Debian Codegraph @

gtk/src/texttag.hg

raw
1 /* Copyright (C) 1998-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 Lesser General Public
5 * License as published by the Free Software Foundation; either
6 * version 2.1 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 * Lesser General Public License for more details.
12 *
13 * You should have received a copy of the GNU Lesser General Public
14 * License along with this library; if not, see <https://www.gnu.org/licenses/>.
15 */
16
17 _CONFIGINCLUDE(gtkmmconfig.h)
18
19 #include <glibmm/object.h>
20 #include <gtkmm/enums.h>
21 #ifndef GTKMM_DISABLE_DEPRECATED
22 #include <gdkmm/color.h>
23 #endif
24 #include <gdkmm/rgba.h>
25 #include <pangomm/fontdescription.h>
26 #include <pangomm/tabarray.h>
27
28 _DEFS(gtkmm,gtk)
29 _PINCLUDE(glibmm/private/object_p.h)
30 _PINCLUDE(gtk/gtk.h)
31
32 namespace Gtk
33 {
34
35 class GTKMM_API TextIter;
36
37 /** Typedefed as Gtk::TextBuffer::Tag.
38 *
39 * Text in a buffer can be marked with tags. A tag is an attribute that can be applied to some range of text. For example, a tag
40 * might be called "bold" and might make the text inside the tag bold. However, the tag concept is more general than that; tags don't
41 * have to affect appearance. They can instead affect the behavior of mouse and key presses, "lock" a range of text so the user
42 * can't edit it, or countless other things.
43 * One tag can be applied to any number of text ranges in any number of @link Gtk::TextBuffer Gtk::TextBuffers@endlink.
44 *
45 * Each tag is stored in a @link Gtk::TextTagTable Gtk::TextBuffer::TagTable@endlink, and Tags should be in the
46 * @link Gtk::TextTagTable Gtk::TextBuffer::TagTable@endlink for a given Gtk::TextBuffer before using
47 * them with that buffer.
48 *
49 * Tags can have names, which is convenient sometimes (for example, you can name your tag that makes things bold "bold"), but
50 * they can also be anonymous (which is convenient if you're creating tags on-the-fly).
51 *
52 * Gtk::TextBuffer::create_tag() is the best way to create tags. See the demo for numerous examples.
53 *
54 * @ingroup TextView
55 */
56 class GTKMM_API TextTag : public Glib::Object
57 {
58 _CLASS_GOBJECT(TextTag, GtkTextTag, GTK_TEXT_TAG, Glib::Object, GObject, , , GTKMM_API)
59 protected:
60 _CTOR_DEFAULT()
61 _WRAP_CTOR(TextTag(const Glib::ustring& name), gtk_text_tag_new)
62
63 public:
64 _WRAP_CREATE()
65 _WRAP_CREATE(const Glib::ustring& name)
66
67 _WRAP_METHOD(int get_priority() const, gtk_text_tag_get_priority)
68 _WRAP_METHOD(void set_priority(int priority), gtk_text_tag_set_priority)
69 _WRAP_METHOD(bool event(const Glib::RefPtr<Glib::Object>& event_object, GdkEvent* gdk_event, const TextIter& iter), gtk_text_tag_event)
70 _WRAP_METHOD(void tag_changed(bool size_changed), gtk_text_tag_changed)
71
72 #m4 _CONVERSION(`GObject*',`const Glib::RefPtr<Glib::Object>&',`Glib::wrap($3, true)')
73 _WRAP_SIGNAL(bool event(const Glib::RefPtr<Glib::Object>& event_object, GdkEvent* gdk_event, const TextIter& iter), "event")
74
75 _WRAP_PROPERTY("name", Glib::ustring) //construct-only.
76 _WRAP_PROPERTY("background", Glib::ustring)
77 _WRAP_PROPERTY("foreground", Glib::ustring)
78 _WRAP_PROPERTY("background-gdk", Gdk::Color, deprecated "Use property_background_rgba() instead.")
79 _WRAP_PROPERTY("background-rgba", Gdk::RGBA)
80 _WRAP_PROPERTY("foreground-gdk", Gdk::Color, deprecated "Use property_foreground_rgba() instead.")
81 _WRAP_PROPERTY("foreground-rgba", Gdk::RGBA)
82 _WRAP_PROPERTY("font", Glib::ustring)
83 _WRAP_PROPERTY("font-desc", Pango::FontDescription)
84 _WRAP_PROPERTY("family", Glib::ustring)
85 _WRAP_PROPERTY("style", Pango::Style)
86 _WRAP_PROPERTY("variant", Pango::Variant)
87 _WRAP_PROPERTY("weight", int)
88 _WRAP_PROPERTY("stretch", Pango::Stretch)
89 _WRAP_PROPERTY("size", int)
90 _WRAP_PROPERTY("size-points", double)
91 _WRAP_PROPERTY("scale", double)
92 _WRAP_PROPERTY("pixels-above-lines", int)
93 _WRAP_PROPERTY("pixels-below-lines", int)
94 _WRAP_PROPERTY("pixels-inside-wrap", int)
95 _WRAP_PROPERTY("editable", bool)
96 _WRAP_PROPERTY("wrap-mode", WrapMode)
97 _WRAP_PROPERTY("justification", Justification)
98 _WRAP_PROPERTY("direction", TextDirection)
99 _WRAP_PROPERTY("left-margin", int)
100 _WRAP_PROPERTY("indent", int)
101 _WRAP_PROPERTY("strikethrough", bool)
102 _WRAP_PROPERTY("strikethrough-rgba", Gdk::RGBA, newin "3,20")
103 _WRAP_PROPERTY("right-margin", int)
104 _WRAP_PROPERTY("underline", Pango::Underline)
105 _WRAP_PROPERTY("underline-rgba", Gdk::RGBA, newin "3,20")
106 _WRAP_PROPERTY("rise", int)
107 _WRAP_PROPERTY("background-full-height", bool)
108 _WRAP_PROPERTY("language", Glib::ustring)
109 _WRAP_PROPERTY("tabs", Pango::TabArray)
110 _WRAP_PROPERTY("invisible", bool)
111 _WRAP_PROPERTY("paragraph-background", Glib::ustring)
112 _WRAP_PROPERTY("paragraph-background-gdk", Gdk::Color, deprecated "Use property_paragraph_background_rgba() instead.")
113 _WRAP_PROPERTY("paragraph-background-rgba", Gdk::RGBA)
114 _WRAP_PROPERTY("font-features", Glib::ustring, newin "3,20")
115 _WRAP_PROPERTY("accumulative-margin", bool)
116 _WRAP_PROPERTY("background-set", bool)
117 _WRAP_PROPERTY("foreground-set", bool)
118 _WRAP_PROPERTY("family-set", bool)
119 _WRAP_PROPERTY("style-set", bool)
120 _WRAP_PROPERTY("variant-set", bool)
121 _WRAP_PROPERTY("weight-set", bool)
122 _WRAP_PROPERTY("stretch-set", bool)
123 _WRAP_PROPERTY("size-set", bool)
124 _WRAP_PROPERTY("scale-set", bool)
125 _WRAP_PROPERTY("pixels-above-lines-set", bool)
126 _WRAP_PROPERTY("pixels-below-lines-set", bool)
127 _WRAP_PROPERTY("pixels-inside-wrap-set", bool)
128 _WRAP_PROPERTY("editable-set", bool)
129 _WRAP_PROPERTY("wrap-mode-set", bool)
130 _WRAP_PROPERTY("justification-set", bool)
131 _WRAP_PROPERTY("left-margin-set", bool)
132 _WRAP_PROPERTY("indent-set", bool)
133 _WRAP_PROPERTY("strikethrough-set", bool)
134 _WRAP_PROPERTY("strikethrough-rgba-set", bool, newin "3,20")
135 _WRAP_PROPERTY("right-margin-set", bool)
136 _WRAP_PROPERTY("underline-set", bool)
137 _WRAP_PROPERTY("underline-rgba-set", bool, newin "3,20")
138 _WRAP_PROPERTY("rise-set", bool)
139 _WRAP_PROPERTY("background-full-height-set", bool)
140 _WRAP_PROPERTY("language-set", bool)
141 _WRAP_PROPERTY("tabs-set", bool)
142 _WRAP_PROPERTY("invisible-set", bool)
143 _WRAP_PROPERTY("paragraph-background-set", bool)
144 _WRAP_PROPERTY("fallback", bool)
145 _WRAP_PROPERTY("fallback-set", bool)
146 _WRAP_PROPERTY("letter-spacing", int)
147 _WRAP_PROPERTY("letter-spacing-set", bool)
148 _WRAP_PROPERTY("font-features-set", bool, newin "3,20")
149 };
150
151 } //namespace Gtk