[cairo-commit] cairo/doc/tutorial/src Makefile, 1.1, 1.2 cairo-tutorial-gtk.h, 1.1, 1.2 cairo-tutorial-pdf.h, 1.1, 1.2 cairo-tutorial-png.h, 1.1, 1.2 cairo-tutorial-xlib.h, 1.1, 1.2 circle.c, 1.1, 1.2 expander.c, 1.1, 1.2

Carl Worth commit at pdx.freedesktop.org
Wed Jan 25 02:10:25 PST 2006


Committed by: cworth

Update of /cvs/cairo/cairo/doc/tutorial/src
In directory gabe:/tmp/cvs-serv22130/doc/tutorial/src

Modified Files:
	Makefile cairo-tutorial-gtk.h cairo-tutorial-pdf.h 
	cairo-tutorial-png.h cairo-tutorial-xlib.h circle.c expander.c 
Log Message:

2006-01-25  Carl Worth  <cworth at cworth.org>

        * doc/tutorial/slides/tutorial.xml: A few random changes to the
        slides.

        * doc/tutorial/src/Makefile: Remove pdf build by default, (since
        it is disabled by defalt in cairo 1.0.2).

        * doc/tutorial/src/cairo-tutorial-gtk.h:
        * doc/tutorial/src/cairo-tutorial-pdf.h:
        * doc/tutorial/src/cairo-tutorial-png.h:
        * doc/tutorial/src/cairo-tutorial-xlib.h:
        * doc/tutorial/src/circle.c: (draw):
        * doc/tutorial/src/expander.c: (draw): Change draw interface to
        accept a width and height.

        * doc/tutorial/src/cairo-tutorial-gtk.h: Fix the destroy event
        handler so that clicking on the window manager's 'close window'
        button works.


Index: Makefile
===================================================================
RCS file: /cvs/cairo/cairo/doc/tutorial/src/Makefile,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -d -r1.1 -r1.2
--- Makefile	22 Jul 2005 13:20:53 -0000	1.1
+++ Makefile	25 Jan 2006 10:10:23 -0000	1.2
@@ -2,6 +2,7 @@
 
 # If you don't want to/can't compile all of these targets, then trim
 # this list.
+# all: gtk xlib pdf png
 all: gtk xlib pdf png
 
 GTK_EXAMPLES=$(patsubst %.c,%-gtk,$(wildcard *.c))

Index: cairo-tutorial-gtk.h
===================================================================
RCS file: /cvs/cairo/cairo/doc/tutorial/src/cairo-tutorial-gtk.h,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -d -r1.1 -r1.2
--- cairo-tutorial-gtk.h	22 Jul 2005 13:20:53 -0000	1.1
+++ cairo-tutorial-gtk.h	25 Jan 2006 10:10:23 -0000	1.2
@@ -28,7 +28,7 @@
 #endif
 
 static void
