2007-02-03 05:05:30 -08:00
|
|
|
/* vim: set sw=4 ts=4 sts=4 et: */
|
|
|
|
#ifndef EFREET_PRIVATE_H
|
|
|
|
#define EFREET_PRIVATE_H
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @file efreet_private.h
|
|
|
|
* @brief Contains methods and defines that are private to the Efreet
|
|
|
|
* implementaion
|
|
|
|
* @addtogroup Efreet_Private Efreet_Private: Private methods and defines
|
|
|
|
*
|
|
|
|
* @{
|
|
|
|
*/
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @def NEW(x, c)
|
|
|
|
* Allocate and zero out c structures of type x
|
|
|
|
*/
|
|
|
|
#define NEW(x, c) calloc(c, sizeof(x))
|
|
|
|
|
|
|
|
/**
|
2007-09-06 09:15:10 -07:00
|
|
|
* @def FREE(x)
|
2007-02-03 05:05:30 -08:00
|
|
|
* Free x and set to NULL
|
|
|
|
*/
|
2007-06-22 02:45:09 -07:00
|
|
|
#define FREE(x) do { free(x); x = NULL; } while (0)
|
2007-02-03 05:05:30 -08:00
|
|
|
|
|
|
|
/**
|
2007-09-06 09:15:10 -07:00
|
|
|
* @def IF_FREE(x)
|
|
|
|
* If x is set, free x and set to NULL
|
2007-02-03 05:05:30 -08:00
|
|
|
*/
|
2007-06-22 02:45:09 -07:00
|
|
|
#define IF_FREE(x) do { if (x) FREE(x); } while (0)
|
2007-02-03 05:05:30 -08:00
|
|
|
|
|
|
|
/**
|
|
|
|
* @def IF_RELEASE(x)
|
2008-10-15 07:48:03 -07:00
|
|
|
* If x is set, eina_stringshare_del x and set to NULL
|
2007-02-03 05:05:30 -08:00
|
|
|
*/
|
2007-06-22 02:45:09 -07:00
|
|
|
#define IF_RELEASE(x) do { \
|
|
|
|
if (x) { \
|
2008-10-15 07:48:03 -07:00
|
|
|
const char *__tmp; __tmp = (x); (x) = NULL; eina_stringshare_del(__tmp); \
|
2007-06-22 02:45:09 -07:00
|
|
|
} \
|
|
|
|
(x) = NULL; \
|
|
|
|
} while (0)
|
2007-02-03 05:05:30 -08:00
|
|
|
|
|
|
|
/**
|
2007-09-06 09:15:10 -07:00
|
|
|
* @def IF_FREE_LIST(x)
|
2007-02-03 05:05:30 -08:00
|
|
|
* If x is a valid pointer destroy x and set to NULL
|
|
|
|
*/
|
2009-03-23 05:19:31 -07:00
|
|
|
#define IF_FREE_LIST(list, free_cb) do { \
|
|
|
|
while (list) \
|
|
|
|
{ \
|
|
|
|
free_cb(eina_list_data_get(list)); \
|
|
|
|
list = eina_list_remove_list(list, list); \
|
|
|
|
} \
|
2007-06-22 02:45:09 -07:00
|
|
|
} while (0)
|
2007-02-03 05:05:30 -08:00
|
|
|
|
|
|
|
/**
|
2007-09-06 09:15:10 -07:00
|
|
|
* @def IF_FREE_HASH(x)
|
2007-02-03 05:05:30 -08:00
|
|
|
* If x is a valid pointer destroy x and set to NULL
|
|
|
|
*/
|
2007-06-22 02:45:09 -07:00
|
|
|
#define IF_FREE_HASH(x) do { \
|
|
|
|
if (x) { \
|
2008-12-17 07:33:43 -08:00
|
|
|
Eina_Hash *__tmp; __tmp = (x); (x) = NULL; eina_hash_free(__tmp); \
|
2007-06-22 02:45:09 -07:00
|
|
|
} \
|
|
|
|
(x) = NULL; \
|
|
|
|
} while (0)
|
2007-02-03 05:05:30 -08:00
|
|
|
|
|
|
|
#ifndef PATH_MAX
|
|
|
|
/**
|
|
|
|
* @def PATH_MAX
|
|
|
|
* Convenience define to set the maximim path length
|
|
|
|
*/
|
|
|
|
#define PATH_MAX 4096
|
|
|
|
#endif
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @internal
|
|
|
|
* The different types of commands in an Exec entry
|
|
|
|
*/
|
2009-09-13 17:38:59 -07:00
|
|
|
typedef enum Efreet_Desktop_Command_Flag
|
2007-02-03 05:05:30 -08:00
|
|
|
{
|
|
|
|
EFREET_DESKTOP_EXEC_FLAG_FULLPATH = 0x0001,
|
|
|
|
EFREET_DESKTOP_EXEC_FLAG_URI = 0x0002,
|
|
|
|
EFREET_DESKTOP_EXEC_FLAG_DIR = 0x0004,
|
|
|
|
EFREET_DESKTOP_EXEC_FLAG_FILE = 0x0008
|
2009-09-13 17:38:59 -07:00
|
|
|
} Efreet_Desktop_Command_Flag;
|
2007-02-03 05:05:30 -08:00
|
|
|
|
|
|
|
/**
|
|
|
|
* @internal
|
|
|
|
* Efreet_Desktop_Command
|
|
|
|
*/
|
|
|
|
typedef struct Efreet_Desktop_Command Efreet_Desktop_Command;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @internal
|
|
|
|
* Holds information on a desktop Exec command entry
|
|
|
|
*/
|
|
|
|
struct Efreet_Desktop_Command
|
|
|
|
{
|
|
|
|
Efreet_Desktop *desktop;
|
|
|
|
int num_pending;
|
|
|
|
|
|
|
|
Efreet_Desktop_Command_Flag flags;
|
|
|
|
|
|
|
|
Efreet_Desktop_Command_Cb cb_command;
|
|
|
|
Efreet_Desktop_Progress_Cb cb_progress;
|
|
|
|
void *data;
|
|
|
|
|
* 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 *files; /**< list of Efreet_Desktop_Command_File */
|
2007-02-03 05:05:30 -08:00
|
|
|
};
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @internal
|
|
|
|
* Efreet_Desktop_Command_File
|
|
|
|
*/
|
|
|
|
typedef struct Efreet_Desktop_Command_File Efreet_Desktop_Command_File;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @internal
|
|
|
|
* Stores information on a file passed to the desktop Exec command
|
|
|
|
*/
|
|
|
|
struct Efreet_Desktop_Command_File
|
|
|
|
{
|
|
|
|
Efreet_Desktop_Command *command;
|
|
|
|
char *dir;
|
|
|
|
char *file;
|
|
|
|
char *fullpath;
|
|
|
|
char *uri;
|
|
|
|
|
|
|
|
int pending;
|
|
|
|
};
|
|
|
|
|
|
|
|
int efreet_base_init(void);
|
|
|
|
void efreet_base_shutdown(void);
|
|
|
|
|
|
|
|
int efreet_icon_init(void);
|
|
|
|
void efreet_icon_shutdown(void);
|
|
|
|
|
|
|
|
int efreet_menu_init(void);
|
|
|
|
void efreet_menu_shutdown(void);
|
* 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 *efreet_default_dirs_get(const char *user_dir,
|
|
|
|
Eina_List *system_dirs,
|
2007-02-06 17:12:25 -08:00
|
|
|
const char *suffix);
|
2007-02-03 05:05:30 -08:00
|
|
|
|
|
|
|
int efreet_ini_init(void);
|
|
|
|
int efreet_ini_shutdown(void);
|
|
|
|
|
|
|
|
int efreet_desktop_init(void);
|
|
|
|
int efreet_desktop_shutdown(void);
|
|
|
|
|
|
|
|
const char *efreet_home_dir_get(void);
|
|
|
|
|
2008-11-14 12:22:03 -08:00
|
|
|
EAPI const char *efreet_lang_get(void);
|
|
|
|
EAPI const char *efreet_lang_country_get(void);
|
|
|
|
EAPI const char *efreet_lang_modifier_get(void);
|
2007-02-03 05:05:30 -08:00
|
|
|
|
|
|
|
size_t efreet_array_cat(char *buffer, size_t size, const char *strs[]);
|
|
|
|
|
2007-07-17 08:07:59 -07:00
|
|
|
const char *efreet_desktop_environment_get(void);
|
|
|
|
|
2009-01-28 23:36:58 -08:00
|
|
|
#define NON_EXISTING (void *)-1
|
|
|
|
|
|
|
|
void efreet_cache_clear(void);
|
|
|
|
const char *efreet_icon_hash_get(const char *theme_name, const char *icon, int size);
|
|
|
|
void efreet_icon_hash_put(const char *theme_name, const char *icon, int size, const char *file);
|
|
|
|
|
2007-02-03 05:05:30 -08:00
|
|
|
/**
|
|
|
|
* @}
|
|
|
|
*/
|
|
|
|
|
|
|
|
#endif
|