Compatibility patches, Gtk+2.0 (win32)



Takeing the full tour through the win32/msvc build of gtk+
some small changes in the common sources were required, where
I'm not sure if my changes are acceptable. 
The changes in question are listed here (but detailed patches 
including the usual addition of e.g.  <string.h> are following
with extra mails ...)

Thanks in advance,
	Hans

* gtk+/gtk/gtkstyle.c (gtk_style_realize) : gets called without
a colormap, when invoked from testgtk::entry. I'm not sure where
the bug is, but g_return_if_fail (GDK_IS_COLORMAP (colormap));
avoids immediate crashing ...

* gtk+/gtk/gtkmain.c (check_setugid) : totally disabled on win32;
any objections ?

* gtk+/gtk/gtktreemodel.c : called G_VALUE_LCOPY with an extra
0 parameter. At least msvc doesn't like macros with var args. 
I simply removed the extra 0, was it a feature or a typo ?

* gtk/gtktreeviewcolumn.[hc] (gtk_tree_view_column_set_func) :
removed the extra indirection from the GtkTreeViewColumnFunc parameter,
because the value assignment to the internal struct wasn't working.
I'm not absolutely sure. The problem could have been resolved by
changing the "func" declartion in the struct, but was the pointer
to the function pointer intended ?

* gtk+/gtk/gtktreedatalist.c : include gboxed.h

diff --exclude-from=c:\util\tool\diff.ign -u -r from-cvs/gtk+\gtk/gtk.def
my-gtk/gtk+\gtk/gtk.def
--- from-cvs/gtk+\gtk/gtk.def	Thu Feb 15 22:41:06 2001
+++ my-gtk/gtk+\gtk/gtk.def	Sat Feb 17 22:47:48 2001
@@ -1153,7 +1153,6 @@
 	gtk_text_buffer_get_iter_at_line_offset
 	gtk_text_buffer_get_iter_at_mark
 	gtk_text_buffer_get_iter_at_offset
-	gtk_text_buffer_get_last_iter
 	gtk_text_buffer_get_line_count
 	gtk_text_buffer_get_mark
 	gtk_text_buffer_get_selection_bounds
@@ -1208,7 +1207,6 @@
 	gtk_text_iter_get_text
 	gtk_text_iter_get_toggled_tags
 	gtk_text_iter_in_range
-	gtk_text_iter_is_last
 	gtk_text_iter_reorder
 	gtk_text_iter_spew
 	gtk_text_iter_toggles_tag
@@ -1355,9 +1353,7 @@
 	gtk_tree_set_view_lines
 	gtk_tree_set_view_mode
 	gtk_tree_store_append
-	gtk_tree_store_get
 	gtk_tree_store_get_type
-	gtk_tree_store_get_valist
 	gtk_tree_store_insert
 	gtk_tree_store_insert_after
 	gtk_tree_store_insert_before
@@ -1577,3 +1573,8 @@
 	gtk_window_set_title
 	gtk_window_set_transient_for
 	gtk_window_set_wmclass
+	gtk_image_menu_item_new
+	gtk_label_set_selectable
+	gtk_range_set_inverted
+	gtk_text_buffer_get_end_iter
+	gtk_text_iter_is_end
diff --exclude-from=c:\util\tool\diff.ign -u -r from-cvs/gtk+\gtk/gtklist.c
my-gtk/gtk+\gtk/gtklist.c
--- from-cvs/gtk+\gtk/gtklist.c	Sat Feb 17 09:28:18 2001
+++ my-gtk/gtk+\gtk/gtklist.c	Sat Feb 17 18:04:08 2001
@@ -24,6 +24,8 @@
  * GTK+ at ftp://ftp.gtk.org/pub/gtk/. 
  */
 
+#include <string.h> /* memset */
+
 #include "gtklist.h"
 #include "gtklistitem.h"
 #include "gtkmain.h"
diff --exclude-from=c:\util\tool\diff.ign -u -r from-cvs/gtk+\gtk/gtkmain.c
my-gtk/gtk+\gtk/gtkmain.c
--- from-cvs/gtk+\gtk/gtkmain.c	Thu Feb 15 22:41:08 2001
+++ my-gtk/gtk+\gtk/gtkmain.c	Sat Feb 17 18:12:26 2001
@@ -202,6 +202,8 @@
 static gboolean
 check_setugid (void)
 {
+/* this isn't at all relevant on Windoze and doesn't compile ... --hb */
+#ifndef G_OS_WIN32
   uid_t ruid, euid, suid; /* Real, effective and saved user ID's */
   gid_t rgid, egid, sgid; /* Real, effective and saved group ID's */
   
@@ -231,7 +233,7 @@
 		 "Refusing to initialize GTK+.");
       exit (1);
     }
-
+#endif
   return TRUE;
 }
 
