~timchen119/ubuntu/trusty/gnome-bluetooth/lp1035431

« back to all changes in this revision

Viewing changes to applet/marshal.c

  • Committer: Bazaar Package Importer
  • Author(s): Emilio Pozuelo Monfort
  • Date: 2011-02-27 15:45:22 UTC
  • mfrom: (1.3.2 upstream)
  • mto: (2.2.3 experimental) (1.5.1)
  • mto: This revision was merged to the branch mainline in revision 53.
  • Revision ID: james.westby@ubuntu.com-20110227154522-dnnoqasv5v3mv42a
Tags: upstream-2.91.5
ImportĀ upstreamĀ versionĀ 2.91.5

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
 
 
2
#ifndef __marshal_MARSHAL_H__
 
3
#define __marshal_MARSHAL_H__
 
4
 
 
5
#include        <glib-object.h>
 
6
 
 
7
G_BEGIN_DECLS
 
8
 
 
9
#ifdef G_ENABLE_DEBUG
 
10
#define g_marshal_value_peek_boolean(v)  g_value_get_boolean (v)
 
11
#define g_marshal_value_peek_char(v)     g_value_get_char (v)
 
12
#define g_marshal_value_peek_uchar(v)    g_value_get_uchar (v)
 
13
#define g_marshal_value_peek_int(v)      g_value_get_int (v)
 
14
#define g_marshal_value_peek_uint(v)     g_value_get_uint (v)
 
15
#define g_marshal_value_peek_long(v)     g_value_get_long (v)
 
16
#define g_marshal_value_peek_ulong(v)    g_value_get_ulong (v)
 
17
#define g_marshal_value_peek_int64(v)    g_value_get_int64 (v)
 
18
#define g_marshal_value_peek_uint64(v)   g_value_get_uint64 (v)
 
19
#define g_marshal_value_peek_enum(v)     g_value_get_enum (v)
 
20
#define g_marshal_value_peek_flags(v)    g_value_get_flags (v)
 
21
#define g_marshal_value_peek_float(v)    g_value_get_float (v)
 
22
#define g_marshal_value_peek_double(v)   g_value_get_double (v)
 
23
#define g_marshal_value_peek_string(v)   (char*) g_value_get_string (v)
 
24
#define g_marshal_value_peek_param(v)    g_value_get_param (v)
 
25
#define g_marshal_value_peek_boxed(v)    g_value_get_boxed (v)
 
26
#define g_marshal_value_peek_pointer(v)  g_value_get_pointer (v)
 
27
#define g_marshal_value_peek_object(v)   g_value_get_object (v)
 
28
#define g_marshal_value_peek_variant(v)  g_value_get_variant (v)
 
29
#else /* !G_ENABLE_DEBUG */
 
30
/* WARNING: This code accesses GValues directly, which is UNSUPPORTED API.
 
31
 *          Do not access GValues directly in your code. Instead, use the
 
32
 *          g_value_get_*() functions
 
33
 */
 
34
#define g_marshal_value_peek_boolean(v)  (v)->data[0].v_int
 
35
#define g_marshal_value_peek_char(v)     (v)->data[0].v_int
 
36
#define g_marshal_value_peek_uchar(v)    (v)->data[0].v_uint
 
37
#define g_marshal_value_peek_int(v)      (v)->data[0].v_int
 
38
#define g_marshal_value_peek_uint(v)     (v)->data[0].v_uint
 
39
#define g_marshal_value_peek_long(v)     (v)->data[0].v_long
 
40
#define g_marshal_value_peek_ulong(v)    (v)->data[0].v_ulong
 
41
#define g_marshal_value_peek_int64(v)    (v)->data[0].v_int64
 
42
#define g_marshal_value_peek_uint64(v)   (v)->data[0].v_uint64
 
43
#define g_marshal_value_peek_enum(v)     (v)->data[0].v_long
 
44
#define g_marshal_value_peek_flags(v)    (v)->data[0].v_ulong
 
