Regenerate, restoring full UpCast functionality.
[girtod.git] / gtk2 / pangocairo.d
blob80c5a5be2f08a25a255b9bc86882660ff84e9321
1 // *** DO NOT EDIT ***
2 // Automatically generated from "/usr/share/gir-1.0/PangoCairo-1.0.gir"
4 module PangoCairo;
5 public import gtk2.glib2;
6 alias gtk2.glib2 GLib2;
7 public import gtk2.gobject2;
8 alias gtk2.gobject2 GObject2;
9 public import gtk2.pango;
10 alias gtk2.pango Pango;
11 public import gtk2.pangoft2;
12 alias gtk2.pangoft2 PangoFT2;
13 public import gtk2.cairo;
14 alias gtk2.cairo cairo;
15 public import gtk2.fontconfig2;
16 alias gtk2.fontconfig2 fontconfig2;
17 public import gtk2.freetype2;
18 alias gtk2.freetype2 freetype2;
20 // package: "cairo";
22 // package: "gobject-2.0";
24 // c:symbol-prefixes: ["pango_cairo"]
25 // c:identifier-prefixes: ["PangoCairo"]
27 // module PangoCairo;
29 struct FcFontMap /* : Pango.FontMap */ {
30 mixin FontMap.__interface__;
31 alias parent_instance this;
32 alias parent_instance super_;
33 alias parent_instance fontmap;
34 Pango.FontMap parent_instance;
35 double dpi;
36 freetype2.Library library;
40 // #PangoCairoFont is an interface exported by fonts for
41 // use with Cairo. The actual type of the font will depend
42 // on the particular font technology Cairo was compiled to use.
43 struct Font /* Interface */ /* Version 1.18 */ {
44 mixin template __interface__() {
45 // VERSION: 1.18
46 // Gets the #cairo_scaled_font_t used by @font.
47 // The scaled font can be referenced and kept using
48 // cairo_scaled_font_reference().
49 //
50 // or %NULL if @font is %NULL.
51 // RETURNS: the #cairo_scaled_font_t used by @font,
52 cairo.ScaledFont* /*new*/ get_scaled_font()() nothrow {
53 return pango_cairo_font_get_scaled_font(cast(Font*)&this);
56 mixin __interface__;
60 // #PangoCairoFontMap is an interface exported by font maps for
61 // use with Cairo. The actual type of the font map will depend
62 // on the particular font technology Cairo was compiled to use.
63 struct FontMap /* Interface */ /* Version 1.10 */ {
64 mixin template __interface__() {
65 // Unintrospectable function: get_default() / pango_cairo_font_map_get_default()
66 // VERSION: 1.10
67 // Gets a default #PangoCairoFontMap to use with Cairo.
68 //
69 // Note that the type of the returned object will depend
70 // on the particular font backend Cairo was compiled to use;
71 // You generally should only use the #PangoFontMap and
72 // #PangoCairoFontMap interfaces on the returned object.
73 //
74 // The default Cairo fontmap can be changed by using
75 // pango_cairo_font_map_set_default(). This can be used to
76 // change the Cairo font backend that the default fontmap
77 // uses for example.
78 //
79 // object is owned by Pango and must not be freed.
80 // RETURNS: the default Cairo fontmap for Pango. This
81 static Pango.FontMap* get_default()() nothrow {
82 return pango_cairo_font_map_get_default();
85 // Unintrospectable function: new() / pango_cairo_font_map_new()
86 // VERSION: 1.10
87 // Creates a new #PangoCairoFontMap object; a fontmap is used
88 // to cache information about available fonts, and holds
89 // certain global parameters such as the resolution.
90 // In most cases, you can use pango_cairo_font_map_get_default()
91 // instead.
92 //
93 // Note that the type of the returned object will depend
94 // on the particular font backend Cairo was compiled to use;
95 // You generally should only use the #PangoFontMap and
96 // #PangoCairoFontMap interfaces on the returned object.
97 //
98 // be freed with g_object_unref().
99 // RETURNS: the newly allocated #PangoFontMap, which should
100 static Pango.FontMap* new_()() nothrow {
101 return pango_cairo_font_map_new();
104 // Unintrospectable function: new_for_font_type() / pango_cairo_font_map_new_for_font_type()
105 // VERSION: 1.18
106 // Creates a new #PangoCairoFontMap object of the type suitable
107 // to be used with cairo font backend of type @fonttype.
109 // In most cases one should simply use @pango_cairo_font_map_new(),
110 // or in fact in most of those cases, just use
111 // @pango_cairo_font_map_get_default().
113 // which should be freed with g_object_unref(),
114 // or %NULL if the requested cairo font backend is
115 // not supported / compiled in.
116 // RETURNS: the newly allocated #PangoFontMap of suitable type
117 // <fonttype>: desired #cairo_font_type_t
118 static Pango.FontMap* new_for_font_type()(cairo.FontType fonttype) nothrow {
119 return pango_cairo_font_map_new_for_font_type(fonttype);
122 // Unintrospectable method: create_context() / pango_cairo_font_map_create_context()
123 // VERSION: 1.10
124 // DEPRECATED (v1.22) method: create_context - Use pango_font_map_create_context() instead.
125 // Create a #PangoContext for the given fontmap.
126 // RETURNS: the newly created context; free with g_object_unref().
127 Pango.Context* create_context()() nothrow {
128 return pango_cairo_font_map_create_context(cast(FontMap*)&this);
131 // VERSION: 1.18
132 // Gets the type of Cairo font backend that @fontmap uses.
133 // RETURNS: the #cairo_font_type_t cairo font backend type
134 cairo.FontType /*new*/ get_font_type()() nothrow {
135 return pango_cairo_font_map_get_font_type(cast(FontMap*)&this);
138 // VERSION: 1.10
139 // Gets the resolution for the fontmap. See pango_cairo_font_map_set_resolution()
140 // RETURNS: the resolution in "dots per inch"
141 double get_resolution()() nothrow {
142 return pango_cairo_font_map_get_resolution(cast(FontMap*)&this);
145 // VERSION: 1.22
146 // Sets a default #PangoCairoFontMap to use with Cairo.
148 // This can be used to change the Cairo font backend that the
149 // default fontmap uses for example. The old default font map
150 // is unreffed and the new font map referenced.
152 // A value of %NULL for @fontmap will cause the current default
153 // font map to be released and a new default font
154 // map to be created on demand, using pango_cairo_font_map_new().
155 void set_default()() nothrow {
156 pango_cairo_font_map_set_default(cast(FontMap*)&this);
159 // VERSION: 1.10
160 // Sets the resolution for the fontmap. This is a scale factor between
161 // points specified in a #PangoFontDescription and Cairo units. The
162 // default value is 96, meaning that a 10 point font will be 13
163 // units high. (10 * 96. / 72. = 13.3).
164 // <dpi>: the resolution in "dots per inch". (Physical inches aren't actually involved; the terminology is conventional.)
165 void set_resolution()(double dpi) nothrow {
166 pango_cairo_font_map_set_resolution(cast(FontMap*)&this, dpi);
169 mixin __interface__;
172 extern (C) alias void function (cairo.Context* cr, Pango.AttrShape* attr, int do_path, void* data) nothrow ShapeRendererFunc;
175 // VERSION: 1.10
176 // Retrieves any font rendering options previously set with
177 // pango_cairo_font_map_set_font_options(). This function does not report options
178 // that are derived from the target surface by pango_cairo_update_context()
180 // if no options have been set. This value is owned by the context
181 // and must not be modified or freed.
182 // RETURNS: the font options previously set on the context, or %NULL
183 // <context>: a #PangoContext, from a pangocairo font map
184 static cairo.FontOptions* context_get_font_options(AT0)(AT0 /*Pango.Context*/ context) nothrow {
185 return pango_cairo_context_get_font_options(UpCast!(Pango.Context*)(context));
189 // VERSION: 1.10
190 // Gets the resolution for the context. See pango_cairo_context_set_resolution()
192 // be returned if no resolution has previously been set.
193 // RETURNS: the resolution in "dots per inch". A negative value will
194 // <context>: a #PangoContext, from a pangocairo font map
195 static double context_get_resolution(AT0)(AT0 /*Pango.Context*/ context) nothrow {
196 return pango_cairo_context_get_resolution(UpCast!(Pango.Context*)(context));
200 // Unintrospectable function: context_get_shape_renderer() / pango_cairo_context_get_shape_renderer()
201 // VERSION: 1.18
202 // Sets callback function for context to use for rendering attributes
203 // of type %PANGO_ATTR_SHAPE. See #PangoCairoShapeRendererFunc for
204 // details.
206 // Retrieves callback function and associated user data for rendering
207 // attributes of type %PANGO_ATTR_SHAPE as set by
208 // pango_cairo_context_set_shape_renderer(), if any.
210 // if no shape rendering callback have been set.
211 // RETURNS: the shape rendering callback previously set on the context, or %NULL
212 // <context>: a #PangoContext, from a pangocairo font map
213 // <data>: Pointer to #gpointer to return user data
214 static ShapeRendererFunc context_get_shape_renderer(AT0, AT1)(AT0 /*Pango.Context*/ context, AT1 /*void**/ data) nothrow {
215 return pango_cairo_context_get_shape_renderer(UpCast!(Pango.Context*)(context), UpCast!(void**)(data));
219 // VERSION: 1.10
220 // Sets the font options used when rendering text with this context.
221 // These options override any options that pango_cairo_update_context()
222 // derives from the target surface.
223 // <context>: a #PangoContext, from a pangocairo font map
224 // <options>: a #cairo_font_options_t, or %NULL to unset any previously set options. A copy is made.
225 static void context_set_font_options(AT0, AT1)(AT0 /*Pango.Context*/ context, AT1 /*cairo.FontOptions*/ options) nothrow {
226 pango_cairo_context_set_font_options(UpCast!(Pango.Context*)(context), UpCast!(cairo.FontOptions*)(options));
230 // VERSION: 1.10
231 // Sets the resolution for the context. This is a scale factor between
232 // points specified in a #PangoFontDescription and Cairo units. The
233 // default value is 96, meaning that a 10 point font will be 13
234 // units high. (10 * 96. / 72. = 13.3).
235 // <context>: a #PangoContext, from a pangocairo font map
236 // <dpi>: the resolution in "dots per inch". (Physical inches aren't actually involved; the terminology is conventional.) A 0 or negative value means to use the resolution from the font map.
237 static void context_set_resolution(AT0)(AT0 /*Pango.Context*/ context, double dpi) nothrow {
238 pango_cairo_context_set_resolution(UpCast!(Pango.Context*)(context), dpi);
242 // VERSION: 1.18
243 // Sets callback function for context to use for rendering attributes
244 // of type %PANGO_ATTR_SHAPE. See #PangoCairoShapeRendererFunc for
245 // details.
246 // <context>: a #PangoContext, from a pangocairo font map
247 // <func>: Callback function for rendering attributes of type %PANGO_ATTR_SHAPE, or %NULL to disable shape rendering.
248 // <data>: User data that will be passed to @func.
249 // <dnotify>: Callback that will be called when the context is freed to release @data, or %NULL.
250 static void context_set_shape_renderer(AT0, AT1)(AT0 /*Pango.Context*/ context, ShapeRendererFunc func, AT1 /*void*/ data, GLib2.DestroyNotify dnotify) nothrow {
251 pango_cairo_context_set_shape_renderer(UpCast!(Pango.Context*)(context), func, UpCast!(void*)(data), dnotify);
255 // Unintrospectable function: create_context() / pango_cairo_create_context()
256 // VERSION: 1.22
257 // Creates a context object set up to match the current transformation
258 // and target surface of the Cairo context. This context can then be
259 // used to create a layout using pango_layout_new().
261 // This function is a convenience function that creates a context using
262 // the default font map, then updates it to @cr. If you just need to
263 // create a layout for use with @cr and do not need to access #PangoContext
264 // directly, you can use pango_cairo_create_layout() instead.
266 // g_object_unref().
267 // RETURNS: the newly created #PangoContext. Free with
268 // <cr>: a Cairo context
269 static Pango.Context* create_context(AT0)(AT0 /*cairo.Context*/ cr) nothrow {
270 return pango_cairo_create_context(UpCast!(cairo.Context*)(cr));
274 // Unintrospectable function: create_layout() / pango_cairo_create_layout()
275 // VERSION: 1.10
276 // Creates a layout object set up to match the current transformation
277 // and target surface of the Cairo context. This layout can then be
278 // used for text measurement with functions like
279 // pango_layout_get_size() or drawing with functions like
280 // pango_cairo_show_layout(). If you change the transformation
281 // or target surface for @cr, you need to call pango_cairo_update_layout()
283 // This function is the most convenient way to use Cairo with Pango,
284 // however it is slightly inefficient since it creates a separate
285 // #PangoContext object for each layout. This might matter in an
286 // application that was laying out large amounts of text.
288 // g_object_unref().
289 // RETURNS: the newly created #PangoLayout. Free with
290 // <cr>: a Cairo context
291 static Pango.Layout* create_layout(AT0)(AT0 /*cairo.Context*/ cr) nothrow {
292 return pango_cairo_create_layout(UpCast!(cairo.Context*)(cr));
296 // VERSION: 1.14
297 // Add a squiggly line to the current path in the specified cairo context that
298 // approximately covers the given rectangle in the style of an underline used
299 // to indicate a spelling error. (The width of the underline is rounded to an
300 // integer number of up/down segments and the resulting rectangle is centered
301 // in the original rectangle)
302 // <cr>: a Cairo context
303 // <x>: The X coordinate of one corner of the rectangle
304 // <y>: The Y coordinate of one corner of the rectangle
305 // <width>: Non-negative width of the rectangle
306 // <height>: Non-negative height of the rectangle
307 static void error_underline_path(AT0)(AT0 /*cairo.Context*/ cr, double x, double y, double width, double height) nothrow {
308 pango_cairo_error_underline_path(UpCast!(cairo.Context*)(cr), x, y, width, height);
312 // VERSION: 1.10
313 // Adds the glyphs in @glyphs to the current path in the specified
314 // cairo context. The origin of the glyphs (the left edge of the baseline)
315 // will be at the current point of the cairo context.
316 // <cr>: a Cairo context
317 // <font>: a #PangoFont from a #PangoCairoFontMap
318 // <glyphs>: a #PangoGlyphString
319 static void glyph_string_path(AT0, AT1, AT2)(AT0 /*cairo.Context*/ cr, AT1 /*Pango.Font*/ font, AT2 /*Pango.GlyphString*/ glyphs) nothrow {
320 pango_cairo_glyph_string_path(UpCast!(cairo.Context*)(cr), UpCast!(Pango.Font*)(font), UpCast!(Pango.GlyphString*)(glyphs));
324 // VERSION: 1.10
325 // Adds the text in #PangoLayoutLine to the current path in the
326 // specified cairo context. The origin of the glyphs (the left edge
327 // of the line) will be at the current point of the cairo context.
328 // <cr>: a Cairo context
329 // <line>: a #PangoLayoutLine
330 static void layout_line_path(AT0, AT1)(AT0 /*cairo.Context*/ cr, AT1 /*Pango.LayoutLine*/ line) nothrow {
331 pango_cairo_layout_line_path(UpCast!(cairo.Context*)(cr), UpCast!(Pango.LayoutLine*)(line));
335 // VERSION: 1.10
336 // Adds the text in a #PangoLayout to the current path in the
337 // specified cairo context. The top-left corner of the #PangoLayout
338 // will be at the current point of the cairo context.
339 // <cr>: a Cairo context
340 // <layout>: a Pango layout
341 static void layout_path(AT0, AT1)(AT0 /*cairo.Context*/ cr, AT1 /*Pango.Layout*/ layout) nothrow {
342 pango_cairo_layout_path(UpCast!(cairo.Context*)(cr), UpCast!(Pango.Layout*)(layout));
346 // VERSION: 1.14
347 // Draw a squiggly line in the specified cairo context that approximately
348 // covers the given rectangle in the style of an underline used to indicate a
349 // spelling error. (The width of the underline is rounded to an integer
350 // number of up/down segments and the resulting rectangle is centered in the
351 // original rectangle)
352 // <cr>: a Cairo context
353 // <x>: The X coordinate of one corner of the rectangle
354 // <y>: The Y coordinate of one corner of the rectangle
355 // <width>: Non-negative width of the rectangle
356 // <height>: Non-negative height of the rectangle
357 static void show_error_underline(AT0)(AT0 /*cairo.Context*/ cr, double x, double y, double width, double height) nothrow {
358 pango_cairo_show_error_underline(UpCast!(cairo.Context*)(cr), x, y, width, height);
362 // VERSION: 1.22
363 // Draws the glyphs in @glyph_item in the specified cairo context,
364 // embedding the text associated with the glyphs in the output if the
365 // output format supports it (PDF for example), otherwise it acts
366 // similar to pango_cairo_show_glyph_string().
368 // The origin of the glyphs (the left edge of the baseline) will
369 // be drawn at the current point of the cairo context.
371 // Note that @text is the start of the text for layout, which is then
372 // indexed by <literal>@glyph_item->item->offset</literal>.
373 // <cr>: a Cairo context
374 // <text>: the UTF-8 text that @glyph_item refers to
375 // <glyph_item>: a #PangoGlyphItem
376 static void show_glyph_item(AT0, AT1, AT2)(AT0 /*cairo.Context*/ cr, AT1 /*char*/ text, AT2 /*Pango.GlyphItem*/ glyph_item) nothrow {
377 pango_cairo_show_glyph_item(UpCast!(cairo.Context*)(cr), toCString!(char*)(text), UpCast!(Pango.GlyphItem*)(glyph_item));
381 // VERSION: 1.10
382 // Draws the glyphs in @glyphs in the specified cairo context.
383 // The origin of the glyphs (the left edge of the baseline) will
384 // be drawn at the current point of the cairo context.
385 // <cr>: a Cairo context
386 // <font>: a #PangoFont from a #PangoCairoFontMap
387 // <glyphs>: a #PangoGlyphString
388 static void show_glyph_string(AT0, AT1, AT2)(AT0 /*cairo.Context*/ cr, AT1 /*Pango.Font*/ font, AT2 /*Pango.GlyphString*/ glyphs) nothrow {
389 pango_cairo_show_glyph_string(UpCast!(cairo.Context*)(cr), UpCast!(Pango.Font*)(font), UpCast!(Pango.GlyphString*)(glyphs));
393 // VERSION: 1.10
394 // Draws a #PangoLayout in the specified cairo context.
395 // The top-left corner of the #PangoLayout will be drawn
396 // at the current point of the cairo context.
397 // <cr>: a Cairo context
398 // <layout>: a Pango layout
399 static void show_layout(AT0, AT1)(AT0 /*cairo.Context*/ cr, AT1 /*Pango.Layout*/ layout) nothrow {
400 pango_cairo_show_layout(UpCast!(cairo.Context*)(cr), UpCast!(Pango.Layout*)(layout));
404 // VERSION: 1.10
405 // Draws a #PangoLayoutLine in the specified cairo context.
406 // The origin of the glyphs (the left edge of the line) will
407 // be drawn at the current point of the cairo context.
408 // <cr>: a Cairo context
409 // <line>: a #PangoLayoutLine
410 static void show_layout_line(AT0, AT1)(AT0 /*cairo.Context*/ cr, AT1 /*Pango.LayoutLine*/ line) nothrow {
411 pango_cairo_show_layout_line(UpCast!(cairo.Context*)(cr), UpCast!(Pango.LayoutLine*)(line));
415 // VERSION: 1.10
416 // Updates a #PangoContext previously created for use with Cairo to
417 // match the current transformation and target surface of a Cairo
418 // context. If any layouts have been created for the context,
419 // it's necessary to call pango_layout_context_changed() on those
420 // layouts.
421 // <cr>: a Cairo context
422 // <context>: a #PangoContext, from a pangocairo font map
423 static void update_context(AT0, AT1)(AT0 /*cairo.Context*/ cr, AT1 /*Pango.Context*/ context) nothrow {
424 pango_cairo_update_context(UpCast!(cairo.Context*)(cr), UpCast!(Pango.Context*)(context));
428 // VERSION: 1.10
429 // Updates the private #PangoContext of a #PangoLayout created with
430 // pango_cairo_create_layout() to match the current transformation
431 // and target surface of a Cairo context.
432 // <cr>: a Cairo context
433 // <layout>: a #PangoLayout, from pango_cairo_create_layout()
434 static void update_layout(AT0, AT1)(AT0 /*cairo.Context*/ cr, AT1 /*Pango.Layout*/ layout) nothrow {
435 pango_cairo_update_layout(UpCast!(cairo.Context*)(cr), UpCast!(Pango.Layout*)(layout));
439 // C prototypes:
441 extern (C) {
442 cairo.ScaledFont* /*new*/ pango_cairo_font_get_scaled_font(Font* this_) nothrow;
443 Pango.FontMap* pango_cairo_font_map_get_default() nothrow;
444 Pango.FontMap* pango_cairo_font_map_new() nothrow;
445 Pango.FontMap* pango_cairo_font_map_new_for_font_type(cairo.FontType fonttype) nothrow;
446 Pango.Context* pango_cairo_font_map_create_context(FontMap* this_) nothrow;
447 cairo.FontType /*new*/ pango_cairo_font_map_get_font_type(FontMap* this_) nothrow;
448 double pango_cairo_font_map_get_resolution(FontMap* this_) nothrow;
449 void pango_cairo_font_map_set_default(FontMap* this_) nothrow;
450 void pango_cairo_font_map_set_resolution(FontMap* this_, double dpi) nothrow;
451 cairo.FontOptions* pango_cairo_context_get_font_options(Pango.Context* context) nothrow;
452 double pango_cairo_context_get_resolution(Pango.Context* context) nothrow;
453 ShapeRendererFunc pango_cairo_context_get_shape_renderer(Pango.Context* context, void** data) nothrow;
454 void pango_cairo_context_set_font_options(Pango.Context* context, cairo.FontOptions* options) nothrow;
455 void pango_cairo_context_set_resolution(Pango.Context* context, double dpi) nothrow;
456 void pango_cairo_context_set_shape_renderer(Pango.Context* context, ShapeRendererFunc func, void* data, GLib2.DestroyNotify dnotify) nothrow;
457 Pango.Context* pango_cairo_create_context(cairo.Context* cr) nothrow;
458 Pango.Layout* pango_cairo_create_layout(cairo.Context* cr) nothrow;
459 void pango_cairo_error_underline_path(cairo.Context* cr, double x, double y, double width, double height) nothrow;
460 void pango_cairo_glyph_string_path(cairo.Context* cr, Pango.Font* font, Pango.GlyphString* glyphs) nothrow;
461 void pango_cairo_layout_line_path(cairo.Context* cr, Pango.LayoutLine* line) nothrow;
462 void pango_cairo_layout_path(cairo.Context* cr, Pango.Layout* layout) nothrow;
463 void pango_cairo_show_error_underline(cairo.Context* cr, double x, double y, double width, double height) nothrow;
464 void pango_cairo_show_glyph_item(cairo.Context* cr, char* text, Pango.GlyphItem* glyph_item) nothrow;
465 void pango_cairo_show_glyph_string(cairo.Context* cr, Pango.Font* font, Pango.GlyphString* glyphs) nothrow;
466 void pango_cairo_show_layout(cairo.Context* cr, Pango.Layout* layout) nothrow;
467 void pango_cairo_show_layout_line(cairo.Context* cr, Pango.LayoutLine* line) nothrow;
468 void pango_cairo_update_context(cairo.Context* cr, Pango.Context* context) nothrow;
469 void pango_cairo_update_layout(cairo.Context* cr, Pango.Layout* layout) nothrow;