Dnia 24-12-2006, nie o godzinie 00:28 -0800, Octavio Alvarez Piza
napisał(a):
> Hi, everybody. I'm new to the list. My name is Octavio Alvarez and I'm
> developing a small app named Superkb, intended to make something fancy
> for Xorg.
> 
> I'm converting the lookup algorithm in the Icon Theme Specification to
> C code. I have noticed that the "hicolor" fallback theme will be
> looked up before a second parent, thus, having the wrong lookup
> priority.

Why are you rewriting this from scratch if all widget toolkits already
provide such functionality?

> One of the paragraphs that says so is:
> 
> "In order to have a place for third party applications to install
> their icons there should always exist a theme called 'hicolor' [1].
> The data for the hicolor theme is available for download at:
> http://www.freedesktop.org/software/icon-theme/. Implementations are
> required to look in the "hicolor" theme if an icon was not found in
> the current theme."
> 
> This makes a second parent theme to get ignored if an icon exists in
> "hicolor". Themes that use "hicolor" as a parent should explicitly say
> so in their Inherits key.

I think I know what you mean:

> Here is a patch for the lookup pseudocode.
> 
>  FindIcon(icon, size) {
>    filename = FindIconHelper(icon, size, user selected theme);
>    if filename != none
>      return filename
> +   filename = FindIconHelper(icon, size, "hicolor");
> +   if filename != none
> +     return filename
>    return LookupFallbackIcon (icon)
>  }
>  FindIconHelper(icon, size, theme) {
>    filename = LookupIcon (icon, size, theme)
>    if filename != none
>      return filename
> 
>    if theme has parents
>      parents = theme.parents
> -  else if theme != hicolor
> -    parents = [hicolor]
> 
>    for parent in parents {
>      filename = FindIconHelper (icon, size, parent)
>      if filename != none
>        return filename
>    }

The above call in the loop is recursive so it will always reach a
grand-grand-...-parent that has no more parents and thus fall back into
"hicolor" in the first step of the "for" loop.

>    return none
>  }
> 
> It is my understanding that implementations must not look in "hicolor"
> when looking into a parent theme. Instead, it should be checked right
> before unthemed icons.

And you are probably true.

-- 
Patryk Zawadzki <[EMAIL PROTECTED]>
PLD Linux

Attachment: signature.asc
Description: To jest część listu podpisana cyfrowo

_______________________________________________
xdg mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/xdg

Reply via email to