~ubuntu-branches/ubuntu/natty/empathy/natty-updates

« back to all changes in this revision

Viewing changes to python/pyempathy/pyempathy.c

  • Committer: Bazaar Package Importer
  • Author(s): Sjoerd Simons
  • Date: 2008-03-10 16:39:07 UTC
  • mfrom: (1.1.13 upstream)
  • Revision ID: james.westby@ubuntu.com-20080310163907-tv41g2zmf0qqgi85
Tags: 0.22.0-1
New upstream release

Show diffs side-by-side

added added

removed removed

Lines of Context:
9
9
#include <pygobject.h>
10
10
#include "empathy-avatar.h"
11
11
#include "empathy-chandler.h"
 
12
#include "empathy-chatroom.h"
12
13
#include "empathy-chatroom-manager.h"
13
 
#include "empathy-chatroom.h"
 
14
#include "empathy-contact.h"
 
15
#include "empathy-contact-factory.h"
14
16
#include "empathy-contact-groups.h"
15
17
#include "empathy-contact-list.h"
16
18
#include "empathy-contact-manager.h"
17
 
#include "empathy-contact.h"
18
19
#include "empathy-debug.h"
 
20
#include "empathy-enum-types.h"
19
21
#include "empathy-filter.h"
20
22
#include "empathy-idle.h"
 
23
#include "empathy-irc-network.h"
 
24
#include "empathy-irc-network-manager.h"
 
25
#include "empathy-irc-server.h"
21
26
#include "empathy-log-manager.h"
22
27
#include "empathy-message.h"
23
28
#include "empathy-status-presets.h"
24
29
#include "empathy-time.h"
 
30
#include "empathy-tp-call.h"
25
31
#include "empathy-tp-chat.h"
26
32
#include "empathy-tp-chatroom.h"
27
33
#include "empathy-tp-contact-factory.h"
29
35
#include "empathy-tp-group.h"
30
36
#include "empathy-tp-roomlist.h"
31
37
#include "empathy-utils.h"
32
 
#include "empathy-contact-factory.h"
33
 
#include "empathy-enum-types.h"
34
38
 
35
39
void empathy_add_constants(PyObject *module, const gchar *strip_prefix);
36
40
void empathy_register_classes(PyObject *d);
37
41
 
38
 
#line 39 "pyempathy.c"
 
42
#line 43 "pyempathy.c"
39
43
 
40
44
 
41
45
/* ---------- types from other modules ---------- */
52
56
PyTypeObject G_GNUC_INTERNAL PyEmpathyContactManager_Type;
53
57
PyTypeObject G_GNUC_INTERNAL PyEmpathyFilter_Type;
54
58
PyTypeObject G_GNUC_INTERNAL PyEmpathyIdle_Type;
 
59
PyTypeObject G_GNUC_INTERNAL PyEmpathyIrcNetwork_Type;
 
60
PyTypeObject G_GNUC_INTERNAL PyEmpathyIrcNetworkManager_Type;
 
61
PyTypeObject G_GNUC_INTERNAL PyEmpathyIrcServer_Type;
55
62
PyTypeObject G_GNUC_INTERNAL PyEmpathyLogManager_Type;
56
63
PyTypeObject G_GNUC_INTERNAL PyEmpathyMessage_Type;
57
64
PyTypeObject G_GNUC_INTERNAL PyEmpathyTpCall_Type;
63
70
PyTypeObject G_GNUC_INTERNAL PyEmpathyTpRoomlist_Type;
64
71
PyTypeObject G_GNUC_INTERNAL PyEmpathyContactList_Type;
65
72
 
66
 
#line 67 "pyempathy.c"
 
73
#line 74 "pyempathy.c"
67
74
 
68
75
 
69
76
 
1132
1139
 
1133
1140
 
1134
1141
 
 
1142
/* ----------- EmpathyIrcNetwork ----------- */
 
1143
 
 
1144
static int
 
1145
_wrap_empathy_irc_network_new(PyGObject *self, PyObject *args, PyObject *kwargs)
 
1146
{
 
1147
    static char *kwlist[] = { "name", NULL };
 
1148
    char *name;
 
1149
 
 
1150
    if (!PyArg_ParseTupleAndKeywords(args, kwargs,"s:EmpathyIrcNetwork.__init__", kwlist, &name))
 
1151
        return -1;
 
1152
    self->obj = (GObject *)empathy_irc_network_new(name);
 
1153
 
 
1154
    if (!self->obj) {
 
1155
        PyErr_SetString(PyExc_RuntimeError, "could not create EmpathyIrcNetwork object");
 
1156
        return -1;
 
1157
    }
 
1158
    pygobject_register_wrapper((PyObject *)self);
 
1159
    return 0;
 
1160
}
 
1161
 
 
1162
static PyObject *
 
1163
_wrap_empathy_irc_network_append_server(PyGObject *self, PyObject *args, PyObject *kwargs)
 
1164
{
 
1165
    static char *kwlist[] = { "server", NULL };
 
1166
    PyGObject *server;
 
1167
 
 
1168
    if (!PyArg_ParseTupleAndKeywords(args, kwargs,"O!:EmpathyIrcNetwork.append_server", kwlist, &PyEmpathyIrcServer_Type, &server))
 
1169
        return NULL;
 
1170
    
 
1171
    empathy_irc_network_append_server(EMPATHY_IRC_NETWORK(self->obj), EMPATHY_IRC_SERVER(server->obj));
 
1172
    
 
1173
    Py_INCREF(Py_None);
 
1174
    return Py_None;
 
1175
}
 
