| 1 | /* GTK - The GIMP Toolkit |
| 2 | * Copyright (C) 2006-2007 Async Open Source, |
| 3 | * Johan Dahlin <[email protected]> |
| 4 | * |
| 5 | * This library is free software; you can redistribute it and/or |
| 6 | * modify it under the terms of the GNU Library General Public |
| 7 | * License as published by the Free Software Foundation; either |
| 8 | * version 2 of the License, or (at your option) any later version. |
| 9 | * |
| 10 | * This library is distributed in the hope that it will be useful, |
| 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
| 13 | * Library General Public License for more details. |
| 14 | * |
| 15 | * You should have received a copy of the GNU Library General Public |
| 16 | * License along with this library. If not, see <http://www.gnu.org/licenses/>. |
| 17 | */ |
| 18 | |
| 19 | #pragma once |
| 20 | |
| 21 | #if !defined (__GTK_H_INSIDE__cxx . . $ `gtk/gtk.h:27:9`!) && !defined (GTK_COMPILATIONcxx . . $ `<built-in>:420:9`!) |
| 22 | #error "Only <gtk/gtk.h> can be included directly." |
| 23 | #endif |
| 24 | |
| 25 | #include <gtk/gtkbuilder.h>cxx . . $ `<file>/gtk/gtkbuilder.h`/ |
| 26 | |
| 27 | G_BEGIN_DECLScxx . . $ `<external>/12741050725406041920/gmacros.h:947:9`! |
| 28 | |
| 29 | #define GTK_TYPE_BUILDABLEcxx . . $ `gtk/gtkbuildable.h:29:9`! (gtk_buildable_get_type ()) |
| 30 | #define GTK_BUILDABLEcxx . . $ `gtk/gtkbuildable.h:30:9`!(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GTK_TYPE_BUILDABLE, GtkBuildable)) |
| 31 | #define GTK_IS_BUILDABLEcxx . . $ `gtk/gtkbuildable.h:31:9`!(obj) (G_TYPE_CHECK_INSTANCE_TYPEcxx . . $ `<external>/9567554376676449156/gtype.h:541:9`! ((obj), GTK_TYPE_BUILDABLEcxx . . $ `gtk/gtkbuildable.h:29:9`!)) |
| 32 | #define GTK_BUILDABLE_GET_IFACEcxx . . $ `gtk/gtkbuildable.h:32:9`!(obj) (G_TYPE_INSTANCE_GET_INTERFACEcxx . . $ `<external>/9567554376676449156/gtype.h:584:9`! ((obj), GTK_TYPE_BUILDABLEcxx . . $ `gtk/gtkbuildable.h:29:9`!, GtkBuildableIface)) |
| 33 | |
| 34 | typedef struct _GtkBuildablecxx . . $ _GtkBuildable# GtkBuildablecxx . . $ GtkBuildable#; /* Dummy typedef */ |
| 35 | typedef struct _GtkBuildableIfacecxx . . $ _GtkBuildableIface# GtkBuildableIfacecxx . . $ GtkBuildableIface#; |
| 36 | |
| 37 | typedef struct _GtkBuildableParseContextcxx . . $ _GtkBuildableParseContext# GtkBuildableParseContextcxx . . $ GtkBuildableParseContext#; |
| 38 | typedef struct _GtkBuildableParsercxx . . $ _GtkBuildableParser# GtkBuildableParsercxx . . $ GtkBuildableParser#; |
| 39 | |
| 40 | /** |
| 41 | * GtkBuildableParseContext: |
| 42 | * |
| 43 | * Provides context for parsing GtkBuilder UI files. |
| 44 | * |
| 45 | * `GtkBuildableParseContext` is an opaque struct. |
| 46 | */ |
| 47 | |
| 48 | /** |
| 49 | * GtkBuildableParser: |
| 50 | * @start_element: function called for open elements |
| 51 | * @end_element: function called for close elements |
| 52 | * @text: function called for character data |
| 53 | * @error: function called on error |
| 54 | * |
| 55 | * A sub-parser for `GtkBuildable` implementations. |
| 56 | */ |
| 57 | struct _GtkBuildableParsercxx . . $ _GtkBuildableParser# |
| 58 | { |
| 59 | /* Called for open tags <foo bar="baz"> */ |
| 60 | void (*start_elementcxx . . $ _GtkBuildableParser#start_element.) (GtkBuildableParseContextcxx . . $ GtkBuildableParseContext# *context, |
| 61 | const char *element_name, |
| 62 | const char **attribute_names, |
| 63 | const char **attribute_values, |
| 64 | gpointercxx . . $ gpointer# user_data, |
| 65 | GErrorcxx . . $ GError# **error); |
| 66 | |
| 67 | /* Called for close tags </foo> */ |
| 68 | void (*end_elementcxx . . $ _GtkBuildableParser#end_element.) (GtkBuildableParseContextcxx . . $ GtkBuildableParseContext# *context, |
| 69 | const char *element_name, |
| 70 | gpointercxx . . $ gpointer# user_data, |
| 71 | GErrorcxx . . $ GError# **error); |
| 72 | |
| 73 | /* Called for character data */ |
| 74 | /* text is not nul-terminated */ |
| 75 | void (*textcxx . . $ _GtkBuildableParser#text.) (GtkBuildableParseContextcxx . . $ GtkBuildableParseContext# *context, |
| 76 | const char *text, |
| 77 | gsizecxx . . $ gsize# text_len, |
| 78 | gpointercxx . . $ gpointer# user_data, |
| 79 | GErrorcxx . . $ GError# **error); |
| 80 | |
| 81 | /* Called on error, including one set by other |
| 82 | * methods in the vtable. The GError should not be freed. |
| 83 | */ |
| 84 | void (*errorcxx . . $ _GtkBuildableParser#error.) (GtkBuildableParseContextcxx . . $ GtkBuildableParseContext# *context, |
| 85 | GErrorcxx . . $ GError# *error, |
| 86 | gpointercxx . . $ gpointer# user_data); |
| 87 | |
| 88 | /*< private >*/ |
| 89 | gpointercxx . . $ gpointer# paddingcxx . . $ _GtkBuildableParser#padding.[4]; |
| 90 | }; |
| 91 | |
| 92 | /** |
| 93 | * GtkBuildableIface: |
| 94 | * @g_iface: the parent class |
| 95 | * @set_id: Stores the id attribute given in the `GtkBuilder` UI definition. |
| 96 | * `GtkWidget` stores the name as object data. Implement this method if your |
| 97 | * object has some notion of “ID” and it makes sense to map the XML id |
| 98 | * attribute to it. |
| 99 | * @get_id: The getter corresponding to @set_id. Implement this |
| 100 | * if you implement @set_id. |
| 101 | * @add_child: Adds a child. The @type parameter can be used to |
| 102 | * differentiate the kind of child. `GtkWidget` implements this |
| 103 | * to add event controllers to the widget, `GtkNotebook` uses |
| 104 | * the @type to distinguish between page labels (of type "page-label") |
| 105 | * and normal children. |
| 106 | * @set_buildable_property: Sets a property of a buildable object. |
| 107 | * It is normally not necessary to implement this, g_object_set_property() |
| 108 | * is used by default. `GtkWindow` implements this to delay showing itself |
| 109 | * (i.e. setting the [[email protected]:visible] property) until the whole |
| 110 | * interface is created. |
| 111 | * @construct_child: Constructs a child of a buildable that has been |
| 112 | * specified as “constructor” in the UI definition. This can be used to |
| 113 | * reference a widget created in a `<ui>` tag which is outside |
| 114 | * of the normal GtkBuilder UI definition hierarchy. A reference to the |
| 115 | * constructed object is returned and becomes owned by the caller. |
| 116 | * @custom_tag_start: Implement this if the buildable needs to parse |
| 117 | * content below `<child>`. To handle an element, the implementation |
| 118 | * must fill in the @parser and @user_data and return %TRUE. |
| 119 | * `GtkWidget` implements this to parse accessible attributes specified |
| 120 | * in `<accessibility>` elements. |
| 121 | * Note that @user_data must be freed in @custom_tag_end or @custom_finished. |
| 122 | * @custom_tag_end: Called for the end tag of each custom element that is |
| 123 | * handled by the buildable (see @custom_tag_start). |
| 124 | * @custom_finished: Called for each custom tag handled by the buildable |
| 125 | * when the builder finishes parsing (see @custom_tag_start) |
| 126 | * @parser_finished: Called when a builder finishes the parsing |
| 127 | * of a UI definition. It is normally not necessary to implement this, |
| 128 | * unless you need to perform special cleanup actions. `GtkWindow` sets |
| 129 | * the `GtkWidget:visible` property here. |
| 130 | * @get_internal_child: Returns an internal child of a buildable. |
| 131 | * `GtkDialog` implements this to give access to its @vbox, making |
| 132 | * it possible to add children to the vbox in a UI definition. |
| 133 | * Implement this if the buildable has internal children that may |
| 134 | * need to be accessed from a UI definition. |
| 135 | * |
| 136 | * Contains methods to let `GtkBuilder` construct an object from |
| 137 | * a `GtkBuilder` UI definition. |
| 138 | */ |
| 139 | struct _GtkBuildableIfacecxx . . $ _GtkBuildableIface# |
| 140 | { |
| 141 | GTypeInterfacecxx . . $ GTypeInterface# g_ifacecxx . . $ _GtkBuildableIface#g_iface.; |
| 142 | |
| 143 | /* virtual table */ |
| 144 | void (* set_idcxx . . $ _GtkBuildableIface#set_id.) (GtkBuildablecxx . . $ GtkBuildable# *buildable, |
| 145 | const char *id); |
| 146 | const char * (* get_idcxx . . $ _GtkBuildableIface#get_id.) (GtkBuildablecxx . . $ GtkBuildable# *buildable); |
| 147 | |
| 148 | /** |
| 149 | * GtkBuildableIface::add_child: |
| 150 | * @buildable: a `GtkBuildable` |
| 151 | * @builder: a `GtkBuilder` |
| 152 | * @child: child to add |
| 153 | * @type: (nullable): kind of child or %NULL |
| 154 | * |
| 155 | * Adds a child to @buildable. @type is an optional string |
| 156 | * describing how the child should be added. |
| 157 | */ |
| 158 | void (* add_childcxx . . $ _GtkBuildableIface#add_child.) (GtkBuildablecxx . . $ GtkBuildable# *buildable, |
| 159 | GtkBuildercxx . . $ GtkBuilder# *builder, |
| 160 | GObjectcxx . . $ GObject# *child, |
| 161 | const char *type); |
| 162 | void (* set_buildable_propertycxx . . $ _GtkBuildableIface#set_buildable_property.) (GtkBuildablecxx . . $ GtkBuildable# *buildable, |
| 163 | GtkBuildercxx . . $ GtkBuilder# *builder, |
| 164 | const char *name, |
| 165 | const GValuecxx . . $ GValue# *value); |
| 166 | GObjectcxx . . $ GObject# * (* construct_childcxx . . $ _GtkBuildableIface#construct_child.) (GtkBuildablecxx . . $ GtkBuildable# *buildable, |
| 167 | GtkBuildercxx . . $ GtkBuilder# *builder, |
| 168 | const char *name); |
| 169 | |
| 170 | /** |
| 171 | * GtkBuildableIface::custom_tag_start: |
| 172 | * @buildable: a `GtkBuildable` |
| 173 | * @builder: a `GtkBuilder` used to construct this object |
| 174 | * @child: (nullable): child object or %NULL for non-child tags |
| 175 | * @tagname: name of tag |
| 176 | * @parser: (out): a `GtkBuildableParser` to fill in |
| 177 | * @data: (out): return location for user data that will be passed in |
| 178 | * to parser functions |
| 179 | * |
| 180 | * Called for each unknown element under `<child>`. |
| 181 | * |
| 182 | * Returns: %TRUE if an object has a custom implementation, %FALSE |
| 183 | * if it doesn't. |
| 184 | */ |
| 185 | gbooleancxx . . $ gboolean# (* custom_tag_startcxx . . $ _GtkBuildableIface#custom_tag_start.) (GtkBuildablecxx . . $ GtkBuildable# *buildable, |
| 186 | GtkBuildercxx . . $ GtkBuilder# *builder, |
| 187 | GObjectcxx . . $ GObject# *child, |
| 188 | const char *tagname, |
| 189 | GtkBuildableParsercxx . . $ GtkBuildableParser# *parser, |
| 190 | gpointercxx . . $ gpointer# *data); |
| 191 | /** |
| 192 | * GtkBuildableIface::custom_tag_end: |
| 193 | * @buildable: A `GtkBuildable` |
| 194 | * @builder: `GtkBuilder` used to construct this object |
| 195 | * @child: (nullable): child object or %NULL for non-child tags |
| 196 | * @tagname: name of tag |
| 197 | * @data: user data that will be passed in to parser functions |
| 198 | * |
| 199 | * Called at the end of each custom element handled by |
| 200 | * the buildable. |
| 201 | */ |
| 202 | void (* custom_tag_endcxx . . $ _GtkBuildableIface#custom_tag_end.) (GtkBuildablecxx . . $ GtkBuildable# *buildable, |
| 203 | GtkBuildercxx . . $ GtkBuilder# *builder, |
| 204 | GObjectcxx . . $ GObject# *child, |
| 205 | const char *tagname, |
| 206 | gpointercxx . . $ gpointer# data); |
| 207 | /** |
| 208 | * GtkBuildableIface::custom_finished: |
| 209 | * @buildable: a `GtkBuildable` |
| 210 | * @builder: a `GtkBuilder` |
| 211 | * @child: (nullable): child object or %NULL for non-child tags |
| 212 | * @tagname: the name of the tag |
| 213 | * @data: user data created in custom_tag_start |
| 214 | * |
| 215 | * Similar to gtk_buildable_parser_finished() but is |
| 216 | * called once for each custom tag handled by the @buildable. |
| 217 | */ |
| 218 | void (* custom_finishedcxx . . $ _GtkBuildableIface#custom_finished.) (GtkBuildablecxx . . $ GtkBuildable# *buildable, |
| 219 | GtkBuildercxx . . $ GtkBuilder# *builder, |
| 220 | GObjectcxx . . $ GObject# *child, |
| 221 | const char *tagname, |
| 222 | gpointercxx . . $ gpointer# data); |
| 223 | void (* parser_finishedcxx . . $ _GtkBuildableIface#parser_finished.) (GtkBuildablecxx . . $ GtkBuildable# *buildable, |
| 224 | GtkBuildercxx . . $ GtkBuilder# *builder); |
| 225 | |
| 226 | /** |
| 227 | * GtkBuildableIface::get_internal_child: |
| 228 | * @buildable: a `GtkBuildable` |
| 229 | * @builder: a `GtkBuilder` |
| 230 | * @childname: name of child |
| 231 | * |
| 232 | * Retrieves the internal child called @childname of the @buildable object. |
| 233 | * |
| 234 | * Returns: (transfer none): the internal child of the buildable object |
| 235 | */ |
| 236 | GObjectcxx . . $ GObject# * (* get_internal_childcxx . . $ _GtkBuildableIface#get_internal_child.) (GtkBuildablecxx . . $ GtkBuildable# *buildable, |
| 237 | GtkBuildercxx . . $ GtkBuilder# *builder, |
| 238 | const char *childname); |
| 239 | }; |
| 240 | |
| 241 | |
| 242 | GDK_AVAILABLE_IN_ALLcxx . . $ `build/gdk/version/gdk-visibility.h:22:9`! |
| 243 | GTypecxx . . $ GType# gtk_buildable_get_typecxx . . $ gtk_buildable_get_type(f708dce9a8856c70). (void) G_GNUC_CONSTcxx . . $ `<external>/12741050725406041920/gmacros.h:640:9`!; |
| 244 | |
| 245 | GDK_AVAILABLE_IN_ALLcxx . . $ `build/gdk/version/gdk-visibility.h:22:9`! |
| 246 | const char * gtk_buildable_get_buildable_idcxx . . $ gtk_buildable_get_buildable_id(1d04ccb54531edbe). (GtkBuildablecxx . . $ GtkBuildable# *buildable); |
| 247 | |
| 248 | GDK_AVAILABLE_IN_ALLcxx . . $ `build/gdk/version/gdk-visibility.h:22:9`! |
| 249 | void gtk_buildable_parse_context_pushcxx . . $ gtk_buildable_parse_context_push(2829247e7537960e). (GtkBuildableParseContextcxx . . $ GtkBuildableParseContext# *context, |
| 250 | const GtkBuildableParsercxx . . $ GtkBuildableParser# *parser, |
| 251 | gpointercxx . . $ gpointer# user_data); |
| 252 | GDK_AVAILABLE_IN_ALLcxx . . $ `build/gdk/version/gdk-visibility.h:22:9`! |
| 253 | gpointercxx . . $ gpointer# gtk_buildable_parse_context_popcxx . . $ gtk_buildable_parse_context_pop(7d95a9b1c6e56e05). (GtkBuildableParseContextcxx . . $ GtkBuildableParseContext# *context); |
| 254 | GDK_AVAILABLE_IN_ALLcxx . . $ `build/gdk/version/gdk-visibility.h:22:9`! |
| 255 | const char * gtk_buildable_parse_context_get_elementcxx . . $ gtk_buildable_parse_context_get_element(4cf06b2abbd859b6). (GtkBuildableParseContextcxx . . $ GtkBuildableParseContext# *context); |
| 256 | GDK_AVAILABLE_IN_ALLcxx . . $ `build/gdk/version/gdk-visibility.h:22:9`! |
| 257 | GPtrArraycxx . . $ GPtrArray# *gtk_buildable_parse_context_get_element_stackcxx . . $ gtk_buildable_parse_context_get_element_stack(c968bbf1c4d98579). (GtkBuildableParseContextcxx . . $ GtkBuildableParseContext# *context); |
| 258 | GDK_AVAILABLE_IN_ALLcxx . . $ `build/gdk/version/gdk-visibility.h:22:9`! |
| 259 | void gtk_buildable_parse_context_get_positioncxx . . $ gtk_buildable_parse_context_get_position(cfc09d4d1c1f94ab). (GtkBuildableParseContextcxx . . $ GtkBuildableParseContext# *context, |
| 260 | int *line_number, |
| 261 | int *char_number); |
| 262 | |
| 263 | G_DEFINE_AUTOPTR_CLEANUP_FUNCcxx . . $ glib_autoptr_destroy_GtkBuildable(5d22bdacc48458e8).(GtkBuildable, g_object_unref) |
| 264 | |
| 265 | G_END_DECLScxx . . $ `<external>/12741050725406041920/gmacros.h:948:9`! |
| 266 |