Download

Support

Efreet_Desktop: The FDO Desktop Entry

Data Structures

struct  _Efreet_Desktop
 a parsed representation of a .desktop file More...

Typedefs

typedef struct _Efreet_Desktop Efreet_Desktop
typedef void *(* Efreet_Desktop_Command_Cb )(void *data, Efreet_Desktop *desktop, char *command, int remaining)
typedef int(* Efreet_Desktop_Progress_Cb )(void *data, Efreet_Desktop *desktop, char *uri, long int total, long int current)
typedef void *(* Efreet_Desktop_Type_Free_Cb )(void *data)
typedef void *(* Efreet_Desktop_Type_Parse_Cb )(Efreet_Desktop *desktop, Efreet_Ini *ini)
typedef void(* Efreet_Desktop_Type_Save_Cb )(Efreet_Desktop *desktop, Efreet_Ini *ini)

Functions

EAPI void efreet_desktop_cache_flush (void)
 Tell Efreet to flush any cached desktop entries so it reloads on get.
EAPI void efreet_desktop_category_add (Efreet_Desktop *desktop, const char *category)
 add a category to a desktop
EAPI unsigned int efreet_desktop_category_count_get (Efreet_Desktop *desktop)
 Retrieves the number of categories the given desktop belongs too.
EAPI int efreet_desktop_category_del (Efreet_Desktop *desktop, const char *category)
 removes a category from a desktop
EAPI void * efreet_desktop_command_get (Efreet_Desktop *desktop, Eina_List *files, Efreet_Desktop_Command_Cb func, void *data)
 Get a command to use to execute a desktop entry.
EAPI Eina_List * efreet_desktop_command_local_get (Efreet_Desktop *desktop, Eina_List *files)
 Get the command to use to execute a desktop entry.
EAPI void * efreet_desktop_command_progress_get (Efreet_Desktop *desktop, Eina_List *files, Efreet_Desktop_Command_Cb cb_command, Efreet_Desktop_Progress_Cb cb_prog, void *data)
 Get a command to use to execute a desktop entry, and receive progress updates for downloading of remote URI's passed in.
EAPI Efreet_Desktopefreet_desktop_empty_new (const char *file)
 Creates a new empty Efreet_Desktop structure or NULL on failure.
EAPI const char * efreet_desktop_environment_get (void)
 sets the global desktop environment name
EAPI void efreet_desktop_environment_set (const char *environment)
 sets the global desktop environment name
EAPI void efreet_desktop_exec (Efreet_Desktop *desktop, Eina_List *files, void *data)
 Parses the desktop exec line and returns an Ecore_Exe.
EAPI void efreet_desktop_free (Efreet_Desktop *desktop)
EAPI Efreet_Desktopefreet_desktop_get (const char *file)
 Gets a reference to an Efreet_Desktop structure representing the contents of file or NULL if file is not a valid .desktop file.
EAPI Efreet_Desktopefreet_desktop_new (const char *file)
EAPI int efreet_desktop_ref (Efreet_Desktop *desktop)
EAPI int efreet_desktop_save (Efreet_Desktop *desktop)
 Saves any changes made to desktop back to the file on the filesystem.
EAPI int efreet_desktop_save_as (Efreet_Desktop *desktop, const char *file)
 Saves desktop to file.
EAPI char * efreet_desktop_string_list_join (Eina_List *list)
 Create a ';' separate list of strings according to the desktop spec.
EAPI Eina_List * efreet_desktop_string_list_parse (const char *string)
 Parse ';' separate list of strings according to the desktop spec.
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)
 Adds the given type to the list of types in the system.
EAPI int efreet_desktop_type_alias (int from_type, const char *alias)
 Add an alias for an existing desktop type.
EAPI void * efreet_desktop_type_data_get (Efreet_Desktop *desktop)
 get type specific data for custom desktop types
EAPI Eina_Bool efreet_desktop_x_field_del (Efreet_Desktop *desktop, const char *key)
EAPI const char * efreet_desktop_x_field_get (Efreet_Desktop *desktop, const char *key)
EAPI Eina_Bool efreet_desktop_x_field_set (Efreet_Desktop *desktop, const char *key, const char *data)

Variables

EAPI int EFREET_DESKTOP_TYPE_APPLICATION
EAPI int EFREET_DESKTOP_TYPE_DIRECTORY
EAPI int EFREET_DESKTOP_TYPE_LINK

Detailed Description

Specification functions and structures


Typedef Documentation

