Two small fixes




Here is a patch to fix two small problems. First, in
gtk/gtkclist.[ch], gtk_clist_row_isvisable should be spelled
gtk_clist_row_is_visible. This is a minor point but since it is
technically an API change it would be good to fix this before
1.0. Second, gtk{bbox,hbbox,vbbox}.[ch] use a series of #define's to
name some constants that are used to define the layout style for
button boxes. The patch replaces this with an enum to be more
consistent with the rest gtk. This also makes it easier to update the
guile-gtk bindings in the Gnome repository to the latest CVS version
of gtk.

The patch is against the latest cvs version. I compiled gtk+ and tried
the applicable parts of testgtk after this patch, and everything
worked. I'd appreicate if someone could apply it soon. It's also been
uploaded to the incoming directory at ftp.gimp.org as
gtk-mstachow-980224-0.patch. If someone approves it, I can also apply
it myself; I'm hesitant to do this without asking because I've never
modified gtk before.

Index: gtk/gtkbbox.c
===================================================================
RCS file: /debian/home/gnomecvs/gtk+/gtk/gtkbbox.c,v
retrieving revision 1.2
diff -u -r1.2 gtkbbox.c
--- gtkbbox.c	1998/01/16 00:49:27	1.2
+++ gtkbbox.c	1998/02/25 00:16:33
@@ -63,11 +63,11 @@
 static void
 gtk_button_box_init (GtkButtonBox *button_box)
 {
-  button_box->spacing = GTK_BUTTONBOX_DEFAULT;
-  button_box->child_min_width = GTK_BUTTONBOX_DEFAULT;
-  button_box->child_min_height = GTK_BUTTONBOX_DEFAULT;
-  button_box->child_ipad_x = GTK_BUTTONBOX_DEFAULT;
-  button_box->child_ipad_y = GTK_BUTTONBOX_DEFAULT;
+  button_box->spacing = GTK_BUTTONBOX_DEFAULT_VALUE;
+  button_box->child_min_width = GTK_BUTTONBOX_DEFAULT_VALUE;
+  button_box->child_min_height = GTK_BUTTONBOX_DEFAULT_VALUE;
+  button_box->child_ipad_x = GTK_BUTTONBOX_DEFAULT_VALUE;
+  button_box->child_ipad_y = GTK_BUTTONBOX_DEFAULT_VALUE;
   button_box->layout_style = GTK_BUTTONBOX_DEFAULT;
 }
 
@@ -121,7 +121,8 @@
   widget->child_ipad_y = ipad_y;
 }
 
-void gtk_button_box_set_layout (GtkButtonBox *widget, gint layout_style)
+void gtk_button_box_set_layout (GtkButtonBox *widget, 
+				GtkButtonBoxStyle layout_style)
 {
   widget->layout_style = layout_style;
 }
@@ -148,7 +149,7 @@
   *ipad_y = widget->child_ipad_y;
 }
 
-gint gtk_button_box_get_layout (GtkButtonBox *widget)
+GtkButtonBoxStyle gtk_button_box_get_layout (GtkButtonBox *widget)
 {
   return widget->layout_style;
 }
