1 /*
2 * Copyright (C) 2007 Felipe Weckx <felipe.weckx@gmail.com>
3 *
4 * This program is free software; you can redistribute it and/or
5 * modify it under the terms of the GNU General Public License as
6 * published by the Free Software Foundation; either version 2 of the
7 * License, or (at your option) any later version.
8 *
9 * This program is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12 * General Public License for more details.
13 *
14 * You should have received a copy of the GNU General Public
15 * License along with this program; if not, write to the
16 * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
17 * Boston, MA 02111-1307, USA.
18 */
19
20
21 #include <glib-object.h>
22
23
24 #ifdef G_ENABLE_DEBUG
25 #define g_marshal_value_peek_boolean(v) g_value_get_boolean (v)
26 #define g_marshal_value_peek_char(v) g_value_get_char (v)
27 #define g_marshal_value_peek_uchar(v) g_value_get_uchar (v)
28 #define g_marshal_value_peek_int(v) g_value_get_int (v)
29 #define g_marshal_value_peek_uint(v) g_value_get_uint (v)
30 #define g_marshal_value_peek_long(v) g_value_get_long (v)
31 #define g_marshal_value_peek_ulong(v) g_value_get_ulong (v)
32 #define g_marshal_value_peek_int64(v) g_value_get_int64 (v)
33 #define g_marshal_value_peek_uint64(v) g_value_get_uint64 (v)
34 #define g_marshal_value_peek_enum(v) g_value_get_enum (v)
35 #define g_marshal_value_peek_flags(v) g_value_get_flags (v)
36 #define g_marshal_value_peek_float(v) g_value_get_float (v)
37 #define g_marshal_value_peek_double(v) g_value_get_double (v)
38 #define g_marshal_value_peek_string(v) (char*) g_value_get_string (v)
39 #define g_marshal_value_peek_param(v) g_value_get_param (v)
40 #define g_marshal_value_peek_boxed(v) g_value_get_boxed (v)
41 #define g_marshal_value_peek_pointer(v) g_value_get_pointer (v)
42 #define g_marshal_value_peek_object(v) g_value_get_object (v)
43 #else /* !G_ENABLE_DEBUG */
44 /* WARNING: This code accesses GValues directly, which is UNSUPPORTED API.
45 * Do not access GValues directly in your code. Instead, use the
46 * g_value_get_*() functions
47 */
48 #define g_marshal_value_peek_boolean(v) (v)->data[0].v_int
49 #define g_marshal_value_peek_char(v) (v)->data[0].v_int
50 #define g_marshal_value_peek_uchar(v) (v)->data[0].v_uint
51 #define g_marshal_value_peek_int(v) (v)->data[0].v_int
52 #define g_marshal_value_peek_uint(v) (v)->data[0].v_uint
53 #define g_marshal_value_peek_long(v) (v)->data[0].v_long
54 #define g_marshal_value_peek_ulong(v) (v)->data[0].v_ulong
55 #define g_marshal_value_peek_int64(v) (v)->data[0].v_int64
56 #define g_marshal_value_peek_uint64(v) (v)->data[0].v_uint64
57 #define g_marshal_value_peek_enum(v) (v)->data[0].v_long
58 #define g_marshal_value_peek_flags(v) (v)->data[0].v_ulong
59 #define g_marshal_value_peek_float(v) (v)->data[0].v_float
60 #define g_marshal_value_peek_double(v) (v)->data[0].v_double
61 #define g_marshal_value_peek_string(v) (v)->data[0].v_pointer
62 #define g_marshal_value_peek_param(v) (v)->data[0].v_pointer
63 #define g_marshal_value_peek_boxed(v) (v)->data[0].v_pointer
64 #define g_marshal_value_peek_pointer(v) (v)->data[0].v_pointer
65 #define g_marshal_value_peek_object(v) (v)->data[0].v_pointer
66 #endif /* !G_ENABLE_DEBUG */
67
68
69 /* VOID:INT,INT,STRING (closures:1) */
70 void
gbemol_cclosure_VOID__INT_INT_STRING(GClosure * closure,GValue * return_value,guint n_param_values,const GValue * param_values,gpointer invocation_hint,gpointer marshal_data)71 gbemol_cclosure_VOID__INT_INT_STRING (GClosure *closure,
72 GValue *return_value,
73 guint n_param_values,
74 const GValue *param_values,
75 gpointer invocation_hint,
76 gpointer marshal_data)
77 {
78 typedef void (*GMarshalFunc_VOID__INT_INT_STRING) (gpointer data1,
79 gint arg_1,
80 gint arg_2,
81 gpointer arg_3,
82 gpointer data2);
83 register GMarshalFunc_VOID__INT_INT_STRING callback;
84 register GCClosure *cc = (GCClosure*) closure;
85 register gpointer data1, data2;
86
87 g_return_if_fail (n_param_values == 4);
88
89 if (G_CCLOSURE_SWAP_DATA (closure))
90 {
91 data1 = closure->data;
92 data2 = g_value_peek_pointer (param_values + 0);
93 }
94 else
95 {
96 data1 = g_value_peek_pointer (param_values + 0);
97 data2 = closure->data;
98 }
99 callback = (GMarshalFunc_VOID__INT_INT_STRING) (marshal_data ? marshal_data : cc->callback);
100
101 callback (data1,
102 g_marshal_value_peek_int (param_values + 1),
103 g_marshal_value_peek_int (param_values + 2),
104 g_marshal_value_peek_string (param_values + 3),
105 data2);
106 }
107
108