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.24 2006-04-26 09:21:39 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.so") :prefix ("gdk_" "_gdk_"))
31 (init-types-in-library #.(concatenate 'string
32 (pkg-config:pkg-variable "gtk+-2.0" "libdir")
33 "/libgdk_pixbuf-2.0.so") :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 (register-type 'event-mask '|gdk_event_mask_get_type|)
87 (define-flags-type event-mask
109 (:all-events #x3FFFFE))
111 (register-type 'event-mask '|gdk_modifier_type_get_type|)
112 (define-flags-type modifier-type
113 :shift :lock :control :mod1 :mod2 :mod3 :mod4 :mod5
114 :button1 :button2 :button3 :button4 :button5
115 (:release #.(ash 1 30)))
118 (define-types-by-introspection "Gdk"
119 ("GdkFunction" :type gc-function)
120 ("GdkWMDecoration" :type wm-decoration)
121 ("GdkWMFunction" :type wm-function)
123 ("GdkGCX11" :type gc-x11)
124 ("GdkGCValuesMask" :type gc-values-mask)
125 ("GdkDrawableImplX11" :ignore t)
126 ("GdkWindowImplX11" :ignore t)
127 ("GdkPixmapImplX11" :ignore t)
128 ("GdkGCX11" :ignore t)
129 ("GdkColor" :ignore t)
130 ("GdkEvent" :ignore t)
131 ("GdkRectangle" :ignore t)
132 ("GdkCursor" :ignore t)
133 ("GdkFont" :ignore t) ; deprecated
134 ("GdkEventMask" :ignore t) ; manually defined
135 ("GdkModifierType" :ignore t) ; manually defined
141 :getter "gdk_display_get_name"
143 :type (copy-of string))
146 :getter display-screens)
149 :getter "gdk_display_list_devices"
150 :reader display-devices
151 :type (copy-of (glist device)))))
157 :getter "gdk_drawable_get_display"
158 :reader drawable-display
162 :getter "gdk_drawable_get_screen"
163 :reader drawable-screen
167 :getter "gdk_drawable_get_visual"
168 :reader drawable-visual
172 :getter "gdk_drawable_get_colormap"
173 :setter "gdk_drawable_set_colormap"
175 :accessor drawable-colormap
180 :getter "gdk_drawable_get_depth"
181 :reader drawable-depth
185 :getter drawable-width)
188 :getter drawable-height)))
194 :getter "gdk_window_get_state"
199 :getter "gdk_window_get_parent"
200 :reader window-parent
204 :getter "gdk_window_get_toplevel"
205 :reader window-toplevel
209 :getter "gdk_window_get_children"
210 :reader window-children
211 :type (glist window))
214 :getter "gdk_window_get_events"
215 :setter "gdk_window_set_events"
216 :accessor window-events
220 :getter "gdk_window_get_group"
221 :setter "gdk_window_set_group"
223 :accessor window-group
227 (deftype bitmap () 'pixmap)
229 (defclass cursor (boxed)
239 :getter "gdk_cursor_get_display"
240 :reader cursor-display
242 (:metaclass boxed-class)
244 (:unref %cursor-unref))
247 (defclass geometry (struct)
250 :accessor geometry-min-width
255 :accessor geometry-min-height
260 :accessor geometry-max-width
265 :accessor geometry-max-height
270 :accessor geometry-base-width
275 :accessor geometry-base-height
276 :initarg :base-height
280 :accessor geometry-width-inc
285 :accessor geometry-height-inc
290 :accessor geometry-min-aspect
295 :accessor geometry-max-aspect
300 :accessor geometry-gravity
303 (:metaclass struct-class))
305 (deftype native-window () '(unsigned 32))