]> git.0d.be Git - empathy.git/blob - python/pyempathy/pyempathy.override
a31253ece6962eb81c2971d37a5f9964426e4777
[empathy.git] / python / pyempathy / pyempathy.override
1 %%
2 headers
3 #include <Python.h>
4 #include <pygobject.h>
5 #include "empathy-account-manager.h"
6 #include "empathy-call-factory.h"
7 #include "empathy-chatroom.h"
8 #include "empathy-chatroom-manager.h"
9 #include "empathy-contact.h"
10 #include "empathy-contact-factory.h"
11 #include "empathy-contact-groups.h"
12 #include "empathy-contact-list.h"
13 #include "empathy-contact-manager.h"
14 #include "empathy-contact-monitor.h"
15 #include "empathy-debug.h"
16 #include "empathy-dispatcher.h"
17 #include "empathy-enum-types.h"
18 #include "empathy-idle.h"
19 #include "empathy-irc-network.h"
20 #include "empathy-irc-network-manager.h"
21 #include "empathy-irc-server.h"
22 #include "empathy-log-manager.h"
23 #include "empathy-message.h"
24 #include "empathy-status-presets.h"
25 #include "empathy-time.h"
26 #include "empathy-tp-call.h"
27 #include "empathy-tp-chat.h"
28 #include "empathy-tp-contact-factory.h"
29 #include "empathy-tp-contact-list.h"
30 #include "empathy-tp-file.h"
31 #include "empathy-tp-group.h"
32 #include "empathy-tp-roomlist.h"
33 #include "empathy-tp-tube.h"
34 #include "empathy-tube-handler.h"
35 #include "empathy-utils.h"
36
37 void empathy_add_constants(PyObject *module, const gchar *strip_prefix);
38 void empathy_register_classes(PyObject *d);
39
40 %%
41 modulename empathy
42 %%
43 ignore-glob
44         *_get_type
45 %%
46 import gobject.GObject as PyGObject_Type
47 %%
48 override empathy_contact_list_get_members kwargs
49 static PyObject *
50 _wrap_empathy_contact_list_get_members(PyGObject *self, PyObject *args, PyObject *kwargs)
51 {
52
53         PyObject *py_contacts = PyList_New(0);
54         GList *l, *contacts;
55
56         contacts = empathy_contact_list_get_members(EMPATHY_CONTACT_LIST(self->obj));
57
58         for (l = contacts; l; l = l->next) {
59                 EmpathyContact *contact;
60                 contact = l->data;
61                 PyList_Append(py_contacts, pygobject_new((GObject *) contact));
62         }
63
64         return py_contacts;
65
66 }
67 %%
68 override empathy_dispatcher_chat_with_contact_id kwargs
69 static PyObject *
70 _wrap_empathy_dispatcher_chat_with_contact_id(PyObject *self, PyObject *args, PyObject *kwargs)
71 {
72     static char *kwlist[] = { "account_id", "contact_id", NULL };
73     char *account_id, *contact_id;
74     McAccount *account;
75
76     if (!PyArg_ParseTupleAndKeywords(args, kwargs,"ss:dispatcher_chat_with_contact_id", kwlist, &account_id, &contact_id))
77         return NULL;
78
79     account = mc_account_lookup (account_id);
80     if (account) {
81         empathy_dispatcher_chat_with_contact_id(account, contact_id,
82           NULL, NULL);
83         g_object_unref (account);
84     }
85     
86     Py_INCREF(Py_None);
87     return Py_None;
88 }
89 %%