; -*- scheme -*-
(define-object GtkTreeItem (GtkItem)
  (fields (GtkWidget subtree)))

(define-func gtk_tree_item_new
  GtkWidget
  ())

(define-func gtk_tree_item_new_with_label
  GtkWidget
  ((string label)))

(define-func gtk_tree_item_set_subtree
  none
  ((GtkTreeItem tree_item)
   (GtkWidget subtree)))

(define-func gtk_tree_item_remove_subtree
  none
  ((GtkTreeItem tree_item)))

(define-func gtk_tree_item_select
  none
  ((GtkTreeItem tree_item)))

(define-func gtk_tree_item_deselect
  none
  ((GtkTreeItem tree_item)))

(define-func gtk_tree_item_expand
  none
  ((GtkTreeItem tree_item)))

(define-func gtk_tree_item_collapse
  none
  ((GtkTreeItem tree_item)))

;;; Tree

(define-object GtkTree (GtkContainer))

(define-func gtk_tree_new 
  GtkWidget
  ())

(define-func gtk_tree_append
  none
  ((GtkTree tree)
   (GtkWidget child)))

(define-func gtk_tree_prepend
  none
  ((GtkTree tree)
   (GtkWidget child)))

(define-func gtk_tree_insert
  none
  ((GtkTree tree)
   (GtkWidget child)
   (int position)))

;; XXX - need GList support
;; (define-func gtk_tree_remove_items)

(define-func gtk_tree_clear_items
  none
  ((GtkTree tree)
   (int start)
   (int end)))

(define-func gtk_tree_select_item
  none
  ((GtkTree tree)
   (int item)))

(define-func gtk_tree_unselect_item
  none
  ((GtkTree tree)
   (int item)))

(define-func gtk_tree_select_child
  none
  ((GtkTree tree)
   (GtkWidget child)))

(define-func gtk_tree_unselect_child
  none
  ((GtkTree tree)
   (GtkWidget child)))

(define-func gtk_tree_child_position
  int
  ((GtkTree tree)
   (GtkWidget child)))

(define-func gtk_tree_set_selection_mode
  none
  ((GtkTree tree)
   (GtkSelectionMode mode)))

(define-func gtk_tree_set_view_mode
  none
  ((GtkTree tree)
   (GtkTreeViewMode mode)))

(define-func gtk_tree_set_view_lines
  none
  ((GtkTree tree)
   (bool flag)))

;;; GtkCList

(define-object GtkCList (GtkContainer)
  (fields
   (int focus_row)
   (int columns)
   (int rows)
   (int row_height)
   (int sort_column)
   (int sort_type)))

(define-func gtk_clist_new 
  GtkWidget
  ((int columns)))

;gtk_clist_new_with_titles

(define-func gtk_clist_set_shadow_type
 none
 ((GtkCList clist)
  (GtkShadowType border)))

(define-func gtk_clist_set_selection_mode
 none
 ((GtkCList clist)
  (GtkSelectionMode mode)))

(define-func gtk_clist_set_reorderable
  none
  ((GtkCList clist)
   (bool reorderable)))

(define-func gtk_clist_set_use_drag_icons
  none
  ((GtkCList clist)
   (bool use_icons)))

(define-func gtk_clist_set_button_actions
  none
  ((GtkCList clist)
   (uint button)
   (uint button_actions)))

(define-func gtk_clist_set_hadjustment
  none
  ((GtkCList clist)
   (GtkAdjustment adjustment)))

(define-func gtk_clist_set_vadjustment
  none
  ((GtkCList clist)
   (GtkAdjustment adjustment)))

(define-func gtk_clist_get_hadjustment
  GtkAdjustment
  ((GtkCList clist)))

(define-func gtk_clist_get_vadjustment
  GtkAdjustment
  ((GtkCList clist)))

(define-func gtk_clist_freeze
 none
 ((GtkCList clist)))

(define-func gtk_clist_thaw
 none
 ((GtkCList clist)))

(define-func gtk_clist_column_titles_show
 none
 ((GtkCList clist)))

(define-func gtk_clist_column_titles_hide
 none
 ((GtkCList clist)))

