changeset 16751:8e54f40a60f3

Clean up a bunch of the perl api stuff. Eventually I'll dump the entire list and make it all pretty-like. Ideally before the release.
author Etan Reisner <pidgin@unreliablesource.net>
date Tue, 01 May 2007 03:21:27 +0000
parents 39c7bb133a9f
children 81bba936c933
files libpurple/plugins/perl/common/BuddyList.xs libpurple/plugins/perl/common/Notify.xs libpurple/plugins/perl/common/Proxy.xs libpurple/plugins/perl/common/Request.xs libpurple/plugins/perl/common/Util.xs pidgin/plugins/perl/common/GtkFt.xs
diffstat 6 files changed, 279 insertions(+), 232 deletions(-) [+]
line wrap: on
line diff
--- a/libpurple/plugins/perl/common/BuddyList.xs	Tue May 01 02:34:22 2007 +0000
+++ b/libpurple/plugins/perl/common/BuddyList.xs	Tue May 01 03:21:27 2007 +0000
@@ -50,15 +50,18 @@
 		XPUSHs(sv_2mortal(purple_perl_bless_object(l->data, "Purple::BuddyList::Buddy")));
 	}
 
+Purple::BuddyList::Group
+purple_find_group(name)
+	const char *name
+
+MODULE = Purple::BuddyList  PACKAGE = Purple::Find  PREFIX = purple_
+PROTOTYPES: ENABLE
+
 gboolean
 purple_group_on_account(group, account)
 	Purple::BuddyList::Group  group
 	Purple::Account account
 
-Purple::BuddyList::Group
-purple_find_group(name)
-	const char *name
-
 MODULE = Purple::BuddyList  PACKAGE = Purple::BuddyList::Contact  PREFIX = purple_contact_
 PROTOTYPES: ENABLE
 
--- a/libpurple/plugins/perl/common/Notify.xs	Tue May 01 02:34:22 2007 +0000
+++ b/libpurple/plugins/perl/common/Notify.xs	Tue May 01 03:21:27 2007 +0000
@@ -93,8 +93,44 @@
 	Purple::NotifyCloseCallback cb
 	gpointer user_data
 
+Purple::NotifyUiOps
+purple_notify_get_ui_ops()
+
+void
+purple_notify_set_ui_ops(ops)
+	Purple::NotifyUiOps ops
+
+void *
+purple_notify_message(handle, type, title, primary, secondary, cb, user_data)
+	void * handle
+	Purple::NotifyMsgType type
+	const char *title
+	const char *primary
+	const char *secondary
+	Purple::NotifyCloseCallback cb
+	gpointer user_data
+
+void *
+purple_notify_searchresults(gc, title, primary, secondary, results, cb, user_data)
+	Purple::Connection gc
+	const char *title
+	const char *primary
+	const char *secondary
+	Purple::NotifySearchResults results
+	Purple::NotifyCloseCallback cb
+	gpointer user_data
+
+void *
+purple_notify_uri(handle, uri)
+	void * handle
+	const char *uri
+
+MODULE = Purple::Notify  PACKAGE = Purple::NotifyUserInfo  PREFIX = purple_notify_user_info_
+PROTOTYPES: ENABLE
+
 Purple::NotifyUserInfo
-purple_notify_user_info_new()
+purple_notify_user_info_new(class)
+	C_ARGS: /* void */
 
 void
 purple_notify_user_info_destroy(user_info)
@@ -143,37 +179,3 @@
 gchar *
 purple_notify_user_info_entry_get_value(user_info_entry)
 	Purple::NotifyUserInfoEntry user_info_entry
-
-Purple::NotifyUiOps
-purple_notify_get_ui_ops()
-
-
-void *
-purple_notify_message(handle, type, title, primary, secondary, cb, user_data)
-	void * handle
-	Purple::NotifyMsgType type
-	const char *title
-	const char *primary
-	const char *secondary
-	Purple::NotifyCloseCallback cb
-	gpointer user_data
-
-void *
-purple_notify_searchresults(gc, title, primary, secondary, results, cb, user_data)
-	Purple::Connection gc
-	const char *title
-	const char *primary
-	const char *secondary
-	Purple::NotifySearchResults results
-	Purple::NotifyCloseCallback cb
-	gpointer user_data
-
-void
-purple_notify_set_ui_ops(ops)
-	Purple::NotifyUiOps ops
-
-void *
-purple_notify_uri(handle, uri)
-	void * handle
-	const char *uri
-
--- a/libpurple/plugins/perl/common/Proxy.xs	Tue May 01 02:34:22 2007 +0000
+++ b/libpurple/plugins/perl/common/Proxy.xs	Tue May 01 03:21:27 2007 +0000
@@ -21,13 +21,16 @@
 		newCONSTSUB(stash, (char *)civ->name, newSViv(civ->iv));
 }
 
