Added missing UI operation structures.
authorRagner Magalhaes <ragner.magalhaes@openbossa.org>
Tue, 2 Dec 2008 20:18:29 +0000 (20:18 +0000)
committerAnderson Briglia <anderson.briglia@openbossa.org>
Sat, 28 Feb 2009 21:11:10 +0000 (17:11 -0400)
FIXES:
 - Added missing UI operation structures.
 - Initial support for application initialization/deinitialization.

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@1292 596f6dd7-e928-0410-a184-9e12fd12cf7e

glib.pxd
libpurple/account.pxd
libpurple/blist.pxd
libpurple/connection.pxd
libpurple/conversation.pxd
libpurple/ft.pxd [new file with mode: 0644]
libpurple/notify.pxd [new file with mode: 0644]
libpurple/request.pxd [new file with mode: 0644]
libpurple/roomlist.pxd [new file with mode: 0644]
purple.pyx

index 97664ce..e651a95 100644 (file)
--- a/glib.pxd
+++ b/glib.pxd
@@ -52,6 +52,7 @@ cdef extern from "glib.h":
 
     GHashTable *g_hash_table_new (GHashFunc, GEqualFunc)
     void g_hash_table_insert (GHashTable*, gpointer, gpointer)
 
     GHashTable *g_hash_table_new (GHashFunc, GEqualFunc)
     void g_hash_table_insert (GHashTable*, gpointer, gpointer)
+    void g_hash_table_destroy (GHashTable*)
 
     guint g_timeout_add(guint interval, GSourceFunc function, gpointer data)
     guint g_timeout_add_seconds(guint interval, GSourceFunc function, gpointer data)
 
     guint g_timeout_add(guint interval, GSourceFunc function, gpointer data)
     guint g_timeout_add_seconds(guint interval, GSourceFunc function, gpointer data)
index 059ee6f..841f0c6 100644 (file)
@@ -21,9 +21,13 @@ cdef extern from "libpurple/account.h":
     ctypedef struct PurpleAccount:
         pass
 
     ctypedef struct PurpleAccount:
         pass
 
+    ctypedef struct PurpleAccountUiOps:
+        pass
+
     PurpleAccount *c_purple_account_new "purple_account_new" (const_char_ptr username, const_char_ptr protocol_id)
     void c_purple_account_set_password "purple_account_set_password" (PurpleAccount *account, const_char_ptr password)
     const_char_ptr c_purple_account_get_password "purple_account_get_password" (PurpleAccount *account)
     void c_purple_account_set_enabled "purple_account_set_enabled" (PurpleAccount *account, const_char_ptr ui, gboolean value)
     const_char_ptr c_purple_account_get_username "purple_account_get_username" (PurpleAccount *account)
     GList *c_purple_accounts_get_all_active "purple_accounts_get_all_active" ()
     PurpleAccount *c_purple_account_new "purple_account_new" (const_char_ptr username, const_char_ptr protocol_id)
     void c_purple_account_set_password "purple_account_set_password" (PurpleAccount *account, const_char_ptr password)
     const_char_ptr c_purple_account_get_password "purple_account_get_password" (PurpleAccount *account)
     void c_purple_account_set_enabled "purple_account_set_enabled" (PurpleAccount *account, const_char_ptr ui, gboolean value)
     const_char_ptr c_purple_account_get_username "purple_account_get_username" (PurpleAccount *account)
     GList *c_purple_accounts_get_all_active "purple_accounts_get_all_active" ()
+    void c_purple_accounts_set_ui_ops "purple_accounts_set_ui_ops" (PurpleAccountUiOps *ops)
index 8b523d1..d21f3de 100644 (file)
@@ -21,6 +21,9 @@ cdef extern from "libpurple/blist.h":
     ctypedef struct PurpleBlistNode:
         pass
 
     ctypedef struct PurpleBlistNode:
         pass
 
+    ctypedef struct PurpleBlistUiOps:
+        pass
+
     ctypedef struct PurpleBuddy:
         pass
 
     ctypedef struct PurpleBuddy:
         pass
 
@@ -30,6 +33,7 @@ cdef extern from "libpurple/blist.h":
     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_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_set_ui_ops "purple_blist_set_ui_ops" (PurpleBlistUiOps *ops)
 
     PurpleBuddy *c_purple_buddy_new "purple_buddy_new" (PurpleAccount *account,
             const_char_ptr screenname, const_char_ptr alias)
 
     PurpleBuddy *c_purple_buddy_new "purple_buddy_new" (PurpleAccount *account,
             const_char_ptr screenname, const_char_ptr alias)
index d0632b3..d0a3633 100644 (file)
@@ -20,3 +20,8 @@
 cdef extern from "libpurple/connection.h":
     ctypedef struct PurpleConnection:
         pass
 cdef extern from "libpurple/connection.h":
     ctypedef struct PurpleConnection:
         pass
+
+    ctypedef struct PurpleConnectionUiOps:
+        pass
+
+    void c_purple_connections_set_ui_ops "purple_connections_set_ui_ops" (PurpleConnectionUiOps *ops)
index 32320ee..e4710b7 100644 (file)
@@ -62,6 +62,7 @@ cdef extern from "libpurple/conversation.h":
     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)
     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)