(define-func gtk_clist_column_title_active
 none
 ((GtkCList clist)
  (int column)))

(define-func gtk_clist_column_title_passive
 none
 ((GtkCList clist)
  (int column)))

(define-func gtk_clist_column_titles_active
 none
 ((GtkCList clist)))

(define-func gtk_clist_column_titles_passive
 none
 ((GtkCList clist)))

(define-func gtk_clist_set_column_title
  none
  ((GtkCList clist)
   (int column)
   (string title)))

(define-func gtk_clist_get_column_title
  static_string
  ((GtkCList clist)
   (int column)))

(define-func gtk_clist_set_column_widget
  none
  ((GtkCList clist)
   (int column)
   (GtkWidget widget)))

(define-func gtk_clist_get_column_widget
  GtkWidget
  ((GtkCList clist)
   (int column)))

(define-func gtk_clist_set_column_justification
  none
  ((GtkCList clist)
   (int column)
   (GtkJustification justification)))

(define-func gtk_clist_set_column_visibility
  none
  ((GtkCList clist)
   (int column)
   (bool visible)))

(define-func gtk_clist_set_column_resizeable
  none
  ((GtkCList clist)
   (int column)
   (bool resizeable)))

(define-func gtk_clist_set_column_auto_resize
  none
  ((GtkCList clist)
   (int column)
   (bool auto_resize)))

(define-func gtk_clist_columns_autosize
  int
  ((GtkCList clist)))

(define-func gtk_clist_optimal_column_width
  int
  ((GtkCList clist)
   (int column)))

(define-func gtk_clist_set_column_width
  none
  ((GtkCList clist)
   (int column)
   (int width)))

(define-func gtk_clist_set_column_min_width
  none
  ((GtkCList clist)
   (int column)
   (int min_width)))

(define-func gtk_clist_set_column_max_width
  none
  ((GtkCList clist)
   (int column)
   (int max_width)))

(define-func gtk_clist_set_row_height
  none
  ((GtkCList clist)
   (uint height)))

(define-func gtk_clist_moveto
  none
  ((GtkCList clist)
   (int row)
   (int column)
   (float row_align)
   (float column_align)))

(define-func gtk_clist_row_is_visible
  bool
  ((GtkCList clist)
   (int row)))

(define-func gtk_clist_get_cell_type
  GtkCellType
  ((GtkCList clist)
   (int row) (int column)))

(define-func gtk_clist_set_text
  none
  ((GtkCList clist)
   (int row)
   (int column)
   (string text)))

;gtk_clist_get_text

;gtk_clist_set_pixmap
;gtk_clist_get_pixmap
(define-func gtk_clist_set_pixmap
  none
  ((GtkCList clist)
   (int row) (int col)
   (GdkPixmap pixmap)
   (GdkBitmap mask (null-ok))))

(define-func gtk_clist_set_pixtext
  none
  ((GtkCList clist)
   (int row) (int col)
   (string text)
   (uint spacing)
   (GdkPixmap pixmap)
   (GdkBitmap mask)))

(define-func gtk_clist_set_foreground
  none
  ((GtkCList clist)
   (int row)
   (GdkColor color)))

(define-func gtk_clist_set_background
  none
  ((GtkCList clist)
   (int row)
   (GdkColor color)))

(define-func gtk_clist_set_cell_style
  none
  ((GtkCList clist)
   (int row)
   (int column)
   (GtkStyle style)))

(define-func gtk_clist_get_cell_style
  GtkStyle
  ((GtkCList clist)
   (int row)
   (int column)))

(define-func gtk_clist_set_row_style
  none
  ((GtkCList clist)
   (int row)
   (GtkStyle style)))

(define-func gtk_clist_get_row_style
  GtkStyle
  ((GtkCList clist)
   (int row)))

(define-func gtk_clist_set_shift 
  none
  ((GtkCList clist)
   (int row)
   (int column)
   (int vertical)
   (int horizontal)))

(define-func gtk_clist_set_selectable
  none
  ((GtkCList clist)
   (int row)
   (bool selectable)))

(define-func gtk_clist_get_selectable
  bool
  ((GtkCList clist)
   (int row)))

