package provide Freetype::ftoutln 0.1

if {![info exists _source([file tail [info script]])]} {
package require Freetype::ft2build
package require $FT_FREETYPE

::ffidl::callout _FT_Outline_Decompose {pointer pointer pointer} int \
    [::ffidl::symbol $::ft::lib FT_Outline_Decompose]
proc FT_Outline_Decompose {outline func_interface user} {
    set result [_FT_Outline_Decompose [$outline getPointer] [$func_interface getPointer] $user]
    return $result
}

::ffidl::callout _FT_Outline_New {pointer FT_UInt FT_Int pointer} int \
    [::ffidl::symbol $::ft::lib FT_Outline_New]
proc FT_Outline_New {library numPoints numContours outlineVarName} {
    upvar $outlineVarName outline
    if {[info exists outline]} {
        set p [$outline getPointer]
    } else {
        set temp [FT_Outline new]
        set p [$temp getPointer]
    }
    set result [_FT_Outline_New [$library getPointer] $numPoints $numContours $p]
    if {$result == 0} {
        if {[info exists temp]} {
            set outline $temp
        }
    } else {
        if {[info exists temp]} {
            $temp destroy
        }
    }
    return $result
}

::ffidl::callout _FT_Outline_New_Internal {pointer FT_UInt FT_Int pointer} int \
    [::ffidl::symbol $::ft::lib FT_Outline_New_Internal]
proc FT_Outline_New_Internal {memory numPoints numContours outlineVarName} {
    upvar $outlineVarName outline
    if {[info exists outline]} {
        set p [$outline getPointer]
    } else {
        set temp [FT_Outline new]
        set p [$temp getPointer]
    }
    set result [_FT_Outline_New_Internal [$memory getPointer] $numPoints $numContours p]
    if {$result == 0} {
        if {[info exists temp]} {
            set outline $temp
        }
    } else {
        if {[info exists temp]} {
            $temp destroy
        }
    }
    return $result
}

::ffidl::callout _FT_Outline_Done {pointer pointer} int \
    [::ffidl::symbol $::ft::lib FT_Outline_Done]
proc FT_Outline_Done {library outline} {
    set result [_FT_Outline_Done [$library getPointer] [$outline getPointer]]
    return $result
}

::ffidl::callout _FT_Outline_Done_Internal {pointer pointer} int \
    [::ffidl::symbol $::ft::lib FT_Outline_Done_Internal]
proc FT_Outline_Done_Internal {library outline} {
    set result [_FT_Outline_Done_Internal [$library getPointer] [$outline getPointer]]
    return $result
}

::ffidl::callout _FT_Outline_Check {pointer} int \
    [::ffidl::symbol $::ft::lib FT_Outline_Check]
proc FT_Outline_Check {outline} {
    set result [_FT_Outline_Check [$outline getPointer]]
    return $result
}

::ffidl::callout _FT_Outline_Get_CBox {pointer pointer} int \
    [::ffidl::symbol $::ft::lib FT_Outline_Get_CBox]
proc FT_Outline_Get_CBox {outline cboxVarName} {
    upvar $cboxVarName cbox
    if {[info exists cbox]} {
        set p [$cbox getPointer]
    } else {
        set temp [FT_BBox new]
        set p [$temp getPointer]
    }
    _FT_Outline_Get_CBox [$outline getPointer] $p
    if {[info exists temp]} {
        set cbox $temp
    }
    return
}

::ffidl::callout _FT_Outline_Translate {pointer FT_Pos FT_Pos} void \
    [::ffidl::symbol $::ft::lib FT_Outline_Translate]
proc FT_Outline_Translate {outline xOffset yOffset} {
    _FT_Outline_Translate [$outline getPointer] $xOffset $yOffset
    return
}

::ffidl::callout _FT_Outline_Copy {pointer pointer} int \
    [::ffidl::symbol $::ft::lib FT_Outline_Copy]
proc FT_Outline_Copy {outline target} {
    set result [_FT_Outline_Copy [$outline getPointer] [$target getPointer]]
    return $result
}

::ffidl::callout _FT_Outline_Transform {pointer pointer} void \
    [::ffidl::symbol $::ft::lib FT_Outline_Transform]
proc FT_Outline_Transform {outline matrix} {
    _FT_Outline_Transform [$outline getPointer] [$matrix getPointer]
    return
}

::ffidl::callout _FT_Outline_Embolden {pointer FT_Pos} int \
    [::ffidl::symbol $::ft::lib FT_Outline_Embolden]
proc FT_Outline_Embolden {outline strength} {
    set result [_FT_Outline_Embolden [$outline getPointer] $strength]
    return $result
}

::ffidl::callout _FT_Outline_EmboldenXY {pointer FT_Pos FT_Pos} int \
    [::ffidl::symbol $::ft::lib FT_Outline_EmboldenXY]
proc FT_Outline_EmboldenXY {outline xstrength ystrength} {
    set result [_FT_Outline_EmboldenXY [$outline getPointer] $xstrength $ystrength]
    return $result
}

::ffidl::callout _FT_Outline_Reverse {pointer} void \
    [::ffidl::symbol $::ft::lib FT_Outline_Reverse]
proc FT_Outline_Reverse {outline} {
    _FT_Outline_Reverse [$outline getPointer]
    return
}

::ffidl::callout _FT_Outline_Get_Bitmap {pointer pointer pointer} int \
    [::ffidl::symbol $::ft::lib FT_Outline_Get_Bitmap]
proc FT_Outline_Get_Bitmap {library outline bitmap} {
    set result [_FT_Outline_Get_Bitmap [$library getPointer] \
                    [$outline getPointer] [$bitmap getPointer]]
    return $result
}

::ffidl::callout _FT_Outline_Render {pointer pointer pointer} int \
    [::ffidl::symbol $::ft::lib FT_Outline_Render]
proc FT_Outline_Render {library outline params} {
    set result [_FT_Outline_Render [$library getPointer] [$outline getPointer] [$params getPointer]]
    return $result
}


set FT_ORIENTATION_TRUETYPE    0
set FT_ORIENTATION_POSTSCRIPT  1
set FT_ORIENTATION_FILL_RIGHT  $FT_ORIENTATION_TRUETYPE
set FT_ORIENTATION_FILL_LEFT   $FT_ORIENTATION_POSTSCRIPT
set FT_ORIENTATION_NONE        2
ffidl::typedef FT_Orientation int

::ffidl::callout _FT_Outline_Get_Orientation {pointer} FT_Orientation \
    [::ffidl::symbol $::ft::lib FT_Outline_Get_Orientation]
proc FT_Outline_Get_Orientation {outline} {
    set result [_FT_Outline_Get_Orientation [$outline getPointer]]
    return $result
}

set _source([file tail [info script]]) 1
}
