1
// Generated by gtkmmproc -- DO NOT MODIFY!
3
#include <pangomm/layout.h>
4
#include <pangomm/private/layout_p.h>
6
#include <pango/pango-enum-types.h>
12
* Copyright 1998-2002 The gtkmm Development Team
14
* This library is free software; you can redistribute it and/or
15
* modify it under the terms of the GNU Library General Public
16
* License as published by the Free Software Foundation; either
17
* version 2 of the License, or (at your option) any later version.
19
* This library is distributed in the hope that it will be useful,
20
* but WITHOUT ANY WARRANTY; without even the implied warranty of
21
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
22
* Library General Public License for more details.
24
* You should have received a copy of the GNU Library General Public
25
* License along with this library; if not, write to the Free
26
* Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
32
Layout::Layout(const Glib::RefPtr<Context>& context)
34
Glib::Object(G_OBJECT(pango_layout_new(context->gobj())))
37
void Layout::set_text(const Glib::ustring& text)
39
pango_layout_set_text(gobj(), text.c_str(), text.bytes());
42
void Layout::set_markup(const Glib::ustring& markup)
44
return pango_layout_set_markup(gobj(), markup.c_str(), markup.bytes());
47
void Layout::set_markup(const Glib::ustring& markup, gunichar accel_marker, gunichar& accel_char)
49
return pango_layout_set_markup_with_accel(gobj(), markup.c_str(), markup.bytes(), accel_marker, &accel_char);
52
Glib::ArrayHandle<PangoLogAttr> Layout::get_log_attrs() const
55
PangoLogAttr* pAttrs = 0;
57
pango_layout_get_log_attrs(const_cast<PangoLayout*>(gobj()), &pAttrs, &n_attrs);
59
return Glib::ArrayHandle<PangoLogAttr>(pAttrs, n_attrs, Glib::OWNERSHIP_SHALLOW);
62
Rectangle Layout::index_to_pos(int index) const
65
pango_layout_index_to_pos(const_cast<PangoLayout*>(gobj()), index, pos.gobj());
69
Rectangle Layout::get_cursor_strong_pos(int index) const
72
pango_layout_get_cursor_pos(const_cast<PangoLayout*>(gobj()), index, strong_pos.gobj(), 0);
76
Rectangle Layout::get_cursor_weak_pos(int index) const
79
pango_layout_get_cursor_pos(const_cast<PangoLayout*>(gobj()), index, 0, weak_pos.gobj());
83
Rectangle Layout::get_ink_extents() const
85
Rectangle ink_extents;
86
pango_layout_get_extents(const_cast<PangoLayout*>(gobj()), ink_extents.gobj(), 0);
90
Rectangle Layout::get_logical_extents() const
92
Rectangle logical_extents;
93
pango_layout_get_extents(const_cast<PangoLayout*>(gobj()), 0, logical_extents.gobj());
94
return logical_extents;
97
Rectangle Layout::get_pixel_ink_extents() const
99
Rectangle ink_extents;
100
pango_layout_get_pixel_extents(const_cast<PangoLayout*>(gobj()), ink_extents.gobj(), 0);
104
Rectangle Layout::get_pixel_logical_extents() const
106
Rectangle logical_extents;
107
pango_layout_get_pixel_extents(const_cast<PangoLayout*>(gobj()), 0, logical_extents.gobj());
108
return logical_extents;
111
void Layout::get_iter(LayoutIter& iter)
113
iter.assign_gobj(pango_layout_get_iter(gobj()));
116
void Layout::unset_font_description()
118
pango_layout_set_font_description(gobj(), 0);
121
} /* namespace Pango */
126
} // anonymous namespace
129
GType Glib::Value<Pango::Alignment>::value_type()
131
return pango_alignment_get_type();
135
GType Glib::Value<Pango::WrapMode>::value_type()
137
return pango_wrap_mode_get_type();
141
GType Glib::Value<Pango::EllipsizeMode>::value_type()
143
return pango_ellipsize_mode_get_type();
150
Glib::RefPtr<Pango::Layout> wrap(PangoLayout* object, bool take_copy)
152
return Glib::RefPtr<Pango::Layout>( dynamic_cast<Pango::Layout*> (Glib::wrap_auto ((GObject*)(object), take_copy)) );
153
//We use dynamic_cast<> in case of multiple inheritance.
156
} /* namespace Glib */
163
/* The *_Class implementation: */
165
const Glib::Class& Layout_Class::init()
167
if(!gtype_) // create the GType if necessary
169
// Glib::Class has to know the class init function to clone custom types.
170
class_init_func_ = &Layout_Class::class_init_function;
172
// This is actually just optimized away, apparently with no harm.
173
// Make sure that the parent type has been created.
174
//CppClassParent::CppObjectType::get_type();
176
// Create the wrapper type, with the same class/instance size as the base type.
177
register_derived_type(pango_layout_get_type());
179
// Add derived versions of interfaces, if the C type implements any interfaces:
185
void Layout_Class::class_init_function(void* g_class, void* class_data)
187
BaseClassType *const klass = static_cast<BaseClassType*>(g_class);
188
CppClassParent::class_init_function(klass, class_data);
193
Glib::ObjectBase* Layout_Class::wrap_new(GObject* object)
195
return new Layout((PangoLayout*)object);
199
/* The implementation: */
201
PangoLayout* Layout::gobj_copy()
207
Layout::Layout(const Glib::ConstructParams& construct_params)
209
Glib::Object(construct_params)
212
Layout::Layout(PangoLayout* castitem)
214
Glib::Object((GObject*)(castitem))
221
Layout::CppClassType Layout::layout_class_; // initialize static member
223
GType Layout::get_type()
225
return layout_class_.init().get_type();
228
GType Layout::get_base_type()
230
return pango_layout_get_type();
234
Glib::RefPtr<Layout> Layout::create(const Glib::RefPtr<Context>& context)
236
return Glib::RefPtr<Layout>( new Layout(context) );
238
Glib::RefPtr<Layout> Layout::copy()
240
return Glib::wrap(pango_layout_copy(gobj()));
243
Glib::RefPtr<Context> Layout::get_context() const
246
Glib::RefPtr<Context> retvalue = Glib::wrap(pango_layout_get_context(const_cast<PangoLayout*>(gobj())));
249
retvalue->reference(); //The function does not do a ref for us.
253
void Layout::set_attributes(AttrList& attrs)
255
pango_layout_set_attributes(gobj(), (attrs).gobj());
258
AttrList Layout::get_attributes() const
260
return AttrList((pango_layout_get_attributes(const_cast<PangoLayout*>(gobj()))));
263
Glib::ustring Layout::get_text() const
265
return Glib::convert_const_gchar_ptr_to_ustring(pango_layout_get_text(const_cast<PangoLayout*>(gobj())));
268
void Layout::set_font_description(const FontDescription& desc)
270
pango_layout_set_font_description(gobj(), (desc).gobj());
273
void Layout::set_width(int width)
275
pango_layout_set_width(gobj(), width);
278
int Layout::get_width() const
280
return pango_layout_get_width(const_cast<PangoLayout*>(gobj()));
283
void Layout::set_wrap(WrapMode wrap)
285
pango_layout_set_wrap(gobj(), ((PangoWrapMode)(wrap)));
288
WrapMode Layout::get_wrap() const
290
return ((WrapMode)(pango_layout_get_wrap(const_cast<PangoLayout*>(gobj()))));
293
void Layout::set_indent(int indent)
295
pango_layout_set_indent(gobj(), indent);
298
int Layout::get_indent() const
300
return pango_layout_get_indent(const_cast<PangoLayout*>(gobj()));
303
void Layout::set_spacing(int spacing)
305
pango_layout_set_spacing(gobj(), spacing);
308
int Layout::get_spacing() const
310
return pango_layout_get_spacing(const_cast<PangoLayout*>(gobj()));
313
void Layout::set_justify(bool justify)
315
pango_layout_set_justify(gobj(), static_cast<int>(justify));
318
bool Layout::get_justify() const
320
return pango_layout_get_justify(const_cast<PangoLayout*>(gobj()));
323
bool Layout::get_auto_dir() const
325
return pango_layout_get_auto_dir(const_cast<PangoLayout*>(gobj()));
328
void Layout::set_auto_dir(bool auto_dir)
330
pango_layout_set_auto_dir(gobj(), static_cast<int>(auto_dir));
333
void Layout::set_alignment(Alignment alignment)
335
pango_layout_set_alignment(gobj(), ((PangoAlignment)(alignment)));
338
Alignment Layout::get_alignment() const
340
return ((Alignment)(pango_layout_get_alignment(const_cast<PangoLayout*>(gobj()))));
343
void Layout::set_tabs(TabArray& tabs)
345
pango_layout_set_tabs(gobj(), (tabs).gobj());
348
TabArray Layout::get_tabs() const
350
return TabArray((pango_layout_get_tabs(const_cast<PangoLayout*>(gobj()))));
353
void Layout::set_single_paragraph_mode(bool setting)
355
pango_layout_set_single_paragraph_mode(gobj(), static_cast<int>(setting));
358
bool Layout::get_single_paragraph_mode() const
360
return pango_layout_get_single_paragraph_mode(const_cast<PangoLayout*>(gobj()));
363
void Layout::set_ellipsize(EllipsizeMode ellipsize)
365
pango_layout_set_ellipsize(gobj(), ((PangoEllipsizeMode)(ellipsize)));
368
EllipsizeMode Layout::get_ellipsize() const
370
return ((EllipsizeMode)(pango_layout_get_ellipsize(const_cast<PangoLayout*>(gobj()))));
373
void Layout::context_changed()
375
pango_layout_context_changed(gobj());
378
void Layout::get_cursor_pos(int index, Rectangle& strong_pos, Rectangle& weak_pos) const
380
pango_layout_get_cursor_pos(const_cast<PangoLayout*>(gobj()), index, (strong_pos).gobj(), (weak_pos).gobj());
383
void Layout::move_cursor_visually(bool strong, int old_index, int old_trailing, int direction, int& new_index, int& new_trailing) const
385
pango_layout_move_cursor_visually(const_cast<PangoLayout*>(gobj()), static_cast<int>(strong), old_index, old_trailing, direction, &new_index, &new_trailing);
388
bool Layout::xy_to_index(int x, int y, int& index, int& trailing) const
390
return pango_layout_xy_to_index(const_cast<PangoLayout*>(gobj()), x, y, &index, &trailing);
393
void Layout::get_extents(Rectangle& ink_rect, Rectangle& logical_rect) const
395
pango_layout_get_extents(const_cast<PangoLayout*>(gobj()), (ink_rect).gobj(), (logical_rect).gobj());
398
void Layout::get_pixel_extents(Rectangle& ink_rect, Rectangle& logical_rect) const
400
pango_layout_get_pixel_extents(const_cast<PangoLayout*>(gobj()), (ink_rect).gobj(), (logical_rect).gobj());
403
void Layout::get_size(int& width, int& height) const
405
pango_layout_get_size(const_cast<PangoLayout*>(gobj()), &width, &height);
408
void Layout::get_pixel_size(int& width, int& height) const
410
pango_layout_get_pixel_size(const_cast<PangoLayout*>(gobj()), &width, &height);
413
int Layout::get_line_count() const
415
return pango_layout_get_line_count(const_cast<PangoLayout*>(gobj()));
418
Glib::RefPtr<LayoutLine> Layout::get_line(int line)
421
Glib::RefPtr<LayoutLine> retvalue = Glib::wrap(pango_layout_get_line(gobj(), line));
424
retvalue->reference(); //The function does not do a ref for us.
428
Glib::RefPtr<const LayoutLine> Layout::get_line(int line) const
431
Glib::RefPtr<const LayoutLine> retvalue = Glib::wrap(pango_layout_get_line(const_cast<PangoLayout*>(gobj()), line));
434
retvalue->reference(); //The function does not do a ref for us.
438
SListHandle_LayoutLine Layout::get_lines()
440
return SListHandle_LayoutLine(pango_layout_get_lines(gobj()), Glib::OWNERSHIP_SHALLOW);
443
SListHandle_ConstLayoutLine Layout::get_lines() const
445
return SListHandle_ConstLayoutLine(pango_layout_get_lines(const_cast<PangoLayout*>(gobj())), Glib::OWNERSHIP_SHALLOW);