1 ;; Common Lisp bindings for GTK+ v2.x
2 ;; Copyright 2000-2006 Espen S. Johnsen <espen@users.sf.net>
4 ;; Permission is hereby granted, free of charge, to any person obtaining
5 ;; a copy of this software and associated documentation files (the
6 ;; "Software"), to deal in the Software without restriction, including
7 ;; without limitation the rights to use, copy, modify, merge, publish,
8 ;; distribute, sublicense, and/or sell copies of the Software, and to
9 ;; permit persons to whom the Software is furnished to do so, subject to
10 ;; the following conditions:
12 ;; The above copyright notice and this permission notice shall be
13 ;; included in all copies or substantial portions of the Software.
15 ;; THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
16 ;; EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
17 ;; MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
18 ;; IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
19 ;; CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
20 ;; TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
21 ;; SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
23 ;; $Id: gdktypes.lisp,v 1.28 2007-06-06 10:43:54 espen Exp $
27 (eval-when (:compile-toplevel :load-toplevel :execute)
28 (init-types-in-library gdk "libgdk-2.0" :prefix ("gdk_" "_gdk_"))
29 (init-types-in-library gdk "libgdk_pixbuf-2.0" :prefix "gdk_"))
32 (defclass color (boxed)
48 (:metaclass boxed-class)
52 (deftype point () '(vector int 2))
53 (deftype segment () '(vector int 4))
54 (deftype trapezoid () '(vector double-float 6))
55 (deftype atom () 'unsigned-int)
58 ;; Could this just as well have been a vector?
59 (defclass rectangle (boxed)
72 :accessor rectangle-width
77 :accessor rectangle-height
80 (:metaclass boxed-class))
82 (defclass region (struct)
84 (:metaclass struct-class)
86 (:unref %region-destroy))
89 (register-type 'event-mask '|gdk_event_mask_get_type|)
90 (define-flags-type event-mask
112 (:all-events #x3FFFFE))
114 (register-type 'modifier-type '|gdk_modifier_type_get_type|)
115 (define-flags-type modifier-type
116 :shift :lock :control :mod1 :mod2 :mod3 :mod4 :mod5
117 :button1 :button2 :button3 :button4 :button5
118 (:release #.(ash 1 30)))
121 (define-types-by-introspection "Gdk"
122 ("GdkFunction" :type gc-function)
123 ("GdkWMDecoration" :type wm-decoration)
124 ("GdkWMFunction" :type wm-function)
126 ("GdkGCX11" :type gc-x11)
127 ("GdkGCValuesMask" :type gc-values-mask)
128 ("GdkDrawableImplX11" :ignore t)
129 ("GdkWindowImplX11" :ignore t)
130 ("GdkPixmapImplX11" :ignore t)
131 ("GdkGCX11" :ignore t)
132 ("GdkColor" :ignore t)
133 ("GdkEvent" :ignore t)
134 ("GdkRectangle" :ignore t)
135 ("GdkCursor" :ignore t)
136 ("GdkFont" :ignore t) ; deprecated
137 ("GdkEventMask" :ignore t) ; manually defined
138 ("GdkModifierType" :ignore t) ; manually defined
144 :getter "gdk_display_get_name"
146 :type (copy-of string))
149 :getter display-screens)
152 :getter "gdk_display_list_devices"
153 :reader display-devices
154 :type (copy-of (glist device)))))
156 ;; TODO: add unbound options
161 :getter "gdk_drawable_get_display"
162 :reader drawable-display
166 :getter "gdk_drawable_get_screen"
167 :reader drawable-screen
171 :getter "gdk_drawable_get_visual"
172 :reader drawable-visual
176 :getter "gdk_drawable_get_colormap"
177 :setter "gdk_drawable_set_colormap"
179 :accessor drawable-colormap
184 :getter "gdk_drawable_get_depth"
185 :reader drawable-depth
189 :getter drawable-width)
192 :getter drawable-height)))
198 :getter "gdk_window_get_state"
203 :getter "gdk_window_get_parent"
204 :reader window-parent
208 :getter "gdk_window_get_toplevel"
209 :reader window-toplevel
213 :getter "gdk_window_get_children"
214 :reader window-children
215 :type (glist window))
218 :getter "gdk_window_get_events"
219 :setter "gdk_window_set_events"
220 :accessor window-events
224 :getter "gdk_window_get_group"
225 :setter "gdk_window_set_group"
227 :accessor window-group
229 #?(pkg-exists-p "gtk+-2.0" :atleast-version "2.10.0")
232 :getter "gdk_window_get_type_hint"
233 :setter "gdk_window_set_type_hint"
234 :accessor window-type-hint
235 :type window-type-hint)
236 #?-(pkg-exists-p "gtk+-2.0" :atleast-version "2.10.0")
239 :getter "gdk_window_get_type_hint"
240 :accessor window-type-hint
241 :type window-type-hint)
244 :getter %window-decoration-getter
245 :setter "gdk_window_set_decoration"
246 :boundp %window-decoration-boundp
247 :accessor window-decorations
248 :type wm-decoration))))
251 (deftype bitmap () 'pixmap)
253 (defclass cursor (boxed)
263 :getter "gdk_cursor_get_display"
264 :reader cursor-display
266 (:metaclass boxed-class)
268 (:unref %cursor-unref))
271 (defclass geometry (struct)
274 :accessor geometry-min-width
279 :accessor geometry-min-height
284 :accessor geometry-max-width
289 :accessor geometry-max-height
294 :accessor geometry-base-width
299 :accessor geometry-base-height
300 :initarg :base-height
304 :accessor geometry-width-inc
309 :accessor geometry-height-inc
314 :accessor geometry-min-aspect
319 :accessor geometry-max-aspect
324 :accessor geometry-gravity
327 (:metaclass struct-class))
329 (deftype native-window () '(unsigned 32))