pidgin/pidgin

b34e47e69218
Merged in dequisdequis/pidgin/release-2.x.y (pull request #71)

Add PurplePrefsUiOps API from instantbird
--- a/ChangeLog.API Thu Jun 16 22:29:37 2016 -0500
+++ b/ChangeLog.API Thu Jun 16 22:30:49 2016 -0500
@@ -6,7 +6,9 @@
* account-status-changing signal (account signals)
* buddy-removed-from-group signal (blist signals)
* PurpleCommandsUiOps, to allow the UI to override the
- built-in handling of commands.
+ built-in handling of commands.
+ * PurplePrefsUiOps, to allow the UI to override the way global
+ preferences are stored.
version 2.10.12:
* No changes
--- a/libpurple/prefs.c Thu Jun 16 22:29:37 2016 -0500
+++ b/libpurple/prefs.c Thu Jun 16 22:30:49 2016 -0500
@@ -40,11 +40,15 @@
#include "win32dep.h"
#endif
-struct pref_cb {
+static PurplePrefsUiOps *prefs_ui_ops = NULL;
+
+struct _PurplePrefCallbackData {
PurplePrefCallback func;
gpointer data;
guint id;
void *handle;
+ void *ui_data;
+ char *name;
};
/* TODO: This should use PurpleValues? */
@@ -78,6 +82,24 @@
static GHashTable *prefs_hash = NULL;
static guint save_timer = 0;
static gboolean prefs_loaded = FALSE;
+static GSList *ui_callbacks = NULL;
+
+#define PURPLE_PREFS_UI_OP_CALL(member, ...) \
+ { \
+ PurplePrefsUiOps *uiop = purple_prefs_get_ui_ops(); \
+ if (uiop && uiop->member) { \
+ uiop->member(__VA_ARGS__); \
+ return; \
+ } \
+ }
+
+#define PURPLE_PREFS_UI_OP_CALL_RETURN(member, ...) \
+ { \
+ PurplePrefsUiOps *uiop = purple_prefs_get_ui_ops(); \
+ if (uiop && uiop->member) { \
+ return uiop->member(__VA_ARGS__); \
+ } \
+ }
/*********************************************************************
@@ -207,6 +229,8 @@
return;
}
+ PURPLE_PREFS_UI_OP_CALL(save);
+
node = prefs_to_xmlnode();
data = xmlnode_to_formatted_str(node, NULL);
purple_util_write_data_to_file("prefs.xml", data, -1);
@@ -225,6 +249,8 @@
static void
schedule_prefs_save(void)
{
+ PURPLE_PREFS_UI_OP_CALL(schedule_save);
+
if (save_timer == 0)
save_timer = purple_timeout_add_seconds(5, save_cb, NULL);
}
@@ -376,12 +402,21 @@
gboolean
purple_prefs_load()
{
- gchar *filename = g_build_filename(purple_user_dir(), "prefs.xml", NULL);
+ gchar *filename;
gchar *contents = NULL;
gsize length;
GMarkupParseContext *context;
GError *error = NULL;
+ PurplePrefsUiOps *uiop = purple_prefs_get_ui_ops();
+
+ if (uiop && uiop->load) {
+ prefs_loaded = TRUE;
+ return uiop->load();
+ }
+
+ filename = g_build_filename(purple_user_dir(), "prefs.xml", NULL);
+
if (!filename) {
prefs_loaded = TRUE;
return FALSE;
@@ -605,13 +640,19 @@
void
purple_prefs_add_none(const char *name)
{
+ PURPLE_PREFS_UI_OP_CALL(add_none, name);
+
add_pref(PURPLE_PREF_NONE, name);
}
void
purple_prefs_add_bool(const char *name, gboolean value)
{
- struct purple_pref *pref = add_pref(PURPLE_PREF_BOOLEAN, name);
+ struct purple_pref *pref;
+
+ PURPLE_PREFS_UI_OP_CALL(add_bool, name, value);
+
+ pref = add_pref(PURPLE_PREF_BOOLEAN, name);
if(!pref)
return;
@@ -622,7 +663,11 @@
void
purple_prefs_add_int(const char *name, int value)
{
- struct purple_pref *pref = add_pref(PURPLE_PREF_INT, name);
+ struct purple_pref *pref;
+
+ PURPLE_PREFS_UI_OP_CALL(add_int, name, value);
+
+ pref = add_pref(PURPLE_PREF_INT, name);
if(!pref)
return;
@@ -640,6 +685,8 @@
return;
}
+ PURPLE_PREFS_UI_OP_CALL(add_string, name, value);
+
pref = add_pref(PURPLE_PREF_STRING, name);
if(!pref)
@@ -651,9 +698,13 @@
void
purple_prefs_add_string_list(const char *name, GList *value)
{
- struct purple_pref *pref = add_pref(PURPLE_PREF_STRING_LIST, name);
+ struct purple_pref *pref;
GList *tmp;
+ PURPLE_PREFS_UI_OP_CALL(add_string_list, name, value);
+
+ pref = add_pref(PURPLE_PREF_STRING_LIST, name);
+
if(!pref)
return;
@@ -670,7 +721,12 @@
void
purple_prefs_add_path(const char *name, const char *value)
{
- struct purple_pref *pref = add_pref(PURPLE_PREF_PATH, name);
+ struct purple_pref *pref;
+
+ /* re-use the string UI OP */
+ PURPLE_PREFS_UI_OP_CALL(add_string, name, value);
+
+ pref = add_pref(PURPLE_PREF_PATH, name);
if(!pref)
return;
@@ -681,9 +737,14 @@
void
purple_prefs_add_path_list(const char *name, GList *value)
{
- struct purple_pref *pref = add_pref(PURPLE_PREF_PATH_LIST, name);
+ struct purple_pref *pref;
GList *tmp;
+ /* re-use the string list UI OP */
+ PURPLE_PREFS_UI_OP_CALL(add_string_list, name, value);
+
+ pref = add_pref(PURPLE_PREF_PATH_LIST, name);
+
if(!pref)
return;
@@ -740,7 +801,11 @@
void
purple_prefs_remove(const char *name)
{
- struct purple_pref *pref = find_pref(name);
+ struct purple_pref *pref;
+
+ PURPLE_PREFS_UI_OP_CALL(remove, name);
+
+ pref = find_pref(name);
if(!pref)
return;
@@ -761,16 +826,51 @@
struct purple_pref *cb_pref;
for(cb_pref = pref; cb_pref; cb_pref = cb_pref->parent) {
for(cbs = cb_pref->callbacks; cbs; cbs = cbs->next) {
- struct pref_cb *cb = cbs->data;
+ PurplePrefCallbackData *cb = cbs->data;
cb->func(name, pref->type, pref->value.generic, cb->data);
}
}
}
+static void
+do_ui_callbacks(const char *name)
+{
+ GSList *cbs;
+
+ purple_debug_misc("prefs", "trigger callback %s\n", name);
+
+ for (cbs = ui_callbacks; cbs; cbs = cbs->next) {
+ PurplePrefCallbackData *cb = cbs->data;
+ const char *cb_name = cb->name;
+ size_t len = strlen(cb_name);
+ if (!strncmp(cb_name, name, len) &&
+ (name[len] == 0 || name[len] == '/' ||
+ (len && name[len - 1] == '/'))) {
+ /* This test should behave like this:
+ * name = /toto/tata
+ * cb_name = /toto/tata --> true
+ * cb_name = /toto/tatatiti --> false
+ * cb_name = / --> true
+ * cb_name = /toto --> true
+ * cb_name = /toto/ --> true
+ */
+ purple_prefs_trigger_callback_object(cbs->data);
+ }
+ }
+}
+
void
purple_prefs_trigger_callback(const char *name)
{
- struct purple_pref *pref = find_pref(name);
+ struct purple_pref *pref;
+ PurplePrefsUiOps *uiop = purple_prefs_get_ui_ops();
+
+ if (uiop && uiop->connect_callback) {
+ do_ui_callbacks(name);
+ return;
+ }
+
+ pref = find_pref(name);
if(!pref) {
purple_debug_error("prefs",
@@ -781,6 +881,7 @@
do_callbacks(name, pref);
}
+/* this function is deprecated, so it doesn't get the new UI ops */
void
purple_prefs_set_generic(const char *name, gpointer value)
{
@@ -799,7 +900,11 @@
void
purple_prefs_set_bool(const char *name, gboolean value)
{
- struct purple_pref *pref = find_pref(name);
+ struct purple_pref *pref;
+
+ PURPLE_PREFS_UI_OP_CALL(set_bool, name, value);
+
+ pref = find_pref(name);
if(pref) {
if(pref->type != PURPLE_PREF_BOOLEAN) {
@@ -820,7 +925,11 @@
void
purple_prefs_set_int(const char *name, int value)
{
- struct purple_pref *pref = find_pref(name);
+ struct purple_pref *pref;
+
+ PURPLE_PREFS_UI_OP_CALL(set_int, name, value);
+
+ pref = find_pref(name);
if(pref) {
if(pref->type != PURPLE_PREF_INT) {
@@ -841,13 +950,17 @@
void
purple_prefs_set_string(const char *name, const char *value)
{
- struct purple_pref *pref = find_pref(name);
+ struct purple_pref *pref;
if(value != NULL && !g_utf8_validate(value, -1, NULL)) {
purple_debug_error("prefs", "purple_prefs_set_string: Cannot store invalid UTF8 for string pref %s\n", name);
return;
}
+ PURPLE_PREFS_UI_OP_CALL(set_string, name, value);
+
+ pref = find_pref(name);
+
if(pref) {
if(pref->type != PURPLE_PREF_STRING && pref->type != PURPLE_PREF_PATH) {
purple_debug_error("prefs",
@@ -868,7 +981,12 @@
void
purple_prefs_set_string_list(const char *name, GList *value)
{
- struct purple_pref *pref = find_pref(name);
+ struct purple_pref *pref;
+
+ PURPLE_PREFS_UI_OP_CALL(set_string_list, name, value);
+
+ pref = find_pref(name);
+
if(pref) {
GList *tmp;
@@ -903,7 +1021,11 @@
void
purple_prefs_set_path(const char *name, const char *value)
{
- struct purple_pref *pref = find_pref(name);
+ struct purple_pref *pref;
+
+ PURPLE_PREFS_UI_OP_CALL(set_string, name, value);
+
+ pref = find_pref(name);
if(pref) {
if(pref->type != PURPLE_PREF_PATH) {
@@ -925,7 +1047,12 @@
void
purple_prefs_set_path_list(const char *name, GList *value)
{
- struct purple_pref *pref = find_pref(name);
+ struct purple_pref *pref;
+
+ PURPLE_PREFS_UI_OP_CALL(set_string_list, name, value);
+
+ pref = find_pref(name);
+
if(pref) {
GList *tmp;
@@ -956,7 +1083,11 @@
gboolean
purple_prefs_exists(const char *name)
{
- struct purple_pref *pref = find_pref(name);
+ struct purple_pref *pref;
+
+ PURPLE_PREFS_UI_OP_CALL_RETURN(exists, name);
+
+ pref = find_pref(name);
if (pref != NULL)
return TRUE;
@@ -967,7 +1098,11 @@
PurplePrefType
purple_prefs_get_type(const char *name)
{
- struct purple_pref *pref = find_pref(name);
+ struct purple_pref *pref;
+
+ PURPLE_PREFS_UI_OP_CALL_RETURN(get_type, name);
+
+ pref = find_pref(name);
if (pref == NULL)
return PURPLE_PREF_NONE;
@@ -978,7 +1113,11 @@
gboolean
purple_prefs_get_bool(const char *name)
{
- struct purple_pref *pref = find_pref(name);
+ struct purple_pref *pref;
+
+ PURPLE_PREFS_UI_OP_CALL_RETURN(get_bool, name);
+
+ pref = find_pref(name);
if(!pref) {
purple_debug_error("prefs",
@@ -996,7 +1135,11 @@
int
purple_prefs_get_int(const char *name)
{
- struct purple_pref *pref = find_pref(name);
+ struct purple_pref *pref;
+
+ PURPLE_PREFS_UI_OP_CALL_RETURN(get_int, name);
+
+ pref = find_pref(name);
if(!pref) {
purple_debug_error("prefs",
@@ -1014,7 +1157,11 @@
const char *
purple_prefs_get_string(const char *name)
{
- struct purple_pref *pref = find_pref(name);
+ struct purple_pref *pref;
+
+ PURPLE_PREFS_UI_OP_CALL_RETURN(get_string, name);
+
+ pref = find_pref(name);
if(!pref) {
purple_debug_error("prefs",
@@ -1032,9 +1179,13 @@
GList *
purple_prefs_get_string_list(const char *name)
{
- struct purple_pref *pref = find_pref(name);
+ struct purple_pref *pref;
GList *ret = NULL, *tmp;
+ PURPLE_PREFS_UI_OP_CALL_RETURN(get_string_list, name);
+
+ pref = find_pref(name);
+
if(!pref) {
purple_debug_error("prefs",
"purple_prefs_get_string_list: Unknown pref %s\n", name);
@@ -1055,7 +1206,11 @@
const char *
purple_prefs_get_path(const char *name)
{
- struct purple_pref *pref = find_pref(name);
+ struct purple_pref *pref;
+
+ PURPLE_PREFS_UI_OP_CALL_RETURN(get_string, name);
+
+ pref = find_pref(name);
if(!pref) {
purple_debug_error("prefs",
@@ -1073,9 +1228,13 @@
GList *
purple_prefs_get_path_list(const char *name)
{
- struct purple_pref *pref = find_pref(name);
+ struct purple_pref *pref;
GList *ret = NULL, *tmp;
+ PURPLE_PREFS_UI_OP_CALL_RETURN(get_string_list, name);
+
+ pref = find_pref(name);
+
if(!pref) {
purple_debug_error("prefs",
"purple_prefs_get_path_list: Unknown pref %s\n", name);
@@ -1166,6 +1325,8 @@
{
struct purple_pref *oldpref, *newpref;
+ PURPLE_PREFS_UI_OP_CALL(rename, oldname, newname);
+
oldpref = find_pref(oldname);
/* it's already been renamed, call off the dogs */
@@ -1188,6 +1349,8 @@
{
struct purple_pref *oldpref, *newpref;
+ PURPLE_PREFS_UI_OP_CALL(rename_boolean_toggle, oldname, newname);
+
oldpref = find_pref(oldname);
/* it's already been renamed, call off the cats */
@@ -1230,31 +1393,103 @@
guint
purple_prefs_connect_callback(void *handle, const char *name, PurplePrefCallback func, gpointer data)
{
- struct purple_pref *pref;
- struct pref_cb *cb;
+ struct purple_pref *pref = NULL;
+ PurplePrefCallbackData *cb;
static guint cb_id = 0;
+ PurplePrefsUiOps *uiop = NULL;
g_return_val_if_fail(name != NULL, 0);
g_return_val_if_fail(func != NULL, 0);
- pref = find_pref(name);
- if (pref == NULL) {
- purple_debug_error("prefs", "purple_prefs_connect_callback: Unknown pref %s\n", name);
- return 0;
+ uiop = purple_prefs_get_ui_ops();
+
+ if (!(uiop && uiop->connect_callback)) {
+ pref = find_pref(name);
+ if (pref == NULL) {
+ purple_debug_error("prefs", "purple_prefs_connect_callback: Unknown pref %s\n", name);
+ return 0;
+ }
}
- cb = g_new0(struct pref_cb, 1);
+ cb = g_new0(PurplePrefCallbackData, 1);
cb->func = func;
cb->data = data;
cb->id = ++cb_id;
cb->handle = handle;
+ cb->name = g_strdup(name);
- pref->callbacks = g_slist_append(pref->callbacks, cb);
+ if (uiop && uiop->connect_callback) {
+ cb->ui_data = uiop->connect_callback(name, cb);
+
+ if (cb->ui_data == NULL) {
+ purple_debug_error("prefs", "purple_prefs_connect_callback: connect failed for %s\n", name);
+ g_free(cb->name);
+ g_free(cb);
+ return 0;
+ }
+
+ ui_callbacks = g_slist_append(ui_callbacks, cb);
+ } else {
+ pref->callbacks = g_slist_append(pref->callbacks, cb);
+ }
return cb->id;
}
+static void
+purple_prefs_trigger_ui_callback_object(PurplePrefCallbackData *cb)
+{
+ PurplePrefsUiOps *uiop = purple_prefs_get_ui_ops();
+ gconstpointer value = NULL;
+ PurplePrefType type = PURPLE_PREF_NONE;
+
+ type = uiop->get_type(cb->name);
+
+ switch (type) {
+ case PURPLE_PREF_INT:
+ if (uiop->get_int) {
+ value = GINT_TO_POINTER(uiop->get_int(cb->name));
+ }
+ break;
+ case PURPLE_PREF_BOOLEAN:
+ if (uiop->get_bool) {
+ value = GINT_TO_POINTER(uiop->get_bool(cb->name));
+ }
+ break;
+ case PURPLE_PREF_STRING:
+ case PURPLE_PREF_PATH:
+ if (uiop->get_string) {
+ value = uiop->get_string(cb->name);
+ }
+ break;
+ case PURPLE_PREF_STRING_LIST:
+ case PURPLE_PREF_PATH_LIST:
+ if (uiop->get_string_list) {
+ value = uiop->get_string_list(cb->name);
+ }
+ break;
+ case PURPLE_PREF_NONE:
+ break;
+ default:
+ purple_debug_error("prefs", "Unexpected type = %i\n", type);
+ }
+
+ cb->func(cb->name, type, value, cb->data);
+}
+
+void
+purple_prefs_trigger_callback_object(PurplePrefCallbackData *cb)
+{
+ PurplePrefsUiOps *uiop = purple_prefs_get_ui_ops();
+
+ if (uiop && uiop->connect_callback && uiop->get_type) {
+ purple_prefs_trigger_ui_callback_object(cb);
+ } else {
+ purple_prefs_trigger_callback(cb->name);
+ }
+}
+
static gboolean
disco_callback_helper(struct purple_pref *pref, guint callback_id)
{
@@ -1265,9 +1500,10 @@
return FALSE;
for(cbs = pref->callbacks; cbs; cbs = cbs->next) {
- struct pref_cb *cb = cbs->data;
+ PurplePrefCallbackData *cb = cbs->data;
if(cb->id == callback_id) {
pref->callbacks = g_slist_delete_link(pref->callbacks, cbs);
+ g_free(cb->name);
g_free(cb);
return TRUE;
}
@@ -1281,10 +1517,35 @@
return FALSE;
}
+static void
+disco_ui_callback_helper(guint callback_id)
+{
+ GSList *cbs;
+ PurplePrefsUiOps *uiop = purple_prefs_get_ui_ops();
+
+ for (cbs = ui_callbacks; cbs; cbs = cbs->next) {
+ PurplePrefCallbackData *cb = cbs->data;
+ if (cb->id == callback_id) {
+ uiop->disconnect_callback(cb->name, cb->ui_data);
+
+ ui_callbacks = g_slist_delete_link(ui_callbacks, cbs);
+ g_free(cb->name);
+ g_free(cb);
+ return;
+ }
+ }
+}
+
void
purple_prefs_disconnect_callback(guint callback_id)
{
- disco_callback_helper(&prefs, callback_id);
+ PurplePrefsUiOps *uiop = purple_prefs_get_ui_ops();
+
+ if (uiop && uiop->disconnect_callback) {
+ disco_ui_callback_helper(callback_id);
+ } else {
+ disco_callback_helper(&prefs, callback_id);
+ }
}
static void
@@ -1298,9 +1559,10 @@
cbs = pref->callbacks;
while (cbs != NULL) {
- struct pref_cb *cb = cbs->data;
+ PurplePrefCallbackData *cb = cbs->data;
if(cb->handle == handle) {
pref->callbacks = g_slist_delete_link(pref->callbacks, cbs);
+ g_free(cb->name);
g_free(cb);
cbs = pref->callbacks;
} else
@@ -1311,21 +1573,54 @@
disco_callback_helper_handle(child, handle);
}
+static void
+disco_ui_callback_helper_handle(void *handle)
+{
+ GSList *cbs;
+ PurplePrefsUiOps *uiop = purple_prefs_get_ui_ops();
+
+ cbs = ui_callbacks;
+ for (cbs = ui_callbacks; cbs; cbs = cbs->next) {
+ PurplePrefCallbackData *cb = cbs->data;
+ if (cb->handle != handle) {
+ cbs = cbs->next;
+ continue;
+ }
+
+ uiop->disconnect_callback(cb->name, cb->ui_data);
+
+ ui_callbacks = g_slist_delete_link(ui_callbacks, cbs);
+ g_free(cb->name);
+ g_free(cb);
+ cbs = ui_callbacks;
+ }
+}
+
void
purple_prefs_disconnect_by_handle(void *handle)
{
+ PurplePrefsUiOps *uiop = purple_prefs_get_ui_ops();
+
g_return_if_fail(handle != NULL);
- disco_callback_helper_handle(&prefs, handle);
+ if (uiop && uiop->disconnect_callback) {
+ disco_ui_callback_helper_handle(handle);
+ } else {
+ disco_callback_helper_handle(&prefs, handle);
+ }
}
GList *
purple_prefs_get_children_names(const char *name)
{
GList * list = NULL;
- struct purple_pref *pref = find_pref(name), *child;
+ struct purple_pref *pref, *child;
char sep[2] = "\0\0";;
+ PURPLE_PREFS_UI_OP_CALL_RETURN(get_children_names, name);
+
+ pref = find_pref(name);
+
if (pref == NULL)
return NULL;
@@ -1451,8 +1746,7 @@
if (save_timer != 0)
{
purple_timeout_remove(save_timer);
- save_timer = 0;
- sync_prefs();
+ save_cb(NULL);
}
purple_prefs_disconnect_by_handle(purple_prefs_get_handle());
@@ -1463,3 +1757,15 @@
prefs_hash = NULL;
}
+
+void
+purple_prefs_set_ui_ops(PurplePrefsUiOps *ops)
+{
+ prefs_ui_ops = ops;
+}
+
+PurplePrefsUiOps *
+purple_prefs_get_ui_ops(void)
+{
+ return prefs_ui_ops;
+}
--- a/libpurple/prefs.h Thu Jun 16 22:29:37 2016 -0500
+++ b/libpurple/prefs.h Thu Jun 16 22:30:49 2016 -0500
@@ -62,11 +62,86 @@
typedef void (*PurplePrefCallback) (const char *name, PurplePrefType type,
gconstpointer val, gpointer data);
+/**
+ * Opaque type to carry callback information
+ */
+typedef struct _PurplePrefCallbackData PurplePrefCallbackData;
+
+
+/** @copydoc _PurplePrefsUiOps */
+typedef struct _PurplePrefsUiOps PurplePrefsUiOps;
+
+
+/** Prefs UI operations
+ */
+struct _PurplePrefsUiOps
+{
+ void (*add_none)(const char *name);
+ void (*add_bool)(const char *name, gboolean value);
+ void (*add_int)(const char *name, int value);
+ void (*add_string)(const char *name, const char *value);
+ void (*add_string_list)(const char *name, GList *value);
+
+ void (*set_bool)(const char *name, gboolean value);
+ void (*set_int)(const char *name, int value);
+ void (*set_string)(const char *name, const char *value);
+ void (*set_string_list)(const char *name, GList *value);
+
+ gboolean (*get_bool)(const char *name);
+ int (*get_int)(const char *name);
+ const char *(*get_string)(const char *name);
+ GList *(*get_string_list)(const char *name);
+
+ PurplePrefType (*get_type)(const char *name);
+ GList *(*get_children_names)(const char *name);
+
+ gboolean (*exists)(const char *name);
+ void (*remove)(const char *name);
+
+ void (*rename)(const char *oldname, const char *newname);
+ void (*rename_boolean_toggle)(const char *oldname, const char *newname);
+
+ gboolean (*load)(void);
+ void (*save)(void);
+ void (*schedule_save)(void);
+
+ void *(*connect_callback)(const char *name, PurplePrefCallbackData *data);
+ void (*disconnect_callback)(const char *name, void *ui_data);
+
+ void (*_purple_reserved1)(void);
+ void (*_purple_reserved2)(void);
+ void (*_purple_reserved3)(void);
+ void (*_purple_reserved4)(void);
+ void (*_purple_reserved5)(void);
+};
+
+
+
#ifdef __cplusplus
extern "C" {
#endif
/**************************************************************************/
+/** @name UI Registration Functions */
+/**************************************************************************/
+/*@{*/
+/**
+ * Sets the UI operations structure to be used for preferences.
+ *
+ * @param ops The UI operations structure.
+ */
+void purple_prefs_set_ui_ops(PurplePrefsUiOps *ops);
+
+/**
+ * Returns the UI operations structure used for preferences.
+ *
+ * @return The UI operations structure in use.
+ */
+PurplePrefsUiOps *purple_prefs_get_ui_ops(void);
+
+/*@}*/
+
+/**************************************************************************/
/** @name Prefs API
Preferences are named according to a directory-like structure.
Example: "/plugins/core/potato/is_from_idaho" (probably a boolean) */
@@ -353,6 +428,13 @@
void purple_prefs_trigger_callback(const char *name);
/**
+ * Trigger callbacks as if the pref changed, taking a #PurplePrefCallbackData
+ * instead of a name
+ */
+void purple_prefs_trigger_callback_object(PurplePrefCallbackData *data);
+
+
+/**
* Read preferences
*/
gboolean purple_prefs_load(void);