[Commit] cairo-gtk-engine/src cge-draw.c, 1.6, 1.7 cge-style.c, 1.3, 1.4

Julien Boulnois commit at keithp.com
Mon Aug 4 07:08:21 PDT 2003


Committed by: jboulnois

Update of /local/src/CVS/cairo-gtk-engine/src
In directory home.keithp.com:/tmp/cvs-serv30907/src

Modified Files:
	cge-draw.c cge-style.c 
Log Message:
fix


Index: cge-draw.c
===================================================================
RCS file: /local/src/CVS/cairo-gtk-engine/src/cge-draw.c,v
retrieving revision 1.6
retrieving revision 1.7
diff -u -d -r1.6 -r1.7
--- cge-draw.c	4 Aug 2003 12:39:21 -0000	1.6
+++ cge-draw.c	4 Aug 2003 13:08:19 -0000	1.7
@@ -315,13 +315,16 @@
 {
   gint i;
 
+
   for(i=1;i<MAX_STYLES;i++)       
     {
       cge_style *cstyle=&THEME_DATA(style)->styles[i];
       if(cstyle->detail!=NULL && detail!=NULL)     
       {
+	//printf("%s - %s\n",cstyle->detail,detail);
 	if(g_ascii_strncasecmp(cstyle->detail, detail, strlen(detail))==0)  
 	  {
+	    //printf("style %s found\n",detail);
 	    return cstyle;
 	  }
       }
@@ -1034,41 +1037,45 @@
   GdkColor colors[cstyle->fill_style.gradient_colors_count[state_type]];
 
 
-      if(cstyle->fill_style.gradient_colors_default[state_type]==TRUE)
+  //printf("gradient detail: %s\n",detail);
+
+  if(cstyle->fill_style.fill_mode==CGE_FILL_SOLID)
+    return NULL;
+  
+  if(cstyle->fill_style.gradient_colors_default[state_type]==TRUE)
+    {
+      switch(state_type)
 	{
-	  switch(state_type)
-	    {
-	    case GTK_STATE_PRELIGHT:
-	      colors[0]=style->bg[GTK_STATE_PRELIGHT];
-	      colors[1]=style->bg[GTK_STATE_SELECTED];
-	      
-	      break;
-	    default:	  
-	      colors[0]=style->bg[state_type];
-	      colors[1]=color_tint_black(style->bg[state_type],0.96);      
-	    }
+	case GTK_STATE_PRELIGHT:
+	  colors[0]=style->bg[GTK_STATE_PRELIGHT];
+	  colors[1]=style->bg[GTK_STATE_SELECTED];
+	  
+	  break;
+	default:	  
+	  colors[0]=style->bg[state_type];
+	  colors[1]=color_tint_black(style->bg[state_type],0.96);      
 	}
-      else
+    }
+  else
+    {
+      for(i=0;i<cstyle->fill_style.gradient_colors_count[state_type];i++)
 	{
-	  for(i=0;i<cstyle->fill_style.gradient_colors_count[state_type];i++)
-	    {
-	      GdkColor tmp=colors[i]=cstyle->fill_style.gradient_colors[state_type][i];
-	      
-	      colors[i]=tmp;
-	    }
+	  GdkColor tmp=colors[i]=cstyle->fill_style.gradient_colors[state_type][i];
+	  
+	  colors[i]=tmp;
 	}
-      
-      
-      
-      if(cstyle->fill_style.fill_mode==CGE_FILL_SOLID)
-	gradient=NULL;
-      if(cstyle->fill_style.fill_mode==CGE_FILL_GRADIENT)
-	gradient=cge_create_gradient(xrs,
-				     cstyle->fill_style.gradient_colors_count[state_type],
-				     colors,
-				     cstyle->fill_style.gradient_direction,
-				     x_off,y_off,width,height);
-      
+    }
+  
+  
+  
+  
+  if(cstyle->fill_style.fill_mode==CGE_FILL_GRADIENT)
+    gradient=cge_create_gradient(xrs,
+				 cstyle->fill_style.gradient_colors_count[state_type],
+				 colors,
+				 cstyle->fill_style.gradient_direction,
+				 x_off,y_off,width,height);
+  
   return gradient;
 }
 
@@ -1630,37 +1637,40 @@
   gdk_get_off(window,&x_off,&y_off);
 
   gradient=cge_create_gradient_from_rc(xrs,
-					  style,
-					  state_type,
-					  detail,
-					  x_off,y_off,width,height); 
+				       style,
+				       state_type,
+				       detail,
+				       x_off,y_off,width,height); 
 
+  //printf("detail : %s\n",detail);
   //cge_draw_rectangle(xrs,style->bg[state_type],1,x,y,width,height); 
 
+  
+
   if(cstyle->line_style.color_default[state_type]==TRUE)
     color=style->dark[state_type];
   else
     color=cstyle->line_style.color[state_type];
 
   cge_draw_box_gap(xrs,
-		      style->bg[state_type],
-		      gradient,
-		      1,
-		      x,y,width,height,
-		      cstyle->fill_style.round_width,
-		      gap_x,gap_width,
-		      TRUE,0);
+		   style->bg[state_type],
+		   NULL,
+		   1,
+		   x,y,width,height,
+		   cstyle->fill_style.round_width,
+		   gap_x,gap_width,
+		   TRUE,0);
 
   cge_draw_box_gap(xrs,
-		      color,
-		      NULL,
-		      1,
-		      x,y,width,height,
-		      cstyle->line_style.round_width,
-		      gap_x,gap_width,
-		      FALSE,
-		      cstyle->line_style.line_width);
-
+		   color,
+		   NULL,
+		   1,
+		   x,y,width,height,
+		   cstyle->line_style.round_width,
+		   gap_x,gap_width,
+		   FALSE,
+		   cstyle->line_style.line_width);
+  
   if(gradient)
     cairo_surface_destroy(gradient);
   

Index: cge-style.c
===================================================================
RCS file: /local/src/CVS/cairo-gtk-engine/src/cge-style.c,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -d -r1.3 -r1.4
--- cge-style.c	3 Aug 2003 14:12:48 -0000	1.3
+++ cge-style.c	4 Aug 2003 13:08:19 -0000	1.4
@@ -374,6 +374,7 @@
     switch (token) {
     case TOKEN_DETAIL:
       token = theme_parse_char(scanner, TOKEN_DETAIL, &retval->detail);
+      // printf("style %s found\n",retval->detail);
       break;
     case TOKEN_FILL :
       token = theme_parse_fill (settings, scanner, TOKEN_FILL, &retval->fill_style);
@@ -457,22 +458,6 @@
 
   style->arrow_style=CGE_ARROW_NORMAL;
   
-  /*  style->fill_style.fill_mode=CGE_FILL_SOLID;
-  style->fill_style.round_width=4;
-  style->fill_style.gradient_direction=CGE_DIRECTION_VERTICAL;
-
-  for(i=0;i<5;i++)
-    {
-      //style->fill_style.gradient_colors[i]=g_array_new (FALSE, FALSE, sizeof (GdkColor));;
-      style->fill_style.gradient_colors_count[i]=2;
-      style->fill_style.gradient_colors_default[i]=TRUE;
-      style->line_style.color_default[i]=TRUE;
-    }
-  style->line_style.line_mode=CGE_LINE_SOLID;
-  style->line_style.line_width=1;
-  style->line_style.round_width=4;
-  */
-
 }
 
 static void cge_rc_style_class_init (CgeRCStyleClass * klass) {




More information about the Commit mailing list