changeset 23147:66057702ae5d

Expose smiley API to perl plugins.
author Sadrul Habib Chowdhury <imadil@gmail.com>
date Tue, 13 May 2008 02:24:17 +0000
parents f1df88964b3d
children 59cfa6210910 28a60a010efc
files libpurple/plugins/perl/Makefile.am libpurple/plugins/perl/common/MANIFEST libpurple/plugins/perl/common/Makefile.mingw libpurple/plugins/perl/common/Purple.xs libpurple/plugins/perl/common/Smiley.xs libpurple/plugins/perl/common/module.h libpurple/plugins/perl/common/typemap
diffstat 7 files changed, 92 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/libpurple/plugins/perl/Makefile.am	Tue May 13 00:29:22 2008 +0000
+++ b/libpurple/plugins/perl/Makefile.am	Tue May 13 02:24:17 2008 +0000
@@ -67,6 +67,7 @@
 	common/SavedStatuses.xs \
 	common/Server.xs \
 	common/Signal.xs \
+	common/Smiley.xs \
 	common/Sound.xs \
 	common/Status.xs \
 	common/Stringref.xs \
--- a/libpurple/plugins/perl/common/MANIFEST	Tue May 13 00:29:22 2008 +0000
+++ b/libpurple/plugins/perl/common/MANIFEST	Tue May 13 02:24:17 2008 +0000
@@ -28,6 +28,7 @@
 SavedStatuses.xs
 Server.xs
 Signal.xs
+Smiley.xs
 Sound.xs
 Status.xs
 Stringref.xs
--- a/libpurple/plugins/perl/common/Makefile.mingw	Tue May 13 00:29:22 2008 +0000
+++ b/libpurple/plugins/perl/common/Makefile.mingw	Tue May 13 02:24:17 2008 +0000
@@ -61,8 +61,9 @@
 				Roomlist.xs \
 				SSLConn.xs \
 				SavedStatuses.xs \
+				Server.xs \
 				Signal.xs \
-				Server.xs \
+				Smiley.xs \
 				Sound.xs \
 				Status.xs \
 				Stringref.xs \
--- a/libpurple/plugins/perl/common/Purple.xs	Tue May 13 00:29:22 2008 +0000
+++ b/libpurple/plugins/perl/common/Purple.xs	Tue May 13 02:24:17 2008 +0000
@@ -30,6 +30,7 @@
 PURPLE_PERL_BOOT_PROTO(SavedStatus);
 PURPLE_PERL_BOOT_PROTO(Serv);
 PURPLE_PERL_BOOT_PROTO(Signal);
+PURPLE_PERL_BOOT_PROTO(Smiley);
 PURPLE_PERL_BOOT_PROTO(Sound);
 PURPLE_PERL_BOOT_PROTO(Status);
 PURPLE_PERL_BOOT_PROTO(Stringref);
@@ -68,6 +69,7 @@
 	PURPLE_PERL_BOOT(SavedStatus);
 	PURPLE_PERL_BOOT(Serv);
 	PURPLE_PERL_BOOT(Signal);
+	PURPLE_PERL_BOOT(Smiley);
 	PURPLE_PERL_BOOT(Sound);
 	PURPLE_PERL_BOOT(Status);
 	PURPLE_PERL_BOOT(Stringref);
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/libpurple/plugins/perl/common/Smiley.xs	Tue May 13 02:24:17 2008 +0000
@@ -0,0 +1,81 @@
+#include "module.h"
+
+MODULE = Purple::Smiley  PACKAGE = Purple::Smiley  PREFIX = purple_smiley_
+PROTOTYPES: ENABLE
+
+Purple::Smiley
+purple_smiley_new(img, shortcut)
+	Purple::StoredImage img
+	const char * shortcut
+
+Purple::Smiley
+purple_smiley_new_from_file(shortcut, filepath)
+	const char * shortcut
+	const char * filepath
+
+void
+purple_smiley_delete(smiley)
+	Purple::Smiley smiley
+
+gboolean
+purple_smiley_set_shortcut(smiley, shortcut)
+	Purple::Smiley smiley
+	const char * shortcut
+
+void
+purple_smiley_set_data(smiley, data, data_len, keepfilename)
+	Purple::Smiley  smiley
+	guchar * data
+	size_t  data_len
+	gboolean keepfilename
+
+const char *
+purple_smiley_get_shortcut(smiley)
+	Purple::Smiley smiley
+
+const char *
+purple_smiley_get_checksum(smiley)
+	Purple::Smiley smiley
+
+Purple::StoredImage
+purple_smiley_get_stored_image(smiley)
+	Purple::Smiley smiley
+
+gconstpointer
+purple_smiley_get_data(smiley, len)
+	Purple::Smiley smiley
+	size_t * len
+
+const char *
+purple_smiley_get_extension(smiley)
+	Purple::Smiley smiley
+
+
+gchar_own *
+purple_smiley_get_full_path(smiley)
+	Purple::Smiley smiley
+
+
+MODULE = Purple::Smiley  PACKAGE = Purple::Smileys  PREFIX = purple_smileys_
+PROTOTYPES: ENABLE
+
+void
+purple_smileys_get_all()
+PREINIT:
+    GList *l;
+PPCODE:
+    for (l = purple_smileys_get_all(); l != NULL; l = g_list_delete_link(l, l)) {
+        XPUSHs(sv_2mortal(purple_perl_bless_object(l->data, "Purple::Smiley")));
+    }
+
+Purple::Smiley
+purple_smileys_find_by_shortcut(shortcut)
+	const char * shortcut
+
+Purple::Smiley
+purple_smileys_find_by_checksum(checksum)
+	const char * checksum
+
+const char *
+purple_smileys_get_storing_dir()
+
--- a/libpurple/plugins/perl/common/module.h	Tue May 13 00:29:22 2008 +0000
+++ b/libpurple/plugins/perl/common/module.h	Tue May 13 02:24:17 2008 +0000
@@ -51,6 +51,7 @@
 #include "savedstatuses.h"
 #include "server.h"
 #include "signals.h"
+#include "smiley.h"
 #include "sound.h"
 #include "sslconn.h"
 #include "status.h"
@@ -240,6 +241,9 @@
 typedef PurpleSavedStatus *		Purple__SavedStatus;
 typedef PurpleSavedStatusSub *		Purple__SavedStatus__Sub;
 
+/* smiley.h */
+typedef PurpleSmiley *		Purple__Smiley;
+
 /* sound.h */
 typedef PurpleSoundEventID		Purple__SoundEventID;
 typedef PurpleSoundUiOps *		Purple__Sound__UiOps;
--- a/libpurple/plugins/perl/common/typemap	Tue May 13 00:29:22 2008 +0000
+++ b/libpurple/plugins/perl/common/typemap	Tue May 13 02:24:17 2008 +0000
@@ -151,6 +151,7 @@
 
 Purple::Presence				T_PurpleObj
 Purple::PresenceContext			T_IV
+Purple::Smiley				T_PurpleObj
 Purple::Status				T_PurpleObj
 Purple::StatusAttr			T_PurpleObj
 Purple::StatusPrimitive			T_IV