Index: gtk/gtkbbox.h
===================================================================
RCS file: /debian/home/gnomecvs/gtk+/gtk/gtkbbox.h,v
retrieving revision 1.1.1.1
diff -u -r1.1.1.1 gtkbbox.h
--- gtkbbox.h	1997/11/24 22:37:50	1.1.1.1
+++ gtkbbox.h	1998/02/25 00:16:33
@@ -24,17 +24,22 @@
 #ifdef __cplusplus
 extern "C" {
 #endif /* __cplusplus */
-
+  
 
 #define GTK_BUTTON_BOX(obj)          GTK_CHECK_CAST (obj, gtk_button_box_get_type (), GtkButtonBox)
 #define GTK_BUTTON_BOX_CLASS(klass)  GTK_CHECK_CLASS_CAST (klass, gtk_button_box_get_type (), GtkButtonBoxClass)
 #define GTK_IS_BUTTON_BOX(obj)       GTK_CHECK_TYPE (obj, gtk_button_box_get_type ())
+  
 
-#define GTK_BUTTONBOX_DEFAULT -1
-#define GTK_BUTTONBOX_SPREAD   1
-#define GTK_BUTTONBOX_EDGE     2
-#define GTK_BUTTONBOX_START    3
-#define GTK_BUTTONBOX_END      4
+#define GTK_BUTTONBOX_DEFAULT_VALUE -1
+ 
+typedef enum {
+  GTK_BUTTONBOX_DEFAULT = -1,
+  GTK_BUTTONBOX_SPREAD = 1,
+  GTK_BUTTONBOX_EDGE = 2,
+  GTK_BUTTONBOX_START = 3,
+  GTK_BUTTONBOX_END = 4
+} GtkButtonBoxStyle;
 
 typedef struct _GtkButtonBox       GtkButtonBox;
 typedef struct _GtkButtonBoxClass  GtkButtonBoxClass;
@@ -47,7 +52,7 @@
   gint child_min_height;
   gint child_ipad_x;
   gint child_ipad_y;
-  gint layout_style;
+  GtkButtonBoxStyle layout_style;
 };
 
 struct _GtkButtonBoxClass
@@ -65,13 +70,14 @@
 void gtk_button_box_set_child_ipadding_default (gint ipad_x, gint ipad_y);
 
 gint gtk_button_box_get_spacing (GtkButtonBox *widget);
-gint gtk_button_box_get_layout (GtkButtonBox *widget);
+GtkButtonBoxStyle gtk_button_box_get_layout (GtkButtonBox *widget);
 void gtk_button_box_get_child_size (GtkButtonBox *widget,
 				    gint *min_width, gint *min_height);
 void gtk_button_box_get_child_ipadding (GtkButtonBox *widget, gint *ipad_x, gint *ipad_y);
 
 void gtk_button_box_set_spacing (GtkButtonBox *widget, gint spacing);
-void gtk_button_box_set_layout (GtkButtonBox *widget, gint layout_style);
+void gtk_button_box_set_layout (GtkButtonBox *widget, 
+				GtkButtonBoxStyle layout_style);
 void gtk_button_box_set_child_size (GtkButtonBox *widget,
 				    gint min_width, gint min_height);
 void gtk_button_box_set_child_ipadding (GtkButtonBox *widget, gint ipad_x, gint ipad_y);
Index: gtk/gtkclist.c
===================================================================
RCS file: /debian/home/gnomecvs/gtk+/gtk/gtkclist.c,v
retrieving revision 1.26
diff -u -r1.26 gtkclist.c
--- gtkclist.c	1998/02/23 01:50:22	1.26
+++ gtkclist.c	1998/02/25 00:16:33
@@ -933,7 +933,7 @@
   /* redraw the list if it's not frozen */
   if (!GTK_CLIST_FROZEN (clist))
     {
-      if (gtk_clist_row_isvisable (clist, row))
+      if (gtk_clist_row_isvisible (clist, row))
 	draw_row (clist, NULL, row, clist_row);
     }
 }
@@ -989,7 +989,7 @@
   /* redraw the list if it's not frozen */
   if (!GTK_CLIST_FROZEN (clist))
     {
-      if (gtk_clist_row_isvisable (clist, row))
+      if (gtk_clist_row_isvisible (clist, row))
 	draw_row (clist, NULL, row, clist_row);
     }
 }
@@ -1050,7 +1050,7 @@
   /* redraw the list if it's not frozen */
   if (!GTK_CLIST_FROZEN (clist))
     {
-      if (gtk_clist_row_isvisable (clist, row))
+      if (gtk_clist_row_isvisible (clist, row))
 	draw_row (clist, NULL, row, clist_row);
     }
 }
@@ -1107,7 +1107,7 @@
   clist_row->foreground = *color;
   clist_row->fg_set = TRUE;
 