1176
 
 
1177
static PyObject *
 
1178
_wrap_empathy_irc_network_remove_server(PyGObject *self, PyObject *args, PyObject *kwargs)
 
1179
{
 
1180
    static char *kwlist[] = { "server", NULL };
 
1181
    PyGObject *server;
 
1182
 
 
1183
    if (!PyArg_ParseTupleAndKeywords(args, kwargs,"O!:EmpathyIrcNetwork.remove_server", kwlist, &PyEmpathyIrcServer_Type, &server))
 
1184
        return NULL;
 
1185
    
 
1186
    empathy_irc_network_remove_server(EMPATHY_IRC_NETWORK(self->obj), EMPATHY_IRC_SERVER(server->obj));
 
1187
    
 
1188
    Py_INCREF(Py_None);
 
1189
    return Py_None;
 
1190
}
 
1191
 
 
1192
static PyObject *
 
1193
_wrap_empathy_irc_network_set_server_position(PyGObject *self, PyObject *args, PyObject *kwargs)
 
1194
{
 
1195
    static char *kwlist[] = { "server", "pos", NULL };
 
1196
    PyGObject *server;
 
1197
    int pos;
 
1198
 
 
1199
    if (!PyArg_ParseTupleAndKeywords(args, kwargs,"O!i:EmpathyIrcNetwork.set_server_position", kwlist, &PyEmpathyIrcServer_Type, &server, &pos))
 
1200
        return NULL;
 
1201
    
 
1202
    empathy_irc_network_set_server_position(EMPATHY_IRC_NETWORK(self->obj), EMPATHY_IRC_SERVER(server->obj), pos);
 
1203
    
 
1204
    Py_INCREF(Py_None);
 
1205
    return Py_None;
 
1206
}
 
1207
 
 
1208
static const PyMethodDef _PyEmpathyIrcNetwork_methods[] = {
 
1209
    { "append_server", (PyCFunction)_wrap_empathy_irc_network_append_server, METH_VARARGS|METH_KEYWORDS,
 
1210
      NULL },
 
1211
    { "remove_server", (PyCFunction)_wrap_empathy_irc_network_remove_server, METH_VARARGS|METH_KEYWORDS,
 
1212
      NULL },
 
1213
    { "set_server_position", (PyCFunction)_wrap_empathy_irc_network_set_server_position, METH_VARARGS|METH_KEYWORDS,
 
1214
      NULL },
 
1215
    { NULL, NULL, 0, NULL }
 
1216
};
 
1217
 
 
1218
PyTypeObject G_GNUC_INTERNAL PyEmpathyIrcNetwork_Type = {
 
1219
    PyObject_HEAD_INIT(NULL)
 
1220
    0,                                 /* ob_size */
 
1221
    "empathy.IrcNetwork",                   /* tp_name */
 
1222
    sizeof(PyGObject),          /* tp_basicsize */
 
1223
    0,                                 /* tp_itemsize */
 
1224
    /* methods */
 
1225
    (destructor)0,        /* tp_dealloc */
 
1226
    (printfunc)0,                      /* tp_print */
 
1227
    (getattrfunc)0,       /* tp_getattr */
 
1228
    (setattrfunc)0,       /* tp_setattr */
 
1229
    (cmpfunc)0,           /* tp_compare */
 
1230
    (reprfunc)0,             /* tp_repr */
 
1231
    (PyNumberMethods*)0,     /* tp_as_number */
 
1232
    (PySequenceMethods*)0, /* tp_as_sequence */
 
1233
    (PyMappingMethods*)0,   /* tp_as_mapping */
 
1234
    (hashfunc)0,             /* tp_hash */
 
1235
    (ternaryfunc)0,          /* tp_call */
 
1236
    (reprfunc)0,              /* tp_str */
 
1237
    (getattrofunc)0,     /* tp_getattro */
 
1238
    (setattrofunc)0,     /* tp_setattro */
 
1239
    (PyBufferProcs*)0,  /* tp_as_buffer */
 
1240
    Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,                      /* tp_flags */
 
1241
    NULL,                        /* Documentation string */
 
1242
    (traverseproc)0,     /* tp_traverse */
 
1243
    (inquiry)0,             /* tp_clear */
 
1244
    (richcmpfunc)0,   /* tp_richcompare */
 
1245
    offsetof(PyGObject, weakreflist),             /* tp_weaklistoffset */
 
1246
    (getiterfunc)0,          /* tp_iter */
 
1247
    (iternextfunc)0,     /* tp_iternext */
 
1248
    (struct PyMethodDef*)_PyEmpathyIrcNetwork_methods, /* tp_methods */
 
1249
    (struct PyMemberDef*)0,              /* tp_members */
 
1250
    (struct PyGetSetDef*)0,  /* tp_getset */
 
1251
    NULL,                              /* tp_base */
 
1252
    NULL,                              /* tp_dict */
 
1253
    (descrgetfunc)0,    /* tp_descr_get */
 
1254
    (descrsetfunc)0,    /* tp_descr_set */
 
1255
    offsetof(PyGObject, inst_dict),                 /* tp_dictoffset */
 
1256
    (initproc)_wrap_empathy_irc_network_new,             /* tp_init */
 
1257
    (allocfunc)0,           /* tp_alloc */
 
1258
    (newfunc)0,               /* tp_new */
 
1259
    (freefunc)0,             /* tp_free */
 
1260
    (inquiry)0              /* tp_is_gc */
 
1261
};
 