45
#define g_marshal_value_peek_float(v)    (v)->data[0].v_float
 
46
#define g_marshal_value_peek_double(v)   (v)->data[0].v_double
 
47
#define g_marshal_value_peek_string(v)   (v)->data[0].v_pointer
 
48
#define g_marshal_value_peek_param(v)    (v)->data[0].v_pointer
 
49
#define g_marshal_value_peek_boxed(v)    (v)->data[0].v_pointer
 
50
#define g_marshal_value_peek_pointer(v)  (v)->data[0].v_pointer
 
51
#define g_marshal_value_peek_object(v)   (v)->data[0].v_pointer
 
52
#define g_marshal_value_peek_variant(v)  (v)->data[0].v_pointer
 
53
#endif /* !G_ENABLE_DEBUG */
 
54
 
 
55
 
 
56
/* VOID:STRING,STRING,STRING,BOOLEAN (marshal.list:1) */
 
57
extern void marshal_VOID__STRING_STRING_STRING_BOOLEAN (GClosure     *closure,
 
58
                                                        GValue       *return_value,
 
59
                                                        guint         n_param_values,
 
60
                                                        const GValue *param_values,
 
61
                                                        gpointer      invocation_hint,
 
62
                                                        gpointer      marshal_data);
 
63
void
 
64
marshal_VOID__STRING_STRING_STRING_BOOLEAN (GClosure     *closure,
 
65
                                            GValue       *return_value G_GNUC_UNUSED,
 
66
                                            guint         n_param_values,
 
67
                                            const GValue *param_values,
 
68
                                            gpointer      invocation_hint G_GNUC_UNUSED,
 
69
                                            gpointer      marshal_data)
 
70
{
 
71
  typedef void (*GMarshalFunc_VOID__STRING_STRING_STRING_BOOLEAN) (gpointer     data1,
 
72
                                                                   gpointer     arg_1,
 
73
                                                                   gpointer     arg_2,
 
74
                                                                   gpointer     arg_3,
 
75
                                                                   gboolean     arg_4,
 
76
                                                                   gpointer     data2);
 
77
  register GMarshalFunc_VOID__STRING_STRING_STRING_BOOLEAN callback;
 
78
  register GCClosure *cc = (GCClosure*) closure;
 
79
  register gpointer data1, data2;
 
80
 
 
81
  g_return_if_fail (n_param_values == 5);
 
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
  callback = (GMarshalFunc_VOID__STRING_STRING_STRING_BOOLEAN) (marshal_data ? marshal_data : cc->callback);
 
94
 
 
95
  callback (data1,
 
96
            g_marshal_value_peek_string (param_values + 1),
 
97
            g_marshal_value_peek_string (param_values + 2),
 
98
            g_marshal_value_peek_string (param_values + 3),
 
99
            g_marshal_value_peek_boolean (param_values + 4),
 
100
            data2);
 
101
}
 
102
 
 
103
/* VOID:STRING,STRING,STRING,UINT (marshal.list:2) */
 
104
extern void marshal_VOID__STRING_STRING_STRING_UINT (GClosure     *closure,
 
105
                                                     GValue       *return_value,
 
106
                                                     guint         n_param_values,
 
107
                                                     const GValue *param_values,
 
108
                                                     gpointer      invocation_hint,
 
109
                                                     gpointer      marshal_data);
 
110
void
 
111
marshal_VOID__STRING_STRING_STRING_UINT (GClosure     *closure,
 
112
                                         GValue       *return_value G_GNUC_UNUSED,
 
113
                                         guint         n_param_values,
 
114
                                         const GValue *param_values,
 
115
                                         gpointer      invocation_hint G_GNUC_UNUSED,
 
116
                                         gpointer      marshal_data)
 
