Download

Support

/build/buildd/efreet-0.5.0.063/src/lib/efreet_private.h

Go to the documentation of this file.
00001 /* vim: set sw=4 ts=4 sts=4 et: */
00002 #ifndef EFREET_PRIVATE_H
00003 #define EFREET_PRIVATE_H
00004 
00018 #define NEW(x, c) calloc(c, sizeof(x))
00019 
00024 #define FREE(x) do { free(x); x = NULL; } while (0)
00025 
00030 #define IF_FREE(x) do { if (x) FREE(x); } while (0)
00031 
00036 #define IF_RELEASE(x) do { \
00037     if (x) { \
00038         const char *__tmp; __tmp = (x); (x) = NULL; eina_stringshare_del(__tmp); \
00039     } \
00040     (x) = NULL; \
00041 } while (0)
00042 
00047 #define IF_FREE_LIST(list, free_cb) do { \
00048     while (list) \
00049     { \
00050         free_cb(eina_list_data_get(list)); \
00051         list = eina_list_remove_list(list, list); \
00052     } \
00053 } while (0)
00054 
00059 #define IF_FREE_HASH(x) do { \
00060     if (x) { \
00061         Eina_Hash *__tmp; __tmp = (x); (x) = NULL; eina_hash_free(__tmp); \
00062     } \
00063     (x) = NULL; \
00064 } while (0)
00065 
00066 #ifndef PATH_MAX
00067 
00071 #define PATH_MAX 4096
00072 #endif
00073 
00079 extern int _efreet_log_dom_global;
00080 #ifdef EFREET_DEFAULT_LOG_COLOR
00081 #undef EFREET_DEFAULT_LOG_COLOR
00082 #endif
00083 #define EFREET_DEFAULT_LOG_COLOR "\033[36m"
00084 
00085 #define EFREET_MODULE_LOG_DOM _efreet_log_dom_global; /*default log domain for each module. It can redefined inside each module */
00086 #ifdef ERROR
00087 #undef ERROR
00088 #endif
00089 #define ERROR(...) EINA_LOG_DOM_ERR(EFREET_MODULE_LOG_DOM, __VA_ARGS__)
00090 #ifdef DEBUG
00091 #undef DEBUG
00092 #endif
00093 #define DEBUG(...) EINA_LOG_DOM_DBG(EFREET_MODULE_LOG_DOM, __VA_ARGS__)
00094 #ifdef INFO
00095 #undef INFO
00096 #endif
00097 #define INFO(...) EINA_LOG_DOM_INFO(EFREET_MODULE_LOG_DOM, __VA_ARGS__)
00098 #ifdef WARN
00099 #undef WARN
00100 #endif
00101 #define WARN(...) EINA_LOG_DOM_WARN(EFREET_MODULE_LOG_DOM, __VA_ARGS__)
00102 
00108 #define EFREET_MODULE_LOG_DOM _efreet_log_dom_global; /*default log domain for each module. It can redefined inside each module */
00109 #ifdef ERR
00110 #undef ERR
00111 #endif
00112 #define ERR(...) EINA_LOG_DOM_ERR(EFREET_MODULE_LOG_DOM, __VA_ARGS__)
00113 #ifdef DBG
00114 #undef DBG
00115 #endif
00116 #define DBG(...) EINA_LOG_DOM_DBG(EFREET_MODULE_LOG_DOM, __VA_ARGS__)
00117 #ifdef INF
00118 #undef INF
00119 #endif
00120 #define INF(...) EINA_LOG_DOM_INFO(EFREET_MODULE_LOG_DOM, __VA_ARGS__)
00121 #ifdef WRN
00122 #undef WRN
00123 #endif
00124 #define WRN(...) EINA_LOG_DOM_WARN(EFREET_MODULE_LOG_DOM, __VA_ARGS__)
00125 
00129 typedef enum Efreet_Desktop_Command_Flag
00130 {
00131     EFREET_DESKTOP_EXEC_FLAG_FULLPATH = 0x0001,
00132     EFREET_DESKTOP_EXEC_FLAG_URI      = 0x0002,
00133     EFREET_DESKTOP_EXEC_FLAG_DIR      = 0x0004,
00134     EFREET_DESKTOP_EXEC_FLAG_FILE     = 0x0008
00135 } Efreet_Desktop_Command_Flag;
00136 
00141 typedef struct Efreet_Desktop_Command Efreet_Desktop_Command;
00142 
00147 struct Efreet_Desktop_Command
00148 {
00149   Efreet_Desktop *desktop;
00150   int num_pending;
00151 
00152   Efreet_Desktop_Command_Flag flags;
00153 
00154   Efreet_Desktop_Command_Cb cb_command;
00155   Efreet_Desktop_Progress_Cb cb_progress;
00156   void *data;
00157 
00158   Eina_List *files; 
00159 };
00160 
00165 typedef struct Efreet_Desktop_Command_File Efreet_Desktop_Command_File;
00166 
00171 struct Efreet_Desktop_Command_File
00172 {
00173   Efreet_Desktop_Command *command;
00174   char *dir;
00175   char *file;
00176   char *fullpath;
00177   char *uri;
00178 
00179   int pending;
00180 };
00181 
00182 int efreet_base_init(void);
00183 void efreet_base_shutdown(void);
00184 
00185 int efreet_icon_init(void);
00186 void efreet_icon_shutdown(void);
00187 
00188 int efreet_menu_init(void);
00189 void efreet_menu_shutdown(void);
00190 Eina_List *efreet_default_dirs_get(const char *user_dir,
00191                                     Eina_List *system_dirs,
00192                                     const char *suffix);
00193 
00194 int efreet_ini_init(void);
00195 void efreet_ini_shutdown(void);
00196 
00197 int efreet_desktop_init(void);
00198 void efreet_desktop_shutdown(void);
00199 
00200 const char *efreet_home_dir_get(void);
00201 
00202 EAPI const char *efreet_lang_get(void);
00203 EAPI const char *efreet_lang_country_get(void);
00204 EAPI const char *efreet_lang_modifier_get(void);
00205 
00206 size_t efreet_array_cat(char *buffer, size_t size, const char *strs[]);
00207 
00208 const char *efreet_desktop_environment_get(void);
00209 
00210 #define NON_EXISTING (void *)-1
00211 
00212 void efreet_cache_clear(void);
00213 const char *efreet_icon_hash_get(const char *theme_name, const char *icon, int size);
00214 void efreet_icon_hash_put(const char *theme_name, const char *icon, int size, const char *file);
00215 
00220 #endif

Copyright © Enlightenment.org

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