Data Structures | Typedefs | Enumerations | Functions
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.
 
typedef void(* Efreet_Menu_Cb) (void *data, Efreet_Menu *menu)
 A callback used with efreet_menu_async_get() and efreet_menu_async_parse() More...
 

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. More...
 
Efreet_Menuefreet_menu_new (const char *name)
 Creates a new menu. More...
 
void efreet_menu_file_set (const char *file)
 Override which file is used for menu creation. More...
 
EFREET_DEPRECATED_API void efreet_menu_async_get (Efreet_Menu_Cb func, const void *data)
 Creates the Efreet_Menu representation of the default menu or NULL if none found and returns it in the callback. More...
 
Efreet_Menuefreet_menu_get (void)
 Creates the default menu representation. More...
 
EFREET_DEPRECATED_API void efreet_menu_async_parse (const char *path, Efreet_Menu_Cb func, const void *data)
 Parses the given .menu file and creates the menu representation, and returns it in the callback. More...
 
Efreet_Menuefreet_menu_parse (const char *path)
 Parses the given .menu file and creates the menu representation. More...
 
int efreet_menu_save (Efreet_Menu *menu, const char *path)
 Saves the menu to file. More...
 
void efreet_menu_free (Efreet_Menu *menu)
 Frees the given structure (if refcount at 1 at the time of this call) More...
 
void efreet_menu_ref (Efreet_Menu *menu)
 Incriments refcount for the menu. More...
 
void efreet_menu_unref (Efreet_Menu *menu)
 Decrements refcount for the menu, and on 0 frees. More...
 
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. More...
 
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. More...
 
void efreet_menu_dump (Efreet_Menu *menu, const char *indent)
 Dumps the contents of the menu to the command line. More...
 

Detailed Description

functions and structures

Typedef Documentation

◆ Efreet_Menu_Cb

typedef void(* Efreet_Menu_Cb) (void *data, Efreet_Menu *menu)

A callback used with efreet_menu_async_get() and efreet_menu_async_parse()

Since
1.8

Function Documentation

◆ efreet_menu_kde_legacy_init()

int efreet_menu_kde_legacy_init ( void  )

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

Returns
Returns no value

◆ efreet_menu_new()

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 EINA_SAFETY_ON_NULL_RETURN_VAL.

◆ efreet_menu_file_set()

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 eina_stringshare_add().

◆ efreet_menu_async_get()

EFREET_DEPRECATED_API void efreet_menu_async_get ( Efreet_Menu_Cb  func,
const void *  data 
)

Creates the Efreet_Menu representation of the default menu or NULL if none found and returns it in the callback.

Parameters
funcfunction to call when menu is created
datauser data to return in callback
Deprecated:

References ERR.

◆ efreet_menu_get()

Efreet_Menu * efreet_menu_get ( void  )

Creates the default menu representation.

Returns
Returns the Efreet_Menu representation of the default menu or NULL if none found

◆ efreet_menu_async_parse()

EFREET_DEPRECATED_API void efreet_menu_async_parse ( const char *  path,
Efreet_Menu_Cb  func,
const void *  data 
)

Parses the given .menu file and creates the menu representation, and returns it in the callback.

Parameters
pathThe path of the menu to load
funcfunction to call when menu is created
datauser data to return in callback
Deprecated:

References ERR.

◆ 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 representation on success or NULL on failure

References eina_hash_string_superfast_new(), EINA_SAFETY_ON_NULL_RETURN_VAL, Efreet_Xml::tag, and WRN.

◆ efreet_menu_save()

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

References EINA_SAFETY_ON_NULL_RETURN_VAL.

◆ efreet_menu_free()

void efreet_menu_free ( Efreet_Menu menu)

Frees the given structure (if refcount at 1 at the time of this call)

Parameters
menuThe Efreet_Menu to free
Returns
Returns no value

References desktop, efreet_desktop_free(), efreet_menu_free(), EINA_LIST_FREE, entries, icon, id, name, and references.

Referenced by efreet_menu_desktop_remove(), efreet_menu_free(), and efreet_menu_unref().

◆ efreet_menu_ref()

void efreet_menu_ref ( Efreet_Menu menu)

Incriments refcount for the menu.

Parameters
menuThe Efreet_Menu to reference
Returns
Returns no value
Since
1.11

References efreet_menu_ref(), EINA_LIST_FOREACH, entries, and references.

Referenced by efreet_menu_ref().

◆ efreet_menu_unref()

void efreet_menu_unref ( Efreet_Menu menu)

Decrements refcount for the menu, and on 0 frees.

Parameters
menuThe Efreet_Menu to unreference
Returns
Returns no value
Since
1.11

References efreet_menu_free().

◆ efreet_menu_desktop_insert()

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 efreet_util_path_to_file_id(), EINA_SAFETY_ON_NULL_RETURN_VAL, and _Efreet_Desktop::orig_path.

◆ efreet_menu_desktop_remove()

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(), EINA_COMPARE_CB, eina_list_remove(), eina_list_search_unsorted(), EINA_SAFETY_ON_NULL_RETURN_VAL, and entries.

◆ efreet_menu_dump()

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 alloca(), EINA_LIST_FOREACH, EINA_SAFETY_ON_NULL_RETURN, entries, icon, INF, and name.