GNOME Goal: Adapt to GTK+3 Rendering Cleanup
Contents
Introduction
The stated goal of the rendering cleanup is the removal of GdkColormap and GdkPixmap, and the introduction of gtk_widget_draw() (with the expose-event signal replaced by a draw signal)
GdkPixmap was to be replaced by cairo_surface_t usage and GdkColormap functionality was either removed because it is outdated or replaced by GdkVisual.
Guidelines
Replace !GdkPixmap by cairo surfaces
Replace GdkPixmap/GdkBitmap usage with appropriate equivalents; this looks pretty straightforward, and it usually is: The GdkPixmap version is replaced with a cairo_surface_t version. However, there were some special cases:
- Setting a shape is done internally using a region, so that API is exposed instead. Plus a function called gdk_cairo_region_create_from_surface() was added that does what it says using 50% alpha as the threshold.
- All functions that take or produce a pixmap and a mask were removed and replaced with versions that use any cairo_surface_t.
- Get rid of the Pixmap option when a Pixbuf option exists:
A lot of APIs have versions taking either a Pixmap or a Pixbuf. In those cases, the Pixman version was removed. If people still use them, they can use gdk_pixbuf_get_from_drawable() or similar to convert to a pixbuf. Examples are GtkImage or GdkCursor.
Replace colormaps by visuals:
For drawing with cairo, it is not necessary to allocate colors, and a #GdkVisual provides enough information for cairo to handle colors in 'native' surfaces. The colormap-handling functions of #GtkWidget (gtk_widget_set_colormap(), etc) have been removed and gtk_widget_set_visual() has been undeprecated.
- For example, the new code to get translucent windows looks like this: gtk_widget_set_visual (window, gdk_screen_get_rgba_visual (gdk_screen_get_default ()) (before it was gtk_widget_set_colormap (window, gdk_screen_get_rgba_colormap (gdk_screen_get_default ()))
The !GtkWidget::draw signal:
The GtkWidget #GtkWidget::expose-event signal has been replaced by a new #GtkWidget::draw signal, which takes a #cairo_t instead of an expose event.
- The widget is expected to draw itself with its allocated size, which is available via the new gtk_widget_get_allocated_width() and gtk_widget_get_allocated_height().
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.
More info here:
http://mail.gnome.org/archives/gtk-devel-list/2010-August/msg00264.html
http://mail.gnome.org/archives/gtk-devel-list/2010-September/msg00142.html
Also, follow the tips of the GTK+ migration guide
Comments before approval
Status of this goal
Note: Updated automatical stats can be found at: |
Tip: If you choose to work on a module, create the bug report on the GNOME bugzilla for the relevant module, and make it block bug <<insert here a link to the tracker bug>>. This way people will know someone already works on it, and won't duplicate the work you're doing. |
State |
Markup |
todo |
<: #ff8080> todo |
patch |
<: #ffcc50> [[GnomeBug:xxxxx|patch]] |
done |
<: #80ff80> [[GnomeBug:xxxxx|done]] |
not needed |
<: #80ff80> not needed |
Above are the states and corresponding markup to update the modules state table below.
Module |
Status |
Desktop |
|
alacarte |
to do |
brasero |
to do |
bug-buddy |
to do |
caribou |
to do |
to do |
|
dasher |
to do |
dconf |
to do |
to do |
|
to do |
|
to do |
|
to do |
|
to do |
|
done |
|
evolution-data-server |
to do |
to do |
|
gcalctool |
to do |
to do |
|
to do |
|
to do |
|
to do |
|
gnome-control-center |
to do |
gnome-desktop |
|
gnome-disk-utility |
to do |
to do |
|
gnome-mag |
to do |
to do |
|
gnome-power-manager |
to do |
gnome-session |
to do |
gnome-settings-daemon |
|
gnome-shell |
|
gnome-system-monitor |
to do |
to do |
|
gnome-terminal |
done |
to do |
|
done |
|
gtkhtml |
to do |
gtksourceview |
|
done |
|
hamster-applet |
to do |
libgnomekbd |
|
librsvg |
done |
libwnck |
|
metacity |
to do |
mutter |
|
done |
|
orca |
to do |
to do |
|
tomboy |
to do |
to do |
|
vinagre |
to do |
vino |
|
vte |
done |
to do |
|
Admin |
|
sabayon |
to do |
Development Tools |
|
accerciser |
to do |
anjuta |
to do |
gdl |
to do |
glade3 |
to do |
gnome-devel-docs |
to do |
External Dependencies |
|
cairo |
to do |
gtk-vnc |
|
libcanberra |
|
webkit |
done |
Other |
|
abiword |
to do |
atomix |
to do |
banshee |
to do |
contact-lookup-applet |
to do |
couch-db |
to do |
deja-dup |
to do |
to do |
|
evolution-couchdb |
to do |
f-spot |
to do |
ghex |
to do |
giggle |
to do |
gimp |
to do |
gitg |
to do |
glom |
to do |
gnome-blog |
to do |
gnome-main-menu |
to do |
GNOME Phone Manager |
to do |
goocanvas |
to do |
goocanvasmm |
to do |
GParted |
to do |
to do |
|
gtetrinet |
to do |
gthumb |
to do |
to do |
|
krb5-auth-dialog |
to do |
libbtctl |
to do |
libgnomekbd |
to do |
libgoffice |
to do |
libgsf |
to do |
not needed |
|
mousetrap |
to do |
nemiver |
to do |
network-manager-applet |
to do |
pdfmod |
to do |
planner |
to do |
to do |
|
simple-scan |
to do |
to do |