Re: [Nautilus-list] Proposed mime/uri -> program mapping API



on 5/8/00 8:17 AM, Maciej Stachowiak at mjs eazel com wrote:

> 
> This is a very rough draft. Coments solicited. It will probably go
> through a few rounds of revisions before I implement it.
> 
> Sorry if the gtk-style formatting sucks to read in email.
> 
> - mjs

My comments interspersed below.

John



> -------------------
> 
> /* Open issues:
> *
> * * error handling
> *
> * * do programs need to be represented by something more complicated
> *   than a char *? For instance, how do we represent uri or
> *   multi-open capability?

The callers in Nautilus need to have a command-line-type string to execute.
They also need a name that can be displayed to the user, which is in the
general case not the same as the command-line-type string. (And, like you
said, we'll need some way to query for special app properties like
can-open-uri and can-open-multi.)

> * * For component-related calls, may we impose requirements?

Don't know what you mean here.

> *
> * * "program" or "application?

I like to use "program" to mean "any program, including Bonobo components"
and "application" to mean "program other than Bonobo component".

> * * Do we get the user level from GConf in the short_list calls, or
> *   does it get passed explicitly, or what?
> *
> * * Allow passing of GnomeVFSURI * instead of char *uri?

I'll bet Darin has an opinion on this, and I'll bet his opinion is "char
*uri".

> * * Interface that works with a handle?
> *
> * * Can you specify if you want "slow" or "fast" checking?

That doesn't seem important to me. We should make it always do the right
thing I think. It's weird to let it get different MIME types depending on
how it was called.
> *
> * * _for_uri calls need to get/set metadata, is that OK?

It's OK (necessary), but I think it might mean these calls need to be in
Nautilus code somewhere rather than in GnomeVFS code. (Until/unless the
metadata API gets moved to GnomeVFS.)

> */
> 
> enum GnomeVFSMimeActionType {
> GNOME_VFS_MIME_ACTION_TYPE_PROGRAM,
> GNOME_VFS_MIME_ACTION_TYPE_COMPONENT
> };
> 
> typedef enum GnomeVFSMimeActionType GnomeVFSMimeActionType;
> 
> struct GnomeVFSMimeAction {
> GnomeVFSActionType action_type;

This is probably supposed to be GnomeVFSMimeActionType action_type?

> union {
> OAF_ServerInfo *component;
> char           *program;
> } action;
> }
> 
> typedef struct GnomeVFSMimeAction GnomeVFSMimeAction;
> 
> 
> GnomeVFSMimeAction *gnome_vfs_mime_get_default_action                 (const
> char             *mime_type);
> char               *gnome_vfs_mime_get_default_program                (const
> char             *mime_type);
> OAF_ServerInfo     *gnome_vfs_mime_get_default_component              (const
> char             *mime_type);
> GList              *gnome_vfs_mime_get_short_list_programs            (const
> char             *mime_type);
> GList              *gnome_vfs_mime_get_short_list_components          (const
> char             *mime_type);
> GList              *gnome_vfs_mime_get_all_programs                   (const
> char             *mime_type);
> GList              *gnome_vfs_mime_get_all_components                 (const
> char             *mime_type);
> 
> GnomeVFSMimeAction *gnome_vfs_mime_get_default_action_for_uri         (const
> char             *uri);
> char               *gnome_vfs_mime_get_default_program_for_uri        (const
> char             *uri);
> OAF_ServerInfo     *gnome_vfs_mime_get_default_component_for_uri      (const
> char             *uri);
> GList              *gnome_vfs_mime_get_short_list_programs_for_uri    (const
> char             *mime_type);
> GList              *gnome_vfs_mime_get_short_list_components_for_uri  (const
> char             *mime_type);
> GList              *gnome_vfs_mime_get_all_programs_for_uri           (const
> char             *mime_type);
> GList              *gnome_vfs_mime_get_all_components_for_uri         (const
> char             *mime_type);
> 
> 
> 
> void                gnome_vfs_mime_set_default_action_type            (const
> char             *mime_type,
> GnomeVFSMimeActionType  action_type);
> void                gnome_vfs_mime_set_default_program                (const
> char             *mime_type,
> const char             *program);
> void                gnome_vfs_mime_set_default_component              (const
> char             *mime_type,
> const char             *component_iid);
> /* Stored as delta to current user level */
Since changes to the short-list programs & components are stored as deltas,
there need to be add/remove flavors of the calls.
> void                gnome_vfs_mime_set_short_list_programs            (const
> char             *mime_type,
> GList                  *programs);
> GList              *gnome_vfs_mime_get_short_list_components          (const
> char             *mime_type,
> GList                  *components);
Typo: Above call was meant to be "set" not "get" (but it needs to have
add/remove flavors).

> * No way to override system list; can only add. */
> void                gnome_vfs_mime_extend_all_programs                (const
> char             *mime_type,
> GList                  *programs);
> /* Only "user" entries may be removed. */
> void                gnome_vfs_mime_remove_from_all_programs           (const
> char             *mime_type,
> 
> 
> 
> void                gnome_vfs_mime_set_default_action_type_for_uri    (const
> char             *mime_type,
> GnomeVFSMimeActionType  action_type);
> void                gnome_vfs_mime_set_default_program_for_uri        (const
> char             *mime_type,
> const char             *program);
> void                gnome_vfs_mime_set_default_component_for_uri      (const
> char             *mime_type,
> const char             *component_iid);
> /* Stored as delta to current user level */
Since changes to the short-list programs & components are stored as deltas,
there need to be add/remove flavors of the calls.

> void                gnome_vfs_mime_set_short_list_programs_for_uri    (const
> char             *mime_type,
> GList                  *programs);
> GList              *gnome_vfs_mime_get_short_list_components_for_uri  (const
> char             *mime_type,
> GList                  *components);
Typo: Above call was meant to be "set" not "get" (but it needs to have
add/remove flavors).


> /* No way to override system list; can only add. */
> void                gnome_vfs_mime_extend_all_programs_for_uri        (const
> char             *mime_type,
> GList                  *programs);
> /* Only "user" entries may be removed. */
> void                gnome_vfs_mime_remove_from_all_programs_for_uri   (const
> char             *mime_type,
> GList                  *programs);
> /* No way to add to all components; oafinfo database assumed trusted in this
> regard. */
> 
> 
> 
> void                gnome_vfs_mime_action_free
> (GnomeVFSMimeAction *action);
> 
> 
> 
> 
> _______________________________________________
> Nautilus-list mailing list
> Nautilus-list lists eazel com
> http://www.eazel.com/mailman/listinfo/nautilus-list





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