1 // Generated by gmmproc 2.49.5 -- DO NOT MODIFY!
2
3
4 #include <glibmm.h>
5
6 #include <pangomm/attrlist.h>
7 #include <pangomm/private/attrlist_p.h>
8
9
10 // -*- c++ -*-
11 /* $Id: attrlist.ccg,v 1.3 2005/11/22 15:00:17 murrayc Exp $ */
12
13 /*
14 *
15 * Copyright 1998-1999 The Gtk-- Development Team
16 * Copyright 2001 Free Software Foundation
17 *
18 * This library is free software; you can redistribute it and/or
19 * modify it under the terms of the GNU Lesser General Public
20 * License as published by the Free Software Foundation; either
21 * version 2.1 of the License, or (at your option) any later version.
22 *
23 * This library is distributed in the hope that it will be useful,
24 * but WITHOUT ANY WARRANTY; without even the implied warranty of
25 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
26 * Lesser General Public License for more details.
27 *
28 * You should have received a copy of the GNU Lesser General Public
29 * License along with this library; if not, write to the Free
30 * Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
31 */
32
33 namespace Pango
34 {
35
AttrList(const Glib::ustring & markup_text,gunichar accel_marker)36 AttrList::AttrList(const Glib::ustring& markup_text, gunichar accel_marker)
37 {
38 gboolean bTest = pango_parse_markup(markup_text.c_str(), -1 /* means null-terminated */, accel_marker,
39 &gobject_, 0, 0, 0);
40 if(bTest == FALSE)
41 gobject_ = 0;
42 }
43
44 #ifndef PANGOMM_DISABLE_DEPRECATED
45
operator bool()46 AttrList::operator bool()
47 {
48 return gobj() != 0;
49 }
50 #endif // PANGOMM_DISABLE_DEPRECATED
51
52
operator bool() const53 AttrList::operator bool() const
54 {
55 return gobj() != 0;
56 }
57
AttrList(const Glib::ustring & markup_text,gunichar accel_marker,Glib::ustring & text,gunichar & accel_char)58 AttrList::AttrList(const Glib::ustring& markup_text, gunichar accel_marker, Glib::ustring& text, gunichar& accel_char)
59 {
60 //initialize output parameters:
61 text.erase();
62 accel_char = 0;
63
64 gchar* pchText = 0;
65 gboolean bTest = pango_parse_markup(markup_text.c_str(), -1 /* means null-terminated */, accel_marker,
66 &gobject_, &pchText, &accel_char, 0);
67 if(bTest == FALSE)
68 {
69 gobject_ = 0;
70 }
71 else
72 {
73 text = pchText;
74 g_free(pchText);
75 }
76 }
77
insert(Attribute & attr)78 void AttrList::insert(Attribute& attr)
79 {
80 pango_attr_list_insert(gobj(), pango_attribute_copy(attr.gobj()));
81 }
82
insert_before(Attribute & attr)83 void AttrList::insert_before(Attribute& attr)
84 {
85 pango_attr_list_insert_before(gobj(), pango_attribute_copy(attr.gobj()));
86 }
87
change(Attribute & attr)88 void AttrList::change(Attribute& attr)
89 {
90 pango_attr_list_change(gobj(), pango_attribute_copy(attr.gobj()));
91 }
92
93 } /* namespace Pango */
94
95 namespace
96 {
97 } // anonymous namespace
98
99
100 namespace Glib
101 {
102
wrap(PangoAttrList * object,bool take_copy)103 Pango::AttrList wrap(PangoAttrList* object, bool take_copy)
104 {
105 return Pango::AttrList(object, take_copy);
106 }
107
108 } // namespace Glib
109
110
111 namespace Pango
112 {
113
114
115 // static
get_type()116 GType AttrList::get_type()
117 {
118 return pango_attr_list_get_type();
119 }
120
AttrList()121 AttrList::AttrList()
122 :
123 gobject_ (pango_attr_list_new())
124 {}
125
AttrList(const AttrList & other)126 AttrList::AttrList(const AttrList& other)
127 :
128 gobject_ ((other.gobject_) ? pango_attr_list_copy(other.gobject_) : nullptr)
129 {}
130
AttrList(AttrList && other)131 AttrList::AttrList(AttrList&& other) noexcept
132 :
133 gobject_(other.gobject_)
134 {
135 other.gobject_ = nullptr;
136 }
137
operator =(AttrList && other)138 AttrList& AttrList::operator=(AttrList&& other) noexcept
139 {
140 AttrList temp (other);
141 swap(temp);
142 return *this;
143 }
144
AttrList(PangoAttrList * gobject,bool make_a_copy)145 AttrList::AttrList(PangoAttrList* gobject, bool make_a_copy)
146 :
147 // For BoxedType wrappers, make_a_copy is true by default. The static
148 // BoxedType wrappers must always take a copy, thus make_a_copy = true
149 // ensures identical behaviour if the default argument is used.
150 gobject_ ((make_a_copy && gobject) ? pango_attr_list_copy(gobject) : gobject)
151 {}
152
operator =(const AttrList & other)153 AttrList& AttrList::operator=(const AttrList& other)
154 {
155 AttrList temp (other);
156 swap(temp);
157 return *this;
158 }
159
~AttrList()160 AttrList::~AttrList() noexcept
161 {
162 if(gobject_)
163 pango_attr_list_unref(gobject_);
164 }
165
swap(AttrList & other)166 void AttrList::swap(AttrList& other) noexcept
167 {
168 std::swap(gobject_, other.gobject_);
169 }
170
gobj_copy() const171 PangoAttrList* AttrList::gobj_copy() const
172 {
173 return pango_attr_list_copy(gobject_);
174 }
175
176
splice(AttrList & other,int pos,int len)177 void AttrList::splice(AttrList& other, int pos, int len)
178 {
179 pango_attr_list_splice(gobj(), (other).gobj(), pos, len);
180 }
181
get_iter()182 AttrIter AttrList::get_iter()
183 {
184 return Glib::wrap((pango_attr_list_get_iterator(gobj())));
185 }
186
187
188 } // namespace Pango
189
190
191