Re: Icons and document-types




Fred Bacon <bacon@mediaone.net> writes:

> Jim Pick wrote:
> > 
> > Hi,
> > 
> > I didn't know where to jump in on this thread, so I started a new one.
> > 
> > Conceptually, for me, icons are easy to do:
> > 
> > 1) First we identify the document type for a document.
> >        (returning an "object")
> > 
> 
> Yes, but its the "How do we identify the document type?" question that's
> the sticking point.

I think we need another object with 'hooks' where different methods of
identifying a document type can plug-into.  They'll take as input a
stream of bytes and/or a mime-type.

Some methods I can think of (sucked out of an earlier email I sent
where I described some existing implementations):

In emacs, the (set-auto-mode) function in files.el is used by
find-file (C-x C-f) to pick a major mode for a file based on it's
extension, or magic strings like '-*-MODENAME-*-' or 'mode: MODENAME'.

In Midnight Commander, there is an "extension file" which contains
rules for doing something very similar.  (source is in src/ext.c, I
think) It can match files based on filename extensions, regex magic
strings, output from the 'file' command, directories, etc.

In Gnome, emacs, midnight commander and any other app ought to use the
same code to identify files/parts and decide what to launch.

Metamail, most email browsers, and most web browsers (like Mozilla) do
a very similar sort of matching, but based on MIME types and the
mailcap file.

KDE has kfm.  It's got tonnes of this stuff implemented too.  Check it
out - it can launch various files based on file type, surf the web,
etc.  So it's a pretty close match to what we want.  With CORBA, it
could do a lot more.  In that case, the document type stuff really
ought to be a separate service from the file manager.  They store
their document types in *.kdelnk files under share/mimelnk (plus a
"magic" file) plus under share/applnk too.  It's pretty ugly.  Still,
it might be a worthwhile task to hack out their stuff, and substitute
in the Gnome CORBA-based document type stuff, just to see what they've
done and we haven't.

Win95 has something similar also, but it's too lame to copy.  Same
with OpenDoc, it just stores properties consisting of ISO strings
representing the document type in it's part editor objects.  There are
no hooks for applications to modify the binding process, I think.

There is also the <object> tag in HTML (as used by ActiveX), with
which you can refer to an CLSID which is mapped by the registry to an
object.

I'd like the Gnome document type stuff to work off the standard
mailcap file, the midnight commander "extension file", with support
for emacs mode hints, and support for CORBA based hooks.

Cheers,

 - Jim



PGP signature



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