Specifically, literally theme-parser.c in marco/src/ui/
After spending a few hours fixing pieces of copypasta errors in the "Traditional" themes, one thing that really stands out to me is just how much of this maintenance headache could be wiped out entirely if the theme parser just supported color variables. To give a very cut-down example of what I mean:
<draw_ops name="button_bg">
<line color="shade/gtk:bg[SELECTED]/1.00" x1="2" y1="0" x2="width-3" y2="0"/>
...
<draw_ops name="button_bg_unfocused">
<line color="shade/gtk:bg[NORMAL]/0.93" x1="2" y1="0" x2="width-3" y2="0"/>
...
<draw_ops name="button_bg_pressed">
<line color="shade/gtk:bg[SELECTED]/1.0" x1="2" y1="height-2" x2="width-3" y2="height-2"/>
...
<draw_ops name="button_bg_unfocused_pressed">
<line color="shade/gtk:bg[NORMAL]/1.05" x1="2" y1="height-2" x2="width-3" y2="height-2"/>
and so on. There's literally 30 to 50 lines of XML for each of those cases, with all of them using arbitrary shading constants, and the massive copypasting inevitably leading to lost synchronisation of all the pieces (gradients, etc) as time goes by and one fragment gets tweaked without the changes being replicated to all the other states.
It would be really easy to remove ALL of that duplication if the parser was extended to simply allow colors to be defined and passed to drawops. Since marco actually contains the theme parser, is it reasonable to consider it already forked? And if so, would you like me to patch it to add that functionality?
The result would look something like:
<draw_ops name="button_bg">
<paper="shade/gtk:bg[SELECTED]/>
<include name="button_bg_core"/>
</draw_ops>
...
<draw_ops name="button_bg_unfocused">
<paper="shade/gtk:bg[NORMAL]/>
<include name="button_bg_core"/>
</draw_ops>
...
<draw_ops name="button_bg_core">
<line color="shade/gtk:paper/1.05" x1="2" y1="height-2" x2="width-3" y2="height-2"/>
etc etc etc
with all the ops modulating a base color (a pair of colors actually) in a consistent way with a single instance of the actual drawops calls.
The upside is, literally hundreds of lines of XML, per theme, would simply vanish. Without the copypasta, any modification to the style of "Button X" would automatically propagate to "Button X Unfocused" etc. As a new feature it would be completely backwards-compatible with existing themes.
The downside is, obviously, the theme parser would be distinctly forked. So when GNOME inevitably moves on to "metacity-4" themes or whatever, there'd need to be an actual merge rather than being able to simply take their code as is.
I'm willing to - more precisely, I'm offering to - do the work to add this capability. I think it would be a trivial amount of code, and I think it would make themes much easier to maintain.
The question is, does anyone want this capability? Is there actually enough time being spent on themes for it to be worth the negatives I've mentioned and any that I've missed?