/soc/2013/ankitkv/gobjectification: 01d983ce883d: Replaced Purpl...
Ankit Vani
a at nevitus.org
Sun Jul 14 17:24:30 EDT 2013
Changeset: 01d983ce883d63928a27d3f18e0724abd79068f9
Author: Ankit Vani <a at nevitus.org>
Date: 2013-07-15 02:53 +0530
Branch: soc.2013.gobjectification
URL: https://hg.pidgin.im/soc/2013/ankitkv/gobjectification/rev/01d983ce883d
Description:
Replaced PurpleValue by GValue and GType in the API
diffstat:
libpurple/dbus-server.h | 5 ++---
libpurple/plugin.h | 18 +++++++++---------
libpurple/plugins/mono/loader/mono-helper.h | 4 +---
libpurple/plugins/perl/perl-common.h | 4 ++--
libpurple/plugins/tcl/tcl_purple.h | 4 ++--
libpurple/signals.h | 19 ++++++++-----------
libpurple/status.h | 10 +++++-----
7 files changed, 29 insertions(+), 35 deletions(-)
diffs (198 lines):
diff --git a/libpurple/dbus-server.h b/libpurple/dbus-server.h
--- a/libpurple/dbus-server.h
+++ b/libpurple/dbus-server.h
@@ -140,12 +140,11 @@ void purple_dbus_unregister_pointer(gpoi
@param name The name of the signal ("bla-bla-blaa")
@param num_values The number of parameters.
- @param values Array of pointers to #PurpleValue objects representing
- the types of the parameters.
+ @param types Array of the types of the parameters.
@param vargs A va_list containing the actual parameters.
*/
void purple_dbus_signal_emit_purple(const char *name, int num_values,
- PurpleValue **values, va_list vargs);
+ GType *types, va_list vargs);
/**
* Returns whether Purple's D-BUS subsystem is up and running. If it's
diff --git a/libpurple/plugin.h b/libpurple/plugin.h
--- a/libpurple/plugin.h
+++ b/libpurple/plugin.h
@@ -436,7 +436,7 @@ const gchar *purple_plugin_get_homepage(
* @param command The name of the command.
* @param func The function to execute.
* @param marshal The marshalling function.
- * @param ret_value The return value type.
+ * @param ret_type The return type.
* @param num_params The number of parameters.
* @param ... The parameter types.
*
@@ -446,7 +446,7 @@ const gchar *purple_plugin_get_homepage(
gboolean purple_plugin_ipc_register(PurplePlugin *plugin, const char *command,
PurpleCallback func,
PurpleSignalMarshalFunc marshal,
- PurpleValue *ret_value, int num_params, ...);
+ GType ret_type, int num_params, ...);
/**
* Unregisters an IPC command in a plugin.
@@ -466,17 +466,17 @@ void purple_plugin_ipc_unregister_all(Pu
/**
* Returns a list of value types used for an IPC command.
*
- * @param plugin The plugin.
- * @param command The name of the command.
- * @param ret_value The returned return value.
- * @param num_params The returned number of parameters.
- * @param params The returned list of parameters.
+ * @param plugin The plugin.
+ * @param command The name of the command.
+ * @param ret_value The returned return type.
+ * @param num_params The returned number of parameters.
+ * @param param_types The returned list of parameter types.
*
* @return TRUE if the command was found, or FALSE otherwise.
*/
gboolean purple_plugin_ipc_get_params(PurplePlugin *plugin, const char *command,
- PurpleValue **ret_value, int *num_params,
- PurpleValue ***params);
+ GType *ret_value, int *num_params,
+ GType **param_types);
/**
* Executes an IPC command.
diff --git a/libpurple/plugins/mono/loader/mono-helper.h b/libpurple/plugins/mono/loader/mono-helper.h
--- a/libpurple/plugins/mono/loader/mono-helper.h
+++ b/libpurple/plugins/mono/loader/mono-helper.h
@@ -49,9 +49,7 @@ void ml_set_domain(MonoDomain *d);
void ml_init_internal_calls(void);
-MonoObject* ml_object_from_purple_type(PurpleType type, gpointer data);
-
-MonoObject* ml_object_from_purple_subtype(PurpleSubType type, gpointer data);
+MonoObject* ml_object_from_purple_type(GType type, gpointer data);
MonoObject* ml_create_api_object(char *class_name);
diff --git a/libpurple/plugins/perl/perl-common.h b/libpurple/plugins/perl/perl-common.h
--- a/libpurple/plugins/perl/perl-common.h
+++ b/libpurple/plugins/perl/perl-common.h
@@ -67,8 +67,8 @@ gboolean purple_perl_value_from_sv(Purpl
SV *purple_perl_sv_from_value(const PurpleValue *value);
#endif
-void *purple_perl_data_from_sv(PurpleValue *value, SV *sv);
-SV *purple_perl_sv_from_vargs(const PurpleValue *value, va_list *args,
+void *purple_perl_data_from_sv(GType type, SV *sv);
+SV *purple_perl_sv_from_vargs(const GType type, va_list *args,
void ***copy_arg);
SV *purple_perl_sv_from_fun(PurplePlugin *plugin, SV *callback);
#endif /* _PURPLE_PERL_COMMON_H_ */
diff --git a/libpurple/plugins/tcl/tcl_purple.h b/libpurple/plugins/tcl/tcl_purple.h
--- a/libpurple/plugins/tcl/tcl_purple.h
+++ b/libpurple/plugins/tcl/tcl_purple.h
@@ -40,9 +40,9 @@ struct tcl_signal_handler {
Tcl_Obj *args;
Tcl_Obj *proc;
- PurpleValue *returntype;
+ GType returntype;
int nargs;
- PurpleValue **argtypes;
+ GType *argtypes;
};
struct tcl_cmd_handler {
diff --git a/libpurple/signals.h b/libpurple/signals.h
--- a/libpurple/signals.h
+++ b/libpurple/signals.h
@@ -67,18 +67,16 @@ G_BEGIN_DECLS
* @param instance The instance to register the signal for.
* @param signal The signal name.
* @param marshal The marshal function.
- * @param ret_value The return value type, or NULL for no return value.
+ * @param ret_type The return value type, or G_TYPE_NONE for no return value.
* @param num_values The number of values to be passed to the callbacks.
* @param ... The values to pass to the callbacks.
*
* @return The signal ID local to that instance, or 0 if the signal
* couldn't be registered.
- *
- * @see PurpleValue
*/
gulong purple_signal_register(void *instance, const char *signal,
PurpleSignalMarshalFunc marshal,
- PurpleValue *ret_value, int num_values, ...);
+ GType ret_type, int num_values, ...);
/**
* Unregisters a signal in an instance.
@@ -98,15 +96,14 @@ void purple_signals_unregister_by_instan
/**
* Returns a list of value types used for a signal.
*
- * @param instance The instance the signal is registered to.
- * @param signal The signal.
- * @param ret_value The return value from the last signal handler.
- * @param num_values The returned number of values.
- * @param values The returned list of values.
+ * @param instance The instance the signal is registered to.
+ * @param signal The signal.
+ * @param ret_type The return type for the signal.
+ * @param num_values The returned number of values.
+ * @param value_types The returned list of value types.
*/
void purple_signal_get_values(void *instance, const char *signal,
- PurpleValue **ret_value,
- int *num_values, PurpleValue ***values);
+ GType *ret_type, int *num_values, GType **value_types);
/**
* Connects a signal handler to a signal for a particular object.
diff --git a/libpurple/status.h b/libpurple/status.h
--- a/libpurple/status.h
+++ b/libpurple/status.h
@@ -259,7 +259,7 @@ PurpleStatusType *purple_status_type_new
gboolean independent,
const char *attr_id,
const char *attr_name,
- PurpleValue *attr_value, ...) G_GNUC_NULL_TERMINATED;
+ GValue *attr_value, ...) G_GNUC_NULL_TERMINATED;
/**
* Destroys a status type.
@@ -393,12 +393,12 @@ const PurpleStatusType *purple_status_ty
*
* @param id The ID of the attribute.
* @param name The name presented to the user.
- * @param value_type The type of data contained in the attribute.
+ * @param value The data contained in the attribute.
*
* @return A new status attribute.
*/
PurpleStatusAttr *purple_status_attr_new(const char *id, const char *name,
- PurpleValue *value_type);
+ GValue *value);
/**
* Destroys a status attribute.
@@ -432,7 +432,7 @@ const char *purple_status_attr_get_name(
*
* @return The status attribute's value.
*/
-PurpleValue *purple_status_attr_get_value(const PurpleStatusAttr *attr);
+GValue *purple_status_attr_get_value(const PurpleStatusAttr *attr);
/*@}*/
@@ -605,7 +605,7 @@ gboolean purple_status_is_online(const P
*
* @return The value of the attribute.
*/
-PurpleValue *purple_status_get_attr_value(const PurpleStatus *status,
+GValue *purple_status_get_attr_value(const PurpleStatus *status,
const char *id);
/**
More information about the Commits
mailing list