;gtk_clist_append
;gtk_clist_insert

(define_func gtk_clist_remove 
  none
  ((GtkCList clist)
   (int row)))

;gtk_clist_set_row_data
;gtk_clist_get_row_data
;gtk_clist_find_row_from_data

(define-func gtk_clist_select_row
  none
  ((GtkCList clist)
   (int row)
   (int column)))

(define-func gtk_clist_unselect_row
  none
  ((GtkCList clist)
   (int row)
   (int column)))

(define-func gtk_clist_undo_selection
  none
  ((GtkCList clist)))

(define-func gtk_clist_clear
  none
  ((GtkCList clist)))

;gtk_clist_get_selection_info

(define-func gtk_clist_select_all
  none
  ((GtkCList clist)))

(define-func gtk_clist_unselect_all
  none
  ((GtkCList clist)))

(define-func gtk_clist_swap_rows
  none
  ((GtkCList clist)
   (int row1) (int row2)))

(define-func gtk_clist_row_move
  none
  ((GtkCList clist)
   (int source_row)
   (int dest_row)))

(define-func gtk_clist_set_sort_column
  none
  ((GtkCList clist)
   (int column)))

(define-func gtk_clist_set_sort_type
  none
  ((GtkCList clist)
   (GtkSortType sort_type)))

(define-func gtk_clist_sort
  none
  ((GtkCList clist)))

(define-func gtk_clist_set_auto_sort
  none
  ((GtkCList clist)
   (bool auto_sort)))

;;;; GtkCombo

(define-object GtkCombo (GtkHBox)
  (fields 
   (GtkWidget entry)
   (GtkWidget list)))

(define-func gtk_combo_new
  GtkWidget 
  ())

(define-func gtk_combo_set_value_in_list
  none
  ((GtkCombo combo)
   (bool val)
   (bool ok_if_empty)))

(define-func gtk_combo_set_use_arrows
  none
  ((GtkCombo combo)
   (bool val)))

(define-func gtk_combo_set_use_arrows_always
  none
  ((GtkCombo combo)
   (bool val)))

(define-func gtk_combo_set_case_sensitive
  none
  ((GtkCombo combo)
   (bool val)))

(define-func gtk_combo_set_item_string
  none
  ((GtkCombo combo)
   (GtkItem item)
   (string item_value)))

;gtk_combo_set_popdown_strings

(define-func gtk_combo_disable_activate
  none
  ((GtkCombo combo)))


;; ListItem

(define-object GtkListItem (GtkItem))

(define-func gtk_list_item_new
  GtkWidget
  ())

(define-func gtk_list_item_new_with_label
  GtkWidget
  ((string label)))

(define-func gtk_list_item_select
  none
  ((GtkListItem list_item)))

(define-func gtk_list_item_deselect
  none
  ((GtkListItem list_item)))

;; List

(define-object GtkList (GtkContainer)
  (fields
   (GtkWidget undo_focus_child)
   (GtkWidget last_focus_child)))

(define-func gtk_list_new
  GtkWidget
  ())

;gtk_list_insert_items
;gtk_list_append_items
;gtk_list_prepend_items
;gtk_list_remove_items

(define-func gtk_list_clear_items
  none
  ((GtkList list)
   (int start)
   (int end)))

(define-func gtk_list_select_item
  none
  ((GtkList list)
   (int item)))

(define-func gtk_list_unselect_item
  none
  ((GtkList list)
   (int item)))

(define-func gtk_list_select_child
  none
  ((GtkList list)
   (GtkWidget child)))

(define-func gtk_list_unselect_child
  none
  ((GtkList list)
   (GtkWidget child)))

(define-func gtk_list_child_position
  int
  ((GtkList list)
   (GtkWidget child)))

(define-func gtk_list_set_selection_mode
  none
  ((GtkList list)
   (GtkSelectionMode mode)))

(define-func gtk_list_extend_selection
  none
  ((GtkList list)
   (GtkScrollType scroll_type)
   (float position)
   (bool auto_start)))

(define-func gtk_list_start_selection
  none
  ((GtkList list)))

(define-func gtk_list_end_selection
  none
  ((GtkList list)))