1262
 
 
1263
 
 
1264
 
 
1265
/* ----------- EmpathyIrcNetworkManager ----------- */
 
1266
 
 
1267
static int
 
1268
_wrap_empathy_irc_network_manager_new(PyGObject *self, PyObject *args, PyObject *kwargs)
 
1269
{
 
1270
    static char *kwlist[] = { "global_file", "user_file", NULL };
 
1271
    char *global_file, *user_file;
 
1272
 
 
1273
    if (!PyArg_ParseTupleAndKeywords(args, kwargs,"ss:EmpathyIrcNetworkManager.__init__", kwlist, &global_file, &user_file))
 
1274
        return -1;
 
1275
    self->obj = (GObject *)empathy_irc_network_manager_new(global_file, user_file);
 
1276
 
 
1277
    if (!self->obj) {
 
1278
        PyErr_SetString(PyExc_RuntimeError, "could not create EmpathyIrcNetworkManager object");
 
1279
        return -1;
 
1280
    }
 
1281
    pygobject_register_wrapper((PyObject *)self);
 
1282
    return 0;
 
1283
}
 
1284
 
 
1285
static PyObject *
 
1286
_wrap_empathy_irc_network_manager_add(PyGObject *self, PyObject *args, PyObject *kwargs)
 
1287
{
 
1288
    static char *kwlist[] = { "network", NULL };
 
1289
    PyGObject *network;
 
1290
 
 
1291
    if (!PyArg_ParseTupleAndKeywords(args, kwargs,"O!:EmpathyIrcNetworkManager.add", kwlist, &PyEmpathyIrcNetwork_Type, &network))
 
1292
        return NULL;
 
1293
    
 
1294
    empathy_irc_network_manager_add(EMPATHY_IRC_NETWORK_MANAGER(self->obj), EMPATHY_IRC_NETWORK(network->obj));
 
1295
    
 
1296
    Py_INCREF(Py_None);
 
1297
    return Py_None;
 
1298
}
 
1299
 
 
1300
static PyObject *
 
1301
_wrap_empathy_irc_network_manager_remove(PyGObject *self, PyObject *args, PyObject *kwargs)
 
1302
{
 
1303
    static char *kwlist[] = { "network", NULL };
 
1304
    PyGObject *network;
 
1305
 
 
1306
    if (!PyArg_ParseTupleAndKeywords(args, kwargs,"O!:EmpathyIrcNetworkManager.remove", kwlist, &PyEmpathyIrcNetwork_Type, &network))
 
1307
        return NULL;
 
1308
    
 
1309
    empathy_irc_network_manager_remove(EMPATHY_IRC_NETWORK_MANAGER(self->obj), EMPATHY_IRC_NETWORK(network->obj));
 
1310
    
 
1311
    Py_INCREF(Py_None);
 
1312
    return Py_None;
 
1313
}
 
1314
 
 
1315
static PyObject *
 
1316
_wrap_empathy_irc_network_manager_find_network_by_address(PyGObject *self, PyObject *args, PyObject *kwargs)
 
1317
{
 
1318
    static char *kwlist[] = { "address", NULL };
 
1319
    char *address;
 
1320
    EmpathyIrcNetwork *ret;
 
1321
 
 
1322
    if (!PyArg_ParseTupleAndKeywords(args, kwargs,"s:EmpathyIrcNetworkManager.find_network_by_address", kwlist, &address))
 
1323
        return NULL;
 
1324
    
 
1325
    ret = empathy_irc_network_manager_find_network_by_address(EMPATHY_IRC_NETWORK_MANAGER(self->obj), address);
 
1326
    
 
1327
    /* pygobject_new handles NULL checking */
 
1328
    return pygobject_new((GObject *)ret);
 
1329
}
 
1330
 
 
1331
static const PyMethodDef _PyEmpathyIrcNetworkManager_methods[] = {
 
1332
    { "add", (PyCFunction)_wrap_empathy_irc_network_manager_add, METH_VARARGS|METH_KEYWORDS,
 
1333
      NULL },
 
1334
    { "remove", (PyCFunction)_wrap_empathy_irc_network_manager_remove, METH_VARARGS|METH_KEYWORDS,
 
1335
      NULL },
 
1336
    { "find_network_by_address", (PyCFunction)_wrap_empathy_irc_network_manager_find_network_by_address, METH_VARARGS|METH_KEYWORDS,
 
1337
      NULL },
 
1338
    { NULL, NULL, 0, NULL }
 
1339
};
 
