+(export 'widget-queue-resize)
+
+(defcfun (widget-queue-resize-no-redraw "gtk_widget_queue_resize_no_redraw") :void
+ (widget (g-object widget)))
+
+(export 'widget-queue-resize-no-redraw)
+
+; TODO: gtk_widget_get_child_requisition
+
+; TODO: gtk_widget_size_allocate
+
+(defcfun (widget-add-accelerator "gtk_widget_add_accelerator") :void
+ (widget g-object)
+ (accel-signal :string)
+ (accel-group g-object)
+ (accel-key :uint)
+ (accel-mods modifier-type)
+ (accel-flags accel-flags))
+
+(export 'widget-add-accelerator)
+
+(defcfun (widget-remove-accelerator "gtk_widget_remove_accelerator") :void
+ (widget g-object)
+ (accel-group g-object)
+ (accel-key :uint)
+ (accel-mods modifier-type))
+
+(export 'widget-remove-accelerator)
+
+(defcfun (widget-set-accel-path "gtk_widget_set_accel_path") :void
+ (widget g-object)
+ (accel-path :string)
+ (accel-group g-object))
+
+(export 'widget-set-accel-path)
+
+; TODO: gtk_widget_list_accel_closures
+
+(defcfun gtk-widget-can-activate-accel :boolean
+ (widget g-object)
+ (signal-id :uint))
+
+(defun widget-can-activate-accel (widget signal)
+ (when (stringp signal) (setf signal (g-signal-lookup signal (g-type-from-object widget))))
+ (gtk-widget-can-activate-accel widget signal))
+
+(export 'widget-can-activate-accel)
+
+(defcfun (widget-event "gtk_widget_event") :boolean
+ (widget (g-object widget))
+ (event (g-boxed-foreign event)))
+
+(export 'widget-event)
+
+(defcfun (widget-activate "gtk_widget_activate") :boolean
+ (widget g-object))
+
+(export 'widget-activate)
+
+(defcfun (widget-reparent "gtk_widget_reparent") :void
+ (widget g-object)
+ (new-parent g-object))
+
+(export 'widget-reparent)
+
+(defcfun gtk-widget-intersect :boolean
+ (widget g-object)
+ (area (g-boxed-foreign rectangle))
+ (intersection (g-boxed-foreign rectangle)))
+
+(defun widget-intersect (widget rectangle)
+ (let ((result (make-rectangle)))
+ (when (gtk-widget-intersect widget rectangle result)
+ result)))
+
+(export 'widget-intersect)
+
+(defcfun (widget-focus-p "gtk_widget_is_focus") :boolean
+ (widget g-object))
+
+(export 'widget-focus-p)
+
+(defcfun (widget-grab-focus "gtk_widget_grab_focus") :void
+ (widget g-object))
+
+(export 'widget-grab-focus)
+
+(defcfun (widget-grab-default "gtk_widget_grab_default") :void
+ (widget g-object))
+
+(export 'widget-grab-default)
+
+(defcfun (widget-set-state "gtk_widget_set_state") :void
+ (widget (g-object widget))
+ (state state-type))
+
+(export 'widget-set-state)
+
+(defcfun (widget-ancestor "gtk_widget_get_ancestor") (g-object widget)
+ (widget (g-object widget))
+ (type g-type-designator))
+
+(export 'widget-ancestor)
+
+(defcfun gtk-widget-get-pointer :void
+ (widget g-object)
+ (x (:pointer :int))
+ (y (:pointer :int)))
+
+(defun widget-pointer (widget)
+ (with-foreign-objects ((x :int) (y :int))
+ (gtk-widget-get-pointer widget x y)
+ (values (mem-ref x :int) (mem-ref y :int))))
+
+(export 'widget-pointer)
+
+(defcfun (widget-is-ancestor "gtk_widget_is_ancestor") :boolean
+ (widget g-object)
+ (container g-object))
+
+(export 'widget-is-ancestor)
+
+(defcfun gtk-widget-translate-coordinates :boolean
+ (src-widget g-object)
+ (dst-widget g-object)
+ (src-x :int)
+ (src-y :int)
+ (dst-x (:pointer :int))
+ (dst-y (:pointer :int)))
+
+(defun widget-translate-coordinates (src-widget dst-widget src-x src-y)
+ (with-foreign-objects ((dst-x :int) (dst-y :int))
+ (gtk-widget-translate-coordinates src-widget dst-widget src-x src-y dst-x dst-y)
+ (values (mem-ref dst-x :int)
+ (mem-ref dst-y :int))))
+
+(export 'widget-translate-coordinates)
+
+(defcfun (widget-ensure-style "gtk_widget_ensure_style") :void
+ (widget g-object))
+
+(export 'widget-ensure-style)
+
+(defcfun (widget-reset-rc-styles "gtk_widget_reset_rc_styles") :void
+ (widget g-object))
+
+(export 'widget-reset-rc-styles)
+
+(defcfun (widget-push-colormap "gtk_widget_push_colormap") :void
+ (colormap (g-object gdk-colormap)))
+
+(export 'widget-push-colormap)
+
+(defcfun (widget-pop-colormap "gtk_widget_pop_colormap") :void)
+
+(export 'widget-pop-colormap)
+
+(defcfun (widget-default-colormap "gtk_widget_get_default_colormap") (g-object gdk-colormap))
+
+(defcfun gtk-widget-set-default-colormap :void
+ (colormap (g-object gdk-colormap)))
+
+(defun (setf widget-default-colormap) (colormap)
+ (gtk-widget-set-default-colormap colormap))
+
+(export 'widget-default-colormap)
+
+(defcfun (widget-default-style "gtk_widget_get_default_style") (g-object style))
+
+(export 'widget-default-style)
+
+(defcfun (widget-default-visual "gtk_widget_get_default_visual") (g-object visual))
+
+(export 'widget-default-visual)
+
+(defcfun (widget-default-direction "gtk_widget_get_default_direction") text-direction)
+
+(defcfun gtk-widget-set-default-direction :void
+ (direction text-direction))
+
+(defun (setf widget-default-direction) (new-value)
+ (gtk-widget-set-default-direction new-value))
+
+(export 'widget-default-direction)
+
+(defcfun (widget-shape-combine-mask "gtk_widget_shape_combine_mask") :void
+ (widget (g-object widget))
+ (shape-mask g-object)
+ (offset-x :int)
+ (offset-y :int))
+
+(export 'widget-shape-combine-mask)
+
+(defcfun (widget-input-shape-combine-mask "gtk_widget_input_shape_combine_mask") :void
+ (widget (g-object widget))
+ (shape-mask g-object)
+ (offset-x :int)
+ (offset-y :int))
+
+(export 'widget-input-shape-combine-mask)
+
+(defcfun gtk-widget-path :void
+ (widget g-object)
+ (path-length (:pointer :uint))
+ (path (:pointer (:pointer :char)))
+ (path-reversed (:pointer (:pointer :char))))
+
+(defcfun gtk-widget-class-path :void
+ (widget g-object)
+ (path-length (:pointer :uint))
+ (path (:pointer (:pointer :char)))
+ (path-reversed (:pointer (:pointer :char))))
+
+(defun widget-path (widget &key (path-type :name))
+ (assert (typep path-type '(member :name :class)))
+ (with-foreign-object (path :pointer)
+ (ecase path-type
+ (:name (gtk-widget-path widget (null-pointer) path (null-pointer)))
+ (:class (gtk-widget-class-path widget (null-pointer) path (null-pointer))))
+ (mem-ref path '(g-string :free-from-foreign t))))
+
+(export 'widget-path)
+
+(defcfun (widget-modify-fg "gtk_widget_modify_fg") :void
+ (widget (g-object widget))
+ (state state-type)
+ (color (g-boxed-foreign color)))
+
+(export 'widget-modify-fg)
+
+(defcfun (widget-modify-bg "gtk_widget_modify_bg") :void
+ (widget (g-object widget))
+ (state state-type)
+ (color (g-boxed-foreign color)))
+
+(export 'widget-modify-bg)
+
+(defcfun (widget-modify-text "gtk_widget_modify_text") :void
+ (widget (g-object widget))
+ (state state-type)
+ (color (g-boxed-foreign color)))
+
+(export 'widget-modify-text)
+
+(defcfun (widget-modify-base "gtk_widget_modify_base") :void
+ (widget (g-object widget))
+ (state state-type)
+ (color (g-boxed-foreign color)))
+
+(export 'widget-modify-base)
+
+;void gtk_widget_modify_font (GtkWidget *widget,
+; PangoFontDescription *font_desc);
+
+(defcfun (widget-modify-cursor "gtk_widget_modify_cursor") :void
+ (widget (g-object widget))
+ (primary (g-boxed-foreign color))
+ (secondary (g-boxed-foreign color)))
+
+(export 'widget-modify-cursor)
+
+(defcfun (widget-create-pango-context "gtk_widget_create_pango_context") (g-object :already-referenced)
+ (widget g-object))
+
+(export 'widget-create-pango-context)
+
+(defcfun (widget-create-pango-layout "gtk_widget_create_pango_layout") (g-object pango-layout :already-referenced)