diff options
author | Nicolas "Pixel" Noble <pixel@nobis-crew.org> | 2010-09-09 01:48:52 +0200 |
---|---|---|
committer | Nicolas "Pixel" Noble <pixel@nobis-crew.org> | 2010-09-09 01:50:25 +0200 |
commit | e9a184546b18cf3b796bd560561f312934004c54 (patch) | |
tree | aa785af9a8d03f8ce276c9e9ecec78397005ec22 /cd/src/cairo/cdcairoctx.h | |
parent | 92efe73791d0998536042bfab5a1babc67d168c7 (diff) |
Upgrading to CD 5.4 - and cleaning up.
Diffstat (limited to 'cd/src/cairo/cdcairoctx.h')
-rw-r--r-- | cd/src/cairo/cdcairoctx.h | 88 |
1 files changed, 88 insertions, 0 deletions
diff --git a/cd/src/cairo/cdcairoctx.h b/cd/src/cairo/cdcairoctx.h new file mode 100644 index 0000000..8d1012c --- /dev/null +++ b/cd/src/cairo/cdcairoctx.h @@ -0,0 +1,88 @@ +/** \file + * \brief Cairo Base Driver + * + * See Copyright Notice in cd.h + */ + +#ifndef __CDCAIROCTX_H +#define __CDCAIROCTX_H + +#include <cairo.h> +#include <pango/pango.h> + +#include "cd.h" +#include "cd_private.h" + +#ifndef __GTK_PRINT_UNIX_DIALOG_H__ +typedef struct _GtkPrintJob GtkPrintJob; +#endif + +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* cr; +}; + +struct _cdCtxCanvas +{ + cdCanvas* canvas; + + cairo_t* cr; + + /* text attributes */ + PangoContext *fontcontext; + PangoFontDescription *fontdesc; + PangoLayout *fontlayout; + char* strLastConvertUTF8; + + /* fill attributes */ + cairo_pattern_t *pattern, *solid; + int last_source; + int hatchboxsize; + + /* 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 in double buffer driver */ + cdCanvas* canvas_dbuffer; + + GtkPrintJob* job; /* used in Printer (UNIX) */ + char* printername; /* used in Printer (Win32) */ +}; + +#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 |