Re: Marshalers [was Re: API freezing ...]



OK, I've gone ahead and committed the marshaler change. The
basic effect of this is:
 
If you were using marshalers in the gtk_marshal_* namespace,
you should change your setup to run glib-genmarshal yourself.
All marshalers that were exported in GTK+-1.2 are still
exported, unless you define GTK_DISABLE_DEPRECATED, but
no marshalers added since then.

Also, some code may have been adapted to incompatible name changes in
gtkmarshal.h since GTK+-1.2; that code will either have to be
converted back to the GTK+-1.2 names, or else switched
to use glib-genmarshal.

Instructions for using glib-genmarshal:

Create a file called 'mylib-marshal.list' with contents like:

====
BOOLEAN:BOXED
BOOLEAN:BOXED,BOXED
ENUM:ENUM
VOID:BOOLEAN
VOID:BOOLEAN,BOOLEAN,BOOLEAN
====

One line for each marshaler you use. Then add rules to your
Makefile.am:

====
mylib-marshal.h: mylib-marshal.list
        ( @GLIB_GENMARSHAL@ --prefix=mylib_marshal mylib-marshal.list --header > mylib-marshal.tmp \
	&& mv mylib-marshal.tmp mylib-marshal.h ) \
        || ( rm -f mylib-marshal.tmp && exit 1 )
mylib-marshal.c: mylib-marshal.h
        ( @GLIB_GENMARSHAL@ --prefix=mylib_marshal mylib-marshal.list --body > mylib-marshal.tmp \
	&& mv mylib-marshal.tmp mylib-marshal.c ) \
        || ( rm -f mylib-marshal.tmp && exit 1 )

$(libmylib_la_OBJECTS): mylib-marshal.h
====

Add mylib-marshal.c to your libmylib_la_SOURCES and include 
mylib-marshal.h anywhere you need any of the marshalers.
The @GLIB_GENMARSHAL@ variable is defined by AM_PATH_GLIB_2_0
and AM_PATH_GTK_2_0.

Regards,
                                        Owen

P.S. -- The rules above have not been extensively tested, but
        the GTK+ rules are way more complex than they need to be.
        The only complexity in the above comes from not generating
        the output file on error.



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]