[cairo-commit] gtkcairo/gtkcairo gtkcairo.c,1.1,1.2 gtkcairo.h,1.1,1.2

Evan Martin commit at pdx.freedesktop.org
Wed Nov 19 10:57:49 PST 2003


Committed by: martine

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

Modified Files:
	gtkcairo.c gtkcairo.h 
Log Message:
No functionality changed here.
Removed INSTALL from CVS (it's generated by automake or whatever).

Wed, 19 Nov 2003 10:57:38 -0800  Evan Martin  <martine at danga.com>

	Merged local copy with the version Carl checked into CVS:
	* gtkcairo.c, gtkcairo.h:  Cosmetic changes.
	* demo.c:  Work with different sizes of windows.



Index: gtkcairo.c
===================================================================
RCS file: /cvs/cairo/gtkcairo/gtkcairo/gtkcairo.c,v
retrieving revision 1.1
retrieving revision 1.2
diff -C2 -d -r1.1 -r1.2
*** gtkcairo.c	18 Nov 2003 15:17:07 -0000	1.1
--- gtkcairo.c	19 Nov 2003 18:57:47 -0000	1.2
***************
*** 82,86 ****
  		};
  
! 		gtk_cairo_type = g_type_register_static (GTK_TYPE_WIDGET, "GtkCairo", &gtk_cairo_info, 0);
  	}
  
--- 82,87 ----
  		};
  
! 		gtk_cairo_type = g_type_register_static (GTK_TYPE_WIDGET, "GtkCairo",
! 				&gtk_cairo_info, 0);
  	}
  
***************
*** 117,123 ****
  	GtkWidget *gtkcairo;
  	
! 	gtkcairo = GTK_WIDGET(g_object_new (gtk_cairo_get_type (), NULL));
  
! 	gtk_widget_queue_draw (GTK_WIDGET (gtkcairo));
  
  	return gtkcairo;
--- 118,124 ----
  	GtkWidget *gtkcairo;
  	
! 	gtkcairo = GTK_WIDGET(g_object_new(gtk_cairo_get_type(), NULL));
  
! 	gtk_widget_queue_draw(GTK_WIDGET(gtkcairo));
  
  	return gtkcairo;
***************
*** 147,155 ****
  	gint attributes_mask;
  
! 	g_return_if_fail (widget != NULL);
! 	g_return_if_fail (GTK_IS_CAIRO (widget));
  
! 	GTK_WIDGET_SET_FLAGS (widget, GTK_REALIZED);
! 	gtkcairo = GTK_CAIRO (widget);
  
  	attributes.x = widget->allocation.x;
--- 148,156 ----
  	gint attributes_mask;
  
! 	g_return_if_fail(widget != NULL);
! 	g_return_if_fail(GTK_IS_CAIRO (widget));
  
! 	GTK_WIDGET_SET_FLAGS(widget, GTK_REALIZED);
! 	gtkcairo = GTK_CAIRO(widget);
  
  	attributes.x = widget->allocation.x;
***************
*** 159,173 ****
  	attributes.wclass = GDK_INPUT_OUTPUT;
  	attributes.window_type = GDK_WINDOW_CHILD;
! 	attributes.event_mask = gtk_widget_get_events (widget) | 
! 		GDK_EXPOSURE_MASK/* | GDK_BUTTON_PRESS_MASK | 
! 		GDK_BUTTON_RELEASE_MASK | GDK_POINTER_MOTION_MASK |
! 		GDK_POINTER_MOTION_HINT_MASK*/;
  	attributes.visual = gtk_widget_get_visual (widget);
  	attributes.colormap = gtk_widget_get_colormap (widget);
  	
  	attributes_mask = GDK_WA_X | GDK_WA_Y | GDK_WA_VISUAL | GDK_WA_COLORMAP;
! 	widget->window = gdk_window_new (widget->parent->window, &attributes, attributes_mask);
! 	
! 	widget->style = gtk_style_attach (widget->style, widget->window);
  	
  	gdk_window_set_user_data (widget->window, widget);
--- 160,170 ----
  	attributes.wclass = GDK_INPUT_OUTPUT;
  	attributes.window_type = GDK_WINDOW_CHILD;
