summaryrefslogtreecommitdiff
path: root/canvas/source/cairo/cairo_cairo.hxx
diff options
context:
space:
mode:
authorKurt Zenker <kz@openoffice.org>2006-02-28 09:32:56 +0000
committerKurt Zenker <kz@openoffice.org>2006-02-28 09:32:56 +0000
commit07387628f3fd60a13bb4188ffb32e08416e4916e (patch)
tree44ae1a8a1867aa2d36463f06d17520d20bab65db /canvas/source/cairo/cairo_cairo.hxx
parentf22c4fc218112c01971a2687b6a5631638d973ea (diff)
INTEGRATION: CWS cairocanvas (1.1.2); FILE ADDED
2005/12/14 15:38:04 radekdoulik 1.1.2.3: Issue number: #51657 Submitted by: radekdoulik Reviewed by: radekdoulik use vcl to draw text to virtual device created from our pixmaps 2005/09/14 10:50:55 radekdoulik 1.1.2.2: Issue number: #51657 Submitted by: radekdoulik Reviewed by: radekdoulik Sync code in ooo-build with cairo canvas cws 2005/07/07 07:57:54 radekdoulik 1.1.2.1: Issue number: 51657 Submitted by: radekdoulik Reviewed by: radekdoulik initial import of cairo canvas code
Diffstat (limited to 'canvas/source/cairo/cairo_cairo.hxx')
-rw-r--r--canvas/source/cairo/cairo_cairo.hxx82
1 files changed, 82 insertions, 0 deletions
diff --git a/canvas/source/cairo/cairo_cairo.hxx b/canvas/source/cairo/cairo_cairo.hxx
new file mode 100644
index 000000000000..043ff32497ec
--- /dev/null
+++ b/canvas/source/cairo/cairo_cairo.hxx
@@ -0,0 +1,82 @@
+#ifndef _CAIROCANVAS_CAIRO_HXX
+#define _CAIROCANVAS_CAIRO_HXX
+
+namespace cairo {
+
+#include <cairo.h>
+
+ typedef cairo_t Cairo;
+ typedef cairo_matrix_t Matrix;
+ typedef cairo_format_t Format;
+ typedef cairo_content_t Content;
+ typedef cairo_pattern_t Pattern;
+
+ class Surface {
+ const void* mpSysData;
+ void* mpDisplay;
+ long mhDrawable;
+ void *mpRenderFormat;
+ int mnRefCount;
+ bool mbFreePixmap;
+ public:
+ cairo_surface_t* mpSurface;
+
+ Surface( const void* pSysData, void* pDisplay, long hDrawable, void* pRenderFormat, cairo_surface_t* pSurface )
+ : mpSysData( pSysData ),
+ mpDisplay( pDisplay ),
+ mhDrawable( hDrawable ),
+ mpRenderFormat( pRenderFormat ),
+ mpSurface( pSurface ),
+ mbFreePixmap( true ),
+ mnRefCount( 1 )
+ {
+ }
+
+ Surface( cairo_surface_t* pSurface )
+ : mpSurface( pSurface ),
+ mpDisplay( NULL ),
+ mhDrawable( 0 ),
+ mpSysData( NULL ),
+ mbFreePixmap( false ),
+ mnRefCount( 1 )
+ {
+ }
+
+ Surface( const void* pSysData, int x, int y, int width, int height );
+ Surface( const void* pSysData, void *pBmpData, int width, int height );
+
+
+ ~Surface();
+
+ void Ref()
+ {
+ mnRefCount ++;
+ }
+
+ void Unref()
+ {
+ mnRefCount --;
+ if( mnRefCount <= 0 )
+ delete this;
+ }
+
+ Cairo* getCairo()
+ {
+ return cairo_create( mpSurface );
+ }
+
+ Surface* getSimilar( Content aContent, int width, int height );
+
+ long getPixmap()
+ {
+ return mhDrawable;
+ }
+
+ void* getRenderFormat()
+ {
+ return mpRenderFormat;
+ }
+ };
+}
+
+#endif