1340
 
 
1341
PyTypeObject G_GNUC_INTERNAL PyEmpathyIrcNetworkManager_Type = {
 
1342
    PyObject_HEAD_INIT(NULL)
 
1343
    0,                                 /* ob_size */
 
1344
    "empathy.IrcNetworkManager",                   /* tp_name */
 
1345
    sizeof(PyGObject),          /* tp_basicsize */
 
1346
    0,                                 /* tp_itemsize */
 
1347
    /* methods */
 
1348
    (destructor)0,        /* tp_dealloc */
 
1349
    (printfunc)0,                      /* tp_print */
 
1350
    (getattrfunc)0,       /* tp_getattr */
 
1351
    (setattrfunc)0,       /* tp_setattr */
 
1352
    (cmpfunc)0,           /* tp_compare */
 
1353
    (reprfunc)0,             /* tp_repr */
 
1354
    (PyNumberMethods*)0,     /* tp_as_number */
 
1355
    (PySequenceMethods*)0, /* tp_as_sequence */
 
1356
    (PyMappingMethods*)0,   /* tp_as_mapping */
 
1357
    (hashfunc)0,             /* tp_hash */
 
1358
    (ternaryfunc)0,          /* tp_call */
 
1359
    (reprfunc)0,              /* tp_str */
 
1360
    (getattrofunc)0,     /* tp_getattro */
 
1361
    (setattrofunc)0,     /* tp_setattro */
 
1362
    (PyBufferProcs*)0,  /* tp_as_buffer */
 
1363
    Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,                      /* tp_flags */
 
1364
    NULL,                        /* Documentation string */
 
1365
    (traverseproc)0,     /* tp_traverse */
 
1366
    (inquiry)0,             /* tp_clear */
 
1367
    (richcmpfunc)0,   /* tp_richcompare */
 
1368
    offsetof(PyGObject, weakreflist),             /* tp_weaklistoffset */
 
1369
    (getiterfunc)0,          /* tp_iter */
 
1370
    (iternextfunc)0,     /* tp_iternext */
 
1371
    (struct PyMethodDef*)_PyEmpathyIrcNetworkManager_methods, /* tp_methods */
 
1372
    (struct PyMemberDef*)0,              /* tp_members */
 
1373
    (struct PyGetSetDef*)0,  /* tp_getset */
 
1374
    NULL,                              /* tp_base */
 
1375
    NULL,                              /* tp_dict */
 
1376
    (descrgetfunc)0,    /* tp_descr_get */
 
1377
    (descrsetfunc)0,    /* tp_descr_set */
 
1378
    offsetof(PyGObject, inst_dict),                 /* tp_dictoffset */
 
1379
    (initproc)_wrap_empathy_irc_network_manager_new,             /* tp_init */
 
1380
    (allocfunc)0,           /* tp_alloc */
 
1381
    (newfunc)0,               /* tp_new */
 
1382
    (freefunc)0,             /* tp_free */
 
1383
    (inquiry)0              /* tp_is_gc */
 
1384
};
 
1385
 
 
1386
 
 
1387
 
 
1388
/* ----------- EmpathyIrcServer ----------- */
 
1389
 
 
1390
static int
 
1391
_wrap_empathy_irc_server_new(PyGObject *self, PyObject *args, PyObject *kwargs)
 
1392
{
 
1393
    static char *kwlist[] = { "address", "port", "ssl", NULL };
 
1394
    char *address;
 
1395
    PyObject *py_port = NULL;
 
1396
    int ssl;
 
1397
    guint port = 0;
 
1398
 
 
1399
    if (!PyArg_ParseTupleAndKeywords(args, kwargs,"sOi:EmpathyIrcServer.__init__", kwlist, &address, &py_port, &ssl))
 
1400
        return -1;
 
1401
    if (py_port) {
 
1402
        if (PyLong_Check(py_port))
 
1403
            port = PyLong_AsUnsignedLong(py_port);
 
1404
        else if (PyInt_Check(py_port))
 
1405
            port = PyInt_AsLong(py_port);
 
1406
        else
 
1407
            PyErr_SetString(PyExc_TypeError, "Parameter 'port' must be an int or a long");
 
1408
        if (PyErr_Occurred())
 
1409
            return -1;
 
1410
    }
 
1411
    self->obj = (GObject *)empathy_irc_server_new(address, port, ssl);
 
1412
 
 
1413
    if (!self->obj) {
 
1414
        PyErr_SetString(PyExc_RuntimeError, "could not create EmpathyIrcServer object");
 
1415
        return -1;
 
1416
    }
 
1417
    pygobject_register_wrapper((PyObject *)self);
 
1418
    return 0;
 
1419
}
 
1420
 
 
1421
PyTypeObject G_GNUC_INTERNAL PyEmpathyIrcServer_Type = {
 
1422
    PyObject_HEAD_INIT(NULL)
 
1423
    0,                                 /* ob_size */
 
1424
    "empathy.IrcServer",                   /* tp_name */
 
1425
    sizeof(PyGObject),          /* tp_basicsize */
 
1426
    0,                                 /* tp_itemsize */
 
1427
    /* methods */
 
1428
    (destructor)0,        /* tp_dealloc */
 
1429
    (printfunc)0,                      /* tp_print */
 
1430
    (getattrfunc)0,       /* tp_getattr */
 
1431
    (setattrfunc)0,       /* tp_setattr */
 
1432
    (cmpfunc)0,           /* tp_compare */
 
1433
    (reprfunc)0,             /* tp_repr */
 
1434
    (PyNumberMethods*)0,     /* tp_as_number */
 
1435
    (PySequenceMethods*)0, /* tp_as_sequence */
 
1436
    (PyMappingMethods*)0,   /* tp_as_mapping */
 
1437
    (hashfunc)0,             /* tp_hash */
 
1438
    (ternaryfunc)0,          /* tp_call */
 
1439
    (reprfunc)0,              /* tp_str */
 
1440
    (getattrofunc)0,     /* tp_getattro */
 
1441
    (setattrofunc)0,     /* tp_setattro */
 
1442
    (PyBufferProcs*)0,  /* tp_as_buffer */
 
1443
    Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,                      /* tp_flags */
 
1444
    NULL,                        /* Documentation string */
 
1445
    (traverseproc)0,     /* tp_traverse */
 
1446
    (inquiry)0,             /* tp_clear */
 
1447
    (richcmpfunc)0,   /* tp_richcompare */
 
1448
    offsetof(PyGObject, weakreflist),             /* tp_weaklistoffset */
 
1449
    (getiterfunc)0,          /* tp_iter */
 
1450
    (iternextfunc)0,     /* tp_iternext */
 
1451
    (struct PyMethodDef*)NULL, /* tp_methods */
 
1452
    (struct PyMemberDef*)0,              /* tp_members */
 
1453
    (struct PyGetSetDef*)0,  /* tp_getset */
 
1454
    NULL,                              /* tp_base */
 
1455
    NULL,                              /* tp_dict */
 
1456
    (descrgetfunc)0,    /* tp_descr_get */
 
1457
    (descrsetfunc)0,    /* tp_descr_set */
 
1458
    offsetof(PyGObject, inst_dict),                 /* tp_dictoffset */
 
1459
    (initproc)_wrap_empathy_irc_server_new,             /* tp_init */
 
1460
    (allocfunc)0,           /* tp_alloc */
 
1461
    (newfunc)0,               /* tp_new */
 
1462
    (freefunc)0,             /* tp_free */
 
1463
    (inquiry)0              /* tp_is_gc */
 
1464
};
 
