; -*- scheme -*-
;; MenuShell

(define-object GtkMenuShell (GtkContainer))

(define-func gtk_menu_shell_append
  none
  ((GtkMenuShell menu_shell)
   (GtkWidget child)))

(define-func gtk_menu_shell_prepend
  none
  ((GtkMenuShell menu_shell)
   (GtkWidget child)))

(define-func gtk_menu_shell_insert
  none
  ((GtkMenuShell menu_shell)
   (GtkWidget child)
   (int position)))

(define-func gtk_menu_shell_deactivate
  none
  ((GtkMenuShell menu_shell)))

(define-func gtk_menu_shell_select_item
  none
  ((GtkMenuShell menu_shell)
   (GtkWidget menu_item)))

(define-func gtk_menu_shell_deselect
  none
  ((GtkMenuShell menu_shell)))

(define-func gtk_menu_shell_activate_item
  none
  ((GtkMenuShell menu_shell)
   (GtkWidget menu_item)
   (bool force_deactivate)))

;; MenuBar

(define-object GtkMenuBar (GtkMenuShell))

(define-func gtk_menu_bar_new
  GtkWidget
  ())

(define-func gtk_menu_bar_append
  none
  ((GtkMenuBar menu_bar)
   (GtkWidget child)))

(define-func gtk_menu_bar_prepend
  none
  ((GtkMenuBar menu_bar)
   (GtkWidget child)))

(define-func gtk_menu_bar_insert
  none
  ((GtkMenuBar menu_bar)
   (GtkWidget child)
   (int position)))

(define-func gtk_menu_bar_set_shadow_type
  none
  ((GtkMenuBar menu_bar)
   (GtkShadowType type)))

;; Menu

(define-object GtkMenu (GtkMenuShell))

(define-func gtk_menu_new
  GtkWidget
  ())

(define-func gtk_menu_append
  none
  ((GtkMenu menu)
   (GtkWidget child)))

(define-func gtk_menu_prepend
  none
  ((GtkMenu menu)
   (GtkWidget child)))

(define-func gtk_menu_insert
  none
  ((GtkMenu menu)
   (GtkWidget child)
   (int position)))

;gtk_menu_popup
(define-func gtk_menu_reposition
  none
  ((GtkMenu menu)))

(define-func gtk_menu_popdown
  none
  ((GtkMenu menu)))

(define-func gtk_menu_get_active
  GtkWidget
  ((GtkMenu menu)))

(define-func gtk_menu_set_active
  none
  ((GtkMenu menu)
   (int index)))

(define-func gtk_menu_set_accel_group
  none
  ((GtkMenu menu)
   (GtkAccelGroup group)))

(define-func gtk_menu_get_accel_group
  GtkAccelGroup
  ((GtkMenu menu)))

(define-func gtk_menu_ensure_uline_accel_group
  GtkAccelGroup
  ((GtkMenu menu)))

;; gtk_menu_attach_to_widget

(define-func gtk_menu_get_attach_widget
  GtkWidget
  ((GtkMenu menu)))

(define-func gtk_menu_detach
  none
  ((GtkMenu menu)))

(define-func gtk_menu_set_tearoff_state
  none
  ((GtkMenu menu)
   (bool torn_off)))

(define-func gtk_menu_set_title
  none
  ((GtkMenu menu)
   (string title)))

(define-func gtk_menu_reorder_child
  none
  ((GtkMenu menu)
   (GtkWidget child)
   (int position)))

;; MenuItem

(define-object GtkMenuItem (GtkItem)
  (fields
   (GtkWidget submenu)))

(define-func gtk_menu_item_new
  GtkWidget
  ())

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

(define-func gtk_menu_item_set_submenu
  none
  ((GtkMenuItem menu_item)
   (GtkWidget submenu)))

(define-func gtk_menu_item_remove_submenu
  none
  ((GtkMenuItem menu_item)))

(define-func gtk_menu_item_set_placement
  none
  ((GtkMenuItem menu_item)
   (GtkSubmenuPlacement placement)))

(define-func gtk_menu_item_configure
  none
  ((GtkMenuItem menu_item)
   (bool show_toggle_indicator)
   (bool show_submenu_indicator)))

(define-func gtk_menu_item_select
  none
  ((GtkMenuItem menu_item)))

(define-func gtk_menu_item_deselect
  none
  ((GtkMenuItem menu_item)))

(define-func gtk_menu_item_activate
  none
  ((GtkMenuItem menu_item)))

(define-func gtk_menu_item_right_justify
  none
  ((GtkMenuItem menu_item)))

;; CheckMenuItem

(define-object GtkCheckMenuItem (GtkMenuItem)
  (fields
   (uint active)))

(define-func gtk_check_menu_item_new
  GtkWidget
  ())

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

(define-func gtk_check_menu_item_set_active
  none
  ((GtkCheckMenuItem check_menu_item)
   (bool state)))

(define-func gtk_check_menu_item_set_show_toggle
  none
  ((GtkCheckMenuItem menu_item)
   (bool always)))

(define-func gtk_check_menu_item_toggled
  none
  ((GtkCheckMenuItem check_menu_item)))

;; RadioMenuItem

(define-object GtkRadioMenuItem (GtkCheckMenuItem))

;(define-func gtk_radio_menu_item_new_interp
;  GtkWidget
;  ((GtkRadioMenuItem group (null-ok))))

;(define-func gtk_radio_menu_item_new_with_label_interp
;  GtkWidget
;  ((GtkRadioMenuItem group (null-ok))
;   (string label)))

;; OptionMenu

(define-object GtkOptionMenu (GtkButton))

(define-func gtk_option_menu_new
  GtkWidget
  ())

(define-func gtk_option_menu_get_menu
  GtkWidget
  ((GtkOptionMenu option_menu)))

(define-func gtk_option_menu_set_menu
  none
  ((GtkOptionMenu option_menu)
   (GtkWidget menu)))

(define-func gtk_option_menu_remove_menu
  none
  ((GtkOptionMenu option_menu)))

(define-func gtk_option_menu_set_history
  none
  ((GtkOptionMenu option_menu)
   (int index)))

;; Tearoffs
(define-object GtkTearoffMenuItem (GtkMenuItem))
(define-func gtk_tearoff_menu_item_new
  GtkWidget
  ())

;; Item Factory
(define-object GtkItemFactory (GtkObject))

(define-func gtk_item_factory_new
  GtkItemFactory
  ((uint container_type)
   (string path)
   (GtkAccelGroup group)))

(define-func gtk_item_factory_parse_rc
  none
  ((string file_name)))

(define-func gtk_item_factory_parse_rc_string
  none
  ((string rc_string)))

(define-func gtk_item_factory_add_foreign
  none
  ((GtkWidget accel_widget)
   (string full_path)
   (GtkAccelGroup accel_group)
   (uint keyval)
   (GdkModifierType modifiers)))

(define-func gtk_item_factory_from_widget
  GtkItemFactory
  ((GtkWidget widget)))

(define-func gtk_item_factory_path_from_widget
  static_string
  ((GtkWidget widget)))

(define-func gtk_item_factory_get_widget
  GtkWidget
  ((GtkItemFactory ifactory)
   (string path)))

(define-func gtk_item_factory_get_widget_by_action
  GtkWidget
  ((GtkItemFactory ifactory)
   (uint action)))

;gtk_item_factory_create_items
(define-func gtk_item_factory_delete_item
  none
  ((GtkItemFactory ifactory)
   (string path)))

(define-func gtk_item_factory_popup
  none
  ((GtkItemFactory ifactory)
   (uint x) (uint y)
   (uint mouse_button)
   (uint time)))