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.19 2005-04-23 16:48:50 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))
86 (define-types-by-introspection "Gdk"
87 ("GdkFunction" :type gc-function)
88 ("GdkWMDecoration" :type wm-decoration)
89 ("GdkWMFunction" :type wm-function)
91 ("GdkGCX11" :type gc-x11)
92 ("GdkGCValuesMask" :type gc-values-mask)
93 ("GdkDrawableImplX11" :ignore t)
94 ("GdkWindowImplX11" :ignore t)
95 ("GdkPixmapImplX11" :ignore t)
96 ("GdkGCX11" :ignore t)
97 ("GdkColor" :ignore t)
98 ("GdkEvent" :ignore t)
99 ("GdkRectngle" :ignore t)
100 ("GdkCursor" :ignore t)
101 ("GdkFont" :ignore t) ; deprecated
102 ("GdkEventMask" :ignore t) ; manually defined
108 :getter "gdk_display_get_name"
110 :type (copy-of string))
113 :getter display-screens)
116 :getter "gdk_display_list_devices"
117 :reader display-devices
118 :type (copy-of (glist device)))))
124 :getter "gdk_drawable_get_display"
125 :reader drawable-display
129 :getter "gdk_drawable_get_screen"
130 :reader drawable-screen
134 :getter "gdk_drawable_get_visual"
135 :reader drawable-visual
139 :getter "gdk_drawable_get_colormap"
140 :setter "gdk_drawable_set_colormap"
142 :accessor drawable-colormap
147 :getter "gdk_drawable_get_depth"
148 :reader drawable-depth
152 :getter drawable-width)
155 :getter drawable-height)))
161 :getter "gdk_window_get_state"
166 :getter "gdk_window_get_parent"
167 :reader window-parent
171 :getter "gdk_window_get_toplevel"
172 :reader window-toplevel
176 :getter "gdk_window_get_children"
177 :reader window-children
178 :type (glist window))
181 :getter "gdk_window_get_events"
182 :setter "gdk_window_set_events"
183 :accessor window-events
187 :getter "gdk_window_get_group"
188 :setter "gdk_window_set_group"
190 :accessor window-group
194 (deftype bitmap () 'pixmap)
196 (defclass cursor (boxed)
206 :getter "gdk_cursor_get_display"
207 :reader cursor-display
209 (:metaclass boxed-class))
212 (defclass geometry (struct)
215 :accessor geometry-min-width
220 :accessor geometry-min-height
225 :accessor geometry-max-width
230 :accessor geometry-max-height
235 :accessor geometry-base-width
240 :accessor geometry-base-height
241 :initarg :base-height
245 :accessor geometry-width-inc
250 :accessor geometry-height-inc
255 :accessor geometry-min-aspect
260 :accessor geometry-max-aspect
265 :accessor geometry-gravity
268 (:metaclass struct-class))