-Purple::ProxyInfo
-purple_global_proxy_get_info()
-
 Purple::Handle
 purple_proxy_get_handle()
 
 void
+purple_proxy_init()
+
+MODULE = Purple::Proxy  PACKAGE = Purple::ProxyInfo  PREFIX = purple_proxy_info_
+PROTOTYPES: ENABLE
+
+void
 purple_proxy_info_destroy(info)
 	Purple::ProxyInfo info
 
@@ -79,5 +82,8 @@
 	Purple::ProxyInfo info
 	const char *username
 
-void
-purple_proxy_init()
+MODULE = Purple::Proxy  PACKAGE = Purple::Proxy  PREFIX = purple_
+PROTOTYPES: ENABLE
+
+Purple::ProxyInfo
+purple_global_proxy_get_info()
--- a/libpurple/plugins/perl/common/Request.xs	Tue May 01 02:34:22 2007 +0000
+++ b/libpurple/plugins/perl/common/Request.xs	Tue May 01 03:21:27 2007 +0000
@@ -205,9 +205,22 @@
 purple_request_close_with_handle(handle)
 	void * handle
 
+Purple::Request::UiOps
+purple_request_get_ui_ops()
+
+void
+purple_request_set_ui_ops(ops)
+	Purple::Request::UiOps ops
+
 MODULE = Purple::Request  PACKAGE = Purple::Request::Field  PREFIX = purple_request_field_
 PROTOTYPES: ENABLE
 
+Purple::Request::Field
+purple_request_field_account_new(id, text, account = NULL)
+	const char *id
+	const char *text
+	Purple::Account account
+
 Purple::Account
 purple_request_field_account_get_default_value(field)
 	Purple::Request::Field field
@@ -228,12 +241,6 @@
 purple_request_field_account_get_value(field)
 	Purple::Request::Field field
 
-Purple::Request::Field
-purple_request_field_account_new(id, text, account = NULL)
-	const char *id
-	const char *text
-	Purple::Account account
-
 void
 purple_request_field_account_set_default_value(field, default_value)
 	Purple::Request::Field field
@@ -249,6 +256,15 @@
 	Purple::Request::Field field
 	Purple::Account value
 
+MODULE = Purple::Request  PACKAGE = Purple::Request::Field  PREFIX = purple_request_field_
+PROTOTYPES: ENABLE
+
+Purple::Request::Field
+purple_request_field_bool_new(id, text, default_value = TRUE)
+	const char *id
+	const char *text
+	gboolean default_value
+
 gboolean
 purple_request_field_bool_get_default_value(field)
 	Purple::Request::Field field
@@ -257,12 +273,6 @@
 purple_request_field_bool_get_value(field)
 	Purple::Request::Field field
 
-Purple::Request::Field
-purple_request_field_bool_new(id, text, default_value = TRUE)
-	const char *id
-	const char *text
-	gboolean default_value
-
 void
 purple_request_field_bool_set_default_value(field, default_value)
 	Purple::Request::Field field
@@ -273,6 +283,15 @@
 	Purple::Request::Field field
 	gboolean value
 
+MODULE = Purple::Request  PACKAGE = Purple::Request::Field  PREFIX = purple_request_field_
+PROTOTYPES: ENABLE
+
+Purple::Request::Field
+purple_request_field_choice_new(id, text, default_value = 0)
+	const char *id
+	const char *text
+	int default_value
+
 void
 purple_request_field_choice_add(field, label)
 	Purple::Request::Field field
@@ -296,12 +315,6 @@
 purple_request_field_choice_get_value(field)
 	Purple::Request::Field field
 
-Purple::Request::Field
-purple_request_field_choice_new(id, text, default_value = 0)
-	const char *id
-	const char *text
-	int default_value
-
 void
 purple_request_field_choice_set_default_value(field, default_value)
 	Purple::Request::Field field
@@ -312,25 +325,14 @@
 	Purple::Request::Field field
 	int value
 
-void
-purple_request_field_destroy(field)
-	Purple::Request::Field field
-
-const char *
-purple_request_field_get_id(field)
-	Purple::Request::Field field
+MODULE = Purple::Request  PACKAGE = Purple::Request::Field  PREFIX = purple_request_field_
+PROTOTYPES: ENABLE
 
