[cairo-commit] gtkcairo/tests demo.c,1.2,1.3

Evan Martin commit at pdx.freedesktop.org
Mon Nov 24 20:34:22 PST 2003


Committed by: martine

Update of /cvs/cairo/gtkcairo/tests
In directory pdx:/tmp/cvs-serv11631/tests

Modified Files:
	demo.c 
Log Message:
gtkcairo.c, gtkcairo.h:  Add a "redraw" signal.


Index: demo.c
===================================================================
RCS file: /cvs/cairo/gtkcairo/tests/demo.c,v
retrieving revision 1.2
retrieving revision 1.3
diff -C2 -d -r1.2 -r1.3
*** demo.c	19 Nov 2003 18:57:47 -0000	1.2
--- demo.c	25 Nov 2003 04:34:20 -0000	1.3
***************
*** 13,19 ****
  
  static void
! expose(GtkCairo *gtkcairo, gpointer event, GtkRange *range) {
  	GtkWidget *widget = GTK_WIDGET(gtkcairo);
- 	cairo_t *cairo = gtk_cairo_get_cairo(gtkcairo);
  
  	gint width = widget->allocation.width;
--- 13,18 ----
  
  static void
! redraw(GtkCairo *gtkcairo, cairo_t *cairo, GtkRange *range) {
  	GtkWidget *widget = GTK_WIDGET(gtkcairo);
  
  	gint width = widget->allocation.width;
***************
*** 23,28 ****
  	cairo_default_matrix(cairo);
  	cairo_translate(cairo, width/2, height/2);
  	cairo_rotate(cairo, gtk_range_get_value(range));
- 	cairo_translate(cairo, width/32, height/32);
  	cairo_rectangle(cairo, -box_size, -box_size, box_size, box_size);
  	cairo_set_rgb_color(cairo, 1, 1, 1);
--- 22,27 ----
  	cairo_default_matrix(cairo);
  	cairo_translate(cairo, width/2, height/2);
+ 
  	cairo_rotate(cairo, gtk_range_get_value(range));
  	cairo_rectangle(cairo, -box_size, -box_size, box_size, box_size);
  	cairo_set_rgb_color(cairo, 1, 1, 1);
***************
*** 75,80 ****
  	gtkcairo = gtk_cairo_new();
  	gtk_widget_set_usize(GTK_WIDGET(gtkcairo), INITIAL_SIZE, INITIAL_SIZE);
! 	g_signal_connect_after(G_OBJECT(gtkcairo), "expose-event",
! 	                 G_CALLBACK(expose), slider);
  
  	gtk_container_add(GTK_CONTAINER(frame), gtkcairo);
--- 74,79 ----
  	gtkcairo = gtk_cairo_new();
  	gtk_widget_set_usize(GTK_WIDGET(gtkcairo), INITIAL_SIZE, INITIAL_SIZE);
! 	g_signal_connect(G_OBJECT(gtkcairo), "redraw",
! 	                 G_CALLBACK(redraw), slider);
  
  	gtk_container_add(GTK_CONTAINER(frame), gtkcairo);





More information about the cairo-commit mailing list