Re: RFC: Re-Design GtkStyle to only pass cairo-context?
- From: "Kalle Vahlman" <kalle vahlman gmail com>
- To: "Clemens Eisserer" <linuxhippy gmail com>
- Cc: gtk-devel-list gnome org
- Subject: Re: RFC: Re-Design GtkStyle to only pass cairo-context?
- Date: Sun, 6 Jan 2008 19:47:01 +0200
2008/1/6, Clemens Eisserer <linuxhippy gmail com>:
> Hello,
>
> Many non-gtk applications are using GtkStyle to adjust their
> appearance to the currently used GTK theme.
> The current GtkStyle-function (gtk_paint_xyz()) take a GdkWindow as
> parameter - however I saw many programs which instead passed a
> GdkPixmap which also seemd to work (however as far as I understand
> there is not any guarantee that it will work with all themes).
Hmm, windows and pixmaps should be equals in terms of GdkDrawable API,
what could the theme engine be doing that would break that?
> My idea would be to replace the GdkWindow in the gtk_paint_ functions
> simply with a cairo-context, which could have the following
> advantages:
[snip good reasons]
> Theme and application backward compatibility could be implemented with
> wrapper functions which create the cairo-context (for applications
> which are not aware of the new API), or switch back to the old
> theme-api if a old theme engine is detected (for old theme engines).
Sounds good, except that the theme engine API is basically deriving
the GtkStyle class so to change the function signature you would need
to change the class => boom goes ABI.
I guess it could work if one derives a GtkCairoStyle from GtkStyle and
add the cairo-based API to that. That way casts to GtkStyle should
work and engines could implement the old api with the wrapper
approach.
Or was that what you meant already?-)
--
Kalle Vahlman, zuh iki fi
Powered by http://movial.fi
Interesting stuff at http://syslog.movial.fi
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]