add new sigc++2 directory
[ardour.git] / libs / gtkmm2 / pango / src / layoutiter.ccg
1 // -*- c++ -*-
2 /* $Id: layoutiter.ccg,v 1.1 2003/01/21 13:41:06 murrayc Exp $ */
3
4 /*
5  *
6  * Copyright 2001-2002 The gtkmm Development Team
7  *
8  * This library is free software; you can redistribute it and/or
9  * modify it under the terms of the GNU Library General Public
10  * License as published by the Free Software Foundation; either
11  * version 2 of the License, or (at your option) any later version.
12  *
13  * This library is distributed in the hope that it will be useful,
14  * but WITHOUT ANY WARRANTY; without even the implied warranty of
15  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
16  * Library General Public License for more details.
17  *
18  * You should have received a copy of the GNU Library General Public
19  * License along with this library; if not, write to the Free
20  * Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
21  */
22
23 namespace Pango
24 {
25
26 LayoutIter::LayoutIter()
27 :
28   gobject_ (0)
29 {}
30
31 LayoutIter::~LayoutIter()
32 {
33   if(gobject_)
34     pango_layout_iter_free(gobject_);
35 }
36
37 void LayoutIter::assign_gobj(PangoLayoutIter* src)
38 {
39   if(src != gobject_)
40   {
41     if(gobject_)
42       pango_layout_iter_free(gobject_);
43
44     gobject_ = src;
45   }
46 }
47
48 Rectangle LayoutIter::get_char_extents() const
49 {
50   Rectangle logical_rect;
51   pango_layout_iter_get_char_extents(const_cast<PangoLayoutIter*>(gobj()), logical_rect.gobj());
52   return logical_rect;
53 }
54
55 Rectangle LayoutIter::get_cluster_ink_extents() const
56 {
57   Rectangle ink_rect;
58   pango_layout_iter_get_cluster_extents(const_cast<PangoLayoutIter*>(gobj()), ink_rect.gobj(), 0);
59   return ink_rect;
60 }
61
62 Rectangle LayoutIter::get_cluster_logical_extents() const
63 {
64   Rectangle logical_rect;
65   pango_layout_iter_get_cluster_extents(const_cast<PangoLayoutIter*>(gobj()), 0, logical_rect.gobj());
66   return logical_rect;
67 }
68
69 Rectangle LayoutIter::get_run_ink_extents() const
70 {
71   Rectangle ink_rect;
72   pango_layout_iter_get_run_extents(const_cast<PangoLayoutIter*>(gobj()), ink_rect.gobj(), 0);
73   return ink_rect;
74 }
75
76 Rectangle LayoutIter::get_run_logical_extents() const
77 {
78   Rectangle logical_rect;
79   pango_layout_iter_get_run_extents(const_cast<PangoLayoutIter*>(gobj()), 0, logical_rect.gobj());
80   return logical_rect;
81 }
82
83 Rectangle LayoutIter::get_line_ink_extents() const
84 {
85   Rectangle ink_rect;
86   pango_layout_iter_get_line_extents(const_cast<PangoLayoutIter*>(gobj()), ink_rect.gobj(), 0);
87   return ink_rect;
88 }
89
90 Rectangle LayoutIter::get_line_logical_extents() const
91 {
92   Rectangle logical_rect;
93   pango_layout_iter_get_line_extents(const_cast<PangoLayoutIter*>(gobj()), 0, logical_rect.gobj());
94   return logical_rect;
95 }
96
97 Rectangle LayoutIter::get_layout_ink_extents() const
98 {
99   Rectangle ink_rect;
100   pango_layout_iter_get_layout_extents(const_cast<PangoLayoutIter*>(gobj()), ink_rect.gobj(), 0);
101   return ink_rect;
102 }
103
104 Rectangle LayoutIter::get_layout_logical_extents() const
105 {
106   Rectangle logical_rect;
107   pango_layout_iter_get_layout_extents(const_cast<PangoLayoutIter*>(gobj()), 0, logical_rect.gobj());
108   return logical_rect;
109 }
110
111 } // namespace Pango
112