1 // Generated by gmmproc 2.49.5 -- DO NOT MODIFY!
2 #ifndef _PANGOMM_LAYOUTRUN_H
3 #define _PANGOMM_LAYOUTRUN_H
4
5
6 #include <glibmm/ustring.h>
7 #include <sigc++/sigc++.h>
8
9 /* layoutrun.h
10 *
11 * Copyright (C) 1998-1999 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 Lesser General Public
15 * License as published by the Free Software Foundation; either
16 * version 2.1 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 * Lesser General Public License for more details.
22 *
23 * You should have received a copy of the GNU Lesser 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 <pangomm/attributes.h> //For LogAttr.
29 #include <pango/pango-layout.h>
30
31
32 #ifndef DOXYGEN_SHOULD_SKIP_THIS
33 extern "C" { typedef struct _PangoGlyphItem PangoGlyphItem; }
34 #endif
35
36 namespace Pango
37 {
38
39 class Item;
40 class GlyphString;
41 class LayoutRun;
42
43 /** A Pango::GlyphItem is a pair of a Pango::Items and the glyphs resulting from shaping the text corresponding to an item.
44 * As an example of the usage of Pango::GlyphItem, the results of shaping text with Pango::Layout is a list of Pango::LayoutLine,
45 * each of which contains a list of Pango::GlyphItem.
46 */
47 typedef LayoutRun GlyphItem;
48
49 //TODO: Change this to just GlyphItem when we can break API/ABI.
50
51 /** A Pango::LayoutRun represents a single run within a LayoutLine.
52 * It is simply an alternate name for GlyphItem.
53 */
54 class LayoutRun
55 {
56 public:
57 #ifndef DOXYGEN_SHOULD_SKIP_THIS
58 using CppObjectType = LayoutRun;
59 using BaseObjectType = PangoGlyphItem;
60 #endif /* DOXYGEN_SHOULD_SKIP_THIS */
61
62 /** Get the GType for this class, for use with the underlying GObject type system.
63 */
64 static GType get_type() G_GNUC_CONST;
65
66 LayoutRun();
67
68 explicit LayoutRun(PangoGlyphItem* gobject, bool make_a_copy = true);
69
70 LayoutRun(const LayoutRun& other);
71 LayoutRun& operator=(const LayoutRun& other);
72
73 LayoutRun(LayoutRun&& other) noexcept;
74 LayoutRun& operator=(LayoutRun&& other) noexcept;
75
76 ~LayoutRun() noexcept;
77
78 void swap(LayoutRun& other) noexcept;
79
80 ///Provides access to the underlying C instance.
gobj()81 PangoGlyphItem* gobj() { return gobject_; }
82
83 ///Provides access to the underlying C instance.
gobj()84 const PangoGlyphItem* gobj() const { return gobject_; }
85
86 ///Provides access to the underlying C instance. The caller is responsible for freeing it. Use when directly setting fields in structs.
87 PangoGlyphItem* gobj_copy() const;
88
89 protected:
90 PangoGlyphItem* gobject_;
91
92 private:
93
94
95 /** Modifies @a orig to cover only the text after @a split_index, and
96 * returns a new item that covers the text before @a split_index that
97 * used to be in @a orig. You can think of @a split_index as the length of
98 * the returned item. @a split_index may not be 0, and it may not be
99 * greater than or equal to the length of @a orig (that is, there must
100 * be at least one byte assigned to each item, you can't create a
101 * zero-length item).
102 *
103 * This function is similar in function to Pango::Item::split() (and uses
104 * it internally.)
105 *
106 * @newin{1,2}
107 *
108 * @param text Text to which positions in @a orig apply.
109 * @param split_index Byte index of position to split item, relative to the start of the item.
110 * @return The newly allocated item representing text before
111 * @a split_index, which should be freed
112 * with free().
113 */
114 GlyphItem split(const Glib::ustring& text, int split_index);
115
116 //This takes ownership of the GlyphItem, which is strange: _WRAP_METHOD(GSList* apply_attrs(const Glib::ustring& text, const AttrList& list), pango_glyph_item_apply_attrs)
117
118 /** Adds spacing between the graphemes of @a glyph_item to
119 * give the effect of typographic letter spacing.
120 *
121 * @newin{1,6}
122 *
123 * @param text Text that @a glyph_item corresponds to
124 * (glyph_item->item->offset is an offset from the
125 * start of @a text).
126 * @param log_attrs Logical attributes for the item
127 * (the first logical attribute refers to the position
128 * before the first character in the item).
129 * @param letter_spacing Amount of letter spacing to add
130 * in Pango units. May be negative, though too large
131 * negative values will give ugly results.
132 */
133 void letter_space(const Glib::ustring& text, const LogAttr& log_attrs, int letter_spacing = 0);
134
135 /** Gets the Pango::Item object that provides information about the segment of text in this run.
136 * @return A Pango::Item object.
137 */
138 Item get_item() const;
139
140 /** Gets the string of glyphs obtained by shaping the text for this item.
141 * @return A Pango::GlyphString object.
142 */
143 GlyphString get_glyphs() const;
144
145
146 };
147
148 } /* namespace Pango */
149
150
151 namespace Pango
152 {
153
154 /** @relates Pango::LayoutRun
155 * @param lhs The left-hand side
156 * @param rhs The right-hand side
157 */
swap(LayoutRun & lhs,LayoutRun & rhs)158 inline void swap(LayoutRun& lhs, LayoutRun& rhs) noexcept
159 { lhs.swap(rhs); }
160
161 } // namespace Pango
162
163 namespace Glib
164 {
165
166 /** A Glib::wrap() method for this object.
167 *
168 * @param object The C instance.
169 * @param take_copy False if the result should take ownership of the C instance. True if it should take a new copy or ref.
170 * @result A C++ instance that wraps this C instance.
171 *
172 * @relates Pango::LayoutRun
173 */
174 Pango::LayoutRun wrap(PangoGlyphItem* object, bool take_copy = false);
175
176 #ifndef DOXYGEN_SHOULD_SKIP_THIS
177 template <>
178 class Value<Pango::LayoutRun> : public Glib::Value_Boxed<Pango::LayoutRun>
179 {};
180 #endif /* DOXYGEN_SHOULD_SKIP_THIS */
181
182 } // namespace Glib
183
184
185 #endif /* _PANGOMM_LAYOUTRUN_H */
186
187