-const char *
-purple_request_field_get_label(field)
-	Purple::Request::Field field
-
-Purple::RequestFieldType
-purple_request_field_get_type(field)
-	Purple::Request::Field field
-
-const char *
-purple_request_field_get_type_hint(field)
-	Purple::Request::Field field
+Purple::Request::Field
+purple_request_field_int_new(id, text, default_value = 0)
+	const char *id
+	const char *text
+	int default_value
 
 int
 purple_request_field_int_get_default_value(field)
@@ -340,12 +342,6 @@
 purple_request_field_int_get_value(field)
 	Purple::Request::Field field
 
-Purple::Request::Field
-purple_request_field_int_new(id, text, default_value = 0)
-	const char *id
-	const char *text
-	int default_value
-
 void
 purple_request_field_int_set_default_value(field, default_value)
 	Purple::Request::Field field
@@ -360,15 +356,22 @@
 purple_request_field_is_required(field)
 	Purple::Request::Field field
 
-gboolean
-purple_request_field_is_visible(field)
-	Purple::Request::Field field
+MODULE = Purple::Request  PACKAGE = Purple::Request::Field  PREFIX = purple_request_field_
+PROTOTYPES: ENABLE
 
 Purple::Request::Field
 purple_request_field_label_new(id, text)
 	const char *id
 	const char *text
 
+MODULE = Purple::Request  PACKAGE = Purple::Request::Field  PREFIX = purple_request_field_
+PROTOTYPES: ENABLE
+
+Purple::Request::Field
+purple_request_field_list_new(id, text)
+	const char *id
+	const char *text
+
 void
 purple_request_field_list_add(field, item, data)
 	Purple::Request::Field field
@@ -418,16 +421,14 @@
 	Purple::Request::Field field
 	const char *item
 
-Purple::Request::Field
-purple_request_field_list_new(id, text)
-	const char *id
-	const char *text
-
 void
 purple_request_field_list_set_multi_select(field, multi_select)
 	Purple::Request::Field field
 	gboolean multi_select
 
+MODULE = Purple::Request  PACKAGE = Purple::Request::Field  PREFIX = purple_request_field_
+PROTOTYPES: ENABLE
+
 Purple::Request::Field
 purple_request_field_new(id, text, type)
 	const char *id
@@ -454,6 +455,16 @@
 	Purple::Request::Field field
 	gboolean visible
 
+MODULE = Purple::Request  PACKAGE = Purple::Request::Field  PREFIX = purple_request_field_
+PROTOTYPES: ENABLE
+
+Purple::Request::Field
+purple_request_field_string_new(id, text, default_value, multiline)
+	const char *id
+	const char *text
+	const char *default_value
+	gboolean multiline
+
 const char *
 purple_request_field_string_get_default_value(field)
 	Purple::Request::Field field
@@ -474,13 +485,6 @@
 purple_request_field_string_is_multiline(field)
 	Purple::Request::Field field
 
-Purple::Request::Field
-purple_request_field_string_new(id, text, default_value, multiline)
-	const char *id
-	const char *text
-	const char *default_value
-	gboolean multiline
-
 void
 purple_request_field_string_set_default_value(field, default_value)
 	Purple::Request::Field field
@@ -501,13 +505,6 @@
 	Purple::Request::Field field
 	const char *value
 
-Purple::Request::UiOps
-purple_request_get_ui_ops()
-
-void
-purple_request_set_ui_ops(ops)
-	Purple::Request::UiOps ops
-
 MODULE = Purple::Request  PACKAGE = Purple::Request::Field::Group  PREFIX = purple_request_field_group_
 PROTOTYPES: ENABLE
 
@@ -538,9 +535,39 @@
 purple_request_field_group_new(title)
 	const char *title
 
+MODULE = Purple::Request  PACKAGE = Purple::Request::Field  PREFIX = purple_request_field_
+PROTOTYPES: ENABLE
+
+void
+purple_request_field_destroy(field)
+	Purple::Request::Field field
+
+const char *
+purple_request_field_get_id(field)
+	Purple::Request::Field field
+
+const char *
+purple_request_field_get_label(field)
+	Purple::Request::Field field
+
+Purple::RequestFieldType
+purple_request_field_get_type(field)
+	Purple::Request::Field field
+
+const char *
+purple_request_field_get_type_hint(field)
+	Purple::Request::Field field
+
+gboolean
+purple_request_field_is_visible(field)
+	Purple::Request::Field field
+
 MODULE = Purple::Request  PACKAGE = Purple::Request::Fields  PREFIX = purple_request_fields_
 PROTOTYPES: ENABLE
 
