3 (defcfun gdk-screen-get-monitor-geometry
:void
4 (screen (g-object screen
))
6 (dest (g-boxed-foreign rectangle
)))
8 (defun screen-get-monitor-geometry (screen monitor-num
)
9 (let ((dest (make-rectangle)))
10 (gdk-screen-get-monitor-geometry screen monitor-num dest
)
13 (export 'screen-get-monitor-geometry
)
15 (defcfun (screen-get-monitor-at-point "gdk_screen_get_monitor_at_point") :int
16 (screen (g-object screen
))
20 (export 'screen-get-monitor-at-point
)
22 (defcfun (screen-get-monitor-at-window "gdk_screen_get_monitor_at_window") :int
23 (screen (g-object screen
))
24 (window (g-object gdk-window
)))
26 (export 'screen-get-monitor-at-window
)
28 (defcfun (screen-get-monitor-height-mm "gdk_screen_get_monitor_height_mm") :int
29 (screen (g-object screen
))
32 (defcfun (screen-get-monitor-width-mm "gdk_screen_get_monitor_width_mm") :int
33 (screen (g-object screen
))
36 (export '(screen-get-monitor-height-mm screen-get-monitor-width-mm
))
38 (defcfun (screen-get-monitor-plug-name "gdk_screen_get_monitor_plug_name") (glib:g-string
:free-from-foreign t
)
39 (screen (g-object screen
))
42 (export 'screen-get-monitor-plug-name
)
44 (defcfun (screen-broadcast-client-message "gdk_screen_broadcast_client_message") :void
45 (screen (g-object screen
))
46 (event (g-boxed-foreign event
)))
48 (export 'screen-broadcast-client-message
)
50 (defcfun gdk-screen-get-setting
:boolean
51 (screen (g-object screen
))
55 (defun screen-get-setting (screen name
)
56 (with-foreign-object (value 'g-value
)
58 (when (gdk-screen-get-setting screen name value
)
59 (prog1 (parse-g-value value
)
60 (g-value-unset value
)))))
62 (export 'screen-get-setting
)
64 (defcfun gdk-spawn-command-line-on-screen
:boolean
65 (screen (g-object screen
))
66 (command-line :string
)
69 (defun spawn-command-line-on-screen (screen command-line
)
70 (glib:with-g-error
(err)
71 (gdk-spawn-command-line-on-screen screen command-line err
)))
73 (export 'spawn-command-line-on-screen
)
75 (defcfun gdk_spawn_on_screen
:boolean
76 (screen (g-object screen
))
77 (working-directory :string
)
80 (flags glib
:g-spawn-flags
)
81 (child-setup :pointer
)
83 (child-pid (:pointer
:int
))
86 (defcfun gdk_spawn_on_screen_with_pipes
:boolean
87 (screen (g-object screen
))
88 (working-directory :string
)
91 (flags glib
:g-spawn-flags
)
92 (child-setup :pointer
)
94 (child-pid (:pointer
:int
))
95 (std-input (:pointer
:int
))
96 (std-output (:pointer
:int
))
97 (std-err (:pointer
:int
))
100 (defmacro with-foreign-string-array
((var strings
&key
(null-terminated t
)) &body body
)
101 (let ((strings-var (gensym))
105 `(let* ((,strings-var
,strings
)
106 (,n
(length ,strings-var
)))
107 (with-foreign-object (,var
:pointer
,(if null-terminated
`(1+ ,n
) `,n
))
108 (iter (for ,s in
,strings-var
)
110 (setf (mem-aref ,var
:pointer
,i
) (foreign-string-alloc ,s
))
111 ,@(when null-terminated
112 (list `(finally (setf (mem-aref ,var
:pointer
,n
) (null-pointer))))))
113 (unwind-protect (progn ,@body
)
114 (iter (for ,i from
0 below
,n
)
115 (foreign-string-free (mem-aref ,var
:pointer
,i
))))))))
117 (defun gdk-spawn-on-screen (screen argv
&key working-directory env
(flags '(:search-path
)) with-pipes
)
118 (unless working-directory
(setf working-directory
(null-pointer)))
119 (glib:with-g-error
(err)
120 (with-foreign-objects ((pid :int
) (stdin :int
) (stdout :int
) (stderr :int
))
121 (with-foreign-string-array (argvp argv
)
124 (gdk_spawn_on_screen_with_pipes screen
131 pid stdin stdout stderr err
)
132 (gdk_spawn_on_screen screen
140 (with-foreign-string-array (envp env
)
142 (gdk_spawn_on_screen_with_pipes screen
145 (null-pointer) (null-pointer)
146 pid stdin stdout stderr err
)
147 (gdk_spawn_on_screen screen
150 flags
(null-pointer) (null-pointer)
153 (values (mem-ref pid
:int
) (mem-ref stdin
:int
) (mem-ref stdout
:int
) (mem-ref stderr
:int
))
154 (mem-ref pid
:int
)))))
156 (export 'gdk-spawn-on-screen
)