gtk-Resource-Files {RGtk2} | R Documentation |
Routines for handling resource files
gtkRcScannerNew()
gtkRcGetStyle(object)
gtkRcGetStyleByPaths(settings, widget.path, class.path, type)
gtkRcAddWidgetNameStyle(object, pattern)
gtkRcAddWidgetClassStyle(object, pattern)
gtkRcAddClassStyle(object, pattern)
gtkRcParse(filename)
gtkRcParseString(rc.string)
gtkRcReparseAll()
gtkRcReparseAllForSettings(settings, force.load)
gtkRcResetStyles(settings)
gtkRcAddDefaultFile(filename)
gtkRcGetDefaultFiles()
gtkRcSetDefaultFiles(filenames)
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:
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"
class
matches) or full path names (for
widget
and widget_class
matches)
is to be preferred over shortened names
containing "*"
or "?"
.
"?"
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
.
"*"
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.
GtkRcStyle
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
.
GtkRcFlags
GtkRcFlags
enumeration is used as a bitmask
to specify which fields of a GtkRcStyle
have been
set for each state.
fg
bg
text
base
GtkRcTokenType
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.
invalid
include
normal
active
prelight
selected
insensitive
fg
bg
text
base
xthickness
ythickness
font
fontset
font-name
bg-pixmap
pixmap-path
style
binding
bind
widget
widget-class
class
lowest
gtk
application
theme
rc
highest
engine
module-path
im-module-path
im-module-file
stock
ltr
rtl
last
Derived by RGtkGen from GTK+ documentation
http://developer.gnome.org/doc/API/2.0/gtk/gtk-Resource-Files.html