+Purple::Request::Fields
+purple_request_fields_new()
+
 void
 purple_request_fields_add_group(fields, group)
 	Purple::Request::Fields fields
@@ -613,6 +640,3 @@
 purple_request_fields_is_field_required(fields, id)
 	Purple::Request::Fields fields
 	const char *id
-
-Purple::Request::Fields
-purple_request_fields_new()
--- a/libpurple/plugins/perl/common/Util.xs	Tue May 01 02:34:22 2007 +0000
+++ b/libpurple/plugins/perl/common/Util.xs	Tue May 01 03:21:27 2007 +0000
@@ -28,44 +28,11 @@
 MODULE = Purple::Util  PACKAGE = Purple::Util  PREFIX = purple_
 PROTOTYPES: ENABLE
 
-void
-purple_util_fetch_url(handle, url, full, user_agent, http11, cb)
-	Purple::Plugin handle
-	const char *url
-	gboolean full
-	const char *user_agent
-	gboolean http11
-	SV * cb
-CODE:
-	PurplePerlUrlData *gpr;
-	STRLEN len;
-	char *basename;
-
-	basename = g_path_get_basename(handle->path);
-	purple_perl_normalize_script_name(basename);
-	gpr = g_new(PurplePerlUrlData, 1);
-
-	gpr->cb = g_strdup_printf("Purple::Script::%s::%s", basename, SvPV(cb, len));
-	g_free(basename);
-	purple_util_fetch_url(url, full, user_agent, http11, purple_perl_util_url_cb, gpr);
-
 int
 purple_build_dir(path, mode)
 	const char *path
 	int mode
 
-const char *
-purple_date_format_full(tm)
-	const struct tm *tm
-
-const char *
-purple_date_format_long(tm)
-	const struct tm *tm
-
-const char *
-purple_date_format_short(tm)
-	const struct tm *tm
-
 gboolean
 purple_email_is_valid(address)
 	const char *address
@@ -82,53 +49,6 @@
 purple_home_dir()
 
 gboolean
-purple_markup_extract_info_field(str, len, user_info, start_token, skip, end_token, check_value, no_value_token, display_name, is_link, link_prefix, format_cb)
-	const char *str
-	int len
-	Purple::NotifyUserInfo user_info
-	const char *start_token
-	int skip
-	const char *end_token
-	char check_value
-	const char *no_value_token
-	const char *display_name
-	gboolean is_link
-	const char *link_prefix
-	Purple::Util::InfoFieldFormatCallback format_cb
-
-gboolean
-purple_markup_find_tag(needle, haystack, start, end, attributes)
-	const char *needle
-	const char *haystack
-	const char **start
-	const char **end
-	GData **attributes
-
-gchar_own *
-purple_markup_get_tag_name(tag)
-	const char *tag
-
-void
-purple_markup_html_to_xhtml(html, dest_xhtml, dest_plain)
-	const char *html
-	char **dest_xhtml
-	char **dest_plain
-
-gchar_own *
-purple_markup_linkify(str)
-	const char *str
-
-gchar_own *
-purple_markup_slice(str, x, y)
-	const char *str
-	guint x
-	guint y
-
-gchar_own *
-purple_markup_strip_html(str)
-	const char *str
-
-gboolean
 purple_message_meify(message, len)
 	char *message
 	size_t len
@@ -148,46 +68,6 @@
 	const char *program
 
 gchar_own *
-purple_str_add_cr(str)
-	const char *str
-
-gchar_own *
-purple_str_binary_to_ascii(binary, len)
-	const unsigned char *binary
-	guint len
-
-gboolean
-purple_str_has_prefix(s, p)
-	const char *s
-	const char *p
-
-gboolean
-purple_str_has_suffix(s, x)
-	const char *s
-	const char *x
-
-gchar_own *
-purple_str_seconds_to_string(sec)
-	guint sec
-
-gchar_own *
-purple_str_size_to_units(size)
-	size_t size
-
-void
-purple_str_strip_char(str, thechar)
-	char *str
-	char thechar
-
-time_t
-purple_str_to_time(timestamp, utc = FALSE, tm = NULL, tz_off = NULL, rest = NULL)
-	const char *timestamp
-	gboolean utc
-	struct tm *tm
-	long *tz_off
-	const char **rest
-
-gchar_own *
 purple_strcasereplace(string, delimiter, replacement)
 	const char *string
 	const char *delimiter
