[cairo-commit] gtkcairo/gtkcairo gtkcairo.c,1.6,1.7 gtkcairo.h,1.5,1.6

OEyvind Kolaas commit at pdx.freedesktop.org
Mon Aug 15 11:12:59 PDT 2005


Committed by: pippin

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

Modified Files:
	gtkcairo.c gtkcairo.h 
Log Message:
Cosmetic cleanup of sources


Index: gtkcairo.c
===================================================================
RCS file: /cvs/cairo/gtkcairo/gtkcairo/gtkcairo.c,v
retrieving revision 1.6
retrieving revision 1.7
diff -C2 -d -r1.6 -r1.7
*** a/gtkcairo.c	15 Feb 2004 17:46:28 -0000	1.6
--- b/gtkcairo.c	21 Feb 2004 14:29:37 -0000	1.7
***************
*** 2,5 ****
--- 2,6 ----
   *
   * Hacked up by Evan Martin <martine at danga.com>.
+  * Further adjusted and modified by Øyvind Kolås <oeyvindk at hig.no>
   *
   * Originally from grrobot:
***************
*** 17,21 ****
   * software for any purpose.  It is provided "as is" without express
   * or implied warranty.
!  * 
   * CARL WORTH DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
   * INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN
--- 18,22 ----
   * software for any purpose.  It is provided "as is" without express
   * or implied warranty.
!  *
   * CARL WORTH DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
   * INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN
***************
*** 42,53 ****
  };
  
! static void gtk_cairo_class_init               (GtkCairoClass    *klass);
! static void gtk_cairo_init                     (GtkCairo         *gtkcairo);
! static void gtk_cairo_destroy                  (GtkObject        *object);
! static void gtk_cairo_realize                  (GtkWidget        *widget);
! static void gtk_cairo_size_allocate            (GtkWidget     *widget,
!                                                 GtkAllocation *allocation);
! static gint gtk_cairo_expose                   (GtkWidget        *widget,
!                                                 GdkEventExpose   *event);
  
  static GtkWidgetClass *parent_class = NULL;
--- 43,64 ----
  };
  
! static void
! gtk_cairo_class_init            (GtkCairoClass *klass);
! 
! static void
! gtk_cairo_init                  (GtkCairo *gtkcairo);
! 
! static void
! gtk_cairo_destroy               (GtkObject *object);
! 
! static void
! gtk_cairo_realize               (GtkWidget *widget);
! 
! static void
! gtk_cairo_size_allocate         (GtkWidget     *widget,
!                                  GtkAllocation *allocation);
! static gint
! gtk_cairo_expose                (GtkWidget      *widget,
!                                  GdkEventExpose *event);
  
  static GtkWidgetClass *parent_class = NULL;
***************
*** 55,59 ****
  
  GType
! gtk_cairo_get_type ()
  {
  	static GType gtk_cairo_type = 0;
--- 66,70 ----
  
  GType
! gtk_cairo_get_type (void)
  {
  	static GType gtk_cairo_type = 0;
***************
*** 73,77 ****
  
  		gtk_cairo_type = g_type_register_static (GTK_TYPE_WIDGET, "GtkCairo",
! 				&gtk_cairo_info, 0);
  	}
  
--- 84,88 ----
  
  		gtk_cairo_type = g_type_register_static (GTK_TYPE_WIDGET, "GtkCairo",
! 				                                 &gtk_cairo_info, 0);
  	}
  
***************
*** 107,118 ****
  static void
  gtk_cairo_init (GtkCairo *gtkcairo)
! {      
  #ifdef CAIRO_HAS_GLX_SURFACE
!     gtkcairo->glx = 1;
      gtkcairo->surface = NULL;
  #endif
  #ifndef CAIRO_HAS_GLX_SURFACE
      gtkcairo->glx = 0;
! #endif    
  	gtkcairo->cairo = cairo_create ();
  }
--- 118,129 ----
  static void
  gtk_cairo_init (GtkCairo *gtkcairo)