1465
 
 
1466
 
 
1467
 
1135
1468
/* ----------- EmpathyLogManager ----------- */
1136
1469
 
1137
1470
static int
1443
1776
/* ----------- EmpathyTpCall ----------- */
1444
1777
 
1445
1778
static PyObject *
1446
 
_wrap_empathy_tp_call_is_incoming(PyGObject *self)
1447
 
{
1448
 
    int ret;
1449
 
 
1450
 
    
1451
 
    ret = empathy_tp_call_is_incoming(EMPATHY_TP_CALL(self->obj));
1452
 
    
1453
 
    return PyBool_FromLong(ret);
1454
 
 
1455
 
}
1456
 
 
1457
 
static PyObject *
1458
 
_wrap_empathy_tp_call_get_status(PyGObject *self)
1459
 
{
1460
 
    gint ret;
1461
 
 
1462
 
    
1463
 
    ret = empathy_tp_call_get_status(EMPATHY_TP_CALL(self->obj));
1464
 
    
1465
 
    return pyg_enum_from_gtype(EMPATHY_TYPE_TP_CALL_STATUS, ret);
1466
 
}
1467
 
 
1468
 
static PyObject *
1469
 
_wrap_empathy_tp_call_get_contact(PyGObject *self)
1470
 
{
1471
 
    EmpathyContact *ret;
1472
 
 
1473
 
    
1474
 
    ret = empathy_tp_call_get_contact(EMPATHY_TP_CALL(self->obj));
1475
 
    
1476
 
    /* pygobject_new handles NULL checking */
1477
 
    return pygobject_new((GObject *)ret);
1478
 
}
1479
 
 
1480
 
static PyObject *
1481
 
_wrap_empathy_tp_call_accept(PyGObject *self)
1482
 
{
1483
 
    
1484
 
    empathy_tp_call_accept(EMPATHY_TP_CALL(self->obj));
1485
 
    
1486
 
    Py_INCREF(Py_None);
1487
 
    return Py_None;
1488
 
}
1489
 
 
1490
 
static PyObject *
1491
 
_wrap_empathy_tp_call_invite(PyGObject *self, PyObject *args, PyObject *kwargs)
1492
 
{
1493
 
    static char *kwlist[] = { "contact", NULL };
1494
 
    PyGObject *contact;
1495
 
 
1496
 
    if (!PyArg_ParseTupleAndKeywords(args, kwargs,"O!:EmpathyTpCall.invite", kwlist, &PyEmpathyContact_Type, &contact))
1497
 
        return NULL;
1498
 
    
1499
 
    empathy_tp_call_invite(EMPATHY_TP_CALL(self->obj), EMPATHY_CONTACT(contact->obj));
1500
 
    
1501
 
    Py_INCREF(Py_None);
1502
 
    return Py_None;
1503
 
}
1504
 
 
1505
 
static PyObject *
1506
 
_wrap_empathy_tp_call_request_streams(PyGObject *self, PyObject *args, PyObject *kwargs)
1507
 
{
1508
 
    static char *kwlist[] = { "audio", "video", NULL };
1509
 
    int audio, video;
1510
 
 
1511
 
    if (!PyArg_ParseTupleAndKeywords(args, kwargs,"ii:EmpathyTpCall.request_streams", kwlist, &audio, &video))
1512
 
        return NULL;
1513
 
    
1514
 
    empathy_tp_call_request_streams(EMPATHY_TP_CALL(self->obj), audio, video);
1515
 
    
1516
 
    Py_INCREF(Py_None);
1517
 
    return Py_None;
1518
 
}
1519
 
 
1520
 
static PyObject *
1521
 
_wrap_empathy_tp_call_send_video(PyGObject *self, PyObject *args, PyObject *kwargs)
1522
 
{
1523
 
    static char *kwlist[] = { "send", NULL };
1524
 
    int send;
1525
 
 
1526
 
    if (!PyArg_ParseTupleAndKeywords(args, kwargs,"i:EmpathyTpCall.send_video", kwlist, &send))
1527
 
        return NULL;
1528
 
    
1529
 
    empathy_tp_call_send_video(EMPATHY_TP_CALL(self->obj), send);
1530
 
    
1531
 
    Py_INCREF(Py_None);
1532
 
    return Py_None;
1533
 
}
1534
 
 
1535
 
static PyObject *
1536
 
