;; -*- scheme -*-

;; These are snarfed from the GTK distribution.  It needs to be updated from
;; time to time
(include "gtkenums.defs")

;;; Boxed types
(define-boxed GtkAccelGroup
  gtk_accel_group_ref
  gtk_accel_group_unref)

(define-boxed GtkStyle
  gtk_style_ref
  gtk_style_unref)

(define-boxed GtkSelectionData
  gtk_selection_copy
  gtk_selection_free)

(define-boxed GdkDragContext
  gdk_drag_context_ref
  gdk_drag_context_unref)

(define-boxed GdkColormap
  gdk_colormap_ref
  gdk_colormap_unref)

(define-boxed GdkFont
  gdk_font_ref
  gdk_font_unref)

(define-boxed GdkWindow
  gdk_window_ref
  gdk_window_unref)
(define-boxed GdkPixmap
  gdk_window_ref
  gdk_window_unref)
(define-boxed GdkBitmap
  gdk_window_ref
  gdk_window_unref)
(define-boxed GdkDrawable
  gdk_window_ref
  gdk_window_unref)

(define-boxed GdkEvent
  gdk_event_copy
  gdk_event_free
  "sizeof(GdkEvent)")

(define-boxed GdkColor
  gdk_color_copy
  gdk_color_free
  "sizeof(GdkColor)")

(define-boxed GdkGC
  gdk_gc_ref
  gdk_gc_unref)

(define-boxed GdkCursor
)

(define-boxed GtkCTreeNode
)

;;; Gdk Functions
(define-func gdk_font_load
  GdkFont
  ((string name)))
(define-func gdk_fontset_load
  GdkFont
  ((string name)))

(define-func gdk_draw_point
  none
  ((GdkDrawable drawable)
   (GdkGC gc)
   (int x) (int y)))
(define-func gdk_draw_line
  none
  ((GdkDrawable drawable)
   (GdkGC gc)
   (int x1) (int y1)
   (int x2) (int y2)))
(define-func gdk_draw_rectangle
  none
  ((GdkDrawable drawable)
   (GdkGC gc)
   (int filled)
   (int x)     (int y)
   (int width) (int height)))
(define-func gdk_draw_arc
  none
  ((GdkDrawable drawable)
   (GdkGC gc)
   (int filled)
   (int x)      (int y)
   (int width)  (int height)
   (int angle1) (int angle2)))
; gdk_draw_polygon
(define-func gdk_draw_string
  none
  ((GdkDrawable drawable)
   (GdkFont font)
   (GdkGC gc)
   (int x) (int y)
   (string str)))
; gdk_draw_text
(define-func gdk_draw_pixmap
  none
  ((GdkDrawable drawable)
   (GdkGC gc)
   (GdkDrawable src)
   (int xsrc)  (int ysrc)
   (int xdest) (int ydest)
   (int width) (int height)))
;gdk_draw_points
;gdk_draw_segments
;gdk_draw_lines

(define-func gdk_cursor_new
  GdkCursor
  ((GdkCursorType cursor_type)))

(define-func gdk_cursor_new_from_pixmap
  GdkCursor
  ((GdkPixmap source)
   (GdkBitmap mask)
   (GdkColor fg)
   (GdkColor bg)
   (int x) (int y)))

;; misc gdk functions that are useful to GTK programmers ...
(define-func gdk_screen_width
  int
  ())

(define-func gdk_screen_height
  int
  ())

(define-func gdk_screen_width_mm
  int
  ())

(define-func gdk_screen_height_mm
  int
  ())

;; these two are used extensively -- define early
(define-object GtkObject (nil))
(define-object GtkWidget (GtkObject))

; from gtktypeutils.h
(define-func gtk_type_from_name
  uint
  ((string name)))

(define-func gtk_type_name
  static_string
  ((uint type)))

;;; gtkmain.h
;; main

(define-func gtk_exit
  none
  ((int code (= "0"))))

(define-func gtk_main
  none
  ())

(define-func gtk_main_quit
  none
  ())
;gtk_main_iteration

(define-func gtk_set_locale
  static_string
  ())

(define-func gtk_quit_add_destroy
  none
  ((uint main_level)
   (GtkObject object)))

(define-func gtk_quit_remove
  none
  ((uint quit_id)))

;gtk_timeout_add
(define-func gtk_timeout_remove
  none
  ((int tag)))

;gtk_idle_add
(define-func gtk_idle_remove
  none
  ((int tag)))

;gtk_input_add
(define-func gtk_input_remove
  none
  ((int tag)))

(define-func gtk_events_pending
  int
  ())

;; gtkrc.h
(define-func gtk_rc_parse
  none
  ((string file)))
(define-func gtk_rc_parse_string
  none
  ((string rc_string)))
(define-func gtk_rc_reparse_all
  none
  ())
(define-func gtk_rc_get_style
  GtkStyle
  ((GtkWidget widget)))
;(define-func gtk_rc_add_widget_name_style
;  none
;  ((GtkStyle style)
;   (string pattern)))
;(define-func gtk_rc_add_widget_class_style
;  none
;  ((GtkStyle style)
;   (string pattern)))
;(define-func gtk_rc_add_class_style
;  none
;  ((GtkStyle style)
;   (string pattern)))

;; gtkaccelgroup.h
(define-func gtk_accel_group_new
  GtkAccelGroup
  ())
(define-func gtk_accel_group_get_default
  GtkAccelGroup
  ())
(define-func gtk_accel_group_activate
  bool
  ((GtkAccelGroup group)
   (uint key)
   (GdkModifierType modifiers)))
(define-func gtk_accel_groups_activate
  bool
  ((GtkObject object)
   (uint key)
   (GdkModifierType modifiers)))
(define-func gtk_accel_group_attach
  none
  ((GtkAccelGroup group)
   (GtkObject object)))
(define-func gtk_accel_group_detach
  none
  ((GtkAccelGroup group)
   (GtkObject object)))
(define-func gtk_accel_group_lock
  none
  ((GtkAccelGroup group)))
(define-func gtk_accel_group_unlock
  none
  ((GtkAccelGroup group)))
(define-func gtk_accel_group_lock_entry
  none
  ((GtkAccelGroup group)
   (uint key)
   (GdkModifierType modifiers)))
(define-func gtk_accel_group_unlock_entry
  none
  ((GtkAccelGroup group)
   (uint key)
   (GdkModifierType modifiers)))
(define-func gtk_accel_group_add
  none
  ((GtkAccelGroup group)
   (uint key)
   (GdkModifierType modifiers)
   (GtkAccelFlags flags)
   (GtkObject object)
   (string signal)))
(define-func gtk_accel_group_remove
  none
  ((GtkAccelGroup group)
   (uint key)
   (GdkModifierType modifiers)
   (GtkObject object)))

;; base functionality (GtkObject, signals, GtkWidget)
(include "gtkbase.defs")

;; dnd and selection stuff ...
(include "gtkdnd.defs")

;; descendents of GtkData (alignments, tooltips, etc)
(include "gtkdata.defs")

;; all the different containers
(include "gtkcontainers.defs")

;; all the rest ...
(include "gtkmisc.defs")

;; trees/lists ...
(include "gtklists.defs")

;; menus, menubars ...
(include "gtkmenus.defs")

;; ranges, rulers, scrollbars ...
(include "gtkranges.defs")

;; editable components ...
(include "gtkedit.defs")