! 	attributes.event_mask = gtk_widget_get_events (widget) | GDK_EXPOSURE_MASK;
  	attributes.visual = gtk_widget_get_visual (widget);
  	attributes.colormap = gtk_widget_get_colormap (widget);
  	
  	attributes_mask = GDK_WA_X | GDK_WA_Y | GDK_WA_VISUAL | GDK_WA_COLORMAP;
! 	widget->window = gdk_window_new(widget->parent->window,
! 			&attributes, attributes_mask);
  	
  	gdk_window_set_user_data (widget->window, widget);
***************
*** 201,218 ****
  	gint x_off, y_off;
  
! 	g_return_val_if_fail (widget != NULL, FALSE);
! 	g_return_val_if_fail (GTK_IS_CAIRO (widget), FALSE);
! 	g_return_val_if_fail (event != NULL, FALSE);
  
! 	gtkcairo = GTK_CAIRO (widget);
  
  	/* Ignore GTK+ and use Cairo for drawing. */
! 	gdk_window_get_internal_paint_info (widget->window,
  			&gdkdrawable, &x_off, &y_off);
  
  	/* XXX  X11-specific: */
! 	cairo_set_target_drawable (gtkcairo->cairo,
! 			gdk_x11_drawable_get_xdisplay (gdkdrawable),
! 			gdk_x11_drawable_get_xid (gdkdrawable));
  	/* XXX  :X11-specific */
  
--- 198,215 ----
  	gint x_off, y_off;
  
! 	g_return_val_if_fail(widget != NULL, FALSE);
! 	g_return_val_if_fail(GTK_IS_CAIRO (widget), FALSE);
! 	g_return_val_if_fail(event != NULL, FALSE);
  
! 	gtkcairo = GTK_CAIRO(widget);
  
  	/* Ignore GTK+ and use Cairo for drawing. */
! 	gdk_window_get_internal_paint_info(widget->window,
  			&gdkdrawable, &x_off, &y_off);
  
  	/* XXX  X11-specific: */
! 	cairo_set_target_drawable(gtkcairo->cairo,
! 			gdk_x11_drawable_get_xdisplay(gdkdrawable),
! 			gdk_x11_drawable_get_xid(gdkdrawable));
  	/* XXX  :X11-specific */
  
***************
*** 222,227 ****
  cairo_t*
  gtk_cairo_get_cairo(GtkCairo *gtkcairo) {
! 	g_return_val_if_fail (gtkcairo != NULL, NULL);
! 	g_return_val_if_fail (GTK_IS_CAIRO (gtkcairo), NULL);
  	return gtkcairo->cairo;
  }
--- 219,224 ----
  cairo_t*
  gtk_cairo_get_cairo(GtkCairo *gtkcairo) {
! 	g_return_val_if_fail(gtkcairo != NULL, NULL);
! 	g_return_val_if_fail(GTK_IS_CAIRO(gtkcairo), NULL);
  	return gtkcairo->cairo;
  }

Index: gtkcairo.h
===================================================================
RCS file: /cvs/cairo/gtkcairo/gtkcairo/gtkcairo.h,v
retrieving revision 1.1
retrieving revision 1.2
diff -C2 -d -r1.1 -r1.2
*** gtkcairo.h	18 Nov 2003 15:17:07 -0000	1.1
--- gtkcairo.h	19 Nov 2003 18:57:47 -0000	1.2
***************
*** 32,37 ****
  #define GTK_CAIRO_H
  
- #include <gdk/gdk.h>
- #include <gtk/gtkadjustment.h>
  #include <gtk/gtkwidget.h>
  
--- 32,35 ----
***************
*** 46,51 ****
  #define GTK_IS_CAIRO(obj)	GTK_CHECK_TYPE (obj, gtk_cairo_get_type ())
  
! typedef struct _GtkCairo		GtkCairo;
! typedef struct _GtkCairoClass	GtkCairoClass;
  
  GType      gtk_cairo_get_type   (void);
--- 44,49 ----
  #define GTK_IS_CAIRO(obj)	GTK_CHECK_TYPE (obj, gtk_cairo_get_type ())
  
! typedef struct _GtkCairo        GtkCairo;
! typedef struct _GtkCairoClass   GtkCairoClass;
  
  GType      gtk_cairo_get_type   (void);





More information about the cairo-commit mailing list