! {
  #ifdef CAIRO_HAS_GLX_SURFACE
!     gtkcairo->glx = 0;
      gtkcairo->surface = NULL;
  #endif
  #ifndef CAIRO_HAS_GLX_SURFACE
      gtkcairo->glx = 0;
! #endif
  	gtkcairo->cairo = cairo_create ();
  }
***************
*** 121,126 ****
  gtk_cairo_new (void)
  {
! 	GtkWidget *gtkcairo;    
! 	
  	gtkcairo = GTK_WIDGET (g_object_new (GTK_TYPE_CAIRO, NULL));
  
--- 132,136 ----
  gtk_cairo_new (void)
  {
! 	GtkWidget *gtkcairo;
  	gtkcairo = GTK_WIDGET (g_object_new (GTK_TYPE_CAIRO, NULL));
  
***************
*** 182,194 ****
              attributes.colormap = gdk_colormap_new (attributes.visual, TRUE);
  
!     	    attributes_mask = GDK_WA_X | GDK_WA_Y | GDK_WA_VISUAL | GDK_WA_COLORMAP;
  
!     	    widget->window = gdk_window_new (gtk_widget_get_parent_window (widget),
!     			    &attributes, attributes_mask);
  
              gtkcairo->surface =
                cairo_glx_surface_create_for_window (gdk_x11_get_default_xdisplay (),
!                                  DefaultScreen (gdk_x11_get_default_xdisplay ()),
!                                 0, gdk_x11_drawable_get_xid (widget->window));
  
              cairo_set_target_surface (gtkcairo->cairo, gtkcairo->surface); 
--- 192,204 ----
              attributes.colormap = gdk_colormap_new (attributes.visual, TRUE);
  
! 		    attributes_mask = GDK_WA_X | GDK_WA_Y | GDK_WA_VISUAL | GDK_WA_COLORMAP;
  
! 		    widget->window = gdk_window_new (gtk_widget_get_parent_window (widget),
! 			                                 &attributes, attributes_mask);
  
              gtkcairo->surface =
                cairo_glx_surface_create_for_window (gdk_x11_get_default_xdisplay (),
!                                DefaultScreen (gdk_x11_get_default_xdisplay ()),
!                                0, gdk_x11_drawable_get_xid (widget->window));
  
              cairo_set_target_surface (gtkcairo->cairo, gtkcairo->surface); 
***************
*** 198,203 ****
         }
      }
!         
!     if (!gtkcairo->glx){
  #endif
  	    attributes.colormap = gtk_widget_get_colormap (widget);
--- 208,213 ----
         }
      }
! 
! 	if (!gtkcairo->glx){
  #endif
  	    attributes.colormap = gtk_widget_get_colormap (widget);
***************
*** 209,213 ****
      }
  #endif
!     
  	gtk_style_attach (widget->style, widget->window);
  	gtk_style_set_background (widget->style, widget->window, GTK_STATE_NORMAL);
--- 219,223 ----
      }
  #endif
!  
  	gtk_style_attach (widget->style, widget->window);
  	gtk_style_set_background (widget->style, widget->window, GTK_STATE_NORMAL);
***************
*** 235,240 ****
              if (gtkcairo->glx && gtkcairo->surface) {
                  cairo_gl_surface_realize (gtkcairo->surface);
!             } 
! #endif            
  	}
  }
--- 245,250 ----
              if (gtkcairo->glx && gtkcairo->surface) {
                  cairo_gl_surface_realize (gtkcairo->surface);
!             }
! #endif
  	}
  }
