summaryrefslogtreecommitdiff
path: root/canvas
diff options
context:
space:
mode:
authorKurt Zenker <kz@openoffice.org>2008-04-02 08:40:50 +0000
committerKurt Zenker <kz@openoffice.org>2008-04-02 08:40:50 +0000
commitb3b6e725c265e89590b010bcd391bb40e1596d81 (patch)
tree863cc0e9cd09d390dfdcf6549e131f3ca4417186 /canvas
parent2bfb25f3d229a2b223725f0b71cda8cc52c3f338 (diff)
INTEGRATION: CWS cairoquartz01 (1.3.52); FILE MERGED
2008/03/27 22:50:18 thb 1.3.52.21: Cleaned up a few warnings, made this (almost) build on win32. Still missing the cairo_win32_cairo.cxx file. 2008/02/29 16:37:12 thb 1.3.52.20: Fixed build breakage for X11 case 2008/02/23 13:12:48 mox 1.3.52.19: RESYNC: (1.4-1.5); FILE MERGED 2008/01/18 18:48:31 mox 1.3.52.18: Remove too aggressive namespacing. Broke build with Mac OS X 10.5 Leopard. 2007/12/10 17:34:59 mox 1.3.52.17: Make buildable in Cococa 2007/07/20 10:11:48 mox 1.3.52.16: Cleanup includes and revise code comments 2007/07/19 17:25:50 mox 1.3.52.15: Cleanup - We don't need to store mpSysData inside the Surface (in 1.2 API). 2007/07/19 16:19:02 mox 1.3.52.14: Further cairo win32 backend cleanup. 2007/07/19 07:26:34 mox 1.3.52.13: Legacy cairo API support is not needed on Win32 and Mac OS X Quartz. 2007/07/19 04:35:56 mox 1.3.52.12: Removed platform dependend code from cairo_devicehelper.cxx 2007/07/18 23:07:47 mox 1.3.52.11: Use format converter function to simplify 2007/07/18 22:54:54 mox 1.3.52.10: Cleanup 2007/07/18 21:32:40 radekdoulik 1.3.52.9: Issue number: 69066 Submitted by: radekdoulik Reviewed by: radekdoulik Removed platform dependend code from cairo_canvashelper_text.cxx 2007/07/18 20:48:35 radekdoulik 1.3.52.8: Issue number: 69066 Submitted by: radekdoulik Reviewed by: radekdoulik Fixed xlib backend build. Fixed pixmap double free in xlib backend. Fixed render format generation in xlib backend. 2007/07/17 22:34:42 mox 1.3.52.7: Rework cross-platform files to be separate for each platform. The <1.2 API support is now mostly in platform specific files. 2007/06/19 19:22:15 mox 1.3.52.6: Alternative "legacy" code path for Quartz. 2007/06/10 19:19:21 mox 1.3.52.5: Fix to Cairo 1.2 API usage 2007/06/04 21:13:49 mox 1.3.52.4: Enable building different platforms with both Cairo 1.0 and Cairo 1.2 APIs. Only Quartz uses the Cairo 1.2 API by default. 2007/06/02 23:05:32 thb 1.3.52.3: #i70519# Merged in tml's fixes for WinCairo; made code compile warning-free under Linux; added prex/postx.h (which where already referenced); cleaned up a bit; replaces plain round() call with basegfx::fround; asserting unexpected/unimplemented case at selected places 2007/05/01 21:21:43 mox 1.3.52.2: urther fixes: - separate X11 cairo 1.0 API to legacy file: cairo_cairolegacy.cxx. - maximize the use of crossplatform code - fix quartz bugs 2007/04/12 20:15:58 mox 1.3.52.1: Issue number: #69066# initial Cairo Quartz implementation
Diffstat (limited to 'canvas')
-rw-r--r--canvas/source/cairo/cairo_cairo.hxx77
1 files changed, 67 insertions, 10 deletions
diff --git a/canvas/source/cairo/cairo_cairo.hxx b/canvas/source/cairo/cairo_cairo.hxx
index b00a1815a68c..fcae3d442c68 100644
--- a/canvas/source/cairo/cairo_cairo.hxx
+++ b/canvas/source/cairo/cairo_cairo.hxx
@@ -1,33 +1,72 @@
#ifndef _CAIROCANVAS_CAIRO_HXX
#define _CAIROCANVAS_CAIRO_HXX
-namespace cairo {
-
- bool HasXRender( const void* pSysData );
+#ifdef QUARTZ
+// needed because sysdata.hxx contains native NS* classes
+#include "premac.h"
+#include <Cocoa/Cocoa.h>
+#include "postmac.h"
+#endif
#include <cairo.h>
+#ifdef CAIRO_HAS_WIN32_SURFACE
+// needed because sysdata.hxx contains native types
+#include <tools/prewin.h>
+#include <windows.h>
+#include <tools/postwin.h>
+#undef min
+#undef max
+#endif
+
+#include <vcl/virdev.hxx>
+#include <vcl/sysdata.hxx>
+#include <vcl/bitmap.hxx>
+
+#include <stdio.h>
+
+namespace cairo {
+
+// There are some different code paths with Cairo < 1.2.0 (only supported on XLib)
+#if (CAIRO_VERSION < CAIRO_VERSION_ENCODE(1, 2, 0))
+#define USE_CAIRO10_APIS 1
+#endif
+
typedef cairo_t Cairo;
typedef cairo_matrix_t Matrix;
typedef cairo_format_t Format;
typedef cairo_content_t Content;
typedef cairo_pattern_t Pattern;
+#if defined(CAIRO_HAS_XLIB_SURFACE) && !defined (QUARTZ)
+ bool HasXRender( const void* pSysData );
+#endif
+
class Surface {
+ int mnRefCount;
+#if defined QUARTZ
+ // nothing needed
+#elif defined (CAIRO_HAS_XLIB_SURFACE)
+ #ifdef USE_CAIRO10_APIS
const void* mpSysData;
void* mpDisplay;
long mhDrawable;
void *mpRenderFormat;
- int mnRefCount;
bool mbFreePixmap;
+ #endif
+#elif defined (CAIRO_HAS_WIN32_SURFACE)
+ // nothing needed
+#endif
public:
cairo_surface_t* mpSurface;
+#if defined(USE_CAIRO10_APIS) && defined(CAIRO_HAS_XLIB_SURFACE) && !defined(QUARTZ)
Surface( const void* pSysData, void* pDisplay, long hDrawable, void* pRenderFormat, cairo_surface_t* pSurface );
- Surface( cairo_surface_t* pSurface );
- Surface( const void* pSysData, int x, int y, int width, int height );
- Surface( const void* pSysData, void *pBmpData, int width, int height );
+#endif
+ explicit Surface( cairo_surface_t* pSurface );
+ Surface( const SystemEnvData* pSysData, int x, int y, int width, int height );
+ Surface( const SystemEnvData* pSysData, const BitmapSystemData* pBmpData, int width, int height );
~Surface();
@@ -47,6 +86,14 @@ namespace cairo {
Surface* getSimilar( Content aContent, int width, int height );
+ VirtualDevice* createVirtualDevice();
+ void fillSystemGraphicsData( SystemGraphicsData& data );
+
+ int getDepth();
+
+
+#if defined(CAIRO_HAS_XLIB_SURFACE) && !defined (QUARTZ)
+ #if defined USE_CAIRO10_APIS
long getPixmap()
{
return mhDrawable;
@@ -56,12 +103,22 @@ namespace cairo {
{
return mpRenderFormat;
}
+ #endif
+
+ int getXFormat( Content aContent );
// use only for surfaces made on X Drawables
void Resize( int width, int height );
+#endif
- int getDepth();
- };
-}
+
+#ifdef UNX
+ // Only used by Xlib and the current Mac OS X Quartz implementation
+ void flush(const SystemEnvData* pSysData);
+#endif
+
+ }; // class Surface
+
+} // namespace cairo
#endif