117
{
 
118
  typedef void (*GMarshalFunc_VOID__STRING_STRING_STRING_UINT) (gpointer     data1,
 
119
                                                                gpointer     arg_1,
 
120
                                                                gpointer     arg_2,
 
121
                                                                gpointer     arg_3,
 
122
                                                                guint        arg_4,
 
123
                                                                gpointer     data2);
 
124
  register GMarshalFunc_VOID__STRING_STRING_STRING_UINT callback;
 
125
  register GCClosure *cc = (GCClosure*) closure;
 
126
  register gpointer data1, data2;
 
127
 
 
128
  g_return_if_fail (n_param_values == 5);
 
129
 
 
130
  if (G_CCLOSURE_SWAP_DATA (closure))
 
131
    {
 
132
      data1 = closure->data;
 
133
      data2 = g_value_peek_pointer (param_values + 0);
 
134
    }
 
135
  else
 
136
    {
 
137
      data1 = g_value_peek_pointer (param_values + 0);
 
138
      data2 = closure->data;
 
139
    }
 
140
  callback = (GMarshalFunc_VOID__STRING_STRING_STRING_UINT) (marshal_data ? marshal_data : cc->callback);
 
141
 
 
142
  callback (data1,
 
143
            g_marshal_value_peek_string (param_values + 1),
 
144
            g_marshal_value_peek_string (param_values + 2),
 
145
            g_marshal_value_peek_string (param_values + 3),
 
146
            g_marshal_value_peek_uint (param_values + 4),
 
147
            data2);
 
148
}
 
149
 
 
150
/* VOID:STRING,STRING,STRING,STRING (marshal.list:3) */
 
151
extern void marshal_VOID__STRING_STRING_STRING_STRING (GClosure     *closure,
 
152
                                                       GValue       *return_value,
 
153
                                                       guint         n_param_values,
 
154
                                                       const GValue *param_values,
 
155
                                                       gpointer      invocation_hint,
 
156
                                                       gpointer      marshal_data);
 
157
void
 
158
marshal_VOID__STRING_STRING_STRING_STRING (GClosure     *closure,
 
159
                                           GValue       *return_value G_GNUC_UNUSED,
 
160
                                           guint         n_param_values,
 
161
                                           const GValue *param_values,
 
162
                                           gpointer      invocation_hint G_GNUC_UNUSED,
 
163
                                           gpointer      marshal_data)
 
164
{
 
165
  typedef void (*GMarshalFunc_VOID__STRING_STRING_STRING_STRING) (gpointer     data1,
 
166
                                                                  gpointer     arg_1,
 
167
                                                                  gpointer     arg_2,
 
168
                                                                  gpointer     arg_3,
 
169
                                                                  gpointer     arg_4,
 
170
                                                                  gpointer     data2);
 
171
  register GMarshalFunc_VOID__STRING_STRING_STRING_STRING callback;
 
172
  register GCClosure *cc = (GCClosure*) closure;
 
173
  register gpointer data1, data2;
 
174
 
 
175
  g_return_if_fail (n_param_values == 5);
 
176
 
 
177
  if (G_CCLOSURE_SWAP_DATA (closure))
 
178
    {
 
179
      data1 = closure->data;
 
180
      data2 = g_value_peek_pointer (param_values + 0);
 
181
    }
 
182
  else
 
183
    {
 
184
      data1 = g_value_peek_pointer (param_values + 0);
 
185
      data2 = closure->data;
 
186
    }
 
187
  callback = (GMarshalFunc_VOID__STRING_STRING_STRING_STRING) (marshal_data ? marshal_data : cc->callback);
 
188
 
 
189
  callback (data1,
 
190
            g_marshal_value_peek_string (param_values + 1),
 
191
            g_marshal_value_peek_string (param_values + 2),
 
192
            g_marshal_value_peek_string (param_values + 3),
 
193
            g_marshal_value_peek_string (param_values + 4),
 
194
            data2);
 
195
}
 
196
 
 
197
G_END_DECLS
 
198
 
 
199
#endif /* __marshal_MARSHAL_H__ */
 
200