/[cl-cairo2]/tables.lisp
ViewVC logotype

Contents of /tables.lisp

Parent Directory Parent Directory | Revision Log Revision Log


Revision 7 - (show annotations)
Thu Jul 12 14:01:08 2007 UTC (6 years, 9 months ago) by tpapp
File size: 4044 byte(s)
Code cleanup, also added finalizers
1 (in-package :cl-cairo2)
2
3 (defmacro exporting-table (name definition)
4 `(progn
5 (defparameter ,name ,definition)
6 (export ',name)
7 (dolist (i ,name)
8 ; (export (car i))
9 (export (cdr i)))))
10
11 (exporting-table table-format
12 '((:CAIRO_FORMAT_ARGB32 . argb32)
13 (:CAIRO_FORMAT_RGB24 . rgb24)
14 (:CAIRO_FORMAT_A8 . a8)
15 (:CAIRO_FORMAT_A1 . a1)))
16
17 (exporting-table table-antialias
18 '((:CAIRO_ANTIALIAS_DEFAULT . default)
19 (:CAIRO_ANTIALIAS_NONE . none)
20 (:CAIRO_ANTIALIAS_GRAY . gray)
21 (:CAIRO_ANTIALIAS_SUBPIXEL . subpixel)))
22
23 (exporting-table table-fill-rule
24 '((:CAIRO_FILL_RULE_WINDING . winding)
25 (:CAIRO_FILL_RULE_EVEN_ODD . odd)))
26
27 (exporting-table table-line-cap
28 '((:CAIRO_LINE_CAP_BUTT . butt)
29 (:CAIRO_LINE_CAP_ROUND . round)
30 (:CAIRO_LINE_CAP_SQUARE . square)))
31
32 (exporting-table table-line-join
33 '((:CAIRO_LINE_JOIN_MITER . miter)
34 (:CAIRO_LINE_JOIN_ROUND . round)
35 (:CAIRO_LINE_JOIN_BEVEL . bevel)))
36
37 (exporting-table table-operator
38 '((:CAIRO_OPERATOR_CLEAR . clear)
39 (:CAIRO_OPERATOR_SOURCE . source)
40 (:CAIRO_OPERATOR_OVER . over)
41 (:CAIRO_OPERATOR_IN . in)
42 (:CAIRO_OPERATOR_OUT . out)
43 (:CAIRO_OPERATOR_ATOP . atop)
44 (:CAIRO_OPERATOR_DEST . dest)
45 (:CAIRO_OPERATOR_DEST_OVER . dest-over)
46 (:CAIRO_OPERATOR_DEST_IN . dest-in)
47 (:CAIRO_OPERATOR_DEST_OUT . dest-out)
48 (:CAIRO_OPERATOR_DEST_ATOP . dest-atop)
49 (:CAIRO_OPERATOR_XOR . xor)
50 (:CAIRO_OPERATOR_ADD . add)
51 (:CAIRO_OPERATOR_SATURATE . saturate)))
52
53 (exporting-table table-font-slant
54 '((:CAIRO_FONT_SLANT_NORMAL . normal)
55 (:CAIRO_FONT_SLANT_ITALIC . italic)
56 (:CAIRO_FONT_SLANT_OBLIQUE . oblique)))
57
58 (exporting-table table-font-weight
59 '((:CAIRO_FONT_WEIGHT_NORMAL . normal)
60 (:CAIRO_FONT_WEIGHT_BOLD . bold)))
61
62 (exporting-table table-subpixel-order
63 '((:CAIRO_SUBPIXEL_ORDER_DEFAULT . default)
64 (:CAIRO_SUBPIXEL_ORDER_RGB . rgb)
65 (:CAIRO_SUBPIXEL_ORDER_BGR .bgr)
66 (:CAIRO_SUBPIXEL_ORDER_VRGB . vrgb)
67 (:CAIRO_SUBPIXEL_ORDER_VBGR . vbgr)))
68
69 (exporting-table table-hint-style
70 '((:CAIRO_HINT_STYLE_DEFAULT . default)
71 (:CAIRO_HINT_STYLE_NONE . none)
72 (:CAIRO_HINT_STYLE_SLIGHT . slight)
73 (:CAIRO_HINT_STYLE_MEDIUM . medium)
74 (:CAIRO_HINT_STYLE_FULL . full)))
75
76 (exporting-table table-hint-metrics
77 '((:CAIRO_HINT_METRICS_DEFAULT . default)
78 (:CAIRO_HINT_METRICS_OFF . off)
79 (:CAIRO_HINT_METRICS_ON . on)))
80
81 (exporting-table table-status
82 '((:CAIRO_STATUS_SUCCESS . success)
83 (:CAIRO_STATUS_NO_MEMORY . no-memory)
84 (:CAIRO_STATUS_INVALID_RESTORE . invalid-restore)
85 (:CAIRO_STATUS_INVALID_POP_GROUP . invalid-pop-group)
86 (:CAIRO_STATUS_NO_CURRENT_POINT . no-current-point)
87 (:CAIRO_STATUS_INVALID_MATRIX . invalid-matrix)
88 (:CAIRO_STATUS_INVALID_STATUS . invalid-status)
89 (:CAIRO_STATUS_NULL_POINTER . null-pointer)
90 (:CAIRO_STATUS_INVALID_STRING . invalid-string)
91 (:CAIRO_STATUS_INVALID_PATH_DATA . invalid-path-data)
92 (:CAIRO_STATUS_READ_ERROR . read-error)
93 (:CAIRO_STATUS_WRITE_ERROR . write-error)
94 (:CAIRO_STATUS_SURFACE_FINISHED . surface-finished)
95 (:CAIRO_STATUS_SURFACE_TYPE_MISMATCH . surface-type-mismatch)
96 (:CAIRO_STATUS_PATTERN_TYPE_MISMATCH . pattern-type-mismatch)
97 (:CAIRO_STATUS_INVALID_CONTENT . invalid-content)
98 (:CAIRO_STATUS_INVALID_FORMAT . invalid-format)
99 (:CAIRO_STATUS_INVALID_VISUAL . invalid-visual)
100 (:CAIRO_STATUS_FILE_NOT_FOUND . file-not-found)
101 (:CAIRO_STATUS_INVALID_DASH . invalid-dash)
102 (:CAIRO_STATUS_INVALID_DSC_COMMENT . invalid-dsc-comment)
103 (:CAIRO_STATUS_INVALID_INDEX . invalid-index)
104 (:CAIRO_STATUS_CLIP_NOT_REPRESENTABLE . clip-not-representable)))
105
106 (defun lookup-cairo-enum (cairo-enum table)
107 (let ((enum (cdr (assoc cairo-enum table))))
108 (unless enum
109 (error "Could not find ~a in ~a." cairo-enum table))
110 enum))
111
112 (defun lookup-enum (enum table)
113 (let ((cairo-enum (car (rassoc enum table))))
114 (unless cairo-enum
115 (error "Could not find ~a in ~a." cairo-enum table))
116 cairo-enum))

  ViewVC Help
Powered by ViewVC 1.1.5