1 *** gio/gdesktopappinfo.c 2009-10-16 23:57:29.436561111 -0400
2 --- gio/gdesktopappinfo.c 2009-10-17 00:06:28.716984254 -0400
6 static void mime_info_cache_reload (const char *dir);
7 static gboolean g_desktop_app_info_ensure_saved (GDesktopAppInfo *info,
10 + g_desktop_app_info_launch_handler_on_launched (GDesktopAppInfoLaunchHandler *launch_handler,
11 + const char *desktop_file_path,
19 g_setenv ("DESKTOP_STARTUP_ID", data->sn_id, TRUE);
23 + g_desktop_app_info_on_launched (const char *desktop_file_path, gint pid)
25 + static gsize lookup = 0;
27 + if (g_once_init_enter (&lookup))
29 + gsize setup_value = 1;
30 + GDesktopAppInfoLaunchHandler *lookup_instance;
31 + GIOExtensionPoint *ep;
32 + GIOExtension *extension;
35 + /* Ensure vfs in modules loaded */
36 + _g_io_modules_ensure_loaded ();
38 + ep = g_io_extension_point_lookup (G_DESKTOP_APP_INFO_LAUNCH_HANDLER_EXTENSION_POINT_NAME);
40 + lookup_instance = NULL;
41 + for (l = g_io_extension_point_get_extensions (ep); l != NULL; l = l->next)
43 + extension = l->data;
44 + lookup_instance = g_object_new (g_io_extension_get_type (extension), NULL);
45 + if (lookup_instance != NULL)
49 + if (lookup_instance != NULL)
50 + setup_value = (gsize)lookup_instance;
52 + g_once_init_leave (&lookup, setup_value);
58 + g_desktop_app_info_launch_handler_on_launched (G_DESKTOP_APP_INFO_LAUNCH_HANDLER (lookup), desktop_file_path, pid);
62 g_desktop_app_info_launch_uris (GAppInfo *appinfo,
66 g_list_free (launched_files);
69 if (!g_spawn_async (info->path,
80 g_list_free (launched_files);
84 if (!g_spawn_async (info->path,
102 + g_desktop_app_info_on_launched (info->filename, pid);
106 g_free (data.display);
110 return (* iface->get_default_for_uri_scheme) (lookup, uri_scheme);
113 + /* GDesktopAppInfoLaunchHandler interface: */
115 + static void g_desktop_app_info_launch_handler_base_init (gpointer g_class);
116 + static void g_desktop_app_info_launch_handler_class_init (gpointer g_class,
117 + gpointer class_data);
120 + g_desktop_app_info_launch_handler_get_type (void)
122 + static volatile gsize g_define_type_id__volatile = 0;
124 + if (g_once_init_enter (&g_define_type_id__volatile))
126 + const GTypeInfo desktop_app_info_launch_handler_info =
128 + sizeof (GDesktopAppInfoLaunchHandlerIface), /* class_size */
129 + g_desktop_app_info_launch_handler_base_init, /* base_init */
130 + NULL, /* base_finalize */
131 + g_desktop_app_info_launch_handler_class_init,
132 + NULL, /* class_finalize */
133 + NULL, /* class_data */
135 + 0, /* n_preallocs */
138 + GType g_define_type_id =
139 + g_type_register_static (G_TYPE_INTERFACE, I_("GDesktopAppInfoLaunchHandler"),
140 + &desktop_app_info_launch_handler_info, 0);
142 + g_type_interface_add_prerequisite (g_define_type_id, G_TYPE_OBJECT);
144 + g_once_init_leave (&g_define_type_id__volatile, g_define_type_id);
147 + return g_define_type_id__volatile;
151 + g_desktop_app_info_launch_handler_class_init (gpointer g_class,
152 + gpointer class_data)
157 + g_desktop_app_info_launch_handler_base_init (gpointer g_class)
162 + g_desktop_app_info_launch_handler_on_launched (GDesktopAppInfoLaunchHandler *launch_handler,
163 + const char *desktop_file_path,
166 + GDesktopAppInfoLaunchHandlerIface *iface;
168 + g_return_if_fail (G_IS_DESKTOP_APP_INFO_LAUNCH_HANDLER (launch_handler));
170 + iface = G_DESKTOP_APP_INFO_LAUNCH_HANDLER_GET_IFACE (launch_handler);
172 + (* iface->on_launched) (launch_handler, desktop_file_path, pid);
175 #define __G_DESKTOP_APP_INFO_C__
176 #include "gioaliasdef.c"
178 *** gio/gdesktopappinfo.h 2009-03-31 19:04:20.000000000 -0400
179 --- gio/gdesktopappinfo.h 2009-07-21 20:34:35.565657314 -0400
183 GAppInfo *g_desktop_app_info_lookup_get_default_for_uri_scheme (GDesktopAppInfoLookup *lookup,
184 const char *uri_scheme);
188 + #define G_TYPE_DESKTOP_APP_INFO_LAUNCH_HANDLER (g_desktop_app_info_launch_handler_get_type ())
189 + #define G_DESKTOP_APP_INFO_LAUNCH_HANDLER(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), G_TYPE_DESKTOP_APP_INFO_LAUNCH_HANDLER, GDesktopAppInfoLaunchHandler))
190 + #define G_IS_DESKTOP_APP_INFO_LAUNCH_HANDLER(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), G_TYPE_DESKTOP_APP_INFO_LAUNCH_HANDLER))
191 + #define G_DESKTOP_APP_INFO_LAUNCH_HANDLER_GET_IFACE(obj) (G_TYPE_INSTANCE_GET_INTERFACE ((obj), G_TYPE_DESKTOP_APP_INFO_LAUNCH_HANDLER, GDesktopAppInfoLaunchHandlerIface))
194 + * G_DESKTOP_APP_INFO_LAUNCH_HANDLER_EXTENSION_POINT_NAME:
196 + * Extension point for default handler to launching. See
197 + * <link linkend="extending-gio">Extending GIO</link>.
199 + #define G_DESKTOP_APP_INFO_LAUNCH_HANDLER_EXTENSION_POINT_NAME "gio-desktop-app-info-launch-handler"
201 + typedef struct _GDesktopAppInfoLaunchHandler GDesktopAppInfoLaunchHandler;
202 + typedef struct _GDesktopAppInfoLaunchHandlerIface GDesktopAppInfoLaunchHandlerIface;
204 + struct _GDesktopAppInfoLaunchHandlerIface
206 + GTypeInterface g_iface;
208 + void (* on_launched) (GDesktopAppInfoLaunchHandler *launch_handler,
209 + const char *desktop_file_path,
213 + GType g_desktop_app_info_launch_handler_get_type (void) G_GNUC_CONST;
217 #endif /* __G_DESKTOP_APP_INFO_H__ */
219 *** gio/giomodule.c 2009-03-31 19:04:20.000000000 -0400
220 --- gio/giomodule.c 2009-07-21 20:40:32.738157079 -0400
225 ep = g_io_extension_point_register (G_DESKTOP_APP_INFO_LOOKUP_EXTENSION_POINT_NAME);
226 g_io_extension_point_set_required_type (ep, G_TYPE_DESKTOP_APP_INFO_LOOKUP);
228 + ep = g_io_extension_point_register (G_DESKTOP_APP_INFO_LAUNCH_HANDLER_EXTENSION_POINT_NAME);
229 + g_io_extension_point_set_required_type (ep, G_TYPE_DESKTOP_APP_INFO_LAUNCH_HANDLER);
232 ep = g_io_extension_point_register (G_LOCAL_DIRECTORY_MONITOR_EXTENSION_POINT_NAME);