# HG changeset patch # User masca@cpw.pidgin.im # Date 1314247234 0 # Node ID 16b33ffd75f81a45045b1100c8fa236a8907711c # Parent d3d41ba0c3b8a5787181c74818428b86fdfa6525# Parent d3e36e7af9e7eb2bf3bb24781f24c3ec29bf330c merge of '1ca17dd26ee879f7580c72b03d018e444e0a5144' and '9000557e8a6b7649547a10cfc0fe85dbb8ce661d' diff -r d3d41ba0c3b8 -r 16b33ffd75f8 libpurple/pounce.c --- a/libpurple/pounce.c Wed Aug 24 17:54:39 2011 +0000 +++ b/libpurple/pounce.c Thu Aug 25 04:40:34 2011 +0000 @@ -32,6 +32,31 @@ #include "pounce.h" #include "util.h" +/** + * A buddy pounce structure. + * + * Buddy pounces are actions triggered by a buddy-related event. For + * example, a sound can be played or an IM window opened when a buddy + * signs on or returns from away. Such responses are handled in the + * UI. The events themselves are done in the core. + */ +struct _PurplePounce +{ + char *ui_type; /**< The type of UI. */ + + PurplePounceEvent events; /**< The event(s) to pounce on. */ + PurplePounceOption options; /**< The pounce options */ + PurpleAccount *pouncer; /**< The user who is pouncing. */ + + char *pouncee; /**< The buddy to pounce on. */ + + GHashTable *actions; /**< The registered actions. */ + + gboolean save; /**< Whether or not the pounce should + be saved after activation. */ + void *data; /**< Pounce-specific data. */ +}; + typedef struct { GString *buffer; diff -r d3d41ba0c3b8 -r 16b33ffd75f8 libpurple/pounce.h --- a/libpurple/pounce.h Wed Aug 24 17:54:39 2011 +0000 +++ b/libpurple/pounce.h Thu Aug 25 04:40:34 2011 +0000 @@ -59,31 +59,6 @@ /** A pounce callback. */ typedef void (*PurplePounceCb)(PurplePounce *, PurplePounceEvent, void *); -/** - * A buddy pounce structure. - * - * Buddy pounces are actions triggered by a buddy-related event. For - * example, a sound can be played or an IM window opened when a buddy - * signs on or returns from away. Such responses are handled in the - * UI. The events themselves are done in the core. - */ -struct _PurplePounce -{ - char *ui_type; /**< The type of UI. */ - - PurplePounceEvent events; /**< The event(s) to pounce on. */ - PurplePounceOption options; /**< The pounce options */ - PurpleAccount *pouncer; /**< The user who is pouncing. */ - - char *pouncee; /**< The buddy to pounce on. */ - - GHashTable *actions; /**< The registered actions. */ - - gboolean save; /**< Whether or not the pounce should - be saved after activation. */ - void *data; /**< Pounce-specific data. */ -}; - #ifdef __cplusplus extern "C" { #endif diff -r d3d41ba0c3b8 -r 16b33ffd75f8 libpurple/status.c --- a/libpurple/status.c Wed Aug 24 17:54:39 2011 +0000 +++ b/libpurple/status.c Thu Aug 25 04:40:34 2011 +0000 @@ -763,29 +763,29 @@ specified_attr_ids = g_list_prepend(specified_attr_ids, (gpointer)id); - if (value->type == PURPLE_TYPE_STRING) + if (purple_value_get_type(value) == PURPLE_TYPE_STRING) { const gchar *string_data = l->data; l = l->next; - if (purple_strequal(string_data, value->data.string_data)) + if (purple_strequal(string_data, purple_value_get_string(value))) continue; purple_status_set_attr_string(status, id, string_data); changed = TRUE; } - else if (value->type == PURPLE_TYPE_INT) + else if (purple_value_get_type(value) == PURPLE_TYPE_INT) { int int_data = GPOINTER_TO_INT(l->data); l = l->next; - if (int_data == value->data.int_data) + if (int_data == purple_value_get_int(value)) continue; purple_status_set_attr_int(status, id, int_data); changed = TRUE; } - else if (value->type == PURPLE_TYPE_BOOLEAN) + else if (purple_value_get_type(value) == PURPLE_TYPE_BOOLEAN) { gboolean boolean_data = GPOINTER_TO_INT(l->data); l = l->next; - if (boolean_data == value->data.boolean_data) + if (boolean_data == purple_value_get_boolean(value)) continue; purple_status_set_attr_boolean(status, id, boolean_data); changed = TRUE; @@ -809,7 +809,7 @@ if (!g_list_find_custom(specified_attr_ids, attr->id, (GCompareFunc)strcmp)) { PurpleValue *default_value; default_value = purple_status_attr_get_value(attr); - if (default_value->type == PURPLE_TYPE_STRING) { + if (purple_value_get_type(default_value) == PURPLE_TYPE_STRING) { const char *cur = purple_status_get_attr_string(status, attr->id); const char *def = purple_value_get_string(default_value); if ((cur == NULL && def == NULL) @@ -819,14 +819,14 @@ } purple_status_set_attr_string(status, attr->id, def); - } else if (default_value->type == PURPLE_TYPE_INT) { + } else if (purple_value_get_type(default_value) == PURPLE_TYPE_INT) { int cur = purple_status_get_attr_int(status, attr->id); int def = purple_value_get_int(default_value); if (cur == def) continue; purple_status_set_attr_int(status, attr->id, def); - } else if (default_value->type == PURPLE_TYPE_BOOLEAN) { + } else if (purple_value_get_type(default_value) == PURPLE_TYPE_BOOLEAN) { gboolean cur = purple_status_get_attr_boolean(status, attr->id); gboolean def = purple_value_get_boolean(default_value); if (cur == def) diff -r d3d41ba0c3b8 -r 16b33ffd75f8 libpurple/value.c --- a/libpurple/value.c Wed Aug 24 17:54:39 2011 +0000 +++ b/libpurple/value.c Thu Aug 25 04:40:34 2011 +0000 @@ -29,6 +29,44 @@ #define OUTGOING_FLAG 0x01 +/** + * A wrapper for a type, subtype, and specific type of value. + */ +struct _PurpleValue +{ + PurpleType type; + unsigned short flags; + + union + { + char char_data; + unsigned char uchar_data; + gboolean boolean_data; + short short_data; + unsigned short ushort_data; + int int_data; + unsigned int uint_data; + long long_data; + unsigned long ulong_data; + gint64 int64_data; + guint64 uint64_data; + char *string_data; + void *object_data; + void *pointer_data; + int enum_data; + void *boxed_data; + + } data; + + union + { + unsigned int subtype; + char *specific_type; + + } u; + +}; + PurpleValue * purple_value_new(PurpleType type, ...) { diff -r d3d41ba0c3b8 -r 16b33ffd75f8 libpurple/value.h --- a/libpurple/value.h Wed Aug 24 17:54:39 2011 +0000 +++ b/libpurple/value.h Thu Aug 25 04:40:34 2011 +0000 @@ -86,40 +86,7 @@ /** * A wrapper for a type, subtype, and specific type of value. */ -typedef struct -{ - PurpleType type; - unsigned short flags; - - union - { - char char_data; - unsigned char uchar_data; - gboolean boolean_data; - short short_data; - unsigned short ushort_data; - int int_data; - unsigned int uint_data; - long long_data; - unsigned long ulong_data; - gint64 int64_data; - guint64 uint64_data; - char *string_data; - void *object_data; - void *pointer_data; - int enum_data; - void *boxed_data; - - } data; - - union - { - unsigned int subtype; - char *specific_type; - - } u; - -} PurpleValue; +typedef struct _PurpleValue PurpleValue; #ifdef __cplusplus extern "C" {