diff --exclude-from=c:\util\tool\diff.ign -u -r from-cvs/gtk+\gtk/gtkmenu.c
my-gtk/gtk+\gtk/gtkmenu.c
--- from-cvs/gtk+\gtk/gtkmenu.c	Sat Feb 17 09:28:18 2001
+++ my-gtk/gtk+\gtk/gtkmenu.c	Sat Feb 17 18:10:32 2001
@@ -25,6 +25,7 @@
  */
 
 #include <ctype.h>
+#include <string.h> /* memset */
 #include "gdk/gdkkeysyms.h"
 #include "gtkbindings.h"
 #include "gtklabel.h"
diff --exclude-from=c:\util\tool\diff.ign -u -r
from-cvs/gtk+\gtk/gtkstyle.c my-gtk/gtk+\gtk/gtkstyle.c
--- from-cvs/gtk+\gtk/gtkstyle.c	Fri Feb 09 22:04:32 2001
+++ my-gtk/gtk+/gtk/gtkstyle.c	Sat Feb 17 23:42:00 2001
@@ -659,6 +659,7 @@
                    GdkColormap *colormap)
 {
   g_return_if_fail (GTK_IS_STYLE (style));
+  g_return_if_fail (GDK_IS_COLORMAP (colormap));
   
   style->colormap = gdk_colormap_ref (colormap);
   style->depth = gdk_colormap_get_visual (colormap)->depth;
diff --exclude-from=c:\util\tool\diff.ign -u -r
from-cvs/gtk+\gtk/gtktreedatalist.c my-gtk/gtk+\gtk/gtktreedatalist.c
--- from-cvs/gtk+\gtk/gtktreedatalist.c	Sat Feb 03 14:11:16 2001
+++ my-gtk/gtk+\gtk/gtktreedatalist.c	Sat Feb 17 19:50:12 2001
@@ -18,6 +18,7 @@
  */
 
 #include "gtktreedatalist.h"
+#include "gobject/gboxed.h"
 #include "gobject/gvalue.h"
 #include "gobject/gvaluetypes.h"
 
diff --exclude-from=c:\util\tool\diff.ign -u -r
from-cvs/gtk+\gtk/gtktreemodel.c my-gtk/gtk+\gtk/gtktreemodel.c
--- from-cvs/gtk+\gtk/gtktreemodel.c	Sat Feb 17 09:28:28 2001
+++ my-gtk/gtk+\gtk/gtktreemodel.c	Sat Feb 17 18:17:48 2001
@@ -1199,7 +1199,7 @@
 
       gtk_tree_model_get_value (GTK_TREE_MODEL (tree_model), iter, column,
&value);
 
-      G_VALUE_LCOPY (&value, var_args, 0, &error);
+      G_VALUE_LCOPY (&value, var_args, &error);
       if (error)
 	{
 	  g_warning ("%s: %s", G_STRLOC, error);
Only in my-gtk/gtk+\gtk: gtktreemodelsimple.c
Only in my-gtk/gtk+\gtk: gtktreemodelsimple.h
diff --exclude-from=c:\util\tool\diff.ign -u -r
from-cvs/gtk+\gtk/gtktreeviewcolumn.c my-gtk/gtk+\gtk/gtktreeviewcolumn.c
--- from-cvs/gtk+\gtk/gtktreeviewcolumn.c	Sat Feb 17 09:28:30 2001
+++ my-gtk/gtk+\gtk/gtktreeviewcolumn.c	Sat Feb 17 19:32:58 2001
@@ -643,7 +643,7 @@
  **/
 void
 gtk_tree_view_column_set_func (GtkTreeViewColumn     *tree_column,
-			       GtkTreeViewColumnFunc *func,
+			       GtkTreeViewColumnFunc  func,
 			       gpointer               func_data,
 			       GtkDestroyNotify       destroy)
 {
diff --exclude-from=c:\util\tool\diff.ign -u -r
from-cvs/gtk+\gtk/gtktreeviewcolumn.h my-gtk/gtk+\gtk/gtktreeviewcolumn.h
--- from-cvs/gtk+\gtk/gtktreeviewcolumn.h	Sat Feb 17 09:28:30 2001
+++ my-gtk/gtk+\gtk/gtktreeviewcolumn.h	Sat Feb 17 19:32:30 2001
@@ -105,7 +105,7 @@
 void               gtk_tree_view_column_set_attributes
(GtkTreeViewColumn     *tree_column,
 							     ...);
 void               gtk_tree_view_column_set_func
(GtkTreeViewColumn     *tree_column,
-							     GtkTreeViewColumnFunc *func,
+							     GtkTreeViewColumnFunc  func,
 							     gpointer               func_data,
 							     GtkDestroyNotify       destroy);
 void               gtk_tree_view_column_clear_attributes
(GtkTreeViewColumn     *tree_column);

-------- Hans "at" Breuer "dot" Org -----------
Tell me what you need, and I'll tell you how to 
get along without it.                -- Dilbert




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