/srv/mercurial-server/detachablepurple: d9d8228e12ee: propagate ...

Gilles Bedel gillux at cpw.pidgin.im
Fri Jun 15 22:01:29 EDT 2012


Changeset: d9d8228e12eeb7741a04c5357f6dc236a23d8fce
Author:	 Gilles Bedel <gillux at cpw.pidgin.im>
Date:	 2011-05-14 19:41 +0000
Branch:	 cpw.gillux.detachablepurple
URL: http://hg.pidgin.im/srv/mercurial-server/detachablepurple/rev/d9d8228e12ee

Description:

propagate from branch 'im.pidgin.gobjectification' (head 2a2af69b8d9745b0a9decb1fe1602671ea020b41)
            to branch 'im.pidgin.cpw.gillux.detachablepurple' (head 4ae4b3131f544da7b10ef1c324c6f3b54082ffc5)

diffstat:

 Makefile.am                              |    2 +-
 configure.ac                             |    4 +-
 finch/finch.c                            |   19 +-
 finch/libgnt/wms/Makefile.am             |    1 +
 finch/plugins/Makefile.am                |    1 +
 libpurple/Makefile.am                    |   91 ++++-
 libpurple/account.c                      |   76 +++
 libpurple/accountlist.c                  |    7 +
 libpurple/blist.c                        |   10 +
 libpurple/buddy.c                        |   32 +-
 libpurple/chat.c                         |   31 +-
 libpurple/connection.c                   |   31 +-
 libpurple/contact.c                      |   10 +-
 libpurple/core.c                         |   19 +
 libpurple/core.h                         |   58 ++
 libpurple/dbus-bindings.h                |    2 +
 libpurple/dbus-maybe.h                   |   26 +
 libpurple/dbus-purple.h                  |   28 +
 libpurple/dbus-server.c                  |  188 ++++++++-
 libpurple/dbus-server.h                  |   49 ++
 libpurple/dbus/account.c                 |  451 +++++++++++++++++++++
 libpurple/dbus/account.h                 |  107 +++++
 libpurple/dbus/account.xml               |   52 ++
 libpurple/dbus/blist.c                   |  660 +++++++++++++++++++++++++++++++
 libpurple/dbus/blist.h                   |   54 ++
 libpurple/dbus/blist.xml                 |   24 +
 libpurple/dbus/buddy.c                   |   66 +++
 libpurple/dbus/buddy.h                   |   46 ++
 libpurple/dbus/buddy.xml                 |    7 +
 libpurple/dbus/callback.c                |  494 +++++++++++++++++++++++
 libpurple/dbus/callback.h                |  173 ++++++++
 libpurple/dbus/callback.xml              |   17 +
 libpurple/dbus/chat.c                    |   64 +++
 libpurple/dbus/chat.h                    |   46 ++
 libpurple/dbus/chat.xml                  |    7 +
 libpurple/dbus/connection.c              |   77 +++
 libpurple/dbus/connection.h              |   46 ++
 libpurple/dbus/connection.xml            |    8 +
 libpurple/dbus/constructor.c             |  461 +++++++++++++++++++++
 libpurple/dbus/constructor.h             |   82 +++
 libpurple/dbus/constructor.xml           |   20 +
 libpurple/dbus/contact.c                 |   65 +++
 libpurple/dbus/contact.h                 |   46 ++
 libpurple/dbus/contact.xml               |    5 +
 libpurple/dbus/group.c                   |   72 +++
 libpurple/dbus/group.h                   |   46 ++
 libpurple/dbus/group.xml                 |    6 +
 libpurple/example/Makefile.am            |    8 +-
 libpurple/example/remotenullclient.c     |  365 +++++++++++++++++
 libpurple/group.c                        |   22 +-
 libpurple/marshallers.list               |   10 +
 libpurple/nullmarshaller.c               |   18 +
 libpurple/nullmarshaller.h               |   10 +
 libpurple/plugins/perl/Makefile.am       |    1 +
 libpurple/plugins/ssl/Makefile.am        |    1 +
 libpurple/plugins/tcl/Makefile.am        |    1 +
 libpurple/pobject.c                      |  396 ++++++++++++++++++
 libpurple/pobject.h                      |   98 ++++
 libpurple/protocols/bonjour/Makefile.am  |    3 +-
 libpurple/protocols/gg/Makefile.am       |    1 +
 libpurple/protocols/irc/Makefile.am      |    3 +-
 libpurple/protocols/jabber/Makefile.am   |    1 +
 libpurple/protocols/msn/Makefile.am      |    1 +
 libpurple/protocols/mxit/Makefile.am     |    1 +
 libpurple/protocols/myspace/Makefile.am  |    1 +
 libpurple/protocols/novell/Makefile.am   |    1 +
 libpurple/protocols/null/Makefile.am     |    1 +
 libpurple/protocols/oscar/Makefile.am    |    1 +
 libpurple/protocols/sametime/Makefile.am |    1 +
 libpurple/protocols/silc/Makefile.am     |    1 +
 libpurple/protocols/silc10/Makefile.am   |    1 +
 libpurple/protocols/simple/Makefile.am   |    1 +
 libpurple/protocols/yahoo/Makefile.am    |    1 +
 libpurple/protocols/zephyr/Makefile.am   |    1 +
 libpurple/util.c                         |    5 +
 pidgin/gtkmain.c                         |   24 +-
 pidgin/plugins/Makefile.am               |    1 +
 pidgin/plugins/disco/Makefile.am         |    1 +
 pidgin/plugins/gestures/Makefile.am      |    1 +
 pidgin/plugins/ticker/Makefile.am        |    1 +
 purpled/Makefile.am                      |   35 +
 purpled/purpled-account.c                |  124 +++++
 purpled/purpled-account.h                |   22 +
 purpled/purpled.c                        |  141 ++++++
 purpled/purpled.h                        |   27 +
 purpled/purpled.pc.in                    |   13 +
 86 files changed, 5182 insertions(+), 50 deletions(-)

