diff options
author | Mike Ruprecht <cmaiku@gmail.com> | 2017-06-15 11:54:43 -0500 |
---|---|---|
committer | Mike Ruprecht <cmaiku@gmail.com> | 2017-06-15 11:54:43 -0500 |
commit | cc7d814d4334963e6db23a0de52ac92b1f83f7de (patch) | |
tree | 888167092956417d6d1b66dff4ee1419d0f678e2 | |
parent | db92bedbc3ec77e64f8ae461a60d8c9162afae22 (diff) | |
download | pidgin-cc7d814d4334963e6db23a0de52ac92b1f83f7de.tar.gz |
Remove gtkeventloop.[ch] in preparation for dropping event loop UiOps
This patch removes Pidgin's event loop implementation now that the
event loop functions have been given their own implementations.
-rw-r--r-- | doc/reference/pidgin/pidgin-docs.xml | 1 | ||||
-rw-r--r-- | pidgin/Makefile.am | 2 | ||||
-rw-r--r-- | pidgin/Makefile.mingw | 1 | ||||
-rw-r--r-- | pidgin/gtkeventloop.c | 124 | ||||
-rw-r--r-- | pidgin/gtkeventloop.h | 46 | ||||
-rw-r--r-- | pidgin/libpidgin.c | 3 |
6 files changed, 0 insertions, 177 deletions
diff --git a/doc/reference/pidgin/pidgin-docs.xml b/doc/reference/pidgin/pidgin-docs.xml index 62a6862b73..fab6c76b04 100644 --- a/doc/reference/pidgin/pidgin-docs.xml +++ b/doc/reference/pidgin/pidgin-docs.xml @@ -35,7 +35,6 @@ <xi:include href="xml/gtkdebug.xml" /> <xi:include href="xml/gtkdocklet.xml" /> <xi:include href="xml/gtkdnd-hints.xml" /> - <xi:include href="xml/gtkeventloop.xml" /> <xi:include href="xml/gtkxfer.xml" /> <xi:include href="xml/gtkicon-theme.xml" /> <xi:include href="xml/gtkidle.xml" /> diff --git a/pidgin/Makefile.am b/pidgin/Makefile.am index b41f00c4c9..9dae95b446 100644 --- a/pidgin/Makefile.am +++ b/pidgin/Makefile.am @@ -55,7 +55,6 @@ libpidgin_la_SOURCES = \ gtkdialogs.c \ gtkdnd-hints.c \ gtkdocklet.c \ - gtkeventloop.c \ gtkicon-theme.c \ gtkicon-theme-loader.c \ gtkidle.c \ @@ -103,7 +102,6 @@ libpidgin_la_headers = \ gtkdialogs.h \ gtkdnd-hints.h \ gtkdocklet.h \ - gtkeventloop.h \ gtkicon-theme.h \ gtkicon-theme-loader.h \ gtkidle.h \ diff --git a/pidgin/Makefile.mingw b/pidgin/Makefile.mingw index 0790fff518..89369e5ef3 100644 --- a/pidgin/Makefile.mingw +++ b/pidgin/Makefile.mingw @@ -71,7 +71,6 @@ PIDGIN_C_SRC = \ gtkdialogs.c \ gtkdnd-hints.c \ gtkdocklet.c \ - gtkeventloop.c \ gtkicon-theme-loader.c \ gtkicon-theme.c \ gtkidle.c \ diff --git a/pidgin/gtkeventloop.c b/pidgin/gtkeventloop.c deleted file mode 100644 index 05e19d7027..0000000000 --- a/pidgin/gtkeventloop.c +++ /dev/null @@ -1,124 +0,0 @@ -/* pidgin - * - * Pidgin is the legal property of its developers, whose names are too numerous - * to list here. Please refer to the COPYRIGHT file distributed with this - * source distribution. - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02111-1301 USA - */ - -#include <glib.h> -#include "gtkeventloop.h" -#include "eventloop.h" -#include "internal.h" - -#define PIDGIN_READ_COND (G_IO_IN | G_IO_HUP | G_IO_ERR) -#define PIDGIN_WRITE_COND (G_IO_OUT | G_IO_HUP | G_IO_ERR | G_IO_NVAL) - -typedef struct _PidginIOClosure { - PurpleInputFunction function; - guint result; - gpointer data; - -} PidginIOClosure; - -static gboolean pidgin_io_invoke(GIOChannel *source, GIOCondition condition, gpointer data) -{ - PidginIOClosure *closure = data; - PurpleInputCondition purple_cond = 0; - - if (condition & PIDGIN_READ_COND) - purple_cond |= PURPLE_INPUT_READ; - if (condition & PIDGIN_WRITE_COND) - purple_cond |= PURPLE_INPUT_WRITE; - -#if 0 - purple_debug_misc("gtk_eventloop", - "CLOSURE: callback for %d, fd is %d\n", - closure->result, g_io_channel_unix_get_fd(source)); -#endif - -#ifdef _WIN32 - if(! purple_cond) { -#if 0 - purple_debug_misc("gtk_eventloop", - "CLOSURE received GIOCondition of 0x%x, which does not" - " match 0x%x (READ) or 0x%x (WRITE)\n", - condition, PIDGIN_READ_COND, PIDGIN_WRITE_COND); -#endif /* DEBUG */ - - return TRUE; - } -#endif /* _WIN32 */ - - closure->function(closure->data, g_io_channel_unix_get_fd(source), - purple_cond); - - return TRUE; -} - -static guint pidgin_input_add(gint fd, PurpleInputCondition condition, PurpleInputFunction function, - gpointer data) -{ - PidginIOClosure *closure = g_new0(PidginIOClosure, 1); - GIOChannel *channel; - GIOCondition cond = 0; - - closure->function = function; - closure->data = data; - - if (condition & PURPLE_INPUT_READ) - cond |= PIDGIN_READ_COND; - if (condition & PURPLE_INPUT_WRITE) - cond |= PIDGIN_WRITE_COND; - -#ifdef _WIN32 - channel = g_io_channel_win32_new_socket(fd); -#else - channel = g_io_channel_unix_new(fd); -#endif - - closure->result = g_io_add_watch_full(channel, G_PRIORITY_DEFAULT, cond, - pidgin_io_invoke, closure, g_free); - -#if 0 - purple_debug_misc("gtk_eventloop", - "CLOSURE: adding input watcher %d for fd %d\n", - closure->result, fd); -#endif - - g_io_channel_unref(channel); - return closure->result; -} - -static PurpleEventLoopUiOps eventloop_ops = -{ - g_timeout_add, - g_source_remove, - pidgin_input_add, - g_source_remove, - NULL, /* input_get_error */ - g_timeout_add_seconds, - NULL, - NULL, - NULL, - NULL -}; - -PurpleEventLoopUiOps * -pidgin_eventloop_get_ui_ops(void) -{ - return &eventloop_ops; -} diff --git a/pidgin/gtkeventloop.h b/pidgin/gtkeventloop.h deleted file mode 100644 index a782477a86..0000000000 --- a/pidgin/gtkeventloop.h +++ /dev/null @@ -1,46 +0,0 @@ -/* pidgin - * - * Pidgin is the legal property of its developers, whose names are too numerous - * to list here. Please refer to the COPYRIGHT file distributed with this - * source distribution. - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02111-1301 USA - */ - -#ifndef _PIDGINEVENTLOOP_H_ -#define _PIDGINEVENTLOOP_H_ -/** - * SECTION:gtkeventloop - * @section_id: pidgin-gtkeventloop - * @short_description: <filename>gtkeventloop.h</filename> - * @title: Event Loop Implementation - */ - -#include "eventloop.h" - -G_BEGIN_DECLS - -/** - * pidgin_eventloop_get_ui_ops: - * - * Returns the GTK+ event loop UI operations structure. - * - * Returns: The GTK+ event loop UI operations structure. - */ -PurpleEventLoopUiOps *pidgin_eventloop_get_ui_ops(void); - -G_END_DECLS - -#endif /* _PIDGINEVENTLOOP_H_ */ diff --git a/pidgin/libpidgin.c b/pidgin/libpidgin.c index f8271944c4..bf5d9cba9c 100644 --- a/pidgin/libpidgin.c +++ b/pidgin/libpidgin.c @@ -29,7 +29,6 @@ #include "core.h" #include "dbus-maybe.h" #include "debug.h" -#include "eventloop.h" #include "glibcompat.h" #include "log.h" #include "network.h" @@ -50,7 +49,6 @@ #include "gtkdebug.h" #include "gtkdialogs.h" #include "gtkdocklet.h" -#include "gtkeventloop.h" #include "gtkxfer.h" #include "gtkidle.h" #include "gtklog.h" @@ -726,7 +724,6 @@ int pidgin_start(int argc, char *argv[]) #endif purple_core_set_ui_ops(pidgin_core_get_ui_ops()); - purple_eventloop_set_ui_ops(pidgin_eventloop_get_ui_ops()); if (!purple_core_init(PIDGIN_UI)) { fprintf(stderr, |