Added majority of libpurple functions used by pidgin-carman.
authorRagner Magalhaes <ragner.magalhaes@openbossa.org>
Tue, 2 Dec 2008 20:17:33 +0000 (20:17 +0000)
committerAnderson Briglia <anderson.briglia@openbossa.org>
Sat, 28 Feb 2009 21:11:09 +0000 (17:11 -0400)
FIXES:
 - Added majority of libpurple functions used by pidgin-carman.
 - Fixed alias for conversation functions.
 - Added libpurple/signals.pxd.

Signed-off-by: Bruno Abinader <bruno.abinader@indt.org.br>

git-svn-id: https://garage.maemo.org/svn/carman/branches/carman-0.7-beta2/python-purple@1290 596f6dd7-e928-0410-a184-9e12fd12cf7e

conversation.pxd
libpurple/blist.pxd
libpurple/connection.pxd
libpurple/conversation.pxd
libpurple/proxy.pxd
libpurple/signals.pxd [new file with mode: 0644]
libpurple/util.pxd
purple.pyx

index ecb00bc..ee3b26c 100644 (file)
@@ -22,10 +22,10 @@ cdef class Conversation:
     cdef PurpleConversation *__conv
 
     def __cinit__(self):
     cdef PurpleConversation *__conv
 
     def __cinit__(self):
-        purple_conversations_init()
+        c_purple_conversations_init()
 
     def conversation_new(self, type, acc, const_char_ptr name):
 
     def conversation_new(self, type, acc, const_char_ptr name):
-        self.__conv = purple_conversation_new(type, <PurpleAccount*>acc.__account, name)
+        self.__conv = c_purple_conversation_new(type, <PurpleAccount*>acc.__account, name)
 
     def conversation_set_ui_ops(self):
         cdef PurpleConversationUiOps c_conv_ui_ops
 
     def conversation_set_ui_ops(self):
         cdef PurpleConversationUiOps c_conv_ui_ops
@@ -45,16 +45,16 @@ cdef class Conversation:
         c_conv_ui_ops.custom_smiley_close = NULL
         c_conv_ui_ops.send_confirm = NULL
 
         c_conv_ui_ops.custom_smiley_close = NULL
         c_conv_ui_ops.send_confirm = NULL
 
-        purple_conversation_set_ui_ops(self.__conv, &c_conv_ui_ops)
+        c_purple_conversation_set_ui_ops(self.__conv, &c_conv_ui_ops)
 
     def conversation_write(self, const_char_ptr message):
 
     def conversation_write(self, const_char_ptr message):
-        purple_conv_im_send(purple_conversation_get_im_data(self.__conv), message)
+        c_purple_conv_im_send(c_purple_conversation_get_im_data(self.__conv), message)
 
     def conversation_destroy(self):
 
     def conversation_destroy(self):
-        purple_conversation_destroy(self.__conv)
+        c_purple_conversation_destroy(self.__conv)
 
     def conversation_get_handle(self):
 
     def conversation_get_handle(self):
-        purple_conversations_get_handle()
+        c_purple_conversations_get_handle()
 
     def send_message(self, buddy, const_char_ptr message):
         self.conversation_new(1, buddy.account, buddy.name)
 
     def send_message(self, buddy, const_char_ptr message):
         self.conversation_new(1, buddy.account, buddy.name)
index 36077f2..8b523d1 100644 (file)
@@ -27,6 +27,7 @@ cdef extern from "libpurple/blist.h":
     ctypedef struct PurpleBuddyList:
         pass
 
     ctypedef struct PurpleBuddyList:
         pass
 
+    void *c_purple_blist_get_handle "purple_blist_get_handle" ()
     void c_purple_blist_load "purple_blist_load" ()
     PurpleBuddyList* c_purple_blist_new "purple_blist_new" ()
 
     void c_purple_blist_load "purple_blist_load" ()
     PurpleBuddyList* c_purple_blist_new "purple_blist_new" ()
 
index 5e2c99a..d0632b3 100644 (file)
@@ -20,5 +20,3 @@
 cdef extern from "libpurple/connection.h":
     ctypedef struct PurpleConnection:
         pass
 cdef extern from "libpurple/connection.h":
     ctypedef struct PurpleConnection:
         pass
-
-    void connect_to_signals_for_demonstration_purposes_only()
index 8df130f..32320ee 100644 (file)
@@ -58,11 +58,10 @@ cdef extern from "libpurple/conversation.h":
         void (*custom_smiley_close) (PurpleConversation *conv, const_char_ptr smile)
         void (*send_confirm) (PurpleConversation *conv, const_char_ptr message)
 
         void (*custom_smiley_close) (PurpleConversation *conv, const_char_ptr smile)
         void (*send_confirm) (PurpleConversation *conv, const_char_ptr message)
 
-    void purple_conversations_init()
-    PurpleConversation *purple_conversation_new(int type, PurpleAccount *account, const_char_ptr name)
-    void purple_conversation_set_ui_ops(PurpleConversation *conv, PurpleConversationUiOps *ops)
-    PurpleConvIm *purple_conversation_get_im_data(PurpleConversation *conv)
-    void purple_conv_im_send(PurpleConvIm *im, const_char_ptr message)
-    void *purple_conversations_get_handle()
-    void purple_conversation_destroy(PurpleConversation *conv)
-
+    void c_purple_conversations_init "purple_conversations_init" ()
+    void *c_purple_conversations_get_handle "purple_conversations_get_handle" ()
+    PurpleConversation *c_purple_conversation_new "purple_conversation_new" (int type, PurpleAccount *account, const_char_ptr name)
+    void c_purple_conversation_set_ui_ops "purple_conversation_set_ui_ops" (PurpleConversation *conv, PurpleConversationUiOps *ops)
+    PurpleConvIm *c_purple_conversation_get_im_data "purple_conversation_get_im_data" (PurpleConversation *conv)
+    void c_purple_conv_im_send "purple_conv_im_send" (PurpleConvIm *im, const_char_ptr message)
+    void c_purple_conversation_destroy "purple_conversation_destroy" (PurpleConversation *conv)
index faefbae..59e7e4b 100644 (file)
@@ -21,7 +21,8 @@ cdef extern from "libpurple/proxy.h":
     cdef struct PurpleProxyInfo
 
     ctypedef int PurpleProxyType
     cdef struct PurpleProxyInfo
 
     ctypedef int PurpleProxyType
-    PurpleProxyInfo *purple_proxy_info_new()
+
+    PurpleProxyInfo *c_purple_proxy_info_new "purple_proxy_info_new" ()
     void c_purple_proxy_info_set_type "purple_proxy_info_set_type" (PurpleProxyInfo *info, PurpleProxyType type)
     void c_purple_proxy_info_set_host "purple_proxy_info_set_host" (const_char_ptr host)
     void c_purple_proxy_info_set_port "purple_proxy_info_set_port" (const_char_ptr port)
     void c_purple_proxy_info_set_type "purple_proxy_info_set_type" (PurpleProxyInfo *info, PurpleProxyType type)
     void c_purple_proxy_info_set_host "purple_proxy_info_set_host" (const_char_ptr host)
     void c_purple_proxy_info_set_port "purple_proxy_info_set_port" (const_char_ptr port)
diff --git a/libpurple/signals.pxd b/libpurple/signals.pxd
new file mode 100644 (file)
index 0000000..569f654
--- /dev/null
@@ -0,0 +1,27 @@
+#
+#  Copyright (c) 2008 INdT - Instituto Nokia de Tecnologia
+#
+#  This file is part of python-purple.
+#
+#  python-purple is free software: you can redistribute it and/or modify
+#  it under the terms of the GNU General Public License as published by
+#  the Free Software Foundation, either version 3 of the License, or
+#  (at your option) any later version.
+#
+#  python-purple is distributed in the hope that it will be useful,
+#  but WITHOUT ANY WARRANTY; without even the implied warranty of
+#  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+#  GNU General Public License for more details.
+#
+#  You should have received a copy of the GNU General Public License
+#  along with this program.  If not, see <http://www.gnu.org/licenses/>.
+#
+
+cdef extern from "libpurple/signals.h":
+    ctypedef void (*PurpleCallback) ()
+
+    gulong c_purple_signal_connect "purple_signal_connect" (void *instance,
+            const_char_ptr signal, void *handle, PurpleCallback func,
+            void *data)
+    void c_purple_signal_disconnect "purple_signal_disconnect" (void *instance,
+            const_char_ptr signal, void *handle, PurpleCallback func)
index 612876e..7132a4d 100644 (file)
@@ -18,4 +18,5 @@
 #
 
 cdef extern from "libpurple/util.h":
 #
 
 cdef extern from "libpurple/util.h":
+    void *c_purple_markup_strip_html "purple_markup_strip_html" (const_char_ptr str)
     void c_purple_util_set_user_dir "purple_util_set_user_dir" (char *dir)
     void c_purple_util_set_user_dir "purple_util_set_user_dir" (char *dir)
index d402e2b..35f5a09 100644 (file)
@@ -39,13 +39,14 @@ include "libpurple/plugin.pxd"
 include "libpurple/pounce.pxd"
 include "libpurple/prefs.pxd"
 include "libpurple/proxy.pxd"
 include "libpurple/pounce.pxd"
 include "libpurple/prefs.pxd"
 include "libpurple/proxy.pxd"
+include "libpurple/signals.pxd"
 include "libpurple/status.pxd"
 include "libpurple/savedstatuses.pxd"
 include "libpurple/util.pxd"
 
 cdef extern from "c_purple.h":
 include "libpurple/status.pxd"
 include "libpurple/savedstatuses.pxd"
 include "libpurple/util.pxd"
 
 cdef extern from "c_purple.h":
-     guint glib_input_add(gint fd, PurpleInputCondition condition, PurpleInputFunction function, gpointer data)
-     void glib_main_loop()
+    void connect_to_signals_for_demonstration_purposes_only ()
+    guint glib_input_add(gint fd, PurpleInputCondition condition, PurpleInputFunction function, gpointer data)
 
 import ecore
 
 
 import ecore