Efreet_Desktop

typedef void*(* Efreet_Desktop_Command_Cb)(void *data, Efreet_Desktop *desktop, char *command, int remaining)

A callback used with efreet_desktop_command_get()

typedef int(* Efreet_Desktop_Progress_Cb)(void *data, Efreet_Desktop *desktop, char *uri, long int total, long int current)

A callback used to get download progress of remote uris

typedef void*(* Efreet_Desktop_Type_Free_Cb)(void *data)

A callback used to free data for custom types

typedef void*(* Efreet_Desktop_Type_Parse_Cb)(Efreet_Desktop *desktop, Efreet_Ini *ini)

A callback used to parse data for custom types

typedef void(* Efreet_Desktop_Type_Save_Cb)(Efreet_Desktop *desktop, Efreet_Ini *ini)

A callback used to save data for custom types


Function Documentation

EAPI void efreet_desktop_cache_flush ( void   ) 

Tell Efreet to flush any cached desktop entries so it reloads on get.

This flags the cache to be invalid, so next time a desktop file is fetched it will force it to be re-read off disk next time efreet_desktop_get() is called.

EAPI void efreet_desktop_category_add ( Efreet_Desktop desktop,
const char *  category 
)

add a category to a desktop

Parameters:
desktop,: the desktop
category,: the category name

References _Efreet_Desktop::categories.

EAPI unsigned int efreet_desktop_category_count_get ( Efreet_Desktop desktop  ) 

Retrieves the number of categories the given desktop belongs too.

Parameters:
desktop,: The desktop to work with
Returns:
Returns the number of categories assigned to this desktop

References _Efreet_Desktop::categories.

EAPI int efreet_desktop_category_del ( Efreet_Desktop desktop,
const char *  category 
)

removes a category from a desktop

Parameters:
desktop,: the desktop
category,: the category name
Returns:
1 if the desktop had his category listed, 0 otherwise

References _Efreet_Desktop::categories.

EAPI void* efreet_desktop_command_get ( Efreet_Desktop desktop,
Eina_List *  files,
Efreet_Desktop_Command_Cb  func,
void *  data 
)

Get a command to use to execute a desktop entry.

Parameters:
desktop,: the desktop entry
files,: an eina list of file names to execute, as either absolute paths, relative paths, or uris
func,: a callback to call for each prepared command line
data,: user data passed to the callback
Returns:
Returns the return value of func on success or NULL on failure

References efreet_desktop_command_progress_get().

Referenced by efreet_desktop_exec().

EAPI Eina_List* efreet_desktop_command_local_get ( Efreet_Desktop desktop,
Eina_List *  files 
)

Get the command to use to execute a desktop entry.

Parameters:
desktop,: the desktop entry
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)
Returns:
Returns an eina list of exec strings The returned list and each of its elements must be freed.

References Efreet_Desktop_Command::desktop, _Efreet_Desktop::exec, Efreet_Desktop_Command::files, Efreet_Desktop_Command::flags, NEW, and Efreet_Desktop_Command_File::pending.

EAPI void* efreet_desktop_command_progress_get ( Efreet_Desktop desktop,
Eina_List *  files,
Efreet_Desktop_Command_Cb  cb_command,
Efreet_Desktop_Progress_Cb  cb_progress,
void *  data 
)

Get a command to use to execute a desktop entry, and receive progress updates for downloading of remote URI's passed in.

Parameters:
desktop,: the desktop entry
files,: an eina list of file names to execute, as either absolute paths, relative paths, or uris
cb_command,: a callback to call for each prepared command line
cb_progress,: a callback to get progress for the downloads
data,: user data passed to the callback
Returns:
Returns 1 on success or 0 on failure

References Efreet_Desktop_Command::cb_command, Efreet_Desktop_Command::cb_progress, Efreet_Desktop_Command::data, Efreet_Desktop_Command::desktop, _Efreet_Desktop::exec, Efreet_Desktop_Command::files, Efreet_Desktop_Command::flags, NEW, Efreet_Desktop_Command::num_pending, and Efreet_Desktop_Command_File::pending.

Referenced by efreet_desktop_command_get().

EAPI Efreet_Desktop* efreet_desktop_empty_new ( const char *  file  ) 

Creates a new empty Efreet_Desktop structure or NULL on failure.

Parameters:
file,: The file to create the Efreet_Desktop from
Returns:
Returns a new empty_Efreet_Desktop on success, NULL on failure