(define-func gtk_list_select_all
  none
  ((GtkList list)))

(define-func gtk_list_unselect_all
  none
  ((GtkList list)))

(define-func gtk_list_scroll_horizontal
  none
  ((GtkList list)
   (GtkScrollType scroll_type)
   (float pos)))

(define-func gtk_list_scroll_vertical
  none
  ((GtkList list)
   (GtkScrollType scroll_type)
   (float pos)))

(define-func gtk_list_toggle_add_mode
  none
  ((GtkList list)))

(define-func gtk_list_toggle_focus_row
  none
  ((GtkList list)))

(define-func gtk_list_toggle_row
  none
  ((GtkList list)
   (GtkWidget item)))

(define-func gtk_list_undo_selection
  none
  ((GtkList list)))

(define-func gtk_list_end_drag_selection
  none
  ((GtkList list)))


;; GtkCTree

(define-object GtkCTree (GtkCList))

; gtk_ctree_new_with_titles

(define-func gtk_ctree_new
  GtkWidget
  ((int columns)
   (int tree_column)))

;gtk_ctree_insert_node
(define-func gtk_ctree_remove_node
  none
  ((GtkCTree ctree)
   (GtkCTreeNode node)))

(define-func gtk_ctree_is_viewable
  bool
  ((GtkCTree ctree)
   (GtkCTreeNode node)))

(define-func gtk_ctree_last
  GtkCTreeNode
  ((GtkCTree ctree)
   (GtkCTreeNode node)))

;gtk_ctree_find_node_ptr
(define-func gtk_ctree_node_nth
  (GtkCTreeNode null-ok)
  ((GtkCTree ctree)
   (uint row)))

(define-func gtk_ctree_find
  bool
  ((GtkCTree ctree)
   (GtkCTreeNode node)
   (GtkCTreeNode child)))

(define-func gtk_ctree_is_ancestor
  bool
  ((GtkCTree ctree)
   (GtkCTreeNode node)
   (GtkCTreeNode child)))

; gtk_ctree_find_by_row_data
; gtk_ctree_find_all_by_row_data
(define-func gtk_ctree_is_hot_spot
  bool
  ((GtkCTree ctree)
   (int x) (int y)))

;; defined in gtkmodule.c (so that parent and sibling can be None)
;(define-func gtk_ctree_move
;  none
;  ((GtkCTree ctree)
;   (GtkCTreeNode node)
;   (GtkCTreeNode new_parent)
;   (GtkCTreeNode new_sibling)))

(define-func gtk_ctree_expand
  none
  ((GtkCTree ctree)
   (GtkCTreeNode node)))

(define-func gtk_ctree_expand_recursive
  none
  ((GtkCTree ctree)
   (GtkCTreeNode node)))

(define-func gtk_ctree_expand_to_depth
  none
  ((GtkCTree ctree)
   (GtkCTreeNode node)
   (int depth)))

(define-func gtk_ctree_collapse
  none
  ((GtkCTree ctree)
   (GtkCTreeNode node)))

(define-func gtk_ctree_collapse_recursive
  none
  ((GtkCTree ctree)
   (GtkCTreeNode node)))

(define-func gtk_ctree_collapse_to_depth
  none
  ((GtkCTree ctree)
   (GtkCTreeNode node)
   (int depth)))

(define-func gtk_ctree_toggle_expansion
  none
  ((GtkCTree ctree)
   (GtkCTreeNode node)))

(define-func gtk_ctree_toggle_expansion_recursive
  none
  ((GtkCTree ctree)
   (GtkCTreeNode node)))

(define-func gtk_ctree_select
  none
  ((GtkCTree ctree)
   (GtkCTreeNode node)))

(define-func gtk_ctree_select_recursive
  none
  ((GtkCTree ctree)
   (GtkCTreeNode node)))

(define-func gtk_ctree_unselect
  none
  ((GtkCTree ctree)
   (GtkCTreeNode node)))

(define-func gtk_ctree_unselect_recursive
  none
  ((GtkCTree ctree)
   (GtkCTreeNode node)))

