talons

Fork of Claws Mail https://www.claws-mail
Log | Files | Refs | README | LICENSE

commit 5370d75fe2c88c0147ef8309e6fb646ffa855c38
parent b6b8c2b9c9ef0e2f9e07f7f7430d0de5b2cb09df
Author: Colin Leroy <colin@colino.net>
Date:   Mon, 17 Oct 2011 08:59:49 +0000

2011-10-17 [colin]	3.7.10cvs31

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

Diffstat:
MChangeLog | 8++++++++
MPATCHSETS | 1+
Mconfigure.ac | 2+-
Msrc/action.c | 22+++++++++++-----------
Msrc/gtk/gtkutils.c | 38++++++++++----------------------------
Msrc/gtk/gtkutils.h | 7+++++--
Msrc/main.c | 10+++++-----
7 files changed, 41 insertions(+), 47 deletions(-)

diff --git a/ChangeLog b/ChangeLog @@ -1,3 +1,11 @@ +2011-10-17 [colin] 3.7.10cvs31 + + * src/action.c + * src/main.c + * src/gtk/gtkutils.c + * src/gtk/gtkutils.h + Undeprecate GIO/GdkCondition + 2011-10-16 [mones] 3.7.10cvs30 * src/main.c diff --git a/PATCHSETS b/PATCHSETS @@ -4234,3 +4234,4 @@ ( cvs diff -u -r 1.382.2.584 -r 1.382.2.585 src/compose.c; ) > 3.7.10cvs28.patchset ( cvs diff -u -r 1.1.2.57 -r 1.1.2.58 manual/advanced.xml; ) > 3.7.10cvs29.patchset ( cvs diff -u -r 1.115.2.239 -r 1.115.2.240 src/main.c; ) > 3.7.10cvs30.patchset +( cvs diff -u -r 1.12.2.69 -r 1.12.2.70 src/action.c; cvs diff -u -r 1.115.2.240 -r 1.115.2.241 src/main.c; cvs diff -u -r 1.5.2.98 -r 1.5.2.99 src/gtk/gtkutils.c; cvs diff -u -r 1.4.2.60 -r 1.4.2.61 src/gtk/gtkutils.h; ) > 3.7.10cvs31.patchset diff --git a/configure.ac b/configure.ac @@ -12,7 +12,7 @@ MINOR_VERSION=7 MICRO_VERSION=10 INTERFACE_AGE=0 BINARY_AGE=0 -EXTRA_VERSION=30 +EXTRA_VERSION=31 EXTRA_RELEASE= EXTRA_GTK2_VERSION= diff --git a/src/action.c b/src/action.c @@ -180,13 +180,13 @@ static gint io_dialog_key_pressed_cb (GtkWidget *widget, static void catch_output (gpointer data, gint source, - GdkInputCondition cond); + GIOCondition cond); static void catch_input (gpointer data, gint source, - GdkInputCondition cond); + GIOCondition cond); static void catch_status (gpointer data, gint source, - GdkInputCondition cond); + GIOCondition cond); static gchar *get_user_string (const gchar *action, ActionType type); @@ -905,7 +905,7 @@ static gboolean execute_actions(gchar *action, GSList *msg_list, child_info->data = data; child_info->tag_status = claws_input_add(child_info->chld_status, - GDK_INPUT_READ, + G_IO_IN | G_IO_HUP | G_IO_ERR, catch_status, child_info, FALSE); } @@ -1072,9 +1072,9 @@ static ChildInfo *fork_child(gchar *cmd, const gchar *msg_str, child_info->chld_err = chld_err[0]; child_info->chld_status = chld_status[0]; child_info->tag_in = -1; - child_info->tag_out = claws_input_add(chld_out[0], GDK_INPUT_READ, + child_info->tag_out = claws_input_add(chld_out[0], G_IO_IN | G_IO_HUP | G_IO_ERR, catch_output, child_info, FALSE); - child_info->tag_err = claws_input_add(chld_err[0], GDK_INPUT_READ, + child_info->tag_err = claws_input_add(chld_err[0], G_IO_IN | G_IO_HUP | G_IO_ERR, catch_output, child_info, FALSE); if (!(children->action_type & @@ -1158,7 +1158,7 @@ static void send_input(GtkWidget *w, gpointer data) ChildInfo *child_info = (ChildInfo *) children->list->data; child_info->tag_in = claws_input_add(child_info->chld_in, - GDK_INPUT_WRITE, + G_IO_OUT | G_IO_ERR, catch_input, children, FALSE); } @@ -1465,7 +1465,7 @@ static void create_io_dialog(Children *children) gtk_widget_show(dialog); } -static void catch_status(gpointer data, gint source, GdkInputCondition cond) +static void catch_status(gpointer data, gint source, GIOCondition cond) { ChildInfo *child_info = (ChildInfo *)data; gchar buf; @@ -1533,7 +1533,7 @@ static void catch_status(gpointer data, gint source, GdkInputCondition cond) wait_for_children(child_info->children); } -static void catch_input(gpointer data, gint source, GdkInputCondition cond) +static void catch_input(gpointer data, gint source, GIOCondition cond) { Children *children = (Children *)data; ChildInfo *child_info = (ChildInfo *)children->list->data; @@ -1542,7 +1542,7 @@ static void catch_input(gpointer data, gint source, GdkInputCondition cond) gssize by_read = 0, by_written = 0; debug_print("Sending input to grand child.\n"); - if (!(cond & GDK_INPUT_WRITE)) + if (!(cond & (G_IO_OUT | G_IO_ERR))) return; gtk_widget_set_sensitive(children->input_hbox, FALSE); @@ -1581,7 +1581,7 @@ static void catch_input(gpointer data, gint source, GdkInputCondition cond) debug_print("Input to grand child sent.\n"); } -static void catch_output(gpointer data, gint source, GdkInputCondition cond) +static void catch_output(gpointer data, gint source, GIOCondition cond) { ChildInfo *child_info = (ChildInfo *)data; gint c; diff --git a/src/gtk/gtkutils.c b/src/gtk/gtkutils.c @@ -1626,36 +1626,26 @@ GtkUIManager *gtkut_ui_manager(void) 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 @@ claws_io_destroy (gpointer data) 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 @@ claws_input_add (gint source, 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); diff --git a/src/gtk/gtkutils.h b/src/gtk/gtkutils.h @@ -220,12 +220,15 @@ GtkUIManager *gtkut_ui_manager(void); 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) { \ diff --git a/src/main.c b/src/main.c @@ -222,7 +222,7 @@ static gchar * get_crashfile_name (void); static gint lock_socket_remove (void); static void lock_socket_input_cb (gpointer data, gint source, - GdkInputCondition condition); + GIOCondition condition); static void open_compose_new (const gchar *address, GPtrArray *attach_files); @@ -587,8 +587,8 @@ static void sc_ice_io_error_handler (IceConn connection) (*sc_ice_installed_handler) (connection); } static gboolean sc_process_ice_messages (GIOChannel *source, - GIOCondition condition, - gpointer data) + GIOCondition condition, + gpointer data) { IceConn connection = (IceConn) data; IceProcessMessagesStatus status; @@ -1396,7 +1396,7 @@ int main(int argc, char *argv[]) /* register the callback of unix domain socket input */ lock_socket_tag = claws_input_add(lock_socket, - GDK_INPUT_READ | GDK_INPUT_EXCEPTION, + G_IO_IN | G_IO_HUP | G_IO_ERR | G_IO_PRI, lock_socket_input_cb, mainwin, TRUE); @@ -2475,7 +2475,7 @@ static GPtrArray *get_folder_item_list(gint sock) static void lock_socket_input_cb(gpointer data, gint source, - GdkInputCondition condition) + GIOCondition condition) { MainWindow *mainwin = (MainWindow *)data; gint sock;