/usr/share/gtk-doc/html/gladeui-2/widgetclasses.html is in glade 3.18.3-1.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 | <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Glade User Interface Designer Reference Manual: Widget Adaptor Definitions</title>
<meta name="generator" content="DocBook XSL Stylesheets V1.78.1">
<link rel="home" href="index.html" title="Glade User Interface Designer Reference Manual">
<link rel="up" href="catalog.html" title="Part I. Adding your custom widgets">
<link rel="prev" href="catalogintro.html" title="Introducing the Glade Catalog">
<link rel="next" href="properties.html" title="Property Class Definitions">
<meta name="generator" content="GTK-Doc V1.20 (XML mode)">
<link rel="stylesheet" href="style.css" type="text/css">
</head>
<body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF">
<table class="navigation" id="top" width="100%" summary="Navigation header" cellpadding="2" cellspacing="10"><tr valign="middle">
<td width="100%" align="left" class="shortcuts"></td>
<td><a accesskey="h" href="index.html"><img src="home.png" width="16" height="16" border="0" alt="Home"></a></td>
<td><a accesskey="u" href="catalog.html"><img src="up.png" width="16" height="16" border="0" alt="Up"></a></td>
<td><a accesskey="p" href="catalogintro.html"><img src="left.png" width="16" height="16" border="0" alt="Prev"></a></td>
<td><a accesskey="n" href="properties.html"><img src="right.png" width="16" height="16" border="0" alt="Next"></a></td>
</tr></table>
<div class="refentry">
<a name="widgetclasses"></a><div class="titlepage"></div>
<div class="refnamediv"><table width="100%"><tr>
<td valign="top">
<h2><span class="refentrytitle">Widget Adaptor Definitions</span></h2>
<p>Widget Classes —
Adding support for custom widgets
</p>
</td>
<td class="gallery_image" valign="top" align="right"></td>
</tr></table></div>
<div class="refsect1">
<a name="id-1.2.3.3"></a><h2>Forward</h2>
<p>
Widget support in Glade is provided by the <a class="link" href="gladeui-glade-widget-adaptor.html#GladeWidgetAdaptor"><span class="type">GladeWidgetAdaptor</span></a> object, each
`glade-widget-class' definition in the catalog will result in the creation
of an adaptor, which inherits the funcionality of the adaptor created for its
parent, or the closest adaptor available in the ancestry. Adaptor methods can
be overridden by functions in the plugin by specifying them in the catalog.
There is also a wealth of options you can use in the `glade-widget-class' without
writing code.
</p>
<p>
A typical basic example of a widget class definition is as follows:
</p>
<pre class="programlisting">
<glade-widget-class name="FooFrobnicator" generic-name="frobnicator" title="Frobnicator"/></pre>
<p>
</p>
<p>
Here is the complete example of the form of the `glade-widget-class' definition:
</p>
<pre class="programlisting">
<glade-widget-class name="FooFrobnicator" generic-name="frobnicator" title="Frobnicator"/>
<post-create-function>foo_frobnicator_plugin_post_create</post-create-function>
... widget class support functions go here
<properties>
<property id="frobnicated" default="False"/>
... property definitions go here
</properties>
<signals>
<signal id="frobnicate" since="1.0"/>
... signal definitions go here
</signals>
<packing-properties>
... child packing property definitions go here
</packing-properties>
<actions>
<action id="launch_editor" name="Edit Frob" stock="gtk-edit"/>
... context menu action definitions go here
</actions>
<packing-actions>
... context menu action definitions for child objects go here
</packing-actions>
<packing-defaults>
<parent-class name="GtkVBox">
<child-property id="expand" default="false"/>
</parent-class>
... packing default definitions go here
</packing-defaults>
</glade-widget-class></pre>
<p>
</p>
</div>
<div class="refsect1">
<a name="id-1.2.3.4"></a><h2>Widget Class Properties</h2>
<p>
The following are all properies of the `glade-widget-class' tag
</p>
<div class="variablelist"><table border="0" class="variablelist">
<colgroup>
<col align="left" valign="top">
<col>
</colgroup>
<tbody>
<tr>
<td><p><span class="term">name</span></p></td>
<td><p>
The class name of the widget; unless the 'get-type-function' property is present,
this will essentially be used to instantiate the actual class by deriving
'gtk_label_get_type' from 'GtkLabel' and searching for 'gtk_label_get_type' in the
support library.
</p></td>
</tr>
<tr>
<td><p><span class="term">since</span></p></td>
<td><p>
A 'major.minor' formed version describing the version of the owning catalog in which this
object class was introduced; example: <code class="literal">since="1.0"</code>.
</p></td>
</tr>
<tr>
<td><p><span class="term">deprecated</span></p></td>
<td><p>
A boolean property depicting that this widget is currently deprecated.
</p></td>
</tr>
<tr>
<td><p><span class="term">builder-unsupported</span></p></td>
<td><p>
A boolean property depicting that this widget is not supported by <a href="/usr/share/gtk-doc/html/gtk3/GtkBuilder.html"><span class="type">GtkBuilder</span></a>.
</p></td>
</tr>
<tr>
<td><p><span class="term">get-type-function</span></p></td>
<td><p>
Used to explicitly specify the name of the function used to get the type of the widget.
It is optional, but if it is not present, the 'name' property will be used to guess the
name of the function, a process that could lead to unexpected results.
</p></td>
</tr>
<tr>
<td><p><span class="term">generic-name</span></p></td>
<td><p>
Used to generate a default name for instances of the
widget in the UI editor. It is also used in conjunction with the 'icon-prefix'
to form an icon name for the widget.
</p></td>
</tr>
<tr>
<td><p><span class="term">icon-name</span></p></td>
<td><p>
Used to explicitly set an icon name for this widget.
These icon names are looked up in the current icon theme to retrieve an icon for
the widget.
</p></td>
</tr>
<tr>
<td><p><span class="term">title</span></p></td>
<td><p>
Used to display the name of the class in the palette and widget
tree and will be translated before use in the interface.
</p></td>
</tr>
<tr>
<td><p><span class="term">parent</span></p></td>
<td><p>
Use this to specify the name of the parent your widget derives from, you
can use this option instead of loading a real widget type (this allows you
to fake derive and still add properties and run your catalog independantly
of any plugins or libraries).
</p></td>
</tr>
<tr>
<td><p><span class="term">toplevel</span></p></td>
<td><p>
Used to know whether this widget class is toplevel or not
in Glade context. This property will be inherited from the adaptors parent.
</p></td>
</tr>
<tr>
<td><p><span class="term">fixed</span></p></td>
<td><p>
Used to mark a <span class="type">GladeWidgetClass</span> for free form placement capacities
to be handled with a <span class="type">GladeFixed</span>. This property will be inherited from the adaptors parent.
</p></td>
</tr>
<tr>
<td><p><span class="term">use-placeholders</span></p></td>
<td><p>
Used to inform the core about adaptors that implement
<a href="/usr/share/gtk-doc/html/gtk3/GtkContainer.html"><span class="type">GtkContainer</span></a> editing, and whether or not they use <a class="link" href="GladePlaceholder.html" title="GladePlaceholder"><span class="type">GladePlaceholder</span></a>. This property will
be inherited from the adaptors parent.
</p></td>
</tr>
<tr>
<td><p><span class="term">default-width</span></p></td>
<td><p>
The default width to load a <a href="/usr/share/gtk-doc/html/gtk3/GtkWindow.html"><span class="type">GtkWindow</span></a> derived widget in the <a class="link" href="GladeDesignView.html" title="GladeDesignView"><span class="type">GladeDesignView</span></a>.
This property will be inherited from the adaptors parent.
</p></td>
</tr>
<tr>
<td><p><span class="term">default-height</span></p></td>
<td><p>
The default height to load a <a href="/usr/share/gtk-doc/html/gtk3/GtkWindow.html"><span class="type">GtkWindow</span></a> derived widget in the <a class="link" href="GladeDesignView.html" title="GladeDesignView"><span class="type">GladeDesignView</span></a>.
This property will be inherited from the adaptors parent.
</p></td>
</tr>
</tbody>
</table></div>
</div>
<div class="refsect1">
<a name="id-1.2.3.5"></a><h2>Adapter Methods</h2>
<p>
The following are all child tags of the `glade-widget-class' tag
</p>
<div class="variablelist"><table border="0" class="variablelist">
<colgroup>
<col align="left" valign="top">
<col>
</colgroup>
<tbody>
<tr>
<td><p><span class="term">constructor-function</span></p></td>
<td><p>
Used to override the actual <a href="/usr/share/gtk-doc/html/gobject/gobject-The-Base-Object-Type.html#GObject"><span class="type">GObject</span></a> constructor of the said <a class="link" href="gladeui-glade-widget-adaptor.html#GladeWidgetAdaptor"><span class="type">GladeWidgetAdaptor</span></a>
</p></td>
</tr>
<tr>
<td><p><span class="term">post-create-function</span></p></td>
<td><p>
A <a class="link" href="gladeui-glade-widget-adaptor.html#GladePostCreateFunc" title="GladePostCreateFunc ()"><span class="type">GladePostCreateFunc</span></a> support function that gets called whenever a widget of the said class is instantiated.
</p></td>
</tr>
<tr>
<td><p><span class="term">deep-post-create-function</span></p></td>
<td><p>
Same as `post-create-function' except in that you must always chain up
to the super class definition as a rule.
</p></td>
</tr>
<tr>
<td><p><span class="term">get-property-function</span></p></td>
<td><p>
A <a class="link" href="gladeui-glade-widget-adaptor.html#GladeGetPropertyFunc" title="GladeGetPropertyFunc ()"><span class="type">GladeGetPropertyFunc</span></a> to get values of properties on an instance in the
runtime.
</p></td>
</tr>
<tr>
<td><p><span class="term">set-property-function</span></p></td>
<td><p>
A <a class="link" href="gladeui-glade-widget-adaptor.html#GladeSetPropertyFunc" title="GladeSetPropertyFunc ()"><span class="type">GladeSetPropertyFunc</span></a> to set values of properties on an instance in the
runtime.
</p></td>
</tr>
<tr>
<td><p><span class="term">verify-function</span></p></td>
<td><p>
A <a class="link" href="gladeui-glade-widget-adaptor.html#GladeVerifyPropertyFunc" title="GladeVerifyPropertyFunc ()"><span class="type">GladeVerifyPropertyFunc</span></a> to set values of properties on an instance in the
runtime.
</p></td>
</tr>
<tr>
<td><p><span class="term">add-child-function</span></p></td>
<td><p>
A <a class="link" href="gladeui-glade-widget-adaptor.html#GladeAddChildFunc" title="GladeAddChildFunc ()"><span class="type">GladeAddChildFunc</span></a> to add children to instances in the runtime.
</p></td>
</tr>
<tr>
<td><p><span class="term">remove-child-function</span></p></td>
<td><p>
A <a class="link" href="gladeui-glade-widget-adaptor.html#GladeRemoveChildFunc" title="GladeRemoveChildFunc ()"><span class="type">GladeRemoveChildFunc</span></a> to remove children from instances in the runtime.
</p></td>
</tr>
<tr>
<td><p><span class="term">replace-child-function</span></p></td>
<td><p>
A <a class="link" href="gladeui-glade-widget-adaptor.html#GladeReplaceChildFunc" title="GladeReplaceChildFunc ()"><span class="type">GladeReplaceChildFunc</span></a> to replace children inside instances in the runtime.
</p></td>
</tr>
<tr>
<td><p><span class="term">get-children-function</span></p></td>
<td><p>
A <a class="link" href="gladeui-glade-widget-adaptor.html#GladeGetChildrenFunc" title="GladeGetChildrenFunc ()"><span class="type">GladeGetChildrenFunc</span></a> to get a list of children inside instances in the runtime.
</p></td>
</tr>
<tr>
<td><p><span class="term">child-get-property-function</span></p></td>
<td><p>
A <a class="link" href="gladeui-glade-widget-adaptor.html#GladeChildGetPropertyFunc" title="GladeChildGetPropertyFunc ()"><span class="type">GladeChildGetPropertyFunc</span></a> to get packing properties from instances in the runtime.
</p></td>
</tr>
<tr>
<td><p><span class="term">child-set-property-function</span></p></td>
<td><p>
A <a class="link" href="gladeui-glade-widget-adaptor.html#GladeChildSetPropertyFunc" title="GladeChildSetPropertyFunc ()"><span class="type">GladeChildSetPropertyFunc</span></a> to set packing properties on instances in the runtime.
</p></td>
</tr>
<tr>
<td><p><span class="term">child-verify-function</span></p></td>
<td><p>
A <a class="link" href="gladeui-glade-widget-adaptor.html#GladeChildVerifyPropertyFunc" title="GladeChildVerifyPropertyFunc ()"><span class="type">GladeChildVerifyPropertyFunc</span></a> to verify packing properties on instances in the runtime.
</p></td>
</tr>
<tr>
<td><p><span class="term">get-internal-child-function</span></p></td>
<td><p>
A <a class="link" href="gladeui-glade-widget-adaptor.html#GladeGetInternalFunc" title="GladeGetInternalFunc ()"><span class="type">GladeGetInternalFunc</span></a> to retrieve an internal child of a composite object in the runtime.
</p></td>
</tr>
<tr>
<td><p><span class="term">action-activate-function</span></p></td>
<td><p>
A <a class="link" href="gladeui-glade-widget-adaptor.html#GladeActionActivateFunc" title="GladeActionActivateFunc ()"><span class="type">GladeActionActivateFunc</span></a> to run a routine for a plugin defined <a class="link" href="GladeWidgetAction.html" title="GladeWidgetAction"><span class="type">GladeWidgetAction</span></a>.
</p></td>
</tr>
<tr>
<td><p><span class="term">child-action-activate-function</span></p></td>
<td><p>
A <a class="link" href="gladeui-glade-widget-adaptor.html#GladeChildActionActivateFunc" title="GladeChildActionActivateFunc ()"><span class="type">GladeChildActionActivateFunc</span></a> to run a routine for a plugin defined packing <a class="link" href="GladeWidgetAction.html" title="GladeWidgetAction"><span class="type">GladeWidgetAction</span></a>.
</p></td>
</tr>
<tr>
<td><p><span class="term">read-widget-function</span></p></td>
<td><p>
A <a class="link" href="gladeui-glade-widget-adaptor.html#GladeReadWidgetFunc" title="GladeReadWidgetFunc ()"><span class="type">GladeReadWidgetFunc</span></a> to load a widget from the xml.
</p></td>
</tr>
<tr>
<td><p><span class="term">write-widget-function</span></p></td>
<td><p>
A <a class="link" href="gladeui-glade-widget-adaptor.html#GladeWriteWidgetFunc" title="GladeWriteWidgetFunc ()"><span class="type">GladeWriteWidgetFunc</span></a> to write a widget from the xml.
</p></td>
</tr>
<tr>
<td><p><span class="term">read-child-function</span></p></td>
<td><p>
A <a class="link" href="gladeui-glade-widget-adaptor.html#GladeReadWidgetFunc" title="GladeReadWidgetFunc ()"><span class="type">GladeReadWidgetFunc</span></a> to read a child to the xml.
</p></td>
</tr>
<tr>
<td><p><span class="term">write-child-function</span></p></td>
<td><p>
A <a class="link" href="gladeui-glade-widget-adaptor.html#GladeWriteWidgetFunc" title="GladeWriteWidgetFunc ()"><span class="type">GladeWriteWidgetFunc</span></a> to write a child to the xml.
</p></td>
</tr>
<tr>
<td><p><span class="term">create-editor-property-function</span></p></td>
<td><p>
A <a class="link" href="gladeui-glade-widget-adaptor.html#GladeCreateEPropFunc" title="GladeCreateEPropFunc ()"><span class="type">GladeCreateEPropFunc</span></a> to create widgets to be used in Glade's property editor.
</p></td>
</tr>
<tr>
<td><p><span class="term">string-from-value-function</span></p></td>
<td><p>
A <a class="link" href="gladeui-glade-widget-adaptor.html#GladeStringFromValueFunc" title="GladeStringFromValueFunc ()"><span class="type">GladeStringFromValueFunc</span></a> to create a string from a <a href="/usr/share/gtk-doc/html/gobject/gobject-Generic-values.html#GValue"><span class="type">GValue</span></a>, these strings must
be unique and comparable for undo/redo to work properly.
</p></td>
</tr>
</tbody>
</table></div>
</div>
<div class="refsect1">
<a name="id-1.2.3.6"></a><h2>Action Definitions</h2>
<p>
Actions are added under the `actions' and `packing-actions' tags, actions can also
be nested so as to allow grouping in context menus, example:
</p>
<pre class="programlisting">
...
<action id="manage_frobs" name="Manage Frobs">
<action id="add_frob" name="Add" stock="gtk-add"/>
<action id="remove_frob" name="Remove" stock="gtk-remove"/>
</action>
...</pre>
<p>
</p>
<p>
Here are the meanings of the `action' tag's properties:
</p>
<div class="variablelist"><table border="0" class="variablelist">
<colgroup>
<col align="left" valign="top">
<col>
</colgroup>
<tbody>
<tr>
<td><p><span class="term">id</span></p></td>
<td><p>
The string identifier for this action, the action_path argument to your <a class="link" href="gladeui-glade-widget-adaptor.html#GladeActionActivateFunc" title="GladeActionActivateFunc ()"><span class="type">GladeActionActivateFunc</span></a>
will be a combination if this id and any parents, for the above example:
<code class="literal">"manage_frobs/add_frob"</code>.
</p></td>
</tr>
<tr>
<td><p><span class="term">name</span></p></td>
<td><p>
A string to be displayed in the UI for this action.
</p></td>
</tr>
<tr>
<td><p><span class="term">stock</span></p></td>
<td><p>
An optional Gtk stock icon to represent this action.
</p></td>
</tr>
<tr>
<td><p><span class="term">important</span></p></td>
<td><p>
A boolean option to add emphasis to this action; currently actions marked as `important'
are added to the toolbar.
</p></td>
</tr>
</tbody>
</table></div>
</div>
<div class="refsect1">
<a name="id-1.2.3.7"></a><h2>Packing Defaults</h2>
<p>
Default values can be specified for packing properties on your widget when added
to a said type of parent, as the example shows above; use the `parent-class' to
specify what parent (or derivative of that parent) you are targetting and fill
in any `child-property' tags you need for that parent using `id' property to
specify the property name and the `default' property for the value.
</p>
</div>
<div class="refsect1">
<a name="id-1.2.3.8"></a><h2>Signals</h2>
<p>
The signal elements are currently only needed for versioning support, use
the `signal' child tag as described above and set signal `id' to be supported
since version `since'. Signals are initialized to be supported since the
introducing <a class="link" href="gladeui-glade-widget-adaptor.html#GladeWidgetAdaptor"><span class="type">GladeWidgetAdaptor</span></a> was supported.
</p>
</div>
<div class="refsect1">
<a name="id-1.2.3.9"></a><h2>Icons</h2>
<p>
The Glade palette and other components use icons to represent the various widget classes.
It is a good idea to provide icons for your widget classes, as this
enhances the user interface.
</p>
<p>
Glade uses the GTK+ GtkIconTheme facility to provide icons for widget classes. Any icon
available in the current icon theme can be used as an icon for a widget class.
</p>
<p>
By default, an icon name of the format "widget-CATALOG_NAME-GENERIC_NAME"
is assigned to every widget class. CATALOG_NAME is the value of catalog name attribute,
and GENERIC_NAME is the value of an widget class's generic name attribute.
</p>
<p>
To explicity set an icon name for a widget class, the "icon-name" attribute of the
"glade-widget-class" element can be specified. This will override the default icon
name assigned to the widget class.
</p>
<p>
Icon files can be installed under any system icon theme folder.
</p>
</div>
</div>
<div class="footer">
<hr>
Generated by GTK-Doc V1.20</div>
</body>
</html>
|