Correct the DEFPACKAGE for GOBJECT to work with recent closer-mop (0.60)
[cl-gtk2.git] / gdk / gdk.objects.lisp
blob78774d5abab3be5f017fac830e42ba8209e95629
1 (in-package :gdk)
3 (define-g-enum "GdkGrabStatus" grab-status () :success :already-grabbed :invalid-time :not-viewable :frozen)
5 (defcenum crossing-mode :normal :grab :ungrab :gtk-grab :gtk-ungrab :state-changed)
6 (export 'crossing-mode)
8 (defcenum notify-type (:ancestor 0) :virtual :inferior :nonlinear :nonlinear-virtual :unknown)
9 (export 'notify-type)
11 (define-g-enum "GdkFillRule"
12 gdk-fill-rule
13 (:export t :type-initializer "gdk_fill_rule_get_type")
14 (:even-odd-rule 0)
15 (:winding-rule 1))
17 (define-g-enum "GdkOverlapType"
18 overlap-type
19 (:export t :type-initializer "gdk_overlap_type_get_type")
20 (:in 0)
21 (:out 1)
22 (:part 2))
24 (define-g-flags "GdkGCValuesMask"
25 gc-values-mask
26 (:export t :type-initializer "gdk_gc_values_mask_get_type")
27 (:foreground 1)
28 (:background 2)
29 (:font 4)
30 (:function 8)
31 (:fill 16)
32 (:tile 32)
33 (:stipple 64)
34 (:clip-mask 128)
35 (:subwindow 256)
36 (:ts-x-origin 512)
37 (:ts-y-origin 1024)
38 (:clip-x-origin 2048)
39 (:clip-y-origin 4096)
40 (:exposures 8192)
41 (:line-width 16384)
42 (:line-style 32768)
43 (:cap-style 65536)
44 (:join-style 131072))
46 (define-g-enum "GdkFunction"
47 gdk-function
48 (:export t :type-initializer "gdk_function_get_type")
49 (:copy 0)
50 (:invert 1)
51 (:xor 2)
52 (:clear 3)
53 (:and 4)
54 (:and-reverse 5)
55 (:and-invert 6)
56 (:noop 7)
57 (:or 8)
58 (:equiv 9)
59 (:or-reverse 10)
60 (:copy-invert 11)
61 (:or-invert 12)
62 (:nand 13)
63 (:nor 14)
64 (:set 15))
66 (define-g-enum "GdkFill"
67 gdk-fill
68 (:export t :type-initializer "gdk_fill_get_type")
69 (:solid 0)
70 (:tiled 1)
71 (:stippled 2)
72 (:opaque-stippled 3))
74 (define-g-enum "GdkSubwindowMode"
75 subwindow-mode
76 (:export t :type-initializer "gdk_subwindow_mode_get_type")
77 (:clip-by-children 0)
78 (:include-inferiors 1))
80 (define-g-enum "GdkLineStyle"
81 line-style
82 (:export t :type-initializer "gdk_line_style_get_type")
83 (:solid 0)
84 (:on-off-dash 1)
85 (:double-dash 2))
87 (define-g-enum "GdkCapStyle"
88 cap-style
89 (:export t :type-initializer "gdk_cap_style_get_type")
90 (:not-last 0)
91 (:butt 1)
92 (:round 2)
93 (:projecting 3))
95 (define-g-enum "GdkJoinStyle"
96 join-style
97 (:export t :type-initializer "gdk_join_style_get_type")
98 (:miter 0)
99 (:round 1)
100 (:bevel 2))
102 (define-g-enum "GdkRgbDither"
103 rgb-dither
104 (:export t :type-initializer "gdk_rgb_dither_get_type")
105 (:none 0)
106 (:normal 1)
107 (:max 2))
109 (define-g-enum "GdkVisualType"
110 visual-type
111 (:export t :type-initializer "gdk_visual_type_get_type")
112 (:static-gray 0)
113 (:grayscale 1)
114 (:static-color 2)
115 (:pseudo-color 3)
116 (:true-color 4)
117 (:direct-color 5))
119 (define-g-enum "GdkByteOrder"
120 byte-order
121 (:export t :type-initializer "gdk_byte_order_get_type")
122 (:lsb-first 0)
123 (:msb-first 1))
125 (define-g-enum "GdkCursorType"
126 gdk-cursor-type
127 (:export t :type-initializer "gdk_cursor_type_get_type")
128 (:x-cursor 0)
129 (:arrow 2)
130 (:based-arrow-down 4)
131 (:based-arrow-up 6)
132 (:boat 8)
133 (:bogosity 10)
134 (:bottom-left-corner 12)
135 (:bottom-right-corner 14)
136 (:bottom-side 16)
137 (:bottom-tee 18)
138 (:box-spiral 20)
139 (:center-ptr 22)
140 (:circle 24)
141 (:clock 26)
142 (:coffee-mug 28)
143 (:cross 30)
144 (:cross-reverse 32)
145 (:crosshair 34)
146 (:diamond-cross 36)
147 (:dot 38)
148 (:dotbox 40)
149 (:double-arrow 42)
150 (:draft-large 44)
151 (:draft-small 46)
152 (:draped-box 48)
153 (:exchange 50)
154 (:fleur 52)
155 (:gobbler 54)
156 (:gumby 56)
157 (:hand1 58)
158 (:hand2 60)
159 (:heart 62)
160 (:icon 64)
161 (:iron-cross 66)
162 (:left-ptr 68)
163 (:left-side 70)
164 (:left-tee 72)
165 (:leftbutton 74)
166 (:ll-angle 76)
167 (:lr-angle 78)
168 (:man 80)
169 (:middlebutton 82)
170 (:mouse 84)
171 (:pencil 86)
172 (:pirate 88)
173 (:plus 90)
174 (:question-arrow 92)
175 (:right-ptr 94)
176 (:right-side 96)
177 (:right-tee 98)
178 (:rightbutton 100)
179 (:rtl-logo 102)
180 (:sailboat 104)
181 (:sb-down-arrow 106)
182 (:sb-h-double-arrow 108)
183 (:sb-left-arrow 110)
184 (:sb-right-arrow 112)
185 (:sb-up-arrow 114)
186 (:sb-v-double-arrow 116)
187 (:shuttle 118)
188 (:sizing 120)
189 (:spider 122)
190 (:spraycan 124)
191 (:star 126)
192 (:target 128)
193 (:tcross 130)
194 (:top-left-arrow 132)
195 (:top-left-corner 134)
196 (:top-right-corner 136)
197 (:top-side 138)
198 (:top-tee 140)
199 (:trek 142)
200 (:ul-angle 144)
201 (:umbrella 146)
202 (:ur-angle 148)
203 (:watch 150)
204 (:xterm 152)
205 (:last-cursor 153)
206 (:blank-cursor -2)
207 (:cursor-is-pixmap -1))
209 (define-g-flags "GdkWindowState"
210 gdk-window-state
211 (:export t :type-initializer "gdk_window_state_get_type")
212 (:withdrawn 1)
213 (:iconified 2)
214 (:maximized 4)
215 (:sticky 8)
216 (:fullscreen 16)
217 (:above 32)
218 (:below 64))
220 ;gdk_display_get_screen
222 (define-g-enum "GdkEventType" event-type ()
223 (:nothing -1) (:delete 0)
224 (:destroy 1) (:expose 2) (:motion-notify 3)
225 (:button-press 4) (:2button-press 5) (:3button-press 6)
226 (:button-release 7) (:key-press 8) (:key-release 9)
227 (:enter-notify 10) (:leave-notify 11) (:focus-change 12)
228 (:configure 13) (:map 14) (:unmap 15) (:property-notify 16)
229 (:selection-clear 17) (:selection-request 18)
230 (:selection-notify 19) (:proximity-in 20)
231 (:proximity-out 21) (:drag-enter 22) (:drag-leave 23)
232 (:drag-motion 24) (:drag-status 25) (:drop-start 26)
233 (:drop-finished 27) (:client-event 28)
234 (:visibility-notify 29) (:no-expose 30) (:scroll 31)
235 (:window-state 32) (:setting 33) (:owner-change 34)
236 (:grab-broken 35) (:damage 36))
238 (define-g-enum "GdkExtensionMode" extension-mode (:export t :type-initializer "gdk_extension_mode_get_type")
239 (:none 0) (:all 1) (:cursor 2))
241 (define-g-enum "GdkWindowTypeHint" gdk-window-type-hint (:export t :type-initializer "gdk_window_type_hint_get_type")
242 (:normal 0) (:dialog 1) (:menu 2) (:toolbar 3)
243 (:splashscreen 4) (:utility 5) (:dock 6) (:desktop 7)
244 (:dropdown-menu 8) (:popup-menu 9) (:tooltip 10)
245 (:notification 11) (:combo 12) (:dnd 13))
247 (define-g-flags "GdkModifierType" modifier-type ()
248 (:shift-mask 1) (:lock-mask 2) (:control-mask 4)
249 (:mod1-mask 8) (:mod2-mask 16) (:mod3-mask 32)
250 (:mod4-mask 64) (:mod5-mask 128)
251 (:button1-mask 256) (:button2-mask 512)
252 (:button3-mask 1024) (:button4-mask 2048)
253 (:button5-mask 4096) (:super-mask 67108864)
254 (:hyper-mask 134217728) (:meta-mask 268435456)
255 (:release-mask 1073741824)
256 (:modifier-mask 1543512063))
258 (define-g-enum "GdkScrollDirection" scroll-direction ()
259 (:up 0) (:down 1)
260 (:left 2) (:right 3))
262 (define-g-enum "GdkVisibilityState" visibility-state ()
263 (:unobscured 0)
264 (:partial 1) (:fully-obscured 2))
266 (define-g-enum "GdkPropertyState" property-state ()
267 :new-value :delete)
269 (define-g-flags "GdkWindowState" window-state ()
270 (:withdrawn 1)
271 (:iconified 2) (:maximized 4) (:sticky 8) (:fullscreen 16)
272 (:above 32) (:below 64))
274 (define-g-enum "GdkSettingAction" setting-action ()
275 (:new 0) (:changed 1)
276 (:deleted 2))
278 (define-g-enum "GdkOwnerChange" owner-change ()
279 (:new-owner 0)
280 (:destroy 1) (:close 2))
282 (define-g-flags "GdkEventMask" event-mask ()
283 (:exposure-mask 2)
284 (:pointer-motion-mask 4) (:pointer-motion-hint-mask 8)
285 (:button-motion-mask 16) (:button1-motion-mask 32)
286 (:button2-motion-mask 64) (:button3-motion-mask 128)
287 (:button-press-mask 256) (:button-release-mask 512)
288 (:key-press-mask 1024) (:key-release-mask 2048)
289 (:enter-notify-mask 4096) (:leave-notify-mask 8192)
290 (:focus-change-mask 16384) (:structure-mask 32768)
291 (:property-change-mask 65536)
292 (:visibility-notify-mask 131072)
293 (:proximity-in-mask 262144) (:proximity-out-mask 524288)
294 (:substructure-mask 1048576) (:scroll-mask 2097152)
295 (:all-events-mask 4194302))
297 (define-g-enum "GdkFontType" font-type () :font :fontset)
299 (define-g-enum "GdkGravity" gravity ()
300 (:north-west 1)
301 :north
302 :north-east
303 :west
304 :center
305 :east
306 :south-west
307 :south
308 :south-east
309 :static)
311 (define-g-enum "GdkWindowType"
312 gdk-window-type
313 (:export t :type-initializer "gdk_window_type_get_type")
314 (:root 0)
315 (:toplevel 1)
316 (:child 2)
317 (:dialog 3)
318 (:temp 4)
319 (:foreign 5)
320 (:offscreen 6))
322 (define-g-enum "GdkWindowClass"
323 gdk-window-class
324 (:export t :type-initializer "gdk_window_class_get_type")
325 (:input-output 0)
326 (:input-only 1))
328 (define-g-flags "GdkWindowHints"
329 gdk-window-hints
330 (:export t :type-initializer "gdk_window_hints_get_type")
331 (:pos 1)
332 (:min-size 2)
333 (:max-size 4)
334 (:base-size 8)
335 (:aspect 16)
336 (:resize-inc 32)
337 (:win-gravity 64)
338 (:user-pos 128)
339 (:user-size 256))
341 (define-g-enum "GdkWindowEdge"
342 gdk-window-edge
343 (:export t :type-initializer "gdk_window_edge_get_type")
344 (:north-west 0)
345 (:north 1)
346 (:north-east 2)
347 (:west 3)
348 (:east 4)
349 (:south-west 5)
350 (:south 6)
351 (:south-east 7))
353 (define-g-flags "GdkWindowAttributesType"
354 gdk-window-attributes-type
355 (:export t :type-initializer "gdk_window_attributes_type_get_type")
356 (:title 2)
357 (:x 4)
358 (:y 8)
359 (:cursor 16)
360 (:colormap 32)
361 (:visual 64)
362 (:wmclass 128)
363 (:noredir 256)
364 (:type-hint 512))
366 (define-g-enum "GdkFilterReturn"
367 gdk-filter-return
368 (:export t :type-initializer "gdk_filter_return_get_type")
369 (:continue 0)
370 (:translate 1)
371 (:remove 2))
373 (define-g-flags "GdkWMDecoration"
374 gdk-w-m-decoration
375 (:export t :type-initializer "gdk_wm_decoration_get_type")
376 (:all 1)
377 (:border 2)
378 (:resizeh 4)
379 (:title 8)
380 (:menu 16)
381 (:minimize 32)
382 (:maximize 64))
384 (define-g-flags "GdkWMFunction"
385 gdk-w-m-function
386 (:export t :type-initializer "gdk_wm_function_get_type")
387 (:all 1)
388 (:resize 2)
389 (:move 4)
390 (:minimize 8)
391 (:maximize 16)
392 (:close 32))
394 (define-g-enum "GdkCursorType" cursor-type (:export t :type-initializer "gdk_cursor_type_get_type")
395 (:x-cursor 0) (:arrow 2) (:based-arrow-down 4)
396 (:based-arrow-up 6) (:boat 8) (:bogosity 10)
397 (:bottom-left-corner 12) (:bottom-right-corner 14)
398 (:bottom-side 16) (:bottom-tee 18) (:box-spiral 20)
399 (:center-ptr 22) (:circle 24) (:clock 26)
400 (:coffee-mug 28) (:cross 30) (:cross-reverse 32)
401 (:crosshair 34) (:diamond-cross 36) (:dot 38)
402 (:dotbox 40) (:double-arrow 42) (:draft-large 44)
403 (:draft-small 46) (:draped-box 48) (:exchange 50)
404 (:fleur 52) (:gobbler 54) (:gumby 56) (:hand1 58)
405 (:hand2 60) (:heart 62) (:icon 64) (:iron-cross 66)
406 (:left-ptr 68) (:left-side 70) (:left-tee 72)
407 (:leftbutton 74) (:ll-angle 76) (:lr-angle 78)
408 (:man 80) (:middlebutton 82) (:mouse 84)
409 (:pencil 86) (:pirate 88) (:plus 90)
410 (:question-arrow 92) (:right-ptr 94)
411 (:right-side 96) (:right-tee 98) (:rightbutton 100)
412 (:rtl-logo 102) (:sailboat 104)
413 (:sb-down-arrow 106) (:sb-h-double-arrow 108)
414 (:sb-left-arrow 110) (:sb-right-arrow 112)
415 (:sb-up-arrow 114) (:sb-v-double-arrow 116)
416 (:shuttle 118) (:sizing 120) (:spider 122)
417 (:spraycan 124) (:star 126) (:target 128)
418 (:tcross 130) (:top-left-arrow 132)
419 (:top-left-corner 134) (:top-right-corner 136)
420 (:top-side 138) (:top-tee 140) (:trek 142)
421 (:ul-angle 144) (:umbrella 146) (:ur-angle 148)
422 (:watch 150) (:xterm 152) (:last-cursor 153)
423 (:blank-cursor -2) (:cursor-is-pixmap -1))
425 (define-g-enum "GdkImageType"
426 gdk-image-type
427 (:export t :type-initializer "gdk_image_type_get_type")
428 (:normal 0)
429 (:shared 1)
430 (:fastest 2))
432 (define-g-enum "GdkPixbufAlphaMode"
433 pixbuf-alpha-mode
434 (:export t :type-initializer "gdk_pixbuf_alpha_mode_get_type")
435 (:bilevel 0)
436 (:full 1))
438 (define-g-enum "GdkColorspace" colorspace ()
439 :rgb)
441 (define-g-enum "GdkAxisUse"
442 axis-use
443 (:export t :type-initializer "gdk_axis_use_get_type")
444 (:ignore 0)
445 (:x 1)
446 (:y 2)
447 (:pressure 3)
448 (:xtilt 4)
449 (:ytilt 5)
450 (:wheel 6)
451 (:last 7))
453 (define-g-enum "GdkDragProtocol"
454 gdk-drag-protocol
455 (:export t :type-initializer "gdk_drag_protocol_get_type")
456 (:motif 0)
457 (:xdnd 1)
458 (:rootwin 2)
459 (:none 3)
460 (:win32-dropfiles 4)
461 (:ole2 5)
462 (:local 6))
464 (define-g-flags "GdkDragAction"
465 gdk-drag-action
466 (:export t :type-initializer "gdk_drag_action_get_type")
467 (:default 1)
468 (:copy 2)
469 (:move 4)
470 (:link 8)
471 (:private 16)
472 (:ask 32))
474 (define-g-enum "GdkInputSource"
475 gdk-input-source
476 (:export t :type-initializer "gdk_input_source_get_type")
477 (:mouse 0)
478 (:pen 1)
479 (:eraser 2)
480 (:cursor 3))
482 (define-g-enum "GdkInputMode"
483 gdk-input-mode
484 (:export t :type-initializer "gdk_input_mode_get_type")
485 (:disabled 0)
486 (:screen 1)
487 (:window 2))
489 (define-g-enum "GdkExtensionMode"
490 gdk-extension-mode
491 (:export t :type-initializer "gdk_extension_mode_get_type")
492 (:none 0)
493 (:all 1)
494 (:cursor 2))
496 (export 'cursor-type)
498 (define-g-boxed-cstruct geometry nil
499 (min-width :int :initform 0)
500 (min-height :int :initform 0)
501 (max-width :int :initform 0)
502 (max-height :int :initform 0)
503 (base-width :int :initform 0)
504 (base-height :int :initform 0)
505 (width-increment :int :initform 0)
506 (height-increment :int :initform 0)
507 (min-aspect :double :initform 0.0d0)
508 (max-aspect :double :initform 0.0d0)
509 (gravity gravity :initform :north-west))
511 (export (boxed-related-symbols 'geometry))
513 (glib:at-init () (foreign-funcall-pointer (foreign-symbol-pointer "gdk_cursor_get_type") () :int))
515 (define-g-boxed-opaque cursor "GdkCursor" :alloc (error "GdkCursor can not be created from Lisp side"))
517 (export (boxed-related-symbols 'cursor))
519 (defctype gdk-atom :pointer)
521 (define-foreign-type gdk-atom-as-string-type ()
523 (:actual-type :pointer)
524 (:simple-parser gdk-atom-as-string))
526 (defmethod translate-from-foreign (value (type gdk-atom-as-string-type))
527 (gdk-atom-name value))
529 (defmethod translate-to-foreign (value (type gdk-atom-as-string-type))
530 (gdk-atom-intern value nil))
532 (define-g-object-class "GdkWindow" gdk-window (:superclass drawable)
533 ((:cffi window-type gdk-window-window-type gdk-window-type
534 "gdk_window_get_window_type" nil)
535 (:cffi is-destroyed gdk-window-is-destroyed :boolean
536 "gdk_window_is_destroyed" nil)
537 (:cffi is-visible gdk-window-is-visible :boolean
538 "gdk_window_is_visible" nil)
539 (:cffi is-viewable gdk-window-is-viewable :boolean
540 "gdk_window_is_viewable" nil)
541 (:cffi state gdk-window-state gdk-window-state
542 "gdk_window_get_state" nil)
543 (:cffi keep-above gdk-window-keep-above :boolean
544 nil "gdk_window_set_keep_above")
545 (:cffi keep-below gdk-window-keep-below :boolean
546 nil "gdk_window_set_keep_below" )
547 (:cffi opacity gdk-window-opacity :double
548 nil "gdk_window_set_opacity")
549 (:cffi composited gdk-window-composited :boolean
550 nil "gdk_window_set_composited")
551 (:cffi user-data gdk-window-user-data :pointer
552 "gdk_window_get_user_data" "gdk_window_set_user_data")
553 (:cffi override-redirect gdk-window-override-redirect :boolean
554 nil "gdk_window_set_override_redirect")
555 (:cffi accept-focus gdk-window-accept-focus :boolean
556 nil "gdk_window_set_accept_focus")
557 (:cffi focus-on-map gdk-window-focus-on-map :boolean
558 nil "gdk_window_set_focus_on_map")
559 (:cffi title gdk-window-title :string
560 nil "gdk_window_set_title")
561 (:cffi background gdk-window-background (g-boxed-foreign color)
562 nil "gdk_window_set_background")
563 (:cffi icon-list gdk-window-icon-list (glib:glist (g-object pixbuf))
564 nil "gdk_window_set_icon_list")
565 (:cffi modal-hint gdk-window-modal-hint :boolean
566 nil "gdk_window_set_modal_hint")
567 (:cffi type-hint gdk-window-type-hint gdk-window-type-hint
568 "gdk_window_get_type_hint" "gdk_window_set_type_hint")
569 (:cffi skip-taskbar-hint gdk-window-skip-taskbar-hint :boolean
570 nil "gdk_window_set_skip_taskbar_hint")
571 (:cffi skip-pager-hint gdk-window-skip-pager-hint :boolean
572 nil "gdk_window_set_skip_pager_hint")
573 (:cffi urgency-hint gdk-window-urgency-hint :boolean
574 nil "gdk_window_set_urgency_hint")
575 (:cffi parent gdk-window-parent (g-object gdk-window)
576 "gdk_window_get_parent" nil)
577 (:cffi toplevel gdk-window-get-toplevel (g-object gdk-window)
578 "gdk_window_get_toplevel" nil)
579 (:cffi children gdk-window-children (glib:glist (g-object gdk-window) :free-from-foreign nil)
580 "gdk_window_peek_children" nil)
581 (:cffi events gdk-window-events event-mask
582 "gdk_window_get_events" "gdk_window_set_events")
583 (:cffi icon-name gdk-window-icon-name :string
584 nil "gdk_window_set_icon_name")
585 (:cffi transient-for gdk-window-transient-for (g-object gdk-window)
586 nil "gdk_window_set_transient_for")
587 (:cffi role gdk-window-role :string
588 nil "gdk_window_set_role")
589 (:cffi startup-id gdk-window-startup-id :string
590 nil "gdk_window_set_startup_id")
591 (:cffi group gdk-window-group (g-object gdk-window)
592 "gdk_window_get_group" "gdk_window_set_group")
593 (:cffi decorations gdk-window-decorations gdk-w-m-decoration
594 gdk-window-get-decorations "gdk_window_set_decorations")
595 (:cffi functions gdk-window-functions gdk-w-m-function
596 nil "gdk_window_set_functions")))
599 ;;;FIXME: Check correct type
600 #+ windows
601 (defctype native-window :pointer)
602 #- windows
603 (defctype native-window :uint32)
605 (define-foreign-type fixed-array ()
606 ((element-type :reader fixed-array-element-type :initarg :element-type :initform (error "Element type must be specified"))
607 (array-size :reader fixed-array-array-size :initarg :array-size :initform (error "Array size must be specified")))
608 (:actual-type :pointer)
609 (:documentation
610 "CFFI foreign type for an array of a fixed length. Slot @code{element-type}@see-slot{fixed-array-element-type} specifies the type of elements and slot @code{array-size}@see-slot{fixed-array-array-size} specifies the size of array (in elements)."))
612 (define-parse-method fixed-array (element-type array-size)
613 (make-instance 'fixed-array :element-type element-type :array-size array-size))
615 (defmethod translate-from-foreign (ptr (type fixed-array))
616 (when (not (null-pointer-p ptr))
617 (let ((result (make-array (fixed-array-array-size type)))
618 (el-type (fixed-array-element-type type)))
619 (loop
620 for i from 0 below (fixed-array-array-size type)
621 do (setf (aref result i) (mem-aref ptr el-type i)))
622 result)))
624 (define-g-boxed-cstruct rectangle "GdkRectangle"
625 (x :int :initform 0)
626 (y :int :initform 0)
627 (width :int :initform 0)
628 (height :int :initform 0))
630 (export (boxed-related-symbols 'rectangle))
632 (define-g-boxed-variant-cstruct event "GdkEvent"
633 (type event-type)
634 (window (g-object gdk-window))
635 (send-event (:boolean :int8))
636 (:variant type
637 ((:key-press :key-release) event-key
638 (time :uint32)
639 (state modifier-type)
640 (keyval :uint)
641 (length :int)
642 (string (:string :free-from-foreign nil
643 :free-to-foreign nil))
644 (hardware-keycode :uint16)
645 (group :uint8)
646 (is-modifier :uint))
647 ((:button-press
648 :2button-press
649 :3button-press
650 :button-release) event-button
651 (time :uint32)
652 (x :double)
653 (y :double)
654 (axes (fixed-array :double 2))
655 (state :uint)
656 (button :uint)
657 (device (g-object device))
658 (x-root :double)
659 (y-root :double))
660 ((:scroll) event-scroll
661 (time :uint32)
662 (x :double)
663 (y :double)
664 (state modifier-type)
665 (direction scroll-direction)
666 (device (g-object device))
667 (x-root :double)
668 (y-root :double))
669 ((:motion-notify) event-motion
670 (time :uint32)
671 (x :double)
672 (y :double)
673 (axes (fixed-array :double 2))
674 (state modifier-type)
675 (is-hint :int16)
676 (device (g-object device))
677 (x-root :double)
678 (y-root :double))
679 ((:expose) event-expose
680 (area rectangle :inline t)
681 (region :pointer)
682 (count :int))
683 ((:visibility-notify) event-visibility
684 (state visibility-state))
685 ((:enter-notify :leave-notify) event-crossing
686 (sub-window (g-object gdk-window))
687 (time :uint32)
688 (x :double)
689 (y :double)
690 (x-root :double)
691 (y-root :double)
692 (mode crossing-mode)
693 (detail notify-type)
694 (focus :boolean)
695 (state :uint))
696 ((:focus-change) event-focus
697 (in :int16))
698 ((:configure) event-configure
699 (x :int)
700 (y :int)
701 (width :int)
702 (height :int))
703 ((:property-notify) event-property
704 (atom gdk-atom)
705 (time :uint32)
706 (state property-state))
707 ((:selection-clear
708 :selection-notify
709 :selection-request) event-selection
710 (selection gdk-atom)
711 (target gdk-atom)
712 (property gdk-atom)
713 (time :uint32)
714 (requestor native-window))
715 ((:drag-enter
716 :drag-leave
717 :drag-motion
718 :drag-status
719 :drop-start
720 :drop-finished) event-dnd
721 (drag-context (g-object drag-context))
722 (time :uint32)
723 (x-root :short)
724 (y-root :short))
725 ((:proximity-in
726 :proximity-out) event-proximity
727 (time :uint32)
728 (device (g-object device)))
729 ((:client-event) event-client
730 (message-time gdk-atom)
731 (data-format :ushort)
732 (:variant data-format
733 (8 event-client-8
734 (data :uchar :count 20))
735 (16 event-client-16
736 (data :ushort :count 10))
737 (32 event-client-32
738 (data :ulong :count 5))))
739 ((:no-expose) event-no-expose)
740 ((:window-state) event-window-state
741 (changed-mask window-state)
742 (new-window-state window-state))
743 ((:setting) event-setting
744 (action setting-action)
745 (name (:string :free-from-foreign nil :free-to-foreign nil)))
746 ((:owner-change) event-owner-change
747 (owner native-window)
748 (reason owner-change)
749 (selection gdk-atom)
750 (time :uint32)
751 (selection-time :uint32))
752 ((:grab-broken) event-grab-broken
753 (keyboard :boolean)
754 (implicit :boolean)
755 (grab-window (g-object gdk-window)))))
757 (export (boxed-related-symbols 'event))
759 (define-g-object-class "GdkDragContext" drag-context ()
760 ((:cffi protocol drag-context-protocol gdk-drag-protocol
761 %gdk-drag-context-get-protocol nil)
762 (:cffi is-source drag-context-is-source :boolean
763 %gdk-drag-context-get-is-source nil)
764 (:cffi source-window drag-context-source-window (g-object gdk-window)
765 %gdk-drag-context-get-source-window nil)
766 (:cffi dest-window drag-context-dest-window (g-object gdk-window)
767 %gdk-drag-context-get-dest-window nil)
768 (:cffi targets drag-context-targets (glib:glist gdk-atom-as-string :free-from-foreign nil)
769 %gdk-drag-context-get-targets nil)
770 (:cffi actions drag-context-actions gdk-drag-action
771 %gdk-drag-context-get-actions nil)
772 (:cffi suggested-action drag-context-suggested-action gdk-drag-action
773 %gdk-drag-context-get-suggested-action nil)
774 (:cffi action drag-context-action gdk-drag-action
775 %gdk-drag-context-get-action nil)
776 (:cffi start-time drag-context-start-time :uint32
777 %gdk-drag-context-get-start-time nil)))
779 (define-g-object-class "GdkPixbuf" pixbuf ()
780 ((colorspace pixbuf-colorspace "colorspace" "GdkColorspace" t nil)
781 (n-channels pixbuf-n-channels "n-channels" "gint" t nil)
782 (has-alpha pixbuf-has-alpha "has-alpha" "gboolean" t nil)
783 (bits-per-sample pixbuf-bits-per-sample "bits-per-sample" "gint" t nil)
784 (width pixbuf-width "width" "gint" t nil)
785 (height pixbuf-height "height" "gint" t nil)
786 (rowstride pixbuf-rowstride "rowstride" "gint" t nil)
787 (pixels pixbuf-pixels "pixels" "gpointer" t nil)))
789 (define-g-object-class "GdkPixbufAnimation" pixbuf-animation ()
790 nil)
792 (define-g-object-class "GdkImage" gdk-image
793 (:superclass g-object :export t :interfaces
794 nil :type-initializer
795 "gdk_image_get_type")
796 ((:cffi colormap gdk-image-colormap (g-object gdk-colormap)
797 "gdk_image_get_colormap" "gdk_image_set_colormap")))
799 (define-g-object-class "GdkDisplay" display ()
800 ((:cffi name display-name (glib:g-string :free-from-foreign nil)
801 "gdk_display_get_name" nil)
802 (:cffi n-screens display-n-screens :int
803 "gdk_display_get_n_screens" nil)
804 (:cffi default-screen display-default-screen (g-object screen)
805 "gdk_display_get_default_screen" nil)
806 (:cffi devices display-devices (glib:glist g-object :free-from-foreign nil)
807 "gdk_display_list_devices" nil)
808 (:cffi supports-cursor-color display-supports-cursor-color :boolean
809 "gdk_display_supports_cursor_color" nil)
810 (:cffi supports-cursor-alpha display-supports-color-alpha :boolean
811 "gdk_display_supports_cursor_alpha" nil)
812 (:cffi default-cursor-size display-default-cursor-size :uint
813 "gdk_display_get_default_cursor_size" nil)
814 (:cffi default-group display-default-group (g-object gdk-window)
815 "gdk_display_get_default_group" nil)
816 (:cffi supports-selection-notification display-supports-selection-notification :boolean
817 "gdk_display_supports_selection_notification" nil)
818 (:cffi supports-clipboard-persistence display-supports-clipboard-persistence :boolean
819 "gdk_display_supports_clipboard_persistence" nil)
820 (:cffi supports-shapes display-supports-shapes :boolean
821 "gdk_display_supports_shapes" nil)
822 (:cffi supports-input-shapes display-supports-input-shapes :boolean
823 "gdk_display_supports_input_shapes" nil)
824 (:cffi supports-composite display-supports-composite :boolean
825 "gdk_display_supports_composite" nil)
826 (:cffi core-pointer display-core-pointer g-object
827 "gdk_display_get_core_pointer" nil)))
829 (define-g-object-class "GdkDisplayManager" display-manager ()
830 ((default-display display-manager-default-display "default-display" "GdkDisplay" t t)
831 (:cffi displays display-manager-displays (glib:gslist (g-object display) :free-from-foreign t)
832 "gdk_display_manager_list_displays" nil)))
834 (define-g-object-class "GdkVisual" visual ()
835 ((:cffi screen visual-screen (g-object screen) "gdk_visual_get_screen" nil)
836 (:cffi visual-type visual-visual-type visual-type gdk-visual-get-visual-type nil)
837 (:cffi depth visual-depth :int gdk-visual-get-depth nil)
838 (:cffi byte-order visual-byte-order byte-order gdk-visual-get-byte-order nil)
839 (:cffi colormap-size visual-colormap-size :int gdk-visual-get-colormap-size nil)
840 (:cffi bits-per-rgb visual-bits-per-rgb :int gdk-visual-get-bits-per-rgb nil)
841 (:cffi red-mask visual-red-mask :uint32 gdk-visual-get-red-mask nil)
842 (:cffi red-shift visual-red-shift :int gdk-visual-get-red-shift nil)
843 (:cffi red-prec visual-red-prec :int gdk-visual-get-red-prec nil)
844 (:cffi green-mask visual-green-mask :uint32 gdk-visual-get-green-mask nil)
845 (:cffi green-shift visual-green-shift :int gdk-visual-get-green-shift nil)
846 (:cffi green-prec visual-green-prec :int gdk-visual-get-green-prec nil)
847 (:cffi blue-mask visual-blue-mask :uint32 gdk-visual-get-blue-mask nil)
848 (:cffi blue-shift visual-blue-shift :int gdk-visual-get-blue-shift nil)
849 (:cffi blue-prec visual-blue-prec :int gdk-visual-get-blue-prec nil)))
851 (define-g-object-class "GdkColormap" gdk-colormap
852 (:superclass g-object :export t :interfaces
853 nil :type-initializer
854 "gdk_colormap_get_type")
855 ((:cffi visual colormap-visual (g-object visual)
856 "gdk_colormap_get_visual" nil)
857 (:cffi screen colormap-screen (g-object screen)
858 "gdk_colormap_get_screeen" nil)))
860 (define-g-object-class "GdkScreen" screen ()
861 ((font-options screen-font-options "font-options" "gpointer" t t)
862 (resolution screen-resolution "resolution" "gdouble" t t)
863 (:cffi default-colormap screen-default-colormap (g-object colormap)
864 "gdk_screen_get_default_colormap" "gdk_screen_set_default_colormap")
865 (:cffi system-colormap screen-system-colormap (g-object colormap)
866 "gdk_screen_get_system_colormap" nil)
867 (:cffi system-visual screen-system-visual (g-object visual)
868 "gdk_screen_get_system_visual" nil)
869 (:cffi rgb-colormap screen-rgb-colormap (g-object colormap)
870 "gdk_screen_get_rgb_colormap" nil)
871 (:cffi rgb-visual screen-visual (g-object visual)
872 "gdk_screen_get_rgb_visual" nil)
873 (:cffi rgba-colormap screen-rgba-colormap (g-object colormap)
874 "gdk_screen_get_rgba_colormap" nil)
875 (:cffi rgba-visual screen-rgba-visual (g-object visual)
876 "gdk_screen_get_rgba_visual" nil)
877 (:cffi composited-p screen-composited-p :boolean
878 "gdk_screen_is_composited" nil)
879 (:cffi root-window screen-root-window (g-object gdk-window)
880 "gdk_screen_get_root_window" nil)
881 (:cffi display screen-display (g-object display)
882 "gdk_screen_get_display" nil)
883 (:cffi number screen-number :int
884 "gdk_screen_get_number" nil)
885 (:cffi width screen-widget :int
886 "gdk_screen_get_width" nil)
887 (:cffi height screen-height :int
888 "gdk_screen_get_height" nil)
889 (:cffi width-mm screen-width-mm :int
890 "gdk_screen_get_width_mm" nil)
891 (:cffi height-mm screen-height-mm :int
892 "gdk_screen_get_height_mm" nil)
893 (:cffi visuals screen-visuals (glib:glist (g-object visual) :free-from-foreign t)
894 "gdk_screen_list_visuals" nil)
895 (:cffi toplevel-windows screen-toplevel-windows (glib:glist (g-object gdk-window) :free-from-foreign t)
896 "gdk_screen_get_toplevel_windows" nil)
897 (:cffi display-name screen-display-name (glib:g-string :free-from-foreign t)
898 "gdk_screen_make_display_name" nil)
899 (:cffi n-monitors screen-n-monitors :int
900 "gdk_screen_get_n_monitors" nil)
901 (:cffi active-window screen-active-window (g-object gdk-window)
902 "gdk_screen_get_active_window" nil)
903 (:cffi window-stack screen-window-stack (glib:glist (g-object gdk-window) :free-from-foreign t)
904 "gdk_screen_get_window_stack" nil)))
906 (defcfun gdk-region-new :pointer)
908 (define-g-boxed-opaque region nil :alloc (gdk-region-new))
910 (export (boxed-related-symbols 'region))
912 (define-g-boxed-cstruct point nil
913 (x :int :initform 0)
914 (y :int :initform 0))
916 (export (boxed-related-symbols 'point))
918 (define-g-boxed-cstruct span nil
919 (x :int :initform 0)
920 (y :int :initform 0)
921 (width :int :initform 0))
923 (export (boxed-related-symbols 'span))
925 (define-g-boxed-cstruct segment nil
926 (x1 :int :initform 0)
927 (y1 :int :initform 0)
928 (x2 :int :initform 0)
929 (y2 :int :initform 0))
931 (export (boxed-related-symbols 'segment))
933 (define-g-boxed-cstruct trapezoid nil
934 (y1 :double :initform 0d0)
935 (x11 :double :initform 0d0)
936 (x21 :double :initform 0d0)
937 (y2 :double :initform 0d0)
938 (x12 :double :initform 0d0)
939 (x22 :double :initform 0d0))
941 (export (boxed-related-symbols 'trapezoid))
943 (define-g-boxed-opaque font "GdkFont"
944 :alloc (error "GDK:FONT objects may not be allocated directly"))
946 (export (boxed-related-symbols 'font))
948 (define-g-boxed-cstruct color "GdkColor"
949 (pixel :uint32 :initform 0)
950 (red :uint16 :initform 0)
951 (green :uint16 :initform 0)
952 (blue :uint16 :initform 0))
954 (export (boxed-related-symbols 'color))
956 (define-g-object-class "GdkGC" graphics-context ()
957 ((:cffi screen graphics-context-screen (g-object screen)
958 "gdk_gc_get_screen" nil)
959 (:cffi foreground graphics-context-foreground (g-boxed-foreign color)
960 nil "gdk_gc_set_foreground")
961 (:cffi background graphics-context-background (g-boxed-foreign color)
962 nil "gdk_gc_set_background")
963 (:cffi rgb-fg-color graphics-context-rgb-fg-color (g-boxed-foreign color)
964 nil "gdk_gc_set_rgb_fg_color")
965 (:cffi rgb-bg-color graphics-context-rgb-bg-color (g-boxed-foreign color)
966 nil "gdk_gc_set_rgb_bg_color")
967 (:cffi font graphics-context-font (g-boxed-foreign font)
968 nil "gdk_gc_set_font")
969 (:cffi function graphics-context-function gdk-function
970 nil "gdk_gc_set_function")
971 (:cffi fill graphics-context-fill gdk-fill
972 nil "gdk_gc_set_fill")
973 (:cffi tile graphics-context-tile (g-object pixmap)
974 nil "gdk_gc_set_tile")
975 (:cffi stipple graphics-context-stipple (g-object pixmap)
976 nil "gdk_gc_set_stipple")
977 (:cffi clip-mask graphics-context-clip-mask (g-object pixmap)
978 nil "gdk_gc_set_clip_mask")
979 (:cffi clip-rectangle graphics-context-clip-rectangle (g-boxed-foreign rectangle)
980 nil "gdk_gc_set_clip_rectangle")
981 (:cffi clip-region graphics-context-clip-region (g-boxed-foreign region)
982 nil "gdk_gc_set_clip_region")
983 (:cffi subwindow graphics-context-subwindow subwindow-mode
984 nil "gdk_gc_set_subwindow")
985 (:cffi exposures graphics-context-exposures :boolean
986 nil "gdk_gc_set_exposures")
987 (:cffi colormap graphics-context-colormap (g-object colormap)
988 "gdk_gc_get_colormap" "gdk_gc_set_colormap")))
990 (define-g-object-class "GdkDrawable" drawable ()
991 ((:cffi display drawable-display (g-object display)
992 "gdk_drawable_get_display" nil)
993 (:cffi screen drawable-screen (g-object screen)
994 "gdk_drawable_get_screen" nil)
995 (:cffi visual drawable-visual (g-object visual)
996 "gdk_drawable_get_visual" nil)
997 (:cffi colormap drawable-colormap (g-object colormap)
998 "gdk_drawable_get_colormap" "gdk_drawable_set_colormap")
999 (:cffi depth drawable-depth :int
1000 "gdk_drawable_get_depth" nil)
1001 (:cffi clip-region drawable-clip-region (g-boxed-foreign region :return)
1002 "gdk_drawable_get_clip_region" nil)
1003 (:cffi visible-region drawable-visible-region (g-boxed-foreign region :return)
1004 "gdk_drawable_get_visible_region" nil)))
1006 (define-g-object-class "GdkPixmap" pixmap (:superclass drawable) ())
1008 (define-g-object-class "GdkKeymap" keymap
1009 (:superclass g-object :export t :interfaces
1010 nil :type-initializer "gdk_keymap_get_type")
1011 ((:cffi direction keymap-direction pango:pango-direction
1012 "gdk_keymap_get_direction" nil)
1013 (:cffi has-bidi-layouts keymap-has-bidi-layouts :boolean
1014 "gdk_keymap_have_bidi_layouts" nil)
1015 (:cffi caps-lock-state keymap-caps-lock-state :boolean
1016 "gdk_keymap_get_caps_lock_state" nil)))
1018 (define-g-boxed-cstruct keymap-key nil
1019 (keycode :uint :initform 0)
1020 (group :int :initform 0)
1021 (level :int :initform 0))
1023 (define-g-boxed-cstruct gdk-window-attr nil
1024 (title (:string :free-from-foreign nil) :initform nil)
1025 (event-mask event-mask :initform nil)
1026 (x :int :initform 0)
1027 (y :int :initform 0)
1028 (width :int :initform 0)
1029 (height :int :initform 0)
1030 (window-class gdk-window-class :initform :input-output)
1031 (visual (g-object visual) :initform nil)
1032 (colormap (g-object colormap) :initform nil)
1033 (window-type gdk-window-type :initform :toplevel)
1034 (cursor (g-object cursor) :initform nil)
1035 (wmclass-name (:string :free-from-foreign nil) :initform nil)
1036 (wmclass-class (:string :free-from-foreign nil) :initform nil)
1037 (override-redirect :boolean :initform nil)
1038 (type-hint gdk-window-type-hint :initform :normal))
1040 (export (boxed-related-symbols 'gdk-window-attr))
1042 (define-g-object-class "GdkDevice" gdk-device
1043 (:superclass g-object :export t :interfaces
1044 nil :type-initializer
1045 "gdk_device_get_type")
1046 ((:cffi name gdk-device-name :string
1047 %gdk-device-name nil)
1048 (:cffi source gdk-device-source gdk-input-source
1049 %gdk-device-source "gdk_device_set_source")
1050 (:cffi mode gdk-device-mode gdk-input-mode
1051 %gdk-device-mode gdk_device_set_mode)
1052 (:cffi has-cursor gdk-device-has-cursor :boolean
1053 %gdk-device-has-cursor nil)
1054 (:cffi n-axes gdk-device-n-axes :int
1055 %gdk-device-n-axes nil)
1056 (:cffi axes gdk-device-axes nil
1057 %gdk-device-axes nil)
1058 (:cffi keys gdk-device-keys nil
1059 %gdk-device-keys nil)
1060 (:cffi n-keys gdk-device-n-keys nil
1061 %gdk-device-n-keys nil)))
1063 (define-g-object-class "GdkAppLaunchContext"
1064 gdk-app-launch-context
1065 (:superclass g-object :export t
1066 :interfaces nil :type-initializer
1067 "gdk_app_launch_context_get_type")
1068 ((:cffi display gdk-app-launch-context-display (g-object display)
1069 nil "gdk_app_launch_context_set_display")
1070 (:cffi screen gdk-app-launch-context-screen (g-object screen)
1071 nil "gdk_app_launch_context_set_screen")
1072 (:cffi desktop gdk-app-launch-context-desktop :int
1073 nil "gdk_app_launch_context_set_desktop")
1074 (:cffi timestamp gdk-app-launch-context-timestamp :uint32
1075 nil "gdk_app_launch_context_set_timestamp")
1076 (:cffi icon gdk-app-launch-context-icon g-object
1077 nil "gdk_app_launch_context_set_icon")
1078 (:cffi icon-name gdk-app-launch-context-icon-name :string
1079 nil "gdk_app_launch_context_set_icon_name"))) ;; TODO: GIcon