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