;; -*- scheme -*-
;; boxed definitions ...

(define-boxed AttrList
  (in-module "Pango")
  (c-name "PangoAttrList")
  (gtype-id "PANGO_TYPE_ATTR_LIST")
  (copy-func "pango_attr_list_ref")
  (release-func "pango_attr_list_unref")
)

(define-boxed Color
  (in-module "Pango")
  (c-name "PangoColor")
  (gtype-id "PANGO_TYPE_COLOR")
  (copy-func "pango_color_copy")
  (release-func "pango_color_free")
  (fields
    '("guint16" "red")
    '("guint16" "green")
    '("guint16" "blue")
  )
)

(define-boxed FontDescription
  (in-module "Pango")
  (c-name "PangoFontDescription")
  (gtype-id "PANGO_TYPE_FONT_DESCRIPTION")
  (copy-func "pango_font_description_copy")
  (release-func "pango_font_description_free")
)

(define-boxed FontMetrics
  (in-module "Pango")
  (c-name "PangoFontMetrics")
  (gtype-id "PANGO_TYPE_FONT_METRICS")
  (copy-func "pango_font_metrics_ref")
  (release-func "pango_font_metrics_unref")
)

(define-boxed GlyphString
  (in-module "Pango")
  (c-name "PangoGlyphString")
  (gtype-id "PANGO_TYPE_GLYPH_STRING")
  (copy-func "pango_glyph_string_copy")
  (release-func "pango_glyph_string_free")
  (fields
    '("gint" "num_glyphs")
    '("PangoGlyphInfo*" "glyphs")
    '("gint*" "log_clusters")
  )
)

(define-boxed Item
  (in-module "Pango")
  (c-name "PangoItem")
  (fields
   '("gint" "offset")
   '("gint" "length")
   '("gint" "num_chars")
   '("PangoEngineShape*" "analysis.shape_engine")
   '("PangoEngineLang*" "analysis.lang_engine")
   '("PangoFont*" "analysis.font")
   '("guint8" "analysis.level")
   '("PangoLanguage*" "analysis.language")
   '("GSList*" "analysis.extra_attrs")
  )
  (gtype-id "PANGO_TYPE_ITEM")
)

(define-boxed Language
  (in-module "Pango")
  (c-name "PangoLanguage")
  (gtype-id "PANGO_TYPE_LANGUAGE")
)

(define-boxed LayoutIter
  (in-module "Pango")
  (c-name "PangoLayoutIter")
  (gtype-id "PANGO_TYPE_LAYOUT_ITER")
  (release-func "pango_layout_iter_free")
)


(define-boxed LayoutLine
  (in-module "Pango")
  (c-name "PangoLayoutLine")
  (gtype-id "PANGO_TYPE_LAYOUT_LINE")
  (fields
   ; '("PangoLayout*" "layout") ;; omitted for fear of creating reference cycles
   '("gint" "start_index")
   '("gint" "length")
   '("GSList*" "runs")
   '("guint" "is_paragraph_start")
   '("guint" "resolved_dir")
   )
)

(define-boxed Matrix
  (in-module "Pango")
  (c-name "PangoMatrix")
  (gtype-id "PANGO_TYPE_MATRIX")
)

(define-boxed TabArray
  (in-module "Pango")
  (c-name "PangoTabArray")
  (gtype-id "PANGO_TYPE_TAB_ARRAY")
  (copy-func "pango_tab_array_copy")
  (release-func "pango_tab_array_free")
)


; object definitions ...

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

(define-object Engine
  (in-module "Pango")
  (parent "GObject")
  (c-name "PangoEngine")
  (gtype-id "PANGO_TYPE_ENGINE")
)

(define-object EngineLang
  (in-module "Pango")
  (parent "PangoEngine")
  (c-name "PangoEngineLang")
  (gtype-id "PANGO_TYPE_ENGINE_LANG")
)

(define-object EngineShape
  (in-module "Pango")
  (parent "PangoEngine")
  (c-name "PangoEngineShape")
  (gtype-id "PANGO_TYPE_ENGINE_SHAPE")
)

(define-object Font
  (in-module "Pango")
  (parent "GObject")
  (c-name "PangoFont")
  (gtype-id "PANGO_TYPE_FONT")
)

(define-object FontFace
  (in-module "Pango")
  (parent "GObject")
  (c-name "PangoFontFace")
  (gtype-id "PANGO_TYPE_FONT_FACE")
)

(define-object FontFamily
  (in-module "Pango")
  (parent "GObject")
  (c-name "PangoFontFamily")
  (gtype-id "PANGO_TYPE_FONT_FAMILY")
)

