[Commits] gtkutils.c 1.5.2.98 1.5.2.99 gtkutils.h 1.4.2.60 1.4.2.61

colin at claws-mail.org colin at claws-mail.org
Mon Oct 17 10:59:50 CEST 2011


Update of /home/claws-mail/claws/src/gtk
In directory claws-mail:/tmp/cvs-serv23768/src/gtk

Modified Files:
      Tag: gtk2
	gtkutils.c gtkutils.h 
Log Message:
2011-10-17 [colin]	3.7.10cvs31

	* src/action.c
	* src/main.c
	* src/gtk/gtkutils.c
	* src/gtk/gtkutils.h
		Undeprecate GIO/GdkCondition

Index: gtkutils.c
===================================================================
RCS file: /home/claws-mail/claws/src/gtk/gtkutils.c,v
retrieving revision 1.5.2.98
retrieving revision 1.5.2.99
diff -u -d -r1.5.2.98 -r1.5.2.99
--- gtkutils.c	7 Oct 2011 09:40:16 -0000	1.5.2.98
+++ gtkutils.c	17 Oct 2011 08:59:47 -0000	1.5.2.99
@@ -1626,36 +1626,26 @@
 	return gui_manager;
 }
 
-#define READ_CONDITION (G_IO_IN | G_IO_HUP | G_IO_ERR)
-#define WRITE_CONDITION (G_IO_OUT | G_IO_ERR)
-#define EXCEPTION_CONDITION (G_IO_PRI)
 typedef struct _ClawsIOClosure ClawsIOClosure;
 
 struct _ClawsIOClosure
 {
-  GdkInputFunction function;
-  GdkInputCondition condition;
+  ClawsIOFunc function;
+  GIOCondition condition;
   GDestroyNotify notify;
   gpointer data;
 };
 
 static gboolean  
 claws_io_invoke (GIOChannel   *source,
-	       GIOCondition  condition,
-	       gpointer      data)
+	         GIOCondition  condition,
+	         gpointer      data)
 {
   ClawsIOClosure *closure = data;
-  GdkInputCondition gdk_cond = 0;
-
-  if (condition & READ_CONDITION)
-    gdk_cond |= GDK_INPUT_READ;
-  if (condition & WRITE_CONDITION)
-    gdk_cond |= GDK_INPUT_WRITE;
-  if (condition & EXCEPTION_CONDITION)
-    gdk_cond |= GDK_INPUT_EXCEPTION;
 
-  if (closure->condition & gdk_cond)
-    closure->function (closure->data, g_io_channel_unix_get_fd (source), gdk_cond);
+  if (closure->condition & condition)
+    closure->function (closure->data, g_io_channel_unix_get_fd (source),
+    		       condition);
 
   return TRUE;
 }
@@ -1673,28 +1663,20 @@
 
 gint
 claws_input_add    (gint	      source,
-		    GdkInputCondition condition,
-		    GdkInputFunction  function,
+		    GIOCondition      condition,
+		    ClawsIOFunc       function,
 		    gpointer	      data,
 		    gboolean	      is_sock)
 {
   guint result;
   ClawsIOClosure *closure = g_new (ClawsIOClosure, 1);
   GIOChannel *channel;
-  GIOCondition cond = 0;
 
   closure->function = function;
   closure->condition = condition;
   closure->notify = NULL;
   closure->data = data;
 
-  if (condition & GDK_INPUT_READ)
-    cond |= READ_CONDITION;
-  if (condition & GDK_INPUT_WRITE)
-    cond |= WRITE_CONDITION;
-  if (condition & GDK_INPUT_EXCEPTION)
-    cond |= EXCEPTION_CONDITION;
-
 #ifndef G_OS_WIN32
   channel = g_io_channel_unix_new (source);
 #else
@@ -1703,7 +1685,7 @@
   else
     channel = g_io_channel_win32_new_fd(source);
 #endif
-  result = g_io_add_watch_full (channel, G_PRIORITY_DEFAULT, cond, 
+  result = g_io_add_watch_full (channel, G_PRIORITY_DEFAULT, condition, 
 				claws_io_invoke,
 				closure, claws_io_destroy);
   g_io_channel_unref (channel);

Index: gtkutils.h
===================================================================
RCS file: /home/claws-mail/claws/src/gtk/gtkutils.h,v
retrieving revision 1.4.2.60
retrieving revision 1.4.2.61
diff -u -d -r1.4.2.60 -r1.4.2.61
--- gtkutils.h	7 Oct 2011 16:06:53 -0000	1.4.2.60
+++ gtkutils.h	17 Oct 2011 08:59:47 -0000	1.4.2.61
@@ -220,12 +220,15 @@
 
 GdkPixbuf *claws_load_pixbuf_fitting(GdkPixbuf *pixbuf, int box_width,
 				     int box_height);
+
+typedef void (*ClawsIOFunc)(gpointer data, gint source, GIOCondition condition);
 gint
 claws_input_add    (gint	      source,
-		    GdkInputCondition condition,
-		    GdkInputFunction  function,
+		    GIOCondition      condition,
+		    ClawsIOFunc       function,
 		    gpointer	      data,
 		    gboolean          is_sock);
+
 #if GTK_CHECK_VERSION(2,12,0)
 #define CLAWS_TIP_DECL() {}
 #define CLAWS_SET_TIP(widget,tip) { 					\



More information about the Commits mailing list