1 2# Enums: 3_CONV_ENUM(Pango,AttrType) 4_CONV_ENUM(Pango,Underline) 5_CONV_ENUM(Pango,Direction) 6_CONV_ENUM(Pango,CoverageLevel) 7_CONV_ENUM(Pango,Style) 8_CONV_ENUM(Pango,Variant) 9_CONV_ENUM(Pango,Stretch) 10_CONV_ENUM(Pango,Weight) 11_CONV_ENUM(Pango,FontMask) 12_CONV_ENUM(Pango,Alignment) 13_CONV_ENUM(Pango,WrapMode) 14_CONV_ENUM(Pango,TabAlign) 15_CONV_ENUM(Pango,Script) 16_CONV_ENUM(Pango,EllipsizeMode) 17_CONV_ENUM(Pango,RenderPart) 18_CONV_ENUM(Pango,Gravity) 19_CONV_ENUM(Pango,GravityHint) 20 21# General conversions: 22_CONVERSION(`gchar*',`const char*',`($3)') 23_CONVERSION(`guchar*&',`guchar**',`&($3)') 24_CONVERSION(`int*&',`int**',`&($3)') 25 26 27# Wrapper type conversions: 28_CONVERSION(`PangoLanguage*',`Language',`Language($3)') 29_CONVERSION(`PangoLanguage*',`Pango::Language',`Pango::Language($3)') 30_CONVERSION(`const Language&',`const PangoLanguage*',`($3).gobj()') 31_CONVERSION(`const Language&',`PangoLanguage*',`const_cast<PangoLanguage*>(`($3).gobj()')') 32 33_CONVERSION(`Rectangle&',`PangoRectangle*',`($3).gobj()') 34_CONVERSION(`Rectangle',`PangoRectangle',`*($3).gobj()') 35_CONVERSION(`PangoRectangle',`Rectangle',`Rectangle(&($3))') 36 37_CONVERSION(`Color&',`PangoColor*',`($3).gobj()') 38_CONVERSION(`const Color&',`const PangoColor*',`($3).gobj()') 39_CONVERSION(`Color',`PangoColor',`*($3).gobj()') 40_CONVERSION(`PangoColor',`Color',`Color(&($3))') 41 42_CONVERSION(`PangoFontDescription*',`FontDescription',`FontDescription(($3))') 43_CONVERSION(`const PangoFontDescription*',`FontDescription',`FontDescription(const_cast<PangoFontDescription*>($3))') 44_CONVERSION(`Pango::FontDescription&',`PangoFontDescription*',`($3).gobj()') 45_CONVERSION(`FontDescription&',`PangoFontDescription*',`($3).gobj()') 46_CONVERSION(`const FontDescription&',`const PangoFontDescription*',`($3).gobj()') 47_CONVERSION(`const Pango::FontDescription&',`const PangoFontDescription*',`($3).gobj()') 48_CONVERSION(`const Pango::FontDescription&',`PangoFontDescription*',`const_cast<PangoFontDescription*>(`($3).gobj()')') 49_CONVERSION(`const FontDescription&',`PangoFontDescription*',`const_cast<PangoFontDescription*>(`($3).gobj()')') 50 51_CONVERSION(`PangoFontMetrics*',`FontMetrics',`FontMetrics(($3))') 52 53_CONVERSION(`PangoAttribute*',`Attribute',`Attribute(($3))') 54_CONVERSION(`Attribute&',`PangoAttribute*',`($3).gobj()') 55_CONVERSION(`const Attribute&',`const PangoAttribute*',`($3).gobj()') 56 57_CONVERSION(`PangoAttrList*',`AttrList',`AttrList(($3))') 58_CONVERSION(`PangoAttrList*',`Pango::AttrList',`Pango::AttrList(($3))') 59_CONVERSION(`AttrList&',`PangoAttrList*',`($3).gobj()') 60_CONVERSION(`Pango::AttrList&',`PangoAttrList*',`($3).gobj()') 61 62_CONVERSION(`PangoAttrIterator*',`AttrIter',`Glib::wrap(($3))') 63 64_CONVERSION(`PangoAnalysis',`Analysis',`Analysis(&($3))') 65_CONVERSION(`PangoAnalysis',`const Analysis',`Analysis(&($3))') 66_CONVERSION(`Analysis&',`PangoAnalysis*',`($3).gobj()') 67_CONVERSION(`const Analysis&',`const PangoAnalysis*',`($3).gobj()') 68_CONVERSION(`const Analysis&',`PangoAnalysis*',`const_cast<PangoAnalysis*>(($3).gobj())') 69 70_CONVERSION(`PangoItem*',`Item',`Item(($3))') 71_CONVERSION(`PangoItem*',`const Item',`Item(($3))') 72_CONVERSION(`Item&',`PangoItem*',`($3).gobj()') 73_CONVERSION(`const Item&',`const PangoItem*',`($3).gobj()') 74 75_EQUAL(`PangoGlyph',`Glyph') 76_EQUAL(`PangoGlyphUnit',`GlyphUnit') 77_EQUAL(`PangoGlyphVisAttr',`GlyphVisAttr') 78#_CONVERSION(`PangoGlyphVisAttr',`GlyphVisAttr',`GlyphVisAttr(&($3))') 79#_CONVERSION(`GlyphVisAttr',`PangoGlyphVisAttr',`*($3).gobj()') 80_CONVERSION(`PangoGlyphGeometry',`GlyphGeometry',`GlyphGeometry(&($3))') 81_CONVERSION(`GlyphGeometry',`PangoGlyphGeometry',`*($3).gobj()') 82 83_CONVERSION(`PangoGlyphString*',`GlyphString',`GlyphString(($3))') 84_CONVERSION(`PangoGlyphString*',`const GlyphString',`GlyphString(($3))') 85_CONVERSION(`const Pango::GlyphString&',`PangoGlyphString*',const_cast<PangoGlyphString*>($3.gobj())) 86_CONVERSION(`const GlyphString&',`PangoGlyphString*',const_cast<PangoGlyphString*>($3.gobj())) 87 88_CONVERSION(`PangoGlyphItem*',`GlyphItem',`GlyphItem(($3))') 89_CONVERSION(`const GlyphItem&',`PangoGlyphItem*',const_cast<PangoGlyphItem*>($3.gobj())) 90 91_CONVERSION(`PangoFont*',`Glib::RefPtr<Font>',Glib::wrap($3)) 92_CONVERSION(`PangoFont*',`Glib::RefPtr<Pango::Font>',Glib::wrap($3)) 93_CONVERSION(`PangoFont*',`Glib::RefPtr<const Font>',Glib::wrap($3)) 94_CONVERSION(`PangoFont*',`Glib::RefPtr<const Pango::Font>',Glib::wrap($3)) 95_CONVERSION(`const Glib::RefPtr<Font>&',`PangoFont*',__CONVERT_REFPTR_TO_P) 96_CONVERSION(`const Glib::RefPtr<Pango::Font>&',`PangoFont*',__CONVERT_REFPTR_TO_P) 97# Special treatment for the Sun Forte compiler 98#_CONVERSION(const Glib::RefPtr<const Font>&,`PangoFont*',__CONVERT_CONST_REFPTR_TO_P) 99_CONVERSION(`const Glib::RefPtr<const Font>&',`PangoFont*',__CONVERT_CONST_REFPTR_TO_P_SUN(Font)) 100#_CONVERSION(`const Glib::RefPtr<const Font>&',`PangoFont*',__CONVERT_CONST_REFPTR_TO_P) 101_CONVERSION(`const Glib::RefPtr<const Pango::Font>&',`PangoFont*',__CONVERT_CONST_REFPTR_TO_P_SUN(Pango::Font)) 102 103_CONVERSION(`PangoFontFace*',`Glib::RefPtr<Pango::FontFace>',Glib::wrap($3)) 104_CONVERSION(`PangoFontFace*',`Glib::RefPtr<const Pango::FontFace>',Glib::wrap($3)) 105_CONVERSION(`PangoFontFamily*',`Glib::RefPtr<Pango::FontFamily>',Glib::wrap($3)) 106_CONVERSION(`PangoFontFamily*',`Glib::RefPtr<const Pango::FontFamily>',Glib::wrap($3)) 107 108_CONVERSION(`PangoFontMap*',`Glib::RefPtr<FontMap>',Glib::wrap($3)) 109_CONVERSION(`PangoFontMap*',`Glib::RefPtr<const FontMap>',Glib::wrap($3)) 110_CONVERSION(`const Glib::RefPtr<FontMap>&',`PangoFontMap*',__CONVERT_REFPTR_TO_P) 111 112_CONVERSION(`PangoCairoFontMap*',`Glib::RefPtr<CairoFontMap>',Glib::wrap($3)) 113 114_CONVERSION(`PangoFontSet*',`Glib::RefPtr<FontSet>',Glib::wrap($3)) 115_CONVERSION(`const Glib::RefPtr<FontSet>&',`PangoFontSet*',__CONVERT_REFPTR_TO_P) 116 117_CONVERSION(`PangoContext*',`Glib::RefPtr<Pango::Context>',Glib::wrap($3)) 118_CONVERSION(`PangoContext*',`Glib::RefPtr<Context>',Glib::wrap($3)) 119_CONVERSION(`const Glib::RefPtr<Context>&',`PangoContext*',__CONVERT_REFPTR_TO_P) 120 121_CONVERSION(`PangoLayout*',`Glib::RefPtr<Pango::Layout>',Glib::wrap($3)) 122_CONVERSION(`PangoLayout*',`Glib::RefPtr<const Pango::Layout>',Glib::wrap($3)) 123_CONVERSION(`PangoLayout*',`Glib::RefPtr<Layout>',Glib::wrap($3)) 124_CONVERSION(`PangoLayout*',`const Glib::RefPtr<Pango::Layout>&',Glib::wrap($3)) 125_CONVERSION(`const Glib::RefPtr<Layout>&',`PangoLayout*',__CONVERT_REFPTR_TO_P) 126_CONVERSION(`const Glib::RefPtr<Pango::Layout>&',`PangoLayout*',__CONVERT_REFPTR_TO_P) 127# Special treatment for the Sun Forte compiler 128_CONVERSION(`const Glib::RefPtr<const Pango::Layout>&',`PangoLayout*',__CONVERT_CONST_REFPTR_TO_P_SUN(Pango::Layout)) 129_CONVERSION(`const Glib::RefPtr<const Layout>&',`PangoLayout*',__CONVERT_CONST_REFPTR_TO_P_SUN(Layout)) 130 131_CONVERSION(`PangoLayoutLine*',`Glib::RefPtr<Pango::LayoutLine>',`Glib::wrap($3)') 132_CONVERSION(`PangoLayoutLine*',`Glib::RefPtr<LayoutLine>',`Glib::wrap($3)') 133_CONVERSION(`PangoLayoutLine*',`Glib::RefPtr<const LayoutLine>',`Glib::wrap($3)') 134_CONVERSION(`const Glib::RefPtr<Pango::LayoutLine>&',`PangoLayoutLine*',__CONVERT_REFPTR_TO_P) 135_CONVERSION(`const Glib::RefPtr<LayoutLine>&',`PangoLayoutLine*',__CONVERT_REFPTR_TO_P) 136# Special treatment for the Sun Forte compiler 137_CONVERSION(`const Glib::RefPtr<const Pango::LayoutLine>&',`PangoLayoutLine*',__CONVERT_CONST_REFPTR_TO_P_SUN(Pango::LayoutLine)) 138_CONVERSION(`const Glib::RefPtr<const LayoutLine>&',`PangoLayoutLine*',__CONVERT_CONST_REFPTR_TO_P_SUN(LayoutLine)) 139 140_CONVERSION(`PangoLayoutRun*',`LayoutRun',Glib::wrap($3)) 141 142_CONVERSION(`PangoLayoutIter*',`LayoutIter',`LayoutIter($3)') 143 144_CONVERSION(`PangoCoverage*',`Glib::RefPtr<Coverage>',`Glib::wrap($3)') 145_CONVERSION(`const Glib::RefPtr<Coverage>&',`PangoCoverage*',`Glib::unwrap($3)') 146 147_CONVERSION(`PangoTabArray*',`Pango::TabArray',`Pango::TabArray(($3))') 148_CONVERSION(`PangoTabArray*',`TabArray',`TabArray(($3))') 149_CONVERSION(`Pango::TabArray&',`PangoTabArray*',($3).gobj()) 150_CONVERSION(`TabArray&',`PangoTabArray*',($3).gobj()) 151 152_CONVERSION(`PangoTabAlign&',`PangoTabAlign*',`&$3',`*$3') 153_CONVERSION(`Pango::TabAlign&',`PangoTabAlign*',`((PangoTabAlign*) &($3))') 154_CONVERSION(`TabAlign&',`PangoTabAlign*',`((PangoTabAlign*) &($3))') 155 156_CONVERSION(`const Matrix&',`const PangoMatrix*',`&($3)') 157 158#The documentation for pango_context_get_matrix() suggests that it's generally OK 159#to consider PANGO_MATRIX_INIT and a NULL PangoMatrix* as being equivalent: 160#But this would cause 2 function calls. 161#_CONVERSION(`const PangoMatrix*',`Matrix',`($3) ? *($3) : PANGO_MATRIX_INIT') 162#_CONVERSION(`const Matrix&',`PangoMatrix*',`const_cast<PangoMatrix*>(&($3))') 163 164define(`__FL2H_SHALLOW',`$`'2($`'3, Glib::OWNERSHIP_SHALLOW)') 165_CONVERSION(`GSList*',`SListHandle_LayoutLine',__FL2H_SHALLOW) 166_CONVERSION(`GSList*',`SListHandle_ConstLayoutLine',__FL2H_SHALLOW) 167 168_CONVERSION(`PangoFontMap*',`Glib::RefPtr<Pango::FontMap>',`Glib::wrap($3)') 169 170_CONVERSION(`const Cairo::FontOptions&',`const cairo_font_options_t*',`($3).cobj()') 171 172_CONVERSION(`const LogAttr&',`PangoLogAttr*',&(const_cast<LogAttr&>($3))) 173 174 175