summaryrefslogtreecommitdiff
path: root/src/cairo/cdcairoctx.h
diff options
context:
space:
mode:
authorscuri <scuri>2010-05-12 20:38:46 +0000
committerscuri <scuri>2010-05-12 20:38:46 +0000
commitb7d97c7ed82f0d0472cf0c2ae5d61e99a73b33a8 (patch)
tree0da03500210df1ac835203e2bb83748564e67423 /src/cairo/cdcairoctx.h
parentafaff9e085b51c822f0ce31ac91cc8196bfa5113 (diff)
New Cairo driver
Diffstat (limited to 'src/cairo/cdcairoctx.h')
-rw-r--r--src/cairo/cdcairoctx.h77
1 files changed, 77 insertions, 0 deletions
diff --git a/src/cairo/cdcairoctx.h b/src/cairo/cdcairoctx.h
new file mode 100644
index 0000000..266cfb3
--- /dev/null
+++ b/src/cairo/cdcairoctx.h
@@ -0,0 +1,77 @@
+/** \file
+ * \brief Cairo Base Driver
+ *
+ * See Copyright Notice in cd.h
+ */
+
+#ifndef __CDCAIROCTX_H
+#define __CDCAIROCTX_H
+
+#include <cairo.h>
+
+#include "cd.h"
+#include "cd_private.h"
+
+
+struct _cdCtxImage {
+ unsigned int w, h;
+ double w_mm, h_mm; /* size in mm */
+ double xres, yres; /* resolution in pixels/mm */
+ int bpp;
+ cairo_t* img;
+};
+
+struct _cdCtxCanvas
+{
+ cdCanvas* canvas;
+
+ cairo_t* cr;
+
+ cairo_scaled_font_t* font;
+
+ cairo_pattern_t *pattern, *solid;
+ int last_source;
+
+ char* cairoLastConvertUTF8;
+
+ /* custom attributes */
+
+ int img_format;
+
+ float rotate_angle;
+ int rotate_center_x;
+ int rotate_center_y;
+
+ int poly_holes[500];
+ int holes;
+
+ void* drawable; /* used in NativeWindow in GDK */
+
+#ifdef WIN32
+ void* hWnd; /* used in NativeWindow in Win32 */
+ void* hDC;
+ int isOwnedDC;
+#else
+ void* dpy; /* used in NativeWindow in X11 */
+ unsigned long wnd;
+#endif
+
+ int user_image; /* used in ImageRGB */
+ unsigned char *rgb;
+
+ int eps; /* used in PS */
+
+ cdImage* image_dbuffer; /* Used by double buffer driver */
+ cdCanvas* canvas_dbuffer;
+};
+
+#define cdCairoGetRed(_) (((double)cdRed(_))/255.)
+#define cdCairoGetGreen(_) (((double)cdGreen(_))/255.)
+#define cdCairoGetBlue(_) (((double)cdBlue(_))/255.)
+#define cdCairoGetAlpha(_) (((double)cdAlpha(_))/255.)
+
+cdCtxCanvas *cdcairoCreateCanvas(cdCanvas* canvas, cairo_t* cr);
+void cdcairoInitTable(cdCanvas* canvas);
+void cdcairoKillCanvas(cdCtxCanvas *ctxcanvas);
+
+#endif