Re: Announce: gio merged

Alexander Larsson wrote:
On Tue, 2007-11-27 at 10:11 -0600, Yevgen Muntyan wrote:
Hi there,

Does GAppInfo make sense on Windows and Mac? It doesn't
build on win32, and it's not quite clear whether the fix is
to provide stubs or to remove the code completely.
What is it for, are normal applications going to use it? Perhaps
it's an X-specific (that is, specific to platforms which use
specs) functionality needed by Nautilus and friends,
while on win32 and mac all that's needed is some
g_open_file_somehow()? Perhaps applications do need
some information about "what application handles this
file type or this file", but then probably some special API
should be provided exactly for that, while a xdg desktop
wrapper should be left for X, as X-specific API.

I haven't built of Win32 in a while, so I can't say anything about the
current state. However, GAppInfo is clearly not X-specific in any way,
as its an abstract interface. There is even an Win32 implementation
gwin32appinfo.c (that at least used to work last time I tried it).

Well, here are the functions from the header:

This is not exactly unix-specific, but is indeed very unixish.

const char *g_app_info_get_id (GAppInfo *appinfo); const char *g_app_info_get_name (GAppInfo *appinfo); const char *g_app_info_get_description (GAppInfo *appinfo);

Desktop files here, and stubs on win32.

const char *g_app_info_get_executable (GAppInfo *appinfo); GIcon * g_app_info_get_icon (GAppInfo *appinfo);

Desktop file too.

gboolean g_app_info_supports_uris (GAppInfo *appinfo);

This one, isn't it from desktop file, when you have "foobar %u" line?

gboolean g_app_info_should_show (GAppInfo *appinfo,
                            const char           *desktop_env);

This one - desktop file, show in the menus or not, right?

gboolean g_app_info_set_as_default_for_type (GAppInfo *appinfo,
                            const char           *content_type,
                            GError              **error);
GAppInfo *g_app_info_get_default_for_type        (const char  *content_type,
                         gboolean     must_support_uris); thing. I guess Internet Explorer will tell about its
ideas of how to handle different content types, but most interesting
ones are in f.d.o. own database, will glib have its own mime type
database on windows? (And on mac)

gboolean g_app_info_set_as_default_for_extension (GAppInfo *appinfo,
                            const char           *extension,
                            GError              **error);
gboolean g_app_info_add_supports_type (GAppInfo *appinfo,
                            const char           *content_type,
                            GError              **error);

Same thing - applications do or do not support certain mime types,
but only on xdg you can know that.

Then, GAppLaunchContext is X-specific - display and startup notification.
All in all, it *looks* like a glib wrapper around xdg desktop
files mechanics, which is X-specific. It surely can all be implemented
on all platforms (partly with stubs), but is it needed?
Win32 is different (and dumber); Mac has yet a different set of notions
about applications, starting applications, and opening files (especially
this one, how it chooses applications for files is total mystery). Why
have rich f.d.o. API on platforms where it doesn't make sense? After
all, it's glib, not *gnome*-vfs. This stuff could do well in Gtk maybe.
Or maybe I am wrong, don't know.

Best regards,

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