emblems api

Peter de Ridder peter at xfce.org
Sun Jul 19 22:27:23 CEST 2009


I want to discuss an emblem api of some sort.
This topic has past a few times, here and on the freedesktop mailing list.

= Introduction =

The results I found so for are the emblems context in
http://standards.freedesktop.org/icon-naming-spec/icon-naming-spec-latest.html
and http://www.freedesktop.org/wiki/Specifications/desktop-emblem-spec
This specifications only specify ways to find emblems, not a way to
connect/store them to files/directories.

In the freedesktop mailing list is a thread about an api to be able to
load emblems cross desktop: Icon names vs. emblems
This thread has no final conclusion. And I don't agree with the
provided suggestion (but  that could be just me ;) ).
The thread doesn't specify any means to determine which emblems should
be "connected" to which files.

= Goals =

My goal of this mail is:
1. Decide a way how we like to connect/store emblems to files.
2. Possibly post our suggestion to freedesktop.org

= Current emblems in Thunar =

Currently emblems are stored in .cache/Thunar/metafile.tdb
This file can only be changed from Thunar using the file properties dialog.
Thunar also adds some emblems automatically based on file permissions.
This has as drawback only the user can set emblems manually (except
for the file permissions emblems) and those are only used by Thunar.

In the current implementation it is not possible for other
applications to set emblems in thunar. Plugins like thunar-vcs-plugin
would like to set some emblems.
Other applications can't show emblems as they are set in Thunar.
Making an standard would resolve this problem.

= New api =

What should a new api be able to do?
1. Manually set emblems for files
2. Provide a way for plugins to set emblems
3. Make emblem settings desktop environment independent

= Suggestions =

I could come up with the following suggestions.

1. Store emblems on a specified location in a specified format, like
places in gtk.
2. Create a DBus api to query emblems for a file, thumbler like.
3. Create a plugin api, like the Thunar context menu.

Pros cons:
1 is fast makes it easy to be cross desktop, but a program like
thunar-vcs-plugin would need to run in the background listen for file
changes to update the emblems for all the files on the in version
control.
So 1 would be easy for file browsers, but would emblem "providers"
need to run in the background.
2 would be slower since it need to query for the emblems and it would
need a DBus service for applications which provide emblems.
Either Thunar or a emblem provider would implement some sort of
caching to speed things up. Static emblems can be stored like option 1
to speed thing up, don't know if that would help.
3 would be slower than 1 but faster as 2, I guess and it doesn't need
and application to run in the background.
3 wouldn't really be cross desktop, there could be a plugin which
reads static emblem information from other desktop environments or for
static emblems option 1 can be used.
Dynamic emblems in option 3 wouldn't be cross desktop, but there will
probably be plugins for every desktop which provide these emblems.

Sub conclusion:
1 comes back in all suggestions to provide static (user defined) cross
desktop emblems. Only in option 2 this wouldn't be neccesary if the
user defined emblems are provides by 1 DBus service for all desktops
(like that's going to happen).
The problem lays with the dynamic emblems. This can be done by using
the same storage as user defined emblems (1). Make a cross desktop
DBus api (2). Solve this in every desktop environment since these
plugins would be written for all environments anyway (3).


I would like to find some solution for Thunar and maybe we can suggest
a cross desktop solution to freedesktop.org

Kind regards,
Peter



More information about the Xfce4-dev mailing list