Correct the DEFPACKAGE for GOBJECT to work with recent closer-mop (0.60)
[cl-gtk2.git] / gdk / gdk.display.lisp
blobc7ef13686d68fefccffdfe84649e7a629222a8e2
1 (in-package :gdk)
3 (defcfun (display-open "gdk_display_open") (g-object display)
4 (display-name :string))
5 (export 'display-open)
7 (defcfun (default-display "gdk_display_get_default") (g-object display))
8 (export 'default-display)
10 (defcfun (display-get-screen "gdk_display_get_screen") (g-object screen)
11 (display (g-object display))
12 (screen-num :int))
13 (export 'display-get-screen)
15 (defcfun (display-pointer-ungrab "gdk_display_pointer_ungrab") :void
16 (display (g-object display))
17 (time :uint32))
18 (export 'display-pointer-ungrab)
20 (defcfun (display-keyboard-ungrab "gdk_display_keyboard_ungrab") :void
21 (display (g-object display))
22 (time :uint32))
23 (export 'display-keyboard-ungrab)
25 (defcfun (display-pointer-is-grabbed "gdk_display_pointer_is_grabbed") :boolean
26 (display (g-object display)))
27 (export 'display-pointer-is-grabbed)
29 (defcfun (display-beep "gdk_display_beep") :void
30 (display (g-object display)))
31 (export 'display-beep)
33 (defcfun (display-sync "gdk_display_sync") :void
34 (display (g-object display)))
35 (export 'display-sync)
37 (defcfun (display-flush "gdk_display_flush") :void
38 (display (g-object display)))
39 (export 'display-flush)
41 (defcfun (display-close "gdk_display_close") :void
42 (display (g-object display)))
43 (export 'display-close)
45 (defcfun (display-get-event "gdk_display_get_event") (g-boxed-foreign event :return)
46 (display (g-object display)))
47 (export 'display-get-event)
49 (defcfun (display-peek-event "gdk_display_peek_event") (g-boxed-foreign event :return)
50 (display (g-object display)))
51 (export 'display-peek-event)
53 (defcfun (display-put-event "gdk_display_put_event") :void
54 (display (g-object display))
55 (event (g-boxed-foreign event)))
56 (export 'display-put-event)
58 (defcfun gdk_display_add_client_message_filter :void
59 (display (g-object display))
60 (message-type gdk-atom-as-string)
61 (func :pointer)
62 (data :pointer))
64 (defun dispaly-add-client-message-filter (display message-type fn)
65 (gdk_display_add_client_message_filter display message-type (callback gdk-client-message-filter-func) (allocate-stable-pointer fn)))
67 (export 'display-add-client-message-filter)
69 (defcfun (display-set-double-click-time "gdk_display_set_double_click_time") :void
70 (display (g-object display))
71 (msec :uint))
72 (export 'display-set-double-click-time)
74 (defcfun (display-set-double-click-distance "gdk_display_set_double_click_distance") :void
75 (display (g-object display))
76 (distance :uint))
77 (export 'display-set-double-click-distance)
79 (defcfun gdk-display-get-pointer :void
80 (display (g-object display))
81 (screen :pointer)
82 (x :pointer)
83 (y :pointer)
84 (mask :pointer))
86 (defun display-get-pointer (display)
87 (with-foreign-objects ((screen :pointer) (x :int) (y :int) (mask 'modifier-type))
88 (gdk-display-get-pointer display screen x y mask)
89 (values (mem-ref screen '(g-object screen))
90 (mem-ref x :int)
91 (mem-ref y :int)
92 (mem-ref mask :int))))
93 (export 'display-get-pointer)
95 (defcfun gdk-display-get-window-at-pointer (g-object gdk-window)
96 (display (g-object display))
97 (win-x :pointer)
98 (win-y :pointer))
100 (defun display-get-window-at-pointer (display)
101 (with-foreign-objects ((win-x :int) (win-y :int))
102 (let ((win (gdk-display-get-window-at-pointer display win-x win-y)))
103 (values win (mem-ref win-x :int) (mem-ref win-y :int)))))
105 (export 'display-get-window-at-pointer)
107 ; ignored:
108 ;GdkDisplayPointerHooks * gdk_display_set_pointer_hooks (GdkDisplay *display,
109 ; const GdkDisplayPointerHooks *new_hooks);
111 (defcfun (display-warp-pointer "gdk_display_warp_pointer") :void
112 (display (g-object display))
113 (screen (g-object screen))
114 (x :int)
115 (y :int))
116 (export 'display-warp-pointer)
118 (defcfun gdk-display-get-maximal-cursor-size :void
119 (display (g-object display))
120 (width :pointer)
121 (height :pointer))
123 (defun display-get-maximal-cursor-size (display)
124 (with-foreign-objects ((width :uint) (height :uint))
125 (gdk-display-get-maximal-cursor-size display width height)
126 (values (mem-ref width :uint) (mem-ref height :uint))))
127 (export 'display-get-maximal-cursor-size)
129 (defcfun (display-request-selection-notification "gdk_display_request_selection_notification") :boolean
130 (display (g-object display))
131 (selection gdk-atom-as-string))
132 (export 'display-request-selection-notification)
134 (defcfun gdk-display-store-clipboard :void
135 (display (g-object display))
136 (clipboard-window (g-object gdk-window))
137 (time :uint32)
138 (targets :pointer)
139 (n-targets :int))
141 (defun display-store-clipboard (display clipboard-window time targets)
142 (let ((n-targets (length targets)))
143 (with-foreign-object (targets-ptr 'gdk-atom-as-string n-targets)
144 (loop
145 for str in targets
146 for i from 0
147 do (setf (mem-aref targets-ptr 'gdk-atom-as-string i) str))
148 (gdk-display-store-clipboard display clipboard-window time targets-ptr n-targets))))
149 (export 'display-store-clipboard)
151 (defcfun (display-manager-get "gdk_display_manager_get") (g-object display-manager))
152 (export 'display-manager-get)