(define-object FontMap
  (in-module "Pango")
  (parent "GObject")
  (c-name "PangoFontMap")
  (gtype-id "PANGO_TYPE_FONT_MAP")
)

(define-object Fontset
  (in-module "Pango")
  (parent "GObject")
  (c-name "PangoFontset")
  (gtype-id "PANGO_TYPE_FONTSET")
)

(define-object FontsetSimple
  (in-module "Pango")
  (parent "PangoFontset")
  (c-name "PangoFontsetSimple")
  (gtype-id "PANGO_TYPE_FONTSET_SIMPLE")
)

(define-object Layout
  (in-module "Pango")
  (parent "GObject")
  (c-name "PangoLayout")
  (gtype-id "PANGO_TYPE_LAYOUT")
)

(define-object Renderer
  (in-module "Pango")
  (parent "GObject")
  (c-name "PangoRenderer")
  (gtype-id "PANGO_TYPE_RENDERER")
)


;; Enumerations and flags ...

(define-enum Alignment
  (in-module "Pango")
  (c-name "PangoAlignment")
  (gtype-id "PANGO_TYPE_ALIGNMENT")
  (values
    '("left" "PANGO_ALIGN_LEFT")
    '("center" "PANGO_ALIGN_CENTER")
    '("right" "PANGO_ALIGN_RIGHT")
  )
)

(define-enum AttrType
  (in-module "Pango")
  (c-name "PangoAttrType")
  (gtype-id "PANGO_TYPE_ATTR_TYPE")
  (values
    '("invalid" "PANGO_ATTR_INVALID")
    '("language" "PANGO_ATTR_LANGUAGE")
    '("family" "PANGO_ATTR_FAMILY")
    '("style" "PANGO_ATTR_STYLE")
    '("weight" "PANGO_ATTR_WEIGHT")
    '("variant" "PANGO_ATTR_VARIANT")
    '("stretch" "PANGO_ATTR_STRETCH")
    '("size" "PANGO_ATTR_SIZE")
    '("font-desc" "PANGO_ATTR_FONT_DESC")
    '("foreground" "PANGO_ATTR_FOREGROUND")
    '("background" "PANGO_ATTR_BACKGROUND")
    '("underline" "PANGO_ATTR_UNDERLINE")
    '("strikethrough" "PANGO_ATTR_STRIKETHROUGH")
    '("rise" "PANGO_ATTR_RISE")
    '("shape" "PANGO_ATTR_SHAPE")
    '("scale" "PANGO_ATTR_SCALE")
    '("fallback" "PANGO_ATTR_FALLBACK")
    '("letter-spacing" "PANGO_ATTR_LETTER_SPACING")
    '("underline-color" "PANGO_ATTR_UNDERLINE_COLOR")
    '("strikethrough-color" "PANGO_ATTR_STRIKETHROUGH_COLOR")
    '("absolute-size" "PANGO_ATTR_ABSOLUTE_SIZE")
  )
)

(define-enum CoverageLevel
  (in-module "Pango")
  (c-name "PangoCoverageLevel")
  (gtype-id "PANGO_TYPE_COVERAGE_LEVEL")
  (values
    '("none" "PANGO_COVERAGE_NONE")
    '("fallback" "PANGO_COVERAGE_FALLBACK")
    '("approximate" "PANGO_COVERAGE_APPROXIMATE")
    '("exact" "PANGO_COVERAGE_EXACT")
  )
)

(define-enum Direction
  (in-module "Pango")
  (c-name "PangoDirection")
  (gtype-id "PANGO_TYPE_DIRECTION")
  (values
    '("ltr" "PANGO_DIRECTION_LTR")
    '("rtl" "PANGO_DIRECTION_RTL")
    '("ttb-ltr" "PANGO_DIRECTION_TTB_LTR")
    '("ttb-rtl" "PANGO_DIRECTION_TTB_RTL")
    '("weak-ltr" "PANGO_DIRECTION_WEAK_LTR")
    '("weak-rtl" "PANGO_DIRECTION_WEAK_RTL")
    '("neutral" "PANGO_DIRECTION_NEUTRAL")
  )
)

(define-enum EllipsizeMode
  (in-module "Pango")
  (c-name "PangoEllipsizeMode")
  (gtype-id "PANGO_TYPE_ELLIPSIZE_MODE")
  (values
    '("none" "PANGO_ELLIPSIZE_NONE")
    '("start" "PANGO_ELLIPSIZE_START")
    '("middle" "PANGO_ELLIPSIZE_MIDDLE")
    '("end" "PANGO_ELLIPSIZE_END")
  )
)

