]> Pileus Git - ~andy/gtk/blob - docs/reference/gtk/tmpl/gtkrc.sgml
add example to docs, as people are seeming to have trouble with this
[~andy/gtk] / docs / reference / gtk / tmpl / gtkrc.sgml
1 <!-- ##### SECTION Title ##### -->
2 Resource Files
3
4 <!-- ##### SECTION Short_Description ##### -->
5 Routines for handling resource files
6
7 <!-- ##### SECTION Long_Description ##### -->
8 <para id="GtkRcStyle">
9 GTK+ provides resource file mechanism for configuring
10 various aspects of the operation of a GTK+ program
11 at runtime.
12 </para>
13
14 <refsect2><title>Default files</title>
15 <para>
16 An application can cause GTK+ to parse a specific RC
17 file by calling gtk_rc_parse(). In addition to this,
18 certain files will be read at the end of gtk_init().
19 Unless modified, the files looked for will be 
20 <filename>&lt;SYSCONFDIR&gt;/gtk-2.0/gtkrc</filename> 
21 and <filename>.gtkrc-2.0</filename> in the users home directory.
22 (<filename>&lt;SYSCONFDIR&gt;</filename> defaults to 
23 <filename>/usr/local/etc</filename>. It can be changed with the
24 <option>--prefix</option> or <option>--sysconfdir</option> options when 
25 configuring GTK+.)
26 </para>
27 <para>
28 The set of these <firstterm>default</firstterm> files
29 can be retrieved with gtk_rc_get_default_files()
30 and modified with gtk_rc_add_default_file() and
31 gtk_rc_set_default_files().
32 Additionally, the <envar>GTK_RC_FILES</envar> environment variable
33 can be set to a #G_SEARCHPATH_SEPARATOR_S-separated list of files
34 in order to overwrite the set of default files at runtime.
35 </para>
36 <para><anchor id="locale-specific-rc">
37 For each RC file, in addition to the file itself, GTK+ will look for 
38 a locale-specific file that will be parsed after the main file. 
39 For instance, if <envar>LANG</envar> is set to <literal>ja_JP.ujis</literal>,
40 when loading the default file <filename>~/.gtkrc</filename> then GTK+ looks 
41 for <filename>~/.gtkrc.ja_JP</filename> and <filename>~/.gtkrc.ja</filename>, 
42 and parses the first of those that exists.
43 </para>
44 </refsect2>
45
46 <refsect2><title>Pathnames and patterns</title>
47 <para>
48 A resource file defines a number of styles and key bindings and
49 attaches them to particular widgets. The attachment is done
50 by the <literal>widget</literal>, <literal>widget_class</literal>,
51 and <literal>class</literal> declarations. As an example
52 of such a statement:
53 <informalexample><programlisting>
54 widget "mywindow.*.GtkEntry" style "my-entry-class"
55 </programlisting></informalexample>
56 attaches the style <literal>"my-entry-class"</literal>
57 to all widgets whose <firstterm>widget class</firstterm>
58 matches the <firstterm>pattern</firstterm>
59 <literal>"mywindow.*.GtkEntry"</literal>.
60 </para>
61 <para>
62 The patterns here are given in the standard shell glob
63 syntax. The <literal>"?"</literal> wildcard matches
64 any character, while <literal>"*"</literal> matches
65 zero or more of any character. The three types of
66 matching are against the widget path, the
67 <firstterm>class path</firstterm> and the class
68 hierarchy. Both the widget and the class paths consists of a
69 <literal>"."</literal> separated list of all the
70 parents of the widget and the widget itself from
71 outermost to innermost. The difference is that in
72 the widget path, the name assigned by
73 gtk_widget_set_name() is used
74 if present, otherwise the class name of the widget, while
75 for the widget path, the class name is always used.
76 </para>
77 <para>
78 So, if you have a #GtkEntry named
79 <literal>"myentry"</literal>, inside of a of a window
80 named <literal>"mywindow"</literal>, then the
81 widget path is: <literal>"mwindow.GtkHBox.myentry"</literal>
82 while the class path is: <literal>"GtkWindow.GtkHBox.GtkEntry"</literal>.
83 </para>
84 <para>
85 Matching against class is a little different. The pattern
86 match is done against all class names in the widgets
87 class hierarchy (not the layout hierarchy) in sequence, so the
88 pattern:
89 <informalexample><programlisting>
90 class "GtkButton" style "my-style"
91 </programlisting></informalexample>
92 will match not just #GtkButton widgets,
93 but also #GtkToggleButton and
94 #GtkCheckButton widgets, since
95 those classes derive from #GtkButton.
96 </para>
97 </refsect2>
98
99 <refsect2><title>Toplevel declarations</title>
100 <para>
101 An RC file is a text file which is composed of a sequence
102 of declarations. <literal>'#'</literal> characters delimit comments and
103 the portion of a line after a <literal>'#'</literal> is ignored when parsing
104 an RC file.
105 </para>
106
107 <para>
108 The possible toplevel declarations are:
109
110 <variablelist>
111   <varlistentry>
112     <term><literal>binding <replaceable>name</replaceable>
113      { ... }</literal></term>
114     <listitem>
115       <para>Declares a binding set.</para>
116     </listitem>
117   </varlistentry>
118   <varlistentry>
119     <term><literal>class <replaceable>pattern</replaceable> 
120           [ style | binding [ : <replaceable>priority</replaceable> ]]
121           <replaceable>name</replaceable></literal></term>
122     <listitem>
123      <para>Specifies a style or binding set for a particular
124      branch of the inheritance hierarchy.</para>
125     </listitem>
126   </varlistentry>
127   <varlistentry>
128     <term><literal>include <replaceable>filename</replaceable></literal></term>
129     <listitem>
130       <para>Parses another file at this point. If
131         <replaceable>filename</replaceable> is not an absolute filename, 
132         it is searched in the directories of the currently open RC files.
133       </para>
134       <para>GTK+ also tries to load a 
135         <link linkend="locale-specific-rc">locale-specific variant</link> of
136         the included file.
137        </para>
138     </listitem>
139   </varlistentry>
140   <varlistentry>
141     <term><literal>module_path <replaceable>path</replaceable></literal></term>
142     <listitem>
143       <para>Sets a path (a list of directories separated
144       by colons) that will be searched for theme engines referenced in
145       RC files.</para>
146     </listitem>
147   </varlistentry>
148   <varlistentry>
149     <term><literal>pixmap_path <replaceable>path</replaceable></literal></term>
150     <listitem>
151       <para>Sets a path (a list of directories separated
152       by colons) that will be searched for pixmaps referenced in
153       RC files.</para>
154     </listitem>
155   </varlistentry>
156   <varlistentry>
157     <term><literal>style <replaceable>name</replaceable> [ =
158     <replaceable>parent</replaceable> ] { ... }</literal></term>
159     <listitem>
160       <para>Declares a style.</para>
161     </listitem>
162   </varlistentry>
163   <varlistentry>
164     <term><literal>widget <replaceable>pattern</replaceable> 
165           [ style | binding [ : <replaceable>priority</replaceable> ]]
166           <replaceable>name</replaceable></literal></term>
167     <listitem>
168      <para>Specifies a style or binding set for a particular
169      group of widgets by matching on the widget pathname.</para>
170     </listitem>
171   </varlistentry>
172   <varlistentry>
173     <term><literal>widget_class <replaceable>pattern</replaceable> 
174           [ style | binding [ : <replaceable>priority</replaceable> ]]
175           <replaceable>name</replaceable></literal></term>
176     <listitem>
177      <para>Specifies a style or binding set for a particular
178      group of widgets by matching on the class pathname.</para>
179     </listitem>
180   </varlistentry>
181 </variablelist>
182 </para>
183 </refsect2>
184
185 <refsect2><title>Styles</title>
186 <para>
187 A RC style is specified by a <literal>style</literal> 
188 declaration in a RC file, and then bound to widgets
189 with a <literal>widget</literal>, <literal>widget_class</literal>,
190 or <literal>class</literal> declaration. All styles
191 applying to a particular widget are composited together
192 with <literal>widget</literal> declarations overriding
193 <literal>widget_class</literal> declarations which, in
194 turn, override <literal>class</literal> declarations.
195 Within each type of declaration, later declarations override
196 earlier ones.
197 </para>
198
199 <para>
200 Within a <literal>style</literal> declaration, the possible
201 elements are:
202
203 <variablelist>
204   <varlistentry>
205     <term><literal>bg[<replaceable>state</replaceable>] =
206       <replaceable>color</replaceable></literal></term>
207      <listitem>
208        <para>
209          Sets the color used for the background of most widgets.
210        </para>
211      </listitem>
212   </varlistentry>
213   <varlistentry>
214     <term><literal>fg[<replaceable>state</replaceable>] =
215       <replaceable>color</replaceable></literal></term>
216      <listitem>
217        <para>
218          Sets the color used for the foreground of most widgets.
219        </para>
220      </listitem>
221   </varlistentry>
222   <varlistentry>
223     <term><literal>base[<replaceable>state</replaceable>] =
224       <replaceable>color</replaceable></literal></term>
225      <listitem>
226        <para>
227          Sets the color used for the background of widgets displaying
228          editable text. This color is used for the background
229          of, among others, #GtkText, #GtkEntry, #GtkList, and #GtkClist.
230        </para>
231      </listitem>
232   </varlistentry>
233   <varlistentry>
234     <term><literal>text[<replaceable>state</replaceable>] =
235       <replaceable>color</replaceable></literal></term>
236      <listitem>
237        <para>
238          Sets the color used for foreground of widgets using
239          <literal>base</literal> for the background color.
240        </para>
241      </listitem>
242   </varlistentry>
243   <varlistentry>
244     <term><literal>bg_pixmap[<replaceable>state</replaceable>] =
245       <replaceable>pixmap</replaceable></literal></term>
246      <listitem>
247        <para>
248          Sets a background pixmap to be used in place of
249          the <literal>bg</literal> color (or for #GtkText,
250          in place of the <literal>base</literal> color. The special
251          value <literal>"&lt;parent&gt;"</literal> may be used to indicate that the widget should
252          use the same background pixmap as its parent. The special value
253          <literal>"&lt;none&gt;"</literal> may be used to indicate no background pixmap.
254        </para>
255      </listitem>
256   </varlistentry>
257   <varlistentry>
258     <term><literal>font = <replaceable>font</replaceable></literal></term>
259      <listitem>
260        <para>
261          Sets the font for a widget. <replaceable>font</replaceable> must be
262          a XLFD font description, e.g. 
263          <literal>"-*-helvetica-medium-r-normal--10-*-*-*-*-*-*-*"</literal>.
264        </para>
265      </listitem>
266   </varlistentry>
267   <varlistentry>
268     <term><literal>fontset = <replaceable>font</replaceable></literal></term>
269      <listitem>
270        <para>
271          Sets the fontset for a widget. Overrides any
272          <literal>font</literal> declarations. <replaceable>font</replaceable> 
273          must be a comma-separated list of XLFD font descriptions, e.g.
274          <literal>"-JIS-Fixed-Medium-R-Normal--26-180-100-100-C-240,
275                    -JIS-Fixed-Medium-R-Normal--26-180-100-100-C-120,
276                    -GB-Fixed-Medium-R-Normal--26-180-100-100-C-240,
277                    -Adobe-Courier-Bold-R-Normal--25-180-100-100-M-150"</literal>.
278        </para>
279      </listitem>
280   </varlistentry>
281   <varlistentry>
282     <term><literal>font_name = <replaceable>font</replaceable></literal></term>
283      <listitem>
284        <para>
285          Sets the font for a widget. Overrides any
286          <literal>font</literal> or <literal>fontset</literal> declarations. 
287          <replaceable>font</replaceable> must be a Pango font name, e.g.
288          <literal>"Sans Italic 10"</literal>.
289        </para>
290      </listitem>   
291   </varlistentry>
292   <varlistentry>
293     <term><literal>stock[<replaceable>"stock-id"</replaceable>] = { <replaceable>icon source specifications</replaceable> }</literal></term>
294      <listitem>
295        <para>
296         Defines the icon for a stock item.
297        </para>
298      </listitem>
299   </varlistentry>
300   <varlistentry>
301     <term><literal>engine <replaceable>"engine"</replaceable> { <replaceable>engine-specific
302 settings</replaceable> }</literal></term>
303      <listitem>
304        <para>
305         Defines the engine to be used when drawing with this style.
306        </para>
307      </listitem>
308   </varlistentry>
309 </variablelist>
310 </para>
311 <para>
312 The colors and background pixmaps are specified as a function of the
313 state of the widget. The states are:
314
315 <variablelist>
316   <varlistentry>
317     <term><literal>NORMAL</literal></term>
318     <listitem>
319       <para>
320         A color used for a widget in its normal state.
321       </para>
322     </listitem>
323   </varlistentry>
324   <varlistentry>
325     <term><literal>ACTIVE</literal></term>
326     <listitem>
327       <para>
328         A variant of the <literal>NORMAL</literal> color used when the
329         widget is in the %GTK_STATE_ACTIVE state, and also for
330         the trough of a ScrollBar, tabs of a NoteBook
331         other than the current tab and similar areas.
332         Frequently, this should be a darker variant
333         of the <literal>NORMAL</literal> color.
334       </para>
335     </listitem>
336   </varlistentry>
337   <varlistentry>
338     <term><literal>PRELIGHT</literal></term>
339     <listitem>
340       <para>
341         A color used for widgets in the %GTK_STATE_PRELIGHT state. This
342         state is the used for Buttons and MenuItems
343         that have the mouse cursor over them, and for 
344         their children.
345       </para>
346     </listitem>
347   </varlistentry>
348   <varlistentry>
349     <term><literal>SELECTED</literal></term>
350     <listitem>
351       <para>
352         A color used to highlight data selected by the user.
353         for instance, the selected items in a list widget, and the
354         selection in an editable widget.
355       </para>
356     </listitem>
357   </varlistentry>
358   <varlistentry>
359     <term><literal>INSENSITIVE</literal></term>
360     <listitem>
361       <para>
362         A color used for the background of widgets that have
363         been set insensitive with gtk_widget_set_sensitive().
364       </para>
365     </listitem>
366   </varlistentry>
367 </variablelist>
368 </para>
369
370 <para><anchor id="color-format">
371 Colors can be specified as a string containing a color name (GTK+ knows
372 all names from the X color database 
373 <filename>/usr/lib/X11/rgb.txt</filename>),  
374 in one of the hexadecimal forms <literal>&hash;rrrrggggbbbb</literal>,
375 <literal>&hash;rrrgggbbb</literal>, <literal>&hash;rrggbb</literal>,
376 or <literal>&hash;rgb</literal>, where <literal>r</literal>,
377 <literal>g</literal> and <literal>b</literal> are
378 hex digits, or they can be specified as a triplet 
379 <literal>{ <replaceable>r</replaceable>, <replaceable>g</replaceable>,
380 <replaceable>b</replaceable>}</literal>, where <literal>r</literal>,
381 <literal>g</literal> and <literal>b</literal> are either integers in 
382 the range 0-65635 or floats in the range 0.0-1.0.
383 </para>
384
385 <para>
386 In a <literal>stock</literal> definition, icon sources are specified as a
387 4-tuple of image filename, text direction, widget state, and size, in that
388 order.  Each icon source specifies an image filename to use with a given
389 direction, state, and size. The <literal>*</literal> character can be used as a
390 wildcard, and if direction/state/size are omitted they default to
391 <literal>*</literal>. So for example, the following specifies different icons to
392 use for left-to-right and right-to-left languages:
393 <informalexample><programlisting>
394 stock["my-stock-item"] = 
395 {
396   { "itemltr.png", LTR, *, * },
397   { "itemrtl.png", RTL, *, * }
398 }
399 </programlisting></informalexample>
400 This could be abbreviated as follows:
401 <informalexample><programlisting>
402 stock["my-stock-item"] = 
403 {
404   { "itemltr.png", LTR },
405   { "itemrtl.png", RTL }
406 }
407 </programlisting></informalexample>
408 </para>
409
410 <para>
411 You can specify custom icons for specific sizes, as follows:
412 <informalexample><programlisting>
413 stock["my-stock-item"] = 
414 {
415   { "itemmenusize.png", *, *, "gtk-menu" },
416   { "itemtoolbarsize.png", *, *, "gtk-large-toolbar" }
417   { "itemgeneric.png" } /* implicit *, *, * as a fallback */
418 }
419 </programlisting></informalexample>
420 The sizes that come with GTK+ itself are <literal>"gtk-menu"</literal>,
421 <literal>"gtk-small-toolbar"</literal>, <literal>"gtk-large-toolbar"</literal>,
422 <literal>"gtk-button"</literal>, <literal>"gtk-dialog"</literal>. Applications
423 can define other sizes.
424 </para>
425
426 <para>
427 It's also possible to use custom icons for a given state, for example:
428 <informalexample><programlisting>
429 stock["my-stock-item"] = 
430 {
431   { "itemprelight.png", *, PRELIGHT },
432   { "iteminsensitive.png", *, INSENSITIVE }, 
433   { "itemgeneric.png" } /* implicit *, *, * as a fallback */
434 }
435 </programlisting></informalexample>
436 </para>
437
438 <para>
439 When selecting an icon source to use, GTK+ will consider text direction most
440 important, state second, and size third. It will select the best match based on
441 those criteria. If an attribute matches exactly (e.g. you specified
442 <literal>PRELIGHT</literal> or specified the size), GTK+ won't modify the image;
443 if the attribute matches with a wildcard, GTK+ will scale or modify the image to
444 match the state and size the user requested.
445 </para>
446
447 </refsect2>
448
449 <refsect2><title>Key bindings</title>
450 <para>
451 Key bindings allow the user to specify actions to be 
452 taken on particular key presses. The form of a binding
453 set declaration is:
454 </para>
455
456 <informalexample><programlisting>
457 binding <replaceable>name</replaceable> {
458   bind <replaceable>key</replaceable> { 
459     <replaceable>signalname</replaceable> (<replaceable>param</replaceable>, ...)
460     ...
461   }
462   ...
463 }
464 </programlisting></informalexample>
465
466 <para>
467 <replaceable>key</replaceable> is a string consisting of a 
468 series of modifiers followed by the name of a key. The
469 modifiers can be:
470 <simplelist>
471 <member><literal>&lt;alt&gt;</literal></member>
472 <member><literal>&lt;control&gt;</literal></member>
473 <member><literal>&lt;mod1&gt;</literal></member>
474 <member><literal>&lt;mod2&gt;</literal></member>
475 <member><literal>&lt;mod3&gt;</literal></member>
476 <member><literal>&lt;mod4&gt;</literal></member>
477 <member><literal>&lt;mod5&gt;</literal></member>
478 <member><literal>&lt;release&gt;</literal></member>
479 <member><literal>&lt;shft&gt;</literal></member>
480 <member><literal>&lt;shift&gt;</literal></member>
481 </simplelist>
482 <literal>&lt;shft&gt;</literal> is an alias for 
483 <literal>&lt;shift&gt;</literal> and 
484 <literal>&lt;alt&gt;</literal> is an alias for
485 <literal>&lt;mod1&gt;</literal>.
486 </para>
487
488 <para>
489 The action that is bound to the key is a sequence
490 of signal names (strings) followed by parameters for 
491 each signal. The signals must be action signals.
492 (See g_signal_new()). Each parameter can be
493 a float, integer, string, or unquoted string
494 representing an enumeration value. The types of
495 the parameters specified must match the types of the 
496 parameters of the signal.
497 </para>
498
499 <para>
500 Binding sets are connected to widgets in the
501 same manner as styles, with one addition. 
502 A priority can be specified for each pattern,
503 and within each type of pattern, binding sets
504 override other binding sets first by priority,
505 and only then by order of specification. (Later
506 overrides earlier). The priorities that can
507 be specified are (highest to lowest):
508 <simplelist>
509 <member><literal>highest</literal></member>
510 <member><literal>rc</literal></member>
511 <member><literal>theme</literal></member>
512 <member><literal>application</literal></member>
513 <member><literal>gtk</literal></member>
514 <member><literal>lowest</literal></member>
515 </simplelist>
516 <literal>rc</literal> is the default for bindings
517 read from an RC file, <literal>theme</literal>
518 is the default for bindings read from theme RC files,
519 <literal>application</literal> 
520 should be used for bindings an application sets
521 up, and <literal>gtk</literal> is used for bindings
522 that GTK+ creates internally.
523 </para>
524 </refsect2>
525
526 <!-- ##### SECTION See_Also ##### -->
527 <para>
528
529 </para>
530
531 <!-- ##### STRUCT GtkRcStyle ##### -->
532 <para>
533 The #GtkRcStyle structure is used to represent a set
534 of information about the appearance of a widget.
535 This can later be composited together with other
536 #GtkRcStyle structures to form a #GtkStyle.
537 </para>
538
539 @name: 
540 @bg_pixmap_name: 
541 @font_desc: 
542 @color_flags: 
543 @fg: 
544 @bg: 
545 @text: 
546 @base: 
547 @xthickness: 
548 @ythickness: 
549
550 <!-- ##### ENUM GtkRcFlags ##### -->
551 <para>
552 The #GtkRcFlags enumeration is used as a bitmask
553 to specify which fields of a #GtkRcStyle have been
554 set for each state.
555 </para>
556
557 @GTK_RC_FG: If present, the foreground color has been set for this state.
558 @GTK_RC_BG: If present, the background color has been set for this state.
559 @GTK_RC_TEXT: If present, the text color has been set for this state.
560 @GTK_RC_BASE: If present, the base color has been set for this state.
561
562 <!-- ##### ENUM GtkRcTokenType ##### -->
563 <para>
564 The #GtkRcTokenType enumeration represents the tokens
565 in the RC file. It is exposed so that theme engines
566 can reuse these tokens when parsing the theme-engine
567 specific portions of a RC file.
568 </para>
569
570 @GTK_RC_TOKEN_INVALID: 
571 @GTK_RC_TOKEN_INCLUDE: 
572 @GTK_RC_TOKEN_NORMAL: 
573 @GTK_RC_TOKEN_ACTIVE: 
574 @GTK_RC_TOKEN_PRELIGHT: 
575 @GTK_RC_TOKEN_SELECTED: 
576 @GTK_RC_TOKEN_INSENSITIVE: 
577 @GTK_RC_TOKEN_FG: 
578 @GTK_RC_TOKEN_BG: 
579 @GTK_RC_TOKEN_TEXT: 
580 @GTK_RC_TOKEN_BASE: 
581 @GTK_RC_TOKEN_XTHICKNESS: 
582 @GTK_RC_TOKEN_YTHICKNESS: 
583 @GTK_RC_TOKEN_FONT: 
584 @GTK_RC_TOKEN_FONTSET: 
585 @GTK_RC_TOKEN_FONT_NAME: 
586 @GTK_RC_TOKEN_BG_PIXMAP: 
587 @GTK_RC_TOKEN_PIXMAP_PATH: 
588 @GTK_RC_TOKEN_STYLE: 
589 @GTK_RC_TOKEN_BINDING: 
590 @GTK_RC_TOKEN_BIND: 
591 @GTK_RC_TOKEN_WIDGET: 
592 @GTK_RC_TOKEN_WIDGET_CLASS: 
593 @GTK_RC_TOKEN_CLASS: 
594 @GTK_RC_TOKEN_LOWEST: 
595 @GTK_RC_TOKEN_GTK: 
596 @GTK_RC_TOKEN_APPLICATION: 
597 @GTK_RC_TOKEN_THEME: 
598 @GTK_RC_TOKEN_RC: 
599 @GTK_RC_TOKEN_HIGHEST: 
600 @GTK_RC_TOKEN_ENGINE: 
601 @GTK_RC_TOKEN_MODULE_PATH: 
602 @GTK_RC_TOKEN_IM_MODULE_PATH: 
603 @GTK_RC_TOKEN_IM_MODULE_FILE: 
604 @GTK_RC_TOKEN_STOCK: 
605 @GTK_RC_TOKEN_LTR: 
606 @GTK_RC_TOKEN_RTL: 
607 @GTK_RC_TOKEN_LAST: 
608
609 <!-- ##### FUNCTION gtk_rc_scanner_new ##### -->
610 <para>
611
612 </para>
613
614 @Returns: 
615
616
617 <!-- ##### FUNCTION gtk_rc_get_style ##### -->
618 <para>
619 </para>
620
621 @widget: 
622 @Returns: 
623
624
625 <!-- ##### FUNCTION gtk_rc_get_style_by_paths ##### -->
626 <para>
627
628 </para>
629
630 @settings: 
631 @widget_path: 
632 @class_path: 
633 @type: 
634 @Returns: 
635
636
637 <!-- ##### FUNCTION gtk_rc_add_widget_name_style ##### -->
638 <para>
639 Adds a #GtkRcStyle that will be looked up by a match against
640 the widget's pathname. This is equivalent to a:
641 <literal>
642 widget PATTERN style STYLE
643 </literal>
644 statement in a RC file.
645 </para>
646
647 @rc_style: the #GtkRcStyle to use for widgets matching @pattern
648 @pattern: the pattern
649
650
651 <!-- ##### FUNCTION gtk_rc_add_widget_class_style ##### -->
652 <para>
653 Adds a #GtkRcStyle that will be looked up by a match against
654 the widget's class pathname. This is equivalent to a:
655 <literal>
656 widget_class PATTERN style STYLE
657 </literal>
658 statement in a RC file.
659 </para>
660
661 @rc_style: the #GtkRcStyle to use for widgets matching @pattern
662 @pattern: the pattern
663
664
665 <!-- ##### FUNCTION gtk_rc_add_class_style ##### -->
666 <para>
667 Adds a #GtkRcStyle that will be looked up by a matching against
668 the class hierarchy of the widget. This is equivalent to a:
669 <literal>
670 class PATTERN style STYLE
671 </literal>
672 statement in a RC file.
673 </para>
674
675 @rc_style: the #GtkRcStyle to use for widgets deriving from @pattern
676 @pattern: the pattern
677
678
679 <!-- ##### FUNCTION gtk_rc_parse ##### -->
680 <para>
681 Parses a given resource file.
682 </para>
683
684 @filename: the filename of a file to parse. If @filename is not absolute, it
685   is searched in the current directory.
686
687
688 <!-- ##### FUNCTION gtk_rc_parse_string ##### -->
689 <para>
690 Parses resource information directly from a string.
691 </para>
692
693 @rc_string: a string to parse.
694
695
696 <!-- ##### FUNCTION gtk_rc_reparse_all ##### -->
697 <para>
698 </para>
699
700 @Returns: 
701
702
703 <!-- ##### FUNCTION gtk_rc_reparse_all_for_settings ##### -->
704 <para>
705
706 </para>
707
708 @settings: 
709 @force_load: 
710 @Returns: 
711
712
713 <!-- ##### FUNCTION gtk_rc_add_default_file ##### -->
714 <para>
715 </para>
716
717 @filename: 
718
719
720 <!-- ##### FUNCTION gtk_rc_get_default_files ##### -->
721 <para>
722 </para>
723
724 @Returns: 
725
726
727 <!-- ##### FUNCTION gtk_rc_set_default_files ##### -->
728 <para>
729 </para>
730
731 @filenames: 
732
733
734 <!-- ##### FUNCTION gtk_rc_parse_color ##### -->
735 <para>
736 Parses a color in the <link linkend="color-format">format</link> expected in a RC file.
737 </para>
738
739 @scanner: a #GtkScanner
740 @color: a pointer to a #GtkColor structure in which to store the result
741 @Returns: %G_TOKEN_NONE if parsing suceeded, otherwise the token
742 that was expected but not found.
743
744
745 <!-- ##### FUNCTION gtk_rc_parse_state ##### -->
746 <para>
747 Parses a #GtkStateType variable from the format expected
748 in a RC file.
749 </para>
750
751 @scanner: a #GtkScanner (must be initialized for parsing an RC file)
752 @state: A pointer to a #GtkStateType variable in which to
753 store the result.
754 @Returns: %G_TOKEN_NONE if parsing suceeded, otherwise the token
755 that was expected but not found.
756
757
758 <!-- ##### FUNCTION gtk_rc_parse_priority ##### -->
759 <para>
760 Parses a #GtkPathPriorityType variable from the format expected
761 in a RC file.
762 </para>
763
764 @scanner: a #GtkScanner (must be initialized for parsing an RC file)
765 @priority: A pointer to #GtkPathPriorityType variable in which
766 to store the result.
767 @Returns: %G_TOKEN_NONE if parsing suceeded, otherwise the token
768 that was expected but not found.
769
770
771 <!-- ##### FUNCTION gtk_rc_find_module_in_path ##### -->
772 <para>
773 </para>
774
775 @module_file: The name of the module to search for.
776 @Returns: 
777
778
779 <!-- ##### FUNCTION gtk_rc_find_pixmap_in_path ##### -->
780 <para>
781 </para>
782
783 @settings: 
784 @scanner: a #GtkScanner. Used for printing out warning messages
785 if the file is not found.
786 @pixmap_file: The name of the file to search for.
787 @Returns: The filename, if found (must be freed with g_free()),
788 otherwise %NULL.
789 <!-- # Unused Parameters # -->
790 @context: 
791
792
793 <!-- ##### FUNCTION gtk_rc_get_module_dir ##### -->
794 <para>
795 Returns the directory in which GTK+ will look for
796 theme engines.
797 </para>
798
799 @Returns: The directory. (Must be freed with g_free())
800
801
802 <!-- ##### FUNCTION gtk_rc_get_im_module_path ##### -->
803 <para>
804
805 </para>
806
807 @Returns: 
808
809
810 <!-- ##### FUNCTION gtk_rc_get_im_module_file ##### -->
811 <para>
812
813 </para>
814
815 @Returns: 
816
817
818 <!-- ##### FUNCTION gtk_rc_get_theme_dir ##### -->
819 <para>
820 Returns the standard directory in which themes should
821 be installed. (GTK+ does not actually use this directory
822 itself.)
823 </para>
824
825 @Returns: The directory (must be freed with g_free()).
826
827
828 <!-- ##### FUNCTION gtk_rc_style_new ##### -->
829 <para>
830 Creates a new #GtkRcStyle with no fields set and
831 a reference count of 1.
832 </para>
833
834 @Returns: the newly-created #GtkRcStyle
835
836
837 <!-- ##### FUNCTION gtk_rc_style_copy ##### -->
838 <para>
839
840 </para>
841
842 @orig: 
843 @Returns: 
844
845
846 <!-- ##### FUNCTION gtk_rc_style_ref ##### -->
847 <para>
848 Increments the reference count of a #GtkRcStyle.
849 </para>
850
851 @rc_style: a #GtkRcStyle
852
853
854 <!-- ##### FUNCTION gtk_rc_style_unref ##### -->
855 <para>
856 Decrements the reference count of a #GtkRcStyle and
857 frees if the result is 0.
858 </para>
859
860 @rc_style: a #GtkRcStyle
861
862