diffs (truncated from 6487 to 300 lines):

diff --git a/Makefile.am b/Makefile.am
--- a/Makefile.am
+++ b/Makefile.am
@@ -125,7 +125,7 @@
 # line does is tell 'distcheck' to shut up and ignore those two files.
 distcleancheck_listfiles = find . -type f -a ! -name package_revision.h
 
-SUBDIRS = . libpurple doc $(GNT_DIR) $(GTK_DIR) m4macros $(PO_DIR) share/ca-certs share/sounds
+SUBDIRS = . libpurple doc $(GNT_DIR) $(GTK_DIR) purpled m4macros $(PO_DIR) share/ca-certs share/sounds
 
 docs: Doxyfile
 if HAVE_DOXYGEN
diff --git a/configure.ac b/configure.ac
--- a/configure.ac
+++ b/configure.ac
@@ -74,7 +74,7 @@
 
 AC_CANONICAL_HOST
 AC_CONFIG_HEADERS([config.h])
-AM_INIT_AUTOMAKE([1.9 -Wno-portability dist-bzip2])
+AM_INIT_AUTOMAKE([1.9 -Wno-portability dist-bzip2 subdir-objects])
 dnl TODO: Always use AM_SILENT_RULES when we depend on automake >= 1.11
 m4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES([yes])])
 
@@ -2595,6 +2595,8 @@
 		   finch/libgnt/gnt.pc
 		   finch/libgnt/wms/Makefile
 		   finch/plugins/Makefile
+		   purpled/Makefile
+		   purpled/purpled.pc
 		   po/Makefile.in
 		   pidgin.spec
 		  ])
