Sven Neumann <[EMAIL PROTECTED]> writes:
> or (and I'd prefer that), we pass these settings to the plug-in in the
> GPConfig message. This is a message that is sent to each plug-in when
> it is started. We handle this in libgimp and allow the plug-in to
> access the settings using a simple API. See for example
> gimp_show_tool_tips() or gimp_display_name().
>
> Using the config message is definitely the prefered way of doing this
> but unfortunately we are completely braindead and didn't add any
> padding to the GPConfig struct :( However, there's still hope but
> things are becoming ugly now. Readers with a weak stomach, please
> leave now...
>
> The GPConfig struct contains an unused member which is "gamma". This
> is a double and IIRC a double is guaranteed to be always 8 bytes. So
> we could remove "gamma" and replace it with two 32bit integers and use
> those for the transparency settings. We could even squeeze the
> transparency settings into less than 8 bytes and keep the remaining
> bytes for future use. Might become useful pretty soon, for example as
> a way to pass whether color management should be enabled or disabled.
>
> Can anyone think of better ways to do this? Are there any strong
> objections against the ugly hack I outlined above? Did I overlook
> something (like for example platforms where a gdouble is not 8 bytes)?
When looking at the struct:
struct _GPConfig
{
guint32 version;
guint32 tile_width;
guint32 tile_height;
gint32 shm_ID;
gdouble gamma;
gint8install_cmap;
gint8show_tool_tips;
gint32 min_colors;
gint32 gdisp_ID;
gchar *app_name;
gchar *wm_class;
gchar *display_name;
gint32 monitor_number;
};
I see two options:
- using the place "gdouble gamma" uses.
- using the two unused bytes after "gint8 show_tool_tips".
I'd suggest we do both and change the struct to:
struct _GPConfig
{
guint32 version;
guint32 tile_width;
guint32 tile_height;
gint32 shm_ID;
gint8gimp_reserved_1;
gint8gimp_reserved_2;
gint8gimp_reserved_3;
gint8gimp_reserved_4;
gint8gimp_reserved_5;
gint8gimp_reserved_6;
gint8gimp_reserved_7;
gint8gimp_reserved_8;
gint8install_cmap;
gint8show_tool_tips;
gint8gimp_reserved_9;
gint8gimp_reserved_10;
gint32 min_colors;
gint32 gdisp_ID;
gchar *app_name;
gchar *wm_class;
gchar *display_name;
gint32 monitor_number;
};
Which should be binary compatible on all platforms.
ciao,
--mitch
___
Gimp-developer mailing list
[EMAIL PROTECTED]
http://lists.xcf.berkeley.edu/mailman/listinfo/gimp-developer