;; -*- scheme -*-
; object definitions ...

(define-object Canvas
  (in-module "Mate")
  (parent "GtkLayout")
  (c-name "MateCanvas")
  (gtype-id "MATE_TYPE_CANVAS")
)

(define-object CanvasItem
  (in-module "Mate")
  (parent "GtkObject")
  (c-name "MateCanvasItem")
  (gtype-id "MATE_TYPE_CANVAS_ITEM")
)

(define-object CanvasGroup
  (in-module "Mate")
  (parent "MateCanvasItem")
  (c-name "MateCanvasGroup")
  (gtype-id "MATE_TYPE_CANVAS_GROUP")
  (fields
    '("GList*" "item_list"))
)

(define-object CanvasClipgroup
  (in-module "Mate")
  (parent "MateCanvasGroup")
  (c-name "MateCanvasClipgroup")
  (gtype-id "MATE_TYPE_CANVAS_CLIPGROUP")
)

(define-object CanvasLine
  (in-module "Mate")
  (parent "MateCanvasItem")
  (c-name "MateCanvasLine")
  (gtype-id "MATE_TYPE_CANVAS_LINE")
)

(define-object CanvasPixbuf
  (in-module "Mate")
  (parent "MateCanvasItem")
  (c-name "MateCanvasPixbuf")
  (gtype-id "MATE_TYPE_CANVAS_PIXBUF")
)

(define-object CanvasRichText
  (in-module "Mate")
  (parent "MateCanvasItem")
  (c-name "MateCanvasRichText")
  (gtype-id "MATE_TYPE_CANVAS_RICH_TEXT")
)

(define-object CanvasShape
  (in-module "Mate")
  (parent "MateCanvasItem")
  (c-name "MateCanvasShape")
  (gtype-id "MATE_TYPE_CANVAS_SHAPE")
)

(define-object CanvasRE
  (in-module "Mate")
  (parent "MateCanvasShape")
  (c-name "MateCanvasRE")
  (gtype-id "MATE_TYPE_CANVAS_RE")
)

(define-object CanvasRect
  (in-module "Mate")
  (parent "MateCanvasRE")
  (c-name "MateCanvasRect")
  (gtype-id "MATE_TYPE_CANVAS_RECT")
)

(define-object CanvasEllipse
  (in-module "Mate")
  (parent "MateCanvasRE")
  (c-name "MateCanvasEllipse")
  (gtype-id "MATE_TYPE_CANVAS_ELLIPSE")
)

(define-object CanvasPolygon
  (in-module "Mate")
  (parent "MateCanvasShape")
  (c-name "MateCanvasPolygon")
  (gtype-id "MATE_TYPE_CANVAS_POLYGON")
)

(define-object CanvasBpath
  (in-module "Mate")
  (parent "MateCanvasShape")
  (c-name "MateCanvasBpath")
  (gtype-id "MATE_TYPE_CANVAS_BPATH")
)

(define-boxed CanvasPathDef
  (in-module "Mate")
  (c-name "MateCanvasPathDef")
  (gtype-id "MATE_TYPE_CANVAS_PATH_DEF")
)

(define-object CanvasText
  (in-module "Mate")
  (parent "MateCanvasItem")
  (c-name "MateCanvasText")
  (gtype-id "MATE_TYPE_CANVAS_TEXT")
)

(define-object CanvasWidget
  (in-module "Mate")
  (parent "MateCanvasItem")
  (c-name "MateCanvasWidget")
  (gtype-id "MATE_TYPE_CANVAS_WIDGET")
)

(define-function mate_canvas_item_get_type
  (c-name "mate_canvas_item_get_type")
  (return-type "GtkType")
)

(define-method add
  (of-object "MateCanvasGroup")
  (c-name "mate_canvas_item_new")
  (return-type "MateCanvasItem*")
  (parameters
    '("GtkType" "type")
    '("const-gchar*" "first_arg_name")
  )
  (varargs #t)
)

(define-method set
  (of-object "MateCanvasItem")
  (c-name "mate_canvas_item_set")
  (return-type "none")
  (parameters
    '("const-gchar*" "first_arg_name")
  )
  (varargs #t)
)

(define-method move
  (of-object "MateCanvasItem")
  (c-name "mate_canvas_item_move")
  (return-type "none")
  (parameters
    '("double" "dx")
    '("double" "dy")
  )
)

(define-method affine_relative
  (of-object "MateCanvasItem")
  (c-name "mate_canvas_item_affine_relative")
  (return-type "none")
  (parameters
    '("const-double[6]" "affine")
  )
)

(define-method affine_absolute
  (of-object "MateCanvasItem")
  (c-name "mate_canvas_item_affine_absolute")
  (return-type "none")
  (parameters
    '("const-double[6]" "affine")
  )
)

;; XXX not implemented in CVS libmatecanvas
;; (define-method scale
;;   (of-object "MateCanvasItem")
;;   (c-name "mate_canvas_item_scale")
;;   (return-type "none")
;;   (parameters
;;     '("double" "x")
;;     '("double" "y")
;;     '("double" "scale_x")
;;     '("double" "scale_y")
;;   )
;; )

;; XXX not implemented in CVS libmatecanvas
;; (define-method rotate
;;   (of-object "MateCanvasItem")
;;   (c-name "mate_canvas_item_rotate")
;;   (return-type "none")
;;   (parameters
;;     '("double" "x")
;;     '("double" "y")
;;     '("double" "angle")
;;   )
;; )

(define-method raise
  (of-object "MateCanvasItem")
  (c-name "mate_canvas_item_raise")
  (return-type "none")
  (parameters
    '("int" "positions")
  )
)

(define-method lower
  (of-object "MateCanvasItem")
  (c-name "mate_canvas_item_lower")
  (return-type "none")
  (parameters
    '("int" "positions")
  )
)

(define-method raise_to_top
  (of-object "MateCanvasItem")
  (c-name "mate_canvas_item_raise_to_top")
  (return-type "none")
)

(define-method lower_to_bottom
  (of-object "MateCanvasItem")
  (c-name "mate_canvas_item_lower_to_bottom")
  (return-type "none")
)


(define-method show
  (of-object "MateCanvasItem")
  (c-name "mate_canvas_item_show")
  (return-type "none")
)

(define-method hide
  (of-object "MateCanvasItem")
  (c-name "mate_canvas_item_hide")
  (return-type "none")
)

(define-method w2i
  (of-object "MateCanvasItem")
  (c-name "mate_canvas_item_w2i")
  (return-type "none")
  (parameters
    '("double*" "x")
    '("double*" "y")
  )
)

(define-method i2w
  (of-object "MateCanvasItem")
  (c-name "mate_canvas_item_i2w")
  (return-type "none")
  (parameters
    '("double*" "x")
    '("double*" "y")
  )
)

(define-method i2w_affine
  (of-object "MateCanvasItem")
  (c-name "mate_canvas_item_i2w_affine")
  (return-type "none")
  (parameters
    '("double[6]" "affine")
  )
)

(define-method i2c_affine
  (of-object "MateCanvasItem")
  (c-name "mate_canvas_item_i2c_affine")
  (return-type "none")
  (parameters
    '("double[6]" "affine")
  )
)

(define-method reparent
  (of-object "MateCanvasItem")
  (c-name "mate_canvas_item_reparent")
  (return-type "none")
  (parameters
    '("MateCanvasGroup*" "new_group")
  )
)

(define-method grab
  (of-object "MateCanvasItem")
  (c-name "mate_canvas_item_grab")
  (return-type "none")
)

(define-method grab_focus
  (of-object "MateCanvasItem")
  (c-name "mate_canvas_item_grab_focus")
  (return-type "none")
)

(define-method get_bounds
  (of-object "MateCanvasItem")
  (c-name "mate_canvas_item_get_bounds")
  (return-type "none")
  (parameters
    '("double*" "x1")
    '("double*" "y1")
    '("double*" "x2")
    '("double*" "y2")
  )
)

;; only used by item implementations
;; (define-method request_update
;;   (of-object "MateCanvasItem")
;;   (c-name "mate_canvas_item_request_update")
;;   (return-type "none")
;; )

(define-function mate_canvas_group_get_type
  (c-name "mate_canvas_group_get_type")
  (return-type "GtkType")
)

(define-function mate_canvas_get_type
  (c-name "mate_canvas_get_type")
  (return-type "GtkType")
)

(define-function mate_canvas_new
  (is-constructor-of MateCanvas)
  (c-name "mate_canvas_new")
  (return-type "GtkWidget*")
)

(define-function mate_canvas_new_aa
  (is-constructor-of MateCanvas)
  (c-name "mate_canvas_new_aa")
  (return-type "GtkWidget*")
)

(define-method root
  (of-object "MateCanvas")
  (c-name "mate_canvas_root")
  (return-type "MateCanvasGroup*")
)

(define-method set_pixels_per_unit
  (of-object "MateCanvas")
  (c-name "mate_canvas_set_pixels_per_unit")
  (return-type "none")
  (parameters
    '("double" "n")
  )
)
	      
(define-method set_scroll_region
  (of-object "MateCanvas")
  (c-name "mate_canvas_set_scroll_region")
  (return-type "none")
  (parameters
    '("double" "x1")
    '("double" "y1")
    '("double" "x2")
    '("double" "y2")
  )
)

(define-method get_scroll_region
  (of-object "MateCanvas")
  (c-name "mate_canvas_get_scroll_region")
  (return-type "none")
  (parameters
    '("double*" "x1")
    '("double*" "y1")
    '("double*" "x2")
    '("double*" "y2")
  )
)

(define-method get_center_scroll_region
  (of-object "MateCanvas")
  (c-name "mate_canvas_get_center_scroll_region")
  (return-type "gboolean")
)

(define-method set_center_scroll_region
  (of-object "MateCanvas")
  (c-name "mate_canvas_set_center_scroll_region")
  (parameters
    '("gboolean" "center_scroll_region")
  )
)

(define-method scroll_to
  (of-object "MateCanvas")
  (c-name "mate_canvas_scroll_to")
  (return-type "none")
  (parameters
    '("int" "cx")
    '("int" "cy")
  )
)

(define-method get_scroll_offsets
  (of-object "MateCanvas")
  (c-name "mate_canvas_get_scroll_offsets")
  (return-type "none")
  (parameters
    '("int*" "cx")
    '("int*" "cy")
  )
)

(define-method update_now
  (of-object "MateCanvas")
  (c-name "mate_canvas_update_now")
  (return-type "none")
)

(define-method get_item_at
  (of-object "MateCanvas")
  (c-name "mate_canvas_get_item_at")
  (return-type "MateCanvasItem*")
  (parameters
    '("double" "x")
    '("double" "y")
  )
)

;; only used by object implementations
;; (define-method request_redraw_uta
;;   (of-object "MateCanvas")
;;   (c-name "mate_canvas_request_redraw_uta")
;;   (return-type "none")
;;   (parameters
;;     '("ArtUta8" "uta")
;;   )
;; )
 
;; only used by object implementations
;; (define-method request_redraw
;;   (of-object "MateCanvas")
;;   (c-name "mate_canvas_request_redraw")
;;   (return-type "none")
;;   (parameters
;;     '("int" "x1")
;;     '("int" "y1")
;;     '("int" "x2")
;;     '("int" "y2")
;;   )
;; )

(define-method w2c_affine
  (of-object "MateCanvas")
  (c-name "mate_canvas_w2c_affine")
  (return-type "none")
  (parameters
    '("double[6]" "affine")
  )
)

(define-method w2c
  (of-object "MateCanvas")
  (c-name "mate_canvas_w2c")
  (return-type "none")
  (parameters
    '("double" "wx")
    '("double" "wy")
    '("int*" "cx")
    '("int*" "cy")
  )
)

(define-method w2c_d
  (of-object "MateCanvas")
  (c-name "mate_canvas_w2c_d")
  (return-type "none")
  (parameters
    '("double" "wx")
    '("double" "wy")
    '("double*" "cx")
    '("double*" "cy")
  )
)

(define-method c2w
  (of-object "MateCanvas")
  (c-name "mate_canvas_c2w")
  (return-type "none")
  (parameters
    '("int" "cx")
    '("int" "cy")
    '("double*" "wx")
    '("double*" "wy")
  )
)

(define-method window_to_world
  (of-object "MateCanvas")
  (c-name "mate_canvas_window_to_world")
  (return-type "none")
  (parameters
    '("double" "winx")
    '("double" "winy")
    '("double*" "worldx")
    '("double*" "worldy")
  )
)

(define-method world_to_window
  (of-object "MateCanvas")
  (c-name "mate_canvas_world_to_window")
  (return-type "none")
  (parameters
    '("double" "worldx")
    '("double" "worldy")
    '("double*" "winx")
    '("double*" "winy")
  )
)

(define-method get_color
  (of-object "MateCanvas")
  (c-name "mate_canvas_get_color")
  (return-type "int")
  (parameters
    '("const-char*" "spec")
    '("GdkColor*" "color")
  )
)

(define-method get_color_pixel
  (of-object "MateCanvas")
  (c-name "mate_canvas_get_color_pixel")
  (return-type "gulong")
  (parameters
    '("guint" "rgba")
  )
)

;; only for use by item implementations
;; 
;; (define-method set_stipple_origin
;;   (of-object "MateCanvas")
;;   (c-name "mate_canvas_set_stipple_origin")
;;   (return-type "none")
;;   (parameters
;;     '("GdkGC*" "gc")
;;   )
;; )

(define-method set_dither
  (of-object "MateCanvas")
  (c-name "mate_canvas_set_dither")
  (return-type "none")
  (parameters
    '("GdkRgbDither" "dither")
  )
)

(define-method get_dither
  (of-object "MateCanvas")
  (c-name "mate_canvas_get_dither")
  (return-type "GdkRgbDither")
)

(define-function path_def_new
  (c-name "mate_canvas_path_def_new")
  (return-type "MateCanvasPathDef*")
)

; This is a fictitious method that sets the bpath property It is
; required because the bpath property is of type pointer, thus not
; usable from python.  See bug #136617.
(define-method set_bpath
  (of-object "MateCanvasBpath")
  (c-name "mate_canvas_bpath_set_bpath")
  (parameters
   '("MateCanvasPathDef*" "bpath")
   )
  (return-type "none")
)

;; From mate-canvas-rich-text.h

(define-method cut_clipboard
  (of-object "MateCanvasRichText")
  (c-name "mate_canvas_rich_text_cut_clipboard")
  (return-type "none")
)

(define-method copy_clipboard
  (of-object "MateCanvasRichText")
  (c-name "mate_canvas_rich_text_copy_clipboard")
  (return-type "none")
)

(define-method paste_clipboard
  (of-object "MateCanvasRichText")
  (c-name "mate_canvas_rich_text_paste_clipboard")
  (return-type "none")
)

(define-method set_buffer
  (of-object "MateCanvasRichText")
  (c-name "mate_canvas_rich_text_set_buffer")
  (return-type "none")
  (parameters
    '("GtkTextBuffer*" "buffer")
  )
)

(define-method get_buffer
  (of-object "MateCanvasRichText")
  (c-name "mate_canvas_rich_text_get_buffer")
  (return-type "GtkTextBuffer*")
)

(define-method get_iter_location
  (of-object "MateCanvasRichText")
  (c-name "mate_canvas_rich_text_get_iter_location")
  (return-type "none")
  (parameters
    '("const-GtkTextIter*" "iter")
    '("GdkRectangle*" "location")
  )
)

(define-method get_iter_at_location
  (of-object "MateCanvasRichText")
  (c-name "mate_canvas_rich_text_get_iter_at_location")
  (return-type "none")
  (parameters
    '("GtkTextIter*" "iter")
    '("gint" "x")
    '("gint" "y")
  )
)
