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