[Geany-devel] Moving RC styles to a file

Matthew Brush mbrush at xxxxx
Sun Sep 30 09:39:49 UTC 2012

On 12-09-29 11:43 AM, Colomban Wendling wrote:
> Hi guys,
> I'm considering moving our hard-coded custom styles (notebook tab button
> sizing, monospaced search entries and unmatched search entries) to an
> external resource file (geany.gtkrc in the datadir) -- patch attached.
> The main reason to do this is to make it easier to replace this by a CSS
> file for my GTK3 port (attempt).  However, we can see a few other
> interesting (or not) points:
> + this removes some hard-coded stuff in a few places;
> + this actually removes an overall of 16 lines, and actually 39 lines
>    of code (those 23 lines being in the resource file);
> + easier to replace with a CSS file in the GTK3 port (and gives the
>    same advantages than with the RC files);
> - that's another file to load.

+ less memory required for the whole runtime (ie. file contents can be 
freed from memory after parsing).

> So the question is, are we happy to load another file at startup,
> besides the Glade XML?  I don't think it's a performance problem,
> moreover the file being probably stored in a near location to the Glade
> file, but since we always tried to load as less files as possible, do we
> want to add this file?
> Since now we need to load the Glade file anyway, I think it's less of a
> concern to add additional external files.  If we think external files
> are OK, maybe we'd like to also move our custom images out of images.c
> to normal files in out datadir.  Actually, we currently have 7 inline
> images (aladin (logo), build, close all, and two save all, and the two
> used in the completion popup), but also "normal" icons (for the symbol
> list for example).
> So, what do you think?

Sounds reasonable to me.

If we do want to embed some stuff into the executable later because 
startup time becomes too slow, there are cleaner and more automated ways 
that can be done by the build system, like using Resources on Windows or 
using something similar to exo-csource/xxd or GResource.

Matthew Brush

More information about the Devel mailing list