;; -*- scheme -*-

(include "gdk-types.defs")

;; From /opt/gtk2/include/gtk-2.0/gdk/gdk.h

(define-function pointer_grab
  (c-name "gdk_pointer_grab")
  (return-type "GdkGrabStatus")
  (parameters
    '("GdkWindow*" "window")
    '("gboolean" "owner_events" (null-ok) (default "FALSE"))
    '("GdkEventMask" "event_mask" (null-ok) (default "0"))
    '("GdkWindow*" "confine_to" (null-ok) (default "NULL"))
    '("GdkCursor*" "cursor" (null-ok) (default "NULL"))
    '("guint32" "time" (null-ok) (default "GDK_CURRENT_TIME"))
  )
)

(define-function pointer_ungrab
  (c-name "gdk_pointer_ungrab")
  (return-type "none")
  (parameters
    '("guint32" "time" (null-ok) (default "GDK_CURRENT_TIME"))
  )
)

(define-function keyboard_grab
  (c-name "gdk_keyboard_grab")
  (return-type "GdkGrabStatus")
  (parameters
    '("GdkWindow*" "window")
    '("gboolean" "owner_events" (null-ok) (default "FALSE"))
    '("guint32" "time" (null-ok) (default "GDK_CURRENT_TIME"))
  )
)

(define-function keyboard_ungrab
  (c-name "gdk_keyboard_ungrab")
  (return-type "none")
  (parameters
    '("guint32" "time" (null-ok) (default "GDK_CURRENT_TIME"))
  )
)

(define-function pointer_is_grabbed
  (c-name "gdk_pointer_is_grabbed")
  (return-type "gboolean")
)

(define-function screen_width
  (c-name "gdk_screen_width")
  (return-type "gint")
)

(define-function screen_height
  (c-name "gdk_screen_height")
  (return-type "gint")
)

(define-function screen_width_mm
  (c-name "gdk_screen_width_mm")
  (return-type "gint")
)

(define-function screen_height_mm
  (c-name "gdk_screen_height_mm")
  (return-type "gint")
)

(define-function flush
  (c-name "gdk_flush")
  (return-type "none")
)

(define-function beep
  (c-name "gdk_beep")
  (return-type "none")
)

(define-function set_double_click_time
  (c-name "gdk_set_double_click_time")
  (return-type "none")
  (parameters
    '("guint" "msec")
  )
)

(define-function threads_enter
  (c-name "gdk_threads_enter")
  (return-type "none")
)

(define-function threads_leave
  (c-name "gdk_threads_leave")
  (return-type "none")
)

(define-function threads_init
  (c-name "gdk_threads_init")
  (return-type "none")
)


;; From /opt/gtk2/include/gtk-2.0/gdk/gdkcolor.h

(define-function gdk_color_new
  (c-name "gdk_color_new")
  (is-constructor-of "GdkColor")
  (return-type "GdkColor")
)

(define-function gdk_colormap_get_type
  (c-name "gdk_colormap_get_type")
  (return-type "GType")
)

(define-function gdk_colormap_new
  (c-name "gdk_colormap_new")
  (is-constructor-of GdkColormap)
  (return-type "GdkColormap*")
  (parameters
    '("GdkVisual*" "visual")
    '("gboolean" "allocate")
  )
)

(define-function colormap_get_system
  (c-name "gdk_colormap_get_system")
  (return-type "GdkColormap*")
)

(define-function colormap_get_system_size
  (deprecated "deprecated")
  (c-name "gdk_colormap_get_system_size")
  (return-type "gint")
)

;(define-method change
;  (deprecated "deprecated")
;  (of-object "GdkColormap")
;  (c-name "gdk_colormap_change")
;  (return-type "none")
;  (parameters
;    '("gint" "ncolors")
;  )
;)

(define-method alloc_color
  (of-object "GdkColormap")
  (c-name "gdk_colormap_alloc_color")
  (return-type "gboolean")
  (parameters
    '("GdkColor*" "color")
    '("gboolean" "writeable")
    '("gboolean" "best_match")
  )
)

(define-method query_color
  (of-object "GdkColormap")
  (c-name "gdk_colormap_query_color")
  (parameters
   '("gulong" "pixel")
   '("GdkColor*" "color")
  )
)

(define-method get_visual
  (of-object "GdkColormap")
  (c-name "gdk_colormap_get_visual")
  (return-type "GdkVisual*")
)

(define-method get_screen
  (of-object "GdkColormap")
  (c-name "gdk_colormap_get_screen")
  (return-type "GdkScreen*")
)

(define-function color_parse
  (c-name "gdk_color_parse")
  (return-type "gint")
  (parameters
    '("const-gchar*" "spec")
    '("GdkColor*" "color")
  )
)

(define-method white
  (deprecated "deprecated")
  (of-object "GdkColormap")
  (c-name "gdk_color_white")
  (return-type "gint")
  (parameters
    '("GdkColor*" "color")
  )
)

(define-method black
  (deprecated "deprecated")
  (of-object "GdkColormap")
  (c-name "gdk_color_black")
  (return-type "gint")
  (parameters
    '("GdkColor*" "color")
  )
)

(define-method alloc
  (deprecated "deprecated")
  (of-object "GdkColormap")
  (c-name "gdk_color_alloc")
  (return-type "gint")
  (parameters
    '("GdkColor*" "color")
  )
)

(define-method change
  (deprecated "deprecated")
  (of-object "GdkColormap")
  (c-name "gdk_color_change")
  (return-type "gint")
  (parameters
    '("GdkColor*" "color")
  )
)



;; From /opt/gtk2/include/gtk-2.0/gdk/gdkcursor.h

(define-function cursor_new
  (is-constructor-of GdkCursor)
  (c-name "gdk_cursor_new")
  (return-type "GdkCursor*")
  (parameters
    '("GdkCursorType" "cursor_type")
  )
)

(define-function cursor_new_for_display
  (is-constructor-of GdkCursor)
  (c-name "gdk_cursor_new_for_display")
  (return-type "GdkCursor*")
  (parameters
    '("GdkDisplay*" "display")
    '("GdkCursorType" "cursor_type")
  )
)

(define-function cursor_new_from_pixmap
  (is-constructor-of GdkCursor)
  (c-name "gdk_cursor_new_from_pixmap")
  (return-type "GdkCursor*")
  (parameters
    '("GdkPixmap*" "source")
    '("GdkPixmap*" "mask")
    '("GdkColor*" "fg")
    '("GdkColor*" "bg")
    '("gint" "x")
    '("gint" "y")
  )
)

(define-function cursor_new_from_pixbuf
  (is-constructor-of GdkCursor)
  (c-name "gdk_cursor_new_from_pixbuf")
  (return-type "GdkCursor*")
  (parameters
    '("GdkDisplay*" "display")
    '("GdkPixbuf*" "source")
    '("gint" "x")
    '("gint" "y")
  )
)

(define-method get_display
  (of-object "GdkCursor")
  (c-name "gdk_cursor_get_display")
  (return-type "GdkDisplay*")
)



;; From /opt/gtk2/include/gtk-2.0/gdk/gdkdisplay.h

(define-function gdk_display_get_type
  (c-name "gdk_display_get_type")
  (return-type "GType")
)

(define-function gdk_display_open
  (is-constructor-of "GdkDisplay")
  (c-name "gdk_display_open")
  (return-type "GdkDisplay*")
  (parameters
    '("const-gchar*" "display_name")
  )
)

(define-method get_name
  (of-object "GdkDisplay")
  (c-name "gdk_display_get_name")
  (return-type "const-gchar*")
)

(define-method get_n_screens
  (of-object "GdkDisplay")
  (c-name "gdk_display_get_n_screens")
  (return-type "gint")
)

(define-method get_screen
  (of-object "GdkDisplay")
  (c-name "gdk_display_get_screen")
  (return-type "GdkScreen*")
  (parameters
    '("gint" "screen_num")
  )
)

(define-method get_default_screen
  (of-object "GdkDisplay")
  (c-name "gdk_display_get_default_screen")
  (return-type "GdkScreen*")
)

(define-method pointer_ungrab
  (of-object "GdkDisplay")
  (c-name "gdk_display_pointer_ungrab")
  (return-type "none")
  (parameters
    '("guint32" "time_" (default "GDK_CURRENT_TIME"))
  )
)

(define-method keyboard_ungrab
  (of-object "GdkDisplay")
  (c-name "gdk_display_keyboard_ungrab")
  (return-type "none")
  (parameters
    '("guint32" "time_" (default "GDK_CURRENT_TIME"))
  )
)

(define-method pointer_is_grabbed
  (of-object "GdkDisplay")
  (c-name "gdk_display_pointer_is_grabbed")
  (return-type "gboolean")
)

(define-method beep
  (of-object "GdkDisplay")
  (c-name "gdk_display_beep")
  (return-type "none")
)

(define-method sync
  (of-object "GdkDisplay")
  (c-name "gdk_display_sync")
  (return-type "none")
)

(define-method close
  (of-object "GdkDisplay")
  (c-name "gdk_display_close")
  (return-type "none")
)

(define-method list_devices
  (of-object "GdkDisplay")
  (c-name "gdk_display_list_devices")
  (return-type "GList*")
)

(define-method get_event
  (of-object "GdkDisplay")
  (c-name "gdk_display_get_event")
  (return-type "GdkEvent*")
)

(define-method peek_event
  (of-object "GdkDisplay")
  (c-name "gdk_display_peek_event")
  (return-type "GdkEvent*")
)

(define-method put_event
  (of-object "GdkDisplay")
  (c-name "gdk_display_put_event")
  (return-type "none")
  (parameters
    '("GdkEvent*" "event")
  )
)

(define-method add_client_message_filter
  (of-object "GdkDisplay")
  (c-name "gdk_display_add_client_message_filter")
  (return-type "none")
  (parameters
    '("GdkAtom" "message_type")
    '("GdkFilterFunc" "func")
    '("gpointer" "data")
  )
)

(define-method set_double_click_time
  (of-object "GdkDisplay")
  (c-name "gdk_display_set_double_click_time")
  (return-type "none")
  (parameters
    '("guint" "msec")
  )
)

(define-function display_get_default
  (c-name "gdk_display_get_default")
  (return-type "GdkDisplay*")
)

(define-method get_core_pointer
  (of-object "GdkDisplay")
  (c-name "gdk_display_get_core_pointer")
  (return-type "GdkDevice*")
)

(define-method get_pointer
  (of-object "GdkDisplay")
  (c-name "gdk_display_get_pointer")
  (return-type "none")
  (parameters
    '("GdkScreen**" "screen")
    '("gint*" "x")
    '("gint*" "y")
    '("GdkModifierType*" "mask")
  )
)

(define-method get_window_at_pointer
  (of-object "GdkDisplay")
  (c-name "gdk_display_get_window_at_pointer")
  (return-type "GdkWindow*")
  (parameters
    '("gint*" "win_x")
    '("gint*" "win_y")
  )
)

(define-method set_pointer_hooks
  (of-object "GdkDisplay")
  (c-name "gdk_display_set_pointer_hooks")
  (return-type "GdkDisplayPointerHooks*")
  (parameters
    '("const-GdkDisplayPointerHooks*" "new_hooks")
  )
)

(define-function display_open_default_libgtk_only
  (c-name "gdk_display_open_default_libgtk_only")
  (return-type "GdkDisplay*")
)

(define-method supports_selection_notification
  (of-object "GdkDisplay")
  (c-name "gdk_display_supports_selection_notification")
  (return-type "gboolean")
)

(define-method request_selection_notification
  (of-object "GdkDisplay")
  (c-name "gdk_display_request_selection_notification")
  (return-type "gboolean")
  (parameters
    '("GdkAtom" "selection")
  )
)

(define-method supports_clipboard_persistence
  (of-object "GdkDisplay")
  (c-name "gdk_display_supports_clipboard_persistence")
  (return-type "gboolean")
)

(define-method store_clipboard
  (of-object "GdkDisplay")
  (c-name "gdk_display_store_clipboard")
  (return-type "none")
  (parameters
    '("GdkWindow*" "clipboard_window")
    '("guint32" "time_")
    '("GdkAtom*" "targets")
    '("gint" "n_targets")
  )
)

;; From /opt/gtk2/include/gtk-2.0/gdk/gdkdisplaymanager.h

(define-function gdk_display_manager_get_type
  (c-name "gdk_display_manager_get_type")
  (return-type "GType")
)

(define-function display_manager_get
  (c-name "gdk_display_manager_get")
  (return-type "GdkDisplayManager*")
)

(define-method get_default_display
  (of-object "GdkDisplayManager")
  (c-name "gdk_display_manager_get_default_display")
  (return-type "GdkDisplay*")
)

(define-method set_default_display
  (of-object "GdkDisplayManager")
  (c-name "gdk_display_manager_set_default_display")
  (return-type "none")
  (parameters
    '("GdkDisplay*" "display")
  )
)

(define-method list_displays
  (of-object "GdkDisplayManager")
  (c-name "gdk_display_manager_list_displays")
  (return-type "GSList*")
)

(define-method flush
  (of-object "GdkDisplay")
  (c-name "gdk_display_flush")
  (return-type "none")
)
 
(define-method set_double_click_distance
  (of-object "GdkDisplay")
  (c-name "gdk_display_set_double_click_distance")
  (return-type "none")
  (parameters
    '("guint" "distance")
  )
)
 
