Re: Clarification about surfaces in Gtk 2.6 and 2.10



2006/8/23, Raju S N <rajusn huawei com>:
Hi all,

Hi!

I am familiar with Gtk2.6 version code. We have plans to migrate to 2.10.
In 2.6, it was not mandatory to use cairo. Now I see that Cairo is an
integral part of 2.10.
Can I know how the approach is changed from 2.6 to 2.10 in the case of
handling surfaces ?
And how the migration happened in GdkDraw, gdkpixmap, gdkwindow, gdkdrawable
to use cairo
How cairo_surface_t structure is used during rendering text, image, etc ?

The answer depends on what point of view you look at the change.

From strictly application users point of view, all you see is better rendering.

From the application developers point of view (who simply use the GTK+
widgets), nothing changes unless you want to add your own drawing on
top of the widgets.

For additional drawing and widget developers, everything that used to
work (Gdk drawing functions etc) still works (and will look better),
but in addition to that you can create a Cairo context for the
GdkDrawable (for example the GdkWindow of the widget) that you can use
for drawing operations using the Cairo API directly. Note that only
the Cairo context is used, the destination surface is not exposed (I'm
not sure if you can get it at all, but usually you don't need it of
course).

I'm not exactly sure how much of the widgets in GTK+ have been
modified to draw directly with Cairo API currently (if at all?), but
future additions surely will use it.

There is a nice tutorial on how to create a widget that uses Cairo for
drawing in the GnomeJournal that also illustrates some Cairo features:

 http://gnomejournal.org/article/34/writing-a-widget-using-cairo-and-gtk28

So considering the GTK+ API, nothing much changed unless you want to
use the new features. The Cairo interaction helpers in Gdk are
documented in

 http://developer.gnome.org/doc/API/2.0/gdk/gdk-Cairo-Interaction.html

Please clarify this.

I hope my explanation helped!  :)

--
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]