aboutsummaryrefslogtreecommitdiffstats
path: root/python/pyempathy/pyempathy.override
blob: 333ae53174ef5152f460f169327350c86260c469 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
%%
headers
#include <Python.h>
#include <pygobject.h>
#include "empathy-chatroom.h"
#include "empathy-chatroom-manager.h"
#include "empathy-contact.h"
#include "empathy-contact-factory.h"
#include "empathy-contact-groups.h"
#include "empathy-contact-list.h"
#include "empathy-contact-manager.h"
#include "empathy-debug.h"
#include "empathy-dispatcher.h"
#include "empathy-enum-types.h"
#include "empathy-idle.h"
#include "empathy-irc-network.h"
#include "empathy-irc-network-manager.h"
#include "empathy-irc-server.h"
#include "empathy-log-manager.h"
#include "empathy-message.h"
#include "empathy-status-presets.h"
#include "empathy-time.h"
#include "empathy-tp-call.h"
#include "empathy-tp-chat.h"
#include "empathy-tp-contact-factory.h"
#include "empathy-tp-contact-list.h"
#include "empathy-tp-group.h"
#include "empathy-tp-roomlist.h"
#include "empathy-tp-tube.h"
#include "empathy-tube-handler.h"
#include "empathy-utils.h"

void empathy_add_constants(PyObject *module, const gchar *strip_prefix);
void empathy_register_classes(PyObject *d);

%%
modulename empathy
%%
ignore-glob
    *_get_type
%%
import gobject.GObject as PyGObject_Type
%%
override empathy_contact_list_get_members kwargs
static PyObject *
_wrap_empathy_contact_list_get_members(PyGObject *self, PyObject *args, PyObject *kwargs)
{

    PyObject *py_contacts = PyList_New(0);
    GList *l, *contacts;

    contacts = empathy_contact_list_get_members(EMPATHY_CONTACT_LIST(self->obj));

    for (l = contacts; l; l = l->next) {
        EmpathyContact *contact;
        contact = l->data;
        PyList_Append(py_contacts, pygobject_new((GObject *) contact));
    }

    return py_contacts;

}
%%
override empathy_dispatcher_chat_with_contact_id kwargs
static PyObject *
_wrap_empathy_dispatcher_chat_with_contact_id(PyObject *self, PyObject *args, PyObject *kwargs)
{
    static char *kwlist[] = { "account_id", "contact_id", NULL };
    char *account_id, *contact_id;
    McAccount *account;

    if (!PyArg_ParseTupleAndKeywords(args, kwargs,"ss:dispatcher_chat_with_contact_id", kwlist, &account_id, &contact_id))
        return NULL;

    account = mc_account_lookup (account_id);
    if (account) {
        empathy_dispatcher_chat_with_contact_id(account, contact_id);
        g_object_unref (account);
    }
    
    Py_INCREF(Py_None);
    return Py_None;
}
%%