References _Efreet_Desktop::load_time, NEW, _Efreet_Desktop::orig_path, and _Efreet_Desktop::ref.

EAPI const char* efreet_desktop_environment_get ( void   ) 

sets the global desktop environment name

Returns:
environment: the environment name
EAPI void efreet_desktop_environment_set ( const char *  environment  ) 

sets the global desktop environment name

Parameters:
environment,: the environment name
EAPI void efreet_desktop_exec ( Efreet_Desktop desktop,
Eina_List *  files,
void *  data 
)

Parses the desktop exec line and returns an Ecore_Exe.

Parameters:
desktop,: The desktop file to work with
files,: The files to be substituted into the exec line
data,: The data pointer to pass
Returns:
Returns the Ecore_Exce for desktop

References efreet_desktop_command_get().

EAPI Efreet_Desktop* efreet_desktop_get ( const char *  file  ) 

Gets a reference to an Efreet_Desktop structure representing the contents of file or NULL if file is not a valid .desktop file.

Parameters:
file,: The file to get the Efreet_Desktop from
Returns:
Returns a reference to a cached Efreet_Desktop on success, NULL on failure. This reference should not be freed.

References _Efreet_Desktop::cache_flush, _Efreet_Desktop::cached, efreet_desktop_new(), and _Efreet_Desktop::ref.

Referenced by efreet_util_desktop_file_id_find().

EAPI Efreet_Desktop* efreet_desktop_new ( const char *  file  ) 
EAPI int efreet_desktop_ref ( Efreet_Desktop desktop  ) 
EAPI int efreet_desktop_save_as ( Efreet_Desktop desktop,
const char *  file 
)

Saves desktop to file.

Parameters:
desktop,: The desktop file to save
file,: The filename to save as
Returns:
Returns 1 on success or 0 on failure

References _Efreet_Desktop::cached, efreet_desktop_save(), FREE, and _Efreet_Desktop::orig_path.

EAPI char* efreet_desktop_string_list_join ( Eina_List *  list  ) 

Create a ';' separate list of strings according to the desktop spec.

Parameters:
list,: Eina_List with strings
Returns:
a raw string list

Referenced by efreet_desktop_save().

EAPI Eina_List* efreet_desktop_string_list_parse ( const char *  string  ) 

Parse ';' separate list of strings according to the desktop spec.

Parameters:
string,: the raw string list
Returns:
an Eina_List of ecore string's

References WRN.

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 
)

Adds the given type to the list of types in the system.

Parameters:
type,: The type to add to the list of matching types
parse_func,: a function to parse out custom fields
save_func,: a function to save data returned from parse_func
free_func,: a function to free data returned from parse_func
Returns:
Returns the id of the new type

References Efreet_Desktop_Type_Info::free_func, Efreet_Desktop_Type_Info::id, NEW, Efreet_Desktop_Type_Info::parse_func, Efreet_Desktop_Type_Info::save_func, and Efreet_Desktop_Type_Info::type.

Referenced by efreet_desktop_init(), and efreet_desktop_type_alias().

EAPI int efreet_desktop_type_alias ( int  from_type,
const char *  alias 
)

Add an alias for an existing desktop type.

Parameters:
from_type the type to alias (e.g. EFREE_DESKTOP_TYPE_APPLICATION)
alias the alias
Returns:
the new type id, or -1 if from_type was not valid

This allows applications to add non-standard types that behave exactly as standard types.

References efreet_desktop_type_add(), Efreet_Desktop_Type_Info::free_func, Efreet_Desktop_Type_Info::parse_func, and Efreet_Desktop_Type_Info::save_func.

EAPI void* efreet_desktop_type_data_get ( Efreet_Desktop desktop  ) 

get type specific data for custom desktop types

Parameters:
desktop the desktop
Returns:
type specific data, or NULL if there is none

References _Efreet_Desktop::type_data.

EAPI Eina_Bool efreet_desktop_x_field_del ( Efreet_Desktop desktop,
const char *  key 
)

References _Efreet_Desktop::x.

EAPI const char* efreet_desktop_x_field_get ( Efreet_Desktop desktop,
const char *  key 
)

References _Efreet_Desktop::x.

EAPI Eina_Bool efreet_desktop_x_field_set ( Efreet_Desktop desktop,
const char *  key,
const char *  data 
)

References _Efreet_Desktop::x.


Variable Documentation


Copyright © Enlightenment.org

Efreet Documentation Generated: Tue Dec 22 16:13:53 2009