Top | ![]() |
![]() |
![]() |
![]() |
MateDesktopItem *
mate_desktop_item_new (void
);
Creates a MateDesktopItem object. The reference count on the returned value is set to '1'.
MateDesktopItem * mate_desktop_item_new_from_file (const char *file
,MateDesktopItemLoadFlags flags
,GError **error
);
This function loads 'file' and turns it into a MateDesktopItem.
MateDesktopItem * mate_desktop_item_new_from_uri (const char *uri
,MateDesktopItemLoadFlags flags
,GError **error
);
This function loads 'uri' and turns it into a MateDesktopItem.
MateDesktopItem * mate_desktop_item_new_from_string (const char *uri
,const char *string
,gssize length
,MateDesktopItemLoadFlags flags
,GError **error
);
This function turns the contents of the string into a MateDesktopItem.
MateDesktopItem * mate_desktop_item_new_from_basename (const char *basename
,MateDesktopItemLoadFlags flags
,GError **error
);
This function loads 'basename' from a system data directory and returns its MateDesktopItem.
MateDesktopItem *
mate_desktop_item_copy (const MateDesktopItem *item
);
Creates a copy of a MateDesktopItem. The new copy has a refcount of 1. Note: Section stack is NOT copied.
gboolean mate_desktop_item_save (MateDesktopItem *item
,const char *under
,gboolean force
,GError **error
);
Writes the specified item to disk. If the 'under' is NULL, the original location is used. It sets the location of this entry to point to the new location.
item |
A desktop item |
|
under |
A new uri (location) for this MateDesktopItem |
|
force |
Save even if it wasn't modified |
|
error |
GError return |
MateDesktopItem *
mate_desktop_item_ref (MateDesktopItem *item
);
Increases the reference count of the specified item.
void
mate_desktop_item_unref (MateDesktopItem *item
);
Decreases the reference count of the specified item, and destroys the item if there are no more references left.
int mate_desktop_item_launch (const MateDesktopItem *item
,GList *file_list
,MateDesktopItemLaunchFlags flags
,GError **error
);
This function runs the program listed in the specified 'item', optionally appending additional arguments to its command line. It uses g_shell_parse_argv to parse the the exec string into a vector which is then passed to g_spawn_async for execution. This can return all the errors from MateURL, g_shell_parse_argv and g_spawn_async, in addition to it's own. The files are only added if the entry defines one of the standard % strings in it's Exec field.
item |
A desktop item |
|
file_list |
Files/URIs to launch this item with, can be |
|
flags |
FIXME |
|
error |
FIXME |
int mate_desktop_item_launch_with_env (const MateDesktopItem *item
,GList *file_list
,MateDesktopItemLaunchFlags flags
,char **envp
,GError **error
);
See mate_desktop_item_launch for a full description. This function additionally passes an environment vector for the child process which is to be launched.
int mate_desktop_item_launch_on_screen (const MateDesktopItem *item
,GList *file_list
,MateDesktopItemLaunchFlags flags
,GdkScreen *screen
,int workspace
,GError **error
);
See mate_desktop_item_launch for a full description. This function additionally attempts to launch the application on a given screen and workspace.
int mate_desktop_item_drop_uri_list (const MateDesktopItem *item
,const char *uri_list
,MateDesktopItemLaunchFlags flags
,GError **error
);
A list of files or urls dropped onto an icon, the proper (Url or File) exec is run you can pass directly string that you got as the text/uri-list. This just parses the list and calls
int mate_desktop_item_drop_uri_list_with_env (const MateDesktopItem *item
,const char *uri_list
,MateDesktopItemLaunchFlags flags
,char **envp
,GError **error
);
See mate_desktop_item_drop_uri_list for a full description. This function additionally passes an environment vector for the child process which is to be launched.
gboolean
mate_desktop_item_exists (const MateDesktopItem *item
);
Attempt to figure out if the program that can be executed by this item actually exists. First it tries the TryExec attribute to see if that contains a program that is in the path. Then if there is no such attribute, it tries the first word of the Exec attribute.
MateDesktopItemType
mate_desktop_item_get_entry_type (const MateDesktopItem *item
);
Gets the type attribute (the 'Type' field) of the item. This should usually be 'Application' for an application, but it can be 'Directory' for a directory description. There are other types available as well. The type usually indicates how the desktop item should be handeled and how the 'Exec' field should be handeled.
void mate_desktop_item_set_entry_type (MateDesktopItem *item
,MateDesktopItemType type
);
const char *
mate_desktop_item_get_location (const MateDesktopItem *item
);
void mate_desktop_item_set_location (MateDesktopItem *item
,const char *location
);
Set's the 'location' uri of this item.
void mate_desktop_item_set_location_file (MateDesktopItem *item
,const char *file
);
Set's the 'location' uri of this item to the given file
.
MateDesktopItemStatus
mate_desktop_item_get_file_status (const MateDesktopItem *item
);
This function checks the modification time of the on-disk file to see if it is more recent than the in-memory data.
char * mate_desktop_item_get_icon (const MateDesktopItem *item
,GtkIconTheme *icon_theme
);
This function goes and looks for the icon file. If the icon
is not set as an absolute filename, this will look for it in the standard places.
If it can't find the icon, it will return NULL
char * mate_desktop_item_find_icon (GtkIconTheme *icon_theme
,const char *icon
,int desired_size
,int flags
);
This function goes and looks for the icon file. If the icon
is not an absolute filename, this will look for it in the standard places.
If it can't find the icon, it will return NULL
gboolean mate_desktop_item_attr_exists (const MateDesktopItem *item
,const char *attr
);
const char * mate_desktop_item_get_string (const MateDesktopItem *item
,const char *attr
);
void mate_desktop_item_set_string (MateDesktopItem *item
,const char *attr
,const char *value
);
const char * mate_desktop_item_get_attr_locale (const MateDesktopItem *item
,const char *attr
);
const char * mate_desktop_item_get_localestring (const MateDesktopItem *item
,const char *attr
);
const char * mate_desktop_item_get_localestring_lang (const MateDesktopItem *item
,const char *attr
,const char *language
);
GList * mate_desktop_item_get_languages (const MateDesktopItem *item
,const char *attr
);
void mate_desktop_item_set_localestring (MateDesktopItem *item
,const char *attr
,const char *value
);
void mate_desktop_item_set_localestring_lang (MateDesktopItem *item
,const char *attr
,const char *language
,const char *value
);
void mate_desktop_item_clear_localestring (MateDesktopItem *item
,const char *attr
);
char ** mate_desktop_item_get_strings (const MateDesktopItem *item
,const char *attr
);
void mate_desktop_item_set_strings (MateDesktopItem *item
,const char *attr
,char **strings
);
gboolean mate_desktop_item_get_boolean (const MateDesktopItem *item
,const char *attr
);
void mate_desktop_item_set_boolean (MateDesktopItem *item
,const char *attr
,gboolean value
);
void mate_desktop_item_set_launch_time (MateDesktopItem *item
,guint32 timestamp
);
void mate_desktop_item_clear_section (MateDesktopItem *item
,const char *section
);
#define MATE_DESKTOP_ITEM_GENERIC_NAME "GenericName" /* localestring */
#define MATE_DESKTOP_ITEM_TERMINAL_OPTIONS "TerminalOptions" /* string */