; -*- scheme -*-

(define-object GtkContainer (GtkWidget))

(define-func gtk_container_set_border_width
  none
  ((GtkContainer container)
   (int border_width)))

(define-func gtk_container_add
  none
  ((GtkContainer container)
   (GtkWidget widget)))

(define-func gtk_container_remove
  none
  ((GtkContainer container)
   (GtkWidget widget)))

(define-func gtk_container_set_resize_mode
  none
  ((GtkContainer container)
   (GtkResizeMode resize_mode)))

(define-func gtk_container_check_resize
  none
  ((GtkContainer container)))

;gtk_container_children

(define-func gtk_container_child_composite_name
  string
  ((GtkContainer container)
   (GtkWidget child)))

(define-func gtk_container_focus
  int
  ((GtkContainer container)
   (GtkDirectionType direction)))

(define-func gtk_container_set_focus_child
  none
  ((GtkContainer container)
   (GtkWidget child (null-ok))))

(define-func gtk_container_set_focus_vadjustment
  none
  ((GtkContainer container)
   (GtkAdjustment adjustment)))

(define-func gtk_container_set_focus_hadjustment
  none
  ((GtkContainer container)
   (GtkAdjustment adjustment)))

(define-func gtk_container_register_toplevel
  none
  ((GtkContainer container)))

(define-func gtk_container_unregister_toplevel
  none
  ((GtkContainer container)))

(define-func gtk_container_resize_children
  none
  ((GtkContainer container)))

(define-func gtk_container_child_type
  uint
  ((GtkContainer container)))

;gtk_container_child_set
;gtk_container_child_get

;;; Fixed

(define-object GtkFixed (GtkContainer))

(define-func gtk_fixed_new
  GtkWidget
  ())

(define-func gtk_fixed_put 
  none
  ((GtkFixed fixed)
   (GtkWidget widget)
   (int x)
   (int y)))

(define-func gtk_fixed_move
  none
  ((GtkFixed fixed)
   (GtkWidget widget)
   (int x)
   (int y)))

;;; Bin

(define-object GtkBin (GtkContainer))

;;; Event Box

(define-object GtkEventBox (GtkBin))

(define-func gtk_event_box_new 
  GtkWidget
  ())

;;; Window

(define-object GtkWindow (GtkBin)
    (fields
     (GtkWidget focus_widget)
     (GtkWidget default_widget)
     (GtkWindow transient_parent)
     (int resize_count)
     (int allow_shrink)
     (int allow_grow)
     (int auto_shrink)
     (int handling_resize)
     (int position)
     (int use_uposition)
     (int modal)
     (int window_has_focus)
     (int window_has_pointer_focus)
    ))

(define-func gtk_window_new
  GtkWidget
  ((GtkWindowType type)))

(define-func gtk_window_set_title
  none
  ((GtkWindow window)
   (string title)))

(define-func gtk_window_set_wmclass
  none
  ((GtkWindow window)
   (string wmclass_class)
   (string wmclass_name)))

(define-func gtk_window_set_policy
  none
  ((GtkWindow window)
   (bool allow_shrink)
   (bool allow_grow)
   (bool auto_shrink)))

(define-func gtk_window_add_accel_group
  none
  ((GtkWindow window)
   (GtkAccelGroup group)))

(define-func gtk_window_remove_accel_group
  none
  ((GtkWindow window)
   (GtkAccelGroup group)))

(define-func gtk_window_set_position
  none
  ((GtkWindow window)
   (GtkWindowPosition position)))

(define-func gtk_window_activate_focus
  int
  ((GtkWindow window)))

(define-func gtk_window_activate_default
  int
  ((GtkWindow window)))

(define-func gtk_window_set_transient_for
  none
  ((GtkWindow window)
   (GtkWindow parent)))

(define-func gtk_window_set_default_size
  none
  ((GtkWindow window)
   (int width) (int height)))