-  if (!GTK_CLIST_FROZEN (clist) && gtk_clist_row_isvisable (clist, row))
+  if (!GTK_CLIST_FROZEN (clist) && gtk_clist_row_isvisible (clist, row))
     draw_row (clist, NULL, row, clist_row);
 }
 
@@ -1127,7 +1127,7 @@
   clist_row->background = *color;
   clist_row->bg_set = TRUE;
 
-  if (!GTK_CLIST_FROZEN (clist) && gtk_clist_row_isvisable (clist, row))
+  if (!GTK_CLIST_FROZEN (clist) && gtk_clist_row_isvisible (clist, row))
     draw_row (clist, NULL, row, clist_row);
 }
 
@@ -1152,7 +1152,7 @@
   clist_row->cell[column].vertical = vertical;
   clist_row->cell[column].horizontal = horizontal;
 
-  if (!GTK_CLIST_FROZEN (clist) && gtk_clist_row_isvisable (clist, row))
+  if (!GTK_CLIST_FROZEN (clist) && gtk_clist_row_isvisible (clist, row))
     draw_row (clist, NULL, row, clist_row);
 }
 
@@ -1201,7 +1201,7 @@
     {
       adjust_scrollbars (clist);
 
-      if (gtk_clist_row_isvisable (clist, clist->rows - 1))
+      if (gtk_clist_row_isvisible (clist, clist->rows - 1))
 	draw_rows (clist, NULL);
     }
 
@@ -1252,7 +1252,7 @@
     {
       adjust_scrollbars (clist);
 
-      if (gtk_clist_row_isvisable (clist, row))
+      if (gtk_clist_row_isvisible (clist, row))
 	draw_rows (clist, NULL);
     }
 }
@@ -1271,7 +1271,7 @@
   if (row < 0 || row > (clist->rows - 1))
     return;
 
-  was_visible = gtk_clist_row_isvisable (clist, row);
+  was_visible = gtk_clist_row_isvisible (clist, row);
 
   /* get the row we're going to delete */
   list = g_list_nth (clist->row_list, row);
@@ -1461,7 +1461,7 @@
 }
 
 gint
-gtk_clist_row_isvisable (GtkCList * clist,
+gtk_clist_row_isvisible (GtkCList * clist,
 			 gint row)
 {
   g_return_val_if_fail (clist != NULL, 0);
@@ -2775,7 +2775,7 @@
 		  clist->selection = g_list_append (clist->selection, clist_row);
 		}
 
-	      if (!GTK_CLIST_FROZEN (clist) && gtk_clist_row_isvisable (clist, row))
+	      if (!GTK_CLIST_FROZEN (clist) && gtk_clist_row_isvisible (clist, row))
 		draw_row (clist, NULL, row, clist_row);
 	    }
 	  else if (clist_row->state == GTK_STATE_SELECTED)
@@ -2803,7 +2803,7 @@
 	      	  clist_row->state = GTK_STATE_SELECTED;
 		  clist->selection = g_list_append (clist->selection, clist_row);
 		
-		  if (!GTK_CLIST_FROZEN (clist) && gtk_clist_row_isvisable (clist, row))
+		  if (!GTK_CLIST_FROZEN (clist) && gtk_clist_row_isvisible (clist, row))
 		    draw_row (clist, NULL, row, clist_row);
 		}
 	    }
@@ -2839,7 +2839,7 @@
 		  clist_row->state = GTK_STATE_SELECTED;
 		}
 
-	      if (!GTK_CLIST_FROZEN (clist) && gtk_clist_row_isvisable (clist, row))
+	      if (!GTK_CLIST_FROZEN (clist) && gtk_clist_row_isvisible (clist, row))
 		draw_row (clist, NULL, row, clist_row);
 	    }
 
@@ -2872,7 +2872,7 @@
   clist_row->state = GTK_STATE_NORMAL;
   clist->selection = g_list_remove (clist->selection, clist_row);
 
-  if (!GTK_CLIST_FROZEN (clist) && gtk_clist_row_isvisable (clist, row))
+  if (!GTK_CLIST_FROZEN (clist) && gtk_clist_row_isvisible (clist, row))
     draw_row (clist, NULL, row, clist_row);
 }
 