(define-method supports_cursor_alpha
  (of-object "GdkDisplay")
  (c-name "gdk_display_supports_cursor_alpha")
  (return-type "gboolean")
)
 
(define-method supports_cursor_color
  (of-object "GdkDisplay")
  (c-name "gdk_display_supports_cursor_color")
  (return-type "gboolean")
)
 
(define-method get_default_cursor_size
  (of-object "GdkDisplay")
  (c-name "gdk_display_get_default_cursor_size")
  (return-type "guint")
)

(define-method get_maximal_cursor_size
  (of-object "GdkDisplay")
  (c-name "gdk_display_get_maximal_cursor_size")
  (return-type "none")
  (parameters
    '("guint*" "width")
    '("guint*" "height")
  )
)
(define-method get_default_group
  (of-object "GdkDisplay")
  (c-name "gdk_display_get_default_group")
  (return-type "GdkWindow*")
)

;; From /opt/gtk2/include/gtk-2.0/gdk/gdkdnd.h

(define-function drag_context_get_type
  (c-name "gdk_drag_context_get_type")
  (return-type "GType")
)

(define-function drag_context_new
  (is-constructor-of GdkDragContext)
  (c-name "gdk_drag_context_new")
  (return-type "GdkDragContext*")
)

(define-method ref
  (of-object "GdkDragContext")
  (c-name "gdk_drag_context_ref")
  (return-type "none")
)

(define-method unref
  (of-object "GdkDragContext")
  (c-name "gdk_drag_context_unref")
  (return-type "none")
)

(define-method drag_status
  (of-object "GdkDragContext")
  (c-name "gdk_drag_status")
  (return-type "none")
  (parameters
    '("GdkDragAction" "action")
    '("guint32" "time" (null-ok) (default "GDK_CURRENT_TIME"))
  )
)

(define-method drop_reply
  (of-object "GdkDragContext")
  (c-name "gdk_drop_reply")
  (return-type "none")
  (parameters
    '("gboolean" "ok")
    '("guint32" "time" (null-ok) (default "GDK_CURRENT_TIME"))
  )
)

(define-method drop_finish
  (of-object "GdkDragContext")
  (c-name "gdk_drop_finish")
  (return-type "none")
  (parameters
    '("gboolean" "success")
    '("guint32" "time" (null-ok) (default "GDK_CURRENT_TIME"))
  )
)

(define-method drag_get_selection
  (of-object "GdkDragContext")
  (c-name "gdk_drag_get_selection")
  (return-type "GdkAtom")
)

(define-method drag_begin
  (of-object "GdkWindow")
  (c-name "gdk_drag_begin")
  (return-type "GdkDragContext*")
  (parameters
    '("GList*" "targets")
  )
)

(define-function drag_get_protocol
  (c-name "gdk_drag_get_protocol")
  (return-type "guint32")
  (parameters
    '("guint32" "xid")
    '("GdkDragProtocol*" "protocol")
  )
)

(define-method drag_find_window
  (of-object "GdkDragContext")
  (c-name "gdk_drag_find_window")
  (return-type "none")
  (parameters
    '("GdkWindow*" "drag_window")
    '("gint" "x_root")
    '("gint" "y_root")
    '("GdkWindow**" "dest_window")
    '("GdkDragProtocol*" "protocol")
  )
)

(define-function drag_get_protocol_for_display
  (c-name "gdk_drag_get_protocol_for_display")
  (return-type "guint32")
  (parameters
    '("GdkDisplay*" "display")
    '("guint32" "xid")
    '("GdkDragProtocol*" "protocol")
  )
)

(define-method drag_find_window_for_screen
  (of-object "GdkDragContext")
  (c-name "gdk_drag_find_window_for_screen")
  (return-type "none")
  (parameters
    '("GdkWindow*" "drag_window")
    '("GdkScreen*" "screen")
    '("gint" "x_root")
    '("gint" "y_root")
    '("GdkWindow**" "dest_window")
    '("GdkDragProtocol*" "protocol")
  )
)

(define-method drag_motion
  (of-object "GdkDragContext")
  (c-name "gdk_drag_motion")
  (return-type "gboolean")
  (parameters
    '("GdkWindow*" "dest_window")
    '("GdkDragProtocol" "protocol")
    '("gint" "x_root")
    '("gint" "y_root")
    '("GdkDragAction" "suggested_action")
    '("GdkDragAction" "possible_actions")
    '("guint32" "time")
  )
)

(define-method drag_drop
  (of-object "GdkDragContext")
  (c-name "gdk_drag_drop")
  (return-type "none")
  (parameters
    '("guint32" "time")
  )
)

(define-method drag_abort
  (of-object "GdkDragContext")
  (c-name "gdk_drag_abort")
  (return-type "none")
  (parameters
    '("guint32" "time")
  )
)

(define-method drag_drop_succeeded
  (of-object "GdkDragContext")
  (c-name "gdk_drag_drop_succeeded")
  (return-type "gboolean")
)



;; From /opt/gtk2/include/gtk-2.0/gdk/gdkdrawable.h

(define-function gdk_drawable_get_type
  (c-name "gdk_drawable_get_type")
  (return-type "GType")
)

(define-method set_data
  (of-object "GdkDrawable")
  (c-name "gdk_drawable_set_data")
  (return-type "none")
  (parameters
    '("const-gchar*" "key")
    '("gpointer" "data")
    '("GDestroyNotify" "destroy_func")
  )
)

(define-method get_data
  (of-object "GdkDrawable")
  (c-name "gdk_drawable_get_data")
  (return-type "gpointer")
  (parameters
    '("const-gchar*" "key")
  )
)

(define-method get_size
  (of-object "GdkDrawable")
  (c-name "gdk_drawable_get_size")
  (return-type "none")
  (parameters
    '("gint*" "width")
    '("gint*" "height")
  )
)

(define-method set_colormap
  (of-object "GdkDrawable")
  (c-name "gdk_drawable_set_colormap")
  (return-type "none")
  (parameters
    '("GdkColormap*" "colormap")
  )
)

(define-method get_colormap
  (of-object "GdkDrawable")
  (c-name "gdk_drawable_get_colormap")
  (return-type "GdkColormap*")
)

(define-method get_visual
  (of-object "GdkDrawable")
  (c-name "gdk_drawable_get_visual")
  (return-type "GdkVisual*")
)

(define-method get_depth
  (of-object "GdkDrawable")
  (c-name "gdk_drawable_get_depth")
  (return-type "gint")
)

(define-method get_screen
  (of-object "GdkDrawable")
  (c-name "gdk_drawable_get_screen")
  (return-type "GdkScreen*")
)

(define-method get_display
  (of-object "GdkDrawable")
  (c-name "gdk_drawable_get_display")
  (return-type "GdkDisplay*")
)

(define-method ref
  (of-object "GdkDrawable")
  (c-name "gdk_drawable_ref")
  (return-type "GdkDrawable*")
)

(define-method unref
  (of-object "GdkDrawable")
  (c-name "gdk_drawable_unref")
  (return-type "none")
)

(define-method draw_point
  (of-object "GdkDrawable")
  (c-name "gdk_draw_point")
  (return-type "none")
  (parameters
    '("GdkGC*" "gc")
    '("gint" "x")
    '("gint" "y")
  )
)

(define-method draw_line
  (of-object "GdkDrawable")
  (c-name "gdk_draw_line")
  (return-type "none")
  (parameters
    '("GdkGC*" "gc")
    '("gint" "x1")
    '("gint" "y1")
    '("gint" "x2")
    '("gint" "y2")
  )
)

(define-method draw_rectangle
  (of-object "GdkDrawable")
  (c-name "gdk_draw_rectangle")
  (return-type "none")
  (parameters
    '("GdkGC*" "gc")
    '("gboolean" "filled")
    '("gint" "x")
    '("gint" "y")
    '("gint" "width")
    '("gint" "height")
  )
)

(define-method draw_arc
  (of-object "GdkDrawable")
  (c-name "gdk_draw_arc")
  (return-type "none")
  (parameters
    '("GdkGC*" "gc")
    '("gboolean" "filled")
    '("gint" "x")
    '("gint" "y")
    '("gint" "width")
    '("gint" "height")
    '("gint" "angle1")
    '("gint" "angle2")
  )
)

(define-method draw_polygon
  (of-object "GdkDrawable")
  (c-name "gdk_draw_polygon")
  (return-type "none")
  (parameters
    '("GdkGC*" "gc")
    '("gboolean" "filled")
    '("GdkPoint*" "points")
    '("gint" "npoints")
  )
)

(define-method draw_string
  (deprecated "use GdkDrawable.draw_layout")
  (of-object "GdkDrawable")
  (c-name "gdk_draw_string")
  (return-type "none")
  (parameters
    '("GdkFont*" "font")
    '("GdkGC*" "gc")
    '("gint" "x")
    '("gint" "y")
    '("const-gchar*" "string")
  )
)

(define-method draw_text
  (deprecated "use GdkDrawable.draw_layout")
  (of-object "GdkDrawable")
  (c-name "gdk_draw_text")
  (return-type "none")
  (parameters
    '("GdkFont*" "font")
    '("GdkGC*" "gc")
    '("gint" "x")
    '("gint" "y")
    '("const-gchar*" "text")
    '("gint" "text_length")
  )
)

(define-method draw_text_wc
  (deprecated "use GdkDrawable.draw_layout")
  (of-object "GdkDrawable")
  (c-name "gdk_draw_text_wc")
  (return-type "none")
  (parameters
    '("GdkFont*" "font")
    '("GdkGC*" "gc")
    '("gint" "x")
    '("gint" "y")
    '("const-GdkWChar*" "text")
    '("gint" "text_length")
  )
)

(define-method draw_drawable
  (of-object "GdkDrawable")
  (c-name "gdk_draw_drawable")
  (return-type "none")
  (parameters
    '("GdkGC*" "gc")
    '("GdkDrawable*" "src")
    '("gint" "xsrc")
    '("gint" "ysrc")
    '("gint" "xdest")
    '("gint" "ydest")
    '("gint" "width")
    '("gint" "height")
  )
)

(define-method draw_image
  (of-object "GdkDrawable")
  (c-name "gdk_draw_image")
  (return-type "none")
  (parameters
    '("GdkGC*" "gc")
    '("GdkImage*" "image")
    '("gint" "xsrc")
    '("gint" "ysrc")
    '("gint" "xdest")
    '("gint" "ydest")
    '("gint" "width")
    '("gint" "height")
  )
)

(define-method draw_points
  (of-object "GdkDrawable")
  (c-name "gdk_draw_points")
  (return-type "none")
  (parameters
    '("GdkGC*" "gc")
    '("GdkPoint*" "points")
    '("gint" "npoints")
  )
)

(define-method draw_segments
  (of-object "GdkDrawable")
  (c-name "gdk_draw_segments")
  (return-type "none")
  (parameters
    '("GdkGC*" "gc")
    '("GdkSegment*" "segs")
    '("gint" "nsegs")
  )
)

(define-method draw_lines
  (of-object "GdkDrawable")
  (c-name "gdk_draw_lines")
  (return-type "none")
  (parameters
    '("GdkGC*" "gc")
    '("GdkPoint*" "points")
    '("gint" "npoints")
  )
)

(define-method draw_pixbuf
  (of-object "GdkDrawable")
  (c-name "gdk_draw_pixbuf")
  (return-type "none")
  (parameters
    '("GdkGC*" "gc" (null-ok))
    '("GdkPixbuf*" "pixbuf")
    '("gint" "src_x")
    '("gint" "src_y")
    '("gint" "dest_x")
    '("gint" "dest_y")
    '("gint" "width" (default "-1"))
    '("gint" "height" (default "-1"))
    '("GdkRgbDither" "dither" (default "GDK_RGB_DITHER_NORMAL"))
    '("gint" "x_dither" (default "0"))
    '("gint" "y_dither" (default "0"))
  )
)

(define-method draw_glyphs
  (of-object "GdkDrawable")
  (c-name "gdk_draw_glyphs")
  (return-type "none")
  (parameters
    '("GdkGC*" "gc")
    '("PangoFont*" "font")
    '("gint" "x")
    '("gint" "y")
    '("PangoGlyphString*" "glyphs")
  )
)

(define-method draw_layout_line
  (of-object "GdkDrawable")
  (c-name "gdk_draw_layout_line")
  (return-type "none")
  (parameters
    '("GdkGC*" "gc")
    '("gint" "x")
    '("gint" "y")
    '("PangoLayoutLine*" "line")
  )
)

(define-method draw_layout
  (of-object "GdkDrawable")
  (c-name "gdk_draw_layout")
  (return-type "none")
  (parameters
    '("GdkGC*" "gc")
    '("gint" "x")
    '("gint" "y")
    '("PangoLayout*" "layout")
  )
)

(define-function gdk_draw_layout_line_with_colors
  (c-name "gdk_draw_layout_line_with_colors")
  (return-type "none")
  (parameters
    '("GdkDrawable*" "drawable")
    '("GdkGC*" "gc")
    '("gint" "x")
    '("gint" "y")
    '("PangoLayoutLine*" "line")
    '("GdkColor*" "foreground")
    '("GdkColor*" "background")
  )
)

