X-Git-Url: https://git.distorted.org.uk/~mdw/clg/blobdiff_plain/e69138cc4765ff17951dc3166c5ca3bcac57368c..c1ef6223c98f5b5401d07ee5c6636b509cb6098e:/gtk/gtk.lisp?ds=sidebyside diff --git a/gtk/gtk.lisp b/gtk/gtk.lisp index 2b117e5..92490c8 100644 --- a/gtk/gtk.lisp +++ b/gtk/gtk.lisp @@ -20,7 +20,7 @@ ;; TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE ;; SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -;; $Id: gtk.lisp,v 1.44 2005/04/25 18:20:00 espen Exp $ +;; $Id: gtk.lisp,v 1.53 2006/02/16 19:39:34 espen Exp $ (in-package "GTK") @@ -45,7 +45,7 @@ (format nil "Gtk+ v~A.~A.~A" major minor micro)))) (defun clg-version () - "clg CVS version") + "clg 0.91 version") ;;;; Initalization @@ -57,6 +57,11 @@ (defun clg-init (&optional display) "Initializes the system and starts the event handling" + #+sbcl(when (and + (find-package "SWANK") + (eq (symbol-value (find-symbol "*COMMUNICATION-STYLE*" "SWANK")) :spawn)) + (error "When running clg in Slime the communication style :spawn can not be used. See the README file and for more information.")) + (unless (gdk:display-get-default) (gdk:gdk-init) (unless (gtk-init) @@ -701,6 +706,16 @@ new-order) (vector int))) +#+gtk2.8 +(progn + (defbinding %dialog-get-response-for-widget () int + (dialog dialog) + (widget widget)) + + (defun dialog-get-response-for-widget (dialog widget) + (dialog-find-response dialog (dialog-get-response-for-widget dialog widget)))) + + (defmethod container-add ((dialog dialog) (child widget) &rest args) (apply #'container-add (dialog-vbox dialog) child args)) @@ -925,6 +940,11 @@ ((or list vector) (make-instance 'image :pixmap source)) (gdk:pixmap (make-instance 'image :pixmap source :mask mask)))) +#+gtk2.8 +(defbinding image-clear () nil + (image image)) + + ;;; Image menu item @@ -1076,13 +1096,14 @@ ;;; Message dialog -(defmethod initialize-instance ((dialog message-dialog) - &key (message-type :info) (buttons :close) - flags text #+gtk 2.6 secondary-text - transient-parent) - (setf - (slot-value dialog 'location) - (%message-dialog-new transient-parent flags message-type buttons)) +(defmethod allocate-foreign ((dialog message-dialog) &key (message-type :info) + (buttons :close) flags transient-parent) + (%message-dialog-new transient-parent flags message-type buttons)) + + +(defmethod shared-initialize ((dialog message-dialog) names + &key text #+gtk 2.6 secondary-text) + (declare (ignore names)) (when text (message-dialog-set-markup dialog text)) #+gtk2.6 @@ -1270,9 +1291,24 @@ (window window) (event gdk:key-event)) +#-gtk2.8 (defbinding window-present () nil (window window)) +#+gtk2.8 +(progn + (defbinding %window-present () nil + (window window)) + + (defbinding %window-present-with-time () nil + (window window) + (timespamp unsigned-int)) + + (defun window-present (window &optional timestamp) + (if timestamp + (%window-present-with-time window timestamp) + (%window-present window)))) + (defbinding window-iconify () nil (window window)) @@ -1336,7 +1372,7 @@ (window window) (left int :out) (top int :out) (rigth int :out) (bottom int :out)) -(defbinding %window-get-icon-list () (glist gdk:pixbuf) +(defbinding %window-get-icon-list () (glist (copy-of gdk:pixbuf)) (window window)) (defbinding window-get-position () nil @@ -1556,7 +1592,7 @@ (defbinding notebook-reorder-child (notebook child position) nil (notebook notebook) (child widget) - ((%notebook-position notebook position) int)) + ((%ensure-notebook-position notebook position) int)) (defbinding notebook-popup-enable () nil (notebook notebook)) @@ -1623,7 +1659,7 @@ (defbinding notebook-query-tab-label-packing (notebook page) nil (notebook notebook) - ((%notebook-child notebook page) widget) + ((%ensure-notebook-child notebook page) widget) (expand boolean :out) (fill boolean :out) (pack-type pack-type :out)) @@ -1631,7 +1667,7 @@ (defbinding notebook-set-tab-label-packing (notebook page expand fill pack-type) nil (notebook notebook) - ((%notebook-child notebook page) widget) + ((%ensure-notebook-child notebook page) widget) (expand boolean) (fill boolean) (pack-type pack-type)) @@ -2201,7 +2237,7 @@ (defun stock-lookup (stock-id) (let ((location - (allocate-memory (proxy-instance-size (find-class 'stock-item))))) + (allocate-memory (foreign-size (find-class 'stock-item))))) (unwind-protect (when (%stock-lookup stock-id location) (ensure-proxy-instance 'stock-item (%stock-item-copy location)))