PageRenderTime 72ms CodeModel.GetById 35ms app.highlight 33ms RepoModel.GetById 1ms app.codeStats 0ms

/binding/pango/cairo.d

http://github.com/wilkie/djehuty
D | 128 lines | 52 code | 22 blank | 54 comment | 0 complexity | b588ec1d0fe3af23f4128684802a6e6d MD5 | raw file
  1/*
  2 * cairo.d
  3 *
  4 * This file holds bindings to pango's pangocairo.h. The original copyright
  5 * is displayed below, but does not pertain to this file.
  6 *
  7 * Author: Dave Wilkinson
  8 *
  9 */
 10
 11module binding.pango.cairo;
 12
 13/* Pango
 14 * pangocairo.h:
 15 *
 16 * Copyright (C) 1999, 2004 Red Hat, Inc.
 17 *
 18 * This library is free software; you can redistribute it and/or
 19 * modify it under the terms of the GNU Library General Public
 20 * License as published by the Free Software Foundation; either
 21 * version 2 of the License, or (at your option) any later version.
 22 *
 23 * This library is distributed in the hope that it will be useful,
 24 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 25 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.	 See the GNU
 26 * Library General Public License for more details.
 27 *
 28 * You should have received a copy of the GNU Library General Public
 29 * License along with this library; if not, write to the
 30 * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
 31 * Boston, MA 02111-1307, USA.
 32 */
 33
 34import binding.pango.types;
 35
 36import binding.pango.context;
 37import binding.pango.fontmap;
 38import binding.pango.layout;
 39import binding.pango.glyph;
 40
 41import binding.cairo.cairo;
 42
 43
 44/**
 45 * PangoCairoFontMap:
 46 *
 47 * #PangoCairoFontMap is an interface exported by font maps for
 48 * use with Cairo. The actual type of the font map will depend
 49 * on the particular font technology Cairo was compiled to use.
 50 *
 51 * Since: 1.10
 52 **/
 53
 54//#define PANGO_TYPE_CAIRO_FONT_MAP       (pango_cairo_font_map_get_type ())
 55//#define PANGO_CAIRO_FONT_MAP(object)    (G_TYPE_CHECK_INSTANCE_CAST ((object), PANGO_TYPE_CAIRO_FONT_MAP, PangoCairoFontMap))
 56//#define PANGO_IS_CAIRO_FONT_MAP(object) (G_TYPE_CHECK_INSTANCE_TYPE ((object), PANGO_TYPE_CAIRO_FONT_MAP))
 57
 58extern(C) struct _PangoCairoFontMap;
 59alias _PangoCairoFontMap      PangoCairoFontMap;
 60
 61/*
 62 * PangoCairoFontMap
 63 */
 64
 65extern(C):
 66
 67GType         pango_cairo_font_map_get_type    ();
 68
 69PangoFontMap *pango_cairo_font_map_new         ();
 70PangoFontMap *pango_cairo_font_map_get_default ();
 71
 72void          pango_cairo_font_map_set_resolution (PangoCairoFontMap *fontmap,
 73						   double             dpi);
 74double        pango_cairo_font_map_get_resolution (PangoCairoFontMap *fontmap);
 75PangoContext *pango_cairo_font_map_create_context (PangoCairoFontMap *fontmap);
 76
 77/* Update a Pango context for the current state of a cairo context
 78 */
 79void         pango_cairo_update_context (cairo_t      *cr,
 80					 PangoContext *context);
 81
 82void                        pango_cairo_context_set_font_options (PangoContext               *context,
 83								  cairo_font_options_t *options);
 84cairo_font_options_t *pango_cairo_context_get_font_options (PangoContext               *context);
 85
 86void               pango_cairo_context_set_resolution     (PangoContext       *context,
 87							   double              dpi);
 88double             pango_cairo_context_get_resolution     (PangoContext       *context);
 89
 90/* Convenience
 91 */
 92PangoLayout *pango_cairo_create_layout (cairo_t     *cr);
 93void         pango_cairo_update_layout (cairo_t     *cr,
 94					PangoLayout *layout);
 95
 96/*
 97 * Rendering
 98 */
 99void pango_cairo_show_glyph_string (cairo_t          *cr,
100				    PangoFont        *font,
101				    PangoGlyphString *glyphs);
102void pango_cairo_show_layout_line  (cairo_t          *cr,
103				    PangoLayoutLine  *line);
104void pango_cairo_show_layout       (cairo_t          *cr,
105				    PangoLayout      *layout);
106
107void pango_cairo_show_error_underline (cairo_t       *cr,
108				       double         x,
109				       double         y,
110				       double         width,
111				       double         height);
112
113/*
114 * Rendering to a path
115 */
116void pango_cairo_glyph_string_path (cairo_t          *cr,
117				    PangoFont        *font,
118				    PangoGlyphString *glyphs);
119void pango_cairo_layout_line_path  (cairo_t          *cr,
120				    PangoLayoutLine  *line);
121void pango_cairo_layout_path       (cairo_t          *cr,
122				    PangoLayout      *layout);
123
124void pango_cairo_error_underline_path (cairo_t       *cr,
125				       double         x,
126				       double         y,
127				       double         width,
128				       double         height);