~ubuntu-branches/ubuntu/natty/pygtk/natty-proposed

« back to all changes in this revision

Viewing changes to gtk/gtktreeview.override

  • Committer: Bazaar Package Importer
  • Author(s): Sebastien Bacher
  • Date: 2010-01-07 11:08:47 UTC
  • mfrom: (1.2.8 upstream)
  • Revision ID: james.westby@ubuntu.com-20100107110847-f5av7e1ttudh7ra6
Tags: 2.17.0-0ubuntu1
New upstream version

Show diffs side-by-side

added added

removed removed

Lines of Context:
1231
1231
    return Py_None;
1232
1232
}
1233
1233
%%
 
1234
override GtkTreeSortable__do_get_sort_column_id kwargs
 
1235
static PyObject *
 
1236
_wrap_GtkTreeSortable__do_get_sort_column_id(PyObject *cls, PyObject *args, PyObject *kwargs)
 
1237
{
 
1238
    static char *kwlist[] = { "self", NULL };
 
1239
    GtkTreeSortableIface *iface;
 
1240
    PyGObject *self;
 
1241
    gint sort_column_id;
 
1242
    GtkSortType order;
 
1243
 
 
1244
    if (!PyArg_ParseTupleAndKeywords(args, kwargs,"O!:gtk.TreeSortable.do_get_sort_column_id", kwlist, &PyGtkTreeSortable_Type, &self))
 
1245
        return NULL;
 
1246
    iface = g_type_interface_peek(g_type_class_peek(pyg_type_from_object(cls)), GTK_TYPE_TREE_SORTABLE);
 
1247
    if (iface->get_sort_column_id)
 
1248
        iface->get_sort_column_id(GTK_TREE_SORTABLE(self->obj), &sort_column_id, &order);
 
1249
    else {
 
1250
        PyErr_SetString(PyExc_NotImplementedError, "interface method gtk.TreeSortable.get_sort_column_id not implemented");
 
1251
        return NULL;
 
1252
    }
 
1253
 
 
1254
    return Py_BuildValue("(iN)", sort_column_id, pyg_enum_from_gtype(GTK_TYPE_SORT_TYPE, order));
 
1255
}
 
1256
%%
 
1257
override GtkTreeSortable__proxy_do_get_sort_column_id
 
1258
static gboolean
 
1259
_wrap_GtkTreeSortable__proxy_do_get_sort_column_id(GtkTreeSortable *self, gint *sort_column_id, GtkSortType *order)
 
1260
{
 
1261
    PyGILState_STATE __py_state;
 
1262
    PyObject *py_self;
 
1263
    PyObject *py_retval;
 
1264
    PyObject *py_method;
 
1265
    gint py_sort_column_id;
 
1266
    PyObject *py_order;
 
1267
 
 
1268
    __py_state = pyg_gil_state_ensure();
 
1269
    py_self = pygobject_new((GObject *) self);
 
1270
    if (!py_self) {
 
1271
        if (PyErr_Occurred())
 
1272
            PyErr_Print();
 
1273
        pyg_gil_state_release(__py_state);
 
1274
        return FALSE;
 
1275
    }
 
1276
    
 
1277
    py_method = PyObject_GetAttrString(py_self, "do_get_sort_column_id");
 
1278
    if (!py_method) {
 
1279
        if (PyErr_Occurred())
 
1280
            PyErr_Print();
 
1281
        Py_DECREF(py_self);
 
1282
        pyg_gil_state_release(__py_state);
 
1283
        return FALSE;
 
1284
    }
 
1285
    py_retval = PyObject_CallObject(py_method, NULL);
 
1286
    if (!py_retval) {
 
1287
        if (PyErr_Occurred())
 
1288
            PyErr_Print();
 
1289
        Py_XDECREF(py_retval);
 
1290
        Py_DECREF(py_method);
 
1291
        Py_DECREF(py_self);
 
1292
        pyg_gil_state_release(__py_state);
 
1293
        return FALSE;
 
1294
    }
 
1295
    if (!PyArg_ParseTuple(py_retval, "iO", &py_sort_column_id, &py_order)) {
 
1296
        PyErr_Print();
 
1297
        Py_XDECREF(py_retval);
 
1298
        Py_DECREF(py_method);
 
1299
        Py_DECREF(py_self);
 
1300
        pyg_gil_state_release(__py_state);
 
1301
        return FALSE;
 
1302
    }
 
1303
    if (sort_column_id)
 
1304
        *sort_column_id = py_sort_column_id;
 
1305
    if (order && pyg_enum_get_value(GTK_TYPE_SORT_TYPE, py_order, (gint *) order)) {
 
1306
        PyErr_Print();
 
1307
        Py_XDECREF(py_retval);
 
1308
        Py_DECREF(py_method);
 
1309
        Py_DECREF(py_self);
 
1310
        pyg_gil_state_release(__py_state);
 
1311
        return FALSE;
 
1312
    }
 
1313
 
 
1314
    Py_XDECREF(py_retval);
 
1315
    Py_DECREF(py_method);
 
1316
    Py_DECREF(py_self);
 
1317
    pyg_gil_state_release(__py_state);
 
1318
 
 
1319
    return py_order >= 0;
 
1320
}
 
1321
%%
1234
1322
ignore gtk_list_store_newv
1235
1323
%%
1236
1324
new-constructor GTK_TYPE_LIST_STORE