Benedikt Meurer benedikt.meurer at unix-ag.uni-siegen.de
Fri Mar 19 11:09:16 CET 2004

edscott wilson garcia wrote:
> El jue, 18-03-2004 a las 08:10, Benedikt Meurer escribió:
>>edscott wilson garcia wrote:
>>>Hey Benny,
>>Hi Edscott,
>>>Looking into the new libxfce4util/xfce-resource.c routines, I have a
>>>small comment. I would need a small function, 
>>>xfce_resource_clear(XfceResourceType type) to clear the contents of the
>>>respective glist (pop everything of the specified type). Is it OK if I
>>>commit a function to do such or would you rather do it yourself?
>>I think you misunderstood the usage of the functions. Theres no need to clear 
>>any of the GLists, as it would make the whole module useless. The push/pop are 
>>provided for modules that temporarily need to add further paths, but should 
>>not be used unless theres no other way. The preferred solution is to move the 
>>files to the locations as specified in the respective XDG standard.
> If that means the routines cannot be used to search paths for icon
> themes, or non-XDG places like where the panel icon themes are currently
> located, then nothing is gained from using the functions. If we limiting
> ourselves to XDG, then I see much easier, faster, and efficient just to
> access the XDG defined paths directly and forget about the overhead of
> loading a dynamic library. Probably the fastest approach is to use
> inline code via macros. 
>>Could you explain, why you see a need for a clear function?
> Sure. I can see much usefulness of the functions for icon themes. To
> change an icon theme on the fly you have to remove all paths to old
> theme and insert new paths to new theme. If it were just one path, no
> problem. Push and pop does the trick. But each theme can have a whole
> bunch (undetermined amount) of paths necessary to find icons. The
> easiest way is to wipe the paths clean and put in the new ones.
> Of course that would probably wipe out one or two XDG defined paths too,
> but since that's standard, there is no problem at all to reinsert them
> again. No magic to that ;-)
> Without a clear function I would have to keep count of what's been
> pushed and popped and I'm afraid I don't have time for that at this
> moment. 

Ok, got your point. But it seems to be out of scope. You can use the resource 
lookup functions to locate the base path of a new theme, like 
xfce_resource_lookup(XFCE_RESOURCE_ICONS, "<theme>/index.theme"), but using 
the resource lookup functions for each and every icon would slow down things 
too much. I think the GtkIconTheme class is better suited for this. I don't 
want to duplicate the GtkIconTheme functionality in libxfce4util.

Also imagine the following case: You clear the XFCE_RESOURCE_ICONS resources 
in a module, but the application from which the module is loaded depends on 
the "original behaviour" of the XFCE_RESOURCE_ICONS resource. That'd definetly 
cause problems.

> regards,
> Edscott  


NetBSD Operating system:                       http://www.NetBSD.org/
pkgsrc "Work in progress":                  http://pkgsrc-wip.sf.net/
XFce desktop environment:                        http://www.xfce.org/
German Unix-AG Association:                   http://www.unix-ag.org/
os-network:                                 http://www.os-network.de/

OpenPGP Key: http://www.home.unix-ag.org/bmeurer/#gpg

More information about the Xfce4-dev mailing list