#include "efreet_utils.h"
#include "efreet_uri.h"
+/**
+ * @return Returns > 0 if the initialization was successful, 0 otherwise
+ * @brief Initializes the Efreet system
+ */
EAPI int efreet_init(void);
+
+/**
+ * @return Returns the number of times the init function as been called
+ * minus the corresponding init call.
+ * @brief Shuts down Efreet if a balanced number of init/shutdown calls have
+ * been made
+ */
EAPI int efreet_shutdown(void);
#ifdef __cplusplus
#endif
+/**
+ * @return Returns 1 on success or 0 on failure
+ * @brief Initializes the efreet mime settings
+ */
EAPI int efreet_mime_init(void);
+
+/**
+ * @return Returns no value
+ * @brief Cleans up the efreet mime settings system
+ */
EAPI int efreet_mime_shutdown(void);
+/**
+ * @param file The file to find the mime type
+ * @return Returns mime type as a string
+ * @brief Retreive the mime type of a file
+ */
EAPI const char *efreet_mime_type_get(const char *file);
+
+/**
+ * @param file The file to check the mime type
+ * @return Returns mime type as a string
+ * @brief Retreive the mime type of a file using magic
+ */
EAPI const char *efreet_mime_magic_type_get(const char *file);
+
+/**
+ * @param file The file to check the mime type
+ * @return Returns mime type as a string
+ * @brief Retreive the mime type of a file using globs
+ */
EAPI const char *efreet_mime_globs_type_get(const char *file);
+
+/**
+ * @param file The file to check the mime type
+ * @return Returns mime type as a string
+ * @brief Retreive the special mime type of a file
+ */
EAPI const char *efreet_mime_special_type_get(const char *file);
+
+/**
+ * @param file The file to check the mime type
+ * @return Returns mime type as a string
+ * @brief Retreive the fallback mime type of a file
+ */
EAPI const char *efreet_mime_fallback_type_get(const char *file);
+
+/**
+ * @param mime The name of the mime type
+ * @param theme The name of the theme to search icons in
+ * @param size The wanted size of the icon
+ * @return Returns mime type icon path as a string
+ * @brief Retreive the mime type icon for a file
+ */
EAPI const char *efreet_mime_type_icon_get(const char *mime, const char *theme,
- unsigned int size);
+ unsigned int size);
+/**
+ * @brief Clear mime icons mapping cache
+ */
EAPI void efreet_mime_type_cache_clear(void);
+
+/**
+ * @brief Flush mime icons mapping cache
+ *
+ * Flush timeout is defined at compile time by
+ * EFREET_MIME_ICONS_FLUSH_TIMEOUT
+ */
EAPI void efreet_mime_type_cache_flush(void);
/**
* @{
*/
+/**
+ * @return Returns 1 on success or 0 on failure
+ * @brief Initializes the efreet trash system
+ */
EAPI int efreet_trash_init(void);
+
+/**
+ * @return Returns no value
+ * @brief Cleans up the efreet trash system
+ */
EAPI int efreet_trash_shutdown(void);
+/**
+ * @return Returns the XDG Trash local directory or NULL on errors
+ * return value must be freed with eina_stringshare_del.
+ * @brief Retrieves the XDG Trash local directory
+ */
EAPI const char *efreet_trash_dir_get(const char *for_file);
+
+/**
+ * @param uri The local uri to move in the trash
+ * @param force_delete If you set this to 1 than files on different filesystems
+ * will be deleted permanently
+ * @return Return 1 on success, 0 on failure or -1 in case the uri is not on the
+ * same filesystem and force_delete is not set.
+ * @brief This function try to move the given uri to the trash. Files on
+ * different filesystem can't be moved to trash. If force_delete
+ * is 0 than non-local files will be ignored and -1 is returned, if you set
+ * force_delete to 1 non-local files will be deleted without asking.
+ */
EAPI int efreet_trash_delete_uri(Efreet_Uri *uri, int force_delete);
+
+/**
+ * @return Return a list of strings with filename (remember to free the list
+ * when you don't need anymore)
+ * @brief List all the files and directory currently inside the trash.
+ */
EAPI Eina_List *efreet_trash_ls(void);
+
+/**
+ * @return Return 1 if the trash is empty or 0 if some file are in.
+ * @brief Check if the trash is currently empty
+ */
EAPI int efreet_trash_is_empty(void);
+
+/**
+ * @return Return 1 on success or 0 on failure
+ * @brief Delete all the files inside the trash.
+ */
EAPI int efreet_trash_empty_trash(void);
/**
static uid_t ruid;
static uid_t rgid;
-/**
- * @return Returns > 0 if the initialization was successful, 0 otherwise
- * @brief Initializes the Efreet system
- */
EAPI int
efreet_init(void)
{
return --_efreet_init_count;
}
-/**
- * @return Returns the number of times the init function as been called
- * minus the corresponding init call.
- * @brief Shuts down Efreet if a balanced number of init/shutdown calls have
- * been made
- */
EAPI int
efreet_shutdown(void)
{
return efreet_home_dir;
}
-/**
- * @return Returns the XDG Data Home directory
- * @brief Retrieves the XDG Data Home directory
- */
EAPI const char *
efreet_data_home_get(void)
{
return xdg_data_home;
}
-/**
- * @return Returns the Eina_List of preference ordered extra data directories
- * @brief Returns the Eina_List of prefernece oredred extra data
- * directories
- *
- * @note The returned list is static inside Efreet. If you add/remove from the
- * list then the next call to efreet_data_dirs_get() will return your
- * modified values. DO NOT free this list.
- */
EAPI Eina_List *
efreet_data_dirs_get(void)
{
return xdg_data_dirs;
}
-/**
- * @return Returns the XDG Config Home directory
- * @brief Retrieves the XDG Config Home directory
- */
EAPI const char *
efreet_config_home_get(void)
{
return xdg_config_home;
}
-/**
- * @return Returns the Eina_List of preference ordered extra config directories
- * @brief Returns the Eina_List of prefernece ordered extra config
- * directories
- *
- * @note The returned list is static inside Efreet. If you add/remove from the
- * list then the next call to efreet_config_dirs_get() will return your
- * modified values. DO NOT free this list.
- */
EAPI Eina_List *
efreet_config_dirs_get(void)
{
return xdg_config_dirs;
}
-/**
- * @return Returns the XDG Cache Home directory
- * @brief Retrieves the XDG Cache Home directory
- */
EAPI const char *
efreet_cache_home_get(void)
{
return xdg_cache_home;
}
-/**
- * @return Returns the current hostname
- * @brief Returns the current hostname or empty string if not found
- */
EAPI const char *
efreet_hostname_get(void)
{
* @{
*/
+
+/**
+ * @return Returns the XDG Data Home directory
+ * @brief Retrieves the XDG Data Home directory
+ */
EAPI const char *efreet_data_home_get(void);
+
+/**
+ * @return Returns the Eina_List of preference ordered extra data directories
+ * @brief Returns the Eina_List of prefernece oredred extra data
+ * directories
+ *
+ * @note The returned list is static inside Efreet. If you add/remove from the
+ * list then the next call to efreet_data_dirs_get() will return your
+ * modified values. DO NOT free this list.
+ */
EAPI Eina_List *efreet_data_dirs_get(void);
+
+/**
+ * @return Returns the XDG Config Home directory
+ * @brief Retrieves the XDG Config Home directory
+ */
EAPI const char *efreet_config_home_get(void);
+
+/**
+ * @return Returns the Eina_List of preference ordered extra config directories
+ * @brief Returns the Eina_List of prefernece ordered extra config
+ * directories
+ *
+ * @note The returned list is static inside Efreet. If you add/remove from the
+ * list then the next call to efreet_config_dirs_get() will return your
+ * modified values. DO NOT free this list.
+ */
EAPI Eina_List *efreet_config_dirs_get(void);
+
+/**
+ * @return Returns the XDG Cache Home directory
+ * @brief Retrieves the XDG Cache Home directory
+ */
EAPI const char *efreet_cache_home_get(void);
+
+/**
+ * @return Returns the current hostname
+ * @brief Returns the current hostname or empty string if not found
+ */
EAPI const char *efreet_hostname_get(void);
/**
_efreet_desktop_log_dom = -1;
}
-/**
- * @param file The file to get the Efreet_Desktop from
- * @return Returns a reference to a cached Efreet_Desktop on success, NULL
- * on failure
- * @brief Gets a reference to an Efreet_Desktop structure representing the
- * contents of @a file or NULL if @a file is not a valid .desktop file.
- *
- * By using efreet_desktop_get the Efreet_Desktop will be saved in an internal
- * cache for quicker loading.
- */
EAPI Efreet_Desktop *
efreet_desktop_get(const char *file)
{
return desktop;
}
-/**
- * @param desktop The Efreet_Desktop to ref
- * @return Returns the new reference count
- * @brief Increases reference count on desktop
- */
EAPI int
efreet_desktop_ref(Efreet_Desktop *desktop)
{
return desktop->ref;
}
-/**
- * @param file The file to create the Efreet_Desktop from
- * @return Returns a new empty_Efreet_Desktop on success, NULL on failure
- * @brief Creates a new empty Efreet_Desktop structure or NULL on failure
- */
EAPI Efreet_Desktop *
efreet_desktop_empty_new(const char *file)
{
return desktop;
}
-/**
- * @param file The file to get the Efreet_Desktop from
- * @return Returns a reference to a cached Efreet_Desktop on success, NULL
- * on failure
- * @brief Gets a reference to an Efreet_Desktop structure representing the
- * contents of @a file or NULL if @a file is not a valid .desktop file.
- */
EAPI Efreet_Desktop *
efreet_desktop_new(const char *file)
{
return efreet_desktop_uncached_new(file);
}
-/**
- * @param file The file to create the Efreet_Desktop from
- * @return Returns a new Efreet_Desktop on success, NULL on failure
- * @brief Creates a new Efreet_Desktop structure initialized from the
- * contents of @a file or NULL on failure
- *
- * By using efreet_desktop_uncached_new the Efreet_Desktop structure will be
- * read from disk, and not from any cache.
- *
- * Data in the structure is allocated with strdup, so use free and strdup to
- * change values.
- */
EAPI Efreet_Desktop *
efreet_desktop_uncached_new(const char *file)
{
return desktop;
}
-/**
- * @param desktop The desktop file to save
- * @return Returns 1 on success or 0 on failure
- * @brief Saves any changes made to @a desktop back to the file on the
- * filesystem
- */
EAPI int
efreet_desktop_save(Efreet_Desktop *desktop)
{
return ok;
}
-/**
- * @param desktop The desktop file to save
- * @param file The filename to save as
- * @return Returns 1 on success or 0 on failure
- * @brief Saves @a desktop to @a file
- *
- * Please use efreet_desktop_uncached_new() on an existing file
- * before using efreet_desktop_save_as()
- */
EAPI int
efreet_desktop_save_as(Efreet_Desktop *desktop, const char *file)
{
return efreet_desktop_save(desktop);
}
-/**
- * @param desktop The Efreet_Desktop to work with
- * @return Returns no value
- * @brief Frees the Efreet_Desktop structure and all of it's data
- */
EAPI void
efreet_desktop_free(Efreet_Desktop *desktop)
{
}
}
-/**
- * @param environment the environment name
- * @brief sets the global desktop environment name
- */
EAPI void
efreet_desktop_environment_set(const char *environment)
{
else desktop_environment = NULL;
}
-/**
- * @return environment the environment name
- * @brief sets the global desktop environment name
- */
EAPI const char *
efreet_desktop_environment_get(void)
{
return desktop_environment;
}
-/**
- * @param desktop The desktop to work with
- * @return Returns the number of categories assigned to this desktop
- * @brief Retrieves the number of categories the given @a desktop belongs
- * too
- */
EAPI unsigned int
efreet_desktop_category_count_get(Efreet_Desktop *desktop)
{
return eina_list_count(desktop->categories);
}
-/**
- * @param desktop the desktop
- * @param category the category name
- * @brief add a category to a desktop
- */
EAPI void
efreet_desktop_category_add(Efreet_Desktop *desktop, const char *category)
{
(void *)eina_stringshare_add(category));
}
-/**
- * @param desktop the desktop
- * @param category the category name
- * @brief removes a category from a desktop
- * @return 1 if the desktop had his category listed, 0 otherwise
- */
EAPI int
efreet_desktop_category_del(Efreet_Desktop *desktop, const char *category)
{
return 0;
}
-/**
- * @param type The type to add to the list of matching types
- * @param parse_func a function to parse out custom fields
- * @param save_func a function to save data returned from @a parse_func
- * @param free_func a function to free data returned from @a parse_func
- * @return Returns the id of the new type
- * @brief Adds the given type to the list of types in the system
- */
EAPI int
efreet_desktop_type_add(const char *type, Efreet_Desktop_Type_Parse_Cb parse_func,
Efreet_Desktop_Type_Save_Cb save_func,
return id;
}
-/**
- * @brief Add an alias for an existing desktop type.
- * @param from_type the type to alias (e.g. EFREE_DESKTOP_TYPE_APPLICATION)
- * @param alias the alias
- * @return the new type id, or -1 if @p from_type was not valid
- *
- * This allows applications to add non-standard types that behave exactly as standard types.
- */
EAPI int
efreet_desktop_type_alias(int from_type, const char *alias)
{
return efreet_desktop_type_add(alias, info->parse_func, info->save_func, info->free_func);
}
-/**
- * @brief Set the value for a X- field (Non spec) in the structure
- * @param desktop the desktop
- * @param key the key name to set
- * @param data the value to set
- * @return EINA_TRUE on success
- *
- * The key has to start with "X-"
- */
EAPI Eina_Bool
efreet_desktop_x_field_set(Efreet_Desktop *desktop, const char *key, const char *data)
{
return EINA_TRUE;
}
-/**
- * @brief Get the value for a X- field (Non spec) in the structure
- * @param desktop the desktop
- * @param key the key
- * @return The value referenced by the key, or NULL if the key does not exist
- */
EAPI const char *
efreet_desktop_x_field_get(Efreet_Desktop *desktop, const char *key)
{
return eina_stringshare_add(ret);
}
-/**
- * @brief Delete the key and value for a X- field (Non spec) in the structure
- * @param desktop the desktop
- * @param key the key
- * @return EINA_TRUE if the key existed
- */
EAPI Eina_Bool
efreet_desktop_x_field_del(Efreet_Desktop *desktop, const char *key)
{
return eina_hash_del_by_key(desktop->x, key);
}
-/**
- * @brief get type specific data for custom desktop types
- * @param desktop the desktop
- * @return type specific data, or NULL if there is none
- */
EAPI void *
efreet_desktop_type_data_get(Efreet_Desktop *desktop)
{
return desktop->type_data;
}
-/**
- * @param string the raw string list
- * @return an Eina_List of ecore string's
- * @brief Parse ';' separate list of strings according to the desktop spec
- */
EAPI Eina_List *
efreet_desktop_string_list_parse(const char *string)
{
return list;
}
-/**
- * @param list Eina_List with strings
- * @return a raw string list
- * @brief Create a ';' separate list of strings according to the desktop spec
- */
EAPI char *
efreet_desktop_string_list_join(Eina_List *list)
{
* @{
*/
+
+/**
+ * @param desktop the desktop entry
+ * @param files an eina list of file names to execute, as either absolute paths,
+ * relative paths, or uris
+ * @param func a callback to call for each prepared command line
+ * @param data user data passed to the callback
+ * @return Returns the return value of @p func on success or NULL on failure
+ * @brief Get a command to use to execute a desktop entry.
+ */
EAPI extern int EFREET_DESKTOP_TYPE_APPLICATION;
EAPI extern int EFREET_DESKTOP_TYPE_LINK;
EAPI extern int EFREET_DESKTOP_TYPE_DIRECTORY;
void *type_data; /**< Type specific data for custom types */
};
+
+/**
+ * @param file The file to get the Efreet_Desktop from
+ * @return Returns a reference to a cached Efreet_Desktop on success, NULL
+ * on failure
+ * @brief Gets a reference to an Efreet_Desktop structure representing the
+ * contents of @a file or NULL if @a file is not a valid .desktop file.
+ *
+ * By using efreet_desktop_get the Efreet_Desktop will be saved in an internal
+ * cache for quicker loading.
+ */
EAPI Efreet_Desktop *efreet_desktop_get(const char *file);
+
+/**
+ * @param desktop The Efreet_Desktop to ref
+ * @return Returns the new reference count
+ * @brief Increases reference count on desktop
+ */
EAPI int efreet_desktop_ref(Efreet_Desktop *desktop);
+
+/**
+ * @param file The file to create the Efreet_Desktop from
+ * @return Returns a new empty_Efreet_Desktop on success, NULL on failure
+ * @brief Creates a new empty Efreet_Desktop structure or NULL on failure
+ */
EAPI Efreet_Desktop *efreet_desktop_empty_new(const char *file);
+
+/**
+ * @param file The file to get the Efreet_Desktop from
+ * @return Returns a reference to a cached Efreet_Desktop on success, NULL
+ * on failure
+ * @brief Gets a reference to an Efreet_Desktop structure representing the
+ * contents of @a file or NULL if @a file is not a valid .desktop file.
+ */
EAPI Efreet_Desktop *efreet_desktop_new(const char *file);
+
+/**
+ * @param file The file to create the Efreet_Desktop from
+ * @return Returns a new Efreet_Desktop on success, NULL on failure
+ * @brief Creates a new Efreet_Desktop structure initialized from the
+ * contents of @a file or NULL on failure
+ *
+ * By using efreet_desktop_uncached_new the Efreet_Desktop structure will be
+ * read from disk, and not from any cache.
+ *
+ * Data in the structure is allocated with strdup, so use free and strdup to
+ * change values.
+ */
EAPI Efreet_Desktop *efreet_desktop_uncached_new(const char *file);
+
+/**
+ * @param desktop The Efreet_Desktop to work with
+ * @return Returns no value
+ * @brief Frees the Efreet_Desktop structure and all of it's data
+ */
EAPI void efreet_desktop_free(Efreet_Desktop *desktop);
+
/**
* @def efreet_desktop_unref(desktop)
* Alias for efreet_desktop_free(desktop)
*/
#define efreet_desktop_unref(desktop) efreet_desktop_free((desktop))
+
+/**
+ * @param desktop The desktop file to save
+ * @return Returns 1 on success or 0 on failure
+ * @brief Saves any changes made to @a desktop back to the file on the
+ * filesystem
+ */
EAPI int efreet_desktop_save(Efreet_Desktop *desktop);
+
+/**
+ * @param desktop The desktop file to save
+ * @param file The filename to save as
+ * @return Returns 1 on success or 0 on failure
+ * @brief Saves @a desktop to @a file
+ *
+ * Please use efreet_desktop_uncached_new() on an existing file
+ * before using efreet_desktop_save_as()
+ */
EAPI int efreet_desktop_save_as(Efreet_Desktop *desktop,
const char *file);
+
+/**
+ * @param desktop The desktop file to work with
+ * @param files The files to be substituted into the exec line
+ * @param data The data pointer to pass
+ * @return Returns the Ecore_Exce for @a desktop
+ * @brief Parses the @a desktop exec line and returns an Ecore_Exe.
+ */
EAPI void efreet_desktop_exec(Efreet_Desktop *desktop,
Eina_List *files, void *data);
+
+/**
+ * @param environment the environment name
+ * @brief sets the global desktop environment name
+ */
EAPI void efreet_desktop_environment_set(const char *environment);
+
+/**
+ * @return environment the environment name
+ * @brief sets the global desktop environment name
+ */
EAPI const char *efreet_desktop_environment_get(void);
+
+/**
+ * @param desktop the desktop entry
+ * @param files an eina list of file names to execute, as either absolute paths,
+ * relative paths, or uris
+ * @param cb_command a callback to call for each prepared command line
+ * @param cb_progress a callback to get progress for the downloads
+ * @param data user data passed to the callback
+ * @return Returns 1 on success or 0 on failure
+ * @brief Get a command to use to execute a desktop entry, and receive progress
+ * updates for downloading of remote URI's passed in.
+ */
EAPI void *efreet_desktop_command_progress_get(Efreet_Desktop *desktop,
Eina_List *files,
Efreet_Desktop_Command_Cb cb_command,
Eina_List *files,
Efreet_Desktop_Command_Cb func,
void *data);
+
+/**
+ * @param desktop the desktop entry
+ * @param files an eina list of local files, as absolute paths, local paths, or file// uris (or NULL to get exec string with no files appended)
+ * @return Returns an eina list of exec strings
+ * @brief Get the command to use to execute a desktop entry
+ *
+ * The returned list and each of its elements must be freed.
+ */
EAPI Eina_List * efreet_desktop_command_local_get(Efreet_Desktop *desktop,
Eina_List *files);
+
+/**
+ * @param desktop The desktop to work with
+ * @return Returns the number of categories assigned to this desktop
+ * @brief Retrieves the number of categories the given @a desktop belongs
+ * too
+ */
EAPI unsigned int efreet_desktop_category_count_get(Efreet_Desktop *desktop);
+
+/**
+ * @param desktop the desktop
+ * @param category the category name
+ * @brief add a category to a desktop
+ */
EAPI void efreet_desktop_category_add(Efreet_Desktop *desktop,
const char *category);
+
+/**
+ * @param desktop the desktop
+ * @param category the category name
+ * @brief removes a category from a desktop
+ * @return 1 if the desktop had his category listed, 0 otherwise
+ */
EAPI int efreet_desktop_category_del(Efreet_Desktop *desktop,
const char *category);
+
+/**
+ * @param type The type to add to the list of matching types
+ * @param parse_func a function to parse out custom fields
+ * @param save_func a function to save data returned from @a parse_func
+ * @param free_func a function to free data returned from @a parse_func
+ * @return Returns the id of the new type
+ * @brief Adds the given type to the list of types in the system
+ */
EAPI int efreet_desktop_type_add(const char *type,
Efreet_Desktop_Type_Parse_Cb parse_func,
Efreet_Desktop_Type_Save_Cb save_func,
Efreet_Desktop_Type_Free_Cb free_func);
+
+/**
+ * @brief Add an alias for an existing desktop type.
+ * @param from_type the type to alias (e.g. EFREE_DESKTOP_TYPE_APPLICATION)
+ * @param alias the alias
+ * @return the new type id, or -1 if @p from_type was not valid
+ *
+ * This allows applications to add non-standard types that behave exactly as standard types.
+ */
EAPI int efreet_desktop_type_alias (int from_type,
const char *alias);
+
+/**
+ * @brief get type specific data for custom desktop types
+ * @param desktop the desktop
+ * @return type specific data, or NULL if there is none
+ */
EAPI void *efreet_desktop_type_data_get(Efreet_Desktop *desktop);
+
+/**
+ * @param string the raw string list
+ * @return an Eina_List of ecore string's
+ * @brief Parse ';' separate list of strings according to the desktop spec
+ */
EAPI Eina_List *efreet_desktop_string_list_parse(const char *string);
+
+/**
+ * @param list Eina_List with strings
+ * @return a raw string list
+ * @brief Create a ';' separate list of strings according to the desktop spec
+ */
EAPI char *efreet_desktop_string_list_join(Eina_List *list);
+
+/**
+ * @brief Set the value for a X- field (Non spec) in the structure
+ * @param desktop the desktop
+ * @param key the key name to set
+ * @param data the value to set
+ * @return EINA_TRUE on success
+ *
+ * The key has to start with "X-"
+ */
EAPI Eina_Bool efreet_desktop_x_field_set(Efreet_Desktop *desktop, const char *key, const char *data);
+
+/**
+ * @brief Get the value for a X- field (Non spec) in the structure
+ * @param desktop the desktop
+ * @param key the key
+ * @return The value referenced by the key, or NULL if the key does not exist
+ */
EAPI const char * efreet_desktop_x_field_get(Efreet_Desktop *desktop, const char *key);
+
+/**
+ * @brief Delete the key and value for a X- field (Non spec) in the structure
+ * @param desktop the desktop
+ * @param key the key
+ * @return EINA_TRUE if the key existed
+ */
EAPI Eina_Bool efreet_desktop_x_field_del(Efreet_Desktop *desktop, const char *key);
/**
int pending;
};
-/**
- * A unique id for each tmp file created while building a command
- */
static int efreet_desktop_command_file_id = 0;
static void *efreet_desktop_exec_cb(void *data, Efreet_Desktop *desktop,
int *len, char c);
-/**
- * @param desktop The desktop file to work with
- * @param files The files to be substituted into the exec line
- * @param data The data pointer to pass
- * @return Returns the Ecore_Exce for @a desktop
- * @brief Parses the @a desktop exec line and returns an Ecore_Exe.
- */
EAPI void
efreet_desktop_exec(Efreet_Desktop *desktop, Eina_List *files, void *data)
{
efreet_desktop_command_get(desktop, files, efreet_desktop_exec_cb, data);
}
-/**
- * @param desktop the desktop entry
- * @param files an eina list of file names to execute, as either absolute paths,
- * relative paths, or uris
- * @param func a callback to call for each prepared command line
- * @param data user data passed to the callback
- * @return Returns the return value of @p func on success or NULL on failure
- * @brief Get a command to use to execute a desktop entry.
- */
EAPI void *
efreet_desktop_command_get(Efreet_Desktop *desktop, Eina_List *files,
Efreet_Desktop_Command_Cb func, void *data)
return efreet_desktop_command_progress_get(desktop, files, func, NULL, data);
}
-/**
- * @param desktop the desktop entry
- * @param files an eina list of local files, as absolute paths, local paths, or file// uris (or NULL to get exec string with no files appended)
- * @return Returns an eina list of exec strings
- * @brief Get the command to use to execute a desktop entry
- *
- * The returned list and each of its elements must be freed.
- */
EAPI Eina_List *
efreet_desktop_command_local_get(Efreet_Desktop *desktop, Eina_List *files)
{
return execs;
}
-/**
- * @param desktop the desktop entry
- * @param files an eina list of file names to execute, as either absolute paths,
- * relative paths, or uris
- * @param cb_command a callback to call for each prepared command line
- * @param cb_progress a callback to get progress for the downloads
- * @param data user data passed to the callback
- * @return Returns 1 on success or 0 on failure
- * @brief Get a command to use to execute a desktop entry, and receive progress
- * updates for downloading of remote URI's passed in.
- */
EAPI void *
efreet_desktop_command_progress_get(Efreet_Desktop *desktop, Eina_List *files,
Efreet_Desktop_Command_Cb cb_command,
IF_FREE_HASH(change_monitors);
}
-/**
- * @return Returns the deprecated user icon directory
- * @brief Returns the deprecated user icon directory
- */
EAPI const char *
efreet_icon_deprecated_user_dir_get(void)
{
return efreet_icon_deprecated_user_dir;
}
-/**
- * @return Returns the user icon directory
- * @brief Returns the user icon directory
- */
EAPI const char *
efreet_icon_user_dir_get(void)
{
return efreet_icon_user_dir;
}
-/**
- * @param ext The extension to add to the list of checked extensions
- * @return Returns no value.
- * @brief Adds the given extension to the list of possible icon extensions
- */
EAPI void
efreet_icon_extension_add(const char *ext)
{
efreet_icon_extensions = eina_list_prepend(efreet_icon_extensions, ext);
}
-/**
- * @return Returns a list of strings that are paths to other icon directories
- * @brief Gets the list of all extra directories to look for icons. These
- * directories are used to look for icons after looking in the user icon dir
- * and before looking in standard system directories. The order of search is
- * from first to last directory in this list. the strings in the list should
- * be created with eina_stringshare_add().
- */
EAPI Eina_List **
efreet_icon_extra_list_get(void)
{
return &efreet_extra_icon_dirs;
}
-/**
- * @return Returns a list of strings that are icon extensions to look for
- * @brief Gets the list of all icon extensions to look for
- */
EAPI Eina_List *
efreet_icon_extensions_list_get(void)
{
return efreet_icon_extensions;
}
-/**
- * @return Returns a list of Efreet_Icon structs for all the non-hidden icon
- * themes
- * @brief Retrieves all of the non-hidden icon themes available on the system.
- * The returned list must be freed. Do not free the list data.
- */
EAPI Eina_List *
efreet_icon_theme_list_get(void)
{
return efreet_cache_icon_theme_list();
}
-/**
- * @param theme_name The theme to look for
- * @return Returns the icon theme related to the given theme name or NULL if
- * none exists.
- * @brief Tries to get the icon theme structure for the given theme name
- */
EAPI Efreet_Icon_Theme *
efreet_icon_theme_find(const char *theme_name)
{
return tmp;
}
-/**
- * @param theme_name The icon theme to look for
- * @param icon The icon to look for
- * @param size; The icon size to look for
- * @return Returns the path to the given icon or NULL if none found
- * @brief Retrives the path to the given icon.
- */
EAPI const char *
efreet_icon_path_find(const char *theme_name, const char *icon, unsigned int size)
{
return value;
}
-/**
- * @param theme_name The icon theme to look for
- * @param icons List of icons to look for
- * @param size; The icon size to look for
- * @return Returns the path representing first found icon or
- * NULL if none of the icons are found
- * @brief Retrieves all of the information about the first found icon in
- * the list.
- * @note This function will search the given theme for all icons before falling
- * back. This is useful when searching for mimetype icons.
- */
EAPI const char *
efreet_icon_list_find(const char *theme_name, Eina_List *icons,
unsigned int size)
return value;
}
-/**
- * @param theme_name The icon theme to look for
- * @param icon The icon to look for
- * @param size The icon size to look for
- * @return Returns the Efreet_Icon structure representing this icon or NULL
- * if the icon is not found
- * @brief Retrieves all of the information about the given icon.
- */
EAPI Efreet_Icon *
efreet_icon_find(const char *theme_name, const char *icon, unsigned int size)
{
return icon;
}
-/**
- * @param icon The Efreet_Icon to cleanup
- * @return Returns no value.
- * @brief Free's the given icon and all its internal data.
- */
EAPI void
efreet_icon_free(Efreet_Icon *icon)
{
/**
* Event id for cache update.
*/
+
+/**
+ * @return Returns the user icon directory
+ * @brief Returns the user icon directory
+ */
EAPI extern int EFREET_EVENT_ICON_CACHE_UPDATE;
/**
};
EAPI const char *efreet_icon_user_dir_get(void);
+
+/**
+ * @return Returns the deprecated user icon directory
+ * @brief Returns the deprecated user icon directory
+ */
EAPI const char *efreet_icon_deprecated_user_dir_get(void);
+
+/**
+ * @param ext The extension to add to the list of checked extensions
+ * @return Returns no value.
+ * @brief Adds the given extension to the list of possible icon extensions
+ */
EAPI void efreet_icon_extension_add(const char *ext);
+
+/**
+ * @return Returns a list of strings that are paths to other icon directories
+ * @brief Gets the list of all extra directories to look for icons. These
+ * directories are used to look for icons after looking in the user icon dir
+ * and before looking in standard system directories. The order of search is
+ * from first to last directory in this list. the strings in the list should
+ * be created with eina_stringshare_add().
+ */
EAPI Eina_List **efreet_icon_extra_list_get(void);
+
+/**
+ * @return Returns a list of strings that are icon extensions to look for
+ * @brief Gets the list of all icon extensions to look for
+ */
EAPI Eina_List *efreet_icon_extensions_list_get(void);
+
+/**
+ * @return Returns a list of Efreet_Icon structs for all the non-hidden icon
+ * themes
+ * @brief Retrieves all of the non-hidden icon themes available on the system.
+ * The returned list must be freed. Do not free the list data.
+ */
EAPI Eina_List *efreet_icon_theme_list_get(void);
+
+/**
+ * @param theme_name The theme to look for
+ * @return Returns the icon theme related to the given theme name or NULL if
+ * none exists.
+ * @brief Tries to get the icon theme structure for the given theme name
+ */
EAPI Efreet_Icon_Theme *efreet_icon_theme_find(const char *theme_name);
+
+/**
+ * @param theme_name The icon theme to look for
+ * @param icon The icon to look for
+ * @param size The icon size to look for
+ * @return Returns the Efreet_Icon structure representing this icon or NULL
+ * if the icon is not found
+ * @brief Retrieves all of the information about the given icon.
+ */
EAPI Efreet_Icon *efreet_icon_find(const char *theme_name,
const char *icon,
unsigned int size);
+
+/**
+ * @param theme_name The icon theme to look for
+ * @param icons List of icons to look for
+ * @param size; The icon size to look for
+ * @return Returns the path representing first found icon or
+ * NULL if none of the icons are found
+ * @brief Retrieves all of the information about the first found icon in
+ * the list.
+ * @note This function will search the given theme for all icons before falling
+ * back. This is useful when searching for mimetype icons.
+ */
EAPI const char *efreet_icon_list_find(const char *theme_name,
Eina_List *icons,
unsigned int size);
+
+/**
+ * @param theme_name The icon theme to look for
+ * @param icon The icon to look for
+ * @param size; The icon size to look for
+ * @return Returns the path to the given icon or NULL if none found
+ * @brief Retrives the path to the given icon.
+ */
EAPI const char *efreet_icon_path_find(const char *theme_name,
const char *icon,
unsigned int size);
+
+/**
+ * @param icon The Efreet_Icon to cleanup
+ * @return Returns no value.
+ * @brief Free's the given icon and all its internal data.
+ */
EAPI void efreet_icon_free(Efreet_Icon *icon);
/**
_efreet_ini_log_dom = -1;
}
-/**
- * @param file The file to parse
- * @return Returns a new Efreet_Ini structure initialized with the contents
- * of @a file, or NULL on memory allocation failure
- * @brief Creates and initializes a new Ini structure with the contents of
- * @a file, or NULL on failure
- */
EAPI Efreet_Ini *
efreet_ini_new(const char *file)
{
return data;
}
-/**
- * @param ini The Efreet_Ini to work with
- * @return Returns no value
- * @brief Frees the given Efree_Ini structure.
- */
EAPI void
efreet_ini_free(Efreet_Ini *ini)
{
FREE(ini);
}
-/**
- * @param ini The Efreet_Ini to work with
- * @param file The file to load
- * @return Returns no value
- * @brief Saves the given Efree_Ini structure.
- */
EAPI int
efreet_ini_save(Efreet_Ini *ini, const char *file)
{
return 1;
}
-/**
- * @param ini The Efreet_Ini to work with
- * @param section The section of the ini file we want to get values from
- * @return Returns 1 if the section exists, otherwise 0
- * @brief Sets the current working section of the ini file to @a section
- */
EAPI int
efreet_ini_section_set(Efreet_Ini *ini, const char *section)
{
return (ini->section ? 1 : 0);
}
-/**
- * @param ini The Efreet_Ini to work with
- * @param section The section of the ini file we want to add
- * @return Returns no value
- * @brief Adds a new working section of the ini file to @a section
- */
EAPI void
efreet_ini_section_add(Efreet_Ini *ini, const char *section)
{
eina_hash_add(ini->data, section, hash);
}
-/**
- * @param ini The Efree_Ini to work with
- * @param key The key to lookup
- * @return Returns the string associated with the given key or NULL if not
- * found.
- * @brief Retrieves the value for the given key or NULL if none found.
- */
EAPI const char *
efreet_ini_string_get(Efreet_Ini *ini, const char *key)
{
return eina_hash_find(ini->section, key);
}
-/**
- * @param ini The Efree_Ini to work with
- * @param key The key to use
- * @param value The value to set
- * @return Returns no value
- * @brief Sets the value for the given key
- */
EAPI void
efreet_ini_string_set(Efreet_Ini *ini, const char *key, const char *value)
{
eina_hash_add(ini->section, key, eina_stringshare_add(value));
}
-/**
- * @param ini The Efree_Ini to work with
- * @param key The key to lookup
- * @return Returns the integer associated with the given key or -1 if not
- * found.
- * @brief Retrieves the value for the given key or -1 if none found.
- */
EAPI int
efreet_ini_int_get(Efreet_Ini *ini, const char *key)
{
return -1;
}
-/**
- * @param ini The Efree_Ini to work with
- * @param key The key to use
- * @param value The value to set
- * @return Returns no value
- * @brief Sets the value for the given key
- */
EAPI void
efreet_ini_int_set(Efreet_Ini *ini, const char *key, int value)
{
efreet_ini_string_set(ini, key, str);
}
-/**
- * @param ini The Efree_Ini to work with
- * @param key The key to lookup
- * @return Returns the double associated with the given key or -1 if not
- * found.
- * @brief Retrieves the value for the given key or -1 if none found.
- */
EAPI double
efreet_ini_double_get(Efreet_Ini *ini, const char *key)
{
return -1;
}
-/**
- * @param ini The Efree_Ini to work with
- * @param key The key to use
- * @param value The value to set
- * @return Returns no value
- * @brief Sets the value for the given key
- */
EAPI void
efreet_ini_double_set(Efreet_Ini *ini, const char *key, double value)
{
efreet_ini_string_set(ini, key, str);
}
-/**
- * @param ini The ini struct to work with
- * @param key The key to search for
- * @return Returns 1 if the boolean is true, 0 otherwise
- * @brief Retrieves the boolean value at key @a key from the ini @a ini
- */
EAPI unsigned int
efreet_ini_boolean_get(Efreet_Ini *ini, const char *key)
{
return 0;
}
-/**
- * @param ini The ini struct to work with
- * @param key The key to use
- * @param value The value to set
- * @return Returns no value
- * @brief Sets the value for the given key
- */
EAPI void
efreet_ini_boolean_set(Efreet_Ini *ini, const char *key, unsigned int value)
{
else efreet_ini_string_set(ini, key, "false");
}
-/**
- * @param ini The ini struct to work with
- * @param key The key to search for
- * @return Returns the utf8 encoded string associated with @a key, or NULL
- * if none found
- * @brief Retrieves the utf8 encoded string associated with @a key in the current locale or NULL if none found
- */
EAPI const char *
efreet_ini_localestring_get(Efreet_Ini *ini, const char *key)
{
return val;
}
-/**
- * @param ini The ini struct to work with
- * @param key The key to use
- * @param value The value to set
- * @return Returns no value
- * @brief Sets the value for the given key
- */
EAPI void
efreet_ini_localestring_set(Efreet_Ini *ini, const char *key, const char *value)
{
efreet_ini_string_set(ini, buf, value);
}
-/**
- * @param ini The ini struct to work with
- * @param key The key to remove
- * @return Returns no value
- * @brief Remove the given key from the ini struct
- */
EAPI void
efreet_ini_key_unset(Efreet_Ini *ini, const char *key)
{
Eina_Hash *section; /**< currently selected section */
};
+
+/**
+ * @param file The file to parse
+ * @return Returns a new Efreet_Ini structure initialized with the contents
+ * of @a file, or NULL on memory allocation failure
+ * @brief Creates and initializes a new Ini structure with the contents of
+ * @a file, or NULL on failure
+ */
EAPI Efreet_Ini *efreet_ini_new(const char *file);
+
+/**
+ * @param ini The Efreet_Ini to work with
+ * @return Returns no value
+ * @brief Frees the given Efree_Ini structure.
+ */
EAPI void efreet_ini_free(Efreet_Ini *ini);
+
+/**
+ * @param ini The Efreet_Ini to work with
+ * @param file The file to load
+ * @return Returns no value
+ * @brief Saves the given Efree_Ini structure.
+ */
EAPI int efreet_ini_save(Efreet_Ini *ini, const char *path);
+
+/**
+ * @param ini The Efreet_Ini to work with
+ * @param section The section of the ini file we want to get values from
+ * @return Returns 1 if the section exists, otherwise 0
+ * @brief Sets the current working section of the ini file to @a section
+ */
EAPI int efreet_ini_section_set(Efreet_Ini *ini, const char *section);
+
+/**
+ * @param ini The Efreet_Ini to work with
+ * @param section The section of the ini file we want to add
+ * @return Returns no value
+ * @brief Adds a new working section of the ini file to @a section
+ */
EAPI void efreet_ini_section_add(Efreet_Ini *ini, const char *section);
+
+/**
+ * @param ini The Efree_Ini to work with
+ * @param key The key to lookup
+ * @return Returns the string associated with the given key or NULL if not
+ * found.
+ * @brief Retrieves the value for the given key or NULL if none found.
+ */
EAPI const char *efreet_ini_string_get(Efreet_Ini *ini, const char *key);
+
+/**
+ * @param ini The Efree_Ini to work with
+ * @param key The key to use
+ * @param value The value to set
+ * @return Returns no value
+ * @brief Sets the value for the given key
+ */
EAPI void efreet_ini_string_set(Efreet_Ini *ini, const char *key,
const char *value);
+
+/**
+ * @param ini The ini struct to work with
+ * @param key The key to search for
+ * @return Returns the utf8 encoded string associated with @a key, or NULL
+ * if none found
+ * @brief Retrieves the utf8 encoded string associated with @a key in the current locale or NULL if none found
+ */
EAPI const char *efreet_ini_localestring_get(Efreet_Ini *ini, const char *key);
+
+/**
+ * @param ini The ini struct to work with
+ * @param key The key to use
+ * @param value The value to set
+ * @return Returns no value
+ * @brief Sets the value for the given key
+ */
EAPI void efreet_ini_localestring_set(Efreet_Ini *ini, const char *key,
const char *value);
+
+/**
+ * @param ini The ini struct to work with
+ * @param key The key to search for
+ * @return Returns 1 if the boolean is true, 0 otherwise
+ * @brief Retrieves the boolean value at key @a key from the ini @a ini
+ */
EAPI unsigned int efreet_ini_boolean_get(Efreet_Ini *ini, const char *key);
+
+/**
+ * @param ini The ini struct to work with
+ * @param key The key to use
+ * @param value The value to set
+ * @return Returns no value
+ * @brief Sets the value for the given key
+ */
EAPI void efreet_ini_boolean_set(Efreet_Ini *ini, const char *key,
unsigned int value);
+
+/**
+ * @param ini The Efree_Ini to work with
+ * @param key The key to lookup
+ * @return Returns the integer associated with the given key or -1 if not
+ * found.
+ * @brief Retrieves the value for the given key or -1 if none found.
+ */
EAPI int efreet_ini_int_get(Efreet_Ini *ini, const char *key);
+
+/**
+ * @param ini The Efree_Ini to work with
+ * @param key The key to use
+ * @param value The value to set
+ * @return Returns no value
+ * @brief Sets the value for the given key
+ */
EAPI void efreet_ini_int_set(Efreet_Ini *ini, const char *key, int value);
+
+/**
+ * @param ini The Efree_Ini to work with
+ * @param key The key to lookup
+ * @return Returns the double associated with the given key or -1 if not
+ * found.
+ * @brief Retrieves the value for the given key or -1 if none found.
+ */
EAPI double efreet_ini_double_get(Efreet_Ini *ini, const char *key);
+
+/**
+ * @param ini The Efree_Ini to work with
+ * @param key The key to use
+ * @param value The value to set
+ * @return Returns no value
+ * @brief Sets the value for the given key
+ */
EAPI void efreet_ini_double_set(Efreet_Ini *ini, const char *key,
double value);
+
+/**
+ * @param ini The ini struct to work with
+ * @param key The key to remove
+ * @return Returns no value
+ * @brief Remove the given key from the ini struct
+ */
EAPI void efreet_ini_key_unset(Efreet_Ini *ini, const char *key);
/**
#include "efreet_private.h"
#include "efreet_xml.h"
-/**
- * Efreet_Menu_Move
- */
typedef struct Efreet_Menu_Move Efreet_Menu_Move;
-/**
- * Efreet_Menu_Move
- * Info on a menu movement
- */
struct Efreet_Menu_Move
{
const char *old_name; /**< The menu path to move from */
const char *new_name; /**< The menu path to move too */
};
-/**
- * Efreet_Menu_Internal
- */
typedef struct Efreet_Menu_Internal Efreet_Menu_Internal;
-/**
- * Efreet_Menu_Internal
- * Contains the information about a menu
- */
struct Efreet_Menu_Internal
{
struct
unsigned char deleted:1; /**< The menu is deleted */
};
-/**
- * Efreet_Menu_App_Dir
- */
typedef struct Efreet_Menu_App_Dir Efreet_Menu_App_Dir;
-/**
- * Holds information on an app dir
- */
struct Efreet_Menu_App_Dir
{
const char *path; /**< directory path */
unsigned int legacy:1; /**< is this a legacy dir */
};
-/**
- * The type of operations we can perform with a filter
- */
enum Efreet_Menu_Filter_Op_Type
{
EFREET_MENU_FILTER_OP_OR,
EFREET_MENU_FILTER_OP_NOT
};
-/**
- * Efreet_Menu_Filter_Op_Type
- */
typedef enum Efreet_Menu_Filter_Op_Type Efreet_Menu_Filter_Op_Type;
-/**
- * The type of filter
- */
enum Efreet_Menu_Filter_Type
{
EFREET_MENU_FILTER_INCLUDE,
EFREET_MENU_FILTER_EXCLUDE
};
-/**
- * Efreet_Menu_Filter_Type
- */
typedef enum Efreet_Menu_Filter_Type Efreet_Menu_Filter_Type;
-/**
- * Efreet_Menu_Filter_Op
- */
typedef struct Efreet_Menu_Filter_Op Efreet_Menu_Filter_Op;
-/**
- * Efreet_Menu_Filter_Op
- * Contains information on a filter operation
- */
struct Efreet_Menu_Filter_Op
{
Efreet_Menu_Filter_Op_Type type; /**< The type of operation */
unsigned char all:1; /**< Applies to all .desktop files */
};
-/**
- * Efreet_Menu_Filter
- */
typedef struct Efreet_Menu_Filter Efreet_Menu_Filter;
-/**
- * Efreet_Menu_Filter
- * Stores information on a filter
- */
struct Efreet_Menu_Filter
{
Efreet_Menu_Filter_Type type; /**< The type of filter */
Efreet_Menu_Filter_Op *op; /**< The filter operations */
};
-/**
- * The type of layout
- */
enum Efreet_Menu_Layout_Type
{
EFREET_MENU_LAYOUT_MENUNAME,
EFREET_MENU_LAYOUT_MERGE
};
-/**
- * Efreet_Menu_Layout_Type
- */
typedef enum Efreet_Menu_Layout_Type Efreet_Menu_Layout_Type;
-/**
- * Efreet_Menu_Layout
- */
typedef struct Efreet_Menu_Layout Efreet_Menu_Layout;
-/**
- * Efreet_Menu_Layout
- * Stores information on a layout
- */
struct Efreet_Menu_Layout
{
Efreet_Menu_Layout_Type type; /**< The type of layout */
signed char inline_alias; /**< Whether we should use the menu name when inlining */
};
-/**
- * Efreet_Menu_Desktop
- */
typedef struct Efreet_Menu_Desktop Efreet_Menu_Desktop;
-/**
- * Efreet_Menu_Desktop
- * Stores information on a desktop for the menu
- */
struct Efreet_Menu_Desktop
{
Efreet_Desktop *desktop; /**< The desktop we refer too */
static void efreet_menu_path_set(Efreet_Menu_Internal *internal, const char *path);
-/**
- * @return Returns 1 on success, 0 on failure
- * @brief Initializes the Efreet Menu system.
- */
int
efreet_menu_init(void)
{
return 1;
}
-/**
- * @return Returns no value
- * @brief Initialize legacy kde support. This function blocks while
- * the kde-config script is run.
- */
EAPI int
efreet_menu_kde_legacy_init(void)
{
return 1;
}
-/**
- * @return Returns no value
- * @brief Shuts down the Efreet menu system
- */
void
efreet_menu_shutdown(void)
{
_efreet_menu_log_dom = -1;
}
-/**
- * @param name The internal name of the menu
- * @return Returns the Efreet_Menu on success or
- * NULL on failure
- * @brief Creates a new menu
- */
EAPI Efreet_Menu *
efreet_menu_new(const char *name)
{
return menu;
}
-/**
- * @brief Override which file is used for menu creation
- * @param file The file to use for menu creation
- *
- * This file is only used if it exists, else the standard files will be used
- * for the menu.
- */
EAPI void
efreet_menu_file_set(const char *file)
{
if (file) efreet_menu_file = eina_stringshare_add(file);
}
-/**
- * @return Returns the Efreet_Menu_Internal representation of the default menu or
- * NULL if none found
- * @brief Creates the default menu representation
- */
EAPI Efreet_Menu *
efreet_menu_get(void)
{
return NULL;
}
-/**
- * @param path The path of the menu to load
- * @return Returns the Efreet_Menu_Internal representation on success or NULL on
- * failure
- * @brief Parses the given .menu file and creates the menu representation
- */
EAPI Efreet_Menu *
efreet_menu_parse(const char *path)
{
return entry;
}
-/**
- * @param menu The menu to work with
- * @param path The path where the menu should be saved
- * @return Returns 1 on success, 0 on failure
- * @brief Saves the menu to file
- */
EAPI int
efreet_menu_save(Efreet_Menu *menu, const char *path)
{
return 1;
}
-/**
- * @param menu The menu to work with
- * @param desktop The desktop to insert
- * @param pos The position to place the new desktop
- * @return Returns 1 on success, 0 on failure
- * @brief Insert a desktop element in a menu structure. Only accepts desktop files
- * in default directories.
- */
EAPI int
efreet_menu_desktop_insert(Efreet_Menu *menu, Efreet_Desktop *desktop, int pos)
{
return 1;
}
-/**
- * @param menu The menu to work with
- * @param desktop The desktop to remove
- * @return Returns 1 on success, 0 on failure
- * @brief Remove a desktop element in a menu structure. Only accepts desktop files
- * in default directories.
- */
EAPI int
efreet_menu_desktop_remove(Efreet_Menu *menu, Efreet_Desktop *desktop)
{
return 0;
}
-/**
- * @param menu The menu to work with
- * @param menu The menu to work with
- * @param indent The indent level to print the menu at
- * @return Returns no value
- * @brief Dumps the contents of the menu to the command line
- */
EAPI void
efreet_menu_dump(Efreet_Menu *menu, const char *indent)
{
}
/**
+ * @internal
* @param user_dir The user directory to work with
* @param system_dirs The system directories to work with
* @param suffix The path suffix to add
return entry;
}
-/**
- * @param entry The Efreet_Menu to free
- * @return Returns no value
- * @brief Frees the given structure
- */
EAPI void
efreet_menu_free(Efreet_Menu *entry)
{
Eina_List *entries; /**< The menu items */
};
+
+/**
+ * @return Returns no value
+ * @brief Initialize legacy kde support. This function blocks while
+ * the kde-config script is run.
+ */
EAPI int efreet_menu_kde_legacy_init(void);
+/**
+ * @param name The internal name of the menu
+ * @return Returns the Efreet_Menu on success or
+ * NULL on failure
+ * @brief Creates a new menu
+ */
EAPI Efreet_Menu *efreet_menu_new(const char *name);
+
+/**
+ * @brief Override which file is used for menu creation
+ * @param file The file to use for menu creation
+ *
+ * This file is only used if it exists, else the standard files will be used
+ * for the menu.
+ */
EAPI void efreet_menu_file_set(const char *file);
+
+/**
+ * @return Returns the Efreet_Menu_Internal representation of the default menu or
+ * NULL if none found
+ * @brief Creates the default menu representation
+ */
EAPI Efreet_Menu *efreet_menu_get(void);
+
+/**
+ * @param path The path of the menu to load
+ * @return Returns the Efreet_Menu_Internal representation on success or NULL on
+ * failure
+ * @brief Parses the given .menu file and creates the menu representation
+ */
EAPI Efreet_Menu *efreet_menu_parse(const char *path);
+
+/**
+ * @param menu The menu to work with
+ * @param path The path where the menu should be saved
+ * @return Returns 1 on success, 0 on failure
+ * @brief Saves the menu to file
+ */
EAPI int efreet_menu_save(Efreet_Menu *menu, const char *path);
+
+/**
+ * @param entry The Efreet_Menu to free
+ * @return Returns no value
+ * @brief Frees the given structure
+ */
EAPI void efreet_menu_free(Efreet_Menu *menu);
+
+/**
+ * @param menu The menu to work with
+ * @param desktop The desktop to insert
+ * @param pos The position to place the new desktop
+ * @return Returns 1 on success, 0 on failure
+ * @brief Insert a desktop element in a menu structure. Only accepts desktop files
+ * in default directories.
+ */
EAPI int efreet_menu_desktop_insert(Efreet_Menu *menu,
Efreet_Desktop *desktop,
int pos);
+
+/**
+ * @param menu The menu to work with
+ * @param desktop The desktop to remove
+ * @return Returns 1 on success, 0 on failure
+ * @brief Remove a desktop element in a menu structure. Only accepts desktop files
+ * in default directories.
+ */
EAPI int efreet_menu_desktop_remove(Efreet_Menu *menu,
Efreet_Desktop *desktop);
+
+/**
+ * @param menu The menu to work with
+ * @param menu The menu to work with
+ * @param indent The indent level to print the menu at
+ * @return Returns no value
+ * @brief Dumps the contents of the menu to the command line
+ */
EAPI void efreet_menu_dump(Efreet_Menu *menu, const char *indent);
/**
*/
//#define EFREET_MIME_ICONS_DEBUG
-/**
- * Efreet_Mime_Glob
- * @brief A parsed representation of a globs file
- */
typedef struct Efreet_Mime_Glob Efreet_Mime_Glob;
struct Efreet_Mime_Glob
{
const char *mime;
};
-/**
- * Efreet_Mime_Magic
- * @brief A parsed representation of a magic file section
- */
typedef struct Efreet_Mime_Magic Efreet_Mime_Magic;
struct Efreet_Mime_Magic
{
Eina_List *entries;
};
-/**
- * Efreet_Mime_Magic_Entry
- * @brief A parsed representation of a magic file entry
- */
typedef struct Efreet_Mime_Magic_Entry Efreet_Mime_Magic_Entry;
struct Efreet_Mime_Magic_Entry
{
unsigned int size);
static void efreet_mime_icons_debug(void);
-/**
- * @return Returns 1 on success or 0 on failure
- * @brief Initializes the efreet mime settings
- */
EAPI int
efreet_mime_init(void)
{
return --_efreet_mime_init_count;
}
-/**
- * @return Returns no value
- * @brief Cleans up the efreet mime settings system
- */
EAPI int
efreet_mime_shutdown(void)
{
return _efreet_mime_init_count;
}
-/**
- * @param file The file to find the mime type
- * @return Returns mime type as a string
- * @brief Retreive the mime type of a file
- */
EAPI const char *
efreet_mime_type_get(const char *file)
{
return efreet_mime_fallback_check(file);
}
-/**
- * @param mime The name of the mime type
- * @param theme The name of the theme to search icons in
- * @param size The wanted size of the icon
- * @return Returns mime type icon path as a string
- * @brief Retreive the mime type icon for a file
- */
EAPI const char *
efreet_mime_type_icon_get(const char *mime, const char *theme, unsigned int size)
{
return icon;
}
-/**
- * @brief Clear mime icons mapping cache
- */
EAPI void
efreet_mime_type_cache_clear(void)
{
mime_icons = eina_hash_stringshared_new(EINA_FREE_CB(efreet_mime_icon_entry_head_free));
}
-/**
- * @brief Flush mime icons mapping cache
- *
- * Flush timeout is defined at compile time by
- * EFREET_MIME_ICONS_FLUSH_TIMEOUT
- */
EAPI void
efreet_mime_type_cache_flush(void)
{
}
-/**
- * @param file The file to check the mime type
- * @return Returns mime type as a string
- * @brief Retreive the mime type of a file using magic
- */
EAPI const char *
efreet_mime_magic_type_get(const char *file)
{
return efreet_mime_magic_check_priority(file, 0, 0);
}
-/**
- * @param file The file to check the mime type
- * @return Returns mime type as a string
- * @brief Retreive the mime type of a file using globs
- */
EAPI const char *
efreet_mime_globs_type_get(const char *file)
{
return NULL;
}
-/**
- * @param file The file to check the mime type
- * @return Returns mime type as a string
- * @brief Retreive the special mime type of a file
- */
EAPI const char *
efreet_mime_special_type_get(const char *file)
{
return efreet_mime_special_check(file);
}
-/**
- * @param file The file to check the mime type
- * @return Returns mime type as a string
- * @brief Retreive the fallback mime type of a file
- */
EAPI const char *
efreet_mime_fallback_type_get(const char *file)
{
# define getuid() GetCurrentProcessId()
#endif
-/**
- * @return Returns 1 on success or 0 on failure
- * @brief Initializes the efreet trash system
- */
EAPI int
efreet_trash_init(void)
{
return _efreet_trash_init_count;
}
-/**
- * @return Returns no value
- * @brief Cleans up the efreet trash system
- */
EAPI int
efreet_trash_shutdown(void)
{
return _efreet_trash_init_count;
}
-/**
- * @return Returns the XDG Trash local directory or NULL on errors
- * return value must be freed with eina_stringshare_del.
- * @brief Retrieves the XDG Trash local directory
- */
EAPI const char*
efreet_trash_dir_get(const char *file)
{
return trash_dir;
}
-/**
- * @param uri The local uri to move in the trash
- * @param force_delete If you set this to 1 than files on different filesystems
- * will be deleted permanently
- * @return Return 1 on success, 0 on failure or -1 in case the uri is not on the
- * same filesystem and force_delete is not set.
- * @brief This function try to move the given uri to the trash. Files on
- * different filesystem can't be moved to trash. If force_delete
- * is 0 than non-local files will be ignored and -1 is returned, if you set
- * force_delete to 1 non-local files will be deleted without asking.
- */
EAPI int
efreet_trash_delete_uri(Efreet_Uri *uri, int force_delete)
{
return 1;
}
-/**
- * @return Return 1 if the trash is empty or 0 if some file are in.
- * @brief Check if the trash is currently empty
- */
EAPI int
efreet_trash_is_empty(void)
{
return ecore_file_dir_is_empty(buf);
}
-/**
- * @return Return 1 on success or 0 on failure
- * @brief Delete all the files inside the trash.
- */
EAPI int
efreet_trash_empty_trash(void)
{
return 1;
}
-/**
- * @return Return a list of strings with filename (remember to free the list
- * when you don't need anymore)
- * @brief List all the files and directory currently inside the trash.
- */
EAPI Eina_List*
efreet_trash_ls(void)
{
#include "efreet_private.h"
-/**
- * @param full_uri a valid uri string to parse
- * @return Return The corresponding Efreet_Uri structure. Or NULL on errors.
- * @brief Read a single uri and return an Efreet_Uri struct. If there's no
- * hostname in the uri then the hostname parameter will be NULL. All the uri
- * escaped chars will be converted to normal.
- */
EAPI Efreet_Uri *
efreet_uri_decode(const char *full_uri)
{
return uri;
}
-/**
- * @param uri Create an URI string from an Efreet_Uri struct
- * @return The string rapresentation of uri (ex: 'file:///home/my%20name')
- * @brief Get the string rapresentation of the given uri struct escaping
- * illegal caracters. Remember to free the string with eina_stringshare_del()
- * when you don't need it anymore.
- * @note The resulting string will contain the protocol and the path but not
- * the hostname, as many apps doesn't handle it.
- */
EAPI const char *
efreet_uri_encode(Efreet_Uri *uri)
{
return eina_stringshare_add(dest);
}
-/**
- * @param uri The uri to free
- * @brief Free the given uri structure.
- */
EAPI void
efreet_uri_free(Efreet_Uri *uri)
{
};
+
+/**
+ * @param uri Create an URI string from an Efreet_Uri struct
+ * @return The string rapresentation of uri (ex: 'file:///home/my%20name')
+ * @brief Get the string rapresentation of the given uri struct escaping
+ * illegal caracters. Remember to free the string with eina_stringshare_del()
+ * when you don't need it anymore.
+ * @note The resulting string will contain the protocol and the path but not
+ * the hostname, as many apps doesn't handle it.
+ */
EAPI const char *efreet_uri_encode(Efreet_Uri *uri);
+
+/**
+ * @param full_uri a valid uri string to parse
+ * @return Return The corresponding Efreet_Uri structure. Or NULL on errors.
+ * @brief Read a single uri and return an Efreet_Uri struct. If there's no
+ * hostname in the uri then the hostname parameter will be NULL. All the uri
+ * escaped chars will be converted to normal.
+ */
EAPI Efreet_Uri *efreet_uri_decode(const char *val);
+
+/**
+ * @param uri The uri to free
+ * @brief Free the given uri structure.
+ */
EAPI void efreet_uri_free(Efreet_Uri *uri);
return ret;
}
-/**
- * Returns the fdo file id for a given path. If the file isn't inside
- * a default fdo path it will return NULL.
- *
- * @param path The path to find the file id for
- *
- * @return File id for path or NULL
- */
EAPI const char *
efreet_util_path_to_file_id(const char *path)
{
return file_id;
}
-/**
- * Find all desktops for a given mime type
- *
- * This list must be freed using EINA_LIST_FREE / efreet_desktop_free
- *
- * @param mime the mime type
- * @return a list of desktops
- */
EAPI Eina_List *
efreet_util_desktop_mime_list(const char *mime)
{
return efreet_util_cache_list("mime_types", mime);
}
-/**
- * Find all desktops for a given wm class
- *
- * This list must be freed using EINA_LIST_FREE / efreet_desktop_free
- *
- * @param wmname the wm name
- * @param wmclass the wm class
- * @return a list of desktops
- */
EAPI Efreet_Desktop *
efreet_util_desktop_wm_class_find(const char *wmname, const char *wmclass)
{
return efreet_util_cache_find("startup_wm_class", wmname, wmclass);
}
-/**
- * Find a desktop by file id
- *
- * return value must be freed by efreet_desktop_free
- *
- * @param file_id the file id
- * @return a desktop
- */
EAPI Efreet_Desktop *
efreet_util_desktop_file_id_find(const char *file_id)
{
return ret;
}
-/**
- * Find a desktop by exec
- *
- * return value must be freed by efreet_desktop_free
- *
- * @param exec the exec name
- * @return a desktop
- */
EAPI Efreet_Desktop *
efreet_util_desktop_exec_find(const char *exec)
{
return ret;
}
-/**
- * Find a desktop by name
- *
- * return value must be freed by efreet_desktop_free
- *
- * @param name the name
- * @return a desktop
- */
EAPI Efreet_Desktop *
efreet_util_desktop_name_find(const char *name)
{
return efreet_util_cache_find("name", name, NULL);
}
-/**
- * Find a desktop by generic name
- *
- * return value must be freed by efreet_desktop_free
- *
- * @param generic_name the generic name
- * @return a desktop
- */
EAPI Efreet_Desktop *
efreet_util_desktop_generic_name_find(const char *generic_name)
{
return efreet_util_cache_find("generic_name", generic_name, NULL);
}
-/**
- * Find all desktops where name matches a glob pattern
- *
- * This list must be freed using EINA_LIST_FREE / efreet_desktop_free
- *
- * @param glob the pattern to match
- * @return a list of desktops
- */
EAPI Eina_List *
efreet_util_desktop_name_glob_list(const char *glob)
{
return efreet_util_cache_glob_list("name", glob);
}
-/**
- * Find all desktops where exec matches a glob pattern
- *
- * This list must be freed using EINA_LIST_FREE / efreet_desktop_free
- *
- * @param glob the pattern to match
- * @return a list of desktops
- */
EAPI Eina_List *
efreet_util_desktop_exec_glob_list(const char *glob)
{
return ret;
}
-/**
- * Find all desktops where generic name matches a glob pattern
- *
- * This list must be freed using EINA_LIST_FREE / efreet_desktop_free
- *
- * @param glob the pattern to match
- * @return a list of desktops
- */
EAPI Eina_List *
efreet_util_desktop_generic_name_glob_list(const char *glob)
{
return efreet_util_cache_glob_list("generic_name", glob);
}
-/**
- * Find all desktops where comment matches a glob pattern
- *
- * This list must be freed using EINA_LIST_FREE / efreet_desktop_free
- *
- * @param glob the pattern to match
- * @return a list of desktops
- */
EAPI Eina_List *
efreet_util_desktop_comment_glob_list(const char *glob)
{
return efreet_util_cache_glob_list("comment", glob);
}
-/**
- * Find all desktop categories
- * This list must be freed using EINA_LIST_FREE
- *
- * @return an Eina_List of category names (const char *)
- */
EAPI Eina_List *
efreet_util_desktop_categories_list(void)
{
return ret;
}
-/**
- * Find all desktops in a given category
- *
- * This list must be freed using EINA_LIST_FREE / efreet_desktop_free
- *
- * @param category the category name
- * @return a list of desktops
- */
EAPI Eina_List *
efreet_util_desktop_category_list(const char *category)
{
return 0;
}
-/**
- * Returns a list of .menu files found in the various config dirs.
- * @return An eina list of menu file paths (const char *). This must be freed with EINA_LIST_FREE.
- */
EAPI Eina_List *
efreet_util_menus_find(void)
{
* @{
*/
+
+/**
+ * Returns the fdo file id for a given path. If the file isn't inside
+ * a default fdo path it will return NULL.
+ *
+ * @param path The path to find the file id for
+ *
+ * @return File id for path or NULL
+ */
EAPI const char *efreet_util_path_to_file_id(const char *path);
+
+/**
+ * Find all desktops for a given mime type
+ *
+ * This list must be freed using EINA_LIST_FREE / efreet_desktop_free
+ *
+ * @param mime the mime type
+ * @return a list of desktops
+ */
EAPI Eina_List *efreet_util_desktop_mime_list(const char *mime);
+
+/**
+ * Find all desktops for a given wm class
+ *
+ * This list must be freed using EINA_LIST_FREE / efreet_desktop_free
+ *
+ * @param wmname the wm name
+ * @param wmclass the wm class
+ * @return a list of desktops
+ */
EAPI Efreet_Desktop *efreet_util_desktop_wm_class_find(const char *wmname, const char *wmclass);
+
+/**
+ * Find a desktop by file id
+ *
+ * return value must be freed by efreet_desktop_free
+ *
+ * @param file_id the file id
+ * @return a desktop
+ */
EAPI Efreet_Desktop *efreet_util_desktop_file_id_find(const char *file_id);
+
+/**
+ * Find a desktop by exec
+ *
+ * return value must be freed by efreet_desktop_free
+ *
+ * @param exec the exec name
+ * @return a desktop
+ */
EAPI Efreet_Desktop *efreet_util_desktop_exec_find(const char *exec);
+
+/**
+ * Find a desktop by name
+ *
+ * return value must be freed by efreet_desktop_free
+ *
+ * @param name the name
+ * @return a desktop
+ */
EAPI Efreet_Desktop *efreet_util_desktop_name_find(const char *name);
+
+/**
+ * Find a desktop by generic name
+ *
+ * return value must be freed by efreet_desktop_free
+ *
+ * @param generic_name the generic name
+ * @return a desktop
+ */
EAPI Efreet_Desktop *efreet_util_desktop_generic_name_find(const char *generic_name);
+
+/**
+ * Find all desktops where name matches a glob pattern
+ *
+ * This list must be freed using EINA_LIST_FREE / efreet_desktop_free
+ *
+ * @param glob the pattern to match
+ * @return a list of desktops
+ */
EAPI Eina_List *efreet_util_desktop_name_glob_list(const char *glob);
+
+/**
+ * Find all desktops where exec matches a glob pattern
+ *
+ * This list must be freed using EINA_LIST_FREE / efreet_desktop_free
+ *
+ * @param glob the pattern to match
+ * @return a list of desktops
+ */
EAPI Eina_List *efreet_util_desktop_exec_glob_list(const char *glob);
+
+/**
+ * Find all desktops where generic name matches a glob pattern
+ *
+ * This list must be freed using EINA_LIST_FREE / efreet_desktop_free
+ *
+ * @param glob the pattern to match
+ * @return a list of desktops
+ */
EAPI Eina_List *efreet_util_desktop_generic_name_glob_list(const char *glob);
+
+/**
+ * Find all desktops where comment matches a glob pattern
+ *
+ * This list must be freed using EINA_LIST_FREE / efreet_desktop_free
+ *
+ * @param glob the pattern to match
+ * @return a list of desktops
+ */
EAPI Eina_List *efreet_util_desktop_comment_glob_list(const char *glob);
+
+/**
+ * Find all desktop categories
+ * This list must be freed using EINA_LIST_FREE
+ *
+ * @return an Eina_List of category names (const char *)
+ */
EAPI Eina_List *efreet_util_desktop_categories_list(void);
+
+/**
+ * Find all desktops in a given category
+ *
+ * This list must be freed using EINA_LIST_FREE / efreet_desktop_free
+ *
+ * @param category the category name
+ * @return a list of desktops
+ */
EAPI Eina_List *efreet_util_desktop_category_list(const char *category);
+
+/**
+ * Returns a list of .menu files found in the various config dirs.
+ * @return An eina list of menu file paths (const char *). This must be freed with EINA_LIST_FREE.
+ */
EAPI Eina_List *efreet_util_menus_find(void);
/**