root / libsylph / syl-marshal.c @ 2164
History | View | Annotate | Download (5.8 kB)
| 1 | 2129 | hiro | |
|---|---|---|---|
| 2 | 2129 | hiro | #include <glib-object.h> |
| 3 | 2129 | hiro | |
| 4 | 2129 | hiro | |
| 5 | 2129 | hiro | #ifdef G_ENABLE_DEBUG
|
| 6 | 2129 | hiro | #define g_marshal_value_peek_boolean(v) g_value_get_boolean (v)
|
| 7 | 2129 | hiro | #define g_marshal_value_peek_char(v) g_value_get_char (v)
|
| 8 | 2129 | hiro | #define g_marshal_value_peek_uchar(v) g_value_get_uchar (v)
|
| 9 | 2129 | hiro | #define g_marshal_value_peek_int(v) g_value_get_int (v)
|
| 10 | 2129 | hiro | #define g_marshal_value_peek_uint(v) g_value_get_uint (v)
|
| 11 | 2129 | hiro | #define g_marshal_value_peek_long(v) g_value_get_long (v)
|
| 12 | 2129 | hiro | #define g_marshal_value_peek_ulong(v) g_value_get_ulong (v)
|
| 13 | 2129 | hiro | #define g_marshal_value_peek_int64(v) g_value_get_int64 (v)
|
| 14 | 2129 | hiro | #define g_marshal_value_peek_uint64(v) g_value_get_uint64 (v)
|
| 15 | 2129 | hiro | #define g_marshal_value_peek_enum(v) g_value_get_enum (v)
|
| 16 | 2129 | hiro | #define g_marshal_value_peek_flags(v) g_value_get_flags (v)
|
| 17 | 2129 | hiro | #define g_marshal_value_peek_float(v) g_value_get_float (v)
|
| 18 | 2129 | hiro | #define g_marshal_value_peek_double(v) g_value_get_double (v)
|
| 19 | 2129 | hiro | #define g_marshal_value_peek_string(v) (char*) g_value_get_string (v) |
| 20 | 2129 | hiro | #define g_marshal_value_peek_param(v) g_value_get_param (v)
|
| 21 | 2129 | hiro | #define g_marshal_value_peek_boxed(v) g_value_get_boxed (v)
|
| 22 | 2129 | hiro | #define g_marshal_value_peek_pointer(v) g_value_get_pointer (v)
|
| 23 | 2129 | hiro | #define g_marshal_value_peek_object(v) g_value_get_object (v)
|
| 24 | 2129 | hiro | #else /* !G_ENABLE_DEBUG */ |
| 25 | 2129 | hiro | /* WARNING: This code accesses GValues directly, which is UNSUPPORTED API.
|
| 26 | 2129 | hiro | * Do not access GValues directly in your code. Instead, use the |
| 27 | 2129 | hiro | * g_value_get_*() functions |
| 28 | 2129 | hiro | */ |
| 29 | 2129 | hiro | #define g_marshal_value_peek_boolean(v) (v)->data[0].v_int |
| 30 | 2129 | hiro | #define g_marshal_value_peek_char(v) (v)->data[0].v_int |
| 31 | 2129 | hiro | #define g_marshal_value_peek_uchar(v) (v)->data[0].v_uint |
| 32 | 2129 | hiro | #define g_marshal_value_peek_int(v) (v)->data[0].v_int |
| 33 | 2129 | hiro | #define g_marshal_value_peek_uint(v) (v)->data[0].v_uint |
| 34 | 2129 | hiro | #define g_marshal_value_peek_long(v) (v)->data[0].v_long |
| 35 | 2129 | hiro | #define g_marshal_value_peek_ulong(v) (v)->data[0].v_ulong |
| 36 | 2129 | hiro | #define g_marshal_value_peek_int64(v) (v)->data[0].v_int64 |
| 37 | 2129 | hiro | #define g_marshal_value_peek_uint64(v) (v)->data[0].v_uint64 |
| 38 | 2129 | hiro | #define g_marshal_value_peek_enum(v) (v)->data[0].v_long |
| 39 | 2129 | hiro | #define g_marshal_value_peek_flags(v) (v)->data[0].v_ulong |
| 40 | 2129 | hiro | #define g_marshal_value_peek_float(v) (v)->data[0].v_float |
| 41 | 2129 | hiro | #define g_marshal_value_peek_double(v) (v)->data[0].v_double |
| 42 | 2129 | hiro | #define g_marshal_value_peek_string(v) (v)->data[0].v_pointer |
| 43 | 2129 | hiro | #define g_marshal_value_peek_param(v) (v)->data[0].v_pointer |
| 44 | 2129 | hiro | #define g_marshal_value_peek_boxed(v) (v)->data[0].v_pointer |
| 45 | 2129 | hiro | #define g_marshal_value_peek_pointer(v) (v)->data[0].v_pointer |
| 46 | 2129 | hiro | #define g_marshal_value_peek_object(v) (v)->data[0].v_pointer |
| 47 | 2129 | hiro | #endif /* !G_ENABLE_DEBUG */ |
| 48 | 2129 | hiro | |
| 49 | 2129 | hiro | |
| 50 | 2129 | hiro | /* VOID:VOID (syl-marshal.list:1) */
|
| 51 | 2129 | hiro | |
| 52 | 2129 | hiro | /* VOID:POINTER,STRING,UINT (syl-marshal.list:2) */
|
| 53 | 2129 | hiro | void
|
| 54 | 2129 | hiro | syl_marshal_VOID__POINTER_STRING_UINT (GClosure *closure, |
| 55 | 2129 | hiro | GValue *return_value G_GNUC_UNUSED, |
| 56 | 2129 | hiro | guint n_param_values, |
| 57 | 2129 | hiro | const GValue *param_values,
|
| 58 | 2129 | hiro | gpointer invocation_hint G_GNUC_UNUSED, |
| 59 | 2129 | hiro | gpointer marshal_data) |
| 60 | 2129 | hiro | {
|
| 61 | 2129 | hiro | typedef void (*GMarshalFunc_VOID__POINTER_STRING_UINT) (gpointer data1, |
| 62 | 2129 | hiro | gpointer arg_1, |
| 63 | 2129 | hiro | gpointer arg_2, |
| 64 | 2129 | hiro | guint arg_3, |
| 65 | 2129 | hiro | gpointer data2); |
| 66 | 2129 | hiro | register GMarshalFunc_VOID__POINTER_STRING_UINT callback;
|
| 67 | 2129 | hiro | register GCClosure *cc = (GCClosure*) closure;
|
| 68 | 2129 | hiro | register gpointer data1, data2;
|
| 69 | 2129 | hiro | |
| 70 | 2129 | hiro | g_return_if_fail (n_param_values == 4);
|
| 71 | 2129 | hiro | |
| 72 | 2129 | hiro | if (G_CCLOSURE_SWAP_DATA (closure))
|
| 73 | 2129 | hiro | {
|
| 74 | 2129 | hiro | data1 = closure->data; |
| 75 | 2129 | hiro | data2 = g_value_peek_pointer (param_values + 0);
|
| 76 | 2129 | hiro | } |
| 77 | 2129 | hiro | else
|
| 78 | 2129 | hiro | {
|
| 79 | 2129 | hiro | data1 = g_value_peek_pointer (param_values + 0);
|
| 80 | 2129 | hiro | data2 = closure->data; |
| 81 | 2129 | hiro | } |
| 82 | 2129 | hiro | callback = (GMarshalFunc_VOID__POINTER_STRING_UINT) (marshal_data ? marshal_data : cc->callback); |
| 83 | 2129 | hiro | |
| 84 | 2129 | hiro | callback (data1, |
| 85 | 2129 | hiro | g_marshal_value_peek_pointer (param_values + 1),
|
| 86 | 2129 | hiro | g_marshal_value_peek_string (param_values + 2),
|
| 87 | 2129 | hiro | g_marshal_value_peek_uint (param_values + 3),
|
| 88 | 2129 | hiro | data2); |
| 89 | 2129 | hiro | } |
| 90 | 2129 | hiro | |
| 91 | 2129 | hiro | /* VOID:POINTER (syl-marshal.list:3) */
|
| 92 | 2129 | hiro | |
| 93 | 2141 | hiro | /* VOID:POINTER,STRING,STRING (syl-marshal.list:4) */
|
| 94 | 2141 | hiro | void
|
| 95 | 2141 | hiro | syl_marshal_VOID__POINTER_STRING_STRING (GClosure *closure, |
| 96 | 2141 | hiro | GValue *return_value G_GNUC_UNUSED, |
| 97 | 2141 | hiro | guint n_param_values, |
| 98 | 2141 | hiro | const GValue *param_values,
|
| 99 | 2141 | hiro | gpointer invocation_hint G_GNUC_UNUSED, |
| 100 | 2141 | hiro | gpointer marshal_data) |
| 101 | 2141 | hiro | {
|
| 102 | 2141 | hiro | typedef void (*GMarshalFunc_VOID__POINTER_STRING_STRING) (gpointer data1, |
| 103 | 2141 | hiro | gpointer arg_1, |
| 104 | 2141 | hiro | gpointer arg_2, |
| 105 | 2141 | hiro | gpointer arg_3, |
| 106 | 2141 | hiro | gpointer data2); |
| 107 | 2141 | hiro | register GMarshalFunc_VOID__POINTER_STRING_STRING callback;
|
| 108 | 2141 | hiro | register GCClosure *cc = (GCClosure*) closure;
|
| 109 | 2141 | hiro | register gpointer data1, data2;
|
| 110 | 2141 | hiro | |
| 111 | 2141 | hiro | g_return_if_fail (n_param_values == 4);
|
| 112 | 2141 | hiro | |
| 113 | 2141 | hiro | if (G_CCLOSURE_SWAP_DATA (closure))
|
| 114 | 2141 | hiro | {
|
| 115 | 2141 | hiro | data1 = closure->data; |
| 116 | 2141 | hiro | data2 = g_value_peek_pointer (param_values + 0);
|
| 117 | 2141 | hiro | } |
| 118 | 2141 | hiro | else
|
| 119 | 2141 | hiro | {
|
| 120 | 2141 | hiro | data1 = g_value_peek_pointer (param_values + 0);
|
| 121 | 2141 | hiro | data2 = closure->data; |
| 122 | 2141 | hiro | } |
| 123 | 2141 | hiro | callback = (GMarshalFunc_VOID__POINTER_STRING_STRING) (marshal_data ? marshal_data : cc->callback); |
| 124 | 2141 | hiro | |
| 125 | 2141 | hiro | callback (data1, |
| 126 | 2141 | hiro | g_marshal_value_peek_pointer (param_values + 1),
|
| 127 | 2141 | hiro | g_marshal_value_peek_string (param_values + 2),
|
| 128 | 2141 | hiro | g_marshal_value_peek_string (param_values + 3),
|
| 129 | 2141 | hiro | data2); |
| 130 | 2141 | hiro | } |