1 /////////////////////////////////////////////////////////////////////////////
3 // Purpose: Cairo library
4 // Author: Anthony Bretaudeau
6 // RCS-ID: $Id: cairo.h 47254 2007-08-25 10:09:52Z VS $
7 // Copyright: (c) Anthony Bretaudeau
8 // Licence: wxWindows licence
9 /////////////////////////////////////////////////////////////////////////////
11 #ifndef _WX_CAIRO_H_BASE_
12 #define _WX_CAIRO_H_BASE_
21 #include "wx/dynlib.h"
28 static wxCairoLibrary
* Get();
29 static void CleanUp();
36 void InitializeMethods();
39 wxDynamicLibrary
*m_cairo_lib
;
40 wxDynamicLibrary
*m_pango_cairo_lib
;
42 static wxCairoLibrary
*s_lib
;
45 wxDL_VOIDMETHOD_DEFINE( cairo_arc
,
46 (cairo_t
*cr
, double xc
, double yc
, double radius
, double angle1
, double angle2
), (cr
, xc
, yc
, radius
, angle1
, angle2
) )
47 wxDL_VOIDMETHOD_DEFINE( cairo_arc_negative
,
48 (cairo_t
*cr
, double xc
, double yc
, double radius
, double angle1
, double angle2
), (cr
, xc
, yc
, radius
, angle1
, angle2
) )
49 wxDL_VOIDMETHOD_DEFINE( cairo_clip
,
51 wxDL_VOIDMETHOD_DEFINE( cairo_close_path
,
53 wxDL_METHOD_DEFINE( cairo_t
*, cairo_create
,
54 (cairo_surface_t
*target
), (target
), NULL
)
55 wxDL_VOIDMETHOD_DEFINE( cairo_curve_to
,
56 (cairo_t
*cr
, double x1
, double y1
, double x2
, double y2
, double x3
, double y3
), (cr
, x1
, y1
, x2
, y2
, x3
, y3
) )
57 wxDL_VOIDMETHOD_DEFINE( cairo_destroy
,
59 wxDL_VOIDMETHOD_DEFINE( cairo_fill
,
61 wxDL_VOIDMETHOD_DEFINE( cairo_fill_preserve
,
63 wxDL_METHOD_DEFINE( cairo_surface_t
*, cairo_get_target
,
64 (cairo_t
*cr
), (cr
), NULL
)
65 wxDL_METHOD_DEFINE( cairo_surface_t
*, cairo_image_surface_create_for_data
,
66 (unsigned char *data
, cairo_format_t format
, int width
, int height
, int stride
), (data
, format
, width
, height
, stride
), NULL
)
67 wxDL_VOIDMETHOD_DEFINE( cairo_line_to
,
68 (cairo_t
*cr
, double x
, double y
), (cr
, x
, y
) )
69 wxDL_VOIDMETHOD_DEFINE( cairo_move_to
,
70 (cairo_t
*cr
, double x
, double y
), (cr
, x
, y
) )
71 wxDL_VOIDMETHOD_DEFINE( cairo_new_path
,
73 wxDL_VOIDMETHOD_DEFINE( cairo_paint
,
75 wxDL_VOIDMETHOD_DEFINE( cairo_pattern_add_color_stop_rgba
,
76 (cairo_pattern_t
*pattern
, double offset
, double red
, double green
, double blue
, double alpha
), (pattern
, offset
, red
, green
, blue
, alpha
) )
77 wxDL_METHOD_DEFINE( cairo_pattern_t
*, cairo_pattern_create_for_surface
,
78 (cairo_surface_t
*surface
), (surface
), NULL
)
79 wxDL_METHOD_DEFINE( cairo_pattern_t
*, cairo_pattern_create_linear
,
80 (double x0
, double y0
, double x1
, double y1
), (x0
, y0
, x1
, y1
), NULL
)
81 wxDL_METHOD_DEFINE( cairo_pattern_t
*, cairo_pattern_create_radial
,
82 (double cx0
, double cy0
, double radius0
, double cx1
, double cy1
, double radius1
), (cx0
, cy0
, radius0
, cx1
, cy1
, radius1
), NULL
)
83 wxDL_VOIDMETHOD_DEFINE( cairo_pattern_destroy
,
84 (cairo_pattern_t
*pattern
), (pattern
) )
85 wxDL_VOIDMETHOD_DEFINE( cairo_pattern_set_extend
,
86 (cairo_pattern_t
*pattern
, cairo_extend_t extend
), (pattern
, extend
) )
87 wxDL_VOIDMETHOD_DEFINE( cairo_pattern_set_filter
,
88 (cairo_pattern_t
*pattern
, cairo_filter_t filter
), (pattern
, filter
) )
89 wxDL_VOIDMETHOD_DEFINE( cairo_rectangle
,
90 (cairo_t
*cr
, double x
, double y
, double width
, double height
), (cr
, x
, y
, width
, height
) )
91 wxDL_METHOD_DEFINE( void, cairo_reset_clip
,
92 (cairo_t
*cr
), (cr
), /**/)
93 wxDL_METHOD_DEFINE( void, cairo_restore
,
94 (cairo_t
*cr
), (cr
), /**/)
95 wxDL_METHOD_DEFINE( void, cairo_rotate
,
96 (cairo_t
*cr
, double angle
), (cr
, angle
), /**/)
97 wxDL_METHOD_DEFINE( void, cairo_save
,
98 (cairo_t
*cr
), (cr
), /**/)
99 wxDL_METHOD_DEFINE( void, cairo_scale
,
100 (cairo_t
*cr
, double sx
, double sy
), (cr
, sx
, sy
), /**/)
101 wxDL_METHOD_DEFINE( void, cairo_set_dash
,
102 (cairo_t
*cr
, const double *dashes
, int num_dashes
, double offset
), (cr
, dashes
, num_dashes
, offset
), /**/)
103 wxDL_METHOD_DEFINE( void, cairo_set_fill_rule
,
104 (cairo_t
*cr
, cairo_fill_rule_t fill_rule
), (cr
, fill_rule
), /**/)
105 wxDL_METHOD_DEFINE( void, cairo_set_line_cap
,
106 (cairo_t
*cr
, cairo_line_cap_t line_cap
), (cr
, line_cap
), /**/)
107 wxDL_METHOD_DEFINE( void, cairo_set_line_join
,
108 (cairo_t
*cr
, cairo_line_join_t line_join
), (cr
, line_join
), /**/)
109 wxDL_METHOD_DEFINE( void, cairo_set_line_width
,
110 (cairo_t
*cr
, double width
), (cr
, width
), /**/)
111 wxDL_METHOD_DEFINE( void, cairo_set_operator
,
112 (cairo_t
*cr
, cairo_operator_t op
), (cr
, op
), /**/)
113 wxDL_METHOD_DEFINE( void, cairo_set_source
,
114 (cairo_t
*cr
, cairo_pattern_t
*source
), (cr
, source
), /**/)
115 wxDL_METHOD_DEFINE( void, cairo_set_source_rgba
,
116 (cairo_t
*cr
, double red
, double green
, double blue
, double alpha
), (cr
, red
, green
, blue
, alpha
), /**/)
117 wxDL_VOIDMETHOD_DEFINE( cairo_stroke
,
118 (cairo_t
*cr
), (cr
) )
119 wxDL_VOIDMETHOD_DEFINE( cairo_stroke_preserve
,
120 (cairo_t
*cr
), (cr
) )
121 wxDL_METHOD_DEFINE( cairo_surface_t
*, cairo_surface_create_similar
,
122 (cairo_surface_t
*other
, cairo_content_t content
, int width
, int height
), (other
, content
, width
, height
), NULL
)
123 wxDL_VOIDMETHOD_DEFINE( cairo_surface_destroy
,
124 (cairo_surface_t
*surface
), (surface
) )
125 wxDL_VOIDMETHOD_DEFINE( cairo_translate
,
126 (cairo_t
*cr
, double tx
, double ty
), (cr
, tx
, ty
) )
128 wxDL_VOIDMETHOD_DEFINE( pango_cairo_update_layout
,
129 (cairo_t
*cr
, PangoLayout
*layout
), (cr
, layout
) )
130 wxDL_VOIDMETHOD_DEFINE( pango_cairo_show_layout
,
131 (cairo_t
*cr
, PangoLayout
*layout
), (cr
, layout
) )
133 DECLARE_NO_COPY_CLASS(wxCairoLibrary
)