]> git.0d.be Git - empathy.git/blob - python/pyempathy/pyempathy.override
Add python binding. Fixes bug #457660 (Michael Sheldon).
[empathy.git] / python / pyempathy / pyempathy.override
1 %%
2 headers
3 #include <Python.h>
4 #include <pygobject.h>
5 #include "empathy-avatar.h"
6 #include "empathy-chandler.h"
7 #include "empathy-chatroom-manager.h"
8 #include "empathy-chatroom.h"
9 #include "empathy-conf.h"
10 #include "empathy-contact-list.h"
11 #include "empathy-contact-manager.h"
12 #include "empathy-contact.h"
13 #include "empathy-debug.h"
14 #include "empathy-filter.h"
15 #include "empathy-idle.h"
16 #include "empathy-log-manager.h"
17 #include "empathy-marshal.h"
18 #include "empathy-message.h"
19 #include "empathy-presence.h"
20 #include "empathy-time.h"
21 #include "empathy-tp-chat.h"
22 #include "empathy-tp-chatroom.h"
23 #include "empathy-tp-contact-list.h"
24 #include "empathy-tp-group.h"
25 #include "empathy-utils.h"
26
27
28 /* FIXME */
29 #define MC_TYPE_PRESENCE 1
30 #define EMPATHY_TYPE_SUBSCRIPTION 2
31 #define EMPATHY_TYPE_MESSAGE_TYPE 3
32 #define EMPATHY_TYPE_REG_EX_TYPE 4
33
34
35 void empathy_add_constants(PyObject *module, const gchar *strip_prefix);
36 void empathy_register_classes(PyObject *d);
37
38 %%
39 modulename empathy
40 %%
41 ignore-glob
42         *_get_type
43 %%
44 import gobject.GObject as PyGObject_Type
45 %%
46 override empathy_contact_list_get_members kwargs
47 static PyObject *
48 _wrap_empathy_contact_list_get_members(PyGObject *self, PyObject *args, PyObject *kwargs)
49 {
50
51         PyObject *py_contacts = PyList_New(0);
52         GList *l, *contacts;
53
54         contacts = empathy_contact_list_get_members(EMPATHY_CONTACT_LIST(self->obj));
55
56         for (l = contacts; l; l = l->next) {
57                 EmpathyContact *contact;
58                 contact = l->data;
59                 PyList_Append(py_contacts, pygobject_new((GObject *) contact));
60         }
61
62         return py_contacts;
63
64 }
65 %%
66 override empathy_contact_get_groups kwargs
67 static PyObject *
68 _wrap_empathy_contact_get_groups(PyGObject *self, PyObject *args, PyObject *kwargs)
69 {
70
71         GList *groups = empathy_contact_get_groups(EMPATHY_CONTACT(self->obj));
72         PyObject *py_groups = PyList_New(0);
73         GList *l;
74
75         for(l = groups; l; l = l->next) {
76                 const gchar *group;
77                 group = l->data;
78                 PyList_Append(py_groups, PyString_FromString(group));
79         }
80
81         return py_groups;
82
83 }
84 %%