From ef06e5aa777920b2f5ad8f8c69a43f5c5c6f50e8 Mon Sep 17 00:00:00 2001 From: Dmitry Kalyanov Date: Sat, 21 Nov 2009 00:27:15 +0300 Subject: [PATCH] Add gdk-add-client-message-filter --- gdk/gdk.events.lisp | 19 ++++++++++++++++--- 1 file changed, 16 insertions(+), 3 deletions(-) diff --git a/gdk/gdk.events.lisp b/gdk/gdk.events.lisp index 8fd27f6..d3d2b6a 100644 --- a/gdk/gdk.events.lisp +++ b/gdk/gdk.events.lisp @@ -119,9 +119,22 @@ (export 'event-send-client-message-to-all) -;; void gdk_add_client_message_filter (GdkAtom message_type, -;; GdkFilterFunc func, -;; gpointer data); +(defcallback gdk-client-message-filter-func gdk-filter-return + ((xevent :pointer) (event :pointer) (data :pointer)) + (multiple-value-bind (return-value translated-event) (funcall (stable-pointer-value data) xevent) + (when (eq return-value :translate) + (gobject:copy-boxed-slots-to-foreign translated-event event)) + return-value)) + +(defcfun gdk_add_client_message_filter :void + (message-type gdk-atom-as-string) + (func :pointer) + (data :pointer)) + +(defun gdk-add-client-message-filter (message-type fn) + (gdk_add_client_message_filter message-type (callback gdk-client-message-filter-func) (allocate-stable-pointer fn))) + +(export 'gdk-add-client-message-filter) (defcfun gdk-get-show-events :boolean) -- 1.7.10.4