From 24b69c32a97c006993f4fd5b9e2c0c0ceffea89b Mon Sep 17 00:00:00 2001 From: Andrey Kutejko Date: Sun, 15 Aug 2010 14:08:33 +0300 Subject: [PATCH] added GtkAboutDialog hooks --- gtk/cl-gtk2-gtk.asd | 1 + gtk/gtk.about-dialog.lisp | 60 +++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 61 insertions(+) create mode 100644 gtk/gtk.about-dialog.lisp diff --git a/gtk/cl-gtk2-gtk.asd b/gtk/cl-gtk2-gtk.asd index c825c29..3d09695 100644 --- a/gtk/cl-gtk2-gtk.asd +++ b/gtk/cl-gtk2-gtk.asd @@ -24,6 +24,7 @@ (:file "gtk.functions") (:file "gtk.base-classes") (:file "gtk.dialog") + (:file "gtk.about-dialog") (:file "gtk.window") (:file "gtk.window-group") (:file "gtk.icon-factory") diff --git a/gtk/gtk.about-dialog.lisp b/gtk/gtk.about-dialog.lisp new file mode 100644 index 0000000..2d36cdc --- /dev/null +++ b/gtk/gtk.about-dialog.lisp @@ -0,0 +1,60 @@ +(in-package :gtk) + +(defvar *about-dialog-url-func* nil) + +(defcallback about-dialog-url-func-cb :void + ((dialog (g-object about-dialog)) (link (:string :free-from-foreign nil)) (user-data :pointer)) + (declare (ignore user-data)) + (funcall *about-dialog-url-func* dialog link)) + +(defcallback about-dialog-url-func-destroy-cb :void + ((data :pointer)) + (declare (ignore data)) + (setf *about-dialog-url-func* nil)) + +(defcfun gtk-about-dialog-set-url-hook :void + (func :pointer) + (data :pointer) + (destroy-notify :pointer)) + +(defun (setf about-dialog-global-url-hook) (new-value) + (if new-value + (gtk-about-dialog-set-url-hook (callback about-dialog-url-func-cb) + (null-pointer) + (callback about-dialog-url-func-destroy-cb)) + (gtk-about-dialog-set-url-hook (null-pointer) + (null-pointer) + (null-pointer))) + (setf *about-dialog-url-func* new-value)) + +(export 'about-dialog-global-url-hook) + +(defvar *about-dialog-email-func* nil) + +(defcallback about-dialog-email-func-cb :void + ((dialog (g-object about-dialog)) (link (:string :free-from-foreign nil)) (user-data :pointer)) + (declare (ignore user-data)) + (funcall *about-dialog-email-func* dialog link)) + +(defcallback about-dialog-email-func-destroy-cb :void + ((data :pointer)) + (declare (ignore data)) + (setf *about-dialog-email-func* nil)) + +(defcfun gtk-about-dialog-set-email-hook :void + (func :pointer) + (data :pointer) + (destroy-notify :pointer)) + +(defun (setf about-dialog-global-email-hook) (new-value) + (if new-value + (gtk-about-dialog-set-email-hook (callback about-dialog-email-func-cb) + (null-pointer) + (callback about-dialog-email-func-destroy-cb)) + (gtk-about-dialog-set-email-hook (null-pointer) + (null-pointer) + (null-pointer))) + (setf *about-dialog-email-func* new-value)) + +(export 'about-dialog-global-email-hook) + -- 1.7.10.4