/** * keystroke accelerator for project window */ static EWL_CALLBACK_DEFN(project_key_down) { Ecore_List *selected; Ewl_Event_Key_Down *ev = ev_data; Ewl_Widget *text, *row; char *name; if( !strcmp(ev->keyname, "Delete") ) { selected = ewl_tree_selected_get(EWL_TREE(file_tree)); if( ecore_list_count(selected) > 0 ) { ecore_list_first_goto(selected); while( (row = ecore_list_next(selected)) ) { text = ewl_tree_row_column_get(EWL_ROW(row), 0); name = ewl_text_text_get(EWL_TEXT(text)); ecore_hash_remove(active_project->files, name); FREE(name); active_project->dirty = true; } project_update(); } } }
void project_file_delete( char *name ) { ecore_hash_remove(active_project->files, name); active_project->dirty = true; project_update(); }
/** * Free memory allocated by a call to exml_mem_write * @param xml The xml document * @param ptr The xml buffer content * @return nothing */ void exml_mem_free(EXML *xml, void *ptr) { CHECK_PARAM_POINTER("xml", xml); if (ecore_hash_get(xml->buffers, ptr)) { ecore_hash_remove(xml->buffers, ptr); } }
/** * Notes that the given string has lost an instance. * * It will free the string if no other instances are left. * * @param string The given string. * @ingroup Ecore_String_Group */ EAPI void ecore_string_release(const char *string) { Ecore_String *str; CHECK_PARAM_POINTER("string", string); str = ecore_hash_get(ecore_strings, (char *)string); if (!str) return; str->references--; if (str->references < 1) { ecore_hash_remove(ecore_strings, (char *)string); FREE(str); } }
/** * @internal * @param tx: The context to work with * @return Returns the number of references left on this context * @brief Releases a reference on the given context. * Do not use the context after this as it will be deallocated if it's * reference count drops to zero. */ int ewl_text_context_release(Ewl_Text_Context *tx) { DENTER_FUNCTION(DLEVEL_STABLE); DCHECK_PARAM_PTR_RET(tx, 0); tx->ref_count --; if (tx->ref_count > 0) DRETURN_INT(tx->ref_count, DLEVEL_STABLE); ecore_hash_remove(context_hash, tx); IF_RELEASE(tx->font); IF_RELEASE(tx->font_source); IF_RELEASE(tx->format); FREE(tx); DRETURN_INT(0, DLEVEL_STABLE); }
/*Location related functions*/ static void _etk_layout_location_delete_confirm_cb(Etk_Object * object, void *data) { entropy_gui_component_instance* instance = data; entropy_layout_gui* gui = instance->data; Etk_Tree_Row* row = gui->delete_row; Entropy_Config_Structure* structure; Ecore_List* row_refs = NULL; _layout_etk_row_structure_plugin* ref; if (row) { structure = ecore_hash_get(_etk_layout_row_reference, row); row_refs = ecore_hash_get(_etk_layout_structure_plugin_reference, structure); if (row_refs) { while ( (ref = ecore_list_first_remove(row_refs))) { etk_tree_row_delete(ref->row); IF_FREE(ref); } ecore_list_destroy(row_refs); ecore_hash_remove(_etk_layout_structure_plugin_reference, structure); } entropy_config_standard_structure_remove(structure); } }
static EWL_CALLBACK_DEFN(project_file_settings_cb) { int *response = ev_data; char *name = user_data; char *new_name, *new_path; if( *response == EWL_RESPONSE_SAVE ) { Ewler_Form *form; new_name = ewl_text_text_get(EWL_TEXT(file_settings.name_entry)); new_path = ewl_text_text_get(EWL_TEXT(file_settings.path_entry)); if( (form = form_get(name)) ) form_name_set(form, new_name); ecore_hash_remove(active_project->files, name); ecore_hash_set(active_project->files, new_name, new_path); project_update(); } ewl_widget_destroy(settings_win); settings_win = NULL; }
void gui_event_callback (entropy_notify_event * eevent, void *requestor, void *el, entropy_gui_component_instance * comp) { entropy_layout_gui* view = (entropy_layout_gui*)comp->data; switch (eevent->event_type) { case ENTROPY_NOTIFY_FILE_PROGRESS:{ entropy_file_progress_window* window; entropy_file_progress *progress = el; if (! (window = ecore_hash_get(view->progress_hash, (long*)progress->identifier))) { window = entropy_etk_progress_window_create(); entropy_etk_progress_dialog_show(window); entropy_etk_progress_dialog_set_file_from_to(window, progress->file_from, progress->file_to); entropy_etk_progress_dialog_set_progress_pct(window, &progress->progress); ecore_hash_set(view->progress_hash, (long*)progress->identifier, window); } else { entropy_etk_progress_dialog_set_file_from_to(window, progress->file_from, progress->file_to); entropy_etk_progress_dialog_set_progress_pct(window, &progress->progress); } if (progress->type == TYPE_END) { window = ecore_hash_get(view->progress_hash, (long*)progress->identifier); if (window) { ecore_hash_remove(view->progress_hash, (long*)progress->identifier); entropy_etk_progress_dialog_destroy(window); } } } break; case ENTROPY_NOTIFY_USER_INTERACTION_YES_NO_ABORT: { /*FIXME: We need to handle different types here*/ entropy_etk_user_interaction_dialog_new((entropy_file_operation*)el); } break; case ENTROPY_NOTIFY_EXTENDED_STAT: { printf("**** Extended stat at layout\n"); ecore_hash_set(view->properties_request_hash, (entropy_generic_file*)el, (int*)1); }; break; case ENTROPY_NOTIFY_FILE_STAT_AVAILABLE:{ entropy_file_stat *file_stat = (entropy_file_stat *) eevent->return_struct; if (ecore_hash_get(view->properties_request_hash, file_stat->file)) { ecore_hash_remove(view->properties_request_hash, file_stat->file); /*Lauch a properties window*/ etk_properties_dialog_new(file_stat->file); } } break; case ENTROPY_NOTIFY_PASTE_REQUEST: { printf("Paste request..\n"); Entropy_Selection_Type stype = entropy_core_selection_type_get(); entropy_generic_file* cfolder = ((entropy_gui_component_instance_layout*)comp)->current_folder; Ecore_List* files = entropy_core_selected_files_get(); if (cfolder) { char* f_uri = cfolder->uri; if (f_uri) { if (stype == ENTROPY_SELECTION_COPY) { printf("Copy type..: %d:%s\n", ecore_list_count(files), f_uri); entropy_plugin_filesystem_file_copy_multi(files, f_uri, comp); } else if (stype == ENTROPY_SELECTION_CUT) { printf("Cut type..:%d:%s\n", ecore_list_count(files), f_uri); entropy_plugin_filesystem_file_move_multi(files, f_uri, comp); } else { printf("Unsupported copy type at context menu paste\n"); } } } else { printf("Current folder is NULL at layout paste\n"); } } break; case ENTROPY_NOTIFY_AUTH_REQUEST: { printf("Requested auth for: %s\n",(char*)el); etk_auth_request_dialog_create(strdup((char*)el)); } break; case ENTROPY_NOTIFY_METADATA_ALL: { entropy_etk_efolder_dialog_show((Eina_List*)el); } break; } }