add new sigc++2 directory
[ardour.git] / libs / gtkmm2 / pango / src / renderer.hg
1 /* $Id: renderer.hg,v 1.4 2006/06/10 15:26:24 murrayc Exp $ */
2
3 /* renderer.h
4  *
5  * Copyright(C) 2004 The gtkmm Development Team
6  *
7  * This library is free software; you can redistribute it and/or
8  * modify it under the terms of the GNU Library General Public
9  * License as published by the Free Software Foundation; either
10  * version 2 of the License, or(at your option) any later version.
11  *
12  * This library is distributed in the hope that it will be useful,
13  * but WITHOUT ANY WARRANTY; without even the implied warranty of
14  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
15  * Library General Public License for more details.
16  *
17  * You should have received a copy of the GNU Library General Public
18  * License along with this library; if not, write to the Free
19  * Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
20  */
21
22
23 #include <glibmm/object.h>
24 #include <pangomm/context.h>
25 #include <pangomm/glyphstring.h>
26 #include <pangomm/layout.h>
27 #include <pangomm/layoutline.h>
28
29 _DEFS(pangomm,pango)
30 _PINCLUDE(glibmm/private/object_p.h)
31
32 namespace Pango
33 {
34
35 _CC_INCLUDE(pango/pango-enum-types.h)
36
37 _WRAP_ENUM(RenderPart, PangoRenderPart)
38
39 /** Pango::Renderer is a base class that contains the necessary logic for rendering a Pango::Layout or Pango::LayoutLine. 
40  * By subclassing Pango::Renderer and overriding operations such as draw_glyphs and draw_rectangle, 
41  * renderers for particular font backends and destinations can be created.
42  */
43 class Renderer : public Glib::Object
44 {
45   _CLASS_GOBJECT(Renderer, PangoRenderer, PANGO_RENDERER, Glib::Object, GObject)
46  
47 protected:
48  
49 public:
50
51   _WRAP_METHOD(void draw_layout(const Glib::RefPtr<Layout>& layout, int x, int y), pango_renderer_draw_layout)
52   _WRAP_METHOD(void draw_layout_line(const Glib::RefPtr<LayoutLine>& line, int x, int y), pango_renderer_draw_layout_line)
53   _WRAP_METHOD(void draw_glyphs(const Glib::RefPtr<Font>& font, const GlyphString& glyphs, int x, int y), pango_renderer_draw_glyphs)
54   _WRAP_METHOD(void draw_rectangle(RenderPart part, int x, int y, int width, int height), pango_renderer_draw_rectangle)
55   _WRAP_METHOD(void draw_error_underline(int x, int y, int width, int height), pango_renderer_draw_error_underline)
56   _WRAP_METHOD(void draw_trapezoid(RenderPart part, double y1, double x11, double x21, double y2, double x12, double x22), pango_renderer_draw_trapezoid)
57   _WRAP_METHOD(void draw_glyph(const Glib::RefPtr<Font>& font, Glyph glyph, double x, double y), pango_renderer_draw_glyph)
58
59   _WRAP_METHOD(void activate(), pango_renderer_activate)
60   _WRAP_METHOD(void deactivate(), pango_renderer_deactivate)
61
62   _WRAP_METHOD(void part_changed(RenderPart part), pango_renderer_part_changed)
63
64   _WRAP_METHOD(void set_color(RenderPart part, const Color& color), pango_renderer_set_color)
65   
66 #m4 _CONVERSION(`PangoColor*',`Color',`Color($3)')
67   _WRAP_METHOD(Color get_color(RenderPart part) const, pango_renderer_get_color)
68
69   _WRAP_METHOD(void set_matrix(const Matrix& matrix), pango_renderer_set_matrix)
70   Matrix get_matrix() const;
71   _IGNORE(pango_renderer_get_matrix)
72 };
73
74 } /* namespace Pango */
75