add new sigc++2 directory
[ardour.git] / libs / gtkmm2 / pango / src / rectangle.ccg
1 /* Copyright (C) 2002 The gtkmm Development Team
2  *
3  * This library is free software; you can redistribute it and/or
4  * modify it under the terms of the GNU Library General Public
5  * License as published by the Free Software Foundation; either
6  * version 2 of the License, or (at your option) any later version.
7  *
8  * This library is distributed in the hope that it will be useful,
9  * but WITHOUT ANY WARRANTY; without even the implied warranty of
10  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
11  * Library General Public License for more details.
12  *
13  * You should have received a copy of the GNU Library General Public
14  * License along with this library; if not, write to the Free
15  * Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
16  */
17
18 namespace Pango
19 {
20
21 Rectangle::Rectangle()
22 {
23   gobject_.x = gobject_.y = 0;
24   gobject_.width = gobject_.height = 0;
25 }
26
27 Rectangle::Rectangle(int x, int y, int width, int height)
28 {
29   gobject_.x = x;
30   gobject_.y = y;
31   gobject_.width = width;
32   gobject_.height = height;
33 }
34
35 Rectangle::Rectangle(const PangoRectangle* src)
36 {
37   gobject_.x = src->x;
38   gobject_.y = src->y;
39   gobject_.width = src->width;
40   gobject_.height = src->height;
41 }
42
43 bool Rectangle::equal(const Rectangle& rhs) const
44 {
45   return (get_x() == rhs.get_x() && get_y() == rhs.get_y() &&
46           get_width() == rhs.get_width() && get_height() == rhs.get_height());
47 }
48
49 } /* namespace Pango */
50
51
52 namespace Glib
53 {
54
55 Pango::Rectangle& wrap(PangoRectangle* object)
56 {
57   return *reinterpret_cast<Pango::Rectangle*>(object);
58 }
59
60 const Pango::Rectangle& wrap(const PangoRectangle* object)
61 {
62   return *reinterpret_cast<const Pango::Rectangle*>(object);
63 }
64
65 } /* namespace Glib */