(define-object Context
  (in-module "Pango")
  (parent "GObject")
  (c-name "PangoContext")
  (gtype-id "PANGO_TYPE_CONTEXT")
)

;;This function is only used when constructing a new Pango backend which
;;applications shouldn't do, and relies on a special #define to be present in
;;the C API. This is not planned to be exposed in java-gnome so it is
;;commented out and fixes bug #528282

;;(define-function pango_context_new
;;  (is-constructor-of "PangoContext")
;;  (c-name "pango_context_new")
;;  (caller-owns-return #t)
;;  (return-type "PangoContext*")
;;)

;;(define-method add_font_map
;;  (of-object "PangoContext")
;;  (c-name "pango_context_set_font_map")
;;  (return-type "none")
;;  (parameters
;;    '("PangoFontMap*" "font_map")
;;  )
;;)

(define-method get_font_map
  (of-object "PangoContext")
  (c-name "pango_context_get_font_map")
  (return-type "PangoFontMap*")
)

(define-method list_families
  (of-object "PangoContext")
  (c-name "pango_context_list_families")
  (return-type "none")
  (parameters
    '("PangoFontFamily***" "families")
    '("int*" "n_families")
  )
)

(define-method load_font
  (of-object "PangoContext")
  (c-name "pango_context_load_font")
  (return-type "PangoFont*")
  (parameters
    '("const-PangoFontDescription*" "desc")
  )
)

(define-method load_fontset
  (of-object "PangoContext")
  (c-name "pango_context_load_fontset")
  (return-type "PangoFontset*")
  (parameters
    '("const-PangoFontDescription*" "desc")
    '("PangoLanguage*" "language")
  )
)

(define-method get_metrics
  (of-object "PangoContext")
  (c-name "pango_context_get_metrics")
  (caller-owns-return #t)
  (return-type "PangoFontMetrics*")
  (parameters
    '("const-PangoFontDescription*" "desc")
    '("PangoLanguage*" "language" (default "NULL") (null-ok))
  )
)

(define-method set_font_description
  (of-object "PangoContext")
  (c-name "pango_context_set_font_description")
  (return-type "none")
  (parameters
    '("const-PangoFontDescription*" "desc")
  )
)

(define-method get_font_description
  (of-object "PangoContext")
  (c-name "pango_context_get_font_description")
  (return-type "PangoFontDescription*")
)

(define-method get_language
  (of-object "PangoContext")
  (c-name "pango_context_get_language")
  (return-type "PangoLanguage*")
)

(define-method set_language
  (of-object "PangoContext")
  (c-name "pango_context_set_language")
  (return-type "none")
  (parameters
    '("PangoLanguage*" "language")
  )
)

(define-method set_base_dir
  (of-object "PangoContext")
  (c-name "pango_context_set_base_dir")
  (return-type "none")
  (parameters
    '("PangoDirection" "direction")
  )
)

(define-method get_base_dir
  (of-object "PangoContext")
  (c-name "pango_context_get_base_dir")
  (return-type "PangoDirection")
)

(define-method set_matrix
  (of-object "PangoContext")
  (c-name "pango_context_set_matrix")
  (return-type "none")
  (parameters
    '("const-PangoMatrix*" "matrix")
  )
)

(define-method get_matrix
  (of-object "PangoContext")
  (c-name "pango_context_get_matrix")
  (return-type "const-PangoMatrix*")
)

(define-method set_base_gravity
  (of-object "PangoContext")
  (c-name "pango_context_set_base_gravity")
  (return-type "none")
  (parameters
    '("PangoGravity" "gravity")
  )
)

(define-method get_base_gravity
  (of-object "PangoContext")
  (c-name "pango_context_get_base_gravity")
  (return-type "PangoGravity")
)

(define-method get_gravity
  (of-object "PangoContext")
  (c-name "pango_context_get_gravity")
  (return-type "PangoGravity")
)

(define-method set_gravity_hint
  (of-object "PangoContext")
  (c-name "pango_context_set_gravity_hint")
  (return-type "none")
  (parameters
    '("PangoGravityHint" "hint")
  )
)

(define-method get_gravity_hint
  (of-object "PangoContext")
  (c-name "pango_context_get_gravity_hint")
  (return-type "PangoGravityHint")
)

;; add Cairo support!
;;
(define-method set_font_options
  (of-object "PangoContext")
  (c-name "pango_cairo_context_set_font_options")
  (return-type "none")
  (parameters
    '("cairo_font_options_t*" "options")
  )
)