(define-func gtk_window_set_modal
  none
  ((GtkWindow window)
   (bool modal)))

;; Dialog

(define-object GtkDialog (GtkWindow)
  (fields
   (GtkWidget vbox)
   (GtkWidget action_area)))

(define-func gtk_dialog_new
  GtkWidget
  ())

;;; HandleBox

(define-object GtkHandleBox (GtkBin))

(define-func gtk_handle_box_new
  GtkWidget
  ())

(define-func gtk_handle_box_set_shadow_type
  none
  ((GtkHandleBox handle_box)
   (GtkShadowType type)))

(define-func gtk_handle_box_set_handle_position
  none
  ((GtkHandleBox handle_box)
   (GtkPositionType position)))

(define-func gtk_handle_box_set_snap_edge
  none
  ((GtkHandleBox handle_box)
   (GtkPositionType position)))

;;; Box

(define-object GtkBox (GtkContainer))

(define-func gtk_box_pack_start
  none
  ((GtkBox box)
   (GtkWidget child)
   (bool expand (= "TRUE"))
   (bool fill (= "TRUE"))
   (int padding (= "0"))))

(define-func gtk_box_pack_end
  none
  ((GtkBox box)
   (GtkWidget child)
   (bool expand (= "TRUE"))
   (bool fill (= "TRUE"))
   (int padding (= "0"))))

(define-func gtk_box_pack_start_defaults
  none
  ((GtkBox box)
   (GtkWidget child)))

(define-func gtk_box_pack_end_defaults
  none
  ((GtkBox box)
   (GtkWidget child)))

(define-func gtk_box_set_homogeneous
  none
  ((GtkBox box)
   (bool homogenous)))

(define-func gtk_box_set_spacing
  none
  ((GtkBox box)
   (int spacing)))

(define-func gtk_box_reorder_child
  none
  ((GtkBox box)
   (GtkWidget child)
   (uint pos)))

;gtk_box_query_child_packing

(define-func gtk_box_set_child_packing
  none
  ((GtkBox box)
   (GtkWidget child)
   (bool expand)
   (bool fill)
   (int padding)
   (GtkPackType pack_type)))

(define-object GtkHBox (GtkBox))
(define-func gtk_hbox_new
  GtkWidget
  ((bool homogeneous) (int spacing)))

(define-object GtkVBox (GtkBox))
(define-func gtk_vbox_new
  GtkWidget
  ((bool homogeneous) (int spacing)))

;;; ButtonBox

(define-object GtkButtonBox (GtkBox))

;; XXX - needs multiple return values
;; (define-func gtk_button_box_get_child_size_default)

;; XXX - needs multiple return values
;; (define-func gtk_button_box_get_child_ipadding_default)

(define-func gtk_button_box_set_child_size_default 
  none
  ((int min_width)
   (int min_height)))

(define-func gtk_button_box_set_child_ipadding_default 
  none
  ((int ipad_x)
   (int ipad_y)))

(define-func gtk_button_box_get_spacing 
  int 
  ((GtkButtonBox widget)))

(define-func gtk_button_box_get_layout 
  GtkButtonBoxStyle
  ((GtkButtonBox widget)))

;; XXX - needs multiple return values
;; (define-func gtk_button_box_get_child_size)

;; XXX - needs multiple return values
;; (define-func gtk_button_box_get_child_ipadding)

(define-func gtk_button_box_set_spacing 
  none
  ((GtkButtonBox widget) 
   (int spacing)))

(define-func gtk_button_box_set_layout 
  none 
  ((GtkButtonBox widget)
   (GtkButtonBoxStyle layout_style)))

(define-func gtk_button_box_set_child_size	 
  none
  ((GtkButtonBox widget)
   (int min_width) 
   (int min_height)))

(define-func gtk_button_box_set_child_ipadding 
  none
  ((GtkButtonBox widget) 
   (int ipad_x) 
   (int ipad_y)))