(define-enum RenderPart
  (in-module "Pango")
  (c-name "PangoRenderPart")
  (gtype-id "PANGO_TYPE_RENDER_PART")
  (values
    '("foreground" "PANGO_RENDER_PART_FOREGROUND")
    '("background" "PANGO_RENDER_PART_BACKGROUND")
    '("underline" "PANGO_RENDER_PART_UNDERLINE")
    '("strikethrough" "PANGO_RENDER_PART_STRIKETHROUGH")
  )
)

(define-enum Script
  (in-module "Pango")
  (c-name "PangoScript")
  (gtype-id "PANGO_TYPE_SCRIPT")
  (values
    '("invalid-code" "PANGO_SCRIPT_INVALID_CODE")
    '("common" "PANGO_SCRIPT_COMMON")
    '("inherited" "PANGO_SCRIPT_INHERITED")
    '("arabic" "PANGO_SCRIPT_ARABIC")
    '("armenian" "PANGO_SCRIPT_ARMENIAN")
    '("bengali" "PANGO_SCRIPT_BENGALI")
    '("bopomofo" "PANGO_SCRIPT_BOPOMOFO")
    '("cherokee" "PANGO_SCRIPT_CHEROKEE")
    '("coptic" "PANGO_SCRIPT_COPTIC")
    '("cyrillic" "PANGO_SCRIPT_CYRILLIC")
    '("deseret" "PANGO_SCRIPT_DESERET")
    '("devanagari" "PANGO_SCRIPT_DEVANAGARI")
    '("ethiopic" "PANGO_SCRIPT_ETHIOPIC")
    '("georgian" "PANGO_SCRIPT_GEORGIAN")
    '("gothic" "PANGO_SCRIPT_GOTHIC")
    '("greek" "PANGO_SCRIPT_GREEK")
    '("gujarati" "PANGO_SCRIPT_GUJARATI")
    '("gurmukhi" "PANGO_SCRIPT_GURMUKHI")
    '("han" "PANGO_SCRIPT_HAN")
    '("hangul" "PANGO_SCRIPT_HANGUL")
    '("hebrew" "PANGO_SCRIPT_HEBREW")
    '("hiragana" "PANGO_SCRIPT_HIRAGANA")
    '("kannada" "PANGO_SCRIPT_KANNADA")
    '("katakana" "PANGO_SCRIPT_KATAKANA")
    '("khmer" "PANGO_SCRIPT_KHMER")
    '("lao" "PANGO_SCRIPT_LAO")
    '("latin" "PANGO_SCRIPT_LATIN")
    '("malayalam" "PANGO_SCRIPT_MALAYALAM")
    '("mongolian" "PANGO_SCRIPT_MONGOLIAN")
    '("myanmar" "PANGO_SCRIPT_MYANMAR")
    '("ogham" "PANGO_SCRIPT_OGHAM")
    '("old-italic" "PANGO_SCRIPT_OLD_ITALIC")
    '("oriya" "PANGO_SCRIPT_ORIYA")
    '("runic" "PANGO_SCRIPT_RUNIC")
    '("sinhala" "PANGO_SCRIPT_SINHALA")
    '("syriac" "PANGO_SCRIPT_SYRIAC")
    '("tamil" "PANGO_SCRIPT_TAMIL")
    '("telugu" "PANGO_SCRIPT_TELUGU")
    '("thaana" "PANGO_SCRIPT_THAANA")
    '("thai" "PANGO_SCRIPT_THAI")
    '("tibetan" "PANGO_SCRIPT_TIBETAN")
    '("canadian-aboriginal" "PANGO_SCRIPT_CANADIAN_ABORIGINAL")
    '("yi" "PANGO_SCRIPT_YI")
    '("tagalog" "PANGO_SCRIPT_TAGALOG")
    '("hanunoo" "PANGO_SCRIPT_HANUNOO")
    '("buhid" "PANGO_SCRIPT_BUHID")
    '("tagbanwa" "PANGO_SCRIPT_TAGBANWA")
    '("braille" "PANGO_SCRIPT_BRAILLE")
    '("cypriot" "PANGO_SCRIPT_CYPRIOT")
    '("limbu" "PANGO_SCRIPT_LIMBU")
    '("osmanya" "PANGO_SCRIPT_OSMANYA")
    '("shavian" "PANGO_SCRIPT_SHAVIAN")
    '("linear-b" "PANGO_SCRIPT_LINEAR_B")
    '("tai-le" "PANGO_SCRIPT_TAI_LE")
    '("ugaritic" "PANGO_SCRIPT_UGARITIC")
    '("new-tai-lue" "PANGO_SCRIPT_NEW_TAI_LUE")
    '("buginese" "PANGO_SCRIPT_BUGINESE")
    '("glagolitic" "PANGO_SCRIPT_GLAGOLITIC")
    '("tifinagh" "PANGO_SCRIPT_TIFINAGH")
    '("syloti-nagri" "PANGO_SCRIPT_SYLOTI_NAGRI")
    '("old-persian" "PANGO_SCRIPT_OLD_PERSIAN")
    '("kharoshthi" "PANGO_SCRIPT_KHAROSHTHI")
  )
)

