static void handle_file_context_action(madshelf_state_t* state, const char* filename, int item_num, bool is_alt) { if(ecore_file_is_dir(filename)) item_num--; if(item_num == -1) /* "open directory" */ { go_to_directory(state, filename); close_file_context_menu(state->canvas, false); } if(item_num == 0) { if(has_tag(state->tags, "hidden", filename)) tag_remove(state->tags, "hidden", filename); else tag_add(state->tags, "hidden", filename); close_file_context_menu(state->canvas, true); } if(item_num == 1) { if(has_tag(state->tags, "favorites", filename)) tag_remove(state->tags, "favorites", filename); else tag_add(state->tags, "favorites", filename); close_file_context_menu(state->canvas, true); } }
/** * @short Initializes all builtins */ void tag_init_builtins(){ tag_add("load", tag_load); tag_add("for", tag_for); tag_add("endfor", tag_endfor); tag_add("if", tag_if); tag_add("else", tag_else); tag_add("endif", tag_endif); tag_add("include", tag_include); tag_add("extends", tag_extends); tag_add("block", tag_block); tag_add("endblock", tag_endblock); }
void tag_set(struct tag * tag, struct screen * screen) { if (tag->screen == screen) return; tag_remove(tag, tag->screen); tag_add(tag, screen); }
void run_default_handler(madshelf_state_t *state, const char *filename) { fileinfo_t *fileinfo = fileinfo_create(filename); openers_t *handlers_list = openers_get(fileinfo->mime_type); fileinfo_destroy(fileinfo); if (!handlers_list) return; tag_add(state->tags, "recent", filename); Efreet_Desktop* handler = eina_list_data_get(handlers_list->apps); Eina_List *l = eina_list_append(NULL, filename); efreet_desktop_exec(handler, l, NULL); eina_list_free(l); }