![]() |
![]() |
![]() |
Thunar-VFS Reference Manual | ![]() |
---|
ThunarVfsMimeApplicationThunarVfsMimeApplication — |
#include <thunar-vfs/thunar-vfs.h> #define THUNAR_VFS_MIME_APPLICATION_ERROR enum ThunarVfsMimeApplicationError; enum ThunarVfsMimeApplicationFlags; ThunarVfsMimeApplication; ThunarVfsMimeApplication* thunar_vfs_mime_application_new_from_desktop_id (const gchar *desktop_id); ThunarVfsMimeApplication* thunar_vfs_mime_application_new_from_file (const gchar *path, const gchar *desktop_id); ThunarVfsMimeApplication* thunar_vfs_mime_application_ref (ThunarVfsMimeApplication *application); void thunar_vfs_mime_application_unref (ThunarVfsMimeApplication *application); const gchar* thunar_vfs_mime_application_get_command (const ThunarVfsMimeApplication *application); const gchar* thunar_vfs_mime_application_get_desktop_id (const ThunarVfsMimeApplication *application); ThunarVfsMimeApplicationFlags thunar_vfs_mime_application_get_flags (const ThunarVfsMimeApplication *application); const gchar* thunar_vfs_mime_application_get_name (const ThunarVfsMimeApplication *application); gboolean thunar_vfs_mime_application_exec (const ThunarVfsMimeApplication *application, GdkScreen *screen, GList *path_list, GError **error); gboolean thunar_vfs_mime_application_exec_with_env (const ThunarVfsMimeApplication *application, GdkScreen *screen, GList *path_list, gchar **envp, GError **error); const gchar* thunar_vfs_mime_application_lookup_icon_name (const ThunarVfsMimeApplication *application, GtkIconTheme *icon_theme); guint thunar_vfs_mime_application_hash (gconstpointer application); gboolean thunar_vfs_mime_application_equal (gconstpointer a, gconstpointer b);
#define THUNAR_VFS_MIME_APPLICATION_ERROR (thunar_vfs_mime_application_error_quark ())
typedef enum { THUNAR_VFS_MIME_APPLICATION_ERROR_LOCAL_FILES_ONLY, } ThunarVfsMimeApplicationError;
typedef enum /*< flags >*/ { THUNAR_VFS_MIME_APPLICATION_HIDDEN = (1 << 0L), THUNAR_VFS_MIME_APPLICATION_REQUIRES_TERMINAL = (1 << 1L), THUNAR_VFS_MIME_APPLICATION_SUPPORTS_STARTUP_NOTIFY = (1 << 2L), THUNAR_VFS_MIME_APPLICATION_SUPPORTS_MULTI = (1 << 3L), } ThunarVfsMimeApplicationFlags;
Various flags associated with a ThunarVfsMimeApplication.
THUNAR_VFS_MIME_APPLICATION_HIDDEN |
the application should not be displayed in the menu system. |
THUNAR_VFS_MIME_APPLICATION_REQUIRES_TERMINAL |
the application must be run in a terminal. |
THUNAR_VFS_MIME_APPLICATION_SUPPORTS_STARTUP_NOTIFY |
the application supports startup notification. |
THUNAR_VFS_MIME_APPLICATION_SUPPORTS_MULTI |
the application supports opening multiple documents at once (F or U ).
|
ThunarVfsMimeApplication* thunar_vfs_mime_application_new_from_desktop_id (const gchar *desktop_id);
Generates a ThunarVfsMimeApplication instance for the application
referenced by desktop_id
. Returns NULL
if desktop_id
is not valid.
The caller is responsible to free the returned instance using
thunar_vfs_mime_application_unref()
.
desktop_id : |
the id of an application's .desktop file. |
Returns : | the ThunarVfsMimeApplication for desktop_id or NULL .
|
ThunarVfsMimeApplication* thunar_vfs_mime_application_new_from_file (const gchar *path, const gchar *desktop_id);
Generates a new ThunarVfsMimeApplication for the application
described by path
and desktop_id
.
The caller is responsible to free the returned instance using
thunar_vfs_mime_application_unref()
.
You should really seldomly use this function and always
prefer thunar_vfs_mime_application_new_from_desktop_id()
.
path : |
the absolute path to the desktop file. |
desktop_id : |
the desktop-id of the file. |
Returns : | the ThunarVfsMimeApplication for desktop_id
or NULL .
|
ThunarVfsMimeApplication* thunar_vfs_mime_application_ref (ThunarVfsMimeApplication *application);
Increases the reference count on application
by one
and returns the reference to application
.
application : |
a ThunarVfsMimeApplication. |
Returns : | a reference to application .
|
void thunar_vfs_mime_application_unref (ThunarVfsMimeApplication *application);
Decreases the reference count on application
and frees
the application
object once the reference count drops
to zero.
application : |
a ThunarVfsMimeApplication. |
const gchar* thunar_vfs_mime_application_get_command (const ThunarVfsMimeApplication *application);
Returns the command line to run application
.
application : |
a ThunarVfsMimeApplication. |
Returns : | the command to run application .
|
const gchar* thunar_vfs_mime_application_get_desktop_id (const ThunarVfsMimeApplication *application);
Returns the desktop-id of application
.
application : |
a ThunarVfsMimeApplication. |
Returns : | the desktop-id of application .
|
ThunarVfsMimeApplicationFlags thunar_vfs_mime_application_get_flags (const ThunarVfsMimeApplication *application);
Returns the flags for application
.
application : |
a ThunarVfsMimeApplication. |
Returns : | the flags for application .
|
const gchar* thunar_vfs_mime_application_get_name (const ThunarVfsMimeApplication *application);
Returns the generic name of application
.
application : |
a ThunarVfsMimeApplication. |
Returns : | the generic name of application .
|
gboolean thunar_vfs_mime_application_exec (const ThunarVfsMimeApplication *application, GdkScreen *screen, GList *path_list, GError **error);
Wrapper to thunar_vfs_mime_application_exec_with_env()
, which
simply passes a NULL
pointer for the environment variables.
application : |
a ThunarVfsMimeApplication. |
screen : |
a GdkScreen or NULL to use the default screen.
|
path_list : |
a list of ThunarVfsPaths to open. |
error : |
return location for errors or NULL .
|
Returns : | TRUE if the execution succeed, else FALSE .
|
gboolean thunar_vfs_mime_application_exec_with_env (const ThunarVfsMimeApplication *application, GdkScreen *screen, GList *path_list, gchar **envp, GError **error);
Executes application
on screen
using the given path_list
. If
path_list
contains more than one ThunarVfsPath and application
doesn't support opening multiple documents at once, one
instance of application
will be spawned for every ThunarVfsPath
given in path_list
.
application : |
a ThunarVfsMimeApplication. |
screen : |
a GdkScreen or NULL to use the default screen.
|
path_list : |
a list of ThunarVfsPaths to open. |
envp : |
child's environment or NULL to inherit parent's.
|
error : |
return location for errors or NULL .
|
Returns : | TRUE if the execution succeed, else FALSE .
|
const gchar* thunar_vfs_mime_application_lookup_icon_name (const ThunarVfsMimeApplication *application, GtkIconTheme *icon_theme);
Looks up the icon name for application
in
icon_theme
. Returns NULL
if no suitable
icon is present in icon_theme
.
application : |
a ThunarVfsMimeApplication. |
icon_theme : |
a GtkIconTheme. |
Returns : | the icon name for application or
NULL .
|
guint thunar_vfs_mime_application_hash (gconstpointer application);
Converts application
to a hash value. It can be passed
to g_hash_table_new()
as the hash_func
parameter,
when using ThunarVfsMimeApplications as keys
in a GHashTable.
application : |
a ThunarVfsMimeApplication. |
Returns : | a hash value corresponding to the key. |
gboolean thunar_vfs_mime_application_equal (gconstpointer a, gconstpointer b);
Checks whether a
and b
refer to the same application.
a : |
a ThunarVfsMimeApplication. |
b : |
a ThunarVfsMimeApplication. |
Returns : | TRUE if a and b are equal.
|
<< ThunarVfsMimeDatabase | Part V. Users and Groups Handling >> |