/soc/2013/ankitkv/gobjectification: e08f2d070470: Refactored lib...

Ankit Vani a at nevitus.org
Mon Jun 17 10:05:03 EDT 2013


Changeset: e08f2d07047066ace2a94ea169ac58fb48ee73c3
Author:	 Ankit Vani <a at nevitus.org>
Date:	 2013-06-17 19:34 +0530
Branch:	 soc.2013.gobjectification
URL: https://hg.pidgin.im/soc/2013/ankitkv/gobjectification/rev/e08f2d070470

Description:

Refactored libpurple/plugins according to changes to PurpleAccount

diffstat:

 libpurple/account.h                          |   1 -
 libpurple/internal.h                         |   2 +-
 libpurple/plugins/perl/common/Account.xs     |  69 ++++++++++-----------------
 libpurple/plugins/perl/common/Accounts.xs    |  53 +++++++++++++++++++++
 libpurple/plugins/perl/common/MANIFEST       |   2 +-
 libpurple/plugins/perl/common/Makefile.mingw |   2 +-
 libpurple/plugins/perl/common/Privacy.xs     |  33 -------------
 libpurple/plugins/perl/common/module.h       |   6 +-
 libpurple/plugins/perl/common/typemap        |   2 +-
 libpurple/plugins/psychic.c                  |   3 +-
 10 files changed, 85 insertions(+), 88 deletions(-)

diffs (truncated from 313 to 300 lines):

