2007-02-03 05:05:30 -08:00
|
|
|
#ifndef EFREET_MENU_H
|
|
|
|
#define EFREET_MENU_H
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @file efreet_menu.h
|
2007-09-06 09:15:10 -07:00
|
|
|
* @brief Contains the structures and methods to support the Desktop
|
2007-02-03 05:05:30 -08:00
|
|
|
* Menu Specification.
|
|
|
|
* @addtogroup Efreet_Menu Efreet_Menu: The FDO Desktop Menu Specification
|
|
|
|
* functions and structures
|
2012-12-29 15:04:40 -08:00
|
|
|
* @ingroup Efreet
|
2007-02-03 05:05:30 -08:00
|
|
|
*
|
|
|
|
* @{
|
|
|
|
*/
|
|
|
|
|
|
|
|
/**
|
|
|
|
* The type of entry
|
|
|
|
*/
|
2009-09-13 17:38:59 -07:00
|
|
|
typedef enum Efreet_Menu_Entry_Type
|
2007-02-03 05:05:30 -08:00
|
|
|
{
|
|
|
|
EFREET_MENU_ENTRY_MENU,
|
|
|
|
EFREET_MENU_ENTRY_DESKTOP,
|
|
|
|
EFREET_MENU_ENTRY_SEPARATOR,
|
|
|
|
EFREET_MENU_ENTRY_HEADER
|
2009-09-13 17:38:59 -07:00
|
|
|
} Efreet_Menu_Entry_Type;
|
2007-02-03 05:05:30 -08:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Efreet_Menu
|
|
|
|
*/
|
|
|
|
typedef struct Efreet_Menu Efreet_Menu;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Efreet_Menu
|
|
|
|
* Stores information on a entry in the menu
|
|
|
|
*/
|
|
|
|
struct Efreet_Menu
|
|
|
|
{
|
|
|
|
Efreet_Menu_Entry_Type type;
|
2007-02-05 18:16:33 -08:00
|
|
|
const char *id; /**< File-id for desktop and relative name for menu */
|
2007-02-03 05:05:30 -08:00
|
|
|
|
|
|
|
const char *name; /**< Name this entry should show */
|
|
|
|
const char *icon; /**< Icon for this entry */
|
|
|
|
|
|
|
|
Efreet_Desktop *desktop; /**< The desktop we refer too */
|
* 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 *entries; /**< The menu items */
|
2007-02-03 05:05:30 -08:00
|
|
|
};
|
|
|
|
|
2011-04-08 04:01:08 -07:00
|
|
|
|
|
|
|
/**
|
|
|
|
* @return Returns no value
|
|
|
|
* @brief Initialize legacy kde support. This function blocks while
|
|
|
|
* the kde-config script is run.
|
|
|
|
*/
|
2007-11-04 01:32:35 -08:00
|
|
|
EAPI int efreet_menu_kde_legacy_init(void);
|
2007-02-03 05:05:30 -08:00
|
|
|
|
2011-04-08 04:01:08 -07:00
|
|
|
/**
|
|
|
|
* @param name The internal name of the menu
|
|
|
|
* @return Returns the Efreet_Menu on success or
|
|
|
|
* NULL on failure
|
|
|
|
* @brief Creates a new menu
|
|
|
|
*/
|
2008-12-15 12:23:24 -08:00
|
|
|
EAPI Efreet_Menu *efreet_menu_new(const char *name);
|
2011-04-08 04:01:08 -07:00
|
|
|
|
|
|
|
/**
|
|
|
|
* @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.
|
|
|
|
*/
|
2008-10-25 08:06:31 -07:00
|
|
|
EAPI void efreet_menu_file_set(const char *file);
|
2011-04-08 04:01:08 -07:00
|
|
|
|
|
|
|
/**
|
|
|
|
* @return Returns the Efreet_Menu_Internal representation of the default menu or
|
|
|
|
* NULL if none found
|
|
|
|
* @brief Creates the default menu representation
|
|
|
|
*/
|
2007-11-04 01:32:35 -08:00
|
|
|
EAPI Efreet_Menu *efreet_menu_get(void);
|
2011-04-08 04:01:08 -07:00
|
|
|
|
|
|
|
/**
|
|
|
|
* @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
|
|
|
|
*/
|
2007-11-04 01:32:35 -08:00
|
|
|
EAPI Efreet_Menu *efreet_menu_parse(const char *path);
|
2011-04-08 04:01:08 -07:00
|
|
|
|
|
|
|
/**
|
|
|
|
* @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
|
|
|
|
*/
|
2007-11-04 01:32:35 -08:00
|
|
|
EAPI int efreet_menu_save(Efreet_Menu *menu, const char *path);
|
2011-04-08 04:01:08 -07:00
|
|
|
|
|
|
|
/**
|
2012-03-31 01:12:22 -07:00
|
|
|
* @param menu The Efreet_Menu to free
|
2011-04-08 04:01:08 -07:00
|
|
|
* @return Returns no value
|
|
|
|
* @brief Frees the given structure
|
|
|
|
*/
|
2007-11-04 01:32:35 -08:00
|
|
|
EAPI void efreet_menu_free(Efreet_Menu *menu);
|
2007-02-03 05:05:30 -08:00
|
|
|
|
2011-04-08 04:01:08 -07:00
|
|
|
|
|
|
|
/**
|
|
|
|
* @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.
|
|
|
|
*/
|
2007-11-04 01:32:35 -08:00
|
|
|
EAPI int efreet_menu_desktop_insert(Efreet_Menu *menu,
|
|
|
|
Efreet_Desktop *desktop,
|
|
|
|
int pos);
|
2011-04-08 04:01:08 -07:00
|
|
|
|
|
|
|
/**
|
|
|
|
* @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.
|
|
|
|
*/
|
2007-11-04 01:32:35 -08:00
|
|
|
EAPI int efreet_menu_desktop_remove(Efreet_Menu *menu,
|
|
|
|
Efreet_Desktop *desktop);
|
2007-02-06 18:14:46 -08:00
|
|
|
|
2011-04-08 04:01:08 -07:00
|
|
|
|
|
|
|
/**
|
|
|
|
* @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
|
|
|
|
*/
|
2007-11-04 01:32:35 -08:00
|
|
|
EAPI void efreet_menu_dump(Efreet_Menu *menu, const char *indent);
|
2007-02-03 05:05:30 -08:00
|
|
|
|
|
|
|
/**
|
|
|
|
* @}
|
|
|
|
*/
|
|
|
|
|
|
|
|
#endif
|