(define-func gtk_ctree_real_select_recursive
  none
  ((GtkCTree ctree)
   (GtkCTreeNode node)
   (int state)))

(define-func gtk_ctree_node_set_text
  none
  ((GtkCTree ctree)
   (GtkCTreeNode node)
   (int column)
   (string text)))

(define-func gtk_ctree_node_set_pixmap
  none
  ((GtkCTree ctree)
   (GtkCTreeNode node)
   (int column)
   (GdkPixmap pixmap)
   (GdkBitmap mask)))

(define-func gtk_ctree_node_set_pixtext
  none
  ((GtkCTree ctree)
   (GtkCTreeNode node)
   (int column)
   (string text)
   (uint spacing)
   (GdkPixmap pixmap)
   (GdkBitmap mask)))

(define-func gtk_ctree_set_node_info
  none
  ((GtkCTree ctree)
   (GtkCTreeNode node)
   (string text)
   (uint spacing)
   (GdkPixmap pixmap_closed) (GdkBitmap mask_closed)
   (GdkPixmap pixmap_opened) (GdkBitmap mask_opened)
   (bool is_leaf)
   (bool expanded)))

(define-func gtk_ctree_node_set_shift
  none
  ((GtkCTree ctree)
   (GtkCTreeNode node)
   (int column)
   (int vertical) (int horizontal)))

(define-func gtk_ctree_node_set_selectable
  none
  ((GtkCTree ctree)
   (GtkCTreeNode node)
   (bool selectable)))

(define-func gtk_ctree_node_get_selectable
  bool
  ((GtkCTree ctree)
   (GtkCTreeNode node)))

(define-func gtk_ctree_node_get_cell_type
  GtkCellType
  ((GtkCTree ctree)
   (GtkCTreeNode node)
   (int column)))

;gtk_ctree_node_get_text
;gtk_ctree_node_get_pixmap
;gtk_ctree_node_get_pixtext
;gtk_ctree_get_node_info

(define-func gtk_ctree_node_set_row_style
  none
  ((GtkCTree ctree)
   (GtkCTreeNode node)
   (GtkStyle style)))

(define-func gtk_ctree_node_get_row_style
  GtkStyle
  ((GtkCTree ctree)
   (GtkCTreeNode node)))

(define-func gtk_ctree_node_set_cell_style
  none
  ((GtkCTree ctree)
   (GtkCTreeNode node)
   (int column)
   (GtkStyle style)))

(define-func gtk_ctree_node_get_cell_style
  GtkStyle
  ((GtkCTree ctree)
   (GtkCTreeNode node)
   (int column)))

(define-func gtk_ctree_node_set_foreground
  none
  ((GtkCTree ctree)
   (GtkCTreeNode node)
   (GdkColor color)))

(define-func gtk_ctree_node_set_background
  none
  ((GtkCTree ctree)
   (GtkCTreeNode node)
   (GdkColor color)))

;gtk_ctree_node_set_row_data
;gtk_ctree_node_get_row_data
(define-func gtk_ctree_node_moveto
  none
  ((GtkCTree ctree)
   (GtkCTreeNode node)
   (int column)
   (float row_align)
   (float col_align)))

(define-func gtk_ctree_node_is_visible
  GtkVisibility
  ((GtkCTree ctree)
   (GtkCTreeNode node)))

(define-func gtk_ctree_set_indent
  none
  ((GtkCTree ctree)
   (int indent)))

(define-func gtk_ctree_set_spacing
  none
  ((GtkCTree ctree)
   (int spacing)))

(define-func gtk_ctree_set_show_stub
  none
  ((GtkCTree ctree)
   (bool show_stub)))

(define-func gtk_ctree_set_line_style
  none
  ((GtkCTree ctree)
   (GtkCTreeLineStyle style)))

(define-func gtk_ctree_set_expander_style
  none
  ((GtkCTree ctree)
   (GtkCTreeExpanderStyle style)))

(define-func gtk_ctree_sort_node
  none
  ((GtkCTree ctree)
   (GtkCTreeNode node)))

(define-func gtk_ctree_sort_recursive
  none
  ((GtkCTree ctree)
   (GtkCTreeNode node)))

