annotate finch/libgnt/pygnt/gntmodule.c @ 21512:166b7949be3d

Compile when plugins are disabled
author Mark Doliner <mark@kingant.net>
date Wed, 14 Nov 2007 23:09:03 +0000
parents dc129248eb7c
children
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 #include <pygobject.h>
20710
dc129248eb7c Make the key-codes available in the python binding.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 18682
diff changeset
2 #include "gnt.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
3
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 void gnt_register_classes (PyObject *d);
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 extern PyMethodDef gnt_functions[];
20710
dc129248eb7c Make the key-codes available in the python binding.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 18682
diff changeset
6
dc129248eb7c Make the key-codes available in the python binding.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 18682
diff changeset
7 static void
dc129248eb7c Make the key-codes available in the python binding.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 18682
diff changeset
8 gnt_add_string_constants(PyObject *module)
dc129248eb7c Make the key-codes available in the python binding.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 18682
diff changeset
9 {
dc129248eb7c Make the key-codes available in the python binding.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 18682
diff changeset
10 #define define_key(x) if (GNT_KEY_##x && *(GNT_KEY_##x)) PyModule_AddStringConstant(module, "KEY_" #x, GNT_KEY_##x)
dc129248eb7c Make the key-codes available in the python binding.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 18682
diff changeset
11
dc129248eb7c Make the key-codes available in the python binding.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 18682
diff changeset
12 define_key(POPUP);
dc129248eb7c Make the key-codes available in the python binding.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 18682
diff changeset
13
dc129248eb7c Make the key-codes available in the python binding.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 18682
diff changeset
14 define_key(LEFT);
dc129248eb7c Make the key-codes available in the python binding.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 18682
diff changeset
15 define_key(RIGHT);
dc129248eb7c Make the key-codes available in the python binding.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 18682
diff changeset
16 define_key(UP);
dc129248eb7c Make the key-codes available in the python binding.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 18682
diff changeset
17 define_key(DOWN);
dc129248eb7c Make the key-codes available in the python binding.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 18682
diff changeset
18
dc129248eb7c Make the key-codes available in the python binding.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 18682
diff changeset
19 define_key(CTRL_UP);
dc129248eb7c Make the key-codes available in the python binding.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 18682
diff changeset
20 define_key(CTRL_DOWN);
dc129248eb7c Make the key-codes available in the python binding.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 18682
diff changeset
21 define_key(CTRL_RIGHT);
dc129248eb7c Make the key-codes available in the python binding.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 18682
diff changeset
22 define_key(CTRL_LEFT);
dc129248eb7c Make the key-codes available in the python binding.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 18682
diff changeset
23
dc129248eb7c Make the key-codes available in the python binding.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 18682
diff changeset
24 define_key(PGUP);
dc129248eb7c Make the key-codes available in the python binding.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 18682
diff changeset
25 define_key(PGDOWN);
dc129248eb7c Make the key-codes available in the python binding.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 18682
diff changeset
26 define_key(HOME);
dc129248eb7c Make the key-codes available in the python binding.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 18682
diff changeset
27 define_key(END);
dc129248eb7c Make the key-codes available in the python binding.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 18682
diff changeset
28
dc129248eb7c Make the key-codes available in the python binding.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 18682
diff changeset
29 define_key(ENTER);
dc129248eb7c Make the key-codes available in the python binding.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 18682
diff changeset
30
dc129248eb7c Make the key-codes available in the python binding.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 18682
diff changeset
31 define_key(BACKSPACE);
dc129248eb7c Make the key-codes available in the python binding.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 18682
diff changeset
32 define_key(DEL);
dc129248eb7c Make the key-codes available in the python binding.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 18682
diff changeset
33 define_key(INS);
dc129248eb7c Make the key-codes available in the python binding.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 18682
diff changeset
34 define_key(BACK_TAB);
dc129248eb7c Make the key-codes available in the python binding.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 18682
diff changeset
35
dc129248eb7c Make the key-codes available in the python binding.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 18682
diff changeset
36 define_key(CTRL_A);
dc129248eb7c Make the key-codes available in the python binding.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 18682
diff changeset
37 define_key(CTRL_B);
dc129248eb7c Make the key-codes available in the python binding.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 18682
diff changeset
38 define_key(CTRL_D);
dc129248eb7c Make the key-codes available in the python binding.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 18682
diff changeset
39 define_key(CTRL_E);
dc129248eb7c Make the key-codes available in the python binding.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 18682
diff changeset
40 define_key(CTRL_F);
dc129248eb7c Make the key-codes available in the python binding.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 18682
diff changeset
41 define_key(CTRL_G);
dc129248eb7c Make the key-codes available in the python binding.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 18682
diff changeset
42 define_key(CTRL_H);
dc129248eb7c Make the key-codes available in the python binding.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 18682
diff changeset
43 define_key(CTRL_I);
dc129248eb7c Make the key-codes available in the python binding.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 18682
diff changeset
44 define_key(CTRL_J);
dc129248eb7c Make the key-codes available in the python binding.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 18682
diff changeset
45 define_key(CTRL_K);
dc129248eb7c Make the key-codes available in the python binding.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 18682
diff changeset
46 define_key(CTRL_L);
dc129248eb7c Make the key-codes available in the python binding.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 18682
diff changeset
47 define_key(CTRL_M);
dc129248eb7c Make the key-codes available in the python binding.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 18682
diff changeset
48 define_key(CTRL_N);
dc129248eb7c Make the key-codes available in the python binding.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 18682
diff changeset
49 define_key(CTRL_O);
dc129248eb7c Make the key-codes available in the python binding.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 18682
diff changeset
50 define_key(CTRL_P);
dc129248eb7c Make the key-codes available in the python binding.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 18682
diff changeset
51 define_key(CTRL_R);
dc129248eb7c Make the key-codes available in the python binding.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 18682
diff changeset
52 define_key(CTRL_T);
dc129248eb7c Make the key-codes available in the python binding.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 18682
diff changeset
53 define_key(CTRL_U);
dc129248eb7c Make the key-codes available in the python binding.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 18682
diff changeset
54 define_key(CTRL_V);
dc129248eb7c Make the key-codes available in the python binding.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 18682
diff changeset
55 define_key(CTRL_W);
dc129248eb7c Make the key-codes available in the python binding.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 18682
diff changeset
56 define_key(CTRL_X);
dc129248eb7c Make the key-codes available in the python binding.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 18682
diff changeset
57 define_key(CTRL_Y);
dc129248eb7c Make the key-codes available in the python binding.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 18682
diff changeset
58
dc129248eb7c Make the key-codes available in the python binding.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 18682
diff changeset
59 define_key(F1);
dc129248eb7c Make the key-codes available in the python binding.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 18682
diff changeset
60 define_key(F2);
dc129248eb7c Make the key-codes available in the python binding.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 18682
diff changeset
61 define_key(F3);
dc129248eb7c Make the key-codes available in the python binding.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 18682
diff changeset
62 define_key(F4);
dc129248eb7c Make the key-codes available in the python binding.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 18682
diff changeset
63 define_key(F5);
dc129248eb7c Make the key-codes available in the python binding.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 18682
diff changeset
64 define_key(F6);
dc129248eb7c Make the key-codes available in the python binding.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 18682
diff changeset
65 define_key(F7);
dc129248eb7c Make the key-codes available in the python binding.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 18682
diff changeset
66 define_key(F8);
dc129248eb7c Make the key-codes available in the python binding.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 18682
diff changeset
67 define_key(F9);
dc129248eb7c Make the key-codes available in the python binding.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 18682
diff changeset
68 define_key(F10);
dc129248eb7c Make the key-codes available in the python binding.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 18682
diff changeset
69 define_key(F11);
dc129248eb7c Make the key-codes available in the python binding.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 18682
diff changeset
70 define_key(F12);
dc129248eb7c Make the key-codes available in the python binding.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 18682
diff changeset
71 }
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
72
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
73 DL_EXPORT(void)
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
74 initgnt(void)
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
75 {
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
76 PyObject *m, *d;
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
77
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
78 init_pygobject ();
18679
6b16fca71f8b Add some more functions for GntTree. One point to note is that the key
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 15932
diff changeset
79
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
80 m = Py_InitModule ("gnt", gnt_functions);
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
81 d = PyModule_GetDict (m);
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
82
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
83 gnt_register_classes (d);
18679
6b16fca71f8b Add some more functions for GntTree. One point to note is that the key
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 15932
diff changeset
84 gnt_add_constants(m, "GNT_");
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
85
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
86 if (PyErr_Occurred ()) {
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
87 Py_FatalError ("can't initialise module sad");
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
88 }
20710
dc129248eb7c Make the key-codes available in the python binding.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 18682
diff changeset
89
dc129248eb7c Make the key-codes available in the python binding.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 18682
diff changeset
90 gnt_init();
dc129248eb7c Make the key-codes available in the python binding.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 18682
diff changeset
91 gnt_add_string_constants(m);
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
92 }
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
93