2007-02-03 05:05:30 -08:00
|
|
|
#ifndef EFREET_DESKTOP_H
|
|
|
|
#define EFREET_DESKTOP_H
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @file efreet_desktop.h
|
2007-09-06 09:15:10 -07:00
|
|
|
* @brief Contains the structures and methods used to support the
|
2007-02-03 05:05:30 -08:00
|
|
|
* FDO desktop entry specificiation.
|
|
|
|
* @addtogroup Efreet_Desktop Efreet_Desktop: The FDO Desktop Entry
|
2007-09-06 09:15:10 -07:00
|
|
|
* Specification functions and structures
|
2007-02-03 05:05:30 -08:00
|
|
|
*
|
|
|
|
* @{
|
|
|
|
*/
|
|
|
|
|
2007-11-04 01:32:35 -08:00
|
|
|
EAPI extern int EFREET_DESKTOP_TYPE_APPLICATION;
|
|
|
|
EAPI extern int EFREET_DESKTOP_TYPE_LINK;
|
|
|
|
EAPI extern int EFREET_DESKTOP_TYPE_DIRECTORY;
|
2007-02-03 05:05:30 -08:00
|
|
|
|
2010-03-25 22:33:12 -07:00
|
|
|
/**
|
|
|
|
* Event id for cache update. All users of efreet_desktop_get must listen to
|
|
|
|
* this event and refetch. The old eet cache will be closed and mem will
|
|
|
|
* be invalidated.
|
|
|
|
*/
|
2010-04-15 12:21:03 -07:00
|
|
|
EAPI extern int EFREET_EVENT_DESKTOP_CACHE_UPDATE;
|
2010-03-25 22:33:12 -07:00
|
|
|
|
2007-02-03 05:05:30 -08:00
|
|
|
/**
|
|
|
|
* Efreet_Desktop
|
|
|
|
*/
|
2009-02-08 17:11:27 -08:00
|
|
|
typedef struct _Efreet_Desktop Efreet_Desktop;
|
2007-02-03 05:05:30 -08:00
|
|
|
|
|
|
|
/**
|
|
|
|
* A callback used with efreet_desktop_command_get()
|
|
|
|
*/
|
2008-02-19 20:10:02 -08:00
|
|
|
typedef void *(*Efreet_Desktop_Command_Cb) (void *data, Efreet_Desktop *desktop,
|
2007-02-05 13:16:55 -08:00
|
|
|
char *command, int remaining);
|
2007-02-03 05:05:30 -08:00
|
|
|
|
|
|
|
/**
|
|
|
|
* A callback used to get download progress of remote uris
|
|
|
|
*/
|
2007-09-06 09:15:10 -07:00
|
|
|
typedef int (*Efreet_Desktop_Progress_Cb) (void *data, Efreet_Desktop *desktop,
|
2007-02-05 13:16:55 -08:00
|
|
|
char *uri, long int total, long int current);
|
2007-02-03 05:05:30 -08:00
|
|
|
|
2007-02-05 12:23:31 -08:00
|
|
|
/**
|
|
|
|
* A callback used to parse data for custom types
|
|
|
|
*/
|
|
|
|
typedef void *(*Efreet_Desktop_Type_Parse_Cb) (Efreet_Desktop *desktop, Efreet_Ini *ini);
|
|
|
|
|
2007-02-05 13:16:55 -08:00
|
|
|
/**
|
|
|
|
* A callback used to save data for custom types
|
|
|
|
*/
|
|
|
|
typedef void (*Efreet_Desktop_Type_Save_Cb) (Efreet_Desktop *desktop, Efreet_Ini *ini);
|
|
|
|
|
2007-02-05 12:23:31 -08:00
|
|
|
/**
|
|
|
|
* A callback used to free data for custom types
|
|
|
|
*/
|
|
|
|
typedef void *(*Efreet_Desktop_Type_Free_Cb) (void *data);
|
|
|
|
|
2007-02-03 05:05:30 -08:00
|
|
|
/**
|
|
|
|
* Efreet_Desktop
|
|
|
|
* @brief a parsed representation of a .desktop file
|
|
|
|
*/
|
2009-02-08 17:11:27 -08:00
|
|
|
struct _Efreet_Desktop
|
2007-02-03 05:05:30 -08:00
|
|
|
{
|
2007-02-05 13:16:55 -08:00
|
|
|
int type; /**< type of desktop file */
|
2007-09-06 09:15:10 -07:00
|
|
|
|
2007-06-14 08:53:02 -07:00
|
|
|
int ref; /**< reference count - internal */
|
2007-02-03 05:05:30 -08:00
|
|
|
|
2010-01-24 13:21:27 -08:00
|
|
|
char *version; /**< version of spec file conforms to */
|
2007-02-03 05:05:30 -08:00
|
|
|
|
|
|
|
char *orig_path; /**< original path to .desktop file */
|
2007-09-06 09:15:10 -07:00
|
|
|
long long load_time; /**< modified time of .desktop on disk */
|
2007-02-03 05:05:30 -08:00
|
|
|
|
|
|
|
char *name; /**< Specific name of the application */
|
|
|
|
char *generic_name; /**< Generic name of the application */
|
|
|
|
char *comment; /**< Tooltip for the entry */
|
|
|
|
char *icon; /**< Icon to display in file manager, menus, etc */
|
|
|
|
char *try_exec; /**< Binary to determine if app is installed */
|
|
|
|
char *exec; /**< Program to execute */
|
|
|
|
char *path; /**< Working directory to run app in */
|
|
|
|
char *startup_wm_class; /**< If specified will map at least one window with
|
|
|
|
the given string as it's WM class or WM name */
|
|
|
|
char *url; /**< URL to access if type is EFREET_TYPE_LINK */
|
|
|
|
|
* estickies,
* etk,
* PROTO/exalt,
* E-MODULES-EXTRA/diskio,
* E-MODULES-EXTRA/drawer,
* E-MODULES-EXTRA/penguins,
* E-MODULES-EXTRA/slideshow,
* E-MODULES-EXTRA/mail,
* E-MODULES-EXTRA/forecasts,
* E-MODULES-EXTRA/iiirk,
* E-MODULES-EXTRA/places,
* e,
* ewl,
* ecore,
* elitaire,
* entrance,
* e_dbus,
* efreet: Here we go, move from Ecore_List to Eina_List.
NOTE: This patch is huge, I did test it a lot, and I hope nothing is
broken. But if you think something change after this commit, please
contact me ASAP.
SVN revision: 39200
2009-02-25 03:03:47 -08:00
|
|
|
Eina_List *only_show_in; /**< list of environments that should
|
2007-02-03 05:05:30 -08:00
|
|
|
display the icon */
|
* estickies,
* etk,
* PROTO/exalt,
* E-MODULES-EXTRA/diskio,
* E-MODULES-EXTRA/drawer,
* E-MODULES-EXTRA/penguins,
* E-MODULES-EXTRA/slideshow,
* E-MODULES-EXTRA/mail,
* E-MODULES-EXTRA/forecasts,
* E-MODULES-EXTRA/iiirk,
* E-MODULES-EXTRA/places,
* e,
* ewl,
* ecore,
* elitaire,
* entrance,
* e_dbus,
* efreet: Here we go, move from Ecore_List to Eina_List.
NOTE: This patch is huge, I did test it a lot, and I hope nothing is
broken. But if you think something change after this commit, please
contact me ASAP.
SVN revision: 39200
2009-02-25 03:03:47 -08:00
|
|
|
Eina_List *not_show_in; /**< list of environments that shoudn't
|
2007-02-03 05:05:30 -08:00
|
|
|
display the icon */
|
* estickies,
* etk,
* PROTO/exalt,
* E-MODULES-EXTRA/diskio,
* E-MODULES-EXTRA/drawer,
* E-MODULES-EXTRA/penguins,
* E-MODULES-EXTRA/slideshow,
* E-MODULES-EXTRA/mail,
* E-MODULES-EXTRA/forecasts,
* E-MODULES-EXTRA/iiirk,
* E-MODULES-EXTRA/places,
* e,
* ewl,
* ecore,
* elitaire,
* entrance,
* e_dbus,
* efreet: Here we go, move from Ecore_List to Eina_List.
NOTE: This patch is huge, I did test it a lot, and I hope nothing is
broken. But if you think something change after this commit, please
contact me ASAP.
SVN revision: 39200
2009-02-25 03:03:47 -08:00
|
|
|
Eina_List *categories; /**< Categories in which item should be shown */
|
|
|
|
Eina_List *mime_types; /**< The mime types supppored by this app */
|
2007-02-03 05:05:30 -08:00
|
|
|
|
2010-03-01 10:16:32 -08:00
|
|
|
unsigned char no_display; /**< Don't display this application in menus */
|
|
|
|
unsigned char hidden; /**< User delete the item */
|
|
|
|
unsigned char terminal; /**< Does the program run in a terminal */
|
|
|
|
unsigned char startup_notify; /**< The starup notify settings of the app */
|
|
|
|
unsigned char cached:1; /**< The desktop file is cached by Efreet */
|
|
|
|
unsigned char eet:1; /**< The desktop file is in eet cache */
|
2007-02-03 05:05:30 -08:00
|
|
|
|
2008-12-17 07:33:43 -08:00
|
|
|
Eina_Hash *x; /**< Keep track of all user extensions, keys that begin with X- */
|
2007-02-05 12:23:31 -08:00
|
|
|
void *type_data; /**< Type specific data for custom types */
|
2007-02-03 05:05:30 -08:00
|
|
|
};
|
|
|
|
|
2007-11-04 01:32:35 -08:00
|
|
|
EAPI Efreet_Desktop *efreet_desktop_get(const char *file);
|
|
|
|
EAPI int efreet_desktop_ref(Efreet_Desktop *desktop);
|
|
|
|
EAPI Efreet_Desktop *efreet_desktop_empty_new(const char *file);
|
|
|
|
EAPI Efreet_Desktop *efreet_desktop_new(const char *file);
|
2010-03-15 12:57:57 -07:00
|
|
|
EAPI Efreet_Desktop *efreet_desktop_uncached_new(const char *file);
|
2007-11-04 01:32:35 -08:00
|
|
|
EAPI void efreet_desktop_free(Efreet_Desktop *desktop);
|
2010-03-01 10:16:32 -08:00
|
|
|
#define efreet_desktop_unref(desktop) efreet_desktop_free((desktop))
|
2007-02-03 05:05:30 -08:00
|
|
|
|
2007-11-04 01:32:35 -08:00
|
|
|
EAPI int efreet_desktop_save(Efreet_Desktop *desktop);
|
|
|
|
EAPI int efreet_desktop_save_as(Efreet_Desktop *desktop,
|
2007-02-03 05:05:30 -08:00
|
|
|
const char *file);
|
|
|
|
|
2007-11-04 01:32:35 -08:00
|
|
|
EAPI void efreet_desktop_exec(Efreet_Desktop *desktop,
|
* estickies,
* etk,
* PROTO/exalt,
* E-MODULES-EXTRA/diskio,
* E-MODULES-EXTRA/drawer,
* E-MODULES-EXTRA/penguins,
* E-MODULES-EXTRA/slideshow,
* E-MODULES-EXTRA/mail,
* E-MODULES-EXTRA/forecasts,
* E-MODULES-EXTRA/iiirk,
* E-MODULES-EXTRA/places,
* e,
* ewl,
* ecore,
* elitaire,
* entrance,
* e_dbus,
* efreet: Here we go, move from Ecore_List to Eina_List.
NOTE: This patch is huge, I did test it a lot, and I hope nothing is
broken. But if you think something change after this commit, please
contact me ASAP.
SVN revision: 39200
2009-02-25 03:03:47 -08:00
|
|
|
Eina_List *files, void *data);
|
2007-02-03 05:05:30 -08:00
|
|
|
|
2007-11-04 01:32:35 -08:00
|
|
|
EAPI void efreet_desktop_environment_set(const char *environment);
|
|
|
|
EAPI const char *efreet_desktop_environment_get(void);
|
2008-02-19 20:10:02 -08:00
|
|
|
EAPI void *efreet_desktop_command_progress_get(Efreet_Desktop *desktop,
|
* estickies,
* etk,
* PROTO/exalt,
* E-MODULES-EXTRA/diskio,
* E-MODULES-EXTRA/drawer,
* E-MODULES-EXTRA/penguins,
* E-MODULES-EXTRA/slideshow,
* E-MODULES-EXTRA/mail,
* E-MODULES-EXTRA/forecasts,
* E-MODULES-EXTRA/iiirk,
* E-MODULES-EXTRA/places,
* e,
* ewl,
* ecore,
* elitaire,
* entrance,
* e_dbus,
* efreet: Here we go, move from Ecore_List to Eina_List.
NOTE: This patch is huge, I did test it a lot, and I hope nothing is
broken. But if you think something change after this commit, please
contact me ASAP.
SVN revision: 39200
2009-02-25 03:03:47 -08:00
|
|
|
Eina_List *files,
|
2007-02-03 05:05:30 -08:00
|
|
|
Efreet_Desktop_Command_Cb cb_command,
|
|
|
|
Efreet_Desktop_Progress_Cb cb_prog,
|
|
|
|
void *data);
|
2008-02-19 20:10:02 -08:00
|
|
|
EAPI void *efreet_desktop_command_get(Efreet_Desktop *desktop,
|
* estickies,
* etk,
* PROTO/exalt,
* E-MODULES-EXTRA/diskio,
* E-MODULES-EXTRA/drawer,
* E-MODULES-EXTRA/penguins,
* E-MODULES-EXTRA/slideshow,
* E-MODULES-EXTRA/mail,
* E-MODULES-EXTRA/forecasts,
* E-MODULES-EXTRA/iiirk,
* E-MODULES-EXTRA/places,
* e,
* ewl,
* ecore,
* elitaire,
* entrance,
* e_dbus,
* efreet: Here we go, move from Ecore_List to Eina_List.
NOTE: This patch is huge, I did test it a lot, and I hope nothing is
broken. But if you think something change after this commit, please
contact me ASAP.
SVN revision: 39200
2009-02-25 03:03:47 -08:00
|
|
|
Eina_List *files,
|
2007-02-03 05:05:30 -08:00
|
|
|
Efreet_Desktop_Command_Cb func,
|
|
|
|
void *data);
|
* estickies,
* etk,
* PROTO/exalt,
* E-MODULES-EXTRA/diskio,
* E-MODULES-EXTRA/drawer,
* E-MODULES-EXTRA/penguins,
* E-MODULES-EXTRA/slideshow,
* E-MODULES-EXTRA/mail,
* E-MODULES-EXTRA/forecasts,
* E-MODULES-EXTRA/iiirk,
* E-MODULES-EXTRA/places,
* e,
* ewl,
* ecore,
* elitaire,
* entrance,
* e_dbus,
* efreet: Here we go, move from Ecore_List to Eina_List.
NOTE: This patch is huge, I did test it a lot, and I hope nothing is
broken. But if you think something change after this commit, please
contact me ASAP.
SVN revision: 39200
2009-02-25 03:03:47 -08:00
|
|
|
EAPI Eina_List * efreet_desktop_command_local_get(Efreet_Desktop *desktop,
|
|
|
|
Eina_List *files);
|
2007-02-03 05:05:30 -08:00
|
|
|
|
2007-11-04 01:32:35 -08:00
|
|
|
EAPI unsigned int efreet_desktop_category_count_get(Efreet_Desktop *desktop);
|
|
|
|
EAPI void efreet_desktop_category_add(Efreet_Desktop *desktop,
|
2007-02-03 05:05:30 -08:00
|
|
|
const char *category);
|
2007-11-04 01:32:35 -08:00
|
|
|
EAPI int efreet_desktop_category_del(Efreet_Desktop *desktop,
|
2007-02-03 05:05:30 -08:00
|
|
|
const char *category);
|
|
|
|
|
2007-11-04 01:32:35 -08:00
|
|
|
EAPI int efreet_desktop_type_add(const char *type,
|
2007-09-06 09:15:10 -07:00
|
|
|
Efreet_Desktop_Type_Parse_Cb parse_func,
|
|
|
|
Efreet_Desktop_Type_Save_Cb save_func,
|
2007-02-05 13:16:55 -08:00
|
|
|
Efreet_Desktop_Type_Free_Cb free_func);
|
2007-11-04 01:32:35 -08:00
|
|
|
EAPI int efreet_desktop_type_alias (int from_type,
|
2007-06-20 11:04:26 -07:00
|
|
|
const char *alias);
|
2007-11-04 01:32:35 -08:00
|
|
|
EAPI void *efreet_desktop_type_data_get(Efreet_Desktop *desktop);
|
2007-02-04 18:06:05 -08:00
|
|
|
|
* estickies,
* etk,
* PROTO/exalt,
* E-MODULES-EXTRA/diskio,
* E-MODULES-EXTRA/drawer,
* E-MODULES-EXTRA/penguins,
* E-MODULES-EXTRA/slideshow,
* E-MODULES-EXTRA/mail,
* E-MODULES-EXTRA/forecasts,
* E-MODULES-EXTRA/iiirk,
* E-MODULES-EXTRA/places,
* e,
* ewl,
* ecore,
* elitaire,
* entrance,
* e_dbus,
* efreet: Here we go, move from Ecore_List to Eina_List.
NOTE: This patch is huge, I did test it a lot, and I hope nothing is
broken. But if you think something change after this commit, please
contact me ASAP.
SVN revision: 39200
2009-02-25 03:03:47 -08:00
|
|
|
EAPI Eina_List *efreet_desktop_string_list_parse(const char *string);
|
|
|
|
EAPI char *efreet_desktop_string_list_join(Eina_List *list);
|
2007-11-04 04:29:36 -08:00
|
|
|
|
2009-05-15 04:47:39 -07:00
|
|
|
EAPI Eina_Bool efreet_desktop_x_field_set(Efreet_Desktop *desktop, const char *key, const char *data);
|
|
|
|
EAPI const char * efreet_desktop_x_field_get(Efreet_Desktop *desktop, const char *key);
|
|
|
|
EAPI Eina_Bool efreet_desktop_x_field_del(Efreet_Desktop *desktop, const char *key);
|
|
|
|
|
2007-09-06 09:15:10 -07:00
|
|
|
/**
|
2007-02-03 05:05:30 -08:00
|
|
|
* @}
|
|
|
|
*/
|
|
|
|
|
|
|
|
#endif
|