X-Git-Url: http://repo.macrolet.net/gitweb/?a=blobdiff_plain;f=gtk%2Fgtk.widget.lisp;h=a70ec15e704c0547a18577a82b28ad962ea07961;hb=30479689751d0231111787728ac4cf4eab293e0e;hp=0e5def493e6c4c3ef4008c91bdfe3b645cdc8436;hpb=9af0a44db2b9491749a7936c782c3d7ff1b804a3;p=cl-gtk2.git diff --git a/gtk/gtk.widget.lisp b/gtk/gtk.widget.lisp index 0e5def4..a70ec15 100644 --- a/gtk/gtk.widget.lisp +++ b/gtk/gtk.widget.lisp @@ -13,33 +13,33 @@ (export 'widget-flags) (defcstruct %gtk-requisition - (width :int) - (height :int)) + (:width :int) + (:height :int)) (defcstruct %gtk-allocation - (x :int) - (y :int) - (width :int) - (height :int)) + (:x :int) + (:y :int) + (:width :int) + (:height :int)) (defcstruct %gtk-widget - (object %gtk-object) - (private-flags :uint16) - (state state-type) - (saved-state state-type) - (name (:pointer :char)) - (style :pointer) - (requisition %gtk-requisition) - (allocation %gtk-allocation) - (window :pointer) - (parent :pointer)) + (:object %gtk-object) + (:private-flags :uint16) + (:state state-type) + (:saved-state state-type) + (:name (:pointer :char)) + (:style :pointer) + (:requisition %gtk-requisition) + (:allocation %gtk-allocation) + (:window :pointer) + (:parent :pointer)) (defun widget-state (widget) - (foreign-slot-value (pointer widget) '%gtk-widget 'state)) + (foreign-slot-value (pointer widget) '%gtk-widget :state)) (export 'widget-state) (defun widget-saved-state (widget) - (foreign-slot-value (pointer widget) '%gtk-widget 'saved-state)) + (foreign-slot-value (pointer widget) '%gtk-widget :saved-state)) (export 'widget-saved-state) @@ -147,7 +147,7 @@ (accel-signal :string) (accel-group g-object) (accel-key :uint) - (accel-mods gdk-modifier-type) + (accel-mods modifier-type) (accel-flags accel-flags)) (export 'widget-add-accelerator) @@ -156,7 +156,7 @@ (widget g-object) (accel-group g-object) (accel-key :uint) - (accel-mods gdk-modifier-type)) + (accel-mods modifier-type)) (export 'widget-remove-accelerator) @@ -194,8 +194,8 @@ (defcfun gtk-widget-intersect :boolean (widget g-object) - (area (g-boxed-ptr rectangle)) - (intersection (g-boxed-ptr rectangle :in-out))) + (area (g-boxed-foreign rectangle)) + (intersection (g-boxed-foreign rectangle :in-out))) (defun widget-intersect (widget rectangle) (let ((result (make-rectangle :x 0 :y 0 :width 0 :height 0))) @@ -357,7 +357,7 @@ (export 'widget-get-pango-context) -(defcfun (widget-create-pango-layout "gtk_widget_create_pango_layout") (g-object gdk::pango-layout) +(defcfun (widget-create-pango-layout "gtk_widget_create_pango_layout") (g-object gdk::pango-layout :already-referenced) (widget (g-object widget)) (text :string)) @@ -447,8 +447,8 @@ (class (g-type-class-ref type))) (unwind-protect (let ((g-param-spec (gtk-widget-class-find-style-property class property-name))) - (unless g-param-spec (error "Widget ~A has no style-property named '~A'" widget property-name)) - (foreign-slot-value g-param-spec 'gobject::g-param-spec 'gobject::value-type)) + (when (null-pointer-p g-param-spec) (error "Widget ~A has no style-property named '~A'" widget property-name)) + (foreign-slot-value g-param-spec 'gobject:g-param-spec :value-type)) (g-type-class-unref class)))) (defun widget-child-property-value (widget property-name &optional property-type) @@ -541,8 +541,11 @@ (export 'widget-trigger-tooltip-query) -(defcfun (widget-snapshot "gtk_widget_get_snapshot") g-object +(defcfun gtk-widget-get-snapshot g-object (widget g-object) - (clip-rectangle (g-boxed-ptr rectangle))) + (clip-rectangle (g-boxed-foreign rectangle))) + +(defun widget-snapshot (widget &optional clip-rectangle) + (gtk-widget-get-snapshot widget clip-rectangle)) (export 'widget-snapshot) \ No newline at end of file