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.27 2006-09-05 13:14:10 espen Exp $
27 (eval-when (:compile-toplevel :load-toplevel :execute)
28 (init-types-in-library #.(concatenate 'string
29 (pkg-config:pkg-variable "gtk+-2.0" "libdir")
30 "/libgdk-x11-2.0." asdf:*dso-extension*) :prefix ("gdk_" "_gdk_"))
31 (init-types-in-library #.(concatenate 'string
32 (pkg-config:pkg-variable "gtk+-2.0" "libdir")
33 "/libgdk_pixbuf-2.0." asdf:*dso-extension*) :prefix "gdk_"))
36 (defclass color (boxed)
52 (:metaclass boxed-class)
56 (deftype point () '(vector int 2))
57 (deftype segment () '(vector int 4))
58 (deftype trapezoid () '(vector double-float 6))
59 (deftype atom () 'unsigned-int)
62 ;; Could this just as well have been a vector?
63 (defclass rectangle (boxed)
76 :accessor rectangle-width
81 :accessor rectangle-height
84 (:metaclass boxed-class))
86 (defclass region (struct)
88 (:metaclass struct-class)
90 (:unref %region-destroy))
93 (register-type 'event-mask '|gdk_event_mask_get_type|)
94 (define-flags-type event-mask
116 (:all-events #x3FFFFE))
118 (register-type 'modifier-type '|gdk_modifier_type_get_type|)
119 (define-flags-type modifier-type
120 :shift :lock :control :mod1 :mod2 :mod3 :mod4 :mod5
121 :button1 :button2 :button3 :button4 :button5
122 (:release #.(ash 1 30)))
125 (define-types-by-introspection "Gdk"
126 ("GdkFunction" :type gc-function)
127 ("GdkWMDecoration" :type wm-decoration)
128 ("GdkWMFunction" :type wm-function)
130 ("GdkGCX11" :type gc-x11)
131 ("GdkGCValuesMask" :type gc-values-mask)
132 ("GdkDrawableImplX11" :ignore t)
133 ("GdkWindowImplX11" :ignore t)
134 ("GdkPixmapImplX11" :ignore t)
135 ("GdkGCX11" :ignore t)
136 ("GdkColor" :ignore t)
137 ("GdkEvent" :ignore t)
138 ("GdkRectangle" :ignore t)
139 ("GdkCursor" :ignore t)
140 ("GdkFont" :ignore t) ; deprecated
141 ("GdkEventMask" :ignore t) ; manually defined
142 ("GdkModifierType" :ignore t) ; manually defined
148 :getter "gdk_display_get_name"
150 :type (copy-of string))
153 :getter display-screens)
156 :getter "gdk_display_list_devices"
157 :reader display-devices
158 :type (copy-of (glist device)))))
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))