MIDI branch becomes trunk
[ardour.git] / libs / gtkmm2 / gtk / gtkmm / textattributes.cc
1 // Generated by gtkmmproc -- DO NOT MODIFY!
2
3 #include <gtkmm/textattributes.h>
4 #include <gtkmm/private/textattributes_p.h>
5
6 // -*- c++ -*-
7 /* $Id$ */
8
9 /*
10  *
11  * Copyright 1998-2002 The gtkmm Development Team
12  *
13  * This library is free software; you can redistribute it and/or
14  * modify it under the terms of the GNU Library General Public
15  * License as published by the Free Software Foundation; either
16  * version 2 of the License, or (at your option) any later version.
17  *
18  * This library is distributed in the hope that it will be useful,
19  * but WITHOUT ANY WARRANTY; without even the implied warranty of
20  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
21  * Library General Public License for more details.
22  *
23  * You should have received a copy of the GNU Library General Public
24  * License along with this library; if not, write to the Free
25  * Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
26  */
27
28 #include <gtk/gtktexttag.h>
29
30
31 namespace
32 {
33 } // anonymous namespace
34
35
36 namespace Glib
37 {
38
39 Gtk::TextAttributes wrap(GtkTextAttributes* object, bool take_copy)
40 {
41   return Gtk::TextAttributes(object, take_copy);
42 }
43
44 } // namespace Glib
45
46
47 namespace Gtk
48 {
49
50
51 // static
52 GType TextAttributes::get_type()
53 {
54   return gtk_text_attributes_get_type();
55 }
56
57 TextAttributes::TextAttributes()
58 :
59   gobject_ (gtk_text_attributes_new())
60 {}
61
62 TextAttributes::TextAttributes(const TextAttributes& other)
63 :
64   gobject_ ((other.gobject_) ? gtk_text_attributes_copy(other.gobject_) : 0)
65 {}
66
67 TextAttributes::TextAttributes(GtkTextAttributes* gobject, bool make_a_copy)
68 :
69   // For BoxedType wrappers, make_a_copy is true by default.  The static
70   // BoxedType wrappers must always take a copy, thus make_a_copy = true
71   // ensures identical behaviour if the default argument is used.
72   gobject_ ((make_a_copy && gobject) ? gtk_text_attributes_copy(gobject) : gobject)
73 {}
74
75 TextAttributes& TextAttributes::operator=(const TextAttributes& other)
76 {
77   TextAttributes temp (other);
78   swap(temp);
79   return *this;
80 }
81
82 TextAttributes::~TextAttributes()
83 {
84   if(gobject_)
85     gtk_text_attributes_unref(gobject_);
86 }
87
88 void TextAttributes::swap(TextAttributes& other)
89 {
90   GtkTextAttributes *const temp = gobject_;
91   gobject_ = other.gobject_;
92   other.gobject_ = temp;
93 }
94
95 GtkTextAttributes* TextAttributes::gobj_copy() const
96 {
97   return gtk_text_attributes_copy(gobject_);
98 }
99
100
101 } // namespace Gtk
102
103