Changed so that unknown type defaults to pointer.
[trivial-gtk.git] / cairo-loader.lisp
blob57fd9c00c45a3efa2075251c7ec43a777aede069
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"))
8 #+darwin
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
30 (x_bearing :double)
31 (y_bearing :double)
32 (width :double)
33 (height :double)
34 (x_advance :double)
35 (y_advance :double))
37 (cffi:defcstruct cairo_font_extents
38 (ascent :double)
39 (descent :double)
40 (height :double)
41 (max_x_advance :double)
42 (max_y_advance :double))
44 (cffi:defcstruct cairo_glyph
45 (index :unsigned-int)
46 (x :double)
47 (y :double))
49 (cffi:defcstruct cairo_matrix_t
50 (xx :double)
51 (yx :double)
52 (xy :double)
53 (yy :double)
54 (x0 :double)
55 (y0 :double))
58 ;; enums
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
65 :clear
66 :src :over :in :out :atop
67 :dest :dest_over :dest_in :dest_out :dest_atop
68 :xor :add :saturate)
70 (cffi:defcenum cairo_fill_rule_t
71 :winding :even_odd)
73 (cffi:defcenum cairo_line_cap_t
74 :butt :round :square)
76 (cffi:defcenum cairo_line_join_t
77 :miter :round :bevel)
79 (cffi:defcenum cairo_font_slant_t
80 :normal :italic :oblique)
82 (cffi:defcenum cairo_font_weight_t
83 :normal :bold)
85 (cffi:defcenum cairo_status_t
86 :success
87 :no_memory
88 :invalid_restore
89 :invalid_pop_group
90 :no_current_point
91 :invalid_matrix
92 :invalid_status
93 :null_pointer
94 :invalid_string
95 :invalid_path_data
96 :read_error
97 :write_error
98 :surface_finished
99 :surface_type_mismatch
100 :pattern_type_mismatch
101 :invalid_content
102 :invalid_format
103 :invalid_visual
104 :file_not_found
105 :invalid_dash)
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)