version 1 showing authors affecting page license.
.
Rev |
Author |
# |
Line |
1 |
perry |
1 |
GLIB-GENMARSHAL |
|
|
2 |
!!!GLIB-GENMARSHAL |
|
|
3 |
NAME |
|
|
4 |
SYNOPSIS |
|
|
5 |
DESCRIPTION |
|
|
6 |
INVOCATION |
|
|
7 |
EXAMPLE |
|
|
8 |
SEE ALSO |
|
|
9 |
BUGS |
|
|
10 |
AUTHOR |
|
|
11 |
---- |
|
|
12 |
!!NAME |
|
|
13 |
|
|
|
14 |
|
|
|
15 |
glib-genmarshal - C code marshaller generation utility for GLib closures |
|
|
16 |
!!SYNOPSIS |
|
|
17 |
|
|
|
18 |
|
|
|
19 |
__glib-genmarshal__ [[''options''] |
|
|
20 |
[[''files...''] |
|
|
21 |
!!DESCRIPTION |
|
|
22 |
|
|
|
23 |
|
|
|
24 |
__glib-genmarshal__ is a small utility that generates C |
|
|
25 |
code marshallers for callback functions of the GClosure |
|
|
26 |
mechanism in the GObject sublibrary of GLib. The marshaller |
|
|
27 |
functions have a standard signature, they get passed in the |
|
|
28 |
invoking closure, an array of value structures holding the |
|
|
29 |
callback function parameters and a value structure for the |
|
|
30 |
return value of the callback. The marshaller is then |
|
|
31 |
responsible to call the respective C code function of the |
|
|
32 |
closure with all the parameters on the stack and to collect |
|
|
33 |
its return value. |
|
|
34 |
!!INVOCATION |
|
|
35 |
|
|
|
36 |
|
|
|
37 |
__glib-genmarshal__ takes a list of marshallers to |
|
|
38 |
generate as input. The marshaller list is either read from |
|
|
39 |
standard input or from files passed as additional arguments |
|
|
40 |
on the command line. |
|
|
41 |
|
|
|
42 |
|
|
|
43 |
__Options__ |
|
|
44 |
|
|
|
45 |
|
|
|
46 |
''--header'' |
|
|
47 |
|
|
|
48 |
|
|
|
49 |
Generate header file contents of the |
|
|
50 |
marshallers. |
|
|
51 |
|
|
|
52 |
|
|
|
53 |
''--body'' |
|
|
54 |
|
|
|
55 |
|
|
|
56 |
Generate C code file contents of the |
|
|
57 |
marshallers. |
|
|
58 |
|
|
|
59 |
|
|
|
60 |
''--prefix=string, --prefix string'' |
|
|
61 |
|
|
|
62 |
|
|
|
63 |
Specify marshaller prefix. The default prefix is |
|
|
64 |
`''g_cclosure_marshal'''. |
|
|
65 |
|
|
|
66 |
|
|
|
67 |
''--skip-source'' |
|
|
68 |
|
|
|
69 |
|
|
|
70 |
Skip source location remarks in generated |
|
|
71 |
comments. |
|
|
72 |
|
|
|
73 |
|
|
|
74 |
''--nostdinc'' |
|
|
75 |
|
|
|
76 |
|
|
|
77 |
Do not use the standard GRuntime marshallers, and skip |
|
|
78 |
gmarshal.h include directive in generated header |
|
|
79 |
files. |
|
|
80 |
|
|
|
81 |
|
|
|
82 |
''--g-fatal-warnings'' |
|
|
83 |
|
|
|
84 |
|
|
|
85 |
Make warnings fatal, that is, exit immediately once a |
|
|
86 |
warning occurs. |
|
|
87 |
|
|
|
88 |
|
|
|
89 |
''-h, --help'' |
|
|
90 |
|
|
|
91 |
|
|
|
92 |
Print brief help and exit. |
|
|
93 |
|
|
|
94 |
|
|
|
95 |
''-v, --version'' |
|
|
96 |
|
|
|
97 |
|
|
|
98 |
Print version and exit. |
|
|
99 |
|
|
|
100 |
|
|
|
101 |
__Marshaller list format__ |
|
|
102 |
|
|
|
103 |
|
|
|
104 |
The marshaller lists are processed line by line, a line can |
|
|
105 |
contain a comment in the form of |
|
|
106 |
|
|
|
107 |
|
|
|
108 |
# this is a comment |
|
|
109 |
|
|
|
110 |
|
|
|
111 |
or a marshaller specification of the form |
|
|
112 |
|
|
|
113 |
|
|
|
114 |
''RTYPE'':__PTYPE__ |
|
|
115 |
|
|
|
116 |
|
|
|
117 |
''RTYPE'':__PTYPE__,__PTYPE__ |
|
|
118 |
|
|
|
119 |
|
|
|
120 |
''RTYPE'':__PTYPE__,__PTYPE__,__PTYPE__ |
|
|
121 |
|
|
|
122 |
|
|
|
123 |
# up to 16 __PTYPE__s may be present |
|
|
124 |
|
|
|
125 |
|
|
|
126 |
The ''RTYPE'' part specifies the callback's return type |
|
|
127 |
and the __PTYPE__s right to the colon specify the |
|
|
128 |
callback's parameter list, except for the first and the last |
|
|
129 |
arguments which are always pointers. |
|
|
130 |
|
|
|
131 |
|
|
|
132 |
__Parameter types__ |
|
|
133 |
|
|
|
134 |
|
|
|
135 |
Currently, the following types are supported: |
|
|
136 |
|
|
|
137 |
|
|
|
138 |
''VOID'' indicates no return type, or no extra |
|
|
139 |
parameters. if ''VOID'' is used as the parameter list, no |
|
|
140 |
additional parameters may be present. |
|
|
141 |
|
|
|
142 |
|
|
|
143 |
''BOOLEAN'' |
|
|
144 |
|
|
|
145 |
|
|
|
146 |
for boolean types (gboolean) |
|
|
147 |
|
|
|
148 |
|
|
|
149 |
''CHAR'' for signed char types (gchar) |
|
|
150 |
|
|
|
151 |
|
|
|
152 |
''UCHAR'' |
|
|
153 |
|
|
|
154 |
|
|
|
155 |
for unsigned char types (guchar) |
|
|
156 |
|
|
|
157 |
|
|
|
158 |
''INT'' for signed integer types (gint) |
|
|
159 |
|
|
|
160 |
|
|
|
161 |
''UINT'' for unsigned integer types (guint) |
|
|
162 |
|
|
|
163 |
|
|
|
164 |
''LONG'' for signed long integer types |
|
|
165 |
(glong) |
|
|
166 |
|
|
|
167 |
|
|
|
168 |
''ULONG'' |
|
|
169 |
|
|
|
170 |
|
|
|
171 |
for unsigned long integer types (gulong) |
|
|
172 |
|
|
|
173 |
|
|
|
174 |
''ENUM'' for enumeration types (gint) |
|
|
175 |
|
|
|
176 |
|
|
|
177 |
''FLAGS'' |
|
|
178 |
|
|
|
179 |
|
|
|
180 |
for flag enumeration types (guint) |
|
|
181 |
|
|
|
182 |
|
|
|
183 |
''FLOAT'' |
|
|
184 |
|
|
|
185 |
|
|
|
186 |
for single-precision float types (gfloat) |
|
|
187 |
|
|
|
188 |
|
|
|
189 |
''DOUBLE'' |
|
|
190 |
|
|
|
191 |
|
|
|
192 |
for double-precision float types (gdouble) |
|
|
193 |
|
|
|
194 |
|
|
|
195 |
''STRING'' |
|
|
196 |
|
|
|
197 |
|
|
|
198 |
for string types (gchar*) |
|
|
199 |
|
|
|
200 |
|
|
|
201 |
''BOXED'' |
|
|
202 |
|
|
|
203 |
|
|
|
204 |
for boxed (anonymous but reference counted) types |
|
|
205 |
(GBoxed*) |
|
|
206 |
|
|
|
207 |
|
|
|
208 |
''PARAM'' |
|
|
209 |
|
|
|
210 |
|
|
|
211 |
for GParamSpec or derived types (GParamSpec*) |
|
|
212 |
|
|
|
213 |
|
|
|
214 |
''POINTER'' |
|
|
215 |
|
|
|
216 |
|
|
|
217 |
for anonymous pointer types (gpointer) |
|
|
218 |
|
|
|
219 |
|
|
|
220 |
''OBJECT'' |
|
|
221 |
|
|
|
222 |
|
|
|
223 |
for GObject or derived types (GObject*) |
|
|
224 |
|
|
|
225 |
|
|
|
226 |
''NONE'' deprecated alias for ''VOID'' |
|
|
227 |
|
|
|
228 |
|
|
|
229 |
''BOOL'' deprecated alias for ''BOOLEAN'' |
|
|
230 |
!!EXAMPLE |
|
|
231 |
|
|
|
232 |
|
|
|
233 |
To generate marshallers for the following callback |
|
|
234 |
functions: |
|
|
235 |
|
|
|
236 |
|
|
|
237 |
void foo (gpointer data1, |
|
|
238 |
gpointer data2); |
|
|
239 |
void bar (gpointer data1, |
|
|
240 |
gint param1, |
|
|
241 |
gpointer data2); |
|
|
242 |
gfloat baz (gpointer data1, |
|
|
243 |
gboolean param1, |
|
|
244 |
guchar param2, |
|
|
245 |
gpointer data2); |
|
|
246 |
|
|
|
247 |
|
|
|
248 |
The marshaller list has to look like this: |
|
|
249 |
|
|
|
250 |
|
|
|
251 |
VOID:VOID |
|
|
252 |
VOID:INT |
|
|
253 |
FLOAT:BOOLEAN,UCHAR |
|
|
254 |
|
|
|
255 |
|
|
|
256 |
The generated marshallers have the arguments encoded in |
|
|
257 |
their function name. For this particular list, they are |
|
|
258 |
g_cclosure_marshal_VOID__VOID(), |
|
|
259 |
g_cclosure_marshal_VOID__INT(), |
|
|
260 |
g_cclosure_marshal_FLOAT__BOOLEAN_UCHAR(). |
|
|
261 |
|
|
|
262 |
|
|
|
263 |
They can be used directly for GClosures or be passed in as |
|
|
264 |
the GSignalCMarshaller c_marshaller; argument upon creation |
|
|
265 |
of signals: |
|
|
266 |
|
|
|
267 |
|
|
|
268 |
GClosure *cc_foo, *cc_bar, *cc_baz; |
|
|
269 |
cc_foo = g_cclosure_new (NULL, foo, NULL); |
|
|
270 |
g_closure_set_marshal (cc_foo, g_cclosure_marshal_VOID__VOID); |
|
|
271 |
cc_bar = g_cclosure_new (NULL, bar, NULL); |
|
|
272 |
g_closure_set_marshal (cc_bar, g_cclosure_marshal_VOID__INT); |
|
|
273 |
cc_baz = g_cclosure_new (NULL, baz, NULL); |
|
|
274 |
g_closure_set_marshal (cc_baz, g_cclosure_marshal_FLOAT__BOOLEAN_UCHAR); |
|
|
275 |
!!SEE ALSO |
|
|
276 |
|
|
|
277 |
|
|
|
278 |
__glib-mkenums(1)__ |
|
|
279 |
!!BUGS |
|
|
280 |
|
|
|
281 |
|
|
|
282 |
None known yet. |
|
|
283 |
!!AUTHOR |
|
|
284 |
|
|
|
285 |
|
|
|
286 |
__glib-genmarshal__ has been written by Tim Janik |
|
|
287 |
__ |
|
|
288 |
|
|
|
289 |
|
|
|
290 |
This manual page was provided by Tim Janik |
|
|
291 |
---- |