Mercurial > pidgin
annotate finch/libgnt/pygnt/gnttree.override @ 19289:f12bf92d64ec
Add marginally better doxygen magic to PurplePluginProtocolInfo
author | Will Thompson <will.thompson@collabora.co.uk> |
---|---|
date | Thu, 16 Aug 2007 18:33:00 +0000 |
parents | 54a28e05e8af |
children | 44b4e8bd759b |
rev | line source |
---|---|
18556
5e1412f4e67a
Do some work to make pygnt more useful. The dbus-gnt script works fairly
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
1 /** |
5e1412f4e67a
Do some work to make pygnt more useful. The dbus-gnt script works fairly
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
2 * pygnt- Python bindings for the GNT toolkit. |
5e1412f4e67a
Do some work to make pygnt more useful. The dbus-gnt script works fairly
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
3 * Copyright (C) 2007 Sadrul Habib Chowdhury <sadrul@pidgin.im> |
5e1412f4e67a
Do some work to make pygnt more useful. The dbus-gnt script works fairly
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
4 * |
5e1412f4e67a
Do some work to make pygnt more useful. The dbus-gnt script works fairly
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
5 * gnttree.override: overrides for the tree widget. |
5e1412f4e67a
Do some work to make pygnt more useful. The dbus-gnt script works fairly
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
6 * |
5e1412f4e67a
Do some work to make pygnt more useful. The dbus-gnt script works fairly
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
7 * This library is free software; you can redistribute it and/or |
5e1412f4e67a
Do some work to make pygnt more useful. The dbus-gnt script works fairly
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
8 * modify it under the terms of the GNU Lesser General Public |
5e1412f4e67a
Do some work to make pygnt more useful. The dbus-gnt script works fairly
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
9 * License as published by the Free Software Foundation; either |
5e1412f4e67a
Do some work to make pygnt more useful. The dbus-gnt script works fairly
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
10 * version 2.1 of the License, or (at your option) any later version. |
5e1412f4e67a
Do some work to make pygnt more useful. The dbus-gnt script works fairly
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
11 * |
5e1412f4e67a
Do some work to make pygnt more useful. The dbus-gnt script works fairly
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
12 * This library is distributed in the hope that it will be useful, |
5e1412f4e67a
Do some work to make pygnt more useful. The dbus-gnt script works fairly
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of |
5e1412f4e67a
Do some work to make pygnt more useful. The dbus-gnt script works fairly
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
5e1412f4e67a
Do some work to make pygnt more useful. The dbus-gnt script works fairly
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
15 * Lesser General Public License for more details. |
5e1412f4e67a
Do some work to make pygnt more useful. The dbus-gnt script works fairly
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
16 * |
5e1412f4e67a
Do some work to make pygnt more useful. The dbus-gnt script works fairly
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
17 * You should have received a copy of the GNU Lesser General Public |
5e1412f4e67a
Do some work to make pygnt more useful. The dbus-gnt script works fairly
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
18 * License along with this library; if not, write to the Free Software |
5e1412f4e67a
Do some work to make pygnt more useful. The dbus-gnt script works fairly
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
19 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 |
5e1412f4e67a
Do some work to make pygnt more useful. The dbus-gnt script works fairly
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
20 * USA |
5e1412f4e67a
Do some work to make pygnt more useful. The dbus-gnt script works fairly
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
21 */ |
5e1412f4e67a
Do some work to make pygnt more useful. The dbus-gnt script works fairly
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
22 %% |
18682
254823d66aa5
The promised cleanups.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
18679
diff
changeset
|
23 headers |
18556
5e1412f4e67a
Do some work to make pygnt more useful. The dbus-gnt script works fairly
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
24 #include "common.h" |
5e1412f4e67a
Do some work to make pygnt more useful. The dbus-gnt script works fairly
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
25 %% |
5e1412f4e67a
Do some work to make pygnt more useful. The dbus-gnt script works fairly
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
26 ignore |
5e1412f4e67a
Do some work to make pygnt more useful. The dbus-gnt script works fairly
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
27 gnt_tree_create_row |
5e1412f4e67a
Do some work to make pygnt more useful. The dbus-gnt script works fairly
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
28 gnt_tree_create_row_from_list |
5e1412f4e67a
Do some work to make pygnt more useful. The dbus-gnt script works fairly
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
29 %% |
5e1412f4e67a
Do some work to make pygnt more useful. The dbus-gnt script works fairly
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
30 override gnt_tree_get_selection_text_list noargs |
5e1412f4e67a
Do some work to make pygnt more useful. The dbus-gnt script works fairly
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
31 static PyObject * |
5e1412f4e67a
Do some work to make pygnt more useful. The dbus-gnt script works fairly
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
32 _wrap_gnt_tree_get_selection_text_list(PyGObject *self) |
5e1412f4e67a
Do some work to make pygnt more useful. The dbus-gnt script works fairly
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
33 { |
5e1412f4e67a
Do some work to make pygnt more useful. The dbus-gnt script works fairly
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
34 GList *list = gnt_tree_get_selection_text_list(GNT_TREE(self->obj)); |
5e1412f4e67a
Do some work to make pygnt more useful. The dbus-gnt script works fairly
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
35 return create_pyobject_from_string_list(list); |
5e1412f4e67a
Do some work to make pygnt more useful. The dbus-gnt script works fairly
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
36 } |
5e1412f4e67a
Do some work to make pygnt more useful. The dbus-gnt script works fairly
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
37 %% |
5e1412f4e67a
Do some work to make pygnt more useful. The dbus-gnt script works fairly
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
38 override gnt_tree_get_rows noargs |
5e1412f4e67a
Do some work to make pygnt more useful. The dbus-gnt script works fairly
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
39 static PyObject * |
5e1412f4e67a
Do some work to make pygnt more useful. The dbus-gnt script works fairly
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
40 _wrap_gnt_tree_get_rows(PyGObject *self) |
5e1412f4e67a
Do some work to make pygnt more useful. The dbus-gnt script works fairly
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
41 { |
5e1412f4e67a
Do some work to make pygnt more useful. The dbus-gnt script works fairly
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
42 GList *list = gnt_tree_get_rows(GNT_TREE(self->obj)); |
5e1412f4e67a
Do some work to make pygnt more useful. The dbus-gnt script works fairly
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
43 PyObject *py_list; |
5e1412f4e67a
Do some work to make pygnt more useful. The dbus-gnt script works fairly
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
44 if (list == NULL) { |
5e1412f4e67a
Do some work to make pygnt more useful. The dbus-gnt script works fairly
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
45 Py_INCREF(Py_None); |
5e1412f4e67a
Do some work to make pygnt more useful. The dbus-gnt script works fairly
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
46 return Py_None; |
5e1412f4e67a
Do some work to make pygnt more useful. The dbus-gnt script works fairly
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
47 } |
5e1412f4e67a
Do some work to make pygnt more useful. The dbus-gnt script works fairly
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
48 if ((py_list = PyList_New(0)) == NULL) { |
5e1412f4e67a
Do some work to make pygnt more useful. The dbus-gnt script works fairly
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
49 return NULL; |
5e1412f4e67a
Do some work to make pygnt more useful. The dbus-gnt script works fairly
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
50 } |
5e1412f4e67a
Do some work to make pygnt more useful. The dbus-gnt script works fairly
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
51 while (list) { |
18679
6b16fca71f8b
Add some more functions for GntTree. One point to note is that the key
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
18556
diff
changeset
|
52 PyObject *obj = list->data; |
18556
5e1412f4e67a
Do some work to make pygnt more useful. The dbus-gnt script works fairly
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
53 PyList_Append(py_list, obj); |
5e1412f4e67a
Do some work to make pygnt more useful. The dbus-gnt script works fairly
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
54 Py_DECREF(obj); |
5e1412f4e67a
Do some work to make pygnt more useful. The dbus-gnt script works fairly
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
55 list = list->next; |
5e1412f4e67a
Do some work to make pygnt more useful. The dbus-gnt script works fairly
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
56 } |
5e1412f4e67a
Do some work to make pygnt more useful. The dbus-gnt script works fairly
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
57 return py_list; |
5e1412f4e67a
Do some work to make pygnt more useful. The dbus-gnt script works fairly
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
58 } |
5e1412f4e67a
Do some work to make pygnt more useful. The dbus-gnt script works fairly
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
59 %% |
5e1412f4e67a
Do some work to make pygnt more useful. The dbus-gnt script works fairly
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
60 override gnt_tree_add_row_after |
5e1412f4e67a
Do some work to make pygnt more useful. The dbus-gnt script works fairly
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
61 static PyObject * |
5e1412f4e67a
Do some work to make pygnt more useful. The dbus-gnt script works fairly
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
62 _wrap_gnt_tree_add_row_after(PyGObject *self, PyObject *args) |
5e1412f4e67a
Do some work to make pygnt more useful. The dbus-gnt script works fairly
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
63 { |
5e1412f4e67a
Do some work to make pygnt more useful. The dbus-gnt script works fairly
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
64 static char *kwlist[] = {"key", "row", "parent", "bigbro", NULL}; |
5e1412f4e67a
Do some work to make pygnt more useful. The dbus-gnt script works fairly
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
65 PyObject *py_list; |
18682
254823d66aa5
The promised cleanups.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
18679
diff
changeset
|
66 gpointer key, parent, bigbro; |
18556
5e1412f4e67a
Do some work to make pygnt more useful. The dbus-gnt script works fairly
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
67 int len, i; |
5e1412f4e67a
Do some work to make pygnt more useful. The dbus-gnt script works fairly
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
68 GList *list = NULL; |
5e1412f4e67a
Do some work to make pygnt more useful. The dbus-gnt script works fairly
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
69 GntTreeRow *row; |
5e1412f4e67a
Do some work to make pygnt more useful. The dbus-gnt script works fairly
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
70 |
5e1412f4e67a
Do some work to make pygnt more useful. The dbus-gnt script works fairly
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
71 if (!PyArg_ParseTuple(args, |
5e1412f4e67a
Do some work to make pygnt more useful. The dbus-gnt script works fairly
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
72 "OOOO:GntTree.add_row_after", |
5e1412f4e67a
Do some work to make pygnt more useful. The dbus-gnt script works fairly
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
73 &key, |
5e1412f4e67a
Do some work to make pygnt more useful. The dbus-gnt script works fairly
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
74 &py_list, |
5e1412f4e67a
Do some work to make pygnt more useful. The dbus-gnt script works fairly
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
75 &parent, |
5e1412f4e67a
Do some work to make pygnt more useful. The dbus-gnt script works fairly
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
76 &bigbro)) |
5e1412f4e67a
Do some work to make pygnt more useful. The dbus-gnt script works fairly
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
77 return NULL; |
5e1412f4e67a
Do some work to make pygnt more useful. The dbus-gnt script works fairly
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
78 |
5e1412f4e67a
Do some work to make pygnt more useful. The dbus-gnt script works fairly
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
79 len = PySequence_Length(py_list); |
5e1412f4e67a
Do some work to make pygnt more useful. The dbus-gnt script works fairly
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
80 for (i = 0; i < len; i++) { |
5e1412f4e67a
Do some work to make pygnt more useful. The dbus-gnt script works fairly
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
81 PyObject *item = PySequence_GetItem(py_list, i); |
5e1412f4e67a
Do some work to make pygnt more useful. The dbus-gnt script works fairly
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
82 if (!pygobject_check(item, &PyString_Type)) { |
5e1412f4e67a
Do some work to make pygnt more useful. The dbus-gnt script works fairly
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
83 PyErr_SetString(PyExc_TypeError, |
5e1412f4e67a
Do some work to make pygnt more useful. The dbus-gnt script works fairly
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
84 "column_list members must be strings"); |
5e1412f4e67a
Do some work to make pygnt more useful. The dbus-gnt script works fairly
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
85 Py_DECREF(item); |
5e1412f4e67a
Do some work to make pygnt more useful. The dbus-gnt script works fairly
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
86 return NULL; |
5e1412f4e67a
Do some work to make pygnt more useful. The dbus-gnt script works fairly
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
87 } |
5e1412f4e67a
Do some work to make pygnt more useful. The dbus-gnt script works fairly
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
88 list = g_list_prepend(list, PyString_AsString(item)); |
5e1412f4e67a
Do some work to make pygnt more useful. The dbus-gnt script works fairly
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
89 Py_DECREF(item); |
5e1412f4e67a
Do some work to make pygnt more useful. The dbus-gnt script works fairly
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
90 } |
5e1412f4e67a
Do some work to make pygnt more useful. The dbus-gnt script works fairly
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
91 |
5e1412f4e67a
Do some work to make pygnt more useful. The dbus-gnt script works fairly
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
92 list = g_list_reverse(list); |
5e1412f4e67a
Do some work to make pygnt more useful. The dbus-gnt script works fairly
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
93 row = gnt_tree_create_row_from_list(GNT_TREE(self->obj), list); |
5e1412f4e67a
Do some work to make pygnt more useful. The dbus-gnt script works fairly
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
94 gnt_tree_add_row_after(GNT_TREE(self->obj), |
5e1412f4e67a
Do some work to make pygnt more useful. The dbus-gnt script works fairly
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
95 key, |
5e1412f4e67a
Do some work to make pygnt more useful. The dbus-gnt script works fairly
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
96 row, |
5e1412f4e67a
Do some work to make pygnt more useful. The dbus-gnt script works fairly
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
97 parent, bigbro); |
5e1412f4e67a
Do some work to make pygnt more useful. The dbus-gnt script works fairly
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
98 g_list_free(list); |
5e1412f4e67a
Do some work to make pygnt more useful. The dbus-gnt script works fairly
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
99 |
5e1412f4e67a
Do some work to make pygnt more useful. The dbus-gnt script works fairly
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
100 Py_INCREF(Py_None); |
5e1412f4e67a
Do some work to make pygnt more useful. The dbus-gnt script works fairly
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
101 return Py_None; |
5e1412f4e67a
Do some work to make pygnt more useful. The dbus-gnt script works fairly
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
102 } |
18679
6b16fca71f8b
Add some more functions for GntTree. One point to note is that the key
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
18556
diff
changeset
|
103 %% |
6b16fca71f8b
Add some more functions for GntTree. One point to note is that the key
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
18556
diff
changeset
|
104 override gnt_tree_get_selection_data noargs |
6b16fca71f8b
Add some more functions for GntTree. One point to note is that the key
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
18556
diff
changeset
|
105 static PyObject * |
6b16fca71f8b
Add some more functions for GntTree. One point to note is that the key
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
18556
diff
changeset
|
106 _wrap_gnt_tree_get_selection_data(PyGObject *self) |
6b16fca71f8b
Add some more functions for GntTree. One point to note is that the key
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
18556
diff
changeset
|
107 { |
6b16fca71f8b
Add some more functions for GntTree. One point to note is that the key
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
18556
diff
changeset
|
108 PyObject *ret = gnt_tree_get_selection_data(GNT_TREE(self->obj)); |
6b16fca71f8b
Add some more functions for GntTree. One point to note is that the key
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
18556
diff
changeset
|
109 if (!ret) |
6b16fca71f8b
Add some more functions for GntTree. One point to note is that the key
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
18556
diff
changeset
|
110 ret = Py_None; |
6b16fca71f8b
Add some more functions for GntTree. One point to note is that the key
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
18556
diff
changeset
|
111 Py_INCREF(ret); |
6b16fca71f8b
Add some more functions for GntTree. One point to note is that the key
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
18556
diff
changeset
|
112 return ret; |
6b16fca71f8b
Add some more functions for GntTree. One point to note is that the key
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
18556
diff
changeset
|
113 } |
6b16fca71f8b
Add some more functions for GntTree. One point to note is that the key
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
18556
diff
changeset
|
114 %% |
6b16fca71f8b
Add some more functions for GntTree. One point to note is that the key
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
18556
diff
changeset
|
115 override gnt_tree_change_text |
6b16fca71f8b
Add some more functions for GntTree. One point to note is that the key
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
18556
diff
changeset
|
116 static PyObject * |
6b16fca71f8b
Add some more functions for GntTree. One point to note is that the key
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
18556
diff
changeset
|
117 _wrap_gnt_tree_change_text(PyGObject *self, PyObject *args, PyObject *kwargs) |
6b16fca71f8b
Add some more functions for GntTree. One point to note is that the key
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
18556
diff
changeset
|
118 { |
18682
254823d66aa5
The promised cleanups.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
18679
diff
changeset
|
119 static char *kwlist[] = { "key", "colno", "text", NULL }; |
254823d66aa5
The promised cleanups.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
18679
diff
changeset
|
120 char *text; |
18679
6b16fca71f8b
Add some more functions for GntTree. One point to note is that the key
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
18556
diff
changeset
|
121 int colno; |
6b16fca71f8b
Add some more functions for GntTree. One point to note is that the key
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
18556
diff
changeset
|
122 gpointer key; |
18556
5e1412f4e67a
Do some work to make pygnt more useful. The dbus-gnt script works fairly
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
123 |
18682
254823d66aa5
The promised cleanups.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
18679
diff
changeset
|
124 if (!PyArg_ParseTupleAndKeywords(args, kwargs,"Ois:GntTree.change_text", kwlist, &key, &colno, &text)) |
254823d66aa5
The promised cleanups.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
18679
diff
changeset
|
125 return NULL; |
254823d66aa5
The promised cleanups.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
18679
diff
changeset
|
126 |
254823d66aa5
The promised cleanups.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
18679
diff
changeset
|
127 gnt_tree_change_text(GNT_TREE(self->obj), key, colno, text); |
254823d66aa5
The promised cleanups.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
18679
diff
changeset
|
128 |
254823d66aa5
The promised cleanups.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
18679
diff
changeset
|
129 Py_INCREF(Py_None); |
254823d66aa5
The promised cleanups.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
18679
diff
changeset
|
130 return Py_None; |
18679
6b16fca71f8b
Add some more functions for GntTree. One point to note is that the key
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
18556
diff
changeset
|
131 } |
6b16fca71f8b
Add some more functions for GntTree. One point to note is that the key
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
18556
diff
changeset
|
132 %% |
6b16fca71f8b
Add some more functions for GntTree. One point to note is that the key
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
18556
diff
changeset
|
133 override gnt_tree_set_row_flags |
6b16fca71f8b
Add some more functions for GntTree. One point to note is that the key
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
18556
diff
changeset
|
134 static PyObject * |
6b16fca71f8b
Add some more functions for GntTree. One point to note is that the key
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
18556
diff
changeset
|
135 _wrap_gnt_tree_set_row_flags(PyGObject *self, PyObject *args, PyObject *kwargs) |
6b16fca71f8b
Add some more functions for GntTree. One point to note is that the key
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
18556
diff
changeset
|
136 { |
18682
254823d66aa5
The promised cleanups.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
18679
diff
changeset
|
137 static char *kwlist[] = { "key", "flag", NULL }; |
18679
6b16fca71f8b
Add some more functions for GntTree. One point to note is that the key
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
18556
diff
changeset
|
138 int flag; |
6b16fca71f8b
Add some more functions for GntTree. One point to note is that the key
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
18556
diff
changeset
|
139 gpointer key; |
6b16fca71f8b
Add some more functions for GntTree. One point to note is that the key
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
18556
diff
changeset
|
140 |
18682
254823d66aa5
The promised cleanups.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
18679
diff
changeset
|
141 if (!PyArg_ParseTupleAndKeywords(args, kwargs,"Oi:GntTree.set_row_flags", kwlist, &key, &flag)) |
254823d66aa5
The promised cleanups.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
18679
diff
changeset
|
142 return NULL; |
254823d66aa5
The promised cleanups.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
18679
diff
changeset
|
143 |
254823d66aa5
The promised cleanups.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
18679
diff
changeset
|
144 gnt_tree_set_row_flags(GNT_TREE(self->obj), key, flag); |
254823d66aa5
The promised cleanups.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
18679
diff
changeset
|
145 |
254823d66aa5
The promised cleanups.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
18679
diff
changeset
|
146 Py_INCREF(Py_None); |
254823d66aa5
The promised cleanups.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
18679
diff
changeset
|
147 return Py_None; |
18679
6b16fca71f8b
Add some more functions for GntTree. One point to note is that the key
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
18556
diff
changeset
|
148 } |
6b16fca71f8b
Add some more functions for GntTree. One point to note is that the key
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
18556
diff
changeset
|
149 %% |
6b16fca71f8b
Add some more functions for GntTree. One point to note is that the key
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
18556
diff
changeset
|
150 override gnt_tree_remove |
6b16fca71f8b
Add some more functions for GntTree. One point to note is that the key
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
18556
diff
changeset
|
151 static PyObject * |
6b16fca71f8b
Add some more functions for GntTree. One point to note is that the key
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
18556
diff
changeset
|
152 _wrap_gnt_tree_remove(PyGObject *self, PyObject *args, PyObject *kwargs) |
6b16fca71f8b
Add some more functions for GntTree. One point to note is that the key
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
18556
diff
changeset
|
153 { |
18682
254823d66aa5
The promised cleanups.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
18679
diff
changeset
|
154 static char *kwlist[] = { "key", NULL }; |
18679
6b16fca71f8b
Add some more functions for GntTree. One point to note is that the key
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
18556
diff
changeset
|
155 gpointer key; |
6b16fca71f8b
Add some more functions for GntTree. One point to note is that the key
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
18556
diff
changeset
|
156 |
18682
254823d66aa5
The promised cleanups.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
18679
diff
changeset
|
157 if (!PyArg_ParseTupleAndKeywords(args, kwargs,"O:GntTree.remove", kwlist, &key)) |
254823d66aa5
The promised cleanups.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
18679
diff
changeset
|
158 return NULL; |
254823d66aa5
The promised cleanups.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
18679
diff
changeset
|
159 |
254823d66aa5
The promised cleanups.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
18679
diff
changeset
|
160 gnt_tree_remove(GNT_TREE(self->obj), key); |
254823d66aa5
The promised cleanups.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
18679
diff
changeset
|
161 |
254823d66aa5
The promised cleanups.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
18679
diff
changeset
|
162 Py_INCREF(Py_None); |
254823d66aa5
The promised cleanups.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
18679
diff
changeset
|
163 return Py_None; |
18679
6b16fca71f8b
Add some more functions for GntTree. One point to note is that the key
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
18556
diff
changeset
|
164 } |
18730
54a28e05e8af
Export another tree function.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
18682
diff
changeset
|
165 %% |
54a28e05e8af
Export another tree function.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
18682
diff
changeset
|
166 override gnt_tree_set_selected |
54a28e05e8af
Export another tree function.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
18682
diff
changeset
|
167 static PyObject * |
54a28e05e8af
Export another tree function.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
18682
diff
changeset
|
168 _wrap_gnt_tree_set_selected(PyGObject *self, PyObject *args) |
54a28e05e8af
Export another tree function.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
18682
diff
changeset
|
169 { |
54a28e05e8af
Export another tree function.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
18682
diff
changeset
|
170 gpointer key; |
54a28e05e8af
Export another tree function.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
18682
diff
changeset
|
171 if (!PyArg_ParseTuple(args, "O:GntTree.set_selected", &key)) { |
54a28e05e8af
Export another tree function.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
18682
diff
changeset
|
172 return NULL; |
54a28e05e8af
Export another tree function.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
18682
diff
changeset
|
173 } |
54a28e05e8af
Export another tree function.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
18682
diff
changeset
|
174 gnt_tree_set_selected(GNT_TREE(self->obj), key); |
54a28e05e8af
Export another tree function.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
18682
diff
changeset
|
175 Py_INCREF(Py_None); |
54a28e05e8af
Export another tree function.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
18682
diff
changeset
|
176 return Py_None; |
54a28e05e8af
Export another tree function.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
18682
diff
changeset
|
177 } |
54a28e05e8af
Export another tree function.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
18682
diff
changeset
|
178 |