diff --git a/finch/finch.c b/finch/finch.c
--- a/finch/finch.c
+++ b/finch/finch.c
@@ -249,6 +249,7 @@
 	int opt;
 	gboolean opt_help = FALSE;
 	gboolean opt_nologin = FALSE;
+	gboolean opt_remote = FALSE;
 	gboolean opt_version = FALSE;
 	char *opt_config_dir_arg = NULL;
 	gboolean debug_enabled = FALSE;
@@ -259,6 +260,7 @@
 		{"debug",    no_argument,       NULL, 'd'},
 		{"help",     no_argument,       NULL, 'h'},
 		{"nologin",  no_argument,       NULL, 'n'},
+		{"remote",   no_argument,       NULL, 'r'},
 		{"version",  no_argument,       NULL, 'v'},
 		{0, 0, 0, 0}
 	};
@@ -277,9 +279,9 @@
 	opterr = 1;
 	while ((opt = getopt_long(argc, argv,
 #ifndef _WIN32
-				  "c:dhn::v",
+				  "c:dhnr::v",
 #else
-				  "c:dhn::v",
+				  "c:dhnr::v",
 #endif
 				  long_options, NULL)) != -1) {
 		switch (opt) {
@@ -296,6 +298,9 @@
 		case 'n':	/* no autologin */
 			opt_nologin = TRUE;
 			break;
+		case 'r':	/* remote mode */
+			opt_remote = TRUE;
+			break;
 		case 'v':	/* version */
 			opt_version = TRUE;
 			break;
@@ -334,6 +339,16 @@
 	/* We don't want debug-messages to show up and corrupt the display */
 	purple_debug_set_enabled(debug_enabled);
 
+	if (opt_remote) {
+		/* Activate remote mode */
+		purple_core_set_running_mode(PURPLE_RUN_REMOTE_MODE);
+		if (!purple_core_is_remote_mode()) {
+			/* If we are here, purple already printed an error
+			 * message about what went wrong. */
+			return 0;
+		}
+	}
+
 	purple_core_set_ui_ops(gnt_core_get_ui_ops());
 	purple_eventloop_set_ui_ops(gnt_eventloop_get_ui_ops());
 	purple_idle_set_ui_ops(finch_idle_get_ui_ops());
diff --git a/finch/libgnt/wms/Makefile.am b/finch/libgnt/wms/Makefile.am
--- a/finch/libgnt/wms/Makefile.am
+++ b/finch/libgnt/wms/Makefile.am
@@ -35,6 +35,7 @@
 	-I$(top_srcdir)/finch/libgnt \
 	$(DEBUG_CFLAGS) \
 	$(GLIB_CFLAGS) \
+	$(DBUS_CFLAGS) \
 	$(GNT_CFLAGS) \
 	$(PLUGIN_CFLAGS)
 
diff --git a/finch/plugins/Makefile.am b/finch/plugins/Makefile.am
--- a/finch/plugins/Makefile.am
+++ b/finch/plugins/Makefile.am
@@ -47,6 +47,7 @@
 	-I$(top_srcdir)/finch/libgnt \
 	$(DEBUG_CFLAGS) \
 	$(GLIB_CFLAGS) \
+	$(DBUS_CFLAGS) \
 	$(GNT_CFLAGS) \
 	$(PLUGIN_CFLAGS)
 
diff --git a/libpurple/Makefile.am b/libpurple/Makefile.am
--- a/libpurple/Makefile.am
+++ b/libpurple/Makefile.am
@@ -82,6 +82,7 @@
 	network.c \
 	ntlm.c \
 	notify.c \
+	nullmarshaller.c \
 	plugin.c \
 	pluginpref.c \
 	pobject.c \
@@ -163,6 +164,7 @@
 	nat-pmp.h \
 	network.h \
 	notify.h \
+	nullmarshaller.h \
 	ntlm.h \
 	plugin.h \
 	pluginpref.h \
@@ -203,7 +205,17 @@
 	codec.h \
 	enum-types.h
 
-purple_builtheaders = purple.h version.h marshallers.h enums.h
+purple_builtheaders = \
+	purple.h version.h marshallers.h enums.h \
+	dbus/account-server.h dbus/account-client.h \
+	dbus/blist-server.h dbus/blist-client.h \
+	dbus/buddy-server.h dbus/buddy-client.h \
+	dbus/chat-server.h dbus/chat-client.h \
+	dbus/connection-server.h dbus/connection-client.h \
+	dbus/contact-server.h dbus/contact-client.h \
+	dbus/group-server.h dbus/group-client.h \
+	dbus/constructor-server.h dbus/constructor-client.h \
+	dbus/callback-server.h dbus/callback-client.h
 
 purple_enumheaders = \
 	account.h \
@@ -252,6 +264,60 @@
 
 if ENABLE_DBUS
 
+dbus/constructor-server.h: dbus/constructor.xml
+	$(AM_V_GEN)dbus-binding-tool --prefix=DBUS_purple_constructor --mode=glib-server --output=$@ $<
+
+dbus/constructor-client.h: dbus/constructor.xml
+	$(AM_V_GEN)dbus-binding-tool --prefix=DBUS_purple_constructor --mode=glib-client --output=$@ $<
+
+dbus/callback-server.h: dbus/callback.xml
+	$(AM_V_GEN)dbus-binding-tool --prefix=DBUS_purple_callback --mode=glib-server --output=$@ $<
+
+dbus/callback-client.h: dbus/callback.xml
+	$(AM_V_GEN)dbus-binding-tool --prefix=DBUS_purple_callback --mode=glib-client --output=$@ $<
+
+dbus/account-server.h: dbus/account.xml
+	$(AM_V_GEN)dbus-binding-tool --prefix=DBUS_purple_account --mode=glib-server --output=$@ $<
+
+dbus/account-client.h: dbus/account.xml
+	$(AM_V_GEN)dbus-binding-tool --prefix=DBUS_purple_account --mode=glib-client --output=$@ $<
+
+dbus/blist-server.h: dbus/blist.xml
+	$(AM_V_GEN)dbus-binding-tool --prefix=DBUS_purple_blist --mode=glib-server --output=$@ $<
+
+dbus/blist-client.h: dbus/blist.xml
+	$(AM_V_GEN)dbus-binding-tool --prefix=DBUS_purple_blist --mode=glib-client --output=$@ $<
+
+dbus/buddy-server.h: dbus/buddy.xml
+	$(AM_V_GEN)dbus-binding-tool --prefix=DBUS_purple_buddy --mode=glib-server --output=$@ $<
+
+dbus/buddy-client.h: dbus/buddy.xml
+	$(AM_V_GEN)dbus-binding-tool --prefix=DBUS_purple_buddy --mode=glib-client --output=$@ $<
+
+dbus/chat-server.h: dbus/chat.xml
+	$(AM_V_GEN)dbus-binding-tool --prefix=DBUS_purple_chat --mode=glib-server --output=$@ $<
+
+dbus/chat-client.h: dbus/chat.xml
+	$(AM_V_GEN)dbus-binding-tool --prefix=DBUS_purple_chat --mode=glib-client --output=$@ $<
+
+dbus/connection-server.h: dbus/connection.xml
+	$(AM_V_GEN)dbus-binding-tool --prefix=DBUS_purple_connection --mode=glib-server --output=$@ $<
+
+dbus/connection-client.h: dbus/connection.xml
+	$(AM_V_GEN)dbus-binding-tool --prefix=DBUS_purple_connection --mode=glib-client --output=$@ $<
+
+dbus/contact-server.h: dbus/contact.xml
+	$(AM_V_GEN)dbus-binding-tool --prefix=DBUS_purple_contact --mode=glib-server --output=$@ $<
+
+dbus/contact-client.h: dbus/contact.xml
+	$(AM_V_GEN)dbus-binding-tool --prefix=DBUS_purple_contact --mode=glib-client --output=$@ $<
+
+dbus/group-server.h: dbus/group.xml
+	$(AM_V_GEN)dbus-binding-tool --prefix=DBUS_purple_group --mode=glib-server --output=$@ $<
+
+dbus/group-client.h: dbus/group.xml
+	$(AM_V_GEN)dbus-binding-tool --prefix=DBUS_purple_group --mode=glib-client --output=$@ $<
+
 CLEANFILES = \
 	dbus-bindings.c \
 	dbus-client-binding.c \
@@ -267,8 +333,27 @@
 
 # purple dbus server
 
-dbus_sources  = dbus-server.c dbus-useful.c
-dbus_headers  = dbus-bindings.h dbus-purple.h dbus-server.h dbus-useful.h dbus-define-api.h dbus-types.h
+dbus_sources  = dbus-server.c dbus-useful.c \
+	dbus/constructor.c \
+	dbus/callback.c \
+	dbus/account.c \
+	dbus/buddy.c \
+	dbus/chat.c \
+	dbus/connection.c \
+	dbus/contact.c \
+	dbus/blist.c \
+	dbus/group.c
+
+dbus_headers  = dbus-bindings.h dbus-purple.h dbus-server.h dbus-useful.h dbus-define-api.h dbus-types.h \
+	dbus/constructor.h \
+	dbus/callback.h \
+	dbus/account.h \
+	dbus/buddy.h \
+	dbus/chat.h \
+	dbus/connection.h \
+	dbus/contact.h \
+	dbus/blist.h \
+	dbus/group.h
 
 dbus_exported = dbus-useful.h dbus-define-api.h account.h accountlist.h blist.h buddyicon.h \
                 connection.h conversation.h core.h ft.h log.h notify.h prefs.h roomlist.h \
diff --git a/libpurple/account.c b/libpurple/account.c
--- a/libpurple/account.c
+++ b/libpurple/account.c
@@ -25,9 +25,11 @@
  */
 #include "internal.h"
 #include "account.h"
+#include "dbus/account.h"
 #include "accountlist.h"
 #include "core.h"
 #include "dbus-maybe.h"
+#include "dbus/callback.h"
 #include "debug.h"
 #include "marshallers.h"
 #include "network.h"
@@ -454,6 +456,7 @@
 		GParamSpec *pspec)
 {
 	PurpleAccount *account = PURPLE_ACCOUNT(obj);
+
 	switch (param_id) {
 		case PROP_USERNAME:
 			purple_account_set_username(account, g_value_get_string(value));
@@ -752,6 +755,8 @@
 
 #warning TODO: Setup more signals
 
+	purple_account_class_dbus_init();
+
 	g_type_class_add_private(klass, sizeof(PurpleAccountPrivate));
 }
 
@@ -798,6 +803,10 @@
 	if (account != NULL)
 		return account;
 
+	/* Handle remote mode case */
+	if (purple_core_is_remote_mode())
+		return purple_account_new_RPC(username, protocol_id);
+
 	prpl = purple_find_prpl(protocol_id);
 	g_return_val_if_fail(prpl != NULL, NULL);
 
@@ -808,6 +817,7 @@
 	priv = PURPLE_ACCOUNT_GET_PRIVATE(account);
 
 	PURPLE_DBUS_REGISTER_POINTER(account, PurpleAccount);
+	purple_account_dbus_init(account, username, protocol_id);
 
 	prpl_info = PURPLE_PLUGIN_PROTOCOL_INFO(prpl);
 	if (prpl_info != NULL && prpl_info->status_types != NULL)
@@ -847,6 +857,10 @@
 {
 	g_return_if_fail(PURPLE_IS_ACCOUNT(account));
 
+	/* Handle remote mode case */
+	if (purple_core_is_remote_mode())
+		return purple_account_register_RPC(account);



More information about the Commits mailing list