From: Dmitry Kalyanov Date: Sat, 31 Oct 2009 00:28:35 +0000 (+0300) Subject: Add GdkScreen X-Git-Url: http://repo.macrolet.net/gitweb/?a=commitdiff_plain;h=6f2df31b829c09eac1300efddc370cb3c18885d0;p=cl-gtk2.git Add GdkScreen --- diff --git a/gdk/cl-gtk2-gdk.asd b/gdk/cl-gtk2-gdk.asd index 4dfee67..77242c5 100644 --- a/gdk/cl-gtk2-gdk.asd +++ b/gdk/cl-gtk2-gdk.asd @@ -8,5 +8,6 @@ (:file "gdk.objects") (:file "gdk.functions") (:file "gdk.general") - (:file "gdk.display")) + (:file "gdk.display") + (:file "gdk.screen")) :depends-on (:cl-gtk2-glib :cffi :cl-gtk2-pango)) \ No newline at end of file diff --git a/gdk/gdk.screen.lisp b/gdk/gdk.screen.lisp new file mode 100644 index 0000000..cbc847e --- /dev/null +++ b/gdk/gdk.screen.lisp @@ -0,0 +1,73 @@ +(in-package :gdk) + +(defcfun gdk-screen-get-monitor-geometry :void + (screen (g-object screen)) + (monitor-num :int) + (dest (g-boxed-foreign rectangle))) + +(defun screen-get-monitor-geometry (screen monitor-num) + (let ((dest (make-rectangle))) + (gdk-screen-get-monitor-geometry screen monitor-num dest) + dest)) + +(export 'screen-get-monitor-geometry) + +(defcfun (screen-get-monitor-at-point "gdk_screen_get_monitor_at_point") :int + (screen (g-object screen)) + (x :int) + (y :int)) + +(export 'screen-get-monitor-at-point) + +(defcfun (screen-get-monitor-at-window "gdk_screen_get_monitor_at_window") :int + (screen (g-object screen)) + (window (g-object gdk-window))) + +(export 'screen-get-monitor-at-window) + +(defcfun (screen-get-monitor-height-mm "gdk_screen_get_monitor_height_mm") :int + (screen (g-object screen)) + (monitor-num :int)) + +(defcfun (screen-get-monitor-width-mm "gdk_screen_get_monitor_width_mm") :int + (screen (g-object screen)) + (monitor-num :int)) + +(export '(screen-get-monitor-height-mm screen-get-monitor-width-mm)) + +(defcfun (screen-get-monitor-plug-name "gdk_screen_get_monitor_plug_name") (glib:g-string :free-from-foreign t) + (screen (g-object screen)) + (monitor-num :int)) + +(export 'screen-get-monitor-plug-name) + +(defcfun (screen-broadcast-client-message "gdk_screen_broadcast_client_message") :void + (screen (g-object screen)) + (event (g-boxed-foreign event))) + +(export 'screen-broadcast-client-message) + +(defcfun gdk-screen-get-setting :boolean + (screen (g-object screen)) + (name :string) + (value :pointer)) + +(defun screen-get-setting (screen name) + (with-foreign-object (value 'g-value) + (g-value-zero value) + (when (gdk-screen-get-setting screen name value) + (prog1 (parse-g-value value) + (g-value-unset value))))) + +(export 'screen-get-setting) + +(defcfun gdk-spawn-command-line-on-screen :boolean + (screen (g-object screen)) + (command-line :string) + (error :pointer)) + +(defun spawn-command-line-on-screen (screen command-line) + (glib:with-g-error (err) + (gdk-spawn-command-line-on-screen screen command-line err))) + +(export 'spawn-command-line-on-screen)