(define-function gdk_draw_layout_with_colors
  (deprecated "use gtk.gdk.Drawable.draw_layout instead")
  (c-name "gdk_draw_layout_with_colors")
  (return-type "none")
  (parameters
    '("GdkDrawable*" "drawable")
    '("GdkGC*" "gc")
    '("gint" "x")
    '("gint" "y")
    '("PangoLayout*" "layout")
    '("GdkColor*" "foreground")
    '("GdkColor*" "background")
  )
)

(define-method get_image
  (of-object "GdkDrawable")
  (c-name "gdk_drawable_get_image")
  (return-type "GdkImage*")
  (parameters
    '("gint" "x")
    '("gint" "y")
    '("gint" "width")
    '("gint" "height")
  )
  (caller-owns-return #t)
)

(define-method get_clip_region
  (of-object "GdkDrawable")
  (c-name "gdk_drawable_get_clip_region")
  (return-type "GdkRegion*")
)

(define-method get_visible_region
  (of-object "GdkDrawable")
  (c-name "gdk_drawable_get_visible_region")
  (return-type "GdkRegion*")
)



;; From /opt/gtk2/include/gtk-2.0/gdk/gdkevents.h

(define-function gdk_event_get_type
  (c-name "gdk_event_get_type")
  (return-type "GType")
)

(define-function events_pending
  (c-name "gdk_events_pending")
  (return-type "gboolean")
)

(define-function event_get
  (c-name "gdk_event_get")
  (return-type "GdkEvent*")
)

(define-function event_peek
  (c-name "gdk_event_peek")
  (return-type "GdkEvent*")
)

(define-function event_get_graphics_expose
  (c-name "gdk_event_get_graphics_expose")
  (return-type "GdkEvent*")
  (parameters
    '("GdkWindow*" "window")
  )
)

(define-method put
  (of-object "GdkEvent")
  (c-name "gdk_event_put")
  (return-type "none")
)

(define-function event_new
  (is-constructor-of "GdkEvent")
  (c-name "gdk_event_new")
  (return-type "GdkEvent*")
  (parameters
    '("GdkEventType" "type")
  )
)

(define-method copy
  (of-object "GdkEvent")
  (c-name "gdk_event_copy")
  (return-type "GdkEvent*")
)

(define-method free
  (of-object "GdkEvent")
  (c-name "gdk_event_free")
  (return-type "none")
)

(define-method get_time
  (of-object "GdkEvent")
  (c-name "gdk_event_get_time")
  (return-type "guint32")
)

(define-method get_state
  (of-object "GdkEvent")
  (c-name "gdk_event_get_state")
  (return-type "gboolean")
  (parameters
    '("GdkModifierType*" "state")
  )
)

(define-method get_coords
  (of-object "GdkEvent")
  (c-name "gdk_event_get_coords")
  (return-type "gboolean")
  (parameters
    '("gdouble*" "x_win")
    '("gdouble*" "y_win")
  )
)

(define-method get_root_coords
  (of-object "GdkEvent")
  (c-name "gdk_event_get_root_coords")
  (return-type "gboolean")
  (parameters
    '("gdouble*" "x_root")
    '("gdouble*" "y_root")
  )
)

(define-method get_axis
  (of-object "GdkEvent")
  (c-name "gdk_event_get_axis")
  (return-type "gboolean")
  (parameters
    '("GdkAxisUse" "axis_use")
    '("gdouble*" "value")
  )
)

(define-function gdk_event_handler_set
  (c-name "gdk_event_handler_set")
  (return-type "none")
  (parameters
    '("GdkEventFunc" "func")
    '("gpointer" "data")
    '("GDestroyNotify" "notify")
  )
)

(define-method set_screen
  (of-object "GdkEvent")
  (c-name "gdk_event_set_screen")
  (return-type "none")
  (parameters
    '("GdkScreen*" "screen")
  )
)

(define-method get_screen
  (of-object "GdkEvent")
  (c-name "gdk_event_get_screen")
  (return-type "GdkScreen*")
)

(define-function set_show_events
  (c-name "gdk_set_show_events")
  (return-type "none")
  (parameters
    '("gboolean" "show_events")
  )
)

(define-function get_show_events
  (c-name "gdk_get_show_events")
  (return-type "gboolean")
)

(define-function gdk_add_client_message_filter
  (c-name "gdk_add_client_message_filter")
  (return-type "none")
  (parameters
    '("GdkAtom" "message_type")
    '("GdkFilterFunc" "func")
    '("gpointer" "data")
  )
)

(define-function setting_get
  (c-name "gdk_setting_get")
  (return-type "gboolean")
  (parameters
    '("const-gchar*" "name")
    '("GValue*" "value")
  )
)




;; From /opt/gtk2/include/gtk-2.0/gdk/gdkfont.h

(define-method id
  (of-object "GdkFont")
  (c-name "gdk_font_id")
  (return-type "gint")
)

(define-function font_load_for_display
  (c-name "gdk_font_load_for_display")
  (return-type "GdkFont*")
  (parameters
    '("GdkDisplay*" "display")
    '("const-gchar*" "font_name")
  )
)

(define-function fontset_load_for_display
  (c-name "gdk_fontset_load_for_display")
  (return-type "GdkFont*")
  (parameters
    '("GdkDisplay*" "display")
    '("const-gchar*" "fontset_name")
  )
)

(define-function font_from_description_for_display
  (c-name "gdk_font_from_description_for_display")
  (return-type "GdkFont*")
  (parameters
    '("GdkDisplay*" "display")
    '("PangoFontDescription*" "font_desc")
  )
)

(define-function font_load
  (is-constructor-of GdkFont)
  (c-name "gdk_font_load")
  (return-type "GdkFont*")
  (parameters
    '("const-gchar*" "font_name")
  )
)

(define-function fontset_load
  (c-name "gdk_fontset_load")
  (return-type "GdkFont*")
  (parameters
    '("const-gchar*" "fontset_name")
  )
)

(define-function font_from_description
  (c-name "gdk_font_from_description")
  (return-type "GdkFont*")
  (parameters
    '("PangoFontDescription*" "font_desc")
  )
)

(define-method string_width
  (of-object "GdkFont")
  (c-name "gdk_string_width")
  (return-type "gint")
  (parameters
    '("const-gchar*" "string")
  )
)

(define-method width
  (of-object "GdkFont")
  (c-name "gdk_text_width")
  (return-type "gint")
  (parameters
    '("const-gchar*" "text")
    '("gint" "text_length" (default "-1"))
  )
)

(define-method text_width_wc
  (of-object "GdkFont")
  (c-name "gdk_text_width_wc")
  (return-type "gint")
  (parameters
    '("const-GdkWChar*" "text")
    '("gint" "text_length")
  )
)

(define-method char_width
  (of-object "GdkFont")
  (c-name "gdk_char_width")
  (return-type "gint")
  (parameters
    '("gchar" "character")
  )
)

(define-method char_width_wc
  (of-object "GdkFont")
  (c-name "gdk_char_width_wc")
  (return-type "gint")
  (parameters
    '("GdkWChar" "character")
  )
)

(define-method string_measure
  (of-object "GdkFont")
  (c-name "gdk_string_measure")
  (return-type "gint")
  (parameters
    '("const-gchar*" "string")
  )
)

(define-method measure
  (of-object "GdkFont")
  (c-name "gdk_text_measure")
  (return-type "gint")
  (parameters
    '("const-gchar*" "text")
    '("gint" "text_length" (default "-1"))
  )
)

(define-method char_measure
  (of-object "GdkFont")
  (c-name "gdk_char_measure")
  (return-type "gint")
  (parameters
    '("gchar" "character")
  )
)

(define-method string_height
  (of-object "GdkFont")
  (c-name "gdk_string_height")
  (return-type "gint")
  (parameters
    '("const-gchar*" "string")
  )
)

(define-method height
  (of-object "GdkFont")
  (c-name "gdk_text_height")
  (return-type "gint")
  (parameters
    '("const-gchar*" "text")
    '("gint" "text_length" (default "-1"))
  )
)

(define-method char_height
  (of-object "GdkFont")
  (c-name "gdk_char_height")
  (return-type "gint")
  (parameters
    '("gchar" "character")
  )
)

(define-method extents
  (of-object "GdkFont")
  (c-name "gdk_text_extents")
  (return-type "none")
  (parameters
    '("const-gchar*" "text")
    '("gint" "text_length")
    '("gint*" "lbearing")
    '("gint*" "rbearing")
    '("gint*" "width")
    '("gint*" "ascent")
    '("gint*" "descent")
  )
)

(define-method text_extents_wc
  (of-object "GdkFont")
  (c-name "gdk_text_extents_wc")
  (return-type "none")
  (parameters
    '("const-GdkWChar*" "text")
    '("gint" "text_length")
    '("gint*" "lbearing")
    '("gint*" "rbearing")
    '("gint*" "width")
    '("gint*" "ascent")
    '("gint*" "descent")
  )
)

(define-method string_extents
  (of-object "GdkFont")
  (c-name "gdk_string_extents")
  (return-type "none")
  (parameters
    '("const-gchar*" "string")
    '("gint*" "lbearing")
    '("gint*" "rbearing")
    '("gint*" "width")
    '("gint*" "ascent")
    '("gint*" "descent")
  )
)

(define-method "get_display"
  (of-object "GdkFont")
  (c-name "gdk_font_get_display")
  (return-type "GdkDisplay*")
)



;; From /opt/gtk2/include/gtk-2.0/gdk/gdkgc.h

(define-function gdk_gc_get_type
  (c-name "gdk_gc_get_type")
  (return-type "GType")
)

(define-function gc_new
  (c-name "gdk_gc_new")
  (is-constructor-of "GdkGC")
  (return-type "GdkGC*")
  (parameters
    '("GdkDrawable*" "drawable")
  )
)

(define-function gc_new
  (deprecated "use gdk.GC")
  (c-name "gdk_gc_new2")
  (return-type "GdkGC*")
  (parameters
    '("GdkDrawable*" "drawable")
  )
)

(define-method new_gc
  (of-object "GdkDrawable")
  (c-name "gdk_gc_new_with_values")
  (return-type "GdkGC*")
  (parameters
    '("GdkGCValues*" "values")
    '("GdkGCValuesMask" "values_mask")
  )
)

(define-method get_values
  (of-object "GdkGC")
  (c-name "gdk_gc_get_values")
  (return-type "none")
  (parameters
    '("GdkGCValues*" "values")
  )
)

(define-method set_values
  (of-object "GdkGC")
  (c-name "gdk_gc_set_values")
  (return-type "none")
  (parameters
    '("GdkGCValues*" "values")
    '("GdkGCValuesMask" "values_mask")
  )
)

(define-method set_foreground
  (of-object "GdkGC")
  (c-name "gdk_gc_set_foreground")
  (return-type "none")
  (parameters
    '("GdkColor*" "color")
  )
)

(define-method set_background
  (of-object "GdkGC")
  (c-name "gdk_gc_set_background")
  (return-type "none")
  (parameters
    '("GdkColor*" "color")
  )
)

(define-method set_font
  (of-object "GdkGC")
  (c-name "gdk_gc_set_font")
  (return-type "none")
  (parameters
    '("GdkFont*" "font")
  )
)

(define-method set_function
  (of-object "GdkGC")
  (c-name "gdk_gc_set_function")
  (return-type "none")
  (parameters
    '("GdkFunction" "function")
  )
)

(define-method set_fill
  (of-object "GdkGC")
  (c-name "gdk_gc_set_fill")
  (return-type "none")
  (parameters
    '("GdkFill" "fill")
  )
)

(define-method set_tile
  (of-object "GdkGC")
  (c-name "gdk_gc_set_tile")
  (return-type "none")
  (parameters
    '("GdkPixmap*" "tile")
  )
)

(define-method set_stipple
  (of-object "GdkGC")
  (c-name "gdk_gc_set_stipple")
  (return-type "none")
  (parameters
    '("GdkPixmap*" "stipple")
  )
)

(define-method set_ts_origin
  (of-object "GdkGC")
  (c-name "gdk_gc_set_ts_origin")
  (return-type "none")
  (parameters
    '("gint" "x")
    '("gint" "y")
  )
)

(define-method set_clip_origin
  (of-object "GdkGC")
  (c-name "gdk_gc_set_clip_origin")
  (return-type "none")
  (parameters
    '("gint" "x")
    '("gint" "y")
  )
)

(define-method set_clip_mask
  (of-object "GdkGC")
  (c-name "gdk_gc_set_clip_mask")
  (return-type "none")
  (parameters
    '("GdkBitmap*" "mask")
  )
)

(define-method set_clip_rectangle
  (of-object "GdkGC")
  (c-name "gdk_gc_set_clip_rectangle")
  (return-type "none")
  (parameters
    '("GdkRectangle*" "rectangle")
  )
)

(define-method set_clip_region
  (of-object "GdkGC")
  (c-name "gdk_gc_set_clip_region")
  (return-type "none")
  (parameters
    '("GdkRegion*" "region")
  )
)

(define-method set_subwindow
  (of-object "GdkGC")
  (c-name "gdk_gc_set_subwindow")
  (return-type "none")
  (parameters
    '("GdkSubwindowMode" "mode")
  )
)

(define-method set_exposures
  (of-object "GdkGC")
  (c-name "gdk_gc_set_exposures")
  (return-type "none")
  (parameters
    '("gboolean" "exposures")
  )
)

(define-method set_line_attributes
  (of-object "GdkGC")
  (c-name "gdk_gc_set_line_attributes")
  (return-type "none")
  (parameters
    '("gint" "line_width")
    '("GdkLineStyle" "line_style")
    '("GdkCapStyle" "cap_style")
    '("GdkJoinStyle" "join_style")
  )
)

(define-method set_dashes
  (of-object "GdkGC")
  (c-name "gdk_gc_set_dashes")
  (return-type "none")
  (parameters
    '("gint" "dash_offset")
    '("gint8[]" "dash_list")
    '("gint" "n")
  )
)

(define-method offset
  (of-object "GdkGC")
  (c-name "gdk_gc_offset")
  (return-type "none")
  (parameters
    '("gint" "x_offset")
    '("gint" "y_offset")
  )
)

(define-method copy
  (of-object "GdkGC")
  (c-name "gdk_gc_copy")
  (return-type "none")
  (parameters
    '("GdkGC*" "src_gc")
  )
)

(define-method set_colormap
  (of-object "GdkGC")
  (c-name "gdk_gc_set_colormap")
  (return-type "none")
  (parameters
    '("GdkColormap*" "colormap")
  )
)

(define-method get_colormap
  (of-object "GdkGC")
  (c-name "gdk_gc_get_colormap")
  (return-type "GdkColormap*")
)

(define-method set_rgb_fg_color
  (of-object "GdkGC")
  (c-name "gdk_gc_set_rgb_fg_color")
  (return-type "none")
  (parameters
    '("GdkColor*" "color")
  )
)

(define-method set_rgb_bg_color
  (of-object "GdkGC")
  (c-name "gdk_gc_set_rgb_bg_color")
  (return-type "none")
  (parameters
    '("GdkColor*" "color")
  )
)

(define-method "get_screen"
  (of-object "GdkGC")
  (c-name "gdk_gc_get_screen")
  (return-type "GdkScreen*")
)


;; From /opt/gtk2/include/gtk-2.0/gdk/gdkimage.h

(define-function gdk_image_get_type
  (c-name "gdk_image_get_type")
  (return-type "GType")
)

(define-function gdk_image_new
  (is-constructor-of GdkImage)
  (c-name "gdk_image_new")
  (return-type "GdkImage*")
  (parameters
    '("GdkImageType" "type")
    '("GdkVisual*" "visual")
    '("gint" "width")
    '("gint" "height")
  )
)

(define-method image_get
  (of-object "GdkDrawable")
  (deprecated "use GdkDrawable.get_image")
  (c-name "gdk_image_get")
  (return-type "GdkImage*")
  (parameters
    '("gint" "x")
    '("gint" "y")
    '("gint" "width")
    '("gint" "height")
  )
)

(define-method put_pixel
  (of-object "GdkImage")
  (c-name "gdk_image_put_pixel")
  (return-type "none")
  (parameters
    '("gint" "x")
    '("gint" "y")
    '("guint32" "pixel")
  )
)

(define-method get_pixel
  (of-object "GdkImage")
  (c-name "gdk_image_get_pixel")
  (return-type "guint32")
  (parameters
    '("gint" "x")
    '("gint" "y")
  )
)

(define-method set_colormap
  (of-object "GdkImage")
  (c-name "gdk_image_set_colormap")
  (return-type "none")
  (parameters
    '("GdkColormap*" "colormap")
  )
)

(define-method get_colormap
  (of-object "GdkImage")
  (c-name "gdk_image_get_colormap")
  (return-type "GdkColormap*")
)



;; From /opt/gtk2/include/gtk-2.0/gdk/gdkinput.h

(define-function device_get_type
  (c-name "gdk_device_get_type")
  (return-type "GType")
)

(define-function devices_list
  (c-name "gdk_devices_list")
  (return-type "GList*")
)

(define-method set_source
  (of-object "GdkDevice")
  (c-name "gdk_device_set_source")
  (return-type "none")
  (parameters
    '("GdkInputSource" "source")
  )
)

(define-method set_mode
  (of-object "GdkDevice")
  (c-name "gdk_device_set_mode")
  (return-type "gboolean")
  (parameters
    '("GdkInputMode" "mode")
  )
)

(define-method set_key
  (of-object "GdkDevice")
  (c-name "gdk_device_set_key")
  (return-type "none")
  (parameters
    '("guint" "index")
    '("guint" "keyval")
    '("GdkModifierType" "modifiers")
  )
)

(define-method set_axis_use
  (of-object "GdkDevice")
  (c-name "gdk_device_set_axis_use")
  (return-type "none")
  (parameters
    '("guint" "index")
    '("GdkAxisUse" "use")
  )
)

(define-method get_state
  (of-object "GdkDevice")
  (c-name "gdk_device_get_state")
  (return-type "none")
  (parameters
    '("GdkWindow*" "window")
    '("gdouble*" "axes")
    '("GdkModifierType*" "mask")
  )
)

(define-method get_history
  (of-object "GdkDevice")
  (c-name "gdk_device_get_history")
  (return-type "gboolean")
  (parameters
    '("GdkWindow*" "window")
    '("guint32" "start")
    '("guint32" "stop")
    '("GdkTimeCoord***" "events")
    '("gint*" "n_events")
  )
)

(define-function device_free_history
  (c-name "gdk_device_free_history")
  (return-type "none")
  (parameters
    '("GdkTimeCoord**" "events")
    '("gint" "n_events")
  )
)

(define-method get_axis
  (of-object "GdkDevice")
  (c-name "gdk_device_get_axis")
  (return-type "gboolean")
  (parameters
    '("gdouble*" "axes")
    '("GdkAxisUse" "use")
    '("gdouble*" "value")
  )
)

(define-method input_set_extension_events
  (of-object "GdkWindow")
  (c-name "gdk_input_set_extension_events")
  (return-type "none")
  (parameters
    '("gint" "mask")
    '("GdkExtensionMode" "mode")
  )
)

(define-function device_get_core_pointer
  (c-name "gdk_device_get_core_pointer")
  (return-type "GdkDevice*")
)



;; from /opt/gtk2/include/gtk-2.0/gdk/gdkkeys.h

(define-function gdk_keymap_get_type
  (c-name "gdk_keymap_get_type")
  (return-type "GType")
)

(define-function keymap_get_default
  (c-name "gdk_keymap_get_default")
  (return-type "GdkKeymap*")
)

(define-function keymap_get_for_display
  (c-name "gdk_keymap_get_for_display")
  (return-type "GdkKeymap*")
  (parameters
    '("GdkDisplay*" "display")
  )
)

(define-method lookup_key
  (of-object "GdkKeymap")
  (c-name "gdk_keymap_lookup_key")
  (return-type "guint")
  (parameters
    '("const-GdkKeymapKey*" "key")
  )
)

(define-method translate_keyboard_state
  (of-object "GdkKeymap")
  (c-name "gdk_keymap_translate_keyboard_state")
  (return-type "gboolean")
  (parameters
    '("guint" "hardware_keycode")
    '("GdkModifierType" "state")
    '("gint" "group")
    '("guint*" "keyval")
    '("gint*" "effective_group")
    '("gint*" "level")
    '("GdkModifierType*" "consumed_modifiers")
  )
)

(define-method get_entries_for_keyval
  (of-object "GdkKeymap")
  (c-name "gdk_keymap_get_entries_for_keyval")
  (return-type "gboolean")
  (parameters
    '("guint" "keyval")
    '("GdkKeymapKey**" "keys")
    '("gint*" "n_keys")
  )
)

(define-method get_entries_for_keycode
  (of-object "GdkKeymap")
  (c-name "gdk_keymap_get_entries_for_keycode")
  (return-type "gboolean")
  (parameters
    '("guint" "hardware_keycode")
    '("GdkKeymapKey**" "keys")
    '("guint**" "keyvals")
    '("gint*" "n_entries")
  )
)

(define-method get_direction
  (of-object "GdkKeymap")
  (c-name "gdk_keymap_get_direction")
  (return-type "PangoDirection")
)

(define-function keyval_name
  (c-name "gdk_keyval_name")
  (return-type "gchar*")
  (parameters
    '("guint" "keyval")
  )
  (caller-owns-return #f)
)

(define-function keyval_from_name
  (c-name "gdk_keyval_from_name")
  (return-type "guint")
  (parameters
    '("const-gchar*" "keyval_name")
  )
)

(define-function keyval_convert_case
  (c-name "gdk_keyval_convert_case")
  (return-type "none")
  (parameters
    '("guint" "symbol")
    '("guint*" "lower")
    '("guint*" "upper")
  )
)

(define-function keyval_to_upper
  (c-name "gdk_keyval_to_upper")
  (return-type "guint")
  (parameters
    '("guint" "keyval")
  )
)

(define-function keyval_to_lower
  (c-name "gdk_keyval_to_lower")
  (return-type "guint")
  (parameters
    '("guint" "keyval")
  )
)

(define-function keyval_is_upper
  (c-name "gdk_keyval_is_upper")
  (return-type "gboolean")
  (parameters
    '("guint" "keyval")
  )
)

(define-function keyval_is_lower
  (c-name "gdk_keyval_is_lower")
  (return-type "gboolean")
  (parameters
    '("guint" "keyval")
  )
)

(define-function keyval_to_unicode
  (c-name "gdk_keyval_to_unicode")
  (return-type "guint32")
  (parameters
    '("guint" "keyval")
  )
)

(define-function unicode_to_keyval
  (c-name "gdk_unicode_to_keyval")
  (return-type "guint")
  (parameters
    '("guint32" "wc")
  )
)



;; From /opt/gtk2/include/gtk-2.0/gdk/gdkpixbuf.h

(define-method render_to_drawable
  (deprecated "use gtk.gdk.Drawable.draw_pixbuf")
  (of-object "GdkPixbuf")
  (c-name "gdk_pixbuf_render_to_drawable")
  (return-type "none")
  (parameters
    '("GdkDrawable*" "drawable")
    '("GdkGC*" "gc")
    '("int" "src_x")
    '("int" "src_y")
    '("int" "dest_x")
    '("int" "dest_y")
    '("int" "width")
    '("int" "height")
    '("GdkRgbDither" "dither" (default "GDK_RGB_DITHER_NORMAL"))
    '("gint" "x_dither" (default "0"))
    '("gint" "y_dither" (default "0"))
  )
)

(define-method render_to_drawable_alpha
  (deprecated "use gtk.gdk.Drawable.draw_pixbuf")
  (of-object "GdkPixbuf")
  (c-name "gdk_pixbuf_render_to_drawable_alpha")
  (return-type "none")
  (parameters
    '("GdkDrawable*" "drawable")
    '("int" "src_x")
    '("int" "src_y")
    '("int" "dest_x")
    '("int" "dest_y")
    '("int" "width")
    '("int" "height")
    '("GdkPixbufAlphaMode" "alpha_mode")
    '("int" "alpha_threshold")
    '("GdkRgbDither" "dither" (default "GDK_RGB_DITHER_NORMAL"))
    '("gint" "x_dither" (default "0"))
    '("gint" "y_dither" (default "0"))
  )
)

(define-method render_pixmap_and_mask
  (of-object "GdkPixbuf")
  (c-name "gdk_pixbuf_render_pixmap_and_mask")
  (return-type "none")
  (parameters
    '("GdkPixmap**" "pixmap_return")
    '("GdkBitmap**" "mask_return")
    '("int" "alpha_threshold" (default "127"))
  )
)

(define-method get_from_drawable
  (of-object "GdkPixbuf")
  (c-name "gdk_pixbuf_get_from_drawable")
  (return-type "GdkPixbuf*")
  (parameters
    '("GdkDrawable*" "src")
    '("GdkColormap*" "cmap")
    '("int" "src_x")
    '("int" "src_y")
    '("int" "dest_x")
    '("int" "dest_y")
    '("int" "width")
    '("int" "height")
  )
)

(define-method get_from_image
  (of-object "GdkPixbuf")
  (c-name "gdk_pixbuf_get_from_image")
  (return-type "GdkPixbuf*")
  (parameters
    '("GdkImage*" "src")
    '("GdkColormap*" "cmap")
    '("int" "src_x")
    '("int" "src_y")
    '("int" "dest_x")
    '("int" "dest_y")
    '("int" "width")
    '("int" "height")
  )
)



;; From /opt/gtk2/include/gtk-2.0/gdk/gdkpixmap.h

(define-function gdk_pixmap_get_type
  (c-name "gdk_pixmap_get_type")
  (return-type "GType")
)

(define-function gdk_pixmap_new
  (is-constructor-of GdkPixmap)
  (c-name "gdk_pixmap_new")
  (return-type "GdkPixmap*")
  (parameters
    '("GdkDrawable*" "drawable" (null-ok))
    '("gint" "width")
    '("gint" "height")
    '("gint" "depth" (default "-1"))
  )
)

(define-function bitmap_create_from_data
  (c-name "gdk_bitmap_create_from_data")
  (return-type "GdkBitmap*")
  (parameters
    '("GdkDrawable*" "drawable" (null-ok))
    '("const-guchar*" "data")
    '("gint" "width")
    '("gint" "height")
  )
)

(define-function pixmap_create_from_data
  (c-name "gdk_pixmap_create_from_data")
  (return-type "GdkPixmap*")
  (parameters
    '("GdkDrawable*" "drawable" (null-ok))
    '("const-guchar*" "data")
    '("gint" "width")
    '("gint" "height")
    '("gint" "depth")
    '("GdkColor*" "fg")
    '("GdkColor*" "bg")
  )
)

(define-function pixmap_create_from_xpm
  (c-name "gdk_pixmap_create_from_xpm")
  (return-type "GdkPixmap*")
  (parameters
    '("GdkDrawable*" "drawable")
    '("GdkBitmap**" "mask")
    '("GdkColor*" "transparent_color")
    '("const-gchar*" "filename")
  )
)

(define-function pixmap_colormap_create_from_xpm
  (c-name "gdk_pixmap_colormap_create_from_xpm")
  (return-type "GdkPixmap*")
  (parameters
    '("GdkDrawable*" "drawable")
    '("GdkColormap*" "colormap")
    '("GdkBitmap**" "mask")
    '("GdkColor*" "transparent_color")
    '("const-gchar*" "filename")
  )
)

(define-function pixmap_create_from_xpm_d
  (c-name "gdk_pixmap_create_from_xpm_d")
  (return-type "GdkPixmap*")
  (parameters
    '("GdkDrawable*" "drawable")
    '("GdkBitmap**" "mask")
    '("GdkColor*" "transparent_color")
    '("gchar**" "data")
  )
)

(define-function pixmap_colormap_create_from_xpm_d
  (c-name "gdk_pixmap_colormap_create_from_xpm_d")
  (return-type "GdkPixmap*")
  (parameters
    '("GdkDrawable*" "drawable")
    '("GdkColormap*" "colormap")
    '("GdkBitmap**" "mask")
    '("GdkColor*" "transparent_color")
    '("gchar**" "data")
  )
)

(define-function pixmap_foreign_new
  (c-name "gdk_pixmap_foreign_new")
  (return-type "GdkPixmap*")
  (caller-owns-return #t)
  (parameters
    '("GdkNativeWindow" "anid")
  )
)

(define-function pixmap_lookup
  (c-name "gdk_pixmap_lookup")
  (return-type "GdkPixmap*")
  (parameters
    '("GdkNativeWindow" "anid")
  )
)

(define-function pixmap_foreign_new_for_display
  (c-name "gdk_pixmap_foreign_new_for_display")
  (return-type "GdkPixmap*")
  (caller-owns-return #t)
  (parameters
    '("GdkDisplay*" "display")
    '("GdkNativeWindow" "anid")
  )
)

(define-function pixmap_lookup_for_display
  (c-name "gdk_pixmap_lookup_for_display")
  (return-type "GdkPixmap*")
  (parameters
    '("GdkDisplay*" "display")
    '("GdkNativeWindow" "anid")
  )
)



;; From /opt/gtk2/include/gtk-2.0/gdk/gdkproperty.h

(define-method name
  (of-object "GdkAtom")
  (c-name "gdk_atom_name")
  (return-type "gchar*")
)

(define-function atom_intern
  (c-name "gdk_atom_intern")
  (return-type "GdkAtom")
  (parameters
   '("gchar*" "atom_name")
    '("gboolean" "only_if_exists" (default "FALSE"))
  )
)

(define-method property_get
  (of-object "GdkWindow")
  (c-name "gdk_property_get")
  (return-type "gboolean")
  (parameters
    '("GdkAtom" "property")
    '("GdkAtom" "type")
    '("gulong" "offset")
    '("gulong" "length")
    '("gint" "pdelete")
    '("GdkAtom*" "actual_property_type")
    '("gint*" "actual_format")
    '("gint*" "actual_length")
    '("guchar**" "data")
  )
)

(define-method property_change
  (of-object "GdkWindow")
  (c-name "gdk_property_change")
  (return-type "none")
  (parameters
    '("GdkAtom" "property")
    '("GdkAtom" "type")
    '("gint" "format")
    '("GdkPropMode" "mode")
    '("const-guchar*" "data")
    '("gint" "nelements")
  )
)

(define-method property_delete
  (of-object "GdkWindow")
  (c-name "gdk_property_delete")
  (return-type "none")
  (parameters
    '("GdkAtom" "property")
  )
)



;; From /opt/gtk2/include/gtk-2.0/gdk/gdkrgb.h

(define-function rgb_xpixel_from_rgb
  (c-name "gdk_rgb_xpixel_from_rgb")
  (return-type "gulong")
  (parameters
    '("guint32" "rgb")
  )
)

(define-function rgb_gc_set_foreground
  (c-name "gdk_rgb_gc_set_foreground")
  (return-type "none")
  (parameters
    '("GdkGC*" "gc")
    '("guint32" "rgb")
  )
)

(define-function rgb_gc_set_background
  (c-name "gdk_rgb_gc_set_background")
  (return-type "none")
  (parameters
    '("GdkGC*" "gc")
    '("guint32" "rgb")
  )
)

(define-method draw_rgb_image
  (of-object "GdkDrawable")
  (c-name "gdk_draw_rgb_image")
  (return-type "none")
  (parameters
    '("GdkGC*" "gc")
    '("gint" "x")
    '("gint" "y")
    '("gint" "width")
    '("gint" "height")
    '("GdkRgbDither" "dith")
    '("guchar*" "rgb_buf")
    '("gint" "rowstride")
  )
)

(define-method draw_rgb_image_dithalign
  (of-object "GdkDrawable")
  (c-name "gdk_draw_rgb_image_dithalign")
  (return-type "none")
  (parameters
    '("GdkGC*" "gc")
    '("gint" "x")
    '("gint" "y")
    '("gint" "width")
    '("gint" "height")
    '("GdkRgbDither" "dith")
    '("guchar*" "rgb_buf")
    '("gint" "rowstride")
    '("gint" "xdith")
    '("gint" "ydith")
  )
)

(define-method draw_rgb_32_image
  (of-object "GdkDrawable")
  (c-name "gdk_draw_rgb_32_image")
  (return-type "none")
  (parameters
    '("GdkGC*" "gc")
    '("gint" "x")
    '("gint" "y")
    '("gint" "width")
    '("gint" "height")
    '("GdkRgbDither" "dith")
    '("guchar*" "buf")
    '("gint" "rowstride")
  )
)

(define-method draw_gray_image
  (of-object "GdkDrawable")
  (c-name "gdk_draw_gray_image")
  (return-type "none")
  (parameters
    '("GdkGC*" "gc")
    '("gint" "x")
    '("gint" "y")
    '("gint" "width")
    '("gint" "height")
    '("GdkRgbDither" "dith")
    '("guchar*" "buf")
    '("gint" "rowstride")
  )
)

(define-function rgb_cmap_new
  (c-name "gdk_rgb_cmap_new")
  (return-type "GdkRgbCmap*")
  (parameters
    '("guint32*" "colors")
    '("gint" "n_colors")
  )
)

(define-method draw_indexed_image
  (of-object "GdkDrawable")
  (c-name "gdk_draw_indexed_image")
  (return-type "none")
  (parameters
    '("GdkGC*" "gc")
    '("gint" "x")
    '("gint" "y")
    '("gint" "width")
    '("gint" "height")
    '("GdkRgbDither" "dith")
    '("guchar*" "buf")
    '("gint" "rowstride")
    '("GdkRgbCmap*" "cmap")
  )
)

(define-function rgb_ditherable
  (c-name "gdk_rgb_ditherable")
  (return-type "gboolean")
)

(define-function rgb_set_verbose
  (c-name "gdk_rgb_set_verbose")
  (return-type "none")
  (parameters
    '("gboolean" "verbose")
  )
)

(define-function rgb_set_install
  (c-name "gdk_rgb_set_install")
  (return-type "none")
  (parameters
    '("gboolean" "install")
  )
)

(define-function rgb_set_min_colors
  (c-name "gdk_rgb_set_min_colors")
  (return-type "none")
  (parameters
    '("gint" "min_colors")
  )
)

(define-function rgb_get_colormap
  (c-name "gdk_rgb_get_colormap")
  (return-type "GdkColormap*")
)

(define-function rgb_get_cmap
  (deprecated "use gtk.gdk.rgb_get_colormap instead")
  (c-name "gdk_rgb_get_cmap")
  (return-type "GdkColormap*")
)

(define-function rgb_get_visual
  (c-name "gdk_rgb_get_visual")
  (return-type "GdkVisual*")
)



;; From /opt/gtk2/include/gtk-2.0/gdk/gdkscreen.h
 
(define-function gdk_screen_get_type
  (c-name "gdk_screen_get_type")
  (return-type "GType")
)
 
(define-method get_default_colormap
  (of-object "GdkScreen")
  (c-name "gdk_screen_get_default_colormap")
  (return-type "GdkColormap*")
)

(define-method set_default_colormap
  (of-object "GdkScreen")
  (c-name "gdk_screen_set_default_colormap")
  (return-type "none")
  (parameters
    '("GdkColormap*" "colormap")
  )
)

(define-method get_system_colormap
  (of-object "GdkScreen")
  (c-name "gdk_screen_get_system_colormap")
  (return-type "GdkColormap*")
)

(define-method get_system_visual
  (of-object "GdkScreen")
  (c-name "gdk_screen_get_system_visual")
  (return-type "GdkVisual*")
)

(define-method get_rgb_colormap
  (of-object "GdkScreen")
  (c-name "gdk_screen_get_rgb_colormap")
  (return-type "GdkColormap*")
)

(define-method get_rgb_visual
  (of-object "GdkScreen")
  (c-name "gdk_screen_get_rgb_visual")
  (return-type "GdkVisual*")
)

(define-method get_root_window
  (of-object "GdkScreen")
  (c-name "gdk_screen_get_root_window")
  (return-type "GdkWindow*")
)

(define-method get_display
  (of-object "GdkScreen")
  (c-name "gdk_screen_get_display")
  (return-type "GdkDisplay*")
)

(define-method get_number
  (of-object "GdkScreen")
  (c-name "gdk_screen_get_number")
  (return-type "gint")
)

(define-method get_width
  (of-object "GdkScreen")
  (c-name "gdk_screen_get_width")
  (return-type "gint")
)

(define-method get_height
  (of-object "GdkScreen")
  (c-name "gdk_screen_get_height")
  (return-type "gint")
)

(define-method get_width_mm
  (of-object "GdkScreen")
  (c-name "gdk_screen_get_width_mm")
  (return-type "gint")
)

(define-method get_height_mm
  (of-object "GdkScreen")
  (c-name "gdk_screen_get_height_mm")
  (return-type "gint")
)

(define-method list_visuals
  (of-object "GdkScreen")
  (c-name "gdk_screen_list_visuals")
  (return-type "GList*")
)

(define-method get_toplevel_windows
  (of-object "GdkScreen")
  (c-name "gdk_screen_get_toplevel_windows")
  (return-type "GList*")
)

(define-method make_display_name
  (of-object "GdkScreen")
  (c-name "gdk_screen_make_display_name")
  (return-type "gchar*")
)

(define-method get_n_monitors
  (of-object "GdkScreen")
  (c-name "gdk_screen_get_n_monitors")
  (return-type "gint")
)

(define-method get_monitor_geometry
  (of-object "GdkScreen")
  (c-name "gdk_screen_get_monitor_geometry")
  (return-type "none")
  (parameters
    '("gint" "monitor_num")
    '("GdkRectangle*" "dest")
  )
)

(define-method get_monitor_at_point
  (of-object "GdkScreen")
  (c-name "gdk_screen_get_monitor_at_point")
  (return-type "gint")
  (parameters
    '("gint" "x")
    '("gint" "y")
  )
)

(define-method get_monitor_at_window
  (of-object "GdkScreen")
  (c-name "gdk_screen_get_monitor_at_window")
  (return-type "gint")
  (parameters
    '("GdkWindow*" "window")
  )
)

(define-method broadcast_client_message
  (of-object "GdkScreen")
  (c-name "gdk_screen_broadcast_client_message")
  (return-type "none")
  (parameters
    '("GdkEvent*" "event")
  )
)

(define-function screen_get_default
  (c-name "gdk_screen_get_default")
  (return-type "GdkScreen*")
)

(define-method get_setting
  (of-object "GdkScreen")
  (c-name "gdk_screen_get_setting")
  (return-type "gboolean")
  (parameters
    '("const-gchar*" "name")
    '("GValue*" "value")
  )
)

(define-method alternative_dialog_button_order
  (of-object "GdkScreen")
  (c-name "gtk_alternative_dialog_button_order")
  (return-type "gboolean")
)


;; From /opt/gtk2/include/gtk-2.0/gdk/gdkselection.h

(define-function selection_owner_set
  (c-name "gdk_selection_owner_set")
  (return-type "gboolean")
  (parameters
    '("GdkWindow*" "owner")
    '("GdkAtom" "selection")
    '("guint32" "time")
    '("gboolean" "send_event")
  )
)

(define-function selection_owner_get
  (c-name "gdk_selection_owner_get")
  (return-type "GdkWindow*")
  (parameters
    '("GdkAtom" "selection")
  )
)

(define-function selection_owner_set_for_display
  (c-name "gdk_selection_owner_set_for_display")
  (return-type "gboolean")
  (parameters
    '("GdkDisplay*" "display")
    '("GdkWindow*" "owner")
    '("GdkAtom" "selection")
    '("guint32" "time")
    '("gboolean" "send_event")
  )
)

(define-function selection_owner_get_for_display
  (c-name "gdk_selection_owner_get_for_display")
  (return-type "GdkWindow*")
  (parameters
    '("GdkDisplay*" "display")
    '("GdkAtom" "selection")
  )
)

(define-method selection_convert
  (of-object "GdkWindow")
  (c-name "gdk_selection_convert")
  (return-type "none")
  (parameters
    '("GdkAtom" "selection")
    '("GdkAtom" "target")
    '("guint32" "time")
  )
)

(define-method selection_property_get
  (of-object "GdkWindow")
  (c-name "gdk_selection_property_get")
  (return-type "gboolean")
  (parameters
    '("guchar**" "data")
    '("GdkAtom*" "prop_type")
    '("gint*" "prop_format")
  )
)

(define-function selection_send_notify
  (c-name "gdk_selection_send_notify")
  (return-type "none")
  (parameters
    '("guint32" "requestor")
    '("GdkAtom" "selection")
    '("GdkAtom" "target")
    '("GdkAtom" "property")
    '("guint32" "time")
  )
)

(define-function selection_send_notify_for_display
  (c-name "gdk_selection_send_notify_for_display")
  (return-type "none")
  (parameters
    '("GdkDisplay*" "display")
    '("guint32" "requestor")
    '("GdkAtom" "selection")
    '("GdkAtom" "target")
    '("GdkAtom" "property")
    '("guint32" "time")
  )
)



;; From /opt/gtk2/include/gtk-2.0/gdk/gdkvisual.h

(define-function visual_get_best_depth
  (c-name "gdk_visual_get_best_depth")
  (return-type "gint")
)

(define-function visual_get_best_type
  (c-name "gdk_visual_get_best_type")
  (return-type "GdkVisualType")
)

(define-function visual_get_system
  (c-name "gdk_visual_get_system")
  (return-type "GdkVisual*")
)

(define-function visual_get_best
  (c-name "gdk_visual_get_best")
  (return-type "GdkVisual*")
)

(define-function visual_get_best_with_depth
  (c-name "gdk_visual_get_best_with_depth")
  (return-type "GdkVisual*")
  (parameters
    '("gint" "depth")
  )
)

(define-function visual_get_best_with_type
  (c-name "gdk_visual_get_best_with_type")
  (return-type "GdkVisual*")
  (parameters
    '("GdkVisualType" "visual_type")
  )
)

(define-function visual_get_best_with_both
  (is-constructor-of GdkVisual)
  (c-name "gdk_visual_get_best_with_both")
  (return-type "GdkVisual*")
  (parameters
    '("gint" "depth")
    '("GdkVisualType" "visual_type")
  )
)

(define-function query_depths
  (c-name "gdk_query_depths")
  (return-type "none")
  (parameters
    '("gint**" "depths")
    '("gint*" "count")
  )
)

(define-function query_visual_types
  (c-name "gdk_query_visual_types")
  (return-type "none")
  (parameters
    '("GdkVisualType**" "visual_types")
    '("gint*" "count")
  )
)

(define-function list_visuals
  (c-name "gdk_list_visuals")
  (return-type "GList*")
)

(define-method get_screen
  (of-object "GdkVisual")
  (c-name "gdk_visual_get_screen")
  (return-type "GdkScreen*")
)


;; From /opt/gtk2/include/gtk-2.0/gdk/gdkwindow.h

(define-function gdk_window_object_get_type
  (c-name "gdk_window_object_get_type")
  (return-type "GType")
)

(define-function new
  (is-constructor-of GdkWindow)
  (c-name "gdk_window_new")
  (return-type "GdkWindow*")
  (parameters
    '("GdkWindow*" "parent")
    '("GdkWindowAttr*" "attributes")
    '("gint" "attributes_mask")
  )
)

(define-method set_keep_above
  (c-name "gdk_window_set_keep_above")
  (of-object "GdkWindow")
  (parameters
    '("gboolean" "setting")
  )
)

(define-method set_keep_below
  (c-name "gdk_window_set_keep_below")
  (of-object "GdkWindow")
  (parameters
    '("gboolean" "setting")
  )
)

(define-method destroy
  (of-object "GdkWindow")
  (c-name "gdk_window_destroy")
  (return-type "none")
)

(define-method get_window_type
  (of-object "GdkWindow")
  (c-name "gdk_window_get_window_type")
  (return-type "GdkWindowType")
)

(define-function window_at_pointer
  (c-name "gdk_window_at_pointer")
  (return-type "GdkWindow*")
  (parameters
    '("gint*" "win_x")
    '("gint*" "win_y")
  )
)

(define-method show
  (of-object "GdkWindow")
  (c-name "gdk_window_show")
  (return-type "none")
)

(define-method hide
  (of-object "GdkWindow")
  (c-name "gdk_window_hide")
  (return-type "none")
)

(define-method withdraw
  (of-object "GdkWindow")
  (c-name "gdk_window_withdraw")
  (return-type "none")
)

(define-method move
  (of-object "GdkWindow")
  (c-name "gdk_window_move")
  (return-type "none")
  (parameters
    '("gint" "x")
    '("gint" "y")
  )
)

(define-method resize
  (of-object "GdkWindow")
  (c-name "gdk_window_resize")
  (return-type "none")
  (parameters
    '("gint" "width")
    '("gint" "height")
  )
)

(define-method move_resize
  (of-object "GdkWindow")
  (c-name "gdk_window_move_resize")
  (return-type "none")
  (parameters
    '("gint" "x")
    '("gint" "y")
    '("gint" "width")
    '("gint" "height")
  )
)

(define-method reparent
  (of-object "GdkWindow")
  (c-name "gdk_window_reparent")
  (return-type "none")
  (parameters
    '("GdkWindow*" "new_parent")
    '("gint" "x")
    '("gint" "y")
  )
)

(define-method clear
  (of-object "GdkWindow")
  (c-name "gdk_window_clear")
  (return-type "none")
)

(define-method clear_area
  (of-object "GdkWindow")
  (c-name "gdk_window_clear_area")
  (return-type "none")
  (parameters
    '("gint" "x")
    '("gint" "y")
    '("gint" "width")
    '("gint" "height")
  )
)

(define-method clear_area_e
  (of-object "GdkWindow")
  (c-name "gdk_window_clear_area_e")
  (return-type "none")
  (parameters
    '("gint" "x")
    '("gint" "y")
    '("gint" "width")
    '("gint" "height")
  )
)

(define-method raise
  (of-object "GdkWindow")
  (c-name "gdk_window_raise")
  (return-type "none")
)

(define-method lower
  (of-object "GdkWindow")
  (c-name "gdk_window_lower")
  (return-type "none")
)

(define-method focus
  (of-object "GdkWindow")
  (c-name "gdk_window_focus")
  (return-type "none")
  (parameters
    '("guint32" "timestamp" (null-ok) (default "GDK_CURRENT_TIME"))
  )
)

(define-method set_user_data
  (of-object "GdkWindow")
  (c-name "gdk_window_set_user_data")
  (return-type "none")
  (parameters
    '("gpointer" "user_data")
  )
)

(define-method get_user_data
  (of-object "GdkWindow")
  (c-name "gdk_window_get_user_data")
  (return-type "none")
  (parameters
    '("gpointer*" "user_data")
  )
)

(define-method set_override_redirect
  (of-object "GdkWindow")
  (c-name "gdk_window_set_override_redirect")
  (return-type "none")
  (parameters
    '("gboolean" "override_redirect")
  )
)

(define-method add_filter
  (of-object "GdkWindow")
  (c-name "gdk_window_add_filter")
  (return-type "none")
  (parameters
    '("GdkFilterFunc" "function")
    '("gpointer" "data")
  )
)

(define-method remove_filter
  (of-object "GdkWindow")
  (c-name "gdk_window_remove_filter")
  (return-type "none")
  (parameters
    '("GdkFilterFunc" "function")
    '("gpointer" "data")
  )
)

(define-method scroll
  (of-object "GdkWindow")
  (c-name "gdk_window_scroll")
  (return-type "none")
  (parameters
    '("gint" "dx")
    '("gint" "dy")
  )
)

(define-method shape_combine_mask
  (of-object "GdkWindow")
  (c-name "gdk_window_shape_combine_mask")
  (return-type "none")
  (parameters
    '("GdkBitmap*" "shape_mask" (null-ok))
    '("gint" "offset_x")
    '("gint" "offset_y")
  )
)

(define-method set_child_shapes
  (of-object "GdkWindow")
  (c-name "gdk_window_set_child_shapes")
  (return-type "none")
)

(define-method merge_child_shapes
  (of-object "GdkWindow")
  (c-name "gdk_window_merge_child_shapes")
  (return-type "none")
)

(define-method is_visible
  (of-object "GdkWindow")
  (c-name "gdk_window_is_visible")
  (return-type "gboolean")
)

(define-method is_viewable
  (of-object "GdkWindow")
  (c-name "gdk_window_is_viewable")
  (return-type "gboolean")
)

(define-method get_state
  (of-object "GdkWindow")
  (c-name "gdk_window_get_state")
  (return-type "GdkWindowState")
)

(define-method set_static_gravities
  (of-object "GdkWindow")
  (c-name "gdk_window_set_static_gravities")
  (return-type "gboolean")
  (parameters
    '("gboolean" "use_static")
  )
)

(define-function window_foreign_new
  (c-name "gdk_window_foreign_new")
  (return-type "GdkWindow*")
  (caller-owns-return #t)
  (parameters
    '("GdkNativeWindow" "anid")
  )
)

(define-function window_lookup
  (c-name "gdk_window_lookup")
  (return-type "GdkWindow*")
  (parameters
    '("GdkNativeWindow" "anid")
  )
)

(define-function window_foreign_new_for_display
  (c-name "gdk_window_foreign_new_for_display")
  (return-type "GdkWindow*")
  (caller-owns-return #t)
  (parameters
    '("GdkDisplay*" "display")
    '("GdkNativeWindow" "anid")
  )
)

(define-function window_lookup_for_display
  (c-name "gdk_window_lookup_for_display")
  (return-type "GdkWindow*")
  (parameters
    '("GdkDisplay*" "display")
    '("GdkNativeWindow" "anid")
  )
)

(define-method set_hints
  (of-object "GdkWindow")
  (c-name "gdk_window_set_hints")
  (return-type "none")
  (parameters
    '("gint" "x")
    '("gint" "y")
    '("gint" "min_width")
    '("gint" "min_height")
    '("gint" "max_width")
    '("gint" "max_height")
    '("gint" "flags")
  )
)

(define-method set_type_hint
  (of-object "GdkWindow")
  (c-name "gdk_window_set_type_hint")
  (return-type "none")
  (parameters
    '("GdkWindowTypeHint" "hint")
  )
)

(define-method set_modal_hint
  (of-object "GdkWindow")
  (c-name "gdk_window_set_modal_hint")
  (return-type "none")
  (parameters
    '("gboolean" "modal")
  )
)

(define-method set_skip_taskbar_hint
  (of-object "GdkWindow")
  (c-name "gdk_window_set_skip_taskbar_hint")
  (return-type "none")
  (parameters
    '("gboolean" "modal")
  )
)

(define-method set_skip_pager_hint
  (of-object "GdkWindow")
  (c-name "gdk_window_set_skip_pager_hint")
  (return-type "none")
  (parameters
    '("gboolean" "modal")
  )
)

(define-method set_geometry_hints
  (of-object "GdkWindow")
  (c-name "gdk_window_set_geometry_hints")
  (return-type "none")
  (parameters
    '("GdkGeometry*" "geometry")
    '("GdkWindowHints" "flags")
  )
)

(define-function set_sm_client_id
  (c-name "gdk_set_sm_client_id")
  (return-type "none")
  (parameters
    '("const-gchar*" "sm_client_id")
  )
)

(define-method begin_paint_rect
  (of-object "GdkWindow")
  (c-name "gdk_window_begin_paint_rect")
  (return-type "none")
  (parameters
    '("GdkRectangle*" "rectangle")
  )
)

(define-method begin_paint_region
  (of-object "GdkWindow")
  (c-name "gdk_window_begin_paint_region")
  (return-type "none")
  (parameters
    '("GdkRegion*" "region")
  )
)

(define-method end_paint
  (of-object "GdkWindow")
  (c-name "gdk_window_end_paint")
  (return-type "none")
)

(define-method set_title
  (of-object "GdkWindow")
  (c-name "gdk_window_set_title")
  (return-type "none")
  (parameters
    '("const-gchar*" "title")
  )
)

(define-method set_role
  (of-object "GdkWindow")
  (c-name "gdk_window_set_role")
  (return-type "none")
  (parameters
    '("const-gchar*" "role")
  )
)

(define-method set_transient_for
  (of-object "GdkWindow")
  (c-name "gdk_window_set_transient_for")
  (return-type "none")
  (parameters
    '("GdkWindow*" "leader")
  )
)

(define-method set_background
  (of-object "GdkWindow")
  (c-name "gdk_window_set_background")
  (return-type "none")
  (parameters
    '("GdkColor*" "color")
  )
)

(define-method set_back_pixmap
  (of-object "GdkWindow")
  (c-name "gdk_window_set_back_pixmap")
  (return-type "none")
  (parameters
    '("GdkPixmap*" "pixmap" (null-ok))
    '("gboolean" "parent_relative")
  )
)

(define-method set_cursor
  (of-object "GdkWindow")
  (c-name "gdk_window_set_cursor")
  (return-type "none")
  (parameters
    '("GdkCursor*" "cursor" (null-ok))
  )
)

(define-method get_geometry
  (of-object "GdkWindow")
  (c-name "gdk_window_get_geometry")
  (return-type "none")
  (parameters
    '("gint*" "x")
    '("gint*" "y")
    '("gint*" "width")
    '("gint*" "height")
    '("gint*" "depth")
  )
)

(define-method get_position
  (of-object "GdkWindow")
  (c-name "gdk_window_get_position")
  (return-type "none")
  (parameters
    '("gint*" "x")
    '("gint*" "y")
  )
)

(define-method get_origin
  (of-object "GdkWindow")
  (c-name "gdk_window_get_origin")
  (return-type "gint")
  (parameters
    '("gint*" "x")
    '("gint*" "y")
  )
)

(define-method get_deskrelative_origin
  (of-object "GdkWindow")
  (c-name "gdk_window_get_deskrelative_origin")
  (return-type "gboolean")
  (parameters
    '("gint*" "x")
    '("gint*" "y")
  )
)

(define-method get_root_origin
  (of-object "GdkWindow")
  (c-name "gdk_window_get_root_origin")
  (return-type "none")
  (parameters
    '("gint*" "x")
    '("gint*" "y")
  )
)

(define-method get_frame_extents
  (of-object "GdkWindow")
  (c-name "gdk_window_get_frame_extents")
  (return-type "none")
  (parameters
    '("GdkRectangle*" "rect")
  )
)

(define-method get_pointer
  (of-object "GdkWindow")
  (c-name "gdk_window_get_pointer")
  (return-type "GdkWindow*")
  (parameters
    '("gint*" "x")
    '("gint*" "y")
    '("GdkModifierType*" "mask")
  )
)

(define-method get_parent
  (of-object "GdkWindow")
  (c-name "gdk_window_get_parent")
  (return-type "GdkWindow*")
)

(define-method get_toplevel
  (of-object "GdkWindow")
  (c-name "gdk_window_get_toplevel")
  (return-type "GdkWindow*")
)

(define-method get_children
  (of-object "GdkWindow")
  (c-name "gdk_window_get_children")
  (return-type "GList*")
)

(define-method peek_children
  (of-object "GdkWindow")
  (c-name "gdk_window_peek_children")
  (return-type "GList*")
)

(define-method get_events
  (of-object "GdkWindow")
  (c-name "gdk_window_get_events")
  (return-type "GdkEventMask")
)

(define-method set_events
  (of-object "GdkWindow")
  (c-name "gdk_window_set_events")
  (return-type "none")
  (parameters
    '("GdkEventMask" "event_mask")
  )
)

(define-method set_icon_list
  (of-object "GdkWindow")
  (c-name "gdk_window_set_icon_list")
  (return-type "none")
  (parameters
    '("GList*" "pixbufs")
  )
)

(define-method set_icon
  (of-object "GdkWindow")
  (c-name "gdk_window_set_icon")
  (return-type "none")
  (parameters
    '("GdkWindow*" "icon_window")
    '("GdkPixmap*" "pixmap")
    '("GdkBitmap*" "mask")
  )
)

(define-method set_icon_name
  (of-object "GdkWindow")
  (c-name "gdk_window_set_icon_name")
  (return-type "none")
  (parameters
    '("const-gchar*" "name")
  )
)

(define-method set_group
  (of-object "GdkWindow")
  (c-name "gdk_window_set_group")
  (return-type "none")
  (parameters
    '("GdkWindow*" "leader")
  )
)

(define-method get_group
  (of-object "GdkWindow")
  (c-name "gdk_window_get_group")
  (return-type "GdkWindow*")
)

(define-method set_decorations
  (of-object "GdkWindow")
  (c-name "gdk_window_set_decorations")
  (return-type "none")
  (parameters
    '("GdkWMDecoration" "decorations")
  )
)

(define-method get_decorations
  (of-object "GdkWindow")
  (c-name "gdk_window_get_decorations")
  (return-type "gboolean")
  (parameters
    '("GdkWMDecoration*" "decorations")
  )
)

(define-method set_functions
  (of-object "GdkWindow")
  (c-name "gdk_window_set_functions")
  (return-type "none")
  (parameters
    '("GdkWMFunction" "functions")
  )
)

(define-function window_get_toplevels
  (c-name "gdk_window_get_toplevels")
  (return-type "GList*")
)

(define-method iconify
  (of-object "GdkWindow")
  (c-name "gdk_window_iconify")
  (return-type "none")
)

(define-method deiconify
  (of-object "GdkWindow")
  (c-name "gdk_window_deiconify")
  (return-type "none")
)

(define-method stick
  (of-object "GdkWindow")
  (c-name "gdk_window_stick")
  (return-type "none")
)

(define-method unstick
  (of-object "GdkWindow")
  (c-name "gdk_window_unstick")
  (return-type "none")
)

(define-method maximize
  (of-object "GdkWindow")
  (c-name "gdk_window_maximize")
  (return-type "none")
)

(define-method unmaximize
  (of-object "GdkWindow")
  (c-name "gdk_window_unmaximize")
  (return-type "none")
)

(define-method fullscreen
  (of-object "GdkWindow")
  (c-name "gdk_window_fullscreen")
  (return-type "none")
)

(define-method unfullscreen
  (of-object "GdkWindow")
  (c-name "gdk_window_unfullscreen")
  (return-type "none")
)

(define-method register_dnd
  (of-object "GdkWindow")
  (c-name "gdk_window_register_dnd")
  (return-type "none")
)

(define-method begin_resize_drag
  (of-object "GdkWindow")
  (c-name "gdk_window_begin_resize_drag")
  (return-type "none")
  (parameters
    '("GdkWindowEdge" "edge")
    '("gint" "button")
    '("gint" "root_x")
    '("gint" "root_y")
    '("guint32" "timestamp")
  )
)

(define-method begin_move_drag
  (of-object "GdkWindow")
  (c-name "gdk_window_begin_move_drag")
  (return-type "none")
  (parameters
    '("gint" "button")
    '("gint" "root_x")
    '("gint" "root_y")
    '("guint32" "timestamp")
  )
)

(define-method invalidate_rect
  (of-object "GdkWindow")
  (c-name "gdk_window_invalidate_rect")
  (return-type "none")
  (parameters
    '("GdkRectangle*" "rect" (null-ok))
    '("gboolean" "invalidate_children")
  )
)

(define-method invalidate_region
  (of-object "GdkWindow")
  (c-name "gdk_window_invalidate_region")
  (return-type "none")
  (parameters
    '("GdkRegion*" "region")
    '("gboolean" "invalidate_children")
  )
)

(define-method invalidate_maybe_recurse
  (of-object "GdkWindow")
  (c-name "gdk_window_invalidate_maybe_recurse")
  (return-type "none")
  (parameters
    '("GdkRegion*" "region")
    '("gboolean" "(*child_func")
  )
)

(define-method get_update_area
  (of-object "GdkWindow")
  (c-name "gdk_window_get_update_area")
  (return-type "GdkRegion*")
)

(define-method freeze_updates
  (of-object "GdkWindow")
  (c-name "gdk_window_freeze_updates")
  (return-type "none")
)

(define-method thaw_updates
  (of-object "GdkWindow")
  (c-name "gdk_window_thaw_updates")
  (return-type "none")
)

(define-function window_process_all_updates
  (c-name "gdk_window_process_all_updates")
  (return-type "none")
)

(define-method process_updates
  (of-object "GdkWindow")
  (c-name "gdk_window_process_updates")
  (return-type "none")
  (parameters
    '("gboolean" "update_children")
  )
)

(define-function gdk_window_set_debug_updates
  (c-name "gdk_window_set_debug_updates")
  (return-type "none")
  (parameters
    '("gboolean" "setting")
  )
)

(define-function gdk_window_constrain_size
  (c-name "gdk_window_constrain_size")
  (return-type "none")
  (parameters
    '("GdkGeometry*" "geometry")
    '("guint" "flags")
    '("gint" "width")
    '("gint" "height")
    '("gint*" "new_width")
    '("gint*" "new_height")
  )
)

(define-method get_internal_paint_info
  (of-object "GdkWindow")
  (c-name "gdk_window_get_internal_paint_info")
  (return-type "none")
  (parameters
    '("GdkDrawable**" "real_drawable")
    '("gint*" "x_offset")
    '("gint*" "y_offset")
  )
)

(define-function gdk_set_pointer_hooks
  (c-name "gdk_set_pointer_hooks")
  (return-type "GdkPointerHooks*")
  (parameters
    '("const-GdkPointerHooks*" "new_hooks")
  )
)

(define-function get_default_root_window
  (c-name "gdk_get_default_root_window")
  (return-type "GdkWindow*")
)

(define-method set_accept_focus
  (of-object "GdkWindow")
  (c-name "gdk_window_set_accept_focus")
  (return-type "none")
  (parameters
    '("gboolean" "accept_focus")
  )
)

(define-method set_focus_on_map
  (of-object "GdkWindow")
  (c-name "gdk_window_set_focus_on_map")
  (return-type "none")
  (parameters
    '("gboolean" "focus_on_map")
  )
)

(define-method enable_synchronized_configure
  (of-object "GdkWindow")
  (c-name "gdk_window_enable_synchronized_configure")
  (return-type "none")
)

(define-method configure_finished
  (of-object "GdkWindow")
  (c-name "gdk_window_configure_finished")
  (return-type "none")
)

(define-function gdk_set_pointer_hooks
  (c-name "gdk_set_pointer_hooks")
  (return-type "GdkPointerHooks*")
  (parameters
    '("const-GdkPointerHooks*" "new_hooks")
  )
)


;;; XXXX functions from GTK that extend GDK types.
(define-method finish
  (of-object "GdkDragContext")
  (c-name "gtk_drag_finish")
  (return-type "none")
  (parameters
    '("gboolean" "success")
    '("gboolean" "del")
    '("guint32" "time" (default "GDK_CURRENT_TIME"))
  )
)

(define-method get_source_widget
  (of-object "GdkDragContext")
  (c-name "gtk_drag_get_source_widget")
  (return-type "GtkWidget*")
)

(define-method set_icon_widget
  (of-object "GdkDragContext")
  (c-name "gtk_drag_set_icon_widget")
  (return-type "none")
  (parameters
    '("GtkWidget*" "widget")
    '("gint" "hot_x")
    '("gint" "hot_y")
  )
)

(define-method set_icon_pixmap
  (of-object "GdkDragContext")
  (c-name "gtk_drag_set_icon_pixmap")
  (return-type "none")
  (parameters
    '("GdkColormap*" "colormap")
    '("GdkPixmap*" "pixmap")
    '("GdkBitmap*" "mask")
    '("gint" "hot_x")
    '("gint" "hot_y")
  )
)

(define-method set_icon_pixbuf
  (of-object "GdkDragContext")
  (c-name "gtk_drag_set_icon_pixbuf")
  (return-type "none")
  (parameters
    '("GdkPixbuf*" "pixbuf")
    '("gint" "hot_x")
    '("gint" "hot_y")
  )
)

(define-method set_icon_stock
  (of-object "GdkDragContext")
  (c-name "gtk_drag_set_icon_stock")
  (return-type "none")
  (parameters
    '("const-gchar*" "stock_id")
    '("gint" "hot_x")
    '("gint" "hot_y")
  )
)

(define-method set_icon_default
  (of-object "GdkDragContext")
  (c-name "gtk_drag_set_icon_default")
  (return-type "none")
)


;; From /opt/gtk2/include/gtk-2.0/gdk-pixbuf/gdk-pixbuf.h

(define-method get_colorspace
  (of-object "GdkPixbuf")
  (c-name "gdk_pixbuf_get_colorspace")
  (return-type "GdkColorspace")
)

(define-method get_n_channels
  (of-object "GdkPixbuf")
  (c-name "gdk_pixbuf_get_n_channels")
  (return-type "int")
)

(define-method get_has_alpha
  (of-object "GdkPixbuf")
  (c-name "gdk_pixbuf_get_has_alpha")
  (return-type "gboolean")
)

(define-method get_bits_per_sample
  (of-object "GdkPixbuf")
  (c-name "gdk_pixbuf_get_bits_per_sample")
  (return-type "int")
)

(define-method get_pixels
  (of-object "GdkPixbuf")
  (c-name "gdk_pixbuf_get_pixels")
  (return-type "guchar*")
)

(define-method get_width
  (of-object "GdkPixbuf")
  (c-name "gdk_pixbuf_get_width")
  (return-type "int")
)

(define-method get_height
  (of-object "GdkPixbuf")
  (c-name "gdk_pixbuf_get_height")
  (return-type "int")
)

(define-method get_rowstride
  (of-object "GdkPixbuf")
  (c-name "gdk_pixbuf_get_rowstride")
  (return-type "int")
)

(define-function gdk_pixbuf_new
  (is-constructor-of GdkPixbuf)
  (c-name "gdk_pixbuf_new")
  (return-type "GdkPixbuf*")
  (parameters
    '("GdkColorspace" "colorspace")
    '("gboolean" "has_alpha")
    '("int" "bits_per_sample")
    '("int" "width")
    '("int" "height")
  )
)

(define-method copy
  (of-object "GdkPixbuf")
  (c-name "gdk_pixbuf_copy")
  (caller-owns-return #t)
  (return-type "GdkPixbuf*")
)

(define-function pixbuf_new_from_file
  (c-name "gdk_pixbuf_new_from_file")
  (return-type "GdkPixbuf*")
  (caller-owns-return #t)
  (parameters
    '("const-char*" "filename")
    '("GError**" "error")
  )
)

(define-function pixbuf_new_from_file_at_size
  (c-name "gdk_pixbuf_new_from_file_at_size")
  (return-type "GdkPixbuf*")
  (caller-owns-return #t)
  (parameters
    '("const-char*" "filename")
    '("int" "width")
    '("int" "height")
    '("GError**" "error")
  )
)

(define-function pixbuf_new_from_data
  (c-name "gdk_pixbuf_new_from_data")
  (return-type "GdkPixbuf*")
  (caller-owns-return #t)
  (parameters
    '("const-guchar*" "data")
    '("GdkColorspace" "colorspace")
    '("gboolean" "has_alpha")
    '("int" "bits_per_sample")
    '("int" "width")
    '("int" "height")
    '("int" "rowstride")
    '("GdkPixbufDestroyNotify" "destroy_fn")
    '("gpointer" "destroy_fn_data")
  )
)

(define-function pixbuf_new_from_array
  (c-name "gdk_pixbuf_new_from_array")
  (return-type "GdkPixbuf*")
  (caller-owns-return #t)
  (parameters
    '("PyArrayObject*" "array")
    '("GdkColorspace" "colorspace")
    '("int" "bits_per_sample")
  )
)

(define-function pixbuf_new_from_xpm_data
  (c-name "gdk_pixbuf_new_from_xpm_data")
  (return-type "GdkPixbuf*")
  (caller-owns-return #t)
  (parameters
    '("const-char**" "data")
  )
)

(define-function pixbuf_new_from_inline
  (c-name "gdk_pixbuf_new_from_inline")
  (return-type "GdkPixbuf*")
  (caller-owns-return #t)
  (parameters
    '("gint" "data_length")
    '("const-guchar*" "data")
    '("gboolean" "copy_pixels")
    '("GError**" "error")
  )
)

(define-method subpixbuf
  (of-object "GdkPixbuf")
  (c-name "gdk_pixbuf_new_subpixbuf")
  (return-type "GdkPixbuf*")
  (caller-owns-return #t)
  (parameters
    '("int" "src_x")
    '("int" "src_y")
    '("int" "width")
    '("int" "height")
  )
)

(define-method fill
  (of-object "GdkPixbuf")
  (c-name "gdk_pixbuf_fill")
  (parameters
    '("guint32" "pixel")
  )
)

(define-method save
  (of-object "GdkPixbuf")
  (c-name "gdk_pixbuf_save")
  (return-type "gboolean")
  (parameters
    '("const-char*" "filename")
    '("const-char*" "type")
    '("GError**" "error")
  )
  (varargs #t)
)

(define-method savev
  (of-object "GdkPixbuf")
  (c-name "gdk_pixbuf_savev")
  (return-type "gboolean")
  (parameters
    '("const-char*" "filename")
    '("const-char*" "type")
    '("char**" "option_keys")
    '("char**" "option_values")
    '("GError**" "error")
  )
)

(define-method add_alpha
  (of-object "GdkPixbuf")
  (c-name "gdk_pixbuf_add_alpha")
  (caller-owns-return #t)
  (return-type "GdkPixbuf*")
  (parameters
    '("gboolean" "substitute_color")
    '("guchar" "r")
    '("guchar" "g")
    '("guchar" "b")
  )
)

(define-method copy_area
  (of-object "GdkPixbuf")
  (c-name "gdk_pixbuf_copy_area")
  (return-type "none")
  (parameters
    '("int" "src_x")
    '("int" "src_y")
    '("int" "width")
    '("int" "height")
    '("GdkPixbuf*" "dest_pixbuf")
    '("int" "dest_x")
    '("int" "dest_y")
  )
)

(define-method saturate_and_pixelate
  (of-object "GdkPixbuf")
  (c-name "gdk_pixbuf_saturate_and_pixelate")
  (return-type "none")
  (parameters
    '("GdkPixbuf*" "dest")
    '("gfloat" "saturation")
    '("gboolean" "pixelate")
  )
)

(define-method scale
  (of-object "GdkPixbuf")
  (c-name "gdk_pixbuf_scale")
  (return-type "none")
  (parameters
    '("GdkPixbuf*" "dest")
    '("int" "dest_x")
    '("int" "dest_y")
    '("int" "dest_width")
    '("int" "dest_height")
    '("double" "offset_x")
    '("double" "offset_y")
    '("double" "scale_x")
    '("double" "scale_y")
    '("GdkInterpType" "interp_type")
  )
)

(define-method composite
  (of-object "GdkPixbuf")
  (c-name "gdk_pixbuf_composite")
  (return-type "none")
  (parameters
    '("GdkPixbuf*" "dest")
    '("int" "dest_x")
    '("int" "dest_y")
    '("int" "dest_width")
    '("int" "dest_height")
    '("double" "offset_x")
    '("double" "offset_y")
    '("double" "scale_x")
    '("double" "scale_y")
    '("GdkInterpType" "interp_type")
    '("int" "overall_alpha")
  )
)

(define-method composite_color
  (of-object "GdkPixbuf")
  (c-name "gdk_pixbuf_composite_color")
  (return-type "none")
  (parameters
    '("GdkPixbuf*" "dest")
    '("int" "dest_x")
    '("int" "dest_y")
    '("int" "dest_width")
    '("int" "dest_height")
    '("double" "offset_x")
    '("double" "offset_y")
    '("double" "scale_x")
    '("double" "scale_y")
    '("GdkInterpType" "interp_type")
    '("int" "overall_alpha")
    '("int" "check_x")
    '("int" "check_y")
    '("int" "check_size")
    '("guint32" "color1")
    '("guint32" "color2")
  )
)

(define-method scale_simple
  (of-object "GdkPixbuf")
  (c-name "gdk_pixbuf_scale_simple")
  (caller-owns-return #t)
  (return-type "GdkPixbuf*")
  (parameters
    '("int" "dest_width")
    '("int" "dest_height")
    '("GdkInterpType" "interp_type")
  )
)

(define-method composite_color_simple
  (of-object "GdkPixbuf")
  (c-name "gdk_pixbuf_composite_color_simple")
  (caller-owns-return #t)
  (return-type "GdkPixbuf*")
  (parameters
    '("int" "dest_width")
    '("int" "dest_height")
    '("GdkInterpType" "interp_type")
    '("int" "overall_alpha")
    '("int" "check_size")
    '("guint32" "color1")
    '("guint32" "color2")
  )
)

(define-function gdk_pixbuf_animation_get_type
  (c-name "gdk_pixbuf_animation_get_type")
  (return-type "GType")
)

(define-function gdk_pixbuf_animation_new_from_file
  (is-constructor-of GdkPixbufAnimation)
  (c-name "gdk_pixbuf_animation_new_from_file")
  (return-type "GdkPixbufAnimation*")
  (parameters
    '("const-char*" "filename")
    '("GError**" "error")
  )
)

(define-method get_width
  (of-object "GdkPixbufAnimation")
  (c-name "gdk_pixbuf_animation_get_width")
  (return-type "int")
)

(define-method get_height
  (of-object "GdkPixbufAnimation")
  (c-name "gdk_pixbuf_animation_get_height")
  (return-type "int")
)

(define-method is_static_image
  (of-object "GdkPixbufAnimation")
  (c-name "gdk_pixbuf_animation_is_static_image")
  (return-type "gboolean")
)

(define-method get_static_image
  (of-object "GdkPixbufAnimation")
  (c-name "gdk_pixbuf_animation_get_static_image")
  (return-type "GdkPixbuf*")
)

(define-method get_iter
  (of-object "GdkPixbufAnimation")
  (c-name "gdk_pixbuf_animation_get_iter")
  (return-type "GdkPixbufAnimationIter*")
  (parameters
    '("const-GTimeVal*" "start_time")
  )
)

(define-function pixbuf_animation_iter_get_type
  (c-name "gdk_pixbuf_animation_iter_get_type")
  (return-type "GType")
)

(define-method get_delay_time
  (of-object "GdkPixbufAnimationIter")
  (c-name "gdk_pixbuf_animation_iter_get_delay_time")
  (return-type "int")
)

(define-method get_pixbuf
  (of-object "GdkPixbufAnimationIter")
  (c-name "gdk_pixbuf_animation_iter_get_pixbuf")
  (return-type "GdkPixbuf*")
)

(define-method on_currently_loading_frame
  (of-object "GdkPixbufAnimationIter")
  (c-name "gdk_pixbuf_animation_iter_on_currently_loading_frame")
  (return-type "gboolean")
)

(define-method advance
  (of-object "GdkPixbufAnimationIter")
  (c-name "gdk_pixbuf_animation_iter_advance")
  (return-type "gboolean")
  (parameters
    '("const-GTimeVal*" "current_time")
  )
)

(define-method get_option
  (of-object "GdkPixbuf")
  (c-name "gdk_pixbuf_get_option")
  (return-type "const-char*")
  (parameters
    '("const-char*" "key")
  )
)

(define-function pixbuf_get_formats
  (c-name "gdk_pixbuf_get_formats")
  (return-type "GSList*")
)

(define-function pixbuf_get_file_info
  (c-name "gdk_pixbuf_get_file_info")
  (return-type "GdkPixbufFormat*")
  (parameters
    '("gint*" "width")
    '("gint*" "height")
   )
)

(define-method get_name
  (of-object "GdkPixbufFormat")
  (c-name "gdk_pixbuf_format_get_name")
  (return-type "gchar*")
)

(define-method get_description
  (of-object "GdkPixbufFormat")
  (c-name "gdk_pixbuf_format_get_description")
  (return-type "gchar*")
)

(define-method get_mime_types
  (of-object "GdkPixbufFormat")
  (c-name "gdk_pixbuf_format_get_mime_types")
  (return-type "gchar**")
)

(define-method get_extensions
  (of-object "GdkPixbufFormat")
  (c-name "gdk_pixbuf_format_get_extensions")
  (return-type "gchar**")
)

(define-method is_writable
  (of-object "GdkPixbufFormat")
  (c-name "gdk_pixbuf_format_is_writable")
  (return-type "gboolean")
)


;; From /opt/gnome/include/gtk-2.0/gdk-pixbuf/gdk-pixbuf-loader.h

(define-function gdk_pixbuf_loader_get_type
  (c-name "gdk_pixbuf_loader_get_type")
  (return-type "GType")
)

(define-function gdk_pixbuf_loader_new
  (deprecated "use gtk.gdk.PixbufLoader instead")
  (c-name "gdk_pixbuf_loader_new")
  (return-type "GdkPixbufLoader*")
)

(define-function gdk_pixbuf_loader_new_with_type
  (c-name "gdk_pixbuf_loader_new_with_type")
  (is-constructor-of GdkPixbufLoader)
  (return-type "GdkPixbufLoader*")
  (parameters
    '("const-char*" "image_type")
    '("GError**" "error")
  )
)

(define-function pixbuf_loader_new_with_mime_type
  (c-name "gdk_pixbuf_loader_new_with_mime_type")
  (return-type "GdkPixbufLoader*")
  (parameters
    '("const-char*" "mime_type")
    '("GError**" "error")
  )
)

(define-method write
  (of-object "GdkPixbufLoader")
  (c-name "gdk_pixbuf_loader_write")
  (return-type "gboolean")
  (parameters
    '("const-guchar*" "buf")
    '("gsize" "count")
    '("GError**" "error")
  )
)

(define-method get_pixbuf
  (of-object "GdkPixbufLoader")
  (c-name "gdk_pixbuf_loader_get_pixbuf")
  (return-type "GdkPixbuf*")
)

(define-method get_animation
  (of-object "GdkPixbufLoader")
  (c-name "gdk_pixbuf_loader_get_animation")
  (return-type "GdkPixbufAnimation*")
)

(define-method close
  (of-object "GdkPixbufLoader")
  (c-name "gdk_pixbuf_loader_close")
  (return-type "gboolean")
  (parameters
    '("GError**" "error")
  )
)

(define-method set_size
  (of-object "GdkPixbufLoader")
  (c-name "gdk_pixbuf_loader_set_size")
  (return-type "none")
  (parameters
    '("int" "width")
    '("int" "height")
  )
)

(define-method get_format
  (of-object "GdkPixbufLoader")
  (c-name "gdk_pixbuf_loader_get_format")
  (return-type "GdkPixbufFormat*")
)

(define-method intersect
  (of-object "GdkRectangle")
  (c-name "gdk_rectangle_intersect")
  (return-type "gboolean")
  (parameters
    '("GdkRectangle*" "src1")
    '("GdkRectangle*" "src2")
    '("GdkRectangle*" "dest")
  )
)

(define-method union
  (of-object "GdkRectangle")
  (c-name "gdk_rectangle_union")
  (return-type "void")
  (parameters
    '("GdkRectangle*" "src1")
    '("GdkRectangle*" "src2")
    '("GdkRectangle*" "dest")
  )
)

(define-function gdk_rectangle_new
  (c-name "gdk_rectangle_new")
  (is-constructor-of "GdkRectangle")
  (return-type "GdkRectangle")
)

