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:
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:
Which should be binary compatible on all platforms.
Gimp-developer mailing list