;;; HButtonBox

(define-object GtkHButtonBox (GtkButtonBox))

(define-func gtk_hbutton_box_new  
  GtkWidget
  ())

(define-func gtk_hbutton_box_get_spacing_default 
  int 
  ())

(define-func gtk_hbutton_box_get_layout_default 
  GtkButtonBoxStyle
  ())

(define-func gtk_hbutton_box_set_spacing_default 
  none
  ((int spacing)))

(define-func gtk_hbutton_box_set_layout_default 
  none
  ((GtkButtonBoxStyle layout)))

;;; HVuttonBox

(define-object GtkVButtonBox (GtkButtonBox))

(define-func gtk_vbutton_box_new  
  GtkWidget
  ())

(define-func gtk_vbutton_box_get_spacing_default 
  int 
  ())

(define-func gtk_vbutton_box_get_layout_default 
  GtkButtonBoxStyle
  ())

(define-func gtk_vbutton_box_set_spacing_default 
  none
  ((int spacing)))

(define-func gtk_vbutton_box_set_layout_default 
  none
  ((GtkButtonBoxStyle layout)))

;;; Table

(define-object GtkTable (GtkContainer))

(define-func gtk_table_new
  GtkWidget
  ((int rows)
   (int columns)
   (bool homogenous)))

(define-func gtk_table_attach
  none
  ((GtkTable table)
   (GtkWidget child)
   (int left_attach)
   (int right_attach)
   (int top_attach)
   (int bottom_attach)
   (GtkAttachOptions xoptions (= "GTK_EXPAND|GTK_FILL"))
   (GtkAttachOptions yoptions (= "GTK_EXPAND|GTK_FILL"))
   (int xpadding (= "0"))
   (int ypadding (= "0"))))

(define-func gtk_table_attach_defaults
  none
  ((GtkTable table)
   (GtkWidget child)
   (int left_attach)
   (int right_attach)
   (int top_attach)
   (int bottom_attach)))

(define-func gtk_table_set_row_spacing
  none
  ((GtkTable table)
   (int row)
   (int spacing)))

(define-func gtk_table_set_col_spacing
  none
  ((GtkTable table)
   (int column)
   (int spacing)))

(define-func gtk_table_set_row_spacings
  none
  ((GtkTable table)
   (int spacing)))

(define-func gtk_table_set_col_spacings
  none
  ((GtkTable table)
   (int spacing)))

(define-func gtk_table_set_homogeneous
  none
  ((GtkTable table)
   (bool homogeneous)))

(define-func gtk_table_resize
  none
  ((GtkTable table)
   (int rows)
   (int cols)))

;; Packer

(define-object GtkPacker (GtkContainer))

(define-func gtk_packer_new
  GtkWidget
  ())

(define-func gtk_packer_add_defaults
  none
  ((GtkPacker packer)
   (GtkWidget child)
   (GtkSideType side)
   (GtkAnchorType anchor)
   (GtkPackerOptions options)))

(define-func gtk_packer_add
  none
  ((GtkPacker packer)
   (GtkWidget child)
   (GtkSideType side)
   (GtkAnchorType anchor)
   (GtkPackerOptions options)
   (uint border_width (= "0"))
   (uint pad_x (= "0"))  (uint pad_y (= "0"))
   (uint ipad_x (= "0")) (uint ipad_y (= "0"))))

(define-func gtk_packer_set_child_packing
  none
  ((GtkPacker packer)
   (GtkWidget child)
   (GtkSideType size)
   (GtkAnchorType anchor)
   (GtkPackerOptions options)
   (uint border_width (= "0"))
   (uint pad_x (= "0"))  (uint pad_y (= "0"))
   (uint ipad_x (= "0")) (uint ipad_y (= "0"))))

(define-func gtk_packer_reorder_child
  none
  ((GtkPacker packer)
   (GtkWidget widget)
   (int position)))