diff --git a/libpurple/account.h b/libpurple/account.h
--- a/libpurple/account.h
+++ b/libpurple/account.h
@@ -53,7 +53,6 @@ typedef void (*PurpleGetPublicAliasFailu
 
 #include "connection.h"
 #include "log.h"
-#include "privacy.h"
 #include "proxy.h"
 #include "prpl.h"
 #include "status.h"
diff --git a/libpurple/internal.h b/libpurple/internal.h
--- a/libpurple/internal.h
+++ b/libpurple/internal.h
@@ -156,7 +156,7 @@
 
 /* INTERNAL FUNCTIONS */
 
-#include "account.h"
+#include "accounts.h"
 #include "connection.h"
 
 /* This is for the accounts code to notify the buddy icon code that
diff --git a/libpurple/plugins/perl/common/Account.xs b/libpurple/plugins/perl/common/Account.xs
--- a/libpurple/plugins/perl/common/Account.xs
+++ b/libpurple/plugins/perl/common/Account.xs
@@ -273,53 +273,34 @@ purple_account_remove_group(account, gro
     Purple::Account account
     Purple::BuddyList::Group group
 
-MODULE = Purple::Account  PACKAGE = Purple::Accounts  PREFIX = purple_accounts_
+MODULE = Purple::Account  PACKAGE = Purple::Account::Privacy  PREFIX = purple_account_privacy_
 PROTOTYPES: ENABLE
 
-void
-purple_accounts_add(account)
-    Purple::Account account
+gboolean
+purple_account_privacy_permit_add(account, name, local_only)
+	Purple::Account account
+	const char * name
+	gboolean local_only
 
-void
-purple_accounts_remove(account)
-    Purple::Account account
+gboolean
+purple_account_privacy_permit_remove(account, name, local_only)
+	Purple::Account account
+	const char * name
+	gboolean local_only
 
-void
-purple_accounts_delete(account)
-    Purple::Account account
+gboolean
+purple_account_privacy_deny_add(account, name, local_only)
+	Purple::Account account
+	const char * name
+	gboolean local_only
 
-void
-purple_accounts_reorder(account, new_index)
-    Purple::Account account
-    size_t new_index
+gboolean
+purple_account_privacy_deny_remove(account, name, local_only)
+	Purple::Account account
+	const char * name
+	gboolean local_only
 
-void
-purple_accounts_get_all()
-PREINIT:
-    GList *l;
-PPCODE:
-    for (l = purple_accounts_get_all(); l != NULL; l = l->next) {
-        XPUSHs(sv_2mortal(purple_perl_bless_object(l->data, "Purple::Account")));
-    }
-
-void
-purple_accounts_get_all_active()
-PREINIT:
-    GList *list, *iter;
-PPCODE:
-    list = purple_accounts_get_all_active();
-    for (iter = list; iter != NULL; iter = iter->next) {
-        XPUSHs(sv_2mortal(purple_perl_bless_object(iter->data, "Purple::Account")));
-    }
-    g_list_free(list);
-
-void
-purple_accounts_restore_current_statuses()
-
-Purple::Account
-purple_accounts_find(name, protocol)
-    const char * name
-    const char * protocol
-
-Purple::Handle
-purple_accounts_get_handle()
+gboolean
+purple_account_privacy_check(account, who)
+	Purple::Account account
+	const char * who
diff --git a/libpurple/plugins/perl/common/Accounts.xs b/libpurple/plugins/perl/common/Accounts.xs
new file mode 100644
--- /dev/null
+++ b/libpurple/plugins/perl/common/Accounts.xs
@@ -0,0 +1,53 @@
+#include "module.h"
+#include "../perl-handlers.h"
+
+MODULE = Purple::Accounts  PACKAGE = Purple::Accounts  PREFIX = purple_accounts_
+PROTOTYPES: ENABLE
+
+void
+purple_accounts_add(account)
+    Purple::Account account
+
+void
+purple_accounts_remove(account)
+    Purple::Account account
+
+void
+purple_accounts_delete(account)
+    Purple::Account account
+
+void
+purple_accounts_reorder(account, new_index)
+    Purple::Account account
+    size_t new_index
+
+void
+purple_accounts_get_all()
+PREINIT:
+    GList *l;
+PPCODE:
+    for (l = purple_accounts_get_all(); l != NULL; l = l->next) {
+        XPUSHs(sv_2mortal(purple_perl_bless_object(l->data, "Purple::Account")));
+    }
+
+void
+purple_accounts_get_all_active()
+PREINIT:
+    GList *list, *iter;
+PPCODE:
+    list = purple_accounts_get_all_active();
+    for (iter = list; iter != NULL; iter = iter->next) {
+        XPUSHs(sv_2mortal(purple_perl_bless_object(iter->data, "Purple::Account")));
+    }
+    g_list_free(list);
+
+void
+purple_accounts_restore_current_statuses()
+
+Purple::Account
+purple_accounts_find(name, protocol)
+    const char * name
+    const char * protocol
+
+Purple::Handle
+purple_accounts_get_handle()
diff --git a/libpurple/plugins/perl/common/MANIFEST b/libpurple/plugins/perl/common/MANIFEST
--- a/libpurple/plugins/perl/common/MANIFEST
+++ b/libpurple/plugins/perl/common/MANIFEST
@@ -1,4 +1,5 @@
 Account.xs
+Accounts.xs
 AccountOpts.xs
 BuddyIcon.xs
 BuddyList.xs
@@ -18,7 +19,6 @@ Plugin.xs
 PluginPref.xs
 Pounce.xs
 Prefs.xs
-Privacy.xs
 Proxy.xs
 Prpl.xs
 Purple.pm
diff --git a/libpurple/plugins/perl/common/Makefile.mingw b/libpurple/plugins/perl/common/Makefile.mingw
--- a/libpurple/plugins/perl/common/Makefile.mingw
+++ b/libpurple/plugins/perl/common/Makefile.mingw
@@ -37,6 +37,7 @@ LIB_PATHS += \
 ##  SOURCES, OBJECTS
 ##
 XS_FILES =		Account.xs \
+				Accounts.xs \
 				AccountOpts.xs \
 				BuddyIcon.xs \
 				BuddyList.xs \
@@ -59,7 +60,6 @@ XS_FILES =		Account.xs \
 				PluginPref.xs \
 				Pounce.xs \
 				Prefs.xs \
-				Privacy.xs \
 				Proxy.xs \
 				Prpl.xs \
 				Request.xs \
diff --git a/libpurple/plugins/perl/common/Privacy.xs b/libpurple/plugins/perl/common/Privacy.xs
deleted file mode 100644
--- a/libpurple/plugins/perl/common/Privacy.xs
+++ /dev/null
@@ -1,33 +0,0 @@
-#include "module.h"
-
-MODULE = Purple::Privacy  PACKAGE = Purple::Privacy  PREFIX = purple_privacy_
-PROTOTYPES: ENABLE
-
-gboolean
-purple_privacy_permit_add(account, name, local_only)
-	Purple::Account account
-	const char * name
-	gboolean local_only
-
-gboolean
-purple_privacy_permit_remove(account, name, local_only)
-	Purple::Account account
-	const char * name
-	gboolean local_only
-
-gboolean
-purple_privacy_deny_add(account, name, local_only)
-	Purple::Account account
-	const char * name
-	gboolean local_only
-
-gboolean
-purple_privacy_deny_remove(account, name, local_only)
-	Purple::Account account
-	const char * name
-	gboolean local_only
-
-gboolean
-purple_privacy_check(account, who)
-	Purple::Account account
-	const char * who
diff --git a/libpurple/plugins/perl/common/module.h b/libpurple/plugins/perl/common/module.h
--- a/libpurple/plugins/perl/common/module.h
+++ b/libpurple/plugins/perl/common/module.h
@@ -20,6 +20,7 @@ typedef struct group *Purple__Group;
 #include "../perl-common.h"
 
 #include "account.h"
+#include "accounts.h"
 #include "accountopt.h"
 #include "blist.h"
 #include "buddyicon.h"
@@ -49,7 +50,6 @@ typedef struct group *Purple__Group;
 #include "pluginpref.h"
 #include "pounce.h"
 #include "prefs.h"
-#include "privacy.h"
 #include "prpl.h"
 #include "proxy.h"
 #include "request.h"
@@ -72,6 +72,7 @@ typedef struct group *Purple__Group;
 typedef PurpleAccount *			Purple__Account;
 typedef PurpleAccountOption *		Purple__Account__Option;
 typedef PurpleAccountUserSplit *		Purple__Account__UserSplit;
+typedef PurpleAccountPrivacyType		Purple__Account__PrivacyType;
 
 /* blist.h */
 typedef PurpleBlistNode *			Purple__BuddyList__Node;
@@ -216,9 +217,6 @@ typedef PurplePounceEvent			Purple__Poun
 /* prefs.h */
 typedef PurplePrefType			Purple__PrefType;
 
-/* privacy.h */
-typedef PurplePrivacyType			Purple__PrivacyType;
-
 /* proxy.h */
 typedef PurpleProxyInfo *			Purple__ProxyInfo;
 typedef PurpleProxyType			Purple__ProxyType;
diff --git a/libpurple/plugins/perl/common/typemap b/libpurple/plugins/perl/common/typemap
--- a/libpurple/plugins/perl/common/typemap
+++ b/libpurple/plugins/perl/common/typemap
@@ -41,6 +41,7 @@ const void *				T_PTR
 Purple::Account				T_PurpleObj
 Purple::Account::Option			T_PurpleObj
 Purple::Account::UserSplit		T_PurpleObj
+Purple::Account::PrivacyType			T_IV
 
 Purple::Buddy::Icon			T_PurpleObj
 Purple::Buddy::Icon::Spec			T_PurpleObj
@@ -109,7 +110,6 @@ Purple::PluginPref::Frame			T_PurpleObj
 Purple::Pounce				T_PurpleObj
 Purple::PounceEvent			T_IV
 Purple::Presence				T_PurpleObj
-Purple::PrivacyType			T_IV
 Purple::ProtocolOptions			T_IV
 Purple::ProxyInfo				T_PurpleObj
 Purple::ProxyType				T_IV
diff --git a/libpurple/plugins/psychic.c b/libpurple/plugins/psychic.c
--- a/libpurple/plugins/psychic.c
+++ b/libpurple/plugins/psychic.c
@@ -9,7 +9,6 @@
 #include "signals.h"
 #include "status.h"
 #include "version.h"



More information about the Commits mailing list