Efreet_Menu: The FDO Desktop Menu Specification

functions and structures More...

Data Structures

struct  Efreet_Menu
 Efreet_Menu Stores information on a entry in the menu. More...

Typedefs

typedef enum Efreet_Menu_Entry_Type Efreet_Menu_Entry_Type
 The type of entry.
typedef struct Efreet_Menu Efreet_Menu
 Efreet_Menu.

Enumerations

enum  Efreet_Menu_Entry_Type {
  EFREET_MENU_ENTRY_MENU,
  EFREET_MENU_ENTRY_DESKTOP,
  EFREET_MENU_ENTRY_SEPARATOR,
  EFREET_MENU_ENTRY_HEADER
}
 The type of entry.

Functions

int efreet_menu_kde_legacy_init (void)
 Initialize legacy kde support. This function blocks while the kde-config script is run.
Efreet_Menuefreet_menu_new (const char *name)
 Creates a new menu.
void efreet_menu_file_set (const char *file)
 Override which file is used for menu creation.
Efreet_Menuefreet_menu_get (void)
 Creates the default menu representation.
Efreet_Menuefreet_menu_parse (const char *path)
 Parses the given .menu file and creates the menu representation.
int efreet_menu_save (Efreet_Menu *menu, const char *path)
 Saves the menu to file.
void efreet_menu_free (Efreet_Menu *menu)
 Frees the given structure.
int efreet_menu_desktop_insert (Efreet_Menu *menu, Efreet_Desktop *desktop, int pos)
 Insert a desktop element in a menu structure. Only accepts desktop files in default directories.
int efreet_menu_desktop_remove (Efreet_Menu *menu, Efreet_Desktop *desktop)
 Remove a desktop element in a menu structure. Only accepts desktop files in default directories.
void efreet_menu_dump (Efreet_Menu *menu, const char *indent)
 Dumps the contents of the menu to the command line.

Detailed Description

functions and structures


Function Documentation

Initialize legacy kde support. This function blocks while the kde-config script is run.

Returns:
Returns no value

References ERR, and IF_FREE_LIST.

Efreet_Menu* efreet_menu_new ( const char *  name)

Creates a new menu.

Parameters:
nameThe internal name of the menu
Returns:
Returns the Efreet_Menu on success or NULL on failure

References ERR, and name.

void efreet_menu_file_set ( const char *  file)

Override which file is used for menu creation.

Parameters:
fileThe file to use for menu creation

This file is only used if it exists, else the standard files will be used for the menu.

References IF_RELEASE.

Creates the default menu representation.

Returns:
Returns the Efreet_Menu_Internal representation of the default menu or NULL if none found

References efreet_config_dirs_get(), efreet_config_home_get(), and efreet_menu_parse().

Efreet_Menu* efreet_menu_parse ( const char *  path)

Parses the given .menu file and creates the menu representation.

Parameters:
pathThe path of the menu to load
Returns:
Returns the Efreet_Menu_Internal representation on success or NULL on failure

References IF_FREE_HASH, and Efreet_Xml::tag.

Referenced by efreet_menu_get().

int efreet_menu_save ( Efreet_Menu menu,
const char *  path 
)

Saves the menu to file.

Parameters:
menuThe menu to work with
pathThe path where the menu should be saved
Returns:
Returns 1 on success, 0 on failure
void efreet_menu_free ( Efreet_Menu menu)

Frees the given structure.

Parameters:
menuThe Efreet_Menu to free
Returns:
Returns no value

References desktop, efreet_desktop_free(), efreet_menu_free(), entries, FREE, icon, id, IF_RELEASE, and name.

Referenced by efreet_menu_desktop_remove(), and efreet_menu_free().

int efreet_menu_desktop_insert ( Efreet_Menu menu,
Efreet_Desktop desktop,
int  pos 
)

Insert a desktop element in a menu structure. Only accepts desktop files in default directories.

Parameters:
menuThe menu to work with
desktopThe desktop to insert
posThe position to place the new desktop
Returns:
Returns 1 on success, 0 on failure

References desktop, efreet_desktop_ref(), efreet_util_path_to_file_id(), entries, icon, _Efreet_Desktop::icon, id, name, _Efreet_Desktop::name, and _Efreet_Desktop::orig_path.

int efreet_menu_desktop_remove ( Efreet_Menu menu,
Efreet_Desktop desktop 
)

Remove a desktop element in a menu structure. Only accepts desktop files in default directories.

Parameters:
menuThe menu to work with
desktopThe desktop to remove
Returns:
Returns 1 on success, 0 on failure

References efreet_menu_free(), and entries.

void efreet_menu_dump ( Efreet_Menu menu,
const char *  indent 
)

Dumps the contents of the menu to the command line.

Parameters:
menuThe menu to work with
menuThe menu to work with
indentThe indent level to print the menu at
Returns:
Returns no value

References efreet_menu_dump(), entries, icon, and name.

Referenced by efreet_menu_dump().