(define-func gtk_packer_set_spacing
  none
  ((GtkPacker packer)
   (uint spacing)))

(define-func gtk_packer_set_default_border_width
  none
  ((GtkPacker packer)
   (uint border)))

(define-func gtk_packer_set_default_pad
  none
  ((GtkPacker packer)
   (uint pad_x) (uint pad_y)))

(define-func gtk_packer_set_default_ipad
  none
  ((GtkPacker packer)
   (uint ipad_x) (uint ipad_y)))


;; Panes

(define-object GtkPaned (GtkContainer)
  (fields
   (uint handle_size)
   (uint gutter_size)))

(define-func gtk_paned_add1
  none
  ((GtkPaned paned)
   (GtkWidget child)))

(define-func gtk_paned_add2
  none
  ((GtkPaned paned)
   (GtkWidget child)))

(define-func gtk_paned_pack1
  none
  ((GtkPaned paned)
   (GtkWidget child)
   (bool resize)
   (bool shrink)))

(define-func gtk_paned_pack2
  none
  ((GtkPaned paned)
   (GtkWidget child)
   (bool resize)
   (bool shrink)))

(define-func gtk_paned_set_position
  none
  ((GtkPaned paned)
   (int position)))

(define-func gtk_paned_set_handle_size
  none
  ((GtkPaned paned)
   (uint size)))

(define-func gtk_paned_set_gutter_size
  none
  ((GtkPaned paned)
   (uint size)))

(define-object GtkHPaned (GtkPaned))
(define-func gtk_hpaned_new
  GtkWidget
  ())
  
(define-object GtkVPaned (GtkPaned))
(define-func gtk_vpaned_new
  GtkWidget
  ())

;; Frame

(define-object GtkFrame (GtkBin))

(define-func gtk_frame_new
  GtkWidget
  ((string label (null-ok))))

(define-func gtk_frame_set_label
  none
  ((GtkFrame frame)
   (string label)))

(define-func gtk_frame_set_label_align
  none
  ((GtkFrame frame)
   (float xalign)
   (float yalign)))

(define-func gtk_frame_set_shadow_type
  none
  ((GtkFrame frame)
   (GtkShadowType type)))

;; Aspect Frame

(define-object GtkAspectFrame (GtkFrame))

(define-func gtk_aspect_frame_new
  GtkWidget
  ((string label)
   (float xalign)
   (float yalign)
   (float ratio)
   (int obey_child)))

(define-func gtk_aspect_frame_set
  none
  ((GtkAspectFrame aspect_frame)
   (float xalign)
   (float yalign)
   (float ratio)
   (int obey_child)))

;;; Viewport

(define-object GtkViewport (GtkBin))

(define-func gtk_viewport_new
  GtkWidget
  ((GtkAdjustment hadjustment (null-ok) (= "NULL"))
   (GtkAdjustment vadjustment (null-ok) (= "NULL"))))

(define-func gtk_viewport_get_hadjustment
  GtkAdjustment
  ((GtkViewport viewport)))

(define-func gtk_viewport_get_vadjustment
  GtkAdjustment
  ((GtkViewport viewport)))

(define-func gtk_viewport_set_hadjustment
  none
  ((GtkViewport viewport)
   (GtkAdjustment adjustment)))

(define-func gtk_viewport_set_vadjustment
  none
  ((GtkViewport viewport)
   (GtkAdjustment adjustment)))

(define-func gtk_viewport_set_shadow_type
  none
  ((GtkViewport viewport)
   (GtkShadowType type)))

;; ScrolledWidow

(define-object GtkScrolledWindow (GtkContainer)
  (fields
   (GtkWidget hscrollbar)
   (GtkWidget vscrollbar)))

(define-func gtk_scrolled_window_new
  GtkWidget
  ((GtkAdjustment hadjustment (null-ok) (= "NULL"))
   (GtkAdjustment vadjustment (null-ok) (= "NULL"))))

