FAQ Search Today's Posts Mark Forums Read
» Video Reviews

» Linux Archive

Linux-archive is a website aiming to archive linux email lists and to make them easily accessible for linux users/developers.


» Sponsor

» Partners

» Sponsor

Go Back   Linux Archive > Debian > Debian Development

 
 
LinkBack Thread Tools
 
Old 12-29-2007, 02:50 PM
Charles Plessy
 
Default Associating suffixes, programs and icons with MIME.

Dear developpers,

I am packaging specialised programs, such as perlprimer and treeviewx,
and I would like that when users double-click on a file they saved, the
file is opened with the relevant program. Apparently, the FreeDesktop
consortium operates this function through the internet content types
(MIME).

I have worked out the association between programs and suffixes: for
perlprimer for instance I declare the files suffixed by .ppr to be
text/x-perlprimer, and I declare that perlprimer can open files of this
type. I wrote a bried summary on the wiki:
http://wiki.debian.org/MimeTypesSupport (thanks Franklin for the
formatting).

For the association between an icon and a file type, I did not manage. I
found a document that tells how to give a name to the icons, and one
that tells where third party applications should store them:
http://standards.freedesktop.org/icon-naming-spec/icon-naming-spec-latest.html
http://standards.freedesktop.org/icon-theme-spec/icon-theme-spec-latest.html

I found the program dh_icons that appeared in the debhelper suite at
version 5.0.51. However, it seems quite GNOME-specific as it is not
fully compliant with the FreeDesktop standard. http://bugs.debian.org/448094

Is there a "Debian way" to associate icons, file types and suffixes in
FreeDesktop-compliant environments ? For instance, the
/usr/share/icons/hicolor directory (the default one) supports many
different resolutions. Should a package support all of them ? Should
.icon files be written for all icons ? If they are identical, is it
better to use symlinks ?


Have a nice day,

--
Charles Plessy
http://charles.plessy.org
Wakō, Saitama, Japan


--
To UNSUBSCRIBE, email to debian-devel-REQUEST@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmaster@lists.debian.org
 
Old 01-02-2008, 02:46 PM
Josselin Mouette
 
Default Associating suffixes, programs and icons with MIME.

Le dimanche 30 décembre 2007 * 00:50 +0900, Charles Plessy a écrit :
> For the association between an icon and a file type, I did not manage. I
> found a document that tells how to give a name to the icons, and one
> that tells where third party applications should store them:
> http://standards.freedesktop.org/icon-naming-spec/icon-naming-spec-latest.html
> http://standards.freedesktop.org/icon-theme-spec/icon-theme-spec-latest.html
>
> I found the program dh_icons that appeared in the debhelper suite at
> version 5.0.51. However, it seems quite GNOME-specific as it is not
> fully compliant with the FreeDesktop standard. http://bugs.debian.org/448094

The purpose of dh_icons is to update the caches, and it isn’t
GNOME-specific. The bug you are pointing at is not annoying for most
packages, as they use PNG or SVG, not XPM icons.

> Is there a "Debian way" to associate icons, file types and suffixes in
> FreeDesktop-compliant environments ?

I don’t think there is a generic way to do that. The GNOME way is to
provide an icon named mimetypes/gnome-mime-application-x-foobar, and it
will automatically be selected for the application/x-foobar MIME type.

> For instance, the
> /usr/share/icons/hicolor directory (the default one) supports many
> different resolutions. Should a package support all of them ?

The desktop will automatically select the most appropriate resolution
among the ones that are provided, but it is preferable to have at least
a scalable version and a 24x24 one.

> Should .icon files be written for all icons ?

The .icon files are for parameters really specific to a given icon, like
attach points for emblems or the area definition for embedded text. Most
icons don’t need them.

> If they are identical, is it better to use symlinks ?

Sure.