Index: gtk/gtkclist.h
===================================================================
RCS file: /debian/home/gnomecvs/gtk+/gtk/gtkclist.h,v
retrieving revision 1.11
diff -u -r1.11 gtkclist.h
--- gtkclist.h	1998/02/20 05:29:03	1.11
+++ gtkclist.h	1998/02/25 00:16:34
@@ -352,7 +352,7 @@
 		       gfloat col_align);
 
 /* returns true if the row is visible */
-gint gtk_clist_row_isvisable (GtkCList * clist,
+gint gtk_clist_row_isvisible (GtkCList * clist,
 			      gint row);
 
 /* returns the cell type */
Index: gtk/gtkhbbox.c
===================================================================
RCS file: /debian/home/gnomecvs/gtk+/gtk/gtkhbbox.c,v
retrieving revision 1.2
diff -u -r1.2 gtkhbbox.c
--- gtkhbbox.c	1998/01/16 00:49:32	1.2
+++ gtkhbbox.c	1998/02/25 00:16:34
@@ -91,7 +91,7 @@
 
 /* set default value for layout style */
 
-void gtk_hbutton_box_set_layout_default (gint layout)
+void gtk_hbutton_box_set_layout_default (GtkButtonBoxStyle layout)
 {
   default_layout_style = layout;
 }
@@ -106,7 +106,7 @@
 
 /* get default value for layout style */
 
-gint gtk_hbutton_box_get_layout_default (void)
+GtkButtonBoxStyle gtk_hbutton_box_get_layout_default (void)
 {
   return default_layout_style;
 }
@@ -123,7 +123,7 @@
   gint child_width;
   gint child_height;
   gint spacing;
-  gint layout;
+  GtkButtonBoxStyle layout;
   
   g_return_if_fail (widget != NULL);
   g_return_if_fail (GTK_IS_HBUTTON_BOX (widget));
@@ -132,7 +132,7 @@
   box = GTK_BOX (widget);
   bbox = GTK_BUTTON_BOX (widget);
 
-  spacing = bbox->spacing != GTK_BUTTONBOX_DEFAULT
+  spacing = bbox->spacing != GTK_BUTTONBOX_DEFAULT_VALUE
 	  ? bbox->spacing : default_spacing;
   layout = bbox->layout_style != GTK_BUTTONBOX_DEFAULT
 	  ? bbox->layout_style : default_layout_style;
@@ -191,7 +191,7 @@
   gint width;
   gint childspace;
   gint childspacing = 0;
-  gint layout;
+  GtkButtonBoxStyle layout;
   gint spacing;
   
   g_return_if_fail (widget != NULL);
@@ -200,7 +200,7 @@
 
   box = GTK_BUTTON_BOX (widget);
   hbox = GTK_HBUTTON_BOX (widget);
-  spacing = box->spacing != GTK_BUTTONBOX_DEFAULT
+  spacing = box->spacing != GTK_BUTTONBOX_DEFAULT_VALUE
 	  ? box->spacing : default_spacing;
   layout = box->layout_style != GTK_BUTTONBOX_DEFAULT
 	  ? box->layout_style : default_layout_style;
Index: gtk/gtkhbbox.h
===================================================================
RCS file: /debian/home/gnomecvs/gtk+/gtk/gtkhbbox.h,v
retrieving revision 1.1.1.1
diff -u -r1.1.1.1 gtkhbbox.h
--- gtkhbbox.h	1997/11/24 22:37:50	1.1.1.1
+++ gtkhbbox.h	1998/02/25 00:16:34
@@ -52,10 +52,10 @@
 /* buttons can be added by gtk_container_add() */
 
 gint gtk_hbutton_box_get_spacing_default (void);
-gint gtk_hbutton_box_get_layout_default (void);
+GtkButtonBoxStyle gtk_hbutton_box_get_layout_default (void);
 
 void gtk_hbutton_box_set_spacing_default (gint spacing);
-void gtk_hbutton_box_set_layout_default (gint layout);
+void gtk_hbutton_box_set_layout_default (GtkButtonBoxStyle layout);
 
 
 #ifdef __cplusplus
Index: gtk/gtkvbbox.c
===================================================================
RCS file: /debian/home/gnomecvs/gtk+/gtk/gtkvbbox.c,v
retrieving revision 1.2
diff -u -r1.2 gtkvbbox.c
--- gtkvbbox.c	1998/01/16 00:49:48	1.2
+++ gtkvbbox.c	1998/02/25 00:16:34
@@ -26,7 +26,7 @@
 					   GtkAllocation  *allocation);
 
 static gint default_spacing = 10;
