GNOME Bugzilla – Bug 129747
Theme should accept #RRGGBB as constants.
Last modified: 2006-10-07 17:09:59 UTC
The theme file should accept large numbers and strings as constants so as to allow global colour information to be specified at the begining of the file. Right now only small integers are allowed.
String constants would need: * parse_toplevel_element to know to store string constants. * meta_color_spec_new_from_string to be aware of the new constants * meta_theme_define_string_constant to be defined. You'd then have the problem of telling whether defining a constant to be e.g. "1" is the string 1 or the integer 1. Possibly we should define every constant as a string, and then also as a float constant or an integer constant if they parsed as one. The large integer restriction happens because of the constant #define MAX_REASONABLE 4096 in theme-parser.c. Setting it larger (to what? 0x1000000?) would allow large integers as constants.
Looking into this I find that it would be far more sensible to allow strings as constants. Colours can be quite complex, more than can be expressed with a simple integer constant.
Could just allow color constants, that might be easiest. The limitation on integer sizes is probably misguided, I really have no idea what the point of it was supposed to be. Just some kind of generic paranoia I suppose. Would not want to change this limit without doing the theme format versioning though, as for all the other possible theme changes.
Fixed in metacity-theme-2.
When removing a limit like this, you're ensuring that the limit is still enforced for themes with the old filenames right? i.e. it should be impossible to accidentally use new theme features with old filenames.
That's right. There's a macro I'm using: #define META_THEME_ALLOWS(theme, feature) (theme->format_version >= feature) /* What version of the theme file format were various features introduced in? */ ... #define META_THEME_COLOR_CONSTANTS 2 and if that's false it pretends the feature doesn't exist.
Fixed in HEAD!