Changeset 508

Show
Ignore:
Timestamp:
06/28/08 09:56:15 (2 months ago)
Author:
Mike Wey
Message:

Wrapped pangocairo - see ticket #35

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/src/build/gtkD.d

    r498 r508  
    143143private import pango.PgScriptIter; 
    144144private import pango.PgVertical; 
     145private import pango.PgCairoFontMap; 
     146private import pango.PgCairo; 
    145147private import pango.PgRenderer; 
    146148private import pango.PgCoverage; 
  • trunk/src/gtkc/pango.d

    r466 r508  
    3535 
    3636private import gtkc.pangotypes; 
     37private import gtkc.cairotypes; 
    3738private import gtkc.Loader; 
    3839private import gtkc.paths; 
     
    4243static this() 
    4344{ 
    44  pango_Linker = new Linker(libPath ~ importLibs[LIBRARY.PANGO] ); 
     45 pango_Linker = new Linker(libPath ~ importLibs[LIBRARY.PANGO], libPath ~ importLibs[LIBRARY.PANGOCAIRO] ); 
    4546 pango_Linker.link(pangoLinks); 
    4647 
     
    420421    PangoGravity function(PangoScript script, PangoGravity baseGravity, PangoGravityHint hint)pango_gravity_get_for_script; 
    421422    double function(PangoGravity gravity)pango_gravity_to_rotation; 
     423     
     424    // pango.PgCairoFontMap 
     425     
     426    PangoFontMap* function()pango_cairo_font_map_get_default; 
     427    PangoFontMap* function()pango_cairo_font_map_new; 
     428    PangoFontMap* function(cairo_font_type_t fonttype)pango_cairo_font_map_new_for_font_type; 
     429    cairo_font_type_t function(PangoCairoFontMap* fontmap)pango_cairo_font_map_get_font_type; 
     430    void function(PangoCairoFontMap* fontmap, double dpi)pango_cairo_font_map_set_resolution; 
     431    double function(PangoCairoFontMap* fontmap)pango_cairo_font_map_get_resolution; 
     432    PangoContext* function(PangoCairoFontMap* fontmap)pango_cairo_font_map_create_context; 
     433     
     434    // pango.PgCairo 
     435     
     436    cairo_scaled_font_t* function(PangoCairoFont* font)pango_cairo_font_get_scaled_font; 
     437    void function(PangoContext* context, double dpi)pango_cairo_context_set_resolution; 
     438    double function(PangoContext* context)pango_cairo_context_get_resolution; 
     439    void function(PangoContext* context, cairo_font_options_t* options)pango_cairo_context_set_font_options; 
     440    cairo_font_options_t* function(PangoContext* context)pango_cairo_context_get_font_options; 
     441    void function(PangoContext* context, PangoCairoShapeRendererFunc func, gpointer data, GDestroyNotify dnotify)pango_cairo_context_set_shape_renderer; 
     442    PangoCairoShapeRendererFunc function(PangoContext* context, gpointer* data)pango_cairo_context_get_shape_renderer; 
     443    void function(cairo_t* cr, PangoContext* context)pango_cairo_update_context; 
     444    PangoLayout* function(cairo_t* cr)pango_cairo_create_layout; 
     445    void function(cairo_t* cr, PangoLayout* layout)pango_cairo_update_layout; 
     446    void function(cairo_t* cr, PangoFont* font, PangoGlyphString* glyphs)pango_cairo_show_glyph_string; 
     447    void function(cairo_t* cr, PangoLayoutLine* line)pango_cairo_show_layout_line; 
     448    void function(cairo_t* cr, PangoLayout* layout)pango_cairo_show_layout; 
     449    void function(cairo_t* cr, double x, double y, double width, double height)pango_cairo_show_error_underline; 
     450    void function(cairo_t* cr, PangoFont* font, PangoGlyphString* glyphs)pango_cairo_glyph_string_path; 
     451    void function(cairo_t* cr, PangoLayoutLine* line)pango_cairo_layout_line_path; 
     452    void function(cairo_t* cr, PangoLayout* layout)pango_cairo_layout_path; 
     453    void function(cairo_t* cr, double x, double y, double width, double height)pango_cairo_error_underline_path; 
    422454     
    423455    // pango.PgRenderer 
     
    782814    { "pango_gravity_get_for_script",  cast(void**)& pango_gravity_get_for_script}, 
    783815    { "pango_gravity_to_rotation",  cast(void**)& pango_gravity_to_rotation}, 
     816    { "pango_cairo_font_map_get_default",  cast(void**)& pango_cairo_font_map_get_default}, 
     817    { "pango_cairo_font_map_new",  cast(void**)& pango_cairo_font_map_new}, 
     818    { "pango_cairo_font_map_new_for_font_type",  cast(void**)& pango_cairo_font_map_new_for_font_type}, 
     819    { "pango_cairo_font_map_get_font_type",  cast(void**)& pango_cairo_font_map_get_font_type}, 
     820    { "pango_cairo_font_map_set_resolution",  cast(void**)& pango_cairo_font_map_set_resolution}, 
     821    { "pango_cairo_font_map_get_resolution",  cast(void**)& pango_cairo_font_map_get_resolution}, 
     822    { "pango_cairo_font_map_create_context",  cast(void**)& pango_cairo_font_map_create_context}, 
     823    { "pango_cairo_font_get_scaled_font",  cast(void**)& pango_cairo_font_get_scaled_font}, 
     824    { "pango_cairo_context_set_resolution",  cast(void**)& pango_cairo_context_set_resolution}, 
     825    { "pango_cairo_context_get_resolution",  cast(void**)& pango_cairo_context_get_resolution}, 
     826    { "pango_cairo_context_set_font_options",  cast(void**)& pango_cairo_context_set_font_options}, 
     827    { "pango_cairo_context_get_font_options",  cast(void**)& pango_cairo_context_get_font_options}, 
     828    { "pango_cairo_context_set_shape_renderer",  cast(void**)& pango_cairo_context_set_shape_renderer}, 
     829    { "pango_cairo_context_get_shape_renderer",  cast(void**)& pango_cairo_context_get_shape_renderer}, 
     830    { "pango_cairo_update_context",  cast(void**)& pango_cairo_update_context}, 
     831    { "pango_cairo_create_layout",  cast(void**)& pango_cairo_create_layout}, 
     832    { "pango_cairo_update_layout",  cast(void**)& pango_cairo_update_layout}, 
     833    { "pango_cairo_show_glyph_string",  cast(void**)& pango_cairo_show_glyph_string}, 
     834    { "pango_cairo_show_layout_line",  cast(void**)& pango_cairo_show_layout_line}, 
     835    { "pango_cairo_show_layout",  cast(void**)& pango_cairo_show_layout}, 
     836    { "pango_cairo_show_error_underline",  cast(void**)& pango_cairo_show_error_underline}, 
     837    { "pango_cairo_glyph_string_path",  cast(void**)& pango_cairo_glyph_string_path}, 
     838    { "pango_cairo_layout_line_path",  cast(void**)& pango_cairo_layout_line_path}, 
     839    { "pango_cairo_layout_path",  cast(void**)& pango_cairo_layout_path}, 
     840    { "pango_cairo_error_underline_path",  cast(void**)& pango_cairo_error_underline_path}, 
    784841    { "pango_renderer_draw_layout",  cast(void**)& pango_renderer_draw_layout}, 
    785842    { "pango_renderer_draw_layout_line",  cast(void**)& pango_renderer_draw_layout_line}, 
  • trunk/src/gtkc/pangotypes.d

    r466 r508  
    2424 
    2525 
     26public import gtkc.cairotypes; 
    2627public import gtkc.glibtypes; 
    2728public import gtkc.gobjecttypes; 
     
    12101211 
    12111212/** 
     1213 * PangoCairoFont is an interface exported by fonts for 
     1214 * use with Cairo. The actual type of the font will depend 
     1215 * on the particular font technology Cairo was compiled to use. 
     1216 * Since 1.18 
     1217 */ 
     1218public struct PangoCairoFont{} 
     1219 
     1220 
     1221/** 
     1222 * PangoCairoFontMap is an interface exported by font maps for 
     1223 * use with Cairo. The actual type of the font map will depend 
     1224 * on the particular font technology Cairo was compiled to use. 
     1225 * Since 1.10 
     1226 */ 
     1227public struct PangoCairoFontMap{} 
     1228 
     1229 
     1230/** 
    12121231 * Main Gtk struct. 
    12131232 * PangoRenderer is a base class for objects that are used to 
     
    16711690// gboolean (*PangoAttrFilterFunc) (PangoAttribute *attribute,  gpointer data); 
    16721691public typedef extern(C) int  function (PangoAttribute*, void*) PangoAttrFilterFunc; 
     1692 
     1693/* 
     1694 * Function type for rendering attributes of type PANGO_ATTR_SHAPE 
     1695 * with Pango's Cairo renderer. 
     1696 * cr : 
     1697 * a Cairo context with current point set to where the shape should 
     1698 *  be rendered 
     1699 * attr : 
     1700 * the PANGO_ATTR_SHAPE to render 
     1701 * do_path : 
     1702 * whether only the shape path should be appended to current 
     1703 *  path of cr and no filling/stroking done. This will be set 
     1704 *   to TRUE when called from pango_cairo_layout_path() and 
     1705 *   pango_cairo_layout_line_path() rendering functions. 
     1706 * data : 
     1707 * user data passed to pango_cairo_context_set_shape_renderer() 
     1708 */ 
     1709// void (*PangoCairoShapeRendererFunc) (cairo_t *cr,  PangoAttrShape *attr,  gboolean do_path,  gpointer data); 
     1710public typedef extern(C) void  function (cairo_t*, PangoAttrShape*, int, void*) PangoCairoShapeRendererFunc; 
  • trunk/src/gtkc/paths.d

    r492 r508  
    3232    GTK, 
    3333    PANGO, 
     34    PANGOCAIRO, 
    3435    GLGDK, 
    3536    GLGTK, 
     
    5859    LIBRARY.GTK:        "libgtk-win32-2.0-0.dll", 
    5960    LIBRARY.PANGO:      "libpango-1.0-0.dll", 
     61    LIBRARY.PANGOCAIRO: "libpangocairo-1.0-0.dll", 
    6062    LIBRARY.GLGDK:      "libgdkglext-win32-1.0-0.dll", 
    6163    LIBRARY.GLGTK:      "libgtkglext-win32-1.0-0.dll", 
     
    8486    LIBRARY.GTK:        "libgtk-x11-2.0.so", 
    8587    LIBRARY.PANGO:      "libpango-1.0.so", 
     88    LIBRARY.PANGOCAIRO: "libpangocairo-1.0.so", 
    8689    LIBRARY.GLGDK:      "libgdkglext-x11-1.0.so", 
    8790    LIBRARY.GLGTK:      "libgtkglext-x11-1.0.so", 
  • trunk/wrap/APILookupPango.txt

    r494 r508  
    3030addTypedefs: start 
    3131 
     32public import gtkc.cairotypes; 
    3233public import gtkc.glibtypes; 
    3334public import gtkc.gobjecttypes; 
     
    485486#outFile: PgXft 
    486487 
    487 #file: pango-Cairo-Rendering.html 
    488 #struct: PangoCairoFontMap 
    489 #class: PgCairoFontMap 
    490 #prefix: pango_cairo_font_map_ 
    491 #strictPrefix: Yes 
    492 #outFile: PgCairoFontMap 
    493  
    494 #class: PgCairo 
    495 #prefix: pango_cairo_ 
    496 #noprefix: pango_cairo_font_map_ 
    497 #outFile: PgCairo 
     488file: pango-Cairo-Rendering.html 
     489struct: PangoCairoFontMap 
     490ctorStruct: PangoFontMap 
     491extend: PangoFontMap 
     492class: PgCairoFontMap 
     493prefix: pango_cairo_font_map_ 
     494strictPrefix: Yes 
     495import: glib.Str 
     496import: pango.PgFontMap 
     497import: pango.PgContext 
     498structWrap: PangoFontMap* PgFontMap 
     499structWrap: PangoContext* PgContext 
     500outFile: PgCairoFontMap 
     501 
     502class: PgCairo 
     503prefix: pango_cairo_ 
     504noprefix: pango_cairo_font_map_ 
     505import: cairo.Context 
     506import: cairo.ScaledFont 
     507import: cairo.FontOption 
     508import: pango.PgContext 
     509import: pango.PgFont 
     510import: pango.PgGlyphString 
     511import: pango.PgLayout 
     512import: pango.PgLayoutLine 
     513structWrap: cairo_t* Context 
     514structWrap: cairo_scaled_font_t* ScaledFont 
     515structWrap: cairo_font_options_t* FontOption 
     516structWrap: PangoContext* PgContext 
     517structWrap: PangoFont* PgFont 
     518structWrap: PangoGlyphString* PgGlyphString 
     519structWrap: PangoLayout* PgLayout 
     520structWrap: PangoLayoutLine* PgLayoutLine 
     521outFile: PgCairo 
    498522 
    499523#file: pango-ATSUI-Fonts.html 
  • trunk/wrap/paths.d

    r492 r508  
    3232    GTK, 
    3333    PANGO, 
     34    PANGOCAIRO, 
    3435    GLGDK, 
    3536    GLGTK, 
     
    5859    LIBRARY.GTK:        "libgtk-win32-2.0-0.dll", 
    5960    LIBRARY.PANGO:      "libpango-1.0-0.dll", 
     61    LIBRARY.PANGOCAIRO: "libpangocairo-1.0-0.dll", 
    6062    LIBRARY.GLGDK:      "libgdkglext-win32-1.0-0.dll", 
    6163    LIBRARY.GLGTK:      "libgtkglext-win32-1.0-0.dll", 
     
    8486    LIBRARY.GTK:        "libgtk-x11-2.0.so", 
    8587    LIBRARY.PANGO:      "libpango-1.0.so", 
     88    LIBRARY.PANGOCAIRO: "libpangocairo-1.0.so", 
    8689    LIBRARY.GLGDK:      "libgdkglext-x11-1.0.so", 
    8790    LIBRARY.GLGTK:      "libgtkglext-x11-1.0.so", 
  • trunk/wrap/utils/GtkDClass.d

    r506 r508  
    27632763            converted = gToken.dup; 
    27642764        } 
     2765        else if ( endsWith(gToken, "_t*") && startsWith(gToken,"cairo_") ) 
     2766        { 
     2767            converted = gToken.dup; 
     2768        } 
    27652769        else if ( startsWith(gToken,"f_") && (endsWith(gToken,"_out") || endsWith(gToken,"_in") || endsWith(gToken,"_inout") ) ) 
    27662770        { 
  • trunk/wrap/utils/GtkWrapper.d

    r478 r508  
    820820            externalText ~= "\nprivate import "~bindingsDir~".gthreadtypes;"; 
    821821        } 
    822         if ( loaderTableName == "gdk"
     822        if ( loaderTableName == "gdk" || loaderTableName == "pango"
    823823        { 
    824824            externalText ~= "\nprivate import "~bindingsDir~".cairotypes;"; 
     
    843843                         ~std.string.toupper(loaderTableName.dup)~"], libPath ~ importLibs[LIBRARY.GDKPIXBUF] );"; 
    844844            } 
    845             else 
     845            else if ( loaderTableName == "pango" ) 
     846            { 
     847                externalText ~= "\n "~loaderTableName~"_Linker = new Linker(libPath ~ importLibs[LIBRARY." 
     848                         ~std.string.toupper(loaderTableName.dup)~"], libPath ~ importLibs[LIBRARY.PANGOCAIRO] );"; 
     849            } 
     850            else 
    846851            { 
    847852                externalText ~= "\n "~loaderTableName~"_Linker = new Linker(libPath ~ importLibs[LIBRARY."