[LAD] pixmap based knob widgets and theme integration.

hermann brummer- at web.de
Tue Sep 28 13:18:21 UTC 2010


Am Dienstag, den 28.09.2010, 13:00 +0200 schrieb Olivier Guilyardi:
> On 09/28/2010 07:28 AM, hermann wrote:
> > Am Montag, den 27.09.2010, 16:57 +0200 schrieb Olivier Guilyardi:
> >> My point was that widgets drawn directly with Cairo bypass the
> >> gtk_paint_*()
> >> drawing abstraction layer, which would forbid engine to provide their
> >> own knob
> >> drawing implementation, as it's done for buttons, etc...
> >>
> >> Therefore, such Cairo-based knobs wouldn't support the full GTK
> >> theming
> >> capabilities. 
> > 
> > In Gtk+3 many GDK functions are replaced by cairo. 
> > gtk_widget_draw() will take any cairo surface then.
> > 
> > http://live.gnome.org/GnomeGoals/GTKRenderingCleanup
> 
> Okay, it says "All GtkStyle drawing functions (gtk_paint_box(), etc) have been
> changed to take a #cairo_t instead of a window and a clip area. ::draw
> implementations will usually just use the cairo context that has been passed in
> for this."
> 
> I'm not a gtk engine wizard, but the problem is still here IIUC.
> 
> If you draw directly with Cairo within your widget, your bypass the drawing
> "driver" layer, for example used by ClearLooks which overloads the old
> gtk_draw_*() functions in clearlooks_style_class_init():
> http://clearlooks.cvs.sourceforge.net/viewvc/clearlooks/clearlooks/src/clearlooks_style.c?revision=1.100&view=markup
> 
> Whether gtk or a specific engine draw internally with Cairo or not doesn't
> change the situation.
> 
> I suppose that the only solution would be to add some knob drawing primitives to
> the GtkStyle class itself. That would allow gtk engines developers to provide
> their own knob drawing implementation, and also separate the rendering code from
> the knob logic.
> 
> But that might be a lot of trouble.
> 
> --
>   Olivier
> 

Okay, . . 

> The GdkGC and GdkImage objects, as well as all the functions using
> them are gone. This includes the gdk_draw_ family of functions like
> gdk_draw_rectangle() and gdk_draw_drawable(). As GdkGC is roughly
> equivalent to cairo_t and GdkImage was used for drawing images to
> GdkDrawables, which cairo supports automatically, a transition is
> usually straightforward. 

url: http://live.gnome.org/GnomeGoals/GDKtoCairo

I guess that the engines need to be rewrite for GTK+3 anyway, and when
your goal is to include a knob in GTK mainstream, it could be a good
point to do it in the upcoming GTK+3, then it could be done with cairo
and produce a well nice looking and full featured module witch could
supported by engines from beginning on. :-)

greats  hermann




More information about the Linux-audio-dev mailing list