Re: GTK Themes, and theme libraries : how do they fit (get plugged) into GTK ?



On Wed, Dec 13, 2006 at 04:01:48PM +0100, Philippe Bertin wrote:

So how(/where in the code) are these theme libraries coming in the game 
? How can e.g. a GtkToggleButton possibly be drawn another way, e.g. 
with more rounding, or with another kind of shading (as I said, I'm 
explicitly *not* speaking of a different color scheme) ? How(/where in 
the code) do these theme libraries get "plugged-in" into GTK ?

All functions gtk_paint_foo() essentially do nothing more
than call some method(s) of the GtkStyle object passed to
them.  That is, GtkStyle is a class and it has methods that
actually draw the things.

Widgets pass their style as the style argument, which is
under normal circumstances the default style shared between
all widgets (assigned in gtk_widget_init() and attached to
windows when widgets are realized).

The default style is set by the RC parser, which also loads
the theme engine when it encounters a theme engine
declaration in the RC file.

gtk_theme_engine_get() simply uses the GTypeModule mechanism
to load the module implementing a class (theme engine).

To see the code, look at gtkstyle.c, gtkrc.c and
gtkthemes.c.

Yeti


--
Whatever.



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]