head 1.7; access; symbols; locks; strict; comment @# @; 1.7 date 2005.08.07.22.57.09; author pippin; state Exp; branches; next 1.6; commitid 734542f691c44567; 1.6 date 2005.04.01.14.37.17; author cworth; state Exp; branches; next 1.5; 1.5 date 2004.12.11.16.43.55; author pippin; state Exp; branches; next 1.4; 1.4 date 2004.06.29.08.20.48; author pippin; state Exp; branches; next 1.3; 1.3 date 2004.05.20.18.41.16; author pippin; state Exp; branches; next 1.2; 1.2 date 2004.05.13.21.43.19; author pippin; state Exp; branches; next 1.1; 1.1 date 2003.11.18.15.17.07; author cworth; state Exp; branches; next ; desc @@ 1.7 log @Sync up with cairo api @ text @GtkCairo ======== GtkCairo is an extension of GtkWidget that can paint itself using the cairo api using a few backends (xlib w/Render acceleration, and glitz w/open gl acceleration). NOTE: GTK+ 2.7+ supports creating cairo contexts for GDK drawables, making GtkCairo obsolete; see gdk_drawable_get_cairo(). GtkCairo can still be used as a convenient interface to cairo for earlier GTK+ versions. Synopsis ======== GtkWidget *gtk_cairo_new (void); cairo_t *gtk_cairo_get_cairo (GtkCairo *gtkcairo); Signal prototypes ================= "paint" void user_function (GtkWidget *widget, cairo_t *cr, gpointer user_data) Object Hierarchy ================ GObject +---GtkObject +----GtkWidget +----GtkCairo Usage ===== Hook up to the widgets "paint" signal with your custom drawing code, queue redraw of the widget using gtk_widget_queue_draw (widget); The interesting bits are the operations you can perform on the Cairo surface, the documentation of which is outside the scope of GtkCairo. To use GtkCairo in your code, add the package "gtkcairo" to the list of packages you pull in via pkg-config. Backend selection ================= GtkCairo should choose a reasonable cairo backend by default, at the moment this means the xlib backend since it provides AA at all times, setting the backend can be done through the enviroment variable export GTKCAIRO_BACKEND=gl export GTKCAIRO_BACKEND=xlib export GTKCAIRO_BACKEND=image (not implemented yet) before starting an application. Todo ==== * Make it possible to switch backend on the fly using a property, * Implement the image backend, probably using gdkpixbuf. Dependencies ============ GtkCairo depends on the obvious two: - GTK 2: http://www.gtk.org - Cairo: http://www.cairographics.org vim: tw=70 @ 1.6 log @ * README: Remove invalid whitespace from export examples. @ text @d8 5 @ 1.5 log @updated README @ text @d49 3 a51 3 export GTKCAIRO_BACKEND = gl export GTKCAIRO_BACKEND = xlib export GTKCAIRO_BACKEND = image (not implemented yet) @ 1.4 log @renamed the redraw signal to paint @ text @d1 2 a2 17 /* gtkcairo - GTK+ widget for displaying a Cairo surface. * * Hacked up by Evan Martin . * further modified by OEyvind Kolaas */ GtkCairo is a library that provides a new widget to be used in your GTK+ program: a Cairo surface. Dependencies ------------ GtkCairo depends on the obvious two: - GTK 2: http://www.gtk.org - Cairo: http://www.cairographics.org d4 25 d31 1 a31 1 ----- a41 1 d43 1 a43 1 ----------------- d51 1 a51 1 export GTKCAIRO_BACKEND = image d55 2 d58 5 a62 2 Acknowledgement --------------- d64 3 a66 2 The majority of GtkCairo was a cut'n'paste job from from grrobot, by Carl Worth. @ 1.3 log @seperated out the gdkwindow / cairo stuff, to easier support the different backends @ text @d23 1 a23 1 Hook up to the widgets "redraw" signal with your custom drawing code, @ 1.2 log @added subtle hints about usage @ text @d32 14 a45 3 If compiled using a opengl capable version of cairo, setting the enviroment variable GTKCAIRO_GL to a non 0 value, will make gtkcairo use the opengl backend for rendering. @ 1.1 log @Initial import of gtkcairo (courtesy of Evan Martin ) @ text @d4 1 d23 4 a26 2 The current API is trivial; just read gtkcairo/gtkcairo.h. The interesting bits are the operations you can perform on the Cairo d32 3 @