-draw (cairo_t *cr);
+draw (cairo_t *cr, int width, int height);
 
 #if ! GTK_CHECK_VERSION(2,7,0)
 /* copied from gtk+/gdk/gdkcairo.c and gtk+/gdk/x11/gdkdrawable-x11.c
@@ -80,7 +80,7 @@
 
     cr = gdk_cairo_create (widget->window);
 
-    draw (cr);
+    draw (cr, widget->allocation.width, widget->allocation.height);
 
     cairo_destroy (cr);
 
@@ -99,7 +99,7 @@
     gtk_window_set_default_size (GTK_WINDOW (window), WIDTH, HEIGHT);
     gtk_window_set_title (GTK_WINDOW (window), "cairo demo");
 
-    g_signal_connect (window, "destroy-event",
+    g_signal_connect (window, "destroy",
 		      G_CALLBACK (gtk_main_quit), NULL);
 
     drawing_area = gtk_drawing_area_new ();

Index: cairo-tutorial-pdf.h
===================================================================
RCS file: /cvs/cairo/cairo/doc/tutorial/src/cairo-tutorial-pdf.h,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -d -r1.1 -r1.2
--- cairo-tutorial-pdf.h	22 Jul 2005 13:20:53 -0000	1.1
+++ cairo-tutorial-pdf.h	25 Jan 2006 10:10:23 -0000	1.2
@@ -33,7 +33,7 @@
 #endif
 
 static void
-draw (cairo_t *cr);
+draw (cairo_t *cr, int width, int height);
 
 int 
 main (int argc, char **argv)
@@ -61,7 +61,7 @@
     
     cr = cairo_create (surface);
 
-    draw (cr);
+    draw (cr, WIDTH, HEIGHT);
 
     cairo_show_page (cr);
 

Index: cairo-tutorial-png.h
===================================================================
RCS file: /cvs/cairo/cairo/doc/tutorial/src/cairo-tutorial-png.h,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -d -r1.1 -r1.2
--- cairo-tutorial-png.h	22 Jul 2005 13:20:53 -0000	1.1
+++ cairo-tutorial-png.h	25 Jan 2006 10:10:23 -0000	1.2
@@ -32,7 +32,7 @@
 #endif
 
 static void
-draw (cairo_t *cr);
+draw (cairo_t *cr, int width, int height);
 
 int 
 main (int argc, char **argv)
@@ -46,7 +46,7 @@
     
     cr = cairo_create (surface);
 
-    draw (cr);
+    draw (cr, WIDTH, HEIGHT);
 
     filename = strdup (argv[0]);
     assert (filename != NULL);

Index: cairo-tutorial-xlib.h
===================================================================
RCS file: /cvs/cairo/cairo/doc/tutorial/src/cairo-tutorial-xlib.h,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -d -r1.1 -r1.2
--- cairo-tutorial-xlib.h	22 Jul 2005 13:20:53 -0000	1.1
+++ cairo-tutorial-xlib.h	25 Jan 2006 10:10:23 -0000	1.2
@@ -56,7 +56,7 @@
 unsigned int width = WIDTH, height = HEIGHT;
 
 static void
-draw (cairo_t *cr);
+draw (cairo_t *cr, int width, int height);
 
 static void
 handle_expose (Display *dpy, Drawable d)
@@ -68,7 +68,7 @@
 					 width, height);
     cr = cairo_create (surface);
 
-    draw (cr);
+    draw (cr, width, height);
 
     cairo_destroy (cr);
     cairo_surface_destroy (surface);

Index: circle.c
===================================================================
RCS file: /cvs/cairo/cairo/doc/tutorial/src/circle.c,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -d -r1.1 -r1.2
--- circle.c	22 Jul 2005 13:20:53 -0000	1.1
+++ circle.c	25 Jan 2006 10:10:23 -0000	1.2
@@ -1,10 +1,7 @@
-#define WIDTH 50
-#define HEIGHT 50
-
 #include "cairo-tutorial.h"
 
 static void
-draw (cairo_t *cr)
+draw (cairo_t *cr, int width, int height)
 {
     cairo_set_source_rgb (cr, 1.0, 1.0, 1.0);
     cairo_paint (cr);

Index: expander.c
===================================================================
RCS file: /cvs/cairo/cairo/doc/tutorial/src/expander.c,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -d -r1.1 -r1.2
--- expander.c	22 Jul 2005 13:20:53 -0000	1.1
+++ expander.c	25 Jan 2006 10:10:23 -0000	1.2
@@ -1,10 +1,7 @@
-#define WIDTH 50
-#define HEIGHT 50
-
 #include "cairo-tutorial.h"
 
 static void
-draw (cairo_t *cr)
+draw (cairo_t *cr, int width, int height)
 {
     cairo_translate (cr, 24.5, 25);
     cairo_move_to (cr, 5, -2.5);



More information about the cairo-commit mailing list