@@ -256,6 +136,138 @@
 const char *
 purple_utf8_strftime(const char *format, const struct tm *tm);
 
+MODULE = Purple::Util  PACKAGE = Purple::Util::Str  PREFIX = purple_str_
+PROTOTYPES: ENABLE
+
+gchar_own *
+purple_str_add_cr(str)
+	const char *str
+
+gchar_own *
+purple_str_binary_to_ascii(binary, len)
+	const unsigned char *binary
+	guint len
+
+gboolean
+purple_str_has_prefix(s, p)
+	const char *s
+	const char *p
+
+gboolean
+purple_str_has_suffix(s, x)
+	const char *s
+	const char *x
+
+gchar_own *
+purple_str_seconds_to_string(sec)
+	guint sec
+
+gchar_own *
+purple_str_size_to_units(size)
+	size_t size
+
+void
+purple_str_strip_char(str, thechar)
+	char *str
+	char thechar
+
+time_t
+purple_str_to_time(timestamp, utc = FALSE, tm = NULL, tz_off = NULL, rest = NULL)
+	const char *timestamp
+	gboolean utc
+	struct tm *tm
+	long *tz_off
+	const char **rest
+
+MODULE = Purple::Util  PACKAGE = Purple::Util::Date  PREFIX = purple_date_
+PROTOTYPES: ENABLE
+
+const char *
+purple_date_format_full(tm)
+	const struct tm *tm
+
+const char *
+purple_date_format_long(tm)
+	const struct tm *tm
+
+const char *
+purple_date_format_short(tm)
+	const struct tm *tm
+
+MODULE = Purple::Util  PACKAGE = Purple::Util::Markup  PREFIX = purple_markup_
+PROTOTYPES: ENABLE
+
+gboolean
+purple_markup_extract_info_field(str, len, user_info, start_token, skip, end_token, check_value, no_value_token, display_name, is_link, link_prefix, format_cb)
+	const char *str
+	int len
+	Purple::NotifyUserInfo user_info
+	const char *start_token
+	int skip
+	const char *end_token
+	char check_value
+	const char *no_value_token
+	const char *display_name
+	gboolean is_link
+	const char *link_prefix
+	Purple::Util::InfoFieldFormatCallback format_cb
+
+gboolean
+purple_markup_find_tag(needle, haystack, start, end, attributes)
+	const char *needle
+	const char *haystack
+	const char **start
+	const char **end
+	GData **attributes
+
+gchar_own *
+purple_markup_get_tag_name(tag)
+	const char *tag
+
+void
+purple_markup_html_to_xhtml(html, dest_xhtml, dest_plain)
+	const char *html
+	char **dest_xhtml
+	char **dest_plain
+
+gchar_own *
+purple_markup_linkify(str)
+	const char *str
+
+gchar_own *
+purple_markup_slice(str, x, y)
+	const char *str
+	guint x
+	guint y
+
+gchar_own *
+purple_markup_strip_html(str)
+	const char *str
+
+MODULE = Purple::Util  PACKAGE = Purple::Util  PREFIX = purple_util_
+PROTOTYPES: ENABLE
+
+void
+purple_util_fetch_url(handle, url, full, user_agent, http11, cb)
+	Purple::Plugin handle
+	const char *url
+	gboolean full
+	const char *user_agent
+	gboolean http11
+	SV * cb
+CODE:
+	PurplePerlUrlData *gpr;
+	STRLEN len;
+	char *basename;
+
+	basename = g_path_get_basename(handle->path);
+	purple_perl_normalize_script_name(basename);
+	gpr = g_new(PurplePerlUrlData, 1);
+
+	gpr->cb = g_strdup_printf("Purple::Script::%s::%s", basename, SvPV(cb, len));
+	g_free(basename);
+	purple_util_fetch_url(url, full, user_agent, http11, purple_perl_util_url_cb, gpr);
+
 void
 purple_util_set_user_dir(dir)
 	const char *dir
--- a/pidgin/plugins/perl/common/GtkFt.xs	Tue May 01 02:34:22 2007 +0000
+++ b/pidgin/plugins/perl/common/GtkFt.xs	Tue May 01 03:21:27 2007 +0000
@@ -1,6 +1,6 @@
 #include "gtkmodule.h"
 
-MODULE = Pidgin::Xfer  PACKAGE = Pidgin::Xfer  PREFIX = pidgin_xfer_
+MODULE = Pidgin::Xfer  PACKAGE = Pidgin::Xfer  PREFIX = pidgin_
 PROTOTYPES: ENABLE
 
 void