(define-func gtk_scrolled_window_set_hadjustment
  none
  ((GtkScrolledWindow scrolled_window)
   (GtkAdjustment adjustment)))

(define-func gtk_scrolled_window_set_vadjustment
  none
  ((GtkScrolledWindow scrolled_window)
   (GtkAdjustment adjustment)))

(define-func gtk_scrolled_window_get_hadjustment
  GtkAdjustment
  ((GtkScrolledWindow scrolled_window)))

(define-func gtk_scrolled_window_get_vadjustment
  GtkAdjustment
  ((GtkScrolledWindow scrolled_window)))

(define-func gtk_scrolled_window_set_policy
  none
  ((GtkScrolledWindow scrolled_window)
   (GtkPolicyType hscrollbar_policy)
   (GtkPolicyType vscrollbar_policy)))

(define-func gtk_scrolled_window_set_placement
  none
  ((GtkScrolledWindow scrolled_window)
   (GtkCornerType window_placement)))

(define-func gtk_scrolled_window_add_with_viewport
  none
  ((GtkScrolledWindow scrolled_window)
   (GtkWidget child)))

;; Notebook

(define-object GtkNotebook (GtkContainer)
  (fields
   (GtkPositionType tab_pos)))

(define-func gtk_notebook_new
  GtkWidget
  ())

(define-func gtk_notebook_append_page
  none
  ((GtkNotebook notebook)
   (GtkWidget child)
   (GtkWidget tab_label (null-ok))))

(define-func gtk_notebook_append_page_menu  
  none
  ((GtkNotebook notebook)
   (GtkWidget child)
   (GtkWidget tab_label (null-ok))
   (GtkWidget menu_label (null-ok))))

(define-func gtk_notebook_prepend_page
  none
  ((GtkNotebook notebook)
   (GtkWidget child)
   (GtkWidget tab_label (null-ok))))

(define-func gtk_notebook_prepend_page_menu 
  none
  ((GtkNotebook notebook)
   (GtkWidget child)
   (GtkWidget tab_label (null-ok))
   (GtkWidget menu_label (null-ok))))

(define-func gtk_notebook_insert_page
  none
  ((GtkNotebook notebook)
   (GtkWidget child)
   (GtkWidget tab_label (null-ok))
   (int position)))

(define-func gtk_notebook_insert_page_menu 
  none
  ((GtkNotebook notebook)
   (GtkWidget child)
   (GtkWidget tab_label (null-ok))
   (GtkWidget menu_label (null-ok))
   (int position)))

(define-func gtk_notebook_remove_page
  none
  ((GtkNotebook notebook)
   (int page_num)))

(define-func gtk_notebook_get_current_page
  int
  ((GtkNotebook notebook)))

(define-func gtk_notebook_get_nth_page
  GtkWidget
  ((GtkNotebook notebook)
   (int page_num)))

(define-func gtk_notebook_page_num
  int
  ((GtkNotebook notebook)
   (GtkWidget page)))

(define-func gtk_notebook_set_page
  none
  ((GtkNotebook notebook)
   (int page_num)))

(define-func gtk_notebook_next_page
  none
  ((GtkNotebook notebook)))

(define-func gtk_notebook_prev_page
  none
  ((GtkNotebook notebook)))

(define-func gtk_notebook_reorder_child
  none
  ((GtkNotebook notebook)
   (GtkWidget child)
   (int position)))

(define-func gtk_notebook_set_tab_pos
  none
  ((GtkNotebook notebook)
   (GtkPositionType pos)))

(define-func gtk_notebook_set_show_tabs
  none
  ((GtkNotebook notebook)
   (bool show_tabs)))

(define-func gtk_notebook_set_show_border
  none
  ((GtkNotebook notebook)
   (bool show_border)))

(define-func gtk_notebook_set_scrollable 
  none
  ((GtkNotebook notebook)
   (int              scrollable)))

