1 /////////////////////////////////////////////////////////////////////////////
2 // Name: src/common/cairo.cpp
3 // Purpose: Cairo library
4 // Author: Anthony Betaudeau
6 // RCS-ID: $Id: cairo.cpp 44625 2007-08-25 11:35:04Z VZ $
7 // Copyright: (c) Anthony Bretaudeau
8 // Licence: wxWindows licence
9 /////////////////////////////////////////////////////////////////////////////
12 // For compilers that support precompilation, includes "wx/wx.h".
13 #include "wx/wxprec.h"
24 #include "wx/module.h"
29 wxCairoLibrary
*wxCairoLibrary::s_lib
= NULL
;
31 //----------------------------------------------------------------------------
33 //----------------------------------------------------------------------------
35 wxCairoLibrary::wxCairoLibrary()
40 m_cairo_lib
= new wxDynamicLibrary( wxT("libcairo.so") );
41 m_ok
= m_cairo_lib
->IsLoaded();
47 wxCairoLibrary::~wxCairoLibrary()
53 /* static */ wxCairoLibrary
* wxCairoLibrary::Get()
58 s_lib
= new wxCairoLibrary();
68 /* static */ void wxCairoLibrary::CleanUp()
77 bool wxCairoLibrary::IsOk()
82 void wxCairoLibrary::InitializeMethods()
87 wxDL_METHOD_LOAD( m_cairo_lib
, cairo_arc
, success
)
88 wxDL_METHOD_LOAD( m_cairo_lib
, cairo_arc_negative
, success
)
89 wxDL_METHOD_LOAD( m_cairo_lib
, cairo_clip
, success
)
90 wxDL_METHOD_LOAD( m_cairo_lib
, cairo_close_path
, success
)
91 wxDL_METHOD_LOAD( m_cairo_lib
, cairo_create
, success
)
92 wxDL_METHOD_LOAD( m_cairo_lib
, cairo_curve_to
, success
)
93 wxDL_METHOD_LOAD( m_cairo_lib
, cairo_destroy
, success
)
94 wxDL_METHOD_LOAD( m_cairo_lib
, cairo_fill
, success
)
95 wxDL_METHOD_LOAD( m_cairo_lib
, cairo_fill_preserve
, success
)
96 wxDL_METHOD_LOAD( m_cairo_lib
, cairo_get_target
, success
)
97 wxDL_METHOD_LOAD( m_cairo_lib
, cairo_image_surface_create_for_data
, success
)
98 wxDL_METHOD_LOAD( m_cairo_lib
, cairo_line_to
, success
)
99 wxDL_METHOD_LOAD( m_cairo_lib
, cairo_move_to
, success
)
100 wxDL_METHOD_LOAD( m_cairo_lib
, cairo_new_path
, success
)
101 wxDL_METHOD_LOAD( m_cairo_lib
, cairo_paint
, success
)
102 wxDL_METHOD_LOAD( m_cairo_lib
, cairo_pattern_add_color_stop_rgba
, success
)
103 wxDL_METHOD_LOAD( m_cairo_lib
, cairo_pattern_create_for_surface
, success
)
104 wxDL_METHOD_LOAD( m_cairo_lib
, cairo_pattern_create_linear
, success
)
105 wxDL_METHOD_LOAD( m_cairo_lib
, cairo_pattern_create_radial
, success
)
106 wxDL_METHOD_LOAD( m_cairo_lib
, cairo_pattern_destroy
, success
)
107 wxDL_METHOD_LOAD( m_cairo_lib
, cairo_pattern_set_extend
, success
)
108 wxDL_METHOD_LOAD( m_cairo_lib
, cairo_pattern_set_filter
, success
)
109 wxDL_METHOD_LOAD( m_cairo_lib
, cairo_rectangle
, success
)
110 wxDL_METHOD_LOAD( m_cairo_lib
, cairo_reset_clip
, success
)
111 wxDL_METHOD_LOAD( m_cairo_lib
, cairo_restore
, success
)
112 wxDL_METHOD_LOAD( m_cairo_lib
, cairo_rotate
, success
)
113 wxDL_METHOD_LOAD( m_cairo_lib
, cairo_save
, success
)
114 wxDL_METHOD_LOAD( m_cairo_lib
, cairo_scale
, success
)
115 wxDL_METHOD_LOAD( m_cairo_lib
, cairo_set_dash
, success
)
116 wxDL_METHOD_LOAD( m_cairo_lib
, cairo_set_fill_rule
, success
)
117 wxDL_METHOD_LOAD( m_cairo_lib
, cairo_set_line_cap
, success
)
118 wxDL_METHOD_LOAD( m_cairo_lib
, cairo_set_line_join
, success
)
119 wxDL_METHOD_LOAD( m_cairo_lib
, cairo_set_line_width
, success
)
120 wxDL_METHOD_LOAD( m_cairo_lib
, cairo_set_operator
, success
)
121 wxDL_METHOD_LOAD( m_cairo_lib
, cairo_set_source
, success
)
122 wxDL_METHOD_LOAD( m_cairo_lib
, cairo_set_source_rgba
, success
)
123 wxDL_METHOD_LOAD( m_cairo_lib
, cairo_stroke
, success
)
124 wxDL_METHOD_LOAD( m_cairo_lib
, cairo_stroke_preserve
, success
)
125 wxDL_METHOD_LOAD( m_cairo_lib
, cairo_surface_create_similar
, success
)
126 wxDL_METHOD_LOAD( m_cairo_lib
, cairo_surface_destroy
, success
)
127 wxDL_METHOD_LOAD( m_cairo_lib
, cairo_translate
, success
)
132 //----------------------------------------------------------------------------
134 //----------------------------------------------------------------------------
136 class wxCairoModule
: public wxModule
144 DECLARE_DYNAMIC_CLASS(wxGtkPrintModule
)
147 bool wxCairoModule::OnInit()
152 void wxCairoModule::OnExit()
154 wxCairoLibrary::CleanUp();
157 IMPLEMENT_DYNAMIC_CLASS(wxCairoModule
, wxModule
)