2 #-
(or win32 mswindows windows darwin
)
3 (eval-when (:compile-toplevel
:load-toplevel
:execute
)
4 (cffi:load-foreign-library
"libcairo.so")
5 (cffi:load-foreign-library
"libgthread-2.0.so")
6 (cffi:load-foreign-library
"libgtk-x11-2.0.so"))
9 (eval-when (:compile-toplevel
:load-toplevel
:execute
)
10 (let ((cffi:*foreign-library-directories
*
11 (cons "/opt/local/lib/" cffi
:*foreign-library-directories
*)))
12 (cffi:load-foreign-library
"libcairo.dylib")
13 (cffi:load-foreign-library
"libgthread-2.0.dylib")
14 (cffi:load-foreign-library
"libgtk-x11-2.0.dylib")))
16 #+(or win32 mswindows windows
)
17 (eval-when (:compile-toplevel
:load-toplevel
:execute
)
18 (cffi:load-foreign-library
"libcairo-2.dll")
19 (cffi:load-foreign-library
"libglib-2.0-0.dll")
20 (cffi:load-foreign-library
"libgthread-2.0-0.dll")
21 (cffi:load-foreign-library
"libgobject-2.0-0.dll")
22 (cffi:load-foreign-library
"libgdk-win32-2.0-0.dll")
23 (cffi:load-foreign-library
"libgtk-win32-2.0-0.dll")
24 (cffi:load-foreign-library
"libpangocairo-1.0-0.dll")
25 (cffi:load-foreign-library
"libpango-1.0-0.dll"))
27 ;; user-visible structures
29 (cffi:defcstruct cairo_text_extents
37 (cffi:defcstruct cairo_font_extents
41 (max_x_advance :double
)
42 (max_y_advance :double
))
44 (cffi:defcstruct cairo_glyph
49 (cffi:defcstruct cairo_matrix_t
59 ;; (can't look these up yet, why?)
61 (cffi:defcenum cairo_format_t
62 :argb32
:rgb24
:a8
:a1
)
64 (cffi:defcenum cairo_operator_t
66 :src
:over
:in
:out
:atop
67 :dest
:dest_over
:dest_in
:dest_out
:dest_atop
70 (cffi:defcenum cairo_fill_rule_t
73 (cffi:defcenum cairo_line_cap_t
76 (cffi:defcenum cairo_line_join_t
79 (cffi:defcenum cairo_font_slant_t
80 :normal
:italic
:oblique
)
82 (cffi:defcenum cairo_font_weight_t
85 (cffi:defcenum cairo_status_t
99 :surface_type_mismatch
100 :pattern_type_mismatch
107 (cffi:defcenum cairo_filter_t
108 :fast
:good
:best
:nearest
:bilinear
:gaussian
)
110 (cffi:defcenum cairo_extend_t
111 :none
:repeat
:reflect
)
113 (cffi:defcenum cairo_content_t
114 (:cairo_content_color
#x1000
)
115 (:cairo_content_alpha
#x2000
)
116 (:cairo_content_color_alpha
#x3000
))
118 (cffi:defcenum cairo_antialias_t
119 :CAIRO_ANTIALIAS_DEFAULT
120 :CAIRO_ANTIALIAS_NONE
121 :CAIRO_ANTIALIAS_GRAY
122 :CAIRO_ANTIALIAS_SUBPIXEL
)