(define-func gtk_notebook_set_homogeneous_tabs
  none
  ((GtkNotebook notebook)
   (bool homogeneous)))

(define-func gtk_notebook_set_tab_border 
  none
  ((GtkNotebook notebook)
   (int border_width)))

(define-func gtk_notebook_set_tab_hborder
  none
  ((GtkNotebook notebook)
   (uint tab_hborder)))

(define-func gtk_notebook_set_tab_vborder
  none
  ((GtkNotebook notebook)
   (uint tab_vborder)))

(define-func gtk_notebook_popup_enable 
  none
  ((GtkNotebook notebook)))
   
(define-func gtk_notebook_popup_disable 
  none
  ((GtkNotebook notebook)))

(define-func gtk_notebook_get_tab_label
  GtkWidget
  ((GtkNotebook notebook)
   (GtkWidget child)))

(define-func gtk_notebook_set_tab_label
  none
  ((GtkNotebook notebook)
   (GtkWidget child)
   (GtkWidget tab_label)))

(define-func gtk_notebook_set_tab_label_text
  none
  ((GtkNotebook notebook)
   (GtkWidget child)
   (string tab_text)))

(define-func gtk_notebook_get_menu_label
  GtkWidget
  ((GtkNotebook notebook)
   (GtkWidget child)))

(define-func gtk_notebook_set_menu_label
  none
  ((GtkNotebook notebook)
   (GtkWidget child)
   (GtkWidget menu_label)))

(define-func gtk_notebook_set_menu_label_text
  none
  ((GtkNotebook notebook)
   (GtkWidget child)
   (string menu_text)))

; gtk_notebook_query_tab_label_packing
(define-func gtk_notebook_set_tab_label_packing
  none
  ((GtkNotebook notebook)
   (GtkWidget child)
   (bool expand)
   (bool fill)
   (GtkPackType pack_type)))

;; Alignment

(define-object GtkAlignment (GtkBin))

(define-func gtk_alignment_new
  GtkWidget
  ((float xalign)
   (float yalign)
   (float xscale)
   (float yscale)))

(define-func gtk_alignment_set
  none
  ((GtkAlignment alignment)
   (float xalign)
   (float yalign)
   (float xscale)
   (float yscale)))

;; gtklayout.h
(define-object GtkLayout (GtkContainer))

(define-func gtk_layout_new
  GtkWidget
  ((GtkAdjustment hadjustment (null-ok) (= "NULL"))
   (GtkAdjustment vadjustment (null-ok) (= "NULL"))))

(define-func gtk_layout_put
  none
  ((GtkLayout layout)
   (GtkWidget child)
   (int x) (int y)))

(define-func gtk_layout_move
  none
  ((GtkLayout layout)
   (GtkWidget child)
   (int x) (int y)))

(define-func gtk_layout_set_size
  none
  ((GtkLayout layout)
   (uint width) (uint height)))

(define-func gtk_layout_freeze
  none
  ((GtkLayout layout)))

(define-func gtk_layout_thaw
  none
  ((GtkLayout layout)))

(define-func gtk_layout_get_hadjustment
  GtkAdjustment
  ((GtkLayout layout)))

(define-func gtk_layout_get_vadjustment
  GtkAdjustment
  ((GtkLayout layout)))

(define-func gtk_layout_set_hadjustment
  none
  ((GtkLayout layout)
   (GtkAdjustment adjustment)))

(define-func gtk_layout_set_vadjustment
  none
  ((GtkLayout layout)
   (GtkAdjustment adjustment)))

;; gtk-plug.h
(define-object GtkPlug (GtkWindow))

(define-func gtk_plug_new
  GtkWidget
  ((uint socket_id)))

;; gtk-socket.h
(define-object GtkSocket (GtkContainer))

(define-func gtk_socket_new
  GtkWidget
  ())

(define-func gtk_socket_steal
  none
  ((GtkSocket socket)
   (uint window_id)))