(define-enum Stretch
  (in-module "Pango")
  (c-name "PangoStretch")
  (gtype-id "PANGO_TYPE_STRETCH")
  (values
    '("ultra-condensed" "PANGO_STRETCH_ULTRA_CONDENSED")
    '("extra-condensed" "PANGO_STRETCH_EXTRA_CONDENSED")
    '("condensed" "PANGO_STRETCH_CONDENSED")
    '("semi-condensed" "PANGO_STRETCH_SEMI_CONDENSED")
    '("normal" "PANGO_STRETCH_NORMAL")
    '("semi-expanded" "PANGO_STRETCH_SEMI_EXPANDED")
    '("expanded" "PANGO_STRETCH_EXPANDED")
    '("extra-expanded" "PANGO_STRETCH_EXTRA_EXPANDED")
    '("ultra-expanded" "PANGO_STRETCH_ULTRA_EXPANDED")
  )
)

(define-enum Style
  (in-module "Pango")
  (c-name "PangoStyle")
  (gtype-id "PANGO_TYPE_STYLE")
  (values
    '("normal" "PANGO_STYLE_NORMAL")
    '("oblique" "PANGO_STYLE_OBLIQUE")
    '("italic" "PANGO_STYLE_ITALIC")
  )
)

(define-enum TabAlign
  (in-module "Pango")
  (c-name "PangoTabAlign")
  (gtype-id "PANGO_TYPE_TAB_ALIGN")
  (values
    '("left" "PANGO_TAB_LEFT")
  )
)

(define-enum Underline
  (in-module "Pango")
  (c-name "PangoUnderline")
  (gtype-id "PANGO_TYPE_UNDERLINE")
  (values
    '("none" "PANGO_UNDERLINE_NONE")
    '("single" "PANGO_UNDERLINE_SINGLE")
    '("double" "PANGO_UNDERLINE_DOUBLE")
    '("low" "PANGO_UNDERLINE_LOW")
    '("error" "PANGO_UNDERLINE_ERROR")
  )
)

(define-enum Variant
  (in-module "Pango")
  (c-name "PangoVariant")
  (gtype-id "PANGO_TYPE_VARIANT")
  (values
    '("normal" "PANGO_VARIANT_NORMAL")
    '("small-caps" "PANGO_VARIANT_SMALL_CAPS")
  )
)

(define-enum Weight
  (in-module "Pango")
  (c-name "PangoWeight")
  (gtype-id "PANGO_TYPE_WEIGHT")
  (values
    '("ultralight" "PANGO_WEIGHT_ULTRALIGHT")
    '("light" "PANGO_WEIGHT_LIGHT")
    '("normal" "PANGO_WEIGHT_NORMAL")
    '("semibold" "PANGO_WEIGHT_SEMIBOLD")
    '("bold" "PANGO_WEIGHT_BOLD")
    '("ultrabold" "PANGO_WEIGHT_ULTRABOLD")
    '("heavy" "PANGO_WEIGHT_HEAVY")
  )
)

(define-enum WrapMode
  (in-module "Pango")
  (c-name "PangoWrapMode")
  (gtype-id "PANGO_TYPE_WRAP_MODE")
  (values
    '("word" "PANGO_WRAP_WORD")
    '("char" "PANGO_WRAP_CHAR")
    '("word-char" "PANGO_WRAP_WORD_CHAR")
  )
)

(define-flags FontMask
  (in-module "Pango")
  (c-name "PangoFontMask")
  (gtype-id "PANGO_TYPE_FONT_MASK")
  (values
    '("family" "PANGO_FONT_MASK_FAMILY")
    '("style" "PANGO_FONT_MASK_STYLE")
    '("variant" "PANGO_FONT_MASK_VARIANT")
    '("weight" "PANGO_FONT_MASK_WEIGHT")
    '("stretch" "PANGO_FONT_MASK_STRETCH")
    '("size" "PANGO_FONT_MASK_SIZE")
  )
)

