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 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 576 577 578 579 580 581 582 583 584 585 586 587 588 589 590 591 592 593 594 595 596 597 598 599 600 601 602 603 604 605
|
<?xml version="1.0"?>
<!DOCTYPE refentry PUBLIC "-//OASIS//DTD DocBook XML V4.1.2//EN"
"http://www.oasis-open.org/docbook/xml/4.1.2/docbookx.dtd">
<refentry id="libglade-Libglade-Build">
<refmeta>
<refentrytitle>Libglade Build</refentrytitle>
<manvolnum>3</manvolnum>
<refmiscinfo>LIBGLADE Library</refmiscinfo>
</refmeta>
<refnamediv>
<refname>Libglade Build</refname><refpurpose>Routines used by widget building routines</refpurpose>
</refnamediv>
<refsynopsisdiv><title>Synopsis</title>
<synopsis>
#include <glade/glade.h>
#include <glade/glade-build.h>
<link linkend="GtkWidget">GtkWidget</link>* (<link linkend="GladeNewFunc">*GladeNewFunc</link>) (<link linkend="GladeXML">GladeXML</link> *xml,
<link linkend="GType">GType</link> widget_type,
<link linkend="GladeWidgetInfo">GladeWidgetInfo</link> *info);
<link linkend="void">void</link> (<link linkend="GladeBuildChildrenFunc">*GladeBuildChildrenFunc</link>) (<link linkend="GladeXML">GladeXML</link> *xml,
<link linkend="GtkWidget">GtkWidget</link> *parent,
<link linkend="GladeWidgetInfo">GladeWidgetInfo</link> *info);
<link linkend="GtkWidget">GtkWidget</link>* (<link linkend="GladeFindInternalChildFunc">*GladeFindInternalChildFunc</link>) (<link linkend="GladeXML">GladeXML</link> *xml,
<link linkend="GtkWidget">GtkWidget</link> *parent,
const <link linkend="gchar">gchar</link> *childname);
<link linkend="GtkWidget">GtkWidget</link>* <link linkend="glade-xml-build-widget">glade_xml_build_widget</link> (<link linkend="GladeXML">GladeXML</link> *self,
<link linkend="GladeWidgetInfo">GladeWidgetInfo</link> *info);
<link linkend="void">void</link> <link linkend="glade-xml-handle-internal-child">glade_xml_handle_internal_child</link> (<link linkend="GladeXML">GladeXML</link> *self,
<link linkend="GtkWidget">GtkWidget</link> *parent,
<link linkend="GladeChildInfo">GladeChildInfo</link> *child_info);
<link linkend="void">void</link> <link linkend="glade-xml-set-common-params">glade_xml_set_common_params</link> (<link linkend="GladeXML">GladeXML</link> *self,
<link linkend="GtkWidget">GtkWidget</link> *widget,
<link linkend="GladeWidgetInfo">GladeWidgetInfo</link> *info);
<link linkend="void">void</link> <link linkend="glade-register-widget">glade_register_widget</link> (<link linkend="GType">GType</link> type,
<link linkend="GladeNewFunc">GladeNewFunc</link> new_func,
<link linkend="GladeBuildChildrenFunc">GladeBuildChildrenFunc</link> build_children,
<link linkend="GladeFindInternalChildFunc">GladeFindInternalChildFunc</link> find_internal_child);
<link linkend="GtkWidget">GtkWidget</link>* <link linkend="glade-standard-build-widget">glade_standard_build_widget</link> (<link linkend="GladeXML">GladeXML</link> *xml,
<link linkend="GType">GType</link> widget_type,
<link linkend="GladeWidgetInfo">GladeWidgetInfo</link> *info);
<link linkend="void">void</link> <link linkend="glade-xml-handle-widget-prop">glade_xml_handle_widget_prop</link> (<link linkend="GladeXML">GladeXML</link> *self,
<link linkend="GtkWidget">GtkWidget</link> *widget,
const <link linkend="gchar">gchar</link> *prop_name,
const <link linkend="gchar">gchar</link> *value_name);
<link linkend="void">void</link> <link linkend="glade-standard-build-children">glade_standard_build_children</link> (<link linkend="GladeXML">GladeXML</link> *self,
<link linkend="GtkWidget">GtkWidget</link> *parent,
<link linkend="GladeWidgetInfo">GladeWidgetInfo</link> *info);
<link linkend="void">void</link> <link linkend="glade-xml-set-packing-property">glade_xml_set_packing_property</link> (<link linkend="GladeXML">GladeXML</link> *self,
<link linkend="GtkWidget">GtkWidget</link> *parent,
<link linkend="GtkWidget">GtkWidget</link> *child,
const <link linkend="char">char</link> *name,
const <link linkend="char">char</link> *value);
<link linkend="void">void</link> (<link linkend="GladeApplyCustomPropFunc">*GladeApplyCustomPropFunc</link>) (<link linkend="GladeXML">GladeXML</link> *xml,
<link linkend="GtkWidget">GtkWidget</link> *widget,
const <link linkend="gchar">gchar</link> *propname,
const <link linkend="gchar">gchar</link> *value);
<link linkend="void">void</link> <link linkend="glade-register-custom-prop">glade_register_custom_prop</link> (<link linkend="GType">GType</link> type,
const <link linkend="gchar">gchar</link> *prop_name,
<link linkend="GladeApplyCustomPropFunc">GladeApplyCustomPropFunc</link> apply_prop);
<link linkend="gchar">gchar</link>* <link linkend="glade-xml-relative-file">glade_xml_relative_file</link> (<link linkend="GladeXML">GladeXML</link> *self,
const <link linkend="gchar">gchar</link> *filename);
<link linkend="gint">gint</link> <link linkend="glade-enum-from-string">glade_enum_from_string</link> (<link linkend="GType">GType</link> type,
const <link linkend="char">char</link> *string);
<link linkend="guint">guint</link> <link linkend="glade-flags-from-string">glade_flags_from_string</link> (<link linkend="GType">GType</link> type,
const <link linkend="char">char</link> *string);
<link linkend="gboolean">gboolean</link> <link linkend="glade-xml-set-value-from-string">glade_xml_set_value_from_string</link> (<link linkend="GladeXML">GladeXML</link> *xml,
<link linkend="GParamSpec">GParamSpec</link> *pspec,
const <link linkend="gchar">gchar</link> *string,
<link linkend="GValue">GValue</link> *value);
<link linkend="void">void</link> <link linkend="glade-xml-set-toplevel">glade_xml_set_toplevel</link> (<link linkend="GladeXML">GladeXML</link> *xml,
<link linkend="GtkWindow">GtkWindow</link> *window);
<link linkend="GtkAccelGroup">GtkAccelGroup</link>* <link linkend="glade-xml-ensure-accel">glade_xml_ensure_accel</link> (<link linkend="GladeXML">GladeXML</link> *xml);
#define <link linkend="GLADE-MODULE-CHECK-INIT:CAPS">GLADE_MODULE_CHECK_INIT</link>
</synopsis>
</refsynopsisdiv>
<refsect1>
<title>Description</title>
<para>
These functions are used by the routines that are responsible for building
the actual widgets from the XML node data structures.
</para>
</refsect1>
<refsect1>
<title>Details</title>
<refsect2>
<title><anchor id="GladeNewFunc"/>GladeNewFunc ()</title>
<indexterm><primary>GladeNewFunc</primary></indexterm><programlisting><link linkend="GtkWidget">GtkWidget</link>* (*GladeNewFunc) (<link linkend="GladeXML">GladeXML</link> *xml,
<link linkend="GType">GType</link> widget_type,
<link linkend="GladeWidgetInfo">GladeWidgetInfo</link> *info);</programlisting>
<para>
This function signature should be used by functions that build particular
widget types. The function should create the new widget and set any non
standard widget parameters (ie. don't set visibility, size, etc), as
this is handled by glade_xml_build_widget, which calls these functions.</para>
<para>
</para><variablelist role="params">
<varlistentry><term><parameter>xml</parameter> :</term>
<listitem><simpara> The GladeXML object.
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>widget_type</parameter> :</term>
<listitem><simpara> the GType code of the widget.
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>info</parameter> :</term>
<listitem><simpara> the GladeWidgetInfo structure for this widget.
</simpara></listitem></varlistentry>
<varlistentry><term><emphasis>Returns</emphasis> :</term><listitem><simpara> the new widget.
</simpara></listitem></varlistentry>
</variablelist></refsect2>
<refsect2>
<title><anchor id="GladeBuildChildrenFunc"/>GladeBuildChildrenFunc ()</title>
<indexterm><primary>GladeBuildChildrenFunc</primary></indexterm><programlisting><link linkend="void">void</link> (*GladeBuildChildrenFunc) (<link linkend="GladeXML">GladeXML</link> *xml,
<link linkend="GtkWidget">GtkWidget</link> *parent,
<link linkend="GladeWidgetInfo">GladeWidgetInfo</link> *info);</programlisting>
<para>
This function signature should be used by functions that are responsible
for adding children to a container widget. To create each child widget,
glade_xml_build_widget should be called.</para>
<para>
</para><variablelist role="params">
<varlistentry><term><parameter>xml</parameter> :</term>
<listitem><simpara> the GladeXML object.
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>parent</parameter> :</term>
<listitem><simpara> the parent.
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>info</parameter> :</term>
<listitem><simpara> the GladeWidgetInfo structure for the parent.
</simpara></listitem></varlistentry>
</variablelist></refsect2>
<refsect2>
<title><anchor id="GladeFindInternalChildFunc"/>GladeFindInternalChildFunc ()</title>
<indexterm><primary>GladeFindInternalChildFunc</primary></indexterm><programlisting><link linkend="GtkWidget">GtkWidget</link>* (*GladeFindInternalChildFunc) (<link linkend="GladeXML">GladeXML</link> *xml,
<link linkend="GtkWidget">GtkWidget</link> *parent,
const <link linkend="gchar">gchar</link> *childname);</programlisting>
<para>
When some composite widgets are created, a number of children are
added at the same time (for example, the vbox in a GtkDialog).
These widgets are identified in the XML interface file by the
internal-child attribute on their &lt;child&gt; element.
</para>
<para>
When libglade encounters an internal child, rather than creating a
new widget instance, libglade walks up the tree until it finds the
first non internal-child parent. It then calls the
find_internal_child callback for that parent's class.
</para>
<para>
That callback should return the internal child corresponding to the
name passed in as the third argument.</para>
<para>
</para><variablelist role="params">
<varlistentry><term><parameter>xml</parameter> :</term>
<listitem><simpara> the GladeXML object.
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>parent</parameter> :</term>
<listitem><simpara> the parent widget.
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>childname</parameter> :</term>
<listitem><simpara> the name of the internal child
</simpara></listitem></varlistentry>
<varlistentry><term><emphasis>Returns</emphasis> :</term><listitem><simpara> the named internal child.
</simpara></listitem></varlistentry>
</variablelist></refsect2>
<refsect2>
<title><anchor id="glade-xml-build-widget"/>glade_xml_build_widget ()</title>
<indexterm><primary>glade_xml_build_widget</primary></indexterm><programlisting><link linkend="GtkWidget">GtkWidget</link>* glade_xml_build_widget (<link linkend="GladeXML">GladeXML</link> *self,
<link linkend="GladeWidgetInfo">GladeWidgetInfo</link> *info);</programlisting>
<para>
This function is not intended for people who just use libglade. Instead
it is for people extending it (it is designed to be called in the child
build routine defined for the parent widget). It first checks the type
of the widget from the class tag, then calls the corresponding widget
creation routine. This routine sets up all the settings specific to that
type of widget. Then general widget settings are performed on the widget.
Then it sets up accelerators for the widget, and extracts any signal
information for the widget. Then it checks to see if there are any
child widget nodes for this widget, and if so calls the widget's
build routine, which will create the children with this function and add
them to the widget in the appropriate way. Finally it returns the widget.</para>
<para>
</para><variablelist role="params">
<varlistentry><term><parameter>self</parameter> :</term>
<listitem><simpara> the GladeXML object.
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>info</parameter> :</term>
<listitem><simpara> the GladeWidgetInfo structure for the widget.
</simpara></listitem></varlistentry>
<varlistentry><term><emphasis>Returns</emphasis> :</term><listitem><simpara> the newly created widget.
</simpara></listitem></varlistentry>
</variablelist></refsect2>
<refsect2>
<title><anchor id="glade-xml-handle-internal-child"/>glade_xml_handle_internal_child ()</title>
<indexterm><primary>glade_xml_handle_internal_child</primary></indexterm><programlisting><link linkend="void">void</link> glade_xml_handle_internal_child (<link linkend="GladeXML">GladeXML</link> *self,
<link linkend="GtkWidget">GtkWidget</link> *parent,
<link linkend="GladeChildInfo">GladeChildInfo</link> *child_info);</programlisting>
<para>
This function is intended to be called by the build_children
callback for container widgets. If the build_children callback
encounters a child with the internal-child attribute set, then it
should call this function to handle it and then continue on to the
next child.</para>
<para>
</para><variablelist role="params">
<varlistentry><term><parameter>self</parameter> :</term>
<listitem><simpara> the GladeXML object.
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>parent</parameter> :</term>
<listitem><simpara> the parent widget.
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>child_info</parameter> :</term>
<listitem><simpara> the GladeChildInfo structure for the child.
</simpara></listitem></varlistentry>
</variablelist></refsect2>
<refsect2>
<title><anchor id="glade-xml-set-common-params"/>glade_xml_set_common_params ()</title>
<indexterm><primary>glade_xml_set_common_params</primary></indexterm><programlisting><link linkend="void">void</link> glade_xml_set_common_params (<link linkend="GladeXML">GladeXML</link> *self,
<link linkend="GtkWidget">GtkWidget</link> *widget,
<link linkend="GladeWidgetInfo">GladeWidgetInfo</link> *info);</programlisting>
<para>
This function sets the common parameters on a widget, and is responsible
for inserting it into the GladeXML object's internal structures. It will
also add the children to this widget. Usually this function is only called
by glade_xml_build_widget, but is exposed for difficult cases, such as
setting up toolbar buttons and the like.</para>
<para>
</para><variablelist role="params">
<varlistentry><term><parameter>self</parameter> :</term>
<listitem><simpara> the GladeXML widget.
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>widget</parameter> :</term>
<listitem><simpara> the widget to set parameters on.
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>info</parameter> :</term>
<listitem><simpara> the GladeWidgetInfo structure for the widget.
</simpara></listitem></varlistentry>
</variablelist></refsect2>
<refsect2>
<title><anchor id="glade-register-widget"/>glade_register_widget ()</title>
<indexterm><primary>glade_register_widget</primary></indexterm><programlisting><link linkend="void">void</link> glade_register_widget (<link linkend="GType">GType</link> type,
<link linkend="GladeNewFunc">GladeNewFunc</link> new_func,
<link linkend="GladeBuildChildrenFunc">GladeBuildChildrenFunc</link> build_children,
<link linkend="GladeFindInternalChildFunc">GladeFindInternalChildFunc</link> find_internal_child);</programlisting>
<para>
This function is used to register new construction functions for a
widget type. The child building routine would call
<link linkend="glade-xml-build-widget"><function>glade_xml_build_widget()</function></link> on each child node to create the child
before packing it.
</para>
<para>
This function is mainly useful for addon widget modules for libglade
(it would get called from the <link linkend="glade-init-module"><function>glade_init_module()</function></link> function).</para>
<para>
</para><variablelist role="params">
<varlistentry><term><parameter>type</parameter> :</term>
<listitem><simpara> the GType of the widget.
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>new_func</parameter> :</term>
<listitem><simpara> the function used to construct instances of the widget.
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>build_children</parameter> :</term>
<listitem><simpara> function used to construct children (or NULL).
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>find_internal_child</parameter> :</term>
<listitem><simpara> function to find internal children (or NULL).
</simpara></listitem></varlistentry>
</variablelist></refsect2>
<refsect2>
<title><anchor id="glade-standard-build-widget"/>glade_standard_build_widget ()</title>
<indexterm><primary>glade_standard_build_widget</primary></indexterm><programlisting><link linkend="GtkWidget">GtkWidget</link>* glade_standard_build_widget (<link linkend="GladeXML">GladeXML</link> *xml,
<link linkend="GType">GType</link> widget_type,
<link linkend="GladeWidgetInfo">GladeWidgetInfo</link> *info);</programlisting>
<para>
This is the standard widget building function. It processes all
the widget properties using the standard object properties
interfaces. This function will be sufficient for most widget
types, thus reducing the ammount of work needed to wrap a library.</para>
<para>
</para><variablelist role="params">
<varlistentry><term><parameter>xml</parameter> :</term>
<listitem><simpara> the GladeXML object.
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>widget_type</parameter> :</term>
<listitem><simpara> the GType of the widget.
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>info</parameter> :</term>
<listitem><simpara> the GladeWidgetInfo structure.
</simpara></listitem></varlistentry>
<varlistentry><term><emphasis>Returns</emphasis> :</term><listitem><simpara> the constructed widget.
</simpara></listitem></varlistentry>
</variablelist></refsect2>
<refsect2>
<title><anchor id="glade-xml-handle-widget-prop"/>glade_xml_handle_widget_prop ()</title>
<indexterm><primary>glade_xml_handle_widget_prop</primary></indexterm><programlisting><link linkend="void">void</link> glade_xml_handle_widget_prop (<link linkend="GladeXML">GladeXML</link> *self,
<link linkend="GtkWidget">GtkWidget</link> *widget,
const <link linkend="gchar">gchar</link> *prop_name,
const <link linkend="gchar">gchar</link> *value_name);</programlisting>
<para>
Some widgets have properties of type GtkWidget. These are
represented as the widget name in the glade file. When
constructing the interface, the widget specified as the value for a
property may not exist yet.
</para>
<para>
Rather than setting the property directly, this function should be
used. It will perform the name to GtkWidget conversion, and if the
widget is yet to be constructed, defer setting the property until
the widget is constructed.</para>
<para>
</para><variablelist role="params">
<varlistentry><term><parameter>self</parameter> :</term>
<listitem><simpara> the GladeXML object
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>widget</parameter> :</term>
<listitem><simpara> the property the widget to set the property on.
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>prop_name</parameter> :</term>
<listitem><simpara> the name of the property.
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>value_name</parameter> :</term>
<listitem><simpara> the name of the widget used as the value for the property.
</simpara></listitem></varlistentry>
</variablelist></refsect2>
<refsect2>
<title><anchor id="glade-standard-build-children"/>glade_standard_build_children ()</title>
<indexterm><primary>glade_standard_build_children</primary></indexterm><programlisting><link linkend="void">void</link> glade_standard_build_children (<link linkend="GladeXML">GladeXML</link> *self,
<link linkend="GtkWidget">GtkWidget</link> *parent,
<link linkend="GladeWidgetInfo">GladeWidgetInfo</link> *info);</programlisting>
<para>
This is the standard child building function. It simply calls
gtk_container_add on each child to add them to the parent, and
process any packing properties using the generic container packing
properties interfaces.
</para>
<para>
This function will be sufficient for most container widgets
provided that they implement the GtkContainer child packing
properties interfaces.</para>
<para>
</para><variablelist role="params">
<varlistentry><term><parameter>self</parameter> :</term>
<listitem><simpara> the GladeXML object.
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>parent</parameter> :</term>
<listitem><simpara> the container widget.
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>info</parameter> :</term>
<listitem><simpara> the GladeWidgetInfo structure.
</simpara></listitem></varlistentry>
</variablelist></refsect2>
<refsect2>
<title><anchor id="glade-xml-set-packing-property"/>glade_xml_set_packing_property ()</title>
<indexterm><primary>glade_xml_set_packing_property</primary></indexterm><programlisting><link linkend="void">void</link> glade_xml_set_packing_property (<link linkend="GladeXML">GladeXML</link> *self,
<link linkend="GtkWidget">GtkWidget</link> *parent,
<link linkend="GtkWidget">GtkWidget</link> *child,
const <link linkend="char">char</link> *name,
const <link linkend="char">char</link> *value);</programlisting>
<para>
This sets the packing property on container <parameter>parent</parameter> of widget
<parameter>child</parameter> with <parameter>name</parameter> to <parameter>value</parameter></para>
<para>
</para><variablelist role="params">
<varlistentry><term><parameter>self</parameter> :</term>
<listitem><simpara> the GladeXML object.
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>parent</parameter> :</term>
<listitem><simpara> the container widget.
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>child</parameter> :</term>
<listitem><simpara> the contained child
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>name</parameter> :</term>
<listitem><simpara> the name of the property
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>value</parameter> :</term>
<listitem><simpara> it's stringified value
</simpara></listitem></varlistentry>
</variablelist></refsect2>
<refsect2>
<title><anchor id="GladeApplyCustomPropFunc"/>GladeApplyCustomPropFunc ()</title>
<indexterm><primary>GladeApplyCustomPropFunc</primary></indexterm><programlisting><link linkend="void">void</link> (*GladeApplyCustomPropFunc) (<link linkend="GladeXML">GladeXML</link> *xml,
<link linkend="GtkWidget">GtkWidget</link> *widget,
const <link linkend="gchar">gchar</link> *propname,
const <link linkend="gchar">gchar</link> *value);</programlisting>
<para>
This prototype is used for custom property handlers registered with
<link linkend="glade-register-custom-prop"><function>glade_register_custom_prop()</function></link>.</para>
<para>
</para><variablelist role="params">
<varlistentry><term><parameter>xml</parameter> :</term>
<listitem><simpara> the GladeXML object.
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>widget</parameter> :</term>
<listitem><simpara> the widget to apply the property to.
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>propname</parameter> :</term>
<listitem><simpara> the name of the property.
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>value</parameter> :</term>
<listitem><simpara> the value of the property.
</simpara></listitem></varlistentry>
</variablelist></refsect2>
<refsect2>
<title><anchor id="glade-register-custom-prop"/>glade_register_custom_prop ()</title>
<indexterm><primary>glade_register_custom_prop</primary></indexterm><programlisting><link linkend="void">void</link> glade_register_custom_prop (<link linkend="GType">GType</link> type,
const <link linkend="gchar">gchar</link> *prop_name,
<link linkend="GladeApplyCustomPropFunc">GladeApplyCustomPropFunc</link> apply_prop);</programlisting>
<para>
Some properties are not (yet) handled through the GObject property
code, so can not be handled by the generic code. This function
provides a way to register handlers for these properties. Such
handlers will apply for the GType <parameter>type</parameter> and all its descendants.</para>
<para>
</para><variablelist role="params">
<varlistentry><term><parameter>type</parameter> :</term>
<listitem><simpara> the GType of the widget.
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>prop_name</parameter> :</term>
<listitem><simpara> the name for the custom widget.
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>apply_prop</parameter> :</term>
<listitem><simpara> the function to be called when the custom property is found.
</simpara></listitem></varlistentry>
</variablelist></refsect2>
<refsect2>
<title><anchor id="glade-xml-relative-file"/>glade_xml_relative_file ()</title>
<indexterm><primary>glade_xml_relative_file</primary></indexterm><programlisting><link linkend="gchar">gchar</link>* glade_xml_relative_file (<link linkend="GladeXML">GladeXML</link> *self,
const <link linkend="gchar">gchar</link> *filename);</programlisting>
<para>
This function resolves a relative pathname, using the directory of the
XML file as a base. If the pathname is absolute, then the original
filename is returned.</para>
<para>
</para><variablelist role="params">
<varlistentry><term><parameter>self</parameter> :</term>
<listitem><simpara> the GladeXML object.
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>filename</parameter> :</term>
<listitem><simpara> the filename.
</simpara></listitem></varlistentry>
<varlistentry><term><emphasis>Returns</emphasis> :</term><listitem><simpara> the filename. The result must be g_free'd.
</simpara></listitem></varlistentry>
</variablelist></refsect2>
<refsect2>
<title><anchor id="glade-enum-from-string"/>glade_enum_from_string ()</title>
<indexterm><primary>glade_enum_from_string</primary></indexterm><programlisting><link linkend="gint">gint</link> glade_enum_from_string (<link linkend="GType">GType</link> type,
const <link linkend="char">char</link> *string);</programlisting>
<para>
This helper routine is designed to be used by widget build routines to
convert the string representations of enumeration values found in the
XML descriptions to the integer values that can be used to configure
the widget.</para>
<para>
</para><variablelist role="params">
<varlistentry><term><parameter>type</parameter> :</term>
<listitem><simpara> the GType for this enum type.
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>string</parameter> :</term>
<listitem><simpara> the string representation of the enum value.
</simpara></listitem></varlistentry>
<varlistentry><term><emphasis>Returns</emphasis> :</term><listitem><simpara> the integer value for this enumeration, or 0 if it couldn't be
found.
</simpara></listitem></varlistentry>
</variablelist></refsect2>
<refsect2>
<title><anchor id="glade-flags-from-string"/>glade_flags_from_string ()</title>
<indexterm><primary>glade_flags_from_string</primary></indexterm><programlisting><link linkend="guint">guint</link> glade_flags_from_string (<link linkend="GType">GType</link> type,
const <link linkend="char">char</link> *string);</programlisting>
<para>
This helper routine is designed to be used by widget build routines
to convert the string representations of flags values found in the
XML descriptions to the integer values that can be used to
configure the widget. The string is composed of string names or
nicknames for various flags separated by '|'.</para>
<para>
</para><variablelist role="params">
<varlistentry><term><parameter>type</parameter> :</term>
<listitem><simpara> the GType for this flags type.
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>string</parameter> :</term>
<listitem><simpara> the string representation of the flags value.
</simpara></listitem></varlistentry>
<varlistentry><term><emphasis>Returns</emphasis> :</term><listitem><simpara> the integer value for this flags string
</simpara></listitem></varlistentry>
</variablelist></refsect2>
<refsect2>
<title><anchor id="glade-xml-set-value-from-string"/>glade_xml_set_value_from_string ()</title>
<indexterm><primary>glade_xml_set_value_from_string</primary></indexterm><programlisting><link linkend="gboolean">gboolean</link> glade_xml_set_value_from_string (<link linkend="GladeXML">GladeXML</link> *xml,
<link linkend="GParamSpec">GParamSpec</link> *pspec,
const <link linkend="gchar">gchar</link> *string,
<link linkend="GValue">GValue</link> *value);</programlisting>
<para>
This function demarshals a value from a string. This function
calls <link linkend="g-value-init"><function>g_value_init()</function></link> on the <parameter>value</parameter> argument, so it need not be
initialised beforehand.
</para>
<para>
This function can handle char, uchar, boolean, int, uint, long,
ulong, enum, flags, float, double, string, GdkColor and
GtkAdjustment type values. Support for GtkWidget type values is
still to come.</para>
<para>
</para><variablelist role="params">
<varlistentry><term><parameter>xml</parameter> :</term>
<listitem><simpara> the GladeXML object.
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>pspec</parameter> :</term>
<listitem><simpara> the GParamSpec for the property
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>string</parameter> :</term>
<listitem><simpara> the string representation of the value.
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>value</parameter> :</term>
<listitem><simpara> the GValue to store the result in.
</simpara></listitem></varlistentry>
<varlistentry><term><emphasis>Returns</emphasis> :</term><listitem><simpara> <literal>TRUE</literal> on success.
</simpara></listitem></varlistentry>
</variablelist></refsect2>
<refsect2>
<title><anchor id="glade-xml-set-toplevel"/>glade_xml_set_toplevel ()</title>
<indexterm><primary>glade_xml_set_toplevel</primary></indexterm><programlisting><link linkend="void">void</link> glade_xml_set_toplevel (<link linkend="GladeXML">GladeXML</link> *xml,
<link linkend="GtkWindow">GtkWindow</link> *window);</programlisting>
<para>
This is used while the tree is being built to set the toplevel window that
is currently being built. It is mainly used to enable GtkAccelGroup's to
be bound to the correct window, but could have other uses.</para>
<para>
</para><variablelist role="params">
<varlistentry><term><parameter>xml</parameter> :</term>
<listitem><simpara> the GladeXML object.
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>window</parameter> :</term>
<listitem><simpara> the toplevel.
</simpara></listitem></varlistentry>
</variablelist></refsect2>
<refsect2>
<title><anchor id="glade-xml-ensure-accel"/>glade_xml_ensure_accel ()</title>
<indexterm><primary>glade_xml_ensure_accel</primary></indexterm><programlisting><link linkend="GtkAccelGroup">GtkAccelGroup</link>* glade_xml_ensure_accel (<link linkend="GladeXML">GladeXML</link> *xml);</programlisting>
<para>
This function is used to get the current GtkAccelGroup. If there isn't
one, a new one is created and bound to the current toplevel window (if
a toplevel has been set).</para>
<para>
</para><variablelist role="params">
<varlistentry><term><parameter>xml</parameter> :</term>
<listitem><simpara> the GladeXML object.
</simpara></listitem></varlistentry>
<varlistentry><term><emphasis>Returns</emphasis> :</term><listitem><simpara> the current GtkAccelGroup.
</simpara></listitem></varlistentry>
</variablelist></refsect2>
<refsect2>
<title><anchor id="GLADE-MODULE-CHECK-INIT:CAPS"/>GLADE_MODULE_CHECK_INIT</title>
<indexterm><primary>GLADE_MODULE_CHECK_INIT</primary></indexterm><programlisting>#define GLADE_MODULE_CHECK_INIT</programlisting>
<para>
This macro will insert a suitable version check function into a
libglade loadable module.</para>
<para>
</para></refsect2>
</refsect1>
</refentry>
|