Skip to content
  • Ell's avatar
    libgimpbase: add gimp_{enum,flags}_value_get_abbrev() · 7df42758
    Ell authored
    Add support for specifying an abbreviated description for enum/
    flags values, which can be used in contexts where the full
    description is too long.
    
    Since the exact layout and size of Gimp{Enum,Flags}Desc is part of
    the ABI, we can't simply add a field to these structs to hold the
    abbreviated description.  Instead, we use the fact that entries
    with a repeated value in the value descriptions array are ignored,
    and that the array is NULL terminated (in particular, that all non-
    NULL entries are followed by at least one additional entry), and
    specify the abbreviation in the "value_desc" field of the entry
    that immediately follows the initial entry for a given value,
    setting the "value" field of both entries to the same value.
    
    Right now this behavior is undocumented, so there is no proper way
    to specify abbreviated descriptions in the API, and is only meant
    to be used in generated enum files.
    7df42758