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.29 2008-10-27 18:42:01 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
140 ("GdkAppLaunchContext" :ignore t) ; needs GIO
147 :getter "gdk_display_get_name"
149 :type (copy-of string))
152 :getter display-screens)
155 :getter "gdk_display_list_devices"
156 :reader display-devices
157 :type (copy-of (glist device)))))
159 ;; TODO: add unbound options
164 :getter "gdk_drawable_get_display"
165 :reader drawable-display
169 :getter "gdk_drawable_get_screen"
170 :reader drawable-screen
174 :getter "gdk_drawable_get_visual"
175 :reader drawable-visual
179 :getter "gdk_drawable_get_colormap"
180 :setter "gdk_drawable_set_colormap"
182 :accessor drawable-colormap
187 :getter "gdk_drawable_get_depth"
188 :reader drawable-depth
192 :getter drawable-width)
195 :getter drawable-height)))
201 :getter "gdk_window_get_state"
206 :getter "gdk_window_get_parent"
207 :reader window-parent
211 :getter "gdk_window_get_toplevel"
212 :reader window-toplevel
216 :getter "gdk_window_get_children"
217 :reader window-children
218 :type (glist window))
221 :getter "gdk_window_get_events"
222 :setter "gdk_window_set_events"
223 :accessor window-events
227 :getter "gdk_window_get_group"
228 :setter "gdk_window_set_group"
230 :accessor window-group
232 #?(pkg-exists-p "gtk+-2.0" :atleast-version "2.10.0")
235 :getter "gdk_window_get_type_hint"
236 :setter "gdk_window_set_type_hint"
237 :accessor window-type-hint
238 :type window-type-hint)
239 #?-(pkg-exists-p "gtk+-2.0" :atleast-version "2.10.0")
242 :getter "gdk_window_get_type_hint"
243 :accessor window-type-hint
244 :type window-type-hint)
247 :getter %window-decoration-getter
248 :setter "gdk_window_set_decoration"
249 :boundp %window-decoration-boundp
250 :accessor window-decorations
251 :type wm-decoration))))
254 (deftype bitmap () 'pixmap)
256 (defclass cursor (boxed)
266 :getter "gdk_cursor_get_display"
267 :reader cursor-display
269 (:metaclass boxed-class)
271 (:unref %cursor-unref))
274 (defclass geometry (struct)
277 :accessor geometry-min-width
282 :accessor geometry-min-height
287 :accessor geometry-max-width
292 :accessor geometry-max-height
297 :accessor geometry-base-width
302 :accessor geometry-base-height
303 :initarg :base-height
307 :accessor geometry-width-inc
312 :accessor geometry-height-inc
317 :accessor geometry-min-aspect
322 :accessor geometry-max-aspect
327 :accessor geometry-gravity
330 (:metaclass struct-class))
332 (deftype native-window () '(unsigned 32))