/soc/2013/ankitkv/gobjectification: 2ab9fcc7ca7c: Merged soc.201...
Ankit Vani
a at nevitus.org
Tue Nov 19 18:24:44 EST 2013
Changeset: 2ab9fcc7ca7c556ab6f742a67289ed90e01a50a9
Author: Ankit Vani <a at nevitus.org>
Date: 2013-11-20 04:54 +0530
Branch: soc.2013.gobjectification.plugins
URL: https://hg.pidgin.im/soc/2013/ankitkv/gobjectification/rev/2ab9fcc7ca7c
Description:
Merged soc.2013.gobjectification branch
diffstat:
libpurple/ciphers/aescipher.c | 28 ++-
libpurple/ciphers/des3cipher.c | 25 ++-
libpurple/ciphers/descipher.c | 10 +-
libpurple/ciphers/hmaccipher.c | 12 +-
libpurple/ciphers/pbkdf2cipher.c | 24 ++-
libpurple/ciphers/rc4cipher.c | 17 +-
libpurple/glibcompat.h | 9 +
libpurple/protocols/jabber/google/google_p2p.c | 27 ++-
libpurple/protocols/jabber/jingle/content.c | 62 ++++++----
libpurple/protocols/jabber/jingle/iceudp.c | 27 ++-
libpurple/protocols/jabber/jingle/rawudp.c | 27 ++-
libpurple/protocols/jabber/jingle/rtp.c | 27 ++-
libpurple/protocols/jabber/jingle/session.c | 73 +++++++-----
pidgin/gtkblist-theme.c | 143 +++++++++++++++---------
pidgin/gtkconv-theme.c | 24 +---
pidgin/minidialog.c | 39 ++++--
16 files changed, 343 insertions(+), 231 deletions(-)
diffs (truncated from 1577 to 300 lines):
diff --git a/libpurple/ciphers/aescipher.c b/libpurple/ciphers/aescipher.c
--- a/libpurple/ciphers/aescipher.c
+++ b/libpurple/ciphers/aescipher.c
@@ -23,6 +23,7 @@
*/
#include "internal.h"
+#include "glibcompat.h"
#include "aescipher.h"
#include "debug.h"
@@ -70,6 +71,11 @@ enum {
PROP_LAST,
};
+/*******************************************************************************
+ * Globals
+ ******************************************************************************/
+static GParamSpec *properties[PROP_LAST];
+
/******************************************************************************
* Cipher Stuff
*****************************************************************************/
@@ -108,7 +114,7 @@ purple_aes_cipher_set_iv(PurpleCipher *c
else
memcpy(priv->iv, iv, len);
- g_object_notify(G_OBJECT(cipher), "iv");
+ g_object_notify_by_pspec(G_OBJECT(cipher), properties[PROP_IV]);
}
static void
@@ -128,7 +134,7 @@ purple_aes_cipher_set_key(PurpleCipher *
if (len > 0)
memcpy(priv->key, key, len);
- g_object_notify(G_OBJECT(cipher), "key");
+ g_object_notify_by_pspec(G_OBJECT(cipher), properties[PROP_KEY]);
}
static guchar *
@@ -514,7 +520,7 @@ purple_aes_cipher_set_batch_mode(PurpleC
priv->failure = TRUE;
}
- g_object_notify(G_OBJECT(cipher), "batch-mode");
+ g_object_notify_by_pspec(G_OBJECT(cipher), properties[PROP_BATCH_MODE]);
}
static PurpleCipherBatchMode
@@ -580,7 +586,6 @@ static void
purple_aes_cipher_class_init(PurpleAESCipherClass *klass) {
GObjectClass *obj_class = G_OBJECT_CLASS(klass);
PurpleCipherClass *cipher_class = PURPLE_CIPHER_CLASS(klass);
- GParamSpec *pspec;
obj_class->get_property = purple_aes_cipher_get_property;
obj_class->set_property = purple_aes_cipher_set_property;
@@ -595,18 +600,19 @@ purple_aes_cipher_class_init(PurpleAESCi
cipher_class->get_batch_mode = purple_aes_cipher_get_batch_mode;
cipher_class->get_block_size = purple_aes_cipher_get_block_size;
- pspec = g_param_spec_enum("batch-mode", "batch-mode", "batch-mode",
- PURPLE_TYPE_CIPHER_BATCH_MODE, 0,
+ properties[PROP_BATCH_MODE] = g_param_spec_enum("batch-mode", "batch-mode",
+ "batch-mode", PURPLE_TYPE_CIPHER_BATCH_MODE, 0,
G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS);
- g_object_class_install_property(obj_class, PROP_BATCH_MODE, pspec);
+ g_object_class_install_property(obj_class, PROP_BATCH_MODE,
+ properties[PROP_BATCH_MODE]);
- pspec = g_param_spec_string("iv", "iv", "iv", NULL,
+ properties[PROP_IV] = g_param_spec_string("iv", "iv", "iv", NULL,
G_PARAM_WRITABLE | G_PARAM_STATIC_STRINGS);
- g_object_class_install_property(obj_class, PROP_IV, pspec);
+ g_object_class_install_property(obj_class, PROP_IV, properties[PROP_IV]);
- pspec = g_param_spec_string("key", "key", "key", NULL,
+ properties[PROP_KEY] = g_param_spec_string("key", "key", "key", NULL,
G_PARAM_WRITABLE | G_PARAM_STATIC_STRINGS);
- g_object_class_install_property(obj_class, PROP_KEY, pspec);
+ g_object_class_install_property(obj_class, PROP_KEY, properties[PROP_KEY]);
g_type_class_add_private(klass, sizeof(PurpleAESCipherPrivate));
}
diff --git a/libpurple/ciphers/des3cipher.c b/libpurple/ciphers/des3cipher.c
--- a/libpurple/ciphers/des3cipher.c
+++ b/libpurple/ciphers/des3cipher.c
@@ -30,6 +30,8 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02111-1301 USA
*/
#include "internal.h"
+#include "glibcompat.h"
+
#include "des3cipher.h"
#include "descipher.h"
#include "enums.h"
@@ -71,6 +73,7 @@ enum {
* Globals
*****************************************************************************/
static GObjectClass *parent_class = NULL;
+static GParamSpec *properties[PROP_LAST];
/******************************************************************************
* Cipher Stuff
@@ -102,7 +105,7 @@ purple_des3_cipher_set_key(PurpleCipher
purple_cipher_set_key(PURPLE_CIPHER(priv->key3), key + 16,
purple_cipher_get_key_size(PURPLE_CIPHER(priv->key3)));
- g_object_notify(G_OBJECT(cipher), "key");
+ g_object_notify_by_pspec(G_OBJECT(cipher), properties[PROP_KEY]);
}
static ssize_t
@@ -355,7 +358,7 @@ purple_des3_cipher_set_batch_mode(Purple
priv->mode = mode;
- g_object_notify(G_OBJECT(cipher), "batch-mode");
+ g_object_notify_by_pspec(G_OBJECT(cipher), properties[PROP_BATCH_MODE]);
}
static PurpleCipherBatchMode
@@ -377,7 +380,7 @@ purple_des3_cipher_set_iv(PurpleCipher *
memcpy(priv->iv, iv, len);
- g_object_notify(G_OBJECT(cipher), "iv");
+ g_object_notify_by_pspec(G_OBJECT(cipher), properties[PROP_IV]);
}
/******************************************************************************
@@ -446,7 +449,6 @@ static void
purple_des3_cipher_class_init(PurpleDES3CipherClass *klass) {
GObjectClass *obj_class = G_OBJECT_CLASS(klass);
PurpleCipherClass *cipher_class = PURPLE_CIPHER_CLASS(klass);
- GParamSpec *pspec;
parent_class = g_type_class_peek_parent(klass);
@@ -462,18 +464,19 @@ purple_des3_cipher_class_init(PurpleDES3
cipher_class->get_batch_mode = purple_des3_cipher_get_batch_mode;
cipher_class->get_key_size = purple_des3_cipher_get_key_size;
- pspec = g_param_spec_enum("batch-mode", "batch-mode", "batch-mode",
- PURPLE_TYPE_CIPHER_BATCH_MODE, 0,
+ properties[PROP_BATCH_MODE] = g_param_spec_enum("batch-mode", "batch-mode",
+ "batch-mode", PURPLE_TYPE_CIPHER_BATCH_MODE, 0,
G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS);
- g_object_class_install_property(obj_class, PROP_BATCH_MODE, pspec);
+ g_object_class_install_property(obj_class, PROP_BATCH_MODE,
+ properties[PROP_BATCH_MODE]);
- pspec = g_param_spec_string("iv", "iv", "iv", NULL,
+ properties[PROP_IV] = g_param_spec_string("iv", "iv", "iv", NULL,
G_PARAM_WRITABLE | G_PARAM_STATIC_STRINGS);
- g_object_class_install_property(obj_class, PROP_IV, pspec);
+ g_object_class_install_property(obj_class, PROP_IV, properties[PROP_IV]);
- pspec = g_param_spec_string("key", "key", "key", NULL,
+ properties[PROP_KEY] = g_param_spec_string("key", "key", "key", NULL,
G_PARAM_WRITABLE | G_PARAM_STATIC_STRINGS);
- g_object_class_install_property(obj_class, PROP_KEY, pspec);
+ g_object_class_install_property(obj_class, PROP_KEY, properties[PROP_KEY]);
g_type_class_add_private(klass, sizeof(PurpleDES3CipherPrivate));
}
diff --git a/libpurple/ciphers/descipher.c b/libpurple/ciphers/descipher.c
--- a/libpurple/ciphers/descipher.c
+++ b/libpurple/ciphers/descipher.c
@@ -30,6 +30,8 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02111-1301 USA
*/
#include "internal.h"
+#include "glibcompat.h"
+
#include "descipher.h"
#include "enums.h"
@@ -59,6 +61,7 @@ enum {
* Globals
*****************************************************************************/
static GObjectClass *parent_class = NULL;
+static GParamSpec *properties[PROP_LAST];
/*
* The s-box values are permuted according to the 'primitive function P'
@@ -384,7 +387,7 @@ purple_des_cipher_set_key(PurpleCipher *
priv->decrypt_subkeys[i + 1] = priv->encrypt_subkeys[31 - i];
}
- g_object_notify(G_OBJECT(cipher), "key");
+ g_object_notify_by_pspec(G_OBJECT(cipher), properties[PROP_KEY]);
}
static size_t
@@ -524,7 +527,6 @@ purple_des_cipher_class_init(PurpleDESCi
{
GObjectClass *obj_class = G_OBJECT_CLASS(klass);
PurpleCipherClass *cipher_class = PURPLE_CIPHER_CLASS(klass);
- GParamSpec *pspec;
parent_class = g_type_class_peek_parent(klass);
@@ -535,9 +537,9 @@ purple_des_cipher_class_init(PurpleDESCi
cipher_class->set_key = purple_des_cipher_set_key;
cipher_class->get_key_size = purple_des_cipher_get_key_size;
- pspec = g_param_spec_string("key", "key", "key", NULL,
+ properties[PROP_KEY] = g_param_spec_string("key", "key", "key", NULL,
G_PARAM_WRITABLE | G_PARAM_STATIC_STRINGS);
- g_object_class_install_property(obj_class, PROP_KEY, pspec);
+ g_object_class_install_property(obj_class, PROP_KEY, properties[PROP_KEY]);
g_type_class_add_private(klass, sizeof(PurpleDESCipherPrivate));
}
diff --git a/libpurple/ciphers/hmaccipher.c b/libpurple/ciphers/hmaccipher.c
--- a/libpurple/ciphers/hmaccipher.c
+++ b/libpurple/ciphers/hmaccipher.c
@@ -20,6 +20,8 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02111-1301 USA
*/
#include "internal.h"
+#include "glibcompat.h"
+
#include "hmaccipher.h"
#include <string.h>
@@ -49,6 +51,7 @@ enum {
* Globals
******************************************************************************/
static GObjectClass *parent_class = NULL;
+static GParamSpec *properties[PROP_LAST];
/*******************************************************************************
* Helpers
@@ -61,7 +64,7 @@ purple_hmac_cipher_set_hash(PurpleCipher
priv->hash = g_object_ref(G_OBJECT(hash));
- g_object_notify(G_OBJECT(cipher), "hash");
+ g_object_notify_by_pspec(G_OBJECT(cipher), properties[PROP_HASH]);
}
/*******************************************************************************
@@ -263,7 +266,6 @@ static void
purple_hmac_cipher_class_init(PurpleHMACCipherClass *klass) {
GObjectClass *obj_class = G_OBJECT_CLASS(klass);
PurpleCipherClass *cipher_class = PURPLE_CIPHER_CLASS(klass);
- GParamSpec *pspec;
parent_class = g_type_class_peek_parent(klass);
@@ -281,10 +283,12 @@ purple_hmac_cipher_class_init(PurpleHMAC
cipher_class->set_key = purple_hmac_cipher_set_key;
cipher_class->get_block_size = purple_hmac_cipher_get_block_size;
- pspec = g_param_spec_object("hash", "hash", "hash", PURPLE_TYPE_HASH,
+ properties[PROP_HASH] = g_param_spec_object("hash", "hash", "hash",
+ PURPLE_TYPE_HASH,
G_PARAM_READWRITE | G_PARAM_CONSTRUCT_ONLY |
G_PARAM_STATIC_STRINGS);
- g_object_class_install_property(obj_class, PROP_HASH, pspec);
+ g_object_class_install_property(obj_class, PROP_HASH,
+ properties[PROP_HASH]);
}
/******************************************************************************
diff --git a/libpurple/ciphers/pbkdf2cipher.c b/libpurple/ciphers/pbkdf2cipher.c
--- a/libpurple/ciphers/pbkdf2cipher.c
+++ b/libpurple/ciphers/pbkdf2cipher.c
@@ -22,6 +22,8 @@
* Written by Tomek Wasilczyk <tomkiewicz at cpw.pidgin.im>
*/
#include "internal.h"
+#include "glibcompat.h"
+
#include "pbkdf2cipher.h"
#include "hmaccipher.h"
#include "debug.h"
@@ -61,6 +63,7 @@ enum {
* Globals
******************************************************************************/
static GObjectClass *parent_class = NULL;
+static GParamSpec *properties[PROP_LAST];
/*******************************************************************************
* Helpers
@@ -73,7 +76,7 @@ purple_pbkdf2_cipher_set_hash(PurpleCiph
priv->hash = g_object_ref(G_OBJECT(hash));
- g_object_notify(G_OBJECT(cipher), "hash");
+ g_object_notify_by_pspec(G_OBJECT(cipher), properties[PROP_HASH]);
}
/******************************************************************************
@@ -323,7 +326,6 @@ static void
purple_pbkdf2_cipher_class_init(PurplePBKDF2CipherClass *klass) {
GObjectClass *obj_class = G_OBJECT_CLASS(klass);
More information about the Commits
mailing list