Mercurial > pidgin
comparison console/libgnt/gntutils.c @ 13850:0e1e59770cb0
[gaim-migrate @ 16308]
This is my first commit here. So don't yell at me if things get borked.
Also, I haven't looked at the auto-thingies yet. So don't puke at the
Makefiles.
Files in console/libgnt/ are for the 'Gaim/GObjectified Ncurses Toolkit'
library. Files in console/ uses libgaim and libgnt. Currently, only the
buddylist-ui is 'functional', ie. the buddy-list updates when someone
logs on or logs off. It still needs a lot of work.
committer: Tailor Script <tailor@pidgin.im>
author | Sadrul Habib Chowdhury <imadil@gmail.com> |
---|---|
date | Thu, 22 Jun 2006 08:33:54 +0000 |
parents | |
children | c7d84d4c5afa e354528c4163 |
comparison
equal
deleted
inserted
replaced
13849:8d1c55309e3c | 13850:0e1e59770cb0 |
---|---|
1 #include "gntutils.h" | |
2 | |
3 void gnt_closure_marshal_BOOLEAN__STRING(GClosure *closure, | |
4 GValue *ret_value, | |
5 guint n_param_values, | |
6 const GValue *param_values, | |
7 gpointer invocation_hint, | |
8 gpointer marshal_data) | |
9 { | |
10 typedef gboolean (*func) (gpointer data1, const char *arg1, gpointer data2); | |
11 register func callback; | |
12 register GCClosure *cc = (GCClosure*)closure; | |
13 register gpointer data1, data2; | |
14 gboolean ret; | |
15 | |
16 g_return_if_fail(ret_value != NULL); | |
17 g_return_if_fail(n_param_values == 2); | |
18 | |
19 if (G_CCLOSURE_SWAP_DATA(closure)) | |
20 { | |
21 data1 = closure->data; | |
22 data2 = g_value_peek_pointer(param_values + 0); | |
23 } | |
24 else | |
25 { | |
26 data1 = g_value_peek_pointer(param_values + 0); | |
27 data2 = closure->data; | |
28 } | |
29 | |
30 callback = (func) (marshal_data ? marshal_data : cc->callback); | |
31 ret = callback(data1, g_value_get_string(param_values + 1) , data2); | |
32 g_value_set_boolean(ret_value, ret); | |
33 } | |
34 | |
35 void gnt_closure_marshal_VOID__INT_INT_INT_INT(GClosure *closure, | |
36 GValue *ret_value, | |
37 guint n_param_values, | |
38 const GValue *param_values, | |
39 gpointer invocation_hint, | |
40 gpointer marshal_data) | |
41 { | |
42 typedef void (*func) (gpointer data1, int, int, int, int, gpointer data2); | |
43 register func callback; | |
44 register GCClosure *cc = (GCClosure*)closure; | |
45 register gpointer data1, data2; | |
46 | |
47 g_return_if_fail(n_param_values == 5); | |
48 | |
49 if (G_CCLOSURE_SWAP_DATA(closure)) | |
50 { | |
51 data1 = closure->data; | |
52 data2 = g_value_peek_pointer(param_values + 0); | |
53 } | |
54 else | |
55 { | |
56 data1 = g_value_peek_pointer(param_values + 0); | |
57 data2 = closure->data; | |
58 } | |
59 | |
60 callback = (func) (marshal_data ? marshal_data : cc->callback); | |
61 callback(data1, | |
62 g_value_get_int(param_values + 1) , | |
63 g_value_get_int(param_values + 2) , | |
64 g_value_get_int(param_values + 3) , | |
65 g_value_get_int(param_values + 4) , | |
66 data2); | |
67 } | |
68 | |
69 void gnt_closure_marshal_VOID__INT_INT(GClosure *closure, | |
70 GValue *ret_value, | |
71 guint n_param_values, | |
72 const GValue *param_values, | |
73 gpointer invocation_hint, | |
74 gpointer marshal_data) | |
75 { | |
76 typedef void (*func) (gpointer data1, int, int, gpointer data2); | |
77 register func callback; | |
78 register GCClosure *cc = (GCClosure*)closure; | |
79 register gpointer data1, data2; | |
80 | |
81 g_return_if_fail(n_param_values == 3); | |
82 | |
83 if (G_CCLOSURE_SWAP_DATA(closure)) | |
84 { | |
85 data1 = closure->data; | |
86 data2 = g_value_peek_pointer(param_values + 0); | |
87 } | |
88 else | |
89 { | |
90 data1 = g_value_peek_pointer(param_values + 0); | |
91 data2 = closure->data; | |
92 } | |
93 | |
94 callback = (func) (marshal_data ? marshal_data : cc->callback); | |
95 callback(data1, | |
96 g_value_get_int(param_values + 1) , | |
97 g_value_get_int(param_values + 2) , | |
98 data2); | |
99 } | |
100 |