void ecrin_ewl_tree_fill_package (void) { Ewl_Widget *row; Ewl_Widget *row_enum; Ewl_Widget *row_define; Ewl_Widget *row_function; char *key; char *label; label = "Eet"; row = ewl_tree_text_row_add (EWL_TREE (tree), NULL, &label); label = "Enum"; row_enum = ewl_tree_text_row_add (EWL_TREE (tree), EWL_ROW (row), &label); label = "Define"; row_define = ewl_tree_text_row_add (EWL_TREE (tree), EWL_ROW (row), &label); label = "Function"; row_function = ewl_tree_text_row_add (EWL_TREE (tree), EWL_ROW (row), &label); ecore_list_first_goto(sorted_keys); while ((key = ecore_list_next(sorted_keys))) { Ewl_Widget *prow; Ecrin_Hash_Data *data; data = ecrin_hash_data_get (key); switch (data->type) { case HASH_DATA_ENUM: prow = ewl_tree_text_row_add (EWL_TREE (tree), EWL_ROW (row_enum), &data->data_name); ewl_callback_append (prow, EWL_CALLBACK_CLICKED, _enum_display, data); break; case HASH_DATA_DEFINE: prow = ewl_tree_text_row_add (EWL_TREE (tree), EWL_ROW (row_define), &data->data_name); ewl_callback_append (prow, EWL_CALLBACK_CLICKED, _define_display, data); break; case HASH_DATA_FUNCTION: prow = ewl_tree_text_row_add (EWL_TREE (tree), EWL_ROW (row_function), &data->data_name); ewl_callback_append (prow, EWL_CALLBACK_CLICKED, _function_display, data); break; default: break; } } }
void ecrin_ewl_list_fill_package (char *aiguille) { Ewl_Widget *row; char *key; if (list_rows) ecore_list_destroy (list_rows); list_rows = ecore_list_new (); if (!aiguille) aiguille = ""; ecore_list_first_goto(sorted_keys); while ((key = ecore_list_next(sorted_keys))) { Ecrin_Hash_Data *data; data = ecrin_hash_data_get (key); if (strstr (key, aiguille)) { row = ewl_tree_text_row_add (EWL_TREE (list), NULL, &data->data_name); ecore_list_append (list_rows, row); switch (data->type) { case HASH_DATA_ENUM: ewl_callback_append (row, EWL_CALLBACK_CLICKED, _enum_display, data); break; case HASH_DATA_DEFINE: ewl_callback_append (row, EWL_CALLBACK_CLICKED, _define_display, data); break; case HASH_DATA_FUNCTION: ewl_callback_append (row, EWL_CALLBACK_CLICKED, _function_display, data); break; default: break; } } } }
void mime_add_cb(Ewl_Widget *item, void *ev_data, void *user_data) { char *entries[3]; char *type_text = ewl_text_text_get(EWL_TEXT(entry_type)); char *action_text = ewl_text_text_get(EWL_TEXT(entry_action)); entries[0] = type_text; entries[1] = action_text; entries[2] = NULL; ewl_tree_text_row_add(EWL_TREE(mime_tree), NULL,entries); entropy_core_mime_action_add(type_text, action_text); /*free(type_text); free(action_text);*/ ewl_widget_destroy(EWL_WIDGET(user_data)); }
void entropy_ewl_mime_dialog_display() { Ewl_Widget* window = ewl_window_new(); Ewl_Widget* box = ewl_vbox_new(); Ewl_Widget* button = ewl_button_new(); Ewl_Widget* hbox; entropy_core* core = entropy_core_get_core(); char* entries[3]; char* key; entropy_mime_action* action; Ecore_List* keys; last_select_text = NULL; /*Init the mime tree*/ mime_tree = ewl_tree_new(2); ewl_tree_mode_set(EWL_TREE(mime_tree), EWL_SELECTION_MODE_SINGLE); ewl_object_minimum_size_set(EWL_OBJECT(window), 530, 400); ewl_window_title_set(EWL_WINDOW(window), "Edit MIME Actions.."); ewl_container_child_append(EWL_CONTAINER(window), box); ewl_container_child_append(EWL_CONTAINER(box), mime_tree); ewl_widget_show(box); keys = ecore_hash_keys(core->mime_action_hint); while ((key = ecore_list_first_remove(keys))) { Ewl_Widget* row; entries[0] = key; entries[1] = ((entropy_mime_action*)ecore_hash_get(core->mime_action_hint, key))->executable; entries[2] = NULL; row = ewl_tree_text_row_add(EWL_TREE(mime_tree), NULL,entries); ewl_widget_color_set(row,0,0,0,255); ewl_callback_append(row, EWL_CALLBACK_MOUSE_DOWN, mime_row_click_cb, key); } ecore_list_destroy(keys); hbox = ewl_hbox_new(); ewl_container_child_append(EWL_CONTAINER(box), hbox); ewl_object_fill_policy_set(EWL_OBJECT(hbox), EWL_FLAG_FILL_SHRINK); ewl_widget_show(hbox); /*Add Button*/ ewl_button_label_set(EWL_BUTTON(button), "Add MIME Action"); ewl_object_maximum_h_set(EWL_OBJECT(button), 15); ewl_callback_append(button, EWL_CALLBACK_CLICKED, entropy_ewl_mime_add_display_cb, NULL); ewl_container_child_append(EWL_CONTAINER(hbox), button); ewl_widget_show(button); /*OK Button*/ button = ewl_button_new(); ewl_button_label_set(EWL_BUTTON(button), "Close"); ewl_object_maximum_h_set(EWL_OBJECT(button), 15); ewl_callback_append(button, EWL_CALLBACK_CLICKED, window_dismiss_cb, window); ewl_container_child_append(EWL_CONTAINER(hbox), button); ewl_widget_show(button); ewl_widget_show(window); ewl_widget_show(mime_tree); }