icon factories

Jasper Huijsmans jasper at moongroup.com
Thu Dec 18 09:35:50 CET 2003

Op do 18-12-2003, om 03:43 schreef edscott wilson garcia:
> Hey Jazman,
>   I started looking at your code for icon factories and I don't
> comprendo the need for gtkrc files. I find that gtkrc files to define
> widget styles and keybindings, but not as a means for defining icon
> themes. I find you statically define the icon file names in the array

The names are not file names but stock id's. It is equivalent to what
you do in the xml file, but instead using gtk's builtin mechanisms. Gtk
uses this for its own stock icon system.

The gtk rc links a stock id with a file name. It also allows you to add
different files for different icon states and sizes, if you want.

I don't know how the support in 2.4 for icon themes is implemented and
whether it interoperates with the stock icon system or simply is another
implementation of icon themeing.

> static struct _XfceDefaultIcon default_icons[]={...};
> The approach I used in the mime_icon module was to create an xml file
> (mime.xml) for each theme, so that different file names can be used for
> different themes. The equivalent of the default_icons[] array are the
> following lines (using the xfce mime type):
>   <mime-type type="xfce/newmail" icon="newmail.png"/>
>   <mime-type type="xfce/terminal" icon="terminal.png"/>
>   <mime-type type="xfce/sound" icon="sound.png"/>
>   <mime-type type="xfce/schedule" icon="schedule.png"/>
>   <mime-type type="xfce/print" icon="print.png"/>
>   <mime-type type="xfce/paint" icon="paint.png"/>
>   <mime-type type="xfce/network" icon="network.png"/>
>   <mime-type type="xfce/multimedia" icon="multimedia.png"/>
>   <mime-type type="xfce/man" icon="man.png"/>
>   <mime-type type="xfce/games" icon="games.png"/>
>   <mime-type type="xfce/file2" icon="file2.png"/>
>   <mime-type type="xfce/file1" icon="file1.png"/>
>   <mime-type type="xfce/edit" icon="edit.png"/>
>   <mime-type type="xfce/unknown" icon="unknown.png"/>
> The mime_icons module is still missing the following types which you
> define:
>     {XFCE_MINI_EXIT, "minipower.png"},
>     {XFCE_MINI_INFO, "miniinfo.png"},
>     {XFCE_MINI_LOCK, "minilock.png"},
>     {XFCE_MINI_SETUP, "minipalet.png"},
>     {XFCE_NOMAIL, "nomail.png"},

Your implementation is mostly equivalent I believe, I was simply
offering an alternative view that may allow us to make better use of gtk
functionality and save us from having to maintain that part ourselves.

I'm not sure the stock id system is a particularly good idea for mime
icons, as it seems to be designed for a limited number of icons. So,
your implementation may be better suited, I just wanted to make sure we
aren't unnecessarily duplicating gtk functionality.

> Type "xfce/unknown" with icon "unknown.png" is what you refer to as
> XFCE_DEFAULT. I rather put the xfce mouse logo as the xfce/default type
> since in a more general icon factory scenario it can refer to more
> diverse objects.

The mouse is nice, but perhaps not particularly suited for small icons
(menu size).


More information about the Xfce4-dev mailing list