--
.'`.
: :' : We are debian.org. Lower your prices, surrender your code.
`. `' We will add your hardware and software distinctiveness to
`- our own. Resistance is futile.
 
Old 01-02-2008, 03:08 PM
Josselin Mouette
 
Default Associating suffixes, programs and icons with MIME.

Le mercredi 02 janvier 2008 * 16:46 +0100, Josselin Mouette a écrit :
> > Is there a "Debian way" to associate icons, file types and suffixes in
> > FreeDesktop-compliant environments ?
>
> I don’t think there is a generic way to do that. The GNOME way is to
> provide an icon named mimetypes/gnome-mime-application-x-foobar, and it
> will automatically be selected for the application/x-foobar MIME type.

I forgot to add that although this works, you should almost never do
that. This breaks icon themes in a very ugly way, and this is the reason
why the countless MIME type icons in earlier releases were replaced by a
much smaller set of generic icons.

--
.'`.
: :' : We are debian.org. Lower your prices, surrender your code.
`. `' We will add your hardware and software distinctiveness to
`- our own. Resistance is futile.
 
Old 01-03-2008, 03:32 PM
Charles Plessy
 
Default Associating suffixes, programs and icons with MIME.

Dear Josselin, thanks for your answers.

The program for which I want to add a file icon is PerlPrimer, and only
provides a 32x32 XPM icon. If I submit the following patch to the bug
448094, would you, as upstream author, recommend to the debhelper
maintainer to incorporate it ?

--- /usr/bin/dh_icons 2007-11-03 04:18:55.000000000 +0100
+++ dh_icons 2008-01-03 16:58:13.000000000 +0100
@@ -46,7 +46,7 @@
next if $subdir =~ /^./;
my $needs_cache = 0;
find sub {
- $needs_cache = 1 if -f and (/.png$/ or /.svg$/ or /.jpg$/);
+ $needs_cache = 1 if -f and (/.png$/ or /.svg$/ or /.jpg$/ or /.xpm$/);
}, "$icondir/$subdir" ;
push @dirlist, "$baseicondir/$subdir" if $needs_cache;
}


For PerlPrimer, I declared a specific mime type as text/x-perlprimer.
Apparently you suggetst that if I place an icon named
gnome-mime-text-x-perlprimer.xpm in /usr/share/icons/hicolor/32x32/mimetypes/,
it would work but break thinks. Can you give me details on the problems it
creates ?

Does anybody know if a desktop manager follows the FreeDesktop standard for
icon names? If I put an icon named text-x-perlprimer.xpm somewhere in
/usr/share/icons/hicolor/NxN/mimetypes, will it be useless everywhere ?

Lastly, for symlinks, is there any recommentation on where to put the real
file?

Have a nice day, and of course a nice year.

--
Charles Plessy
http://charles.plessy.org
Wakō, Saitama, Japan


--
To UNSUBSCRIBE, email to debian-devel-REQUEST@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmaster@lists.debian.org
 
Old 01-03-2008, 05:22 PM
Darren Salt
 
Default Associating suffixes, programs and icons with MIME.

I demand that Charles Plessy may or may not have written...

[snip]
> $needs_cache = 1 if -f and (/.png$/ or /.svg$/ or /.jpg$/ or /.xpm$/);

Why not this?
$needs_cache = 1 if -f and /.(png|svg|jpg|xpm)$/;

--
| Darren Salt | linux or ds at | nr. Ashington, | Toon
| RISC OS, Linux | youmustbejoking,demon,co,uk | Northumberland | Army
| + Buy local produce. Try to walk or cycle. TRANSPORT CAUSES GLOBAL WARMING.

Windows 95. Launched shortly before testing was complete.


--
To UNSUBSCRIBE, email to debian-devel-REQUEST@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmaster@lists.debian.org
 
Old 01-03-2008, 07:58 PM
Josselin Mouette
 
Default Associating suffixes, programs and icons with MIME.

Le vendredi 04 janvier 2008 * 01:32 +0900, Charles Plessy a écrit :
> Dear Josselin, thanks for your answers.
>
> The program for which I want to add a file icon is PerlPrimer, and only
> provides a 32x32 XPM icon. If I submit the following patch to the bug
> 448094, would you, as upstream author, recommend to the debhelper
> maintainer to incorporate it ?

I already submitted such a patch earlier today.

> For PerlPrimer, I declared a specific mime type as text/x-perlprimer.
> Apparently you suggetst that if I place an icon named
> gnome-mime-text-x-perlprimer.xpm in /usr/share/icons/hicolor/32x32/mimetypes/,
> it would work but break thinks. Can you give me details on the problems it
> creates ?

Yes, it would look utterly and absolutely ugly. XPM icons don’t have
full alpha blending, and it will get worse at sizes smaller or larger
than 32x32. Furthermore, supposing that the icon is assorted to the
default icon theme (and I doubt a 32x32 XPM icon can be), it would look
ugly with other icon themes.

As long as your MIME type is named text/x-something, the default icon
for text files will be used, and this should look *much* better with all
icon themes.

> Does anybody know if a desktop manager follows the FreeDesktop standard for
> icon names? If I put an icon named text-x-perlprimer.xpm somewhere in
> /usr/share/icons/hicolor/NxN/mimetypes, will it be useless everywhere ?

If it is useful in some places, you’d better ensure that it can look
consistently with all of them.

--
.'`. Josselin Mouette /./
: :' : josselin.mouette@ens-lyon.org
`. `' joss@debian.org
`- Debian GNU/Linux -- The power of freedom
 

Thread Tools




All times are GMT. The time now is 05:35 AM.

VBulletin, Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO ©2007, Crawlability, Inc.
Copyright 2007 - 2008, www.linux-archive.org