***************
*** 254,260 ****
  #ifdef CAIRO_HAS_GLX_SURFACE
      if (gtkcairo->glx) {
!         cairo_rectangle (gtkcairo->cairo, 0, 0, widget->allocation.width, widget->allocation.height);
!         cairo_set_rgb_color(gtkcairo->cairo, 0.7, 0.7, 0.7);
!         cairo_fill (gtkcairo->cairo);    
  
  	    g_signal_emit_by_name (gtkcairo, "redraw", gtkcairo->cairo);
--- 264,272 ----
  #ifdef CAIRO_HAS_GLX_SURFACE
      if (gtkcairo->glx) {
!         cairo_rectangle (gtkcairo->cairo,
! 						 0, 0,
! 						 widget->allocation.width, widget->allocation.height);
!         cairo_set_rgb_color (gtkcairo->cairo, 0.7, 0.7, 0.7);
!         cairo_fill      (gtkcairo->cairo);
  
  	    g_signal_emit_by_name (gtkcairo, "redraw", gtkcairo->cairo);
***************
*** 266,274 ****
  
  	    gdk_window_get_internal_paint_info (widget->window,
! 			    &gdkdrawable, &x_off, &y_off);
  
  	    cairo_set_target_drawable (gtkcairo->cairo,
! 			    gdk_x11_drawable_get_xdisplay (gdkdrawable),
! 			    gdk_x11_drawable_get_xid (gdkdrawable));
  
  	    /* counter offset of expose */
--- 278,286 ----
  
  	    gdk_window_get_internal_paint_info (widget->window,
! 			                                &gdkdrawable, &x_off, &y_off);
  
  	    cairo_set_target_drawable (gtkcairo->cairo,
! 			                       gdk_x11_drawable_get_xdisplay (gdkdrawable),
! 			                       gdk_x11_drawable_get_xid (gdkdrawable));
  
  	    /* counter offset of expose */
***************
*** 285,289 ****
  #ifdef CAIRO_HAS_GLX_SURFACE
      }
! #endif    
  	return FALSE;
  }
--- 297,301 ----
  #ifdef CAIRO_HAS_GLX_SURFACE
      }
! #endif
  	return FALSE;
  }

Index: gtkcairo.h
===================================================================
RCS file: /cvs/cairo/gtkcairo/gtkcairo/gtkcairo.h,v
retrieving revision 1.5
retrieving revision 1.6
diff -C2 -d -r1.5 -r1.6
*** a/gtkcairo.h	15 Feb 2004 17:46:28 -0000	1.5
--- b/gtkcairo.h	21 Feb 2004 14:29:37 -0000	1.6
***************
*** 2,5 ****
--- 2,6 ----
   *
   * Hacked up by Evan Martin <martine at danga.com>.
+  * Further adjusted and modified by Øyvind Kolås <oeyvindk at hig.no>
   *
   * Originally from Ricochet Robots:
***************
*** 17,21 ****
   * software for any purpose.  It is provided "as is" without express
   * or implied warranty.
!  * 
   * CARL WORTH DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
   * INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN
--- 18,22 ----
   * software for any purpose.  It is provided "as is" without express
   * or implied warranty.
!  *
   * CARL WORTH DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
   * INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN
***************
*** 54,63 ****
  /* all fields are private */
  	cairo_t *cairo;
!     
      int glx;
  #ifdef CAIRO_HAS_GLX_SURFACE
      cairo_surface_t *surface;
  #endif
!     
  };
  
--- 55,64 ----
  /* all fields are private */
  	cairo_t *cairo;
! 
      int glx;
  #ifdef CAIRO_HAS_GLX_SURFACE
      cairo_surface_t *surface;
  #endif
! 
  };
  
***************
*** 68,75 ****
  };
  
! GType      gtk_cairo_get_type   (void);
! GtkWidget* gtk_cairo_new        (void);
  
! cairo_t*   gtk_cairo_get_cairo  (GtkCairo *gtkcairo);
  
  
--- 69,80 ----
  };
  
! GType
! gtk_cairo_get_type              (void);
  
! GtkWidget*
! gtk_cairo_new                   (void);
! 
! cairo_t*
! gtk_cairo_get_cairo             (GtkCairo *gtkcairo);
  
  





More information about the cairo-commit mailing list