_wrap_empathy_tp_call_add_preview_window(PyGObject *self, PyObject *args, PyObject *kwargs)
1537
 
{
1538
 
    static char *kwlist[] = { "socket_id", NULL };
1539
 
    PyObject *py_socket_id = NULL;
1540
 
    guint socket_id = 0;
1541
 
 
1542
 
    if (!PyArg_ParseTupleAndKeywords(args, kwargs,"O:EmpathyTpCall.add_preview_window", kwlist, &py_socket_id))
1543
 
        return NULL;
1544
 
    if (py_socket_id) {
1545
 
        if (PyLong_Check(py_socket_id))
1546
 
            socket_id = PyLong_AsUnsignedLong(py_socket_id);
1547
 
        else if (PyInt_Check(py_socket_id))
1548
 
            socket_id = PyInt_AsLong(py_socket_id);
1549
 
        else
1550
 
            PyErr_SetString(PyExc_TypeError, "Parameter 'socket_id' must be an int or a long");
1551
 
        if (PyErr_Occurred())
1552
 
            return NULL;
1553
 
    }
1554
 
    
1555
 
    empathy_tp_call_add_preview_window(EMPATHY_TP_CALL(self->obj), socket_id);
1556
 
    
1557
 
    Py_INCREF(Py_None);
1558
 
    return Py_None;
1559
 
}
1560
 
 
1561
 
static PyObject *
1562
 
_wrap_empathy_tp_call_remove_preview_window(PyGObject *self, PyObject *args, PyObject *kwargs)
1563
 
{
1564
 
    static char *kwlist[] = { "socket_id", NULL };
1565
 
    PyObject *py_socket_id = NULL;
1566
 
    guint socket_id = 0;
1567
 
 
1568
 
    if (!PyArg_ParseTupleAndKeywords(args, kwargs,"O:EmpathyTpCall.remove_preview_window", kwlist, &py_socket_id))
1569
 
        return NULL;
1570
 
    if (py_socket_id) {
1571
 
        if (PyLong_Check(py_socket_id))
1572
 
            socket_id = PyLong_AsUnsignedLong(py_socket_id);
1573
 
        else if (PyInt_Check(py_socket_id))
1574
 
            socket_id = PyInt_AsLong(py_socket_id);
1575
 
        else
1576
 
            PyErr_SetString(PyExc_TypeError, "Parameter 'socket_id' must be an int or a long");
1577
 
        if (PyErr_Occurred())
1578
 
            return NULL;
1579
 
    }
1580
 
    
1581
 
    empathy_tp_call_remove_preview_window(EMPATHY_TP_CALL(self->obj), socket_id);
1582
 
    
1583
 
    Py_INCREF(Py_None);
1584
 
    return Py_None;
1585
 
}
1586
 
 
1587
 
static PyObject *
1588
 
_wrap_empathy_tp_call_set_output_window(PyGObject *self, PyObject *args, PyObject *kwargs)
1589
 
