1 ;; Common Lisp bindings for GTK+ v2.x
2 ;; Copyright 2000-2005 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.20 2005-04-24 13:29:36 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)
51 :type unsigned-short))
52 (:metaclass boxed-class))
55 (deftype point () '(vector int 2))
56 (deftype segment () '(vector int 4))
57 (deftype trapezoid () '(vector double-float 6))
58 (deftype atom () 'unsigned-int)
61 ;; Could this just as well have been a vector?
62 (defclass rectangle (boxed)
75 :accessor rectangle-width
80 :accessor rectangle-height
83 (:metaclass boxed-class))
88 (define-types-by-introspection "Gdk"
89 ("GdkFunction" :type gc-function)
90 ("GdkWMDecoration" :type wm-decoration)
91 ("GdkWMFunction" :type wm-function)
93 ("GdkGCX11" :type gc-x11)
94 ("GdkGCValuesMask" :type gc-values-mask)
95 ("GdkDrawableImplX11" :ignore t)
96 ("GdkWindowImplX11" :ignore t)
97 ("GdkPixmapImplX11" :ignore t)
98 ("GdkGCX11" :ignore t)
99 ("GdkColor" :ignore t)
100 ("GdkEvent" :ignore t)
101 ("GdkRectngle" :ignore t)
102 ("GdkCursor" :ignore t)
103 ("GdkFont" :ignore t) ; deprecated
104 ("GdkEventMask" :ignore t) ; manually defined
105 ("GdkModifierType" :ignore t) ; manually defined
111 :getter "gdk_display_get_name"
113 :type (copy-of string))
116 :getter display-screens)
119 :getter "gdk_display_list_devices"
120 :reader display-devices
121 :type (copy-of (glist device)))))
127 :getter "gdk_drawable_get_display"
128 :reader drawable-display
132 :getter "gdk_drawable_get_screen"
133 :reader drawable-screen
137 :getter "gdk_drawable_get_visual"
138 :reader drawable-visual
142 :getter "gdk_drawable_get_colormap"
143 :setter "gdk_drawable_set_colormap"
145 :accessor drawable-colormap
150 :getter "gdk_drawable_get_depth"
151 :reader drawable-depth
155 :getter drawable-width)
158 :getter drawable-height)))
164 :getter "gdk_window_get_state"
169 :getter "gdk_window_get_parent"
170 :reader window-parent
174 :getter "gdk_window_get_toplevel"
175 :reader window-toplevel
179 :getter "gdk_window_get_children"
180 :reader window-children
181 :type (glist window))
184 :getter "gdk_window_get_events"
185 :setter "gdk_window_set_events"
186 :accessor window-events
190 :getter "gdk_window_get_group"
191 :setter "gdk_window_set_group"
193 :accessor window-group
197 (deftype bitmap () 'pixmap)
199 (defclass cursor (boxed)
209 :getter "gdk_cursor_get_display"
210 :reader cursor-display
212 (:metaclass boxed-class))
215 (defclass geometry (struct)
218 :accessor geometry-min-width
223 :accessor geometry-min-height
228 :accessor geometry-max-width
233 :accessor geometry-max-height
238 :accessor geometry-base-width
243 :accessor geometry-base-height
244 :initarg :base-height
248 :accessor geometry-width-inc
253 :accessor geometry-height-inc
258 :accessor geometry-min-aspect
263 :accessor geometry-max-aspect
268 :accessor geometry-gravity
271 (:metaclass struct-class))
273 (define-flags-type modifier-type
274 :shift :lock :control :mod1 :mod2 :mod3 :mod4 :mod5
275 :button1 :button2 :button3 :button4 :button5
276 (:release #.(ash 1 30)))