7 #define MOD_CONFIG_FILE_EPOCH 0x0005
8 #define MOD_CONFIG_FILE_GENERATION 0x0002
9 #define MOD_CONFIG_FILE_VERSION \
10 ((MOD_CONFIG_FILE_EPOCH << 16) | MOD_CONFIG_FILE_GENERATION)
13 #define SLIDE_RIGHT -1
15 typedef struct _Evry_View Evry_View;
16 typedef struct _History Evry_History;
17 typedef struct _Config Evry_Config;
18 typedef struct _Evry_Selector Evry_Selector;
19 typedef struct _Tab_View Tab_View;
20 typedef struct _Evry_Window Evry_Window;
30 Eina_Bool request_selection;
31 Eina_Bool plugin_dedicated;
36 Evry_Selector *selector;
37 Evry_Selector **selectors;
38 Evry_Selector **sel_list;
42 unsigned int mouse_button;
47 Evry_State *state_clearing;
57 /* stack of states (for browseable plugins) */
60 /* provides collection of items from other plugins */
61 Evry_Plugin *aggregator;
63 /* action selector plugin */
66 /* all plugins that belong to this selector*/
69 /* list view instance */
76 Ecore_Timer *update_timer;
77 Ecore_Timer *action_timer;
79 const char *edje_part;
84 Evry_Selector *selector;
86 char *inp; /* alloced input */
88 char *input; /* pointer to input + trigger */
89 /* all available plugins for current state */
92 /* currently active plugins, i.e. those that provide items */
93 Eina_List *cur_plugins;
98 /* aggregator instance */
99 Evry_Plugin *aggregator;
105 Eina_List *sel_items;
107 Eina_Bool plugin_auto_selected;
108 Eina_Bool item_auto_selected;
110 /* current view instance */
114 Eina_Bool trigger_active;
116 unsigned int request;
118 Ecore_Timer *clear_timer;
132 Evry_View *(*create) (Evry_View *view, const Evry_State *s, const Evas_Object *swallow);
133 void (*destroy) (Evry_View *view);
134 int (*cb_key_down) (Evry_View *view, const Ecore_Event_Key *ev);
135 int (*update) (Evry_View *view);
136 void (*clear) (Evry_View *view);
145 const Evry_State *state;
153 void (*update) (Tab_View *tv);
154 void (*clear) (Tab_View *tv);
155 int (*key_down) (Tab_View *tv, const Ecore_Event_Key *ev);
159 Ecore_Animator *animator;
170 int edge_width, edge_height;
174 /* generic plugin config */
175 Eina_List *conf_subjects;
176 Eina_List *conf_actions;
177 Eina_List *conf_objects;
178 Eina_List *conf_views;
179 Eina_List *collections;
187 /* quick navigation mode */
190 /* default view mode */
194 int history_sort_mode;
196 /* use up/down keys for prev/next in thumb view */
199 unsigned char first_run;
215 /*** Evry_Api functions ***/
216 void evry_item_select(const Evry_State *s, Evry_Item *it);
217 void evry_item_mark(const Evry_State *state, Evry_Item *it, Eina_Bool mark);
218 void evry_plugin_select(Evry_Plugin *p);
219 Evry_Item *evry_item_new(Evry_Item *base, Evry_Plugin *p, const char *label,
220 Evas_Object *(*icon_get) (Evry_Item *it, Evas *e),
221 void (*cb_free) (Evry_Item *item));
222 void evry_item_free(Evry_Item *it);
223 void evry_item_ref(Evry_Item *it);
225 void evry_plugin_update(Evry_Plugin *plugin, int state);
226 void evry_clear_input(Evry_Plugin *p);
229 Evas_Object *evry_icon_mime_get(const char *mime, Evas *e);
230 Evas_Object *evry_icon_theme_get(const char *icon, Evas *e);
231 int evry_fuzzy_match(const char *str, const char *match);
232 Eina_List *evry_fuzzy_match_sort(Eina_List *items);
233 int evry_util_exec_app(const Evry_Item *it_app, const Evry_Item *it_file);
234 char *evry_util_url_escape(const char *string, int inlength);
235 char *evry_util_url_unescape(const char *string, int length);
236 void evry_util_file_detail_set(Evry_Item_File *file);
237 int evry_util_module_config_check(const char *module_name, int conf, int epoch, int version);
238 Evas_Object *evry_util_icon_get(Evry_Item *it, Evas *e);
239 int evry_util_plugin_items_add(Evry_Plugin *p, Eina_List *items, const char *input, int match_detail, int set_usage);
240 int evry_items_sort_func(const void *data1, const void *data2);
241 void evry_item_changed(Evry_Item *it, int change_icon, int change_selected);
242 char *evry_util_md5_sum(const char *str);
244 const char *evry_file_path_get(Evry_Item_File *file);
245 const char *evry_file_url_get(Evry_Item_File *file);
247 int evry_plugin_register(Evry_Plugin *p, int type, int priority);
248 void evry_plugin_unregister(Evry_Plugin *p);
249 Evry_Plugin *evry_plugin_find(const char *name);
250 void evry_action_register(Evry_Action *act, int priority);
251 void evry_action_unregister(Evry_Action *act);
252 void evry_view_register(Evry_View *view, int priority);
253 void evry_view_unregister(Evry_View *view);
254 Evry_Action *evry_action_find(const char *name);
256 void evry_history_load(void);
257 void evry_history_unload(void);
258 History_Item *evry_history_item_add(Evry_Item *it, const char *ctxt, const char *input);
259 int evry_history_item_usage_set(Evry_Item *it, const char *input, const char *ctxt);
260 History_Types *evry_history_types_get(Evry_Type type);
262 Evry_Plugin *evry_plugin_new(Evry_Plugin *base, const char *name, const char *label, const char *icon,
264 Evry_Plugin *(*begin) (Evry_Plugin *p, const Evry_Item *item),
265 void (*cleanup) (Evry_Plugin *p),
266 int (*fetch) (Evry_Plugin *p, const char *input),
267 void (*free) (Evry_Plugin *p));
269 void evry_plugin_free(Evry_Plugin *p);
271 Evry_Action *evry_action_new(const char *name, const char *label,
272 Evry_Type type1, Evry_Type type2,
274 int (*action) (Evry_Action *act),
275 int (*check_item) (Evry_Action *act, const Evry_Item *it));
277 void evry_action_free(Evry_Action *act);
279 int evry_api_version_check(int version);
281 Evry_Type evry_type_register(const char *type);
282 const char *evry_type_get(Evry_Type type);
285 Tab_View *evry_tab_view_new(Evry_View *view, const Evry_State *s, Evas *e);
286 void evry_tab_view_free(Tab_View *v);
288 Eina_Bool evry_view_init(void);
289 void evry_view_shutdown(void);
291 Eina_Bool evry_view_help_init(void);
292 void evry_view_help_shutdown(void);
294 Eina_Bool evry_plug_clipboard_init(void);
295 void evry_plug_clipboard_shutdown(void);
297 Eina_Bool evry_plug_text_init(void);
298 void evry_plug_text_shutdown(void);
300 Eina_Bool evry_plug_collection_init(void);
301 void evry_plug_collection_shutdown(void);
304 int evry_shutdown(void);
305 Evry_Window *evry_show(E_Zone *zone, E_Zone_Edge edge, const char *params);
306 void evry_hide(Evry_Window *win, int clear);
308 int evry_plug_actions_init();
309 void evry_plug_actions_shutdown();
311 Evry_Plugin *evry_aggregator_new(Evry_Window *win, int type);
313 void evry_history_init(void);
314 void evry_history_free(void);
316 int evry_browse_item(Evry_Item *it);
317 int evry_browse_back(Evry_Selector *sel);
319 void evry_plugin_action(Evry_Window *win, int finished);
321 int evry_state_push(Evry_Selector *sel, Eina_List *plugins);
322 int evry_selectors_switch(Evry_Window *win,int dir, int slide);
323 int evry_view_toggle(Evry_State *s, const char *trigger);
325 int evry_gadget_init(void);
326 void evry_gadget_shutdown(void);
328 Eina_Bool evry_plug_apps_init(E_Module *m);
329 void evry_plug_apps_shutdown(void);
330 void evry_plug_apps_save(void);
332 Eina_Bool evry_plug_files_init(E_Module *m);
333 void evry_plug_files_shutdown(void);
334 void evry_plug_files_save(void);
336 Eina_Bool evry_plug_windows_init(E_Module *m);
337 void evry_plug_windows_shutdown(void);
338 void evry_plug_windows_save(void);
340 Eina_Bool evry_plug_settings_init(E_Module *m);
341 void evry_plug_settings_shutdown(void);
342 void evry_plug_settings_save(void);
344 Eina_Bool evry_plug_calc_init(E_Module *m);
345 void evry_plug_calc_shutdown(void);
346 void evry_plug_calc_save(void);
348 Ecore_Event_Handler *evry_event_handler_add(int type, Eina_Bool (*func) (void *data, int type, void *event), const void *data);
350 extern Evry_History *evry_hist;
351 extern Evry_Config *evry_conf;
352 extern int _evry_events[NUM_EVRY_EVENTS];
354 #define EVRY_ITEM_NEW(_base, _plugin, _label, _icon_get, _free) \
355 (_base *) evry_item_new(EVRY_ITEM(E_NEW(_base, 1)), EVRY_PLUGIN(_plugin), \
356 _label, _icon_get, _free)
358 #define EVRY_ITEM_FREE(_item) evry_item_free((Evry_Item *)_item)
359 #define EVRY_ITEM_REF(_item) evry_item_ref((Evry_Item *)_item)
361 #define EVRY_PLUGIN_NEW(_base, _name, _icon, _item_type, _begin, _cleanup, _fetch, _free) \
362 evry_plugin_new(EVRY_PLUGIN(E_NEW(_base, 1)), _name, _(_name), _icon, _item_type, \
363 _begin, _cleanup, _fetch, _free)
365 #define EVRY_ACTION_NEW(_name, _in1, _in2, _icon, _action, _check) \
366 evry_action_new(_name, _(_name), _in1, _in2, _icon, _action, _check)
368 #define EVRY_PLUGIN_FREE(_p) \
369 if (_p) evry_plugin_free(EVRY_PLUGIN(_p))
371 #define EVRY_PLUGIN_UPDATE(_p, _action) \
372 if (_p) evry_plugin_update(EVRY_PLUGIN(_p), _action)
374 #define EVRY_PLUGIN_ITEMS_FREE(_p) { \
376 EINA_LIST_FREE(EVRY_PLUGIN(_p)->items, it) \
377 evry_item_free(it); }
379 #define EVRY_PLUGIN_ITEMS_ADD(_plugin, _items, _input, _match_detail, _set_usage) \
380 evry_util_plugin_items_add(EVRY_PLUGIN(_plugin), _items, _input, _match_detail, _set_usage)
383 EAPI void *e_modapi_init (E_Module *m);
384 EAPI int e_modapi_shutdown (E_Module *m);
385 EAPI int e_modapi_save (E_Module *m);
386 EAPI E_Config_Dialog *evry_config_dialog(E_Container *con, const char *params);
387 EAPI E_Config_Dialog *evry_collection_conf_dialog(E_Container *con, const char *params);
388 EAPI extern E_Module_Api e_modapi;
390 /*** Common Logging ***/
391 extern int _e_module_evry_log_dom;
393 #ifndef EINA_LOG_DEFAULT_COLOR
394 #define EINA_LOG_DEFAULT_COLOR EINA_COLOR_CYAN
402 #define DBG(...) EINA_LOG_DOM_DBG(_e_module_evry_log_dom, __VA_ARGS__)
403 #define INF(...) EINA_LOG_DOM_INFO(_e_module_evry_log_dom, __VA_ARGS__)
404 #define WRN(...) EINA_LOG_DOM_WARN(_e_module_evry_log_dom, __VA_ARGS__)
405 #define ERR(...) EINA_LOG_DOM_ERR(_e_module_evry_log_dom, __VA_ARGS__)
407 //#define CHECK_REFS 1
408 //#define CHECK_TIME 1
410 //#define DBG(...) ERR(__VA_ARGS__)
413 extern Eina_List *_refd;
417 extern double _evry_time;