{
1590
 
    static char *kwlist[] = { "socket_id", NULL };
1591
 
    PyObject *py_socket_id = NULL;
1592
 
    guint socket_id = 0;
1593
 
 
1594
 
    if (!PyArg_ParseTupleAndKeywords(args, kwargs,"O:EmpathyTpCall.set_output_window", kwlist, &py_socket_id))
1595
 
        return NULL;
1596
 
    if (py_socket_id) {
1597
 
        if (PyLong_Check(py_socket_id))
1598
 
            socket_id = PyLong_AsUnsignedLong(py_socket_id);
1599
 
        else if (PyInt_Check(py_socket_id))
1600
 
            socket_id = PyInt_AsLong(py_socket_id);
1601
 
        else
1602
 
            PyErr_SetString(PyExc_TypeError, "Parameter 'socket_id' must be an int or a long");
1603
 
        if (PyErr_Occurred())
1604
 
            return NULL;
1605
 
    }
1606
 
    
1607
 
    empathy_tp_call_set_output_window(EMPATHY_TP_CALL(self->obj), socket_id);
 
1779
_wrap_empathy_tp_call_accept_incoming_call(PyGObject *self)
 
1780
{
 
1781
    
 
1782
    empathy_tp_call_accept_incoming_call(EMPATHY_TP_CALL(self->obj));
 
1783
    
 
1784
    Py_INCREF(Py_None);
 
1785
    return Py_None;
 
1786
}
 
1787
 
 
1788
static PyObject *
 
1789
_wrap_empathy_tp_call_close_channel(PyGObject *self)
 
1790
{
 
1791
    
 
1792
    empathy_tp_call_close_channel(EMPATHY_TP_CALL(self->obj));
 
1793
    
 
1794
    Py_INCREF(Py_None);
 
1795
    return Py_None;
 
1796
}
 
1797
 
 
1798
static PyObject *
 
1799
_wrap_empathy_tp_call_request_video_stream_direction(PyGObject *self, PyObject *args, PyObject *kwargs)
 
1800
{
 
1801
    static char *kwlist[] = { "is_sending", NULL };
 
1802
    int is_sending;
 
1803
 
 
1804
    if (!PyArg_ParseTupleAndKeywords(args, kwargs,"i:EmpathyTpCall.request_video_stream_direction", kwlist, &is_sending))
 
1805
        return NULL;
 
1806
    
 
1807
    empathy_tp_call_request_video_stream_direction(EMPATHY_TP_CALL(self->obj), is_sending);
 
1808
    
 
1809
    Py_INCREF(Py_None);
 
1810
    return Py_None;
 
1811
}
 
1812
 
 
1813
static PyObject *
 
1814
_wrap_empathy_tp_call_add_preview_video(PyGObject *self, PyObject *args, PyObject *kwargs)
 
1815
{
 
1816
    static char *kwlist[] = { "preview_video_socket_id", NULL };
 
1817
    PyObject *py_preview_video_socket_id = NULL;
 
1818
    guint preview_video_socket_id = 0;
 
1819
 
 
1820
    if (!PyArg_ParseTupleAndKeywords(args, kwargs,"O:EmpathyTpCall.add_preview_video", kwlist, &py_preview_video_socket_id))
 
1821
        return NULL;
 
1822
    if (py_preview_video_socket_id) {
 
1823
        if (PyLong_Check(py_preview_video_socket_id))
 
1824
            preview_video_socket_id = PyLong_AsUnsignedLong(py_preview_video_socket_id);
 
1825
        else if (PyInt_Check(py_preview_video_socket_id))
 
1826
            preview_video_socket_id = PyInt_AsLong(py_preview_video_socket_id);
 
1827
        else
 
1828
            PyErr_SetString(PyExc_TypeError, "Parameter 'preview_video_socket_id' must be an int or a long");
 
1829
        if (PyErr_Occurred())
 
1830
            return NULL;
 
1831
    }
 
1832
    
 
1833
    empathy_tp_call_add_preview_video(EMPATHY_TP_CALL(self->obj), preview_video_socket_id);
 
1834
    
 
1835
    Py_INCREF(Py_None);
 
1836
    return Py_None;
 
1837
}
 
1838
 
 
1839
static PyObject *
 
1840
_wrap_empathy_tp_call_remove_preview_video(PyGObject *self, PyObject *args, PyObject *kwargs)
 
1841
{
 
1842
    static char *kwlist[] = { "preview_video_socket_id", NULL };
 
1843
    PyObject *py_preview_video_socket_id = NULL;
 
1844
    guint preview_video_socket_id = 0;
 
1845
 
 
1846
    if (!PyArg_ParseTupleAndKeywords(args, kwargs,"O:EmpathyTpCall.remove_preview_video", kwlist, &py_preview_video_socket_id))
 
1847
        return NULL;
 
1848
    if (py_preview_video_socket_id) {
 
1849
        if (PyLong_Check(py_preview_video_socket_id))
 
1850
            preview_video_socket_id = PyLong_AsUnsignedLong(py_preview_video_socket_id);
 
1851
        else if (PyInt_Check(py_preview_video_socket_id))
 
1852
            preview_video_socket_id = PyInt_AsLong(py_preview_video_socket_id);
 
1853
        else
 
1854
            PyErr_SetString(PyExc_TypeError, "Parameter 'preview_video_socket_id' must be an int or a long");
 
1855
        if (PyErr_Occurred())
 
1856
            return NULL;
 
1857
    }
 
1858
    
 
1859
    empathy_tp_call_remove_preview_video(EMPATHY_TP_CALL(self->obj), preview_video_socket_id);
 
1860
    
 
1861
    Py_INCREF(Py_None);
 
1862
    return Py_None;
 
1863
}
 
1864
 
 
1865
static PyObject *
 
1866
_wrap_empathy_tp_call_add_output_video(PyGObject *self, PyObject *args, PyObject *kwargs)
 
1867
{
 
1868
    static char *kwlist[] = { "output_video_socket_id", NULL };
 
1869
    PyObject *py_output_video_socket_id = NULL;
 
1870
    guint output_video_socket_id = 0;
 
1871
 
 
1872
    if (!PyArg_ParseTupleAndKeywords(args, kwargs,"O:EmpathyTpCall.add_output_video", kwlist, &py_output_video_socket_id))
 
1873
        return NULL;
 
1874
    if (py_output_video_socket_id) {
 
1875
        if (PyLong_Check(py_output_video_socket_id))
 
1876
            output_video_socket_id = PyLong_AsUnsignedLong(py_output_video_socket_id);
 
1877
        else if (PyInt_Check(py_output_video_socket_id))
 
1878
            output_video_socket_id = PyInt_AsLong(py_output_video_socket_id);
 
1879
        else
 
1880
            PyErr_SetString(PyExc_TypeError, "Parameter 'output_video_socket_id' must be an int or a long");
 
1881
        if (PyErr_Occurred())
 
1882
            return NULL;
 
1883
    }
 
1884
    
 
1885
    empathy_tp_call_add_output_video(EMPATHY_TP_CALL(self->obj), output_video_socket_id);
1608
1886
    
1609
1887
    Py_INCREF(Py_None);
1610
1888
    return Py_None;
1667
1945
}
1668
1946
 
1669
1947
static const PyMethodDef _PyEmpathyTpCall_methods[] = {
1670
 
    { "is_incoming", (PyCFunction)_wrap_empathy_tp_call_is_incoming, METH_NOARGS,
1671
 
      NULL },
1672
 
    { "get_status", (PyCFunction)_wrap_empathy_tp_call_get_status, METH_NOARGS,
1673
 
      NULL },
1674
 
    { "get_contact", (PyCFunction)_wrap_empathy_tp_call_get_contact, METH_NOARGS,
1675
 
      NULL },
1676
 
    { "accept", (PyCFunction)_wrap_empathy_tp_call_accept, METH_NOARGS,
1677
 
      NULL },
1678
 
    { "invite", (PyCFunction)_wrap_empathy_tp_call_invite, METH_VARARGS|METH_KEYWORDS,
1679
 
      NULL },
1680
 
    { "request_streams", (PyCFunction)_wrap_empathy_tp_call_request_streams, METH_VARARGS|METH_KEYWORDS,
1681
 
      NULL },
1682
 
    { "send_video", (PyCFunction)_wrap_empathy_tp_call_send_video, METH_VARARGS|METH_KEYWORDS,
1683
 
      NULL },
1684
 
    { "add_preview_window", (PyCFunction)_wrap_empathy_tp_call_add_preview_window, METH_VARARGS|METH_KEYWORDS,
1685
 
      NULL },
1686
 
    { "remove_preview_window", (PyCFunction)_wrap_empathy_tp_call_remove_preview_window, METH_VARARGS|METH_KEYWORDS,
1687
 
      NULL },
1688
 
    { "set_output_window", (PyCFunction)_wrap_empathy_tp_call_set_output_window, METH_VARARGS|METH_KEYWORDS,
 
1948
    { "accept_incoming_call", (PyCFunction)_wrap_empathy_tp_call_accept_incoming_call, METH_NOARGS,
 
1949
      NULL },
 
1950
    { "close_channel", (PyCFunction)_wrap_empathy_tp_call_close_channel, METH_NOARGS,
 
1951
      NULL },
 
1952
    { "request_video_stream_direction", (PyCFunction)_wrap_empathy_tp_call_request_video_stream_direction, METH_VARARGS|METH_KEYWORDS,
 
1953
      NULL },
 
1954
    { "add_preview_video", (PyCFunction)_wrap_empathy_tp_call_add_preview_video, METH_VARARGS|METH_KEYWORDS,
 
1955
      NULL },
 
1956
    { "remove_preview_video", (PyCFunction)_wrap_empathy_tp_call_remove_preview_video, METH_VARARGS|METH_KEYWORDS,
 
1957
      NULL },
 
1958
    { "add_output_video", (PyCFunction)_wrap_empathy_tp_call_add_output_video, METH_VARARGS|METH_KEYWORDS,
1689
1959
      NULL },
1690
1960
    { "set_output_volume", (PyCFunction)_wrap_empathy_tp_call_set_output_volume, METH_VARARGS|METH_KEYWORDS,
1691
1961
      NULL },
2431
2701
    return Py_None;
2432
2702
}
2433
2703
 
2434
 
#line 42 "pyempathy.override"
 
2704
#line 46 "pyempathy.override"
2435
2705
static PyObject *
2436
2706
_wrap_empathy_contact_list_get_members(PyGObject *self, PyObject *args, PyObject *kwargs)
2437
2707
{
2450
2720
        return py_contacts;
2451
2721
 
2452
2722
}
2453
 
#line 2454 "pyempathy.c"
 
2723
#line 2724 "pyempathy.c"
2454
2724
 
2455
2725
 
2456
2726
static PyObject *
2978
3248
    }
2979
3249
 
2980
3250
 
2981
 
#line 2982 "pyempathy.c"
 
3251
#line 3252 "pyempathy.c"
2982
3252
    pyg_register_interface(d, "ContactList", EMPATHY_TYPE_CONTACT_LIST, &PyEmpathyContactList_Type);
2983
3253
    pygobject_register_class(d, "EmpathyChandler", EMPATHY_TYPE_CHANDLER, &PyEmpathyChandler_Type, Py_BuildValue("(O)", &PyGObject_Type));
2984
3254
    pygobject_register_class(d, "EmpathyChatroom", EMPATHY_TYPE_CHATROOM, &PyEmpathyChatroom_Type, Py_BuildValue("(O)", &PyGObject_Type));
2992
3262
    pygobject_register_class(d, "EmpathyFilter", EMPATHY_TYPE_FILTER, &PyEmpathyFilter_Type, Py_BuildValue("(O)", &PyGObject_Type));
2993
3263
    pygobject_register_class(d, "EmpathyIdle", EMPATHY_TYPE_IDLE, &PyEmpathyIdle_Type, Py_BuildValue("(O)", &PyGObject_Type));
2994
3264
    pyg_set_object_has_new_constructor(EMPATHY_TYPE_IDLE);
 
3265
    pygobject_register_class(d, "EmpathyIrcNetwork", EMPATHY_TYPE_IRC_NETWORK, &PyEmpathyIrcNetwork_Type, Py_BuildValue("(O)", &PyGObject_Type));
 
3266
    pygobject_register_class(d, "EmpathyIrcNetworkManager", EMPATHY_TYPE_IRC_NETWORK_MANAGER, &PyEmpathyIrcNetworkManager_Type, Py_BuildValue("(O)", &PyGObject_Type));
 
3267
    pygobject_register_class(d, "EmpathyIrcServer", EMPATHY_TYPE_IRC_SERVER, &PyEmpathyIrcServer_Type, Py_BuildValue("(O)", &PyGObject_Type));
2995
3268
    pygobject_register_class(d, "EmpathyLogManager", EMPATHY_TYPE_LOG_MANAGER, &PyEmpathyLogManager_Type, Py_BuildValue("(O)", &PyGObject_Type));
2996
3269
    pyg_set_object_has_new_constructor(EMPATHY_TYPE_LOG_MANAGER);
2997
3270
    pygobject_register_class(d, "EmpathyMessage", EMPATHY_TYPE_MESSAGE, &PyEmpathyMessage_Type, Py_BuildValue("(O)", &PyGObject_Type));