Resource Files
Routines for handling resource files
gtkRcScannerNew()gtkRcGetStyle(object)gtkRcGetStyleByPaths(settings, widget.path, class.path, type)gtkRcAddWidgetNameStyle(object, pattern)gtkRcAddWidgetClassStyle(object, pattern)gtkRcAddClassStyle(object, pattern)gtkRcParseString(rc.string)gtkRcReparseAll()gtkRcReparseAllForSettings(settings, force.load)gtkRcResetStyles(settings)gtkRcGetDefaultFiles()gtkRcParseColor(scanner, color)gtkRcParseColorFull(scanner, style)gtkRcParseState(scanner)gtkRcParsePriority(scanner)gtkRcFindModuleInPath(module.file)gtkRcFindPixmapInPath(settings, scanner = NULL, pixmap.file)gtkRcGetModuleDir()gtkRcGetImModulePath()gtkRcGetImModuleFile()gtkRcGetThemeDir()gtkRcStyleNew()gtkRcStyleCopy(object)
GObject +----GtkRcStyle
GTK+ provides resource file mechanism for configuring various aspects of the operation of a GTK+ program at runtime.
An application can cause GTK+ to parse a specific RC
file by calling gtkRcParse. In addition to this,
certain files will be read at the end of gtkInit.
Unless modified, the files looked for will be
‘<SYSCONFDIR>/gtk-2.0/gtkrc’
and ‘.gtkrc-2.0’ in the users home directory.
(‘<SYSCONFDIR>’ defaults to
‘/usr/local/etc’. It can be changed with the
--prefix or --sysconfdir options when
configuring GTK+.) Note that although the filenames contain the version
number 2.0, all 2.x versions of GTK+ look for these files.
The set of these default files
can be retrieved with gtkRcGetDefaultFiles
and modified with gtkRcAddDefaultFile and
gtkRcSetDefaultFiles.
Additionally, the GTK2_RC_FILES environment variable
can be set to a G_SEARCHPATH_SEPARATOR_S-separated list of files
in order to overwrite the set of default files at runtime.
For each RC file, in addition to the file itself, GTK+ will look for
a locale-specific file that will be parsed after the main file.
For instance, if LANG is set to ja_JP.ujis,
when loading the default file ‘~/.gtkrc’ then GTK+ looks
for ‘~/.gtkrc.ja_JP’ and ‘~/.gtkrc.ja’,
and parses the first of those that exists.
Everytime a widget is created and added to the layout hierarchy of a GtkWindow
("anchored" to be exact), a list of matching RC styles out of all RC styles read
in so far is composed.
For this, every RC style is matched against the widgets class path,
the widgets name path and widgets inheritance hierarchy.
As a consequence, significant slowdown can be caused by utilization of many
RC styles and by using RC style patterns that are slow or complicated to match
against a given widget.
The following ordered list provides a number of advices (prioritized by
effectiveness) to reduce the performance overhead associated with RC style
matches:
Move RC styles for specific applications into RC files dedicated to those applications and parse application specific RC files only from applications that are affected by them. This reduces the overall amount of RC styles that have to be considered for a match across a group of applications.
Merge multiple styles which use the same matching rule, for instance:
style "Foo" { foo_content }
class "X" style "Foo"
style "Bar" { bar_content }
class "X" style "Bar"
is faster to match as:
style "FooBar" { foo_content bar_content }
class "X" style "FooBar"
Use of wildcards should be avoided, this can reduce the individual RC style match to a single integer comparison in most cases.
To avoid complex recursive matching, specification of full class names
(for class matches) or full path names (for
widget and widget_class matches)
is to be preferred over shortened names
containing "*" or "?".
If at all necessary, wildcards should only be used at the tail or head of a pattern. This reduces the match complexity to a string comparison per RC style.
When using wildcards, use of "?" should be preferred
over "*". This can reduce the matching complexity from
O(n^2) to O(n). For example "Gtk*Box" can be turned into
"Gtk?Box" and will still match GtkHBox and GtkVBox.
The use of "*" wildcards should be restricted as much
as possible, because matching "A*B*C*RestString" can
result in matching complexities of O(n^2) worst case.
GtkRcStyleThe GtkRcStyle structure is used to represent a set
of information about the appearance of a widget.
This can later be composited together with other
GtkRcStyle structures to form a GtkStyle.
GtkRcFlagsThe GtkRcFlags enumeration is used as a bitmask
to specify which fields of a GtkRcStyle have been
set for each state.
fgIf present, the foreground color has been set for this state.
bgIf present, the background color has been set for this state.
textIf present, the text color has been set for this state.
baseIf present, the base color has been set for this state.
GtkRcTokenTypeThe GtkRcTokenType enumeration represents the tokens
in the RC file. It is exposed so that theme engines
can reuse these tokens when parsing the theme-engine
specific portions of a RC file.
invalidundocumented
includeundocumented
normalundocumented
activeundocumented
prelightundocumented
selectedundocumented
insensitiveundocumented
fgundocumented
bgundocumented
textundocumented
baseundocumented
xthicknessundocumented
ythicknessundocumented
fontundocumented
fontsetundocumented
font-nameundocumented
bg-pixmapundocumented
pixmap-pathundocumented
styleundocumented
bindingundocumented
bindundocumented
widgetundocumented
widget-classundocumented
classundocumented
lowestundocumented
gtkundocumented
applicationundocumented
themeundocumented
rcundocumented
highestundocumented
engineundocumented
module-pathundocumented
im-module-pathundocumented
im-module-fileundocumented
stockundocumented
ltrundocumented
rtlundocumented
lastundocumented
Derived by RGtkGen from GTK+ documentation
Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.