-static gint default_layout_style = GTK_BUTTONBOX_EDGE;
+static GtkButtonBoxStyle default_layout_style = GTK_BUTTONBOX_EDGE;
 
 guint
 gtk_vbutton_box_get_type ()
@@ -90,7 +90,7 @@
 
 /* set default value for layout style */
 
-void gtk_vbutton_box_set_layout_default (gint layout)
+void gtk_vbutton_box_set_layout_default (GtkButtonBoxStyle layout)
 {
   default_layout_style = layout;
 }
@@ -106,14 +106,14 @@
 
 /* get default value for layout style */
 
-gint gtk_vbutton_box_get_layout_default (void)
+GtkButtonBoxStyle gtk_vbutton_box_get_layout_default (void)
 {
   return default_layout_style;
 }
 
 
 
-  
+
 static void
 gtk_vbutton_box_size_request (GtkWidget      *widget,
 			      GtkRequisition *requisition)
@@ -124,7 +124,7 @@
   gint child_width;
   gint child_height;
   gint spacing;
-  gint layout;
+  GtkButtonBoxStyle layout;
   
   g_return_if_fail (widget != NULL);
   g_return_if_fail (GTK_IS_VBUTTON_BOX (widget));
@@ -133,7 +133,7 @@
   box = GTK_BOX (widget);
   bbox = GTK_BUTTON_BOX (widget);
 
-  spacing = bbox->spacing != GTK_BUTTONBOX_DEFAULT
+  spacing = bbox->spacing != GTK_BUTTONBOX_DEFAULT_VALUE
 	  ? bbox->spacing : default_spacing;
   layout = bbox->layout_style != GTK_BUTTONBOX_DEFAULT
 	  ? bbox->layout_style : default_layout_style;
@@ -193,7 +193,7 @@
   gint height;
   gint childspace;
   gint childspacing = 0;
-  gint layout;
+  GtkButtonBoxStyle layout;
   gint spacing;
   
   g_return_if_fail (widget != NULL);
@@ -202,7 +202,7 @@
 
   box = GTK_BUTTON_BOX (widget);
   hbox = GTK_VBUTTON_BOX (widget);
-  spacing = box->spacing != GTK_BUTTONBOX_DEFAULT
+  spacing = box->spacing != GTK_BUTTONBOX_DEFAULT_VALUE
 	  ? box->spacing : default_spacing;
   layout = box->layout_style != GTK_BUTTONBOX_DEFAULT
 	  ? box->layout_style : default_layout_style;
Index: gtk/gtkvbbox.h
===================================================================
RCS file: /debian/home/gnomecvs/gtk+/gtk/gtkvbbox.h,v
retrieving revision 1.2
diff -u -r1.2 gtkvbbox.h
--- gtkvbbox.h	1998/01/17 23:24:08	1.2
+++ gtkvbbox.h	1998/02/25 00:16:34
@@ -54,8 +54,8 @@
 gint gtk_vbutton_box_get_spacing_default (void);
 void gtk_vbutton_box_set_spacing_default (gint spacing);
 
-gint gtk_vbutton_box_get_layout_default (void);
-void gtk_vbutton_box_set_layout_default (gint layout);
+GtkButtonBoxStyle gtk_vbutton_box_get_layout_default (void);
+void gtk_vbutton_box_set_layout_default (GtkButtonBoxStyle layout);
 
 
 #ifdef __cplusplus




[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]