annotate finch/libgnt/pygnt/gnt.override @ 18724:bfa12b00f54b

Export gnt_widget_get_size for pygnt. I tried to export _register_action, but it doesn't work.
author Sadrul Habib Chowdhury <imadil@gmail.com>
date Mon, 30 Jul 2007 20:24:04 +0000
parents 7389b597a812
children fae29ba432c8
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
15932
8fd5ab3f9716 python bindings for libgnt. dbus-gnt is a gnt-ui (sort of) for gaim over dbus. It allows continuing with the currently opened conversations. pygnt/README.txt explains what to do. Use at your own risk.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff changeset
1 %%
8fd5ab3f9716 python bindings for libgnt. dbus-gnt is a gnt-ui (sort of) for gaim over dbus. It allows continuing with the currently opened conversations. pygnt/README.txt explains what to do. Use at your own risk.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff changeset
2 headers
8fd5ab3f9716 python bindings for libgnt. dbus-gnt is a gnt-ui (sort of) for gaim over dbus. It allows continuing with the currently opened conversations. pygnt/README.txt explains what to do. Use at your own risk.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff changeset
3 #include <Python.h>
8fd5ab3f9716 python bindings for libgnt. dbus-gnt is a gnt-ui (sort of) for gaim over dbus. It allows continuing with the currently opened conversations. pygnt/README.txt explains what to do. Use at your own risk.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff changeset
4 #include "pygobject.h"
8fd5ab3f9716 python bindings for libgnt. dbus-gnt is a gnt-ui (sort of) for gaim over dbus. It allows continuing with the currently opened conversations. pygnt/README.txt explains what to do. Use at your own risk.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff changeset
5 #include "gnt.h"
8fd5ab3f9716 python bindings for libgnt. dbus-gnt is a gnt-ui (sort of) for gaim over dbus. It allows continuing with the currently opened conversations. pygnt/README.txt explains what to do. Use at your own risk.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff changeset
6 #include "gntbindable.h"
8fd5ab3f9716 python bindings for libgnt. dbus-gnt is a gnt-ui (sort of) for gaim over dbus. It allows continuing with the currently opened conversations. pygnt/README.txt explains what to do. Use at your own risk.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff changeset
7 #include "gntwidget.h"
8fd5ab3f9716 python bindings for libgnt. dbus-gnt is a gnt-ui (sort of) for gaim over dbus. It allows continuing with the currently opened conversations. pygnt/README.txt explains what to do. Use at your own risk.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff changeset
8 #include "gntbox.h"
8fd5ab3f9716 python bindings for libgnt. dbus-gnt is a gnt-ui (sort of) for gaim over dbus. It allows continuing with the currently opened conversations. pygnt/README.txt explains what to do. Use at your own risk.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff changeset
9 #include "gntbutton.h"
8fd5ab3f9716 python bindings for libgnt. dbus-gnt is a gnt-ui (sort of) for gaim over dbus. It allows continuing with the currently opened conversations. pygnt/README.txt explains what to do. Use at your own risk.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff changeset
10 #include "gntcheckbox.h"
8fd5ab3f9716 python bindings for libgnt. dbus-gnt is a gnt-ui (sort of) for gaim over dbus. It allows continuing with the currently opened conversations. pygnt/README.txt explains what to do. Use at your own risk.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff changeset
11 #include "gntcolors.h"
8fd5ab3f9716 python bindings for libgnt. dbus-gnt is a gnt-ui (sort of) for gaim over dbus. It allows continuing with the currently opened conversations. pygnt/README.txt explains what to do. Use at your own risk.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff changeset
12 #include "gntcombobox.h"
8fd5ab3f9716 python bindings for libgnt. dbus-gnt is a gnt-ui (sort of) for gaim over dbus. It allows continuing with the currently opened conversations. pygnt/README.txt explains what to do. Use at your own risk.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff changeset
13 #include "gntentry.h"
8fd5ab3f9716 python bindings for libgnt. dbus-gnt is a gnt-ui (sort of) for gaim over dbus. It allows continuing with the currently opened conversations. pygnt/README.txt explains what to do. Use at your own risk.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff changeset
14 #include "gntfilesel.h"
8fd5ab3f9716 python bindings for libgnt. dbus-gnt is a gnt-ui (sort of) for gaim over dbus. It allows continuing with the currently opened conversations. pygnt/README.txt explains what to do. Use at your own risk.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff changeset
15 #include "gntkeys.h"
8fd5ab3f9716 python bindings for libgnt. dbus-gnt is a gnt-ui (sort of) for gaim over dbus. It allows continuing with the currently opened conversations. pygnt/README.txt explains what to do. Use at your own risk.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff changeset
16 #include "gntlabel.h"
8fd5ab3f9716 python bindings for libgnt. dbus-gnt is a gnt-ui (sort of) for gaim over dbus. It allows continuing with the currently opened conversations. pygnt/README.txt explains what to do. Use at your own risk.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff changeset
17 #include "gntline.h"
8fd5ab3f9716 python bindings for libgnt. dbus-gnt is a gnt-ui (sort of) for gaim over dbus. It allows continuing with the currently opened conversations. pygnt/README.txt explains what to do. Use at your own risk.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff changeset
18 #include "gntmenu.h"
8fd5ab3f9716 python bindings for libgnt. dbus-gnt is a gnt-ui (sort of) for gaim over dbus. It allows continuing with the currently opened conversations. pygnt/README.txt explains what to do. Use at your own risk.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff changeset
19 #include "gntmenuitem.h"
8fd5ab3f9716 python bindings for libgnt. dbus-gnt is a gnt-ui (sort of) for gaim over dbus. It allows continuing with the currently opened conversations. pygnt/README.txt explains what to do. Use at your own risk.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff changeset
20 #include "gntmenuitemcheck.h"
18556
5e1412f4e67a Do some work to make pygnt more useful. The dbus-gnt script works fairly
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 15932
diff changeset
21 #include "gntslider.h"
15932
8fd5ab3f9716 python bindings for libgnt. dbus-gnt is a gnt-ui (sort of) for gaim over dbus. It allows continuing with the currently opened conversations. pygnt/README.txt explains what to do. Use at your own risk.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff changeset
22 #include "gntstyle.h"
8fd5ab3f9716 python bindings for libgnt. dbus-gnt is a gnt-ui (sort of) for gaim over dbus. It allows continuing with the currently opened conversations. pygnt/README.txt explains what to do. Use at your own risk.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff changeset
23 #include "gnttextview.h"
8fd5ab3f9716 python bindings for libgnt. dbus-gnt is a gnt-ui (sort of) for gaim over dbus. It allows continuing with the currently opened conversations. pygnt/README.txt explains what to do. Use at your own risk.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff changeset
24 #include "gnttree.h"
8fd5ab3f9716 python bindings for libgnt. dbus-gnt is a gnt-ui (sort of) for gaim over dbus. It allows continuing with the currently opened conversations. pygnt/README.txt explains what to do. Use at your own risk.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff changeset
25 #include "gntutils.h"
8fd5ab3f9716 python bindings for libgnt. dbus-gnt is a gnt-ui (sort of) for gaim over dbus. It allows continuing with the currently opened conversations. pygnt/README.txt explains what to do. Use at your own risk.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff changeset
26 #include "gntwindow.h"
8fd5ab3f9716 python bindings for libgnt. dbus-gnt is a gnt-ui (sort of) for gaim over dbus. It allows continuing with the currently opened conversations. pygnt/README.txt explains what to do. Use at your own risk.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff changeset
27 #include "gntwm.h"
18556
5e1412f4e67a Do some work to make pygnt more useful. The dbus-gnt script works fairly
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 15932
diff changeset
28 #include "gntws.h"
5e1412f4e67a Do some work to make pygnt more useful. The dbus-gnt script works fairly
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 15932
diff changeset
29 #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: 15932
diff changeset
30 %%
5e1412f4e67a Do some work to make pygnt more useful. The dbus-gnt script works fairly
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 15932
diff changeset
31 include
18721
7389b597a812 This gets rid of more weird crashes.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 18718
diff changeset
32 gntbox.override
18556
5e1412f4e67a Do some work to make pygnt more useful. The dbus-gnt script works fairly
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 15932
diff changeset
33 gntfilesel.override
5e1412f4e67a Do some work to make pygnt more useful. The dbus-gnt script works fairly
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 15932
diff changeset
34 gnttree.override
18724
bfa12b00f54b Export gnt_widget_get_size for pygnt.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 18721
diff changeset
35 gntwidget.override
15932
8fd5ab3f9716 python bindings for libgnt. dbus-gnt is a gnt-ui (sort of) for gaim over dbus. It allows continuing with the currently opened conversations. pygnt/README.txt explains what to do. Use at your own risk.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff changeset
36 %%
8fd5ab3f9716 python bindings for libgnt. dbus-gnt is a gnt-ui (sort of) for gaim over dbus. It allows continuing with the currently opened conversations. pygnt/README.txt explains what to do. Use at your own risk.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff changeset
37 modulename gnt
8fd5ab3f9716 python bindings for libgnt. dbus-gnt is a gnt-ui (sort of) for gaim over dbus. It allows continuing with the currently opened conversations. pygnt/README.txt explains what to do. Use at your own risk.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff changeset
38 %%
8fd5ab3f9716 python bindings for libgnt. dbus-gnt is a gnt-ui (sort of) for gaim over dbus. It allows continuing with the currently opened conversations. pygnt/README.txt explains what to do. Use at your own risk.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff changeset
39 import gobject.GObject as PyGObject_Type
8fd5ab3f9716 python bindings for libgnt. dbus-gnt is a gnt-ui (sort of) for gaim over dbus. It allows continuing with the currently opened conversations. pygnt/README.txt explains what to do. Use at your own risk.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff changeset
40 %%
8fd5ab3f9716 python bindings for libgnt. dbus-gnt is a gnt-ui (sort of) for gaim over dbus. It allows continuing with the currently opened conversations. pygnt/README.txt explains what to do. Use at your own risk.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff changeset
41 ignore-glob
8fd5ab3f9716 python bindings for libgnt. dbus-gnt is a gnt-ui (sort of) for gaim over dbus. It allows continuing with the currently opened conversations. pygnt/README.txt explains what to do. Use at your own risk.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff changeset
42 *_get_gtype
8fd5ab3f9716 python bindings for libgnt. dbus-gnt is a gnt-ui (sort of) for gaim over dbus. It allows continuing with the currently opened conversations. pygnt/README.txt explains what to do. Use at your own risk.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff changeset
43 %%
18717
d3542cffbb42 Allow un/setting flags for widgets.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 18556
diff changeset
44 define set_flag
d3542cffbb42 Allow un/setting flags for widgets.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 18556
diff changeset
45 static PyObject *
d3542cffbb42 Allow un/setting flags for widgets.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 18556
diff changeset
46 _wrap_set_flag(PyGObject *self, PyObject *args, PyObject *kwargs)
d3542cffbb42 Allow un/setting flags for widgets.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 18556
diff changeset
47 {
d3542cffbb42 Allow un/setting flags for widgets.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 18556
diff changeset
48 static char *kwlist[] = {"flags", NULL};
d3542cffbb42 Allow un/setting flags for widgets.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 18556
diff changeset
49 PyGObject *widget;
d3542cffbb42 Allow un/setting flags for widgets.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 18556
diff changeset
50 int flags;
d3542cffbb42 Allow un/setting flags for widgets.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 18556
diff changeset
51
d3542cffbb42 Allow un/setting flags for widgets.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 18556
diff changeset
52 if (!PyArg_ParseTuple(args, "O!i:gnt.set_flag", &PyGntWidget_Type, &widget,
d3542cffbb42 Allow un/setting flags for widgets.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 18556
diff changeset
53 &flags)) {
d3542cffbb42 Allow un/setting flags for widgets.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 18556
diff changeset
54 return NULL;
d3542cffbb42 Allow un/setting flags for widgets.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 18556
diff changeset
55 }
d3542cffbb42 Allow un/setting flags for widgets.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 18556
diff changeset
56
d3542cffbb42 Allow un/setting flags for widgets.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 18556
diff changeset
57 GNT_WIDGET_SET_FLAGS(widget->obj, flags);
d3542cffbb42 Allow un/setting flags for widgets.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 18556
diff changeset
58
d3542cffbb42 Allow un/setting flags for widgets.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 18556
diff changeset
59 Py_INCREF(Py_None);
d3542cffbb42 Allow un/setting flags for widgets.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 18556
diff changeset
60 return Py_None;
d3542cffbb42 Allow un/setting flags for widgets.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 18556
diff changeset
61 }
d3542cffbb42 Allow un/setting flags for widgets.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 18556
diff changeset
62 %%
d3542cffbb42 Allow un/setting flags for widgets.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 18556
diff changeset
63 define unset_flag
d3542cffbb42 Allow un/setting flags for widgets.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 18556
diff changeset
64 static PyObject *
d3542cffbb42 Allow un/setting flags for widgets.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 18556
diff changeset
65 _wrap_unset_flag(PyGObject *self, PyObject *args, PyObject *kwargs)
d3542cffbb42 Allow un/setting flags for widgets.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 18556
diff changeset
66 {
d3542cffbb42 Allow un/setting flags for widgets.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 18556
diff changeset
67 static char *kwlist[] = {"flags", NULL};
d3542cffbb42 Allow un/setting flags for widgets.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 18556
diff changeset
68 PyGObject *widget;
d3542cffbb42 Allow un/setting flags for widgets.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 18556
diff changeset
69 int flags;
d3542cffbb42 Allow un/setting flags for widgets.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 18556
diff changeset
70
d3542cffbb42 Allow un/setting flags for widgets.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 18556
diff changeset
71 if (!PyArg_ParseTuple(args, "O!i:gnt.unset_flag", &PyGntWidget_Type, &widget,
d3542cffbb42 Allow un/setting flags for widgets.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 18556
diff changeset
72 &flags)) {
d3542cffbb42 Allow un/setting flags for widgets.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 18556
diff changeset
73 return NULL;
d3542cffbb42 Allow un/setting flags for widgets.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 18556
diff changeset
74 }
d3542cffbb42 Allow un/setting flags for widgets.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 18556
diff changeset
75
d3542cffbb42 Allow un/setting flags for widgets.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 18556
diff changeset
76 GNT_WIDGET_UNSET_FLAGS(widget->obj, flags);
d3542cffbb42 Allow un/setting flags for widgets.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 18556
diff changeset
77
d3542cffbb42 Allow un/setting flags for widgets.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 18556
diff changeset
78 Py_INCREF(Py_None);
d3542cffbb42 Allow un/setting flags for widgets.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 18556
diff changeset
79 return Py_None;
d3542cffbb42 Allow un/setting flags for widgets.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 18556
diff changeset
80 }
18718
1ad1a4e8dfea Add function to get the screen size.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 18717
diff changeset
81 %%
1ad1a4e8dfea Add function to get the screen size.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 18717
diff changeset
82 define screen_size noargs
1ad1a4e8dfea Add function to get the screen size.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 18717
diff changeset
83 static PyObject *
1ad1a4e8dfea Add function to get the screen size.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 18717
diff changeset
84 _wrap_screen_size(PyObject *self)
1ad1a4e8dfea Add function to get the screen size.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 18717
diff changeset
85 {
1ad1a4e8dfea Add function to get the screen size.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 18717
diff changeset
86 PyObject *list = PyList_New(0);
18717
d3542cffbb42 Allow un/setting flags for widgets.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 18556
diff changeset
87
18718
1ad1a4e8dfea Add function to get the screen size.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 18717
diff changeset
88 if (list == NULL)
1ad1a4e8dfea Add function to get the screen size.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 18717
diff changeset
89 return NULL;
18717
d3542cffbb42 Allow un/setting flags for widgets.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 18556
diff changeset
90
18718
1ad1a4e8dfea Add function to get the screen size.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 18717
diff changeset
91 PyList_Append(list, PyInt_FromLong((long)getmaxx(stdscr)));
1ad1a4e8dfea Add function to get the screen size.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 18717
diff changeset
92 PyList_Append(list, PyInt_FromLong((long)getmaxy(stdscr)));
1ad1a4e8dfea Add function to get the screen size.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 18717
diff changeset
93
1ad1a4e8dfea Add function to get the screen size.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 18717
diff changeset
94 return list;
1ad1a4e8dfea Add function to get the screen size.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 18717
diff changeset
95 }
18724
bfa12b00f54b Export gnt_widget_get_size for pygnt.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 18721
diff changeset
96 %%
bfa12b00f54b Export gnt_widget_get_size for pygnt.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 18721
diff changeset
97 override gnt_register_action
bfa12b00f54b Export gnt_widget_get_size for pygnt.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 18721
diff changeset
98 static GHashTable *actions;
18718
1ad1a4e8dfea Add function to get the screen size.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 18717
diff changeset
99
18724
bfa12b00f54b Export gnt_widget_get_size for pygnt.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 18721
diff changeset
100
bfa12b00f54b Export gnt_widget_get_size for pygnt.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 18721
diff changeset
101
bfa12b00f54b Export gnt_widget_get_size for pygnt.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 18721
diff changeset
102 static PyObject *
bfa12b00f54b Export gnt_widget_get_size for pygnt.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 18721
diff changeset
103 _wrap_gnt_register_action(PyGObject *self, PyObject *args, PyObject *kwargs)
bfa12b00f54b Export gnt_widget_get_size for pygnt.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 18721
diff changeset
104 {
bfa12b00f54b Export gnt_widget_get_size for pygnt.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 18721
diff changeset
105 static char *kwlist[] = {"name", "callback", NULL};
bfa12b00f54b Export gnt_widget_get_size for pygnt.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 18721
diff changeset
106 PyGObject *callback;
bfa12b00f54b Export gnt_widget_get_size for pygnt.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 18721
diff changeset
107 GClosure *closure;
bfa12b00f54b Export gnt_widget_get_size for pygnt.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 18721
diff changeset
108 char *name;
bfa12b00f54b Export gnt_widget_get_size for pygnt.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 18721
diff changeset
109
bfa12b00f54b Export gnt_widget_get_size for pygnt.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 18721
diff changeset
110 if (!PyArg_ParseTuple(args, "sO:gnt.gnt_register_action", &name, &callback)) {
bfa12b00f54b Export gnt_widget_get_size for pygnt.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 18721
diff changeset
111 return NULL;
bfa12b00f54b Export gnt_widget_get_size for pygnt.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 18721
diff changeset
112 }
bfa12b00f54b Export gnt_widget_get_size for pygnt.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 18721
diff changeset
113
bfa12b00f54b Export gnt_widget_get_size for pygnt.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 18721
diff changeset
114 if (!PyCallable_Check(callback)) {
bfa12b00f54b Export gnt_widget_get_size for pygnt.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 18721
diff changeset
115 PyErr_SetString(PyExc_TypeError, "the callback must be callable ... doh!");
bfa12b00f54b Export gnt_widget_get_size for pygnt.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 18721
diff changeset
116 return NULL;
bfa12b00f54b Export gnt_widget_get_size for pygnt.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 18721
diff changeset
117 }
bfa12b00f54b Export gnt_widget_get_size for pygnt.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 18721
diff changeset
118
bfa12b00f54b Export gnt_widget_get_size for pygnt.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 18721
diff changeset
119 gnt_register_action(name, callback->obj);
bfa12b00f54b Export gnt_widget_get_size for pygnt.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 18721
diff changeset
120
bfa12b00f54b Export gnt_widget_get_size for pygnt.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 18721
diff changeset
121 Py_INCREF(Py_None);
bfa12b00f54b Export gnt_widget_get_size for pygnt.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 18721
diff changeset
122 return Py_None;
bfa12b00f54b Export gnt_widget_get_size for pygnt.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 18721
diff changeset
123 }
bfa12b00f54b Export gnt_widget_get_size for pygnt.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 18721
diff changeset
124