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 _History Evry_History;
16 typedef struct _Config Evry_Config;
17 typedef struct _Evry_Selector Evry_Selector;
18 typedef struct _Tab_View Tab_View;
19 typedef struct _Evry_Window Evry_Window;
20 typedef struct _Gadget_Config Gadget_Config;
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;
51 void (*hide) (Evry_Window *win, int finished);
54 /* only to be used by creator of win */
65 /* stack of states (for browseable plugins) */
68 /* provides collection of items from other plugins */
69 Evry_Plugin *aggregator;
71 /* action selector plugin */
74 /* all plugins that belong to this selector*/
77 /* list view instance */
84 Ecore_Timer *update_timer;
85 Ecore_Timer *action_timer;
87 const char *edje_part;
92 Evry_Selector *selector;
94 char *inp; /* alloced input */
96 char *input; /* pointer to input + trigger */
97 /* all available plugins for current state */
100 /* currently active plugins, i.e. those that provide items */
101 Eina_List *cur_plugins;
106 /* aggregator instance */
107 Evry_Plugin *aggregator;
113 Eina_List *sel_items;
115 Eina_Bool plugin_auto_selected;
116 Eina_Bool item_auto_selected;
118 /* current view instance */
122 Eina_Bool trigger_active;
124 unsigned int request;
126 Ecore_Timer *clear_timer;
133 const Evry_State *state;
141 void (*update) (Tab_View *tv);
142 void (*clear) (Tab_View *tv);
143 int (*key_down) (Tab_View *tv, const Ecore_Event_Key *ev);
147 Ecore_Animator *animator;
158 int edge_width, edge_height;
162 /* generic plugin config */
163 Eina_List *conf_subjects;
164 Eina_List *conf_actions;
165 Eina_List *conf_objects;
166 Eina_List *conf_views;
167 Eina_List *collections;
175 /* quick navigation mode */
178 /* default view mode */
182 int history_sort_mode;
184 /* use up/down keys for prev/next in thumb view */
189 unsigned char first_run;
197 struct _Gadget_Config
201 int hide_after_action;
212 /*** Evry_Api functions ***/
213 void evry_item_select(const Evry_State *s, Evry_Item *it);
214 void evry_item_mark(const Evry_State *state, Evry_Item *it, Eina_Bool mark);
215 void evry_plugin_select(Evry_Plugin *p);
216 Evry_Item *evry_item_new(Evry_Item *base, Evry_Plugin *p, const char *label,
217 Evas_Object *(*icon_get) (Evry_Item *it, Evas *e),
218 void (*cb_free) (Evry_Item *item));
219 void evry_item_free(Evry_Item *it);
220 void evry_item_ref(Evry_Item *it);
222 void evry_plugin_update(Evry_Plugin *plugin, int state);
223 void evry_clear_input(Evry_Plugin *p);
226 /* Evas_Object *evry_icon_mime_get(const char *mime, Evas *e); */
227 Evas_Object *evry_icon_theme_get(const char *icon, Evas *e);
228 int evry_fuzzy_match(const char *str, const char *match);
229 Eina_List *evry_fuzzy_match_sort(Eina_List *items);
230 int evry_util_exec_app(const Evry_Item *it_app, const Evry_Item *it_file);
231 char *evry_util_url_escape(const char *string, int inlength);
232 char *evry_util_url_unescape(const char *string, int length);
233 void evry_util_file_detail_set(Evry_Item_File *file);
234 int evry_util_module_config_check(const char *module_name, int conf, int epoch, int version);
235 Evas_Object *evry_util_icon_get(Evry_Item *it, Evas *e);
236 int evry_util_plugin_items_add(Evry_Plugin *p, Eina_List *items, const char *input, int match_detail, int set_usage);
237 void evry_item_changed(Evry_Item *it, int change_icon, int change_selected);
238 char *evry_util_md5_sum(const char *str);
239 void evry_util_items_sort(Eina_List **items, int flags);
241 const char *evry_file_path_get(Evry_Item_File *file);
242 const char *evry_file_url_get(Evry_Item_File *file);
244 int evry_plugin_register(Evry_Plugin *p, int type, int priority);
245 void evry_plugin_unregister(Evry_Plugin *p);
246 Evry_Plugin *evry_plugin_find(const char *name);
247 void evry_action_register(Evry_Action *act, int priority);
248 void evry_action_unregister(Evry_Action *act);
249 void evry_view_register(Evry_View *view, int priority);
250 void evry_view_unregister(Evry_View *view);
251 Evry_Action *evry_action_find(const char *name);
253 void evry_history_load(void);
254 void evry_history_unload(void);
255 History_Item *evry_history_item_add(Evry_Item *it, const char *ctxt, const char *input);
256 int evry_history_item_usage_set(Evry_Item *it, const char *input, const char *ctxt);
257 History_Types *evry_history_types_get(Evry_Type type);
259 Evry_Plugin *evry_plugin_new(Evry_Plugin *base, const char *name, const char *label, const char *icon,
261 Evry_Plugin *(*begin) (Evry_Plugin *p, const Evry_Item *item),
262 void (*cleanup) (Evry_Plugin *p),
263 int (*fetch) (Evry_Plugin *p, const char *input));
265 void evry_plugin_free(Evry_Plugin *p);
267 Evry_Action *evry_action_new(const char *name, const char *label,
268 Evry_Type type1, Evry_Type type2,
270 int (*action) (Evry_Action *act),
271 int (*check_item) (Evry_Action *act, const Evry_Item *it));
273 void evry_action_free(Evry_Action *act);
275 int evry_api_version_check(int version);
277 Evry_Type evry_type_register(const char *type);
278 const char *evry_type_get(Evry_Type type);
281 Tab_View *evry_tab_view_new(Evry_View *view, const Evry_State *s, Evas *e);
282 void evry_tab_view_free(Tab_View *v);
284 Eina_Bool evry_view_init(void);
285 void evry_view_shutdown(void);
287 Eina_Bool evry_view_help_init(void);
288 void evry_view_help_shutdown(void);
290 Eina_Bool evry_plug_clipboard_init(void);
291 void evry_plug_clipboard_shutdown(void);
293 Eina_Bool evry_plug_text_init(void);
294 void evry_plug_text_shutdown(void);
296 Eina_Bool evry_plug_collection_init(void);
297 void evry_plug_collection_shutdown(void);
300 int evry_shutdown(void);
301 Evry_Window *evry_show(E_Zone *zone, E_Zone_Edge edge, const char *params, Eina_Bool popup);
302 void evry_hide(Evry_Window *win, int clear);
304 int evry_plug_actions_init(void);
305 void evry_plug_actions_shutdown(void);
307 Evry_Plugin *evry_aggregator_new(int type);
309 void evry_history_init(void);
310 void evry_history_free(void);
312 int evry_browse_item(Evry_Item *it);
313 int evry_browse_back(Evry_Selector *sel);
315 void evry_plugin_action(Evry_Window *win, int finished);
317 int evry_state_push(Evry_Selector *sel, Eina_List *plugins);
318 int evry_selectors_switch(Evry_Window *win,int dir, int slide);
319 int evry_view_toggle(Evry_State *s, const char *trigger);
321 int evry_gadget_init(void);
322 void evry_gadget_shutdown(void);
324 Eina_Bool evry_plug_apps_init(E_Module *m);
325 void evry_plug_apps_shutdown(void);
326 void evry_plug_apps_save(void);
328 Eina_Bool evry_plug_files_init(E_Module *m);
329 void evry_plug_files_shutdown(void);
330 void evry_plug_files_save(void);
332 Eina_Bool evry_plug_windows_init(E_Module *m);
333 void evry_plug_windows_shutdown(void);
334 void evry_plug_windows_save(void);
336 Eina_Bool evry_plug_settings_init(E_Module *m);
337 void evry_plug_settings_shutdown(void);
338 void evry_plug_settings_save(void);
340 Eina_Bool evry_plug_calc_init(E_Module *m);
341 void evry_plug_calc_shutdown(void);
342 void evry_plug_calc_save(void);
344 Ecore_Event_Handler *evry_event_handler_add(int type, Eina_Bool (*func) (void *data, int type, void *event), const void *data);
346 extern Evry_API *evry;
347 extern Evry_History *evry_hist;
348 extern Evry_Config *evry_conf;
349 extern int _evry_events[NUM_EVRY_EVENTS];
350 extern E_Module *_mod_evry;
353 EAPI void *e_modapi_init (E_Module *m);
354 EAPI int e_modapi_shutdown (E_Module *m);
355 EAPI int e_modapi_save (E_Module *m);
356 EAPI E_Config_Dialog *evry_config_dialog(E_Container *con, const char *params);
357 EAPI E_Config_Dialog *evry_collection_conf_dialog(E_Container *con, const char *params);
358 EAPI extern E_Module_Api e_modapi;
360 /* #define CHECK_REFS 1
361 * #define PRINT_REFS 1
362 * #define CHECK_TIME 1
364 * #define DBG(...) ERR(__VA_ARGS__) */
367 extern Eina_List *_refd;
371 extern double _evry_time;