Re: Patch for Clearlooks Theme exporting symbols unneccesarily



In GTK+ 2.8.10, theme engines will be loaded with G_MODULE_BIND_LAZY, so
any symbols likely to clash should never appear in the global name space
(since GTK+ won't ever call them).

Most functions in gtk-engines are declared static to prevent them from
appearing in the global name space. Any functions that aren't static
should be prefixed with the engine name. The problem with G_GNUC_INTERNAL
is that it is (obviously) only a gcc option so it doesn't help where other
compilers are used. GTK+ only needs a handfull of symbols, so it would be
more usefull to be able to explicitly mark functions as exported, and
default to un-exported, rather than the other way round. However, the only
way of doing this might also be a gcc specific option.

-Thomas

On Fri, January 6, 2006 9:14 am, milosz derezynski said:
> Clearlooks gave me some headaches with our app (BMPx,
> http://bmpx.beep-media-player.org), as it exports symbols quite into the
> wild which is completely unneccesary and can cause collisions with
> applications, and in our case did so.
>
> For exmple, our app has a drawing function draw_arrow () that uses Cairo
> to
> draw a certain kind of arrow, and Clearlooks had a symbol of the same name
> exported publicly up to at least 0.6.2 (in CVS it's renamed to
> clearlooks_draw_arrow(), but it's still public never the less).
>
> Just in case the discussion arises: You always run N (distinct) apps
> versus
> 1 style engine, but 1 (identical) style engine versus N (distinct) apps.
> So
> you could argue we should prefix our function as well, and it might be a
> good idea probably in case some other lib has a symbol of this name.
> However, theme engines don't need to export any symbols except the
> GTypeModule stuff and the GType registration for the style and rc_style.
>
> So please find here attached a patch against clearlooks-cvs from the
> gtk-engines module in GNOME CVS from roughly Fri Jan  6 07:43:20 CET 2006
> which keeps all symbols unneccessary G_GNUC_INTERNAL,  plus the needed
> clearlooks.sym file (to be put into gtk-engines/engines/clearlooks) which
> lists only the neccesary symbols to be exported.
>
> (The G_GNUC_INTERNAL prefixing isn't complete, it doesn't cover
> support.cyet, but the .sym file should cover hiding these symbols as
> well)
>
> Regards,
> Milosz
> _______________________________________________
> gnome-themes-list mailing list
> gnome-themes-list gnome org
> http://mail.gnome.org/mailman/listinfo/gnome-themes-list
>





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