Debian Codegraph @

gtk/src/widgetpath.hg

raw
1 /* Copyright (C) 2010 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 #include <gtkmm/enums.h>
18 #include <vector>
19
20 _DEFS(gtkmm,gtk)
21
22
23 namespace Gtk
24 {
25
26 //TODO: Add all of the C documentation, including translating the code examples to C++.
27 /** This represents a widget hierarchy from the topmost widget, typically a toplevel, to any child.
28 * This widget path abstraction is used in StyleContext on behalf of the real
29 * widget in order to query style information.
30 *
31 * If you are using gtkmm widgets, you probably will not need to use
32 * this API directly, as there is Widget::get_path(), and the style
33 * context returned by Widget::get_style_context() will be automatically
34 * updated on widget hierarchy changes.
35 *
36 * @newin{3,0}
37 */
38 class GTKMM_API WidgetPath
39 {
40 _CLASS_BOXEDTYPE(WidgetPath, GtkWidgetPath, gtk_widget_path_new, gtk_widget_path_copy, gtk_widget_path_free, , , GTKMM_API)
41 _IGNORE(gtk_widget_path_new, gtk_widget_path_copy, gtk_widget_path_free)
42 public:
43
44 _WRAP_METHOD(Glib::ustring to_string() const, gtk_widget_path_to_string)
45 _WRAP_METHOD(int path_length() const, gtk_widget_path_length)
46
47 _WRAP_METHOD(int path_append_type(GType type), gtk_widget_path_append_type)
48 _WRAP_METHOD(void prepend_type(GType type), gtk_widget_path_prepend_type)
49
50 _WRAP_METHOD(GType iter_get_object_type(int pos) const, gtk_widget_path_iter_get_object_type)
51 _WRAP_METHOD(void iter_set_object_type(int pos, GType type), gtk_widget_path_iter_set_object_type)
52
53 _WRAP_METHOD(Glib::ustring iter_get_name(int pos) const, gtk_widget_path_iter_get_name)
54 _WRAP_METHOD(void iter_set_name(int pos, const Glib::ustring& name), gtk_widget_path_iter_set_name)
55 _WRAP_METHOD(bool iter_has_name(int pos, const Glib::ustring& name) const, gtk_widget_path_iter_has_name)
56 //TODO: _WRAP_METHOD(bool iter_has_qname(int pos, GQuark qname) const, gtk_widget_path_iter_has_qname)
57
58
59 _WRAP_METHOD(WidgetPath iter_get_siblings(int pos = -1) const, gtk_widget_path_iter_get_siblings)
60 _WRAP_METHOD(guint get_sibling_index(int pos = -1), gtk_widget_path_iter_get_sibling_index)
61
62 _WRAP_METHOD(void iter_add_class(int pos, const Glib::ustring& name), gtk_widget_path_iter_add_class)
63 _WRAP_METHOD(void iter_remove_class(int pos, const Glib::ustring& name), gtk_widget_path_iter_remove_class)
64 _WRAP_METHOD(void iter_clear_classes(int pos = -1), gtk_widget_path_iter_clear_classes)
65
66 #m4 _CONVERSION(`GSList*',`std::vector<Glib::ustring>',`Glib::SListHandler<Glib::ustring>::slist_to_vector($3, Glib::OWNERSHIP_SHALLOW)')
67 _WRAP_METHOD(std::vector<Glib::ustring> iter_list_classes(int pos = -1) const, gtk_widget_path_iter_list_classes)
68
69 _WRAP_METHOD(bool iter_has_class(int pos, const Glib::ustring& name) const, gtk_widget_path_iter_has_class)
70 //TODOL_WRAP_METHOD(bool iter_has_qclass(int pos, GQuark qname) const, gtk_widget_path_iter_has_qclass)
71
72 _WRAP_METHOD(void iter_add_region(int pos, const Glib::ustring& name, RegionFlags flags), gtk_widget_path_iter_add_region, deprecated "The use of regions is deprecated.")
73 _WRAP_METHOD(void iter_remove_region(int pos, const Glib::ustring& name), gtk_widget_path_iter_remove_region, deprecated "The use of regions is deprecated.")
74 _WRAP_METHOD(void iter_clear_regions(int pos = -1), gtk_widget_path_iter_clear_regions, deprecated "The use of regions is deprecated.")
75
76 _WRAP_METHOD(std::vector<Glib::ustring> iter_list_regions(int pos = -1) const, gtk_widget_path_iter_list_regions, deprecated "The use of regions is deprecated.")
77
78 _WRAP_METHOD(bool iter_has_region(int pos, const Glib::ustring& name, RegionFlags& flags) const, gtk_widget_path_iter_has_region, deprecated "The use of regions is deprecated.")
79 _IGNORE(gtk_widget_path_iter_has_qregion) //deprecated
80
81 _WRAP_METHOD(GType get_object_type() const, gtk_widget_path_get_object_type)
82
83 _WRAP_METHOD(bool is_type(GType type) const, gtk_widget_path_is_type)
84 _WRAP_METHOD(bool has_parent(GType type) const, gtk_widget_path_has_parent)
85
86 };
87
88 } //namespace Gtk