+    void c_purple_conversations_set_ui_ops "purple_conversations_set_ui_ops" (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)
     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)
diff --git a/libpurple/ft.pxd b/libpurple/ft.pxd
new file mode 100644 (file)
index 0000000..f7994e6
--- /dev/null
@@ -0,0 +1,24 @@
+#
+#  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/ft.h":
+    ctypedef struct PurpleXferUiOps:
+        pass
+
+    void c_purple_xfers_set_ui_ops "purple_xfers_set_ui_ops" (PurpleXferUiOps *ops)
diff --git a/libpurple/notify.pxd b/libpurple/notify.pxd
new file mode 100644 (file)
index 0000000..c45c60a
--- /dev/null
@@ -0,0 +1,24 @@
+#
+#  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/notify.h":
+    ctypedef struct PurpleNotifyUiOps:
+        pass
+
+    void c_purple_notify_set_ui_ops "purple_notify_set_ui_ops" (PurpleNotifyUiOps *ops)
diff --git a/libpurple/request.pxd b/libpurple/request.pxd
new file mode 100644 (file)
index 0000000..f575125
--- /dev/null
@@ -0,0 +1,24 @@
+#
+#  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/request.h":
+    ctypedef struct PurpleRequestUiOps:
+        pass
+
+    void c_purple_request_set_ui_ops "purple_request_set_ui_ops" (PurpleRequestUiOps *ops)
diff --git a/libpurple/roomlist.pxd b/libpurple/roomlist.pxd
new file mode 100644 (file)
index 0000000..271dbc8
--- /dev/null
@@ -0,0 +1,24 @@
+#
+#  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/roomlist.h":
+    ctypedef struct PurpleRoomlistUiOps:
+        pass
+
+    void c_purple_roomlist_set_ui_ops "purple_roomlist_set_ui_ops" (PurpleRoomlistUiOps *ops)
index 35f5a09..9d87b67 100644 (file)
@@ -34,11 +34,15 @@ include "libpurple/conversation.pxd"
 include "libpurple/core.pxd"
 include "libpurple/debug.pxd"
 include "libpurple/eventloop.pxd"
 include "libpurple/core.pxd"
 include "libpurple/debug.pxd"
 include "libpurple/eventloop.pxd"
+include "libpurple/ft.pxd"
 include "libpurple/idle.pxd"
 include "libpurple/idle.pxd"
+include "libpurple/notify.pxd"
 include "libpurple/plugin.pxd"
 include "libpurple/pounce.pxd"
 include "libpurple/prefs.pxd"
 include "libpurple/proxy.pxd"
 include "libpurple/plugin.pxd"
 include "libpurple/pounce.pxd"
 include "libpurple/prefs.pxd"
 include "libpurple/proxy.pxd"
+include "libpurple/request.pxd"
+include "libpurple/roomlist.pxd"
 include "libpurple/signals.pxd"
 include "libpurple/status.pxd"
 include "libpurple/savedstatuses.pxd"
 include "libpurple/signals.pxd"
 include "libpurple/status.pxd"
 include "libpurple/savedstatuses.pxd"
@@ -90,7 +94,6 @@ cdef class Purple:
         c_purple_prefs_load()
 
         c_purple_prefs_add_none("/carman")
         c_purple_prefs_load()
 
         c_purple_prefs_add_none("/carman")
-        c_purple_prefs_add_none("/carman/plugins")
     # __core_ui_ops_ui_prefs_init
 
     cdef void __core_ui_ops_debug_init(self):
     # __core_ui_ops_ui_prefs_init
 
     cdef void __core_ui_ops_debug_init(self):
@@ -99,10 +102,23 @@ cdef class Purple:
 
     cdef void __core_ui_ops_ui_init(self):
         c_purple_debug(PURPLE_DEBUG_INFO, "core_ui_ops", "ui_init\n")
 
     cdef void __core_ui_ops_ui_init(self):
         c_purple_debug(PURPLE_DEBUG_INFO, "core_ui_ops", "ui_init\n")
+
+        # FIXME: Add core ui initialization here
     # __core_ui_ops_ui_init
 
     cdef void __core_ui_ops_quit(self):
         c_purple_debug(PURPLE_DEBUG_INFO, "core_ui_ops", "quit\n")
     # __core_ui_ops_ui_init
 
     cdef void __core_ui_ops_quit(self):
         c_purple_debug(PURPLE_DEBUG_INFO, "core_ui_ops", "quit\n")
+        c_purple_accounts_set_ui_ops(NULL)
+        c_purple_connections_set_ui_ops(NULL)
+        c_purple_blist_set_ui_ops(NULL)
+        c_purple_conversations_set_ui_ops(NULL)
+        c_purple_notify_set_ui_ops(NULL)
+        c_purple_request_set_ui_ops(NULL)
+        c_purple_xfers_set_ui_ops(NULL)
+        c_purple_roomlist_set_ui_ops(NULL)
+
+        if self.c_ui_info:
+            g_hash_table_destroy(self.c_ui_info)
     # __core_ui_ops_quit
 
     cdef GHashTable *__core_ui_ops_get_ui_info(self):
     # __core_ui_ops_quit
 
     cdef GHashTable *__core_ui_ops_get_ui_info(self):