Re: On Emblems



On Wed, Jul 30, 2008 at 4:56 PM, Clemens Buss <cebuzz gmail com> wrote:
> Hi,
>
> ok let's see now...
>
>> From what I gathered above, the main features in your api are
>> 1) and icon can have multiple emblems
>> 2) each emblem can have a  type or origin
>> 3) you can get the emblems back
>>
>> I think this can easily be achieved in GEmblemedIcon by allowing it to
>> have more than
>> one emblem, and associate some extra information with it. Like
>
> More than one emblem is really a must, in my opinion. For solving the
> issues with the device icons, one emblem is probably enough but not for
> tackling the other cases, which I already talked about.
>
>> g_emblemed_icon_add_emblem (GEmblemedIcon *icon,
>>                                                      GIcon
>>      *emblem,
>>                                                      const char
>>    *origin)
>
> Could you expand on how you would implement that within gemblemedicon?
> I don't see the code in front of me right now...
> Would you extend the instance-struct with a GList of emblems or sth alike?
> Or would you just provide a function which does the recursion? But
> aren't we implementing a single-linked list then?

g_emblemed_icon_add_emblem (GEmblemedIcon *icon,
                                                     GIcon *emblem_icon,
                                                     const char *origin)
{
  GEmblem *emblem;

  emblem = g_new (GEmblem, 1);
  emblem->icon = g_object_ref (emblem_icon);
  emblem->origin = g_strdup (origin);

  icon->emblems = g_list_append (icon->emblems, emblem);
}

Or something along those lines. As you can see,  a GEmblem struct would
appear in this implementation as well. Open for discussion whether it should
be exposed as an object or not.

>
> Esthetically, I just think that themed and file icons on the one hand
> and an emblemed icon on the other hand are different. With themed and
> file icons we say that an icon comes from a file or should be looked up
> in a theme.
> Compared with this an icon with emblems is an icon with some other icons
> on top of it. I would prefer to have that represented in the API.

But doesn't GEmblemedIcon represent that difference nicely ?


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]