From: Enlightenment C. <no...@cv...> - 2007-10-31 19:24:49
|
Enlightenment CVS committal Author : jethomas Project : e17 Module : libs/ewl Dir : e17/libs/ewl/src/bin/tests/combo Modified Files: ewl_combo.c Log Message: Temporary fix for bug 12. =================================================================== RCS file: /cvs/e/e17/libs/ewl/src/bin/tests/combo/ewl_combo.c,v retrieving revision 1.17 retrieving revision 1.18 diff -u -3 -r1.17 -r1.18 --- ewl_combo.c 23 Aug 2007 05:26:43 -0000 1.17 +++ ewl_combo.c 31 Oct 2007 19:24:45 -0000 1.18 @@ -320,15 +320,34 @@ combo_test_editable_cb_header_fetch(void *data, unsigned int col __UNUSED__) { Combo_Test_Data *d; - Ewl_Widget *w, *o; + Ewl_Widget *w, *o, *o2; + Ewl_Selection_Idx *idx; char *val; d = data; + w = ewl_widget_name_find("combo_custom"); + idx = ewl_mvc_selected_get(EWL_MVC(w)); + w = ewl_hbox_new(); + ewl_object_alignment_set(EWL_OBJECT(w), EWL_FLAG_ALIGN_LEFT); val = "Please select an option."; - o = ewl_entry_new(); - ewl_text_text_set(EWL_TEXT(o), val); + + if (idx) + { + val = strrchr(d->data[idx->row], '/'); + ewl_text_text_set(EWL_TEXT(o), + (val ? val + 1 : d->data[idx->row])); + + o2 = ewl_image_new(); + ewl_image_file_path_set(EWL_IMAGE(o2), d->data[idx->row]); + ewl_container_child_append(EWL_CONTAINER(w), o2); + ewl_widget_show(o2); + } + + else + ewl_text_text_set(EWL_TEXT(o), val); + ewl_container_child_append(EWL_CONTAINER(w), o); ewl_callback_append(o, EWL_CALLBACK_VALUE_CHANGED, combo_cb_entry_changed, NULL); |
From: Enlightenment C. <no...@cv...> - 2007-10-31 19:24:54
|
Enlightenment CVS committal Author : jethomas Project : e17 Module : libs/ewl Dir : e17/libs/ewl/src/lib Modified Files: ewl_combo.c Log Message: Temporary fix for bug 12. =================================================================== RCS file: /cvs/e/e17/libs/ewl/src/lib/ewl_combo.c,v retrieving revision 1.61 retrieving revision 1.62 diff -u -3 -r1.61 -r1.62 --- ewl_combo.c 23 Aug 2007 05:26:50 -0000 1.61 +++ ewl_combo.c 31 Oct 2007 19:24:45 -0000 1.62 @@ -335,9 +335,25 @@ model = idx->sel.model; mvc_data = idx->sel.data; - item = view->fetch(model->fetch(mvc_data, idx->row, 0), + if (combo->editable) + { + /* Give the row selected in the column parameter, + * ewl_filepicker needs this to display proper filter + */ + + item = view->header_fetch(ewl_mvc_data_get(mvc), + idx->row); + } + + else + { + + + item = view->fetch(model->fetch(mvc_data, idx->row, 0), idx->row, 0); + } } + else if (view->header_fetch) item = view->header_fetch(ewl_mvc_data_get(mvc), 0); |
From: Enlightenment C. <no...@cv...> - 2007-11-04 23:28:06
|
Enlightenment CVS committal Author : jethomas Project : e17 Module : libs/ewl Dir : e17/libs/ewl/src/lib Modified Files: Ewl.h Makefile.am Added Files: ewl_filelist_model.c ewl_filelist_model.h Log Message: Added ewl_filelist_model.c and ewl_filelist_model.h in steps to convert filelist to mvc. =================================================================== RCS file: /cvs/e/e17/libs/ewl/src/lib/Ewl.h,v retrieving revision 1.31 retrieving revision 1.32 diff -u -3 -r1.31 -r1.32 --- Ewl.h 27 Oct 2007 23:37:59 -0000 1.31 +++ Ewl.h 4 Nov 2007 23:28:03 -0000 1.32 @@ -333,6 +333,7 @@ #include <ewl_freebox.h> #include <ewl_filelist.h> +#include <ewl_filelist_model.h> #include <ewl_filelist_list.h> #include <ewl_filelist_icon.h> #include <ewl_filelist_column.h> =================================================================== RCS file: /cvs/e/e17/libs/ewl/src/lib/Makefile.am,v retrieving revision 1.54 retrieving revision 1.55 diff -u -3 -r1.54 -r1.55 --- Makefile.am 27 Oct 2007 23:37:59 -0000 1.54 +++ Makefile.am 4 Nov 2007 23:28:03 -0000 1.55 @@ -41,6 +41,7 @@ ewl_expansion.h \ ewl_floater.h \ ewl_filelist.h \ + ewl_filelist_model.h \ ewl_filelist_tree.h\ ewl_filelist_list.h\ ewl_filelist_icon.h \ @@ -129,6 +130,7 @@ ewl_expansion.c \ ewl_floater.c \ ewl_filelist.c \ + ewl_filelist_model.c \ ewl_filelist_tree.c \ ewl_filelist_list.c \ ewl_filelist_icon.c \ |
From: Enlightenment C. <no...@cv...> - 2007-11-12 03:07:26
|
Enlightenment CVS committal Author : jethomas Project : e17 Module : libs/ewl Dir : e17/libs/ewl/src/lib Modified Files: ewl_filelist_model.c ewl_filelist_model.h Log Message: Correct the signatures for ewl_model_column_sortable_set and ewl_model_data_unref_set =================================================================== RCS file: /cvs/e/e17/libs/ewl/src/lib/ewl_filelist_model.c,v retrieving revision 1.1 retrieving revision 1.2 diff -u -3 -r1.1 -r1.2 --- ewl_filelist_model.c 4 Nov 2007 23:28:03 -0000 1.1 +++ ewl_filelist_model.c 12 Nov 2007 03:07:21 -0000 1.2 @@ -116,7 +116,7 @@ /* * @internal */ -unsigned int +int ewl_filelist_model_column_sortable(void *data __UNUSED__, unsigned int column) { @@ -344,18 +344,18 @@ /** * @internal */ -void +unsigned int ewl_filelist_model_data_unref(Ewl_Filelist_Directory *dir) { DENTER_FUNCTION(DLEVEL_STABLE); - DCHECK_PARAM_PTR("dir", dir); + DCHECK_PARAM_PTR_RET("dir", dir, FALSE); ecore_string_release(dir->name); ecore_list_destroy(dir->files); ecore_list_destroy(dir->dirs); FREE(dir); - DLEAVE_FUNCTION(DLEVEL_STABLE); + DRETURN_INT(TRUE, DLEVEL_STABLE); } /** =================================================================== RCS file: /cvs/e/e17/libs/ewl/src/lib/ewl_filelist_model.h,v retrieving revision 1.2 retrieving revision 1.3 diff -u -3 -r1.2 -r1.3 --- ewl_filelist_model.h 11 Nov 2007 06:07:46 -0000 1.2 +++ ewl_filelist_model.h 12 Nov 2007 03:07:21 -0000 1.3 @@ -77,8 +77,8 @@ unsigned int row); void *ewl_filelist_model_data_expansion_data_fetch(void *data, unsigned int parent); -void ewl_filelist_model_data_unref(Ewl_Filelist_Directory *dir); -unsigned int ewl_filelist_model_column_sortable(void *data, +unsigned int ewl_filelist_model_data_unref(Ewl_Filelist_Directory *dir); +int ewl_filelist_model_column_sortable(void *data, unsigned int column); /** |
From: Enlightenment C. <no...@cv...> - 2007-11-12 03:18:57
|
Enlightenment CVS committal Author : jethomas Project : e17 Module : libs/ewl Dir : e17/libs/ewl/src/lib Modified Files: ewl_filelist_model.c ewl_filelist_model.h Log Message: Check if type is correct =================================================================== RCS file: /cvs/e/e17/libs/ewl/src/lib/ewl_filelist_model.c,v retrieving revision 1.2 retrieving revision 1.3 diff -u -3 -r1.2 -r1.3 --- ewl_filelist_model.c 12 Nov 2007 03:07:21 -0000 1.2 +++ ewl_filelist_model.c 12 Nov 2007 03:18:56 -0000 1.3 @@ -345,11 +345,17 @@ * @internal */ unsigned int -ewl_filelist_model_data_unref(Ewl_Filelist_Directory *dir) +ewl_filelist_model_data_unref(void *data) { + Ewl_Filelist_Directory *dir; + DENTER_FUNCTION(DLEVEL_STABLE); - DCHECK_PARAM_PTR_RET("dir", dir, FALSE); + DCHECK_PARAM_PTR_RET("data", data, FALSE); + DCHECK_TYPE_RET("data", data, EWL_FILELIST_DIRECTORY_TYPE, + FALSE); + dir = data; + ecore_string_release(dir->name); ecore_list_destroy(dir->files); ecore_list_destroy(dir->dirs); =================================================================== RCS file: /cvs/e/e17/libs/ewl/src/lib/ewl_filelist_model.h,v retrieving revision 1.3 retrieving revision 1.4 diff -u -3 -r1.3 -r1.4 --- ewl_filelist_model.h 12 Nov 2007 03:07:21 -0000 1.3 +++ ewl_filelist_model.h 12 Nov 2007 03:18:56 -0000 1.4 @@ -77,7 +77,7 @@ unsigned int row); void *ewl_filelist_model_data_expansion_data_fetch(void *data, unsigned int parent); -unsigned int ewl_filelist_model_data_unref(Ewl_Filelist_Directory *dir); +unsigned int ewl_filelist_model_data_unref(void *data); int ewl_filelist_model_column_sortable(void *data, unsigned int column); |
From: Enlightenment C. <no...@cv...> - 2007-11-14 20:08:03
|
Enlightenment CVS committal Author : jethomas Project : e17 Module : libs/ewl Dir : e17/libs/ewl/src/bin/tests/filepicker Modified Files: ewl_filepicker.c Log Message: Move file selector over to using mvc, fix bug #250 =================================================================== RCS file: /cvs/e/e17/libs/ewl/src/bin/tests/filepicker/ewl_filepicker.c,v retrieving revision 1.9 retrieving revision 1.10 diff -u -3 -r1.9 -r1.10 --- ewl_filepicker.c 11 Nov 2007 08:03:39 -0000 1.9 +++ ewl_filepicker.c 14 Nov 2007 20:07:58 -0000 1.10 @@ -130,9 +130,7 @@ if (!file) printf("No file selected.\n"); else - printf("Selected %s/%s\n", - ewl_filepicker_directory_get(fp), - file); + printf("%s\n", file); break; } default: |
From: Enlightenment C. <no...@cv...> - 2007-11-14 20:08:02
|
Enlightenment CVS committal Author : jethomas Project : e17 Module : libs/ewl Dir : e17/libs/ewl/src/lib Modified Files: Ewl.h Makefile.am ewl_enums.h ewl_filedialog.c ewl_filedialog.h ewl_filelist.c ewl_filelist.h ewl_filelist_model.c ewl_filepicker.c ewl_filepicker.h ewl_tree2_view_freebox.c Added Files: ewl_filelist_view.c ewl_filelist_view.h Removed Files: ewl_filelist_column.c ewl_filelist_column.h ewl_filelist_icon.c ewl_filelist_icon.h ewl_filelist_list.c ewl_filelist_list.h ewl_filelist_tree.c ewl_filelist_tree.h Log Message: Move file selector over to using mvc, fix bug #250 =================================================================== RCS file: /cvs/e/e17/libs/ewl/src/lib/Ewl.h,v retrieving revision 1.32 retrieving revision 1.33 diff -u -3 -r1.32 -r1.33 --- Ewl.h 4 Nov 2007 23:28:03 -0000 1.32 +++ Ewl.h 14 Nov 2007 20:07:58 -0000 1.33 @@ -334,10 +334,7 @@ #include <ewl_filelist.h> #include <ewl_filelist_model.h> -#include <ewl_filelist_list.h> -#include <ewl_filelist_icon.h> -#include <ewl_filelist_column.h> -#include <ewl_filelist_tree.h> +#include <ewl_filelist_view.h> #include <ewl_filepicker.h> #include <ewl_filedialog.h> =================================================================== RCS file: /cvs/e/e17/libs/ewl/src/lib/Makefile.am,v retrieving revision 1.55 retrieving revision 1.56 diff -u -3 -r1.55 -r1.56 --- Makefile.am 4 Nov 2007 23:28:03 -0000 1.55 +++ Makefile.am 14 Nov 2007 20:07:58 -0000 1.56 @@ -42,10 +42,7 @@ ewl_floater.h \ ewl_filelist.h \ ewl_filelist_model.h \ - ewl_filelist_tree.h\ - ewl_filelist_list.h\ - ewl_filelist_icon.h \ - ewl_filelist_column.h \ + ewl_filelist_view.h \ ewl_filepicker.h \ ewl_filedialog.h \ ewl_freebox.h \ @@ -131,10 +128,7 @@ ewl_floater.c \ ewl_filelist.c \ ewl_filelist_model.c \ - ewl_filelist_tree.c \ - ewl_filelist_list.c \ - ewl_filelist_icon.c \ - ewl_filelist_column.c \ + ewl_filelist_view.c \ ewl_filepicker.c \ ewl_filedialog.c \ ewl_freebox.c \ =================================================================== RCS file: /cvs/e/e17/libs/ewl/src/lib/ewl_enums.h,v retrieving revision 1.83 retrieving revision 1.84 diff -u -3 -r1.83 -r1.84 --- ewl_enums.h 11 Nov 2007 02:12:36 -0000 1.83 +++ ewl_enums.h 14 Nov 2007 20:07:58 -0000 1.84 @@ -598,7 +598,9 @@ { EWL_FILELIST_EVENT_DIR_CHANGE, EWL_FILELIST_EVENT_SELECTION_CHANGE, - EWL_FILELIST_EVENT_FILE_SELECTED + EWL_FILELIST_EVENT_FILE_SELECTED, + EWL_FILELIST_EVENT_MULTI_TRUE, + EWL_FILELIST_EVENT_MULTI_FALSE }; /** @@ -857,6 +859,23 @@ * The Ewl_Thumbnail_Size */ typedef enum Ewl_Thumbnail_Size Ewl_Thumbnail_Size; + +/* + * @enum Ewl_Filelist_View + * The view used in the filelist + */ +enum Ewl_Filelist_View +{ + EWL_FILELIST_VIEW_ICON, /**< Uses freebox view of tree */ + EWL_FILELIST_VIEW_LIST, /**< Normal tree with no expansions */ + EWL_FILELIST_VIEW_TREE, /**< Normal tree with expansions */ + EWL_FILELIST_VIEW_COLUMN, /**< A custom column view */ +}; + +/** + * The Ewl_Filelist_View + */ +typedef enum Ewl_Filelist_View Ewl_Filelist_View; /** * @} =================================================================== RCS file: /cvs/e/e17/libs/ewl/src/lib/ewl_filedialog.c,v retrieving revision 1.39 retrieving revision 1.40 diff -u -3 -r1.39 -r1.40 --- ewl_filedialog.c 12 Nov 2007 22:42:22 -0000 1.39 +++ ewl_filedialog.c 14 Nov 2007 20:07:58 -0000 1.40 @@ -2,10 +2,6 @@ #include "ewl_base.h" #include "ewl_filedialog.h" #include "ewl_filepicker.h" -#include "ewl_filelist_column.h" -#include "ewl_filelist_icon.h" -#include "ewl_filelist_list.h" -#include "ewl_filelist_tree.h" #include "ewl_menu.h" #include "ewl_context_menu.h" #include "ewl_macros.h" @@ -168,11 +164,10 @@ * @brief Set the view to be used for displaying the files in the dialog */ void -ewl_filedialog_list_view_set(Ewl_Filedialog *fd, Ewl_View *view) +ewl_filedialog_list_view_set(Ewl_Filedialog *fd, Ewl_Filelist_View view) { DENTER_FUNCTION(DLEVEL_STABLE); DCHECK_PARAM_PTR(fd); - DCHECK_PARAM_PTR(view); DCHECK_TYPE(fd, EWL_FILEDIALOG_TYPE); ewl_filepicker_list_view_set(EWL_FILEPICKER(fd->fp), view); @@ -185,7 +180,7 @@ * @return Returns the Ewl_View set on this file dialog * @brief Retrieve the file list view used in this file dialog */ -Ewl_View * +Ewl_Filelist_View * ewl_filedialog_list_view_get(Ewl_Filedialog *fd) { DENTER_FUNCTION(DLEVEL_STABLE); @@ -258,8 +253,8 @@ ewl_filedialog_multiselect_get(Ewl_Filedialog *fd) { DENTER_FUNCTION(DLEVEL_STABLE); - DCHECK_PARAM_PTR_RET(fd, 0); - DCHECK_TYPE_RET(fd, EWL_FILEDIALOG_TYPE, 0); + DCHECK_PARAM_PTR_RET(fd, FALSE); + DCHECK_TYPE_RET(fd, EWL_FILEDIALOG_TYPE, FALSE); DRETURN_INT(ewl_filepicker_multiselect_get(EWL_FILEPICKER(fd->fp)), DLEVEL_STABLE); @@ -292,8 +287,8 @@ ewl_filedialog_show_dot_files_get(Ewl_Filedialog *fd) { DENTER_FUNCTION(DLEVEL_STABLE); - DCHECK_PARAM_PTR_RET(fd, 0); - DCHECK_TYPE_RET(fd, EWL_FILEDIALOG_TYPE, 0); + DCHECK_PARAM_PTR_RET(fd, FALSE); + DCHECK_TYPE_RET(fd, EWL_FILEDIALOG_TYPE, FALSE); DRETURN_INT(ewl_filepicker_show_dot_files_get(EWL_FILEPICKER(fd->fp)), DLEVEL_STABLE); @@ -326,8 +321,8 @@ ewl_filedialog_show_favorites_get(Ewl_Filedialog *fd) { DENTER_FUNCTION(DLEVEL_STABLE); - DCHECK_PARAM_PTR_RET(fd, 0); - DCHECK_TYPE_RET(fd, EWL_FILEDIALOG_TYPE, 0); + DCHECK_PARAM_PTR_RET(fd, FALSE); + DCHECK_TYPE_RET(fd, EWL_FILEDIALOG_TYPE, FALSE); DRETURN_INT(ewl_filepicker_show_favorites_get(EWL_FILEPICKER(fd->fp)), DLEVEL_STABLE); @@ -496,7 +491,7 @@ DCHECK_TYPE(data, EWL_FILEDIALOG_TYPE); fd = data; - ewl_filedialog_list_view_set(fd, ewl_filelist_column_view_get()); + ewl_filedialog_list_view_set(fd, EWL_FILELIST_VIEW_COLUMN); DLEAVE_FUNCTION(DLEVEL_STABLE); } @@ -512,7 +507,7 @@ DCHECK_TYPE(data, EWL_FILEDIALOG_TYPE); fd = data; - ewl_filedialog_list_view_set(fd, ewl_filelist_icon_view_get()); + ewl_filedialog_list_view_set(fd, EWL_FILELIST_VIEW_ICON); DLEAVE_FUNCTION(DLEVEL_STABLE); } @@ -528,7 +523,7 @@ DCHECK_TYPE(data, EWL_FILEDIALOG_TYPE); fd = data; - ewl_filedialog_list_view_set(fd, ewl_filelist_list_view_get()); + ewl_filedialog_list_view_set(fd, EWL_FILELIST_VIEW_LIST); DLEAVE_FUNCTION(DLEVEL_STABLE); } @@ -544,7 +539,7 @@ DCHECK_TYPE(data, EWL_FILEDIALOG_TYPE); fd = data; - ewl_filedialog_list_view_set(fd, ewl_filelist_tree_view_get()); + ewl_filedialog_list_view_set(fd, EWL_FILELIST_VIEW_TREE); DLEAVE_FUNCTION(DLEVEL_STABLE); } =================================================================== RCS file: /cvs/e/e17/libs/ewl/src/lib/ewl_filedialog.h,v retrieving revision 1.22 retrieving revision 1.23 diff -u -3 -r1.22 -r1.23 --- ewl_filedialog.h 11 Nov 2007 06:07:46 -0000 1.22 +++ ewl_filedialog.h 14 Nov 2007 20:07:58 -0000 1.23 @@ -60,8 +60,8 @@ int ewl_filedialog_init(Ewl_Filedialog *fd); void ewl_filedialog_list_view_set(Ewl_Filedialog *fd, - Ewl_View *view); -Ewl_View *ewl_filedialog_list_view_get(Ewl_Filedialog *fd); + Ewl_Filelist_View view); +Ewl_Filelist_View *ewl_filedialog_list_view_get(Ewl_Filedialog *fd); void ewl_filedialog_directory_set(Ewl_Filedialog *fd, const char *dir); =================================================================== RCS file: /cvs/e/e17/libs/ewl/src/lib/ewl_filelist.c,v retrieving revision 1.37 retrieving revision 1.38 diff -u -3 -r1.37 -r1.38 --- ewl_filelist.c 12 Nov 2007 22:42:22 -0000 1.37 +++ ewl_filelist.c 14 Nov 2007 20:07:58 -0000 1.38 @@ -1,16 +1,47 @@ /* vim: set sw=8 ts=8 sts=8 noexpandtab: */ #include "ewl_base.h" #include "ewl_filelist.h" +#include "ewl_filelist_model.h" +#include "ewl_filelist_view.h" +#include "ewl_tree2.h" +#include "ewl_tree2_view_freebox.h" +#include "ewl_tree2_view_scrolled.h" +#include "ewl_mvc.h" #include "ewl_icon_theme.h" #include "ewl_io_manager.h" #include "ewl_macros.h" #include "ewl_private.h" #include "ewl_debug.h" -static void ewl_filelist_signal_between(Ewl_Filelist *fl, Ewl_Container *c, - int add, const char *signal, - int a_idx, Ewl_Widget *a, - int b_idx, Ewl_Widget *b); +static void ewl_filelist_setup(Ewl_Filelist *fl); +static void ewl_filelist_view_setup(Ewl_Filelist *fl); +static void ewl_filelist_cb_clicked(Ewl_Widget *w, void *ev, + void *data __UNUSED__); + +/** + * @return Returns a new Ewl_Filelist widget or NULL on failure + * @brief Creates a new Ewl_Filelist widget + */ +Ewl_Widget * +ewl_filelist_new(void) +{ + Ewl_Widget *w; + + DENTER_FUNCTION(DLEVEL_STABLE); + + w = NEW(Ewl_Filelist, 1); + if (!w) + DRETURN_PTR(NULL, DLEVEL_STABLE); + + if (!ewl_filelist_init(EWL_FILELIST(w))) + { + ewl_widget_destroy(w); + w = NULL; + } + + DRETURN_PTR(w, DLEVEL_STABLE); +} + /** * @param fl: The filelist to initialize * @return Returns TRUE on success or FALSE on failure @@ -31,16 +62,191 @@ fl->scroll_flags.h = EWL_SCROLLPANE_FLAG_AUTO_VISIBLE; fl->scroll_flags.v = EWL_SCROLLPANE_FLAG_AUTO_VISIBLE; - fl->selected = ecore_list_new(); ewl_callback_prepend(EWL_WIDGET(fl), EWL_CALLBACK_DESTROY, ewl_filelist_cb_destroy, NULL); + fl->view_flag = EWL_FILELIST_VIEW_ICON; + fl->multiselect = FALSE; + fl->skip_hidden = TRUE; + ewl_filelist_filter_set(fl, NULL); + ewl_filelist_directory_set(fl, NULL); + ewl_filelist_setup(fl); DRETURN_INT(TRUE, DLEVEL_STABLE); } /** + * @param fl: The filelist to setup + * @return Returns no value + * @brief Sets up the filelist view and data + */ +static void +ewl_filelist_setup(Ewl_Filelist *fl) +{ + DENTER_FUNCTION(DLEVEL_STABLE); + DCHECK_PARAM_PTR(fl); + DCHECK_TYPE(fl, EWL_FILELIST_TYPE); + + fl->view = ewl_view_new(); + ewl_view_widget_fetch_set(fl->view, + ewl_filelist_view_widget_fetch); + ewl_view_header_fetch_set(fl->view, + ewl_filelist_view_header_fetch); + + fl->model = ewl_model_new(); + ewl_model_data_count_set(fl->model, + ewl_filelist_model_data_count); + ewl_model_data_fetch_set(fl->model, + ewl_filelist_model_data_fetch); + ewl_model_data_sort_set(fl->model, + ewl_filelist_model_data_sort); + ewl_model_column_sortable_set(fl->model, + ewl_filelist_model_column_sortable); + ewl_model_data_unref_set(fl->model, + ewl_filelist_model_data_unref); + + /* For now just create a tree and set different views */ + fl->controller = ewl_tree2_new(); + ewl_mvc_view_set(EWL_MVC(fl->controller), fl->view); + ewl_mvc_model_set(EWL_MVC(fl->controller), fl->model); + ewl_container_child_append(EWL_CONTAINER(fl), fl->controller); + ewl_callback_append(EWL_WIDGET(fl->controller), + EWL_CALLBACK_CLICKED, ewl_filelist_cb_clicked, + fl); + ewl_widget_show(fl->controller); + + if (fl->multiselect) + ewl_mvc_selection_mode_set(EWL_MVC(fl->controller), + EWL_SELECTION_MODE_MULTI); + else + ewl_mvc_selection_mode_set(EWL_MVC(fl->controller), + EWL_SELECTION_MODE_SINGLE); + + ewl_filelist_view_setup(fl); + + DLEAVE_FUNCTION(DLEVEL_STABLE); +} + +/** + * @internal + */ +static void +ewl_filelist_view_setup(Ewl_Filelist *fl) +{ + Ewl_View *view; + + DENTER_FUNCTION(DLEVEL_STABLE); + DCHECK_PARAM_PTR(fl); + DCHECK_TYPE(fl, EWL_FILELIST_TYPE); + + /* Set expansions callbacks to NULL right off the bat */ + ewl_model_expansion_data_fetch_set(fl->model, NULL); + ewl_model_data_expandable_set(fl->model, NULL); + + if (fl->view_flag == EWL_FILELIST_VIEW_TREE) + { + ewl_tree2_column_count_set(EWL_TREE2(fl->controller), 2); + ewl_tree2_headers_visible_set(EWL_TREE2(fl->controller), + TRUE); + ewl_tree2_alternate_row_colors_set + (EWL_TREE2(fl->controller), TRUE); + ewl_tree2_selection_type_set(EWL_TREE2(fl->controller), + EWL_TREE_SELECTION_TYPE_CELL); + ewl_model_expansion_data_fetch_set(fl->model, + ewl_filelist_model_data_expansion_data_fetch); + ewl_model_data_expandable_set(fl->model, + ewl_filelist_model_data_expandable_get); + view = ewl_tree2_view_scrolled_get(); + } + + else if (fl->view_flag == EWL_FILELIST_VIEW_LIST) + { + ewl_tree2_column_count_set(EWL_TREE2(fl->controller), 6); + ewl_tree2_headers_visible_set(EWL_TREE2(fl->controller), + TRUE); + ewl_tree2_alternate_row_colors_set + (EWL_TREE2(fl->controller), TRUE); + ewl_tree2_selection_type_set(EWL_TREE2(fl->controller), + EWL_TREE_SELECTION_TYPE_ROW); + view = ewl_tree2_view_scrolled_get(); + } + + /* Until column view is written just default and throw a warning */ + else if (fl->view_flag == EWL_FILELIST_VIEW_COLUMN) + { + ewl_tree2_column_count_set(EWL_TREE2(fl->controller), 1); + ewl_tree2_headers_visible_set(EWL_TREE2(fl->controller), + FALSE); + ewl_tree2_alternate_row_colors_set + (EWL_TREE2(fl->controller), FALSE); + ewl_tree2_selection_type_set(EWL_TREE2(fl->controller), + EWL_TREE_SELECTION_TYPE_ROW); + view = ewl_tree2_view_freebox_get(); + DWARNING("Column view not implemented"); + } + + /* Make icon view default */ + else + { + ewl_tree2_column_count_set(EWL_TREE2(fl->controller), 1); + ewl_tree2_headers_visible_set(EWL_TREE2(fl->controller), + FALSE); + ewl_tree2_alternate_row_colors_set + (EWL_TREE2(fl->controller), FALSE); + ewl_tree2_selection_type_set(EWL_TREE2(fl->controller), + EWL_TREE_SELECTION_TYPE_ROW); + view = ewl_tree2_view_freebox_get(); + fl->view_flag = EWL_FILELIST_VIEW_ICON; + } + + /* Set the view and redraw the tree */ + ewl_tree2_content_view_set(EWL_TREE2(fl->controller), view); + ewl_mvc_dirty_set(EWL_MVC(fl->controller), TRUE); + + DLEAVE_FUNCTION(DLEVEL_STABLE); +} + +/** + * @param fl: The filelist to change the view for + * @param view: The view to set + * @return: Returns no value + * @brief Sets the filelist view + */ +void +ewl_filelist_view_set(Ewl_Filelist *fl, Ewl_Filelist_View view) +{ + DENTER_FUNCTION(DLEVEL_STABLE); + DCHECK_PARAM_PTR(fl); + DCHECK_TYPE(fl, EWL_FILELIST_TYPE); + + if (fl->view_flag == view) + DRETURN(DLEVEL_STABLE); + + fl->view_flag = view; + + ewl_filelist_view_setup(fl); + + DLEAVE_FUNCTION(DLEVEL_STABLE); +} + +/** + * @param fl: The filelist to get the view from + * @returns Returns the Ewl_Filelist_View used + * @brief Gets the filelist view + */ +Ewl_Filelist_View * +ewl_filelist_view_get(Ewl_Filelist *fl) +{ + DENTER_FUNCTION(DLEVEL_STABLE); + DCHECK_PARAM_PTR_RET(fl, NULL); + DRETURN_PTR(fl->view_flag, DLEVEL_STABLE); +} + + + + +/** * @param fl: The filelist to set the directory into * @param dir: The directory to set * @return Returns no value @@ -50,20 +256,33 @@ void ewl_filelist_directory_set(Ewl_Filelist *fl, const char *dir) { + Ewl_Filelist_Directory *data; Ewl_Event_Action_Response ev_data; DENTER_FUNCTION(DLEVEL_STABLE); DCHECK_PARAM_PTR(fl); DCHECK_TYPE(fl, EWL_FILELIST_TYPE); - IF_FREE(fl->directory); - fl->directory = strdup(dir); - if (fl->dir_change) fl->dir_change(fl); + if (dir == NULL) fl->directory = NULL; - ev_data.response = EWL_FILELIST_EVENT_DIR_CHANGE; + else if ((!fl->directory) || (strcmp(dir, fl->directory))) + { + fl->directory = strdup(dir); - ewl_callback_call_with_event_data(EWL_WIDGET(fl), - EWL_CALLBACK_VALUE_CHANGED, &ev_data); + data = ewl_mvc_data_get(EWL_MVC(fl->controller)); + if (data) + ewl_filelist_model_data_unref(data); + + data = ewl_filelist_model_directory_new + (fl->directory, + fl->skip_hidden, TRUE); + ewl_mvc_data_set(EWL_MVC(fl->controller), data); + ewl_mvc_dirty_set(EWL_MVC(fl->controller), TRUE); + + ev_data.response = EWL_FILELIST_EVENT_DIR_CHANGE; + ewl_callback_call_with_event_data(EWL_WIDGET(fl), + EWL_CALLBACK_VALUE_CHANGED, &ev_data); + } DLEAVE_FUNCTION(DLEVEL_STABLE); } @@ -99,7 +318,9 @@ IF_FREE(fl->filter); fl->filter = (filter ? strdup(filter) : NULL); - if (fl->filter_change) fl->filter_change(fl); + + /* Model does not do filtering yet */ + DWARNING("Filtering not yet implemented"); DLEAVE_FUNCTION(DLEVEL_STABLE); } @@ -128,13 +349,35 @@ void ewl_filelist_multiselect_set(Ewl_Filelist *fl, unsigned int ms) { + Ewl_Event_Action_Response ev_data; + DENTER_FUNCTION(DLEVEL_STABLE); DCHECK_PARAM_PTR(fl); DCHECK_TYPE(fl, EWL_FILELIST_TYPE); + if (fl->multiselect == ms) + DRETURN(DLEVEL_STABLE); + fl->multiselect = !!ms; - if (fl->multiselect_change) fl->multiselect_change(fl); + + if (ms == TRUE) + { + ewl_mvc_selection_mode_set + (EWL_MVC(fl->controller), + EWL_SELECTION_MODE_MULTI); + ev_data.response = EWL_FILELIST_EVENT_MULTI_TRUE; + } + else + { + ewl_mvc_selection_mode_set + (EWL_MVC(fl->controller), + EWL_SELECTION_MODE_SINGLE); + ev_data.response = EWL_FILELIST_EVENT_MULTI_FALSE; + } + ewl_callback_call_with_event_data(EWL_WIDGET(fl), + EWL_CALLBACK_VALUE_CHANGED, &ev_data); + DLEAVE_FUNCTION(DLEVEL_STABLE); } @@ -147,8 +390,8 @@ ewl_filelist_multiselect_get(Ewl_Filelist *fl) { DENTER_FUNCTION(DLEVEL_STABLE); - DCHECK_PARAM_PTR_RET(fl, 0); - DCHECK_TYPE_RET(fl, EWL_FILELIST_TYPE, 0); + DCHECK_PARAM_PTR_RET(fl, FALSE); + DCHECK_TYPE_RET(fl, EWL_FILELIST_TYPE, FALSE); DRETURN_INT((unsigned int)fl->multiselect, DLEVEL_STABLE); } @@ -162,13 +405,25 @@ void ewl_filelist_show_dot_files_set(Ewl_Filelist *fl, unsigned int dot) { + Ewl_Filelist_Directory *data; + DENTER_FUNCTION(DLEVEL_STABLE); DCHECK_PARAM_PTR(fl); DCHECK_TYPE(fl, EWL_FILELIST_TYPE); - fl->show_dot_files = !!dot; - if (fl->show_dot_change) fl->show_dot_change(fl); + if (fl->skip_hidden == dot) + DRETURN(DLEVEL_STABLE); + fl->skip_hidden = !!dot; + data = ewl_mvc_data_get(EWL_MVC(fl->controller)); + if (data) + ewl_filelist_model_data_unref(data); + + data = ewl_filelist_model_directory_new(fl->directory, + fl->skip_hidden, TRUE); + ewl_mvc_data_set(EWL_MVC(fl->controller), data); + ewl_mvc_dirty_set(EWL_MVC(fl->controller), TRUE); + DLEAVE_FUNCTION(DLEVEL_STABLE); } @@ -181,10 +436,10 @@ ewl_filelist_show_dot_files_get(Ewl_Filelist *fl) { DENTER_FUNCTION(DLEVEL_STABLE); - DCHECK_PARAM_PTR_RET(fl, 0); - DCHECK_TYPE_RET(fl, EWL_FILELIST_TYPE, 0); + DCHECK_PARAM_PTR_RET(fl, FALSE); + DCHECK_TYPE_RET(fl, EWL_FILELIST_TYPE, FALSE); - DRETURN_INT((unsigned int)fl->show_dot_files, DLEVEL_STABLE); + DRETURN_INT((unsigned int)fl->skip_hidden, DLEVEL_STABLE); } /** @@ -196,17 +451,55 @@ void ewl_filelist_selected_file_set(Ewl_Filelist *fl, const char *file) { + char *filename; + Ewl_Filelist_Directory *data; + Ewl_Filelist_File *file_temp; + int dir = 0, index = -1; + Ecore_List *temp; + DENTER_FUNCTION(DLEVEL_STABLE); DCHECK_PARAM_PTR(fl); DCHECK_TYPE(fl, EWL_FILELIST_TYPE); - /* clean out the old set of selected files */ - if (fl->selected_unselect) fl->selected_unselect(fl); - ecore_list_clear(fl->selected); - if (fl->selected_file_add && file) fl->selected_file_add(fl, file); + if (!file) + { + ewl_mvc_selected_clear(EWL_MVC(fl->controller)); + DRETURN(DLEVEL_STABLE); + } - ewl_filelist_selected_files_change_notify(fl); + filename = ewl_filelist_expand_path(fl, file); + data = ewl_mvc_data_get(EWL_MVC(fl->controller)); + if (ecore_file_is_dir(filename)) + { + temp = data->dirs; + dir = 1; + } + else + temp = data->files; + + ecore_list_first_goto(temp); + + while ((file_temp = ecore_list_next(temp))) + { + if (!strcoll(file_temp->name, file)) + { + index = ecore_list_index(temp); + break; + } + } + + if ((index >= 0) && (dir == 0)) + ewl_mvc_selected_set(EWL_MVC(fl->controller), NULL, + NULL, (index+data->num_dirs-1), + 0); + + else if ((index >= 0) && (dir == 1)) + ewl_mvc_selected_set(EWL_MVC(fl->controller), NULL, + NULL, (index-1), 0); + + FREE(filename); + ewl_filelist_selected_files_change_notify(fl); DLEAVE_FUNCTION(DLEVEL_STABLE); } @@ -218,18 +511,42 @@ char * ewl_filelist_selected_file_get(Ewl_Filelist *fl) { - void *widget; - const char *file = NULL; + Ewl_Filelist_Directory *data; + Ewl_Filelist_File *file; + Ewl_Selection_Idx *idx; + char path[PATH_MAX]; + int i; DENTER_FUNCTION(DLEVEL_STABLE); DCHECK_PARAM_PTR_RET(fl, NULL); DCHECK_TYPE_RET(fl, EWL_FILELIST_TYPE, 0); - ecore_list_first_goto(fl->selected); - widget = ecore_list_current(fl->selected); - if (widget && fl->file_name_get) file = fl->file_name_get(fl, widget); + if (!ewl_mvc_selected_count_get(EWL_MVC(fl->controller))) + DRETURN_PTR(NULL, DLEVEL_STABLE); - DRETURN_PTR((file ? strdup(file) : NULL), DLEVEL_STABLE); + data = ewl_mvc_data_get(EWL_MVC(fl->controller)); + idx = ewl_mvc_selected_get(EWL_MVC(fl->controller)); + if (idx->row < data->num_dirs) + file = ecore_list_index_goto(data->dirs, idx->row); + else + { + i = (idx->row - data->num_dirs); + file = ecore_list_index_goto(data->files, i); + } + + FREE(idx); + + if (!strcmp(file->name, "..")) + snprintf(path, PATH_MAX, "%s", data->name); + + else if (!strcmp(data->name, "/")) + snprintf(path, PATH_MAX, "%s%s", data->name, file->name); + + else + snprintf(path, PATH_MAX, "%s/%s", data->name, + file->name); + + DRETURN_PTR(strdup(path), DLEVEL_STABLE); } /** @@ -366,7 +683,7 @@ time = strdup(time); time[strlen(time) - 1] = '\0'; } - else time = strdup("unknown"); + else time = strdup("Unknown"); DRETURN_PTR(time, DLEVEL_STABLE); } @@ -474,29 +791,72 @@ /** * @param fl: The filelist to set the selected files into - * @param files: The Ecore_List of files to set + * @param files: The Ecore_List of the files * @return Returns no value. * @brief Sets the given files as selected in the filelist */ void ewl_filelist_selected_files_set(Ewl_Filelist *fl, Ecore_List *files) { - char *file; + Ewl_Filelist_Directory *data; + Ewl_Filelist_File *file; + Ecore_List *selected, *temp; + Ewl_Selection *sel; + int i, index; + char *path; DENTER_FUNCTION(DLEVEL_STABLE); DCHECK_PARAM_PTR(fl); DCHECK_PARAM_PTR(files); DCHECK_TYPE(fl, EWL_FILELIST_TYPE); - /* clean out the old set of selected files */ - if (fl->selected_unselect) fl->selected_unselect(fl); - ecore_list_clear(fl->selected); + /* Get the mvc data and get ready for looping */ + data = ewl_mvc_data_get(EWL_MVC(fl->controller)); + selected = ecore_list_new(); + ecore_list_first_goto(data->dirs); + ecore_list_first_goto(data->files); ecore_list_first_goto(files); - while ((file = ecore_list_next(files))) - if (fl->selected_file_add) fl->selected_file_add(fl, file); + /* For every file, search for a match */ + for (i = 0; i < ecore_list_count(files); i++) + { + path = ecore_list_next(files); + + /* Set temp to whichever list the file could be in */ + if (ecore_file_is_dir(path)) + { + temp = data->dirs; + index = 0; + } + else + { + temp = data->files; + index = data->num_dirs; + } + + /* Search the list and return the index if found */ + while ((file = ecore_list_next(temp))) + { + if (!strcmp(file->name, ecore_file_file_get + (path))) + { + index = (index + + ecore_list_index(temp) - 1); + sel = ewl_mvc_selection_index_new + (fl->model, NULL, index, 0); + ecore_list_append(selected, sel); + break; + } + } + + ecore_list_first_goto(temp); + } + + ewl_mvc_selected_list_set(EWL_MVC(fl->controller), selected); ewl_filelist_selected_files_change_notify(fl); + ecore_list_destroy(files); + ecore_list_destroy(selected); DLEAVE_FUNCTION(DLEVEL_STABLE); } @@ -509,25 +869,71 @@ Ecore_List * ewl_filelist_selected_files_get(Ewl_Filelist *fl) { - Ecore_List *selected; - void *item; + Ecore_List *selected, *ret; + Ewl_Selection *sel; + Ewl_Filelist_Directory *data; + Ewl_Filelist_File *file; + char path[PATH_MAX]; DENTER_FUNCTION(DLEVEL_STABLE); DCHECK_PARAM_PTR_RET(fl, NULL); DCHECK_TYPE_RET(fl, EWL_FILELIST_TYPE, NULL); - selected = ecore_list_new(); - ecore_list_free_cb_set(selected, free); + ret = ecore_list_new(); - ecore_list_first_goto(fl->selected); - while ((item = ecore_list_next(fl->selected))) + data = ewl_mvc_data_get(EWL_MVC(fl->controller)); + selected = ewl_mvc_selected_list_get(EWL_MVC(fl->controller)); + ecore_list_first_goto(selected); + + while ((sel = ecore_list_next(selected))) { - const char *file; - file = fl->file_name_get(fl, item); - ecore_list_append(selected, strdup(file)); - } + /* If using Index instead of range */ + if (sel->type == EWL_SELECTION_TYPE_INDEX) + { + Ewl_Selection_Idx *idx; + + idx = EWL_SELECTION_IDX(sel); + /* Get the file data */ + if (idx->row < data->num_dirs) + file = ecore_list_index_goto + (data->dirs, idx->row); + else + file = ecore_list_index_goto + (data->files, + (idx->row - data->num_dirs)); + + snprintf(path, PATH_MAX, "%s/%s", data->name, + file->name); + ecore_list_append(ret, strdup(path)); + } + + /* If using range instead of index */ + else if (sel->type == EWL_SELECTION_TYPE_RANGE) + { + Ewl_Selection_Range *r; + int i; - DRETURN_PTR(selected, DLEVEL_STABLE); + r = EWL_SELECTION_RANGE(sel); + for (i = r->start.row; i <= r->end.row; i++) + { + /* Get the file data */ + if (i < data->num_dirs) + file = ecore_list_index_goto + (data->dirs, i); + else + file = ecore_list_index_goto + (data->files, + (i - data->num_dirs)); + + snprintf(path, PATH_MAX, "%s/%s", + data->name, + file->name); + ecore_list_append(ret, strdup(path)); + } + } + } + + DRETURN_PTR(ret, DLEVEL_STABLE); } /** @@ -554,29 +960,6 @@ /** * @param fl: The filelist to work with - * @param signal: The signal to send - * @return Returns no value - * @brief Signals all of the selected widgets with the given signal - */ -void -ewl_filelist_selected_signal_all(Ewl_Filelist *fl, const char *signal) -{ - Ewl_Widget *item; - - DENTER_FUNCTION(DLEVEL_STABLE); - DCHECK_PARAM_PTR(fl); - DCHECK_PARAM_PTR(signal); - DCHECK_TYPE(fl, EWL_FILELIST_TYPE); - - ecore_list_first_goto(fl->selected); - while ((item = ecore_list_next(fl->selected))) - ewl_widget_state_set(item, signal, EWL_STATE_PERSISTENT); - - DLEAVE_FUNCTION(DLEVEL_STABLE); -} - -/** - * @param fl: The filelist to work with * @param v: The value to set for the vertical scrollbar * @return Returns no value * @brief Sets the value to use for flags on the vertical scrollbar @@ -644,21 +1027,18 @@ } /** - * @param fl: The filelist to work with * @param path: The path to get the icon for * @return Returns the stock icon for the given file * @brief Retrieves the stock icon for the given file */ const char * -ewl_filelist_stock_icon_get(Ewl_Filelist *fl, const char *path) +ewl_filelist_stock_icon_get(const char *path) { const char *ret = NULL; char *ptr = NULL; DENTER_FUNCTION(DLEVEL_STABLE); - DCHECK_PARAM_PTR_RET(fl, NULL); DCHECK_PARAM_PTR_RET(path, NULL); - DCHECK_TYPE_RET(fl, EWL_FILELIST_TYPE, NULL); if (ecore_file_is_dir(path)) DRETURN_PTR(EWL_ICON_FOLDER, DLEVEL_STABLE); @@ -734,367 +1114,73 @@ /** * @internal - * @param fl: The filelist to work with - * @param dir: The directory to read - * @param skip_dot_dot: Should the .. entry be skipped - * @param func: The function to call to actually add the item - * @param data: The data to pass to the callback function - * @return Returns no value. - * @brief This will read the directory set in the file list, filter each - * item through the set filter and call @a func if the file is to be - * displayed. + * @param w: The widget to work with + * @param ev: UNUSED + * @param data: UNUSED + * @return Returns no value + * @brief The destroy callback */ void -ewl_filelist_directory_read(Ewl_Filelist *fl, const char *dir, - unsigned int skip_dot_dot, - void (*func)(Ewl_Filelist *fl, const char *dir, - char *file, void *data), void *data) +ewl_filelist_cb_destroy(Ewl_Widget *w, void *ev __UNUSED__, + void *data __UNUSED__) { - Ecore_List *all_files, *files, *dirs; - char path[PATH_MAX]; - char *file; + Ewl_Filelist *fl; DENTER_FUNCTION(DLEVEL_STABLE); - DCHECK_PARAM_PTR(fl); - DCHECK_PARAM_PTR(func); - DCHECK_TYPE(fl, EWL_FILELIST_TYPE); - - all_files = ecore_file_ls(dir); - if (!all_files) DRETURN(DLEVEL_STABLE); - - files = ecore_list_new(); - dirs = ecore_list_new(); - - /* if this isn't the root dir add a .. entry */ - if (strcmp(dir, "/") && !skip_dot_dot) - ecore_list_append(dirs, strdup("..")); - - while ((file = ecore_list_first_remove(all_files))) - { - int is_dir; - - snprintf(path, PATH_MAX, "%s/%s", dir, file); - is_dir = ecore_file_is_dir(path); - - /* check the filter if this isn't a directory */ - if (fl->filter && (!is_dir) && fnmatch(fl->filter, file, 0)) - continue; - - if ((!ewl_filelist_show_dot_files_get(fl)) - && (file[0] == '.')) - continue; - - if (is_dir) ecore_list_append(dirs, file); - else ecore_list_append(files, file); - } - - /* XXX will need to do sorting here ... */ - while ((file = ecore_list_first_remove(dirs))) - { - func(fl, dir, file, data); - FREE(file); - } - - while ((file = ecore_list_first_remove(files))) - { - func(fl, dir, file, data); - FREE(file); - } + DCHECK_PARAM_PTR(w); + DCHECK_TYPE(w, EWL_FILELIST_TYPE); - IF_FREE_LIST(all_files); - IF_FREE_LIST(files); - IF_FREE_LIST(dirs); + fl = EWL_FILELIST(w); + IF_FREE(fl->directory); + IF_FREE(fl->filter); + IF_FREE(fl->view); + IF_FREE(fl->model); DLEAVE_FUNCTION(DLEVEL_STABLE); } -/** - * @internal - * @param fl: The filelist to work with - * @param w: The widget that was clicked - * @param ev: The Ewl_Event_Mouse_Up structure - * @param select_state: Signal to send to goto select state - * @param unselect_state: Signal to send to goto unselect state - * @return Returns no value. - * @brief Adds or removes the given widget from the select list as needed - */ -void -ewl_filelist_handle_click(Ewl_Filelist *fl, Ewl_Widget *w, - Ewl_Event_Mouse_Up *ev, - const char *select_state, - const char *unselect_state) +static void +ewl_filelist_cb_clicked(Ewl_Widget *w, void *ev, + void *data __UNUSED__) { - int multi = FALSE; + Ewl_Event_Mouse_Down *event; + char *file, *t; + Ewl_Filelist *fl; DENTER_FUNCTION(DLEVEL_STABLE); - DCHECK_PARAM_PTR(fl); DCHECK_PARAM_PTR(w); DCHECK_PARAM_PTR(ev); - DCHECK_TYPE(fl, EWL_FILELIST_TYPE); - DCHECK_TYPE(w, EWL_WIDGET_TYPE); - - /* only trigger on lmb */ - if (ev->button != 1) - DRETURN(DLEVEL_STABLE); - - /* are the multiselect keys pressed? */ - if ((ev->base.modifiers & EWL_KEY_MODIFIER_SHIFT) - || (ev->base.modifiers & EWL_KEY_MODIFIER_CTRL)) - multi = TRUE; - - /* we are not in multiselect mode, or the multiselect keys aren't - * pressed */ - if (!ewl_filelist_multiselect_get(fl) || (!multi)) - { - if (fl->selected_unselect) fl->selected_unselect(fl); - ecore_list_clear(fl->selected); - if (select_state) - ewl_widget_state_set(w, select_state, - EWL_STATE_PERSISTENT); - - ecore_list_append(fl->selected, w); - ewl_filelist_selected_files_change_notify(fl); - - fl->select.base = w; - fl->select.last = NULL; + event = ev; + fl = data; + if (!ewl_mvc_selected_count_get(EWL_MVC(fl->controller))) DRETURN(DLEVEL_STABLE); - } - - /* ok, we're in multiselect mode and either shift or ctrl are - * pressed */ - - if (ev->base.modifiers & EWL_KEY_MODIFIER_SHIFT) - { - /* we have no base selected so this is the first click with - * the shift. set base and set the clicked as selected */ - if (!fl->select.base) - { - fl->select.base = w; - fl->select.last = NULL; - - if (fl->selected_unselect) fl->selected_unselect(fl); - ecore_list_clear(fl->selected); - } - else - { - if (fl->shift_handle) fl->shift_handle(fl, w); - fl->select.last = w; - } - - if (select_state) - ewl_widget_state_set(w, select_state, - EWL_STATE_PERSISTENT); - ecore_list_append(fl->selected, w); + /* Single clicks only */ + if (event->clicks != 2) ewl_filelist_selected_files_change_notify(fl); - } - else - { - void *item; - - fl->select.base = w; - fl->select.last = NULL; - - item = ecore_list_goto(fl->selected, w); - if (item) - { - if (unselect_state) - ewl_widget_state_set(w, unselect_state, - EWL_STATE_PERSISTENT); - ecore_list_remove(fl->selected); - } - else - { - if (select_state) - ewl_widget_state_set(w, select_state, - EWL_STATE_PERSISTENT); - ecore_list_append(fl->selected, w); - } - } - - DLEAVE_FUNCTION(DLEVEL_STABLE); -} -/** - * @internal - * @param fl: The filelist to work with - * @param c: The container to select/unselect from - * @param clicked: The clicked widget - * @param select_signal: The signal to send on select - * @param unselect_signal: The signal to send on unselect - * @return Returns no value - * @brief Handles the select/deselect of widgets in the given container @a c - */ -void -ewl_filelist_container_shift_handle(Ewl_Filelist *fl, - Ewl_Container *c, Ewl_Widget *clicked, - const char *select_signal, - const char *unselect_signal) -{ - int base_idx, last_idx = -1, cur_idx; - - DENTER_FUNCTION(DLEVEL_STABLE); - DCHECK_PARAM_PTR(fl); - DCHECK_PARAM_PTR(c); - DCHECK_PARAM_PTR(clicked); - DCHECK_PARAM_PTR(select_signal); - DCHECK_PARAM_PTR(unselect_signal); - DCHECK_TYPE(fl, EWL_FILELIST_TYPE); - DCHECK_TYPE(c, EWL_CONTAINER_TYPE); - DCHECK_TYPE(clicked, EWL_WIDGET_TYPE); - - ecore_list_goto(c->children, fl->select.base); - base_idx = ecore_list_index(c->children); - - ecore_list_goto(c->children, clicked); - cur_idx = ecore_list_index(c->children); - - if (fl->select.last) + /* Handle double clicks */ + if (event->clicks == 2) { - ecore_list_goto(c->children, fl->select.last); - last_idx = ecore_list_index(c->children); - } + file = ewl_filelist_selected_file_get(fl); - if (last_idx < 0) - { - ewl_filelist_signal_between(fl, c, TRUE, select_signal, base_idx, - fl->select.base, cur_idx, clicked); - } - else - { - /* user selected more, just tag on whats between the last - * click and the current click */ - if (((cur_idx < last_idx) && (last_idx < base_idx)) - || ((base_idx < last_idx) - && (last_idx < cur_idx))) + /* If .. */ + if (!strcmp(file, fl->directory)) { - ewl_filelist_signal_between(fl, c, TRUE, select_signal, - last_idx, fl->select.last, - cur_idx, clicked); + t = ecore_file_dir_get(fl->directory); + ewl_filelist_directory_set(fl, t); + FREE(t); } + /* Change dir if dir, else call above */ + else if (ecore_file_is_dir(file)) + ewl_filelist_directory_set(fl, file); + + /* Send signal of file selected */ else - { - /* unselect stuff between last and our current index */ - ewl_filelist_signal_between(fl, c, FALSE, - unselect_signal, last_idx, - fl->select.last, cur_idx, clicked); - - /* make sure the last selected is removed */ - ewl_widget_state_set(fl->select.last, unselect_signal, - EWL_STATE_PERSISTENT); - ecore_list_goto(fl->selected, fl->select.last); - ecore_list_remove(fl->selected); - - /* if we moved over the base point we need to - * reseelct some stuff */ - if (!((last_idx < base_idx) && (cur_idx < base_idx)) - && !((last_idx > base_idx) - && (cur_idx > base_idx))) - { - ewl_filelist_signal_between(fl, c, TRUE, - select_signal, base_idx, - fl->select.base, cur_idx, - clicked); - } - } - } - - DLEAVE_FUNCTION(DLEVEL_STABLE); -} - -static void -ewl_filelist_signal_between(Ewl_Filelist *fl, Ewl_Container *c, int add, - const char *signal, - int a_idx, Ewl_Widget *a, - int b_idx, Ewl_Widget *b) -{ - Ewl_Widget *start, *end, *cur; - - DENTER_FUNCTION(DLEVEL_STABLE); - DCHECK_PARAM_PTR(fl); - DCHECK_PARAM_PTR(c); - DCHECK_PARAM_PTR(signal); - DCHECK_PARAM_PTR(a); - DCHECK_PARAM_PTR(b); - DCHECK_TYPE(fl, EWL_FILELIST_TYPE); - DCHECK_TYPE(c, EWL_CONTAINER_TYPE); - DCHECK_TYPE(a, EWL_WIDGET_TYPE); - DCHECK_TYPE(b, EWL_WIDGET_TYPE); - - if (a_idx < b_idx) - { - start = a; - end = b; + ewl_filelist_selected_files_change_notify(fl); } - else - { - start = b; - end = a; - } - - /* select all the widgets between the base and clicked - * point, excluding the start/end points */ - ecore_list_goto(c->children, start); - ecore_list_next(c->children); - while ((cur = ecore_list_next(c->children))) - { - if (cur == end) break; - - if (add) - { - ewl_widget_state_set(cur, signal, EWL_STATE_PERSISTENT); - ecore_list_append(fl->selected, cur); - } - else - { - /* don't remove the base selected widget */ - if (cur != fl->select.base) - { - ecore_list_goto(fl->selected, cur); - ecore_list_remove(fl->selected); - ewl_widget_state_set(cur, signal, - EWL_STATE_PERSISTENT); - } - } - } - - DLEAVE_FUNCTION(DLEVEL_STABLE); -} - -/** - * @internal - * @param w: The widget to work with - * @param ev: UNUSED - * @param data: UNUSED - * @return Returns no value - * @brief The destroy callback - */ -void -ewl_filelist_cb_destroy(Ewl_Widget *w, void *ev __UNUSED__, - void *data __UNUSED__) -{ - Ewl_Filelist *fl; - - DENTER_FUNCTION(DLEVEL_STABLE); - DCHECK_PARAM_PTR(w); - DCHECK_TYPE(w, EWL_FILELIST_TYPE); - - fl = EWL_FILELIST(w); - - IF_FREE_LIST(fl->selected); - IF_FREE(fl->directory); - IF_FREE(fl->filter); - - fl->dir_change = NULL; - fl->filter_change = NULL; - fl->multiselect_change = NULL; - fl->show_dot_change = NULL; - fl->selected_file_add = NULL; - fl->file_name_get = NULL; - fl->selected_unselect = NULL; - fl->shift_handle = NULL; DLEAVE_FUNCTION(DLEVEL_STABLE); } =================================================================== RCS file: /cvs/e/e17/libs/ewl/src/lib/ewl_filelist.h,v retrieving revision 1.20 retrieving revision 1.21 diff -u -3 -r1.20 -r1.21 --- ewl_filelist.h 11 Nov 2007 06:07:46 -0000 1.20 +++ ewl_filelist.h 14 Nov 2007 20:07:58 -0000 1.21 @@ -6,6 +6,8 @@ #include "ewl_image.h" #include "ewl_icon.h" #include "ewl_text.h" +#include "ewl_model.h" +#include "ewl_view.h" /** * @addtogroup Ewl_Filelist Ewl_Filelist: The base widget for the filelists @@ -48,50 +50,28 @@ struct Ewl_Filelist { Ewl_Box box; /**< Inherits from Ewl_Box */ + Ewl_Widget *controller; /**< Must inherit from mvc **/ + + Ewl_View *view; /**< The view for mvc */ + Ewl_Model *model; /**< The model for the mvc */ - Ecore_List *selected; /**< The selected files */ char *directory; /**< The directory to display */ char *filter; /**< The file filter to employ */ unsigned char multiselect:1; /**< Allow multiple file selctions */ - unsigned char show_dot_files:1; /**< Show . files */ + unsigned char skip_hidden:1; /**< Show . files */ - struct - { - Ewl_Widget *base; /**< First select in SHIFT select */ - Ewl_Widget *last; /**< Last selected in SHIFT select */ - } select; /**< Data used in SHIFT select */ + Ewl_Filelist_View view_flag; /**< The view to use for controller */ struct { Ewl_Scrollpane_Flags h; /**< Horizontal scroll flag */ Ewl_Scrollpane_Flags v; /**< Vertical scroll flag */ } scroll_flags; /**< Flags to modify a containing scrollpane */ - - void (*dir_change)(Ewl_Filelist *fl); /**< Callback to notify of - directory change */ - void (*filter_change)(Ewl_Filelist *fl); /**< Callback to notify - of filter change */ - void (*multiselect_change)(Ewl_Filelist *fl); /**< Callback to notify - of multilselect state - change */ - void (*show_dot_change)(Ewl_Filelist *fl); /**< Callback to notify - of show dot file - setting change */ - void (*selected_unselect)(Ewl_Filelist *fl); /**< Callback to - unselect all files */ - void (*selected_file_add)(Ewl_Filelist *fl, const char *file); /**< - Callback to - notify of a change - to the selected - files */ - const char *(*file_name_get)(Ewl_Filelist *fl, void *file); /**< - Callback to get the - selected filename */ - void (*shift_handle)(Ewl_Filelist *fl, Ewl_Widget *clicked); /**< - Callback to handle - SHIFT clicks */ }; + +Ewl_Widget *ewl_filelist_new(void); + int ewl_filelist_init(Ewl_Filelist *fl); void ewl_filelist_directory_set(Ewl_Filelist *fl, @@ -102,6 +82,11 @@ const char *filter); const char *ewl_filelist_filter_get(Ewl_Filelist *fl); +void ewl_filelist_view_set(Ewl_Filelist *fl, + Ewl_Filelist_View view); +Ewl_Filelist_View *ewl_filelist_view_get(Ewl_Filelist *fl); + + void ewl_filelist_multiselect_set(Ewl_Filelist *fl, unsigned int ms); unsigned int ewl_filelist_multiselect_get(Ewl_Filelist *fl); @@ -138,7 +123,7 @@ Ewl_Scrollpane_Flags h); Ewl_Scrollpane_Flags ewl_filelist_hscroll_flag_get(Ewl_Filelist *fl); -const char *ewl_filelist_stock_icon_get(Ewl_Filelist *fl, const char *path); +const char *ewl_filelist_stock_icon_get(const char *path); char *ewl_filelist_expand_path(Ewl_Filelist *fl, const char *dir); void ewl_filelist_directory_read(Ewl_Filelist *fl, =================================================================== RCS file: /cvs/e/e17/libs/ewl/src/lib/ewl_filelist_model.c,v retrieving revision 1.4 retrieving revision 1.5 diff -u -3 -r1.4 -r1.5 --- ewl_filelist_model.c 12 Nov 2007 22:42:22 -0000 1.4 +++ ewl_filelist_model.c 14 Nov 2007 20:07:59 -0000 1.5 @@ -6,7 +6,6 @@ #include "ewl_model.h" #include "ewl_filelist.h" #include <dirent.h> -#include <locale.h> static int ewl_filelist_model_data_name_sort(Ewl_Filelist_File *file1, Ewl_Filelist_File *file2); @@ -44,7 +43,7 @@ all_files = ecore_file_ls(path); /* Add in the ".." entry for now */ - if (show_dot_dot) + if ((show_dot_dot) && (strcmp(path, "/"))) ecore_list_prepend(all_files, strdup(path)); while ((file_temp = ecore_list_first_remove(all_files))) @@ -149,6 +148,7 @@ Ewl_Filelist_File *file; int i; void *ret; + char path[PATH_MAX]; DENTER_FUNCTION(DLEVEL_STABLE); DCHECK_PARAM_PTR_RET(data, NULL); @@ -164,7 +164,11 @@ file = ecore_list_index_goto(fld->files, i); } - if (column == 0) ret = strdup(file->name); + if ((column == 0) && (strcmp(file->name, ".."))) + { + snprintf(path, PATH_MAX, "%s/%s", fld->name, file->name); + ret = strdup(path); + } else if (column == 1) ret = ewl_filelist_size_get(file->size); else if (column == 2) ret = ewl_filelist_perms_get(file->mode); else if (column == 3) ret = ewl_filelist_username_get @@ -173,7 +177,7 @@ (file->groupname); else if (column == 5) ret = ewl_filelist_modtime_get (file->modtime); - else ret = NULL; + else ret = strdup(file->name); /* ret needs to be freed by the view or with model_data_free_set */ DRETURN_PTR(ret, DLEVEL_STABLE); @@ -353,7 +357,6 @@ DCHECK_PARAM_PTR_RET(data, FALSE); dir = data; - ecore_string_release(dir->name); ecore_list_destroy(dir->files); ecore_list_destroy(dir->dirs); =================================================================== RCS file: /cvs/e/e17/libs/ewl/src/lib/ewl_filepicker.c,v retrieving revision 1.36 retrieving revision 1.37 diff -u -3 -r1.36 -r1.37 --- ewl_filepicker.c 12 Nov 2007 22:42:22 -0000 1.36 +++ ewl_filepicker.c 14 Nov 2007 20:07:59 -0000 1.37 @@ -1,10 +1,10 @@ /* vim: set sw=8 ts=8 sts=8 noexpandtab: */ #include "ewl_base.h" #include "ewl_filepicker.h" +#include "ewl_filelist.h" #include "ewl_button.h" #include "ewl_combo.h" #include "ewl_entry.h" -#include "ewl_filelist_icon.h" #include "ewl_label.h" #include "ewl_model.h" #include "ewl_scrollpane.h" @@ -104,6 +104,7 @@ view = ewl_label_view_get(); fp->path = ecore_list_new(); + ecore_list_free_cb_set(fp->path, ECORE_FREE_CB(free)); fp->path_combo = ewl_combo_new(); ewl_container_child_append(EWL_CONTAINER(fp), fp->path_combo); @@ -194,7 +195,14 @@ ewl_widget_show(o); /* do this last so all the other widgets are set correctly */ - ewl_filepicker_list_view_set(fp, ewl_filelist_icon_view_get()); + fp->file_list = ewl_filelist_new(); + ewl_container_child_append(EWL_CONTAINER(fp->file_list_box), + fp->file_list); + ewl_callback_append(EWL_WIDGET(fp->file_list), + EWL_CALLBACK_VALUE_CHANGED, + ewl_filepicker_cb_list_value_changed, + fp); + ewl_widget_show(fp->file_list); ewl_filepicker_directory_set(fp, NULL); DRETURN_INT(TRUE, DLEVEL_STABLE); @@ -247,55 +255,19 @@ * @brief Sets the given view to be used to display the file list */ void -ewl_filepicker_list_view_set(Ewl_Filepicker *fp, Ewl_View *view) +ewl_filepicker_list_view_set(Ewl_Filepicker *fp, Ewl_Filelist_View view) { - Ewl_Filelist *old_fl; + Ewl_Filelist *temp; DENTER_FUNCTION(DLEVEL_STABLE); DCHECK_PARAM_PTR(fp); - DCHECK_PARAM_PTR(view); DCHECK_TYPE(fp, EWL_FILEPICKER_TYPE); - - if (view == fp->view) + + temp = EWL_FILELIST(fp->file_list); + + if (temp->view_flag == view) DRETURN(DLEVEL_STABLE); - - fp->view = view; - old_fl = EWL_FILELIST(fp->file_list); - - /* set the new view */ - fp->file_list = view->fetch(NULL, 0, 0); - ewl_container_child_append(EWL_CONTAINER(fp->file_list_box), - fp->file_list); - ewl_callback_append(EWL_WIDGET(fp->file_list), - EWL_CALLBACK_VALUE_CHANGED, - ewl_filepicker_cb_list_value_changed, fp); - - /* get any scrollpane flags from the file list in case they need to - * turn off certain bars */ - ewl_scrollpane_vscrollbar_flag_set(EWL_SCROLLPANE(fp->file_list_box), - ewl_filelist_vscroll_flag_get( - EWL_FILELIST(fp->file_list))); - ewl_scrollpane_hscrollbar_flag_set(EWL_SCROLLPANE(fp->file_list_box), - ewl_filelist_hscroll_flag_get( - EWL_FILELIST(fp->file_list))); - - /* load new view from old view values */ - if (old_fl) - { - ewl_filepicker_directory_set(fp, - ewl_filelist_directory_get(old_fl)); - ewl_filepicker_filter_set(fp, - ewl_filelist_filter_get(old_fl)); - ewl_filepicker_multiselect_set(fp, - ewl_filelist_multiselect_get(old_fl)); - ewl_filepicker_show_dot_files_set(fp, - ewl_filelist_show_dot_files_get(old_fl)); - ewl_filepicker_selected_files_set(fp, - ewl_filelist_selected_files_get(old_fl)); - ewl_widget_destroy(EWL_WIDGET(old_fl)); - } - ewl_widget_show(fp->file_list); - + ewl_filelist_view_set(EWL_FILELIST(fp->file_list), view); DLEAVE_FUNCTION(DLEVEL_STABLE); } @@ -304,14 +276,15 @@ * @return Returns the current view set on the filepicker * @brief Retrieves the current view used for the file list */ -Ewl_View * +Ewl_Filelist_View * ewl_filepicker_list_view_get(Ewl_Filepicker *fp) { DENTER_FUNCTION(DLEVEL_STABLE); DCHECK_PARAM_PTR_RET(fp, NULL); DCHECK_TYPE_RET(fp, EWL_FILEPICKER_TYPE, NULL); - DRETURN_PTR(fp->view, DLEVEL_STABLE); + DRETURN_PTR(ewl_filelist_view_get(EWL_FILELIST(fp->file_list)), + DLEVEL_STABLE); } /** @@ -432,8 +405,8 @@ ewl_filepicker_multiselect_get(Ewl_Filepicker *fp) { DENTER_FUNCTION(DLEVEL_STABLE); - DCHECK_PARAM_PTR_RET(fp, 0); - DCHECK_TYPE_RET(fp, EWL_FILEPICKER_TYPE, 0); + DCHECK_PARAM_PTR_RET(fp, FALSE); + DCHECK_TYPE_RET(fp, EWL_FILEPICKER_TYPE, FALSE); DRETURN_INT(ewl_filelist_multiselect_get(EWL_FILELIST(fp->file_list)), DLEVEL_STABLE); @@ -467,8 +440,8 @@ ewl_filepicker_show_dot_files_get(Ewl_Filepicker *fp) { DENTER_FUNCTION(DLEVEL_STABLE); - DCHECK_PARAM_PTR_RET(fp, 0); - DCHECK_TYPE_RET(fp, EWL_FILEPICKER_TYPE, 0); + DCHECK_PARAM_PTR_RET(fp, FALSE); + DCHECK_TYPE_RET(fp, EWL_FILEPICKER_TYPE, FALSE); DRETURN_INT(ewl_filelist_show_dot_files_get(EWL_FILELIST(fp->file_list)), DLEVEL_STABLE); @@ -600,13 +573,26 @@ dir = strdup(ewl_filelist_directory_get(fl)); ewl_filepicker_path_populate(fp, dir); ewl_text_clear(EWL_TEXT(fp->file_entry)); - FREE(dir); } - else if (e->response == EWL_FILELIST_EVENT_SELECTION_CHANGE) + else if ((e->response == EWL_FILELIST_EVENT_SELECTION_CHANGE) && + (!fl->multiselect)) ewl_text_text_set(EWL_TEXT(fp->file_entry), ewl_filelist_selected_file_get(fl)); + else if (e->response == EWL_FILELIST_EVENT_MULTI_TRUE) + { + ewl_text_clear(EWL_TEXT(fp->file_entry)); + ewl_widget_disable(EWL_WIDGET(fp->file_entry)); + } + + else if (e->response == EWL_FILELIST_EVENT_MULTI_FALSE) + { + ewl_widget_enable(EWL_WIDGET(fp->file_entry)); + ewl_text_text_set(EWL_TEXT(fp->file_entry), + ewl_filelist_selected_file_get(fl)); + } + DLEAVE_FUNCTION(DLEVEL_STABLE); } @@ -674,7 +660,7 @@ Ewl_Filepicker *fp; DENTER_FUNCTION(DLEVEL_STABLE); - DCHECK_PARAM_PTR_RET(data, 0); + DCHECK_PARAM_PTR_RET(data, FALSE); fp = data; =================================================================== RCS file: /cvs/e/e17/libs/ewl/src/lib/ewl_filepicker.h,v retrieving revision 1.11 retrieving revision 1.12 diff -u -3 -r1.11 -r1.12 --- ewl_filepicker.h 11 Nov 2007 06:07:46 -0000 1.11 +++ ewl_filepicker.h 14 Nov 2007 20:07:59 -0000 1.12 @@ -3,7 +3,6 @@ #define EWL_FILEPICKER_H #include "ewl_box.h" -#include "ewl_view.h" /** * @addtogroup Ewl_Filepicker Ewl_Filepicker: Allows selecting files from a list @@ -59,7 +58,6 @@ Ecore_List *filters; /**< The type filters */ unsigned char show_favorites:1; /**< Show the favorite box */ - Ewl_View *view; /**< The filelist view to use */ }; Ewl_Widget *ewl_filepicker_new(void); @@ -94,8 +92,8 @@ unsigned int ewl_filepicker_show_favorites_get(Ewl_Filepicker *fp); void ewl_filepicker_list_view_set(Ewl_Filepicker *fp, - Ewl_View *view); -Ewl_View *ewl_filepicker_list_view_get(Ewl_Filepicker *fp); + Ewl_Filelist_View view); +Ewl_Filelist_View *ewl_filepicker_list_view_get(Ewl_Filepicker *fp); void ewl_filepicker_filter_add(Ewl_Filepicker *fp, const char *name, =================================================================== RCS file: /cvs/e/e17/libs/ewl/src/lib/ewl_tree2_view_freebox.c,v retrieving revision 1.2 retrieving revision 1.3 diff -u -3 -r1.2 -r1.3 --- ewl_tree2_view_freebox.c 12 Nov 2007 22:42:22 -0000 1.2 +++ ewl_tree2_view_freebox.c 14 Nov 2007 20:07:59 -0000 1.3 @@ -93,7 +93,7 @@ ewl_widget_inherit(EWL_WIDGET(tv), EWL_TREE2_VIEW_FREEBOX_TYPE); ewl_widget_show(tv->scroll); - tv->fbox = ewl_hfreebox_new(); + tv->fbox = ewl_vfreebox_new(); ewl_freebox_layout_type_set(EWL_FREEBOX(tv->fbox), EWL_FREEBOX_LAYOUT_AUTO); ewl_container_child_append(EWL_CONTAINER(tv->scroll), tv->fbox); |
From: Enlightenment C. <no...@cv...> - 2007-11-15 04:05:51
|
Enlightenment CVS committal Author : jethomas Project : e17 Module : libs/ewl Dir : e17/libs/ewl/src/bin/tests/io_manager Modified Files: ewl_io_manager.c Log Message: Fix tests as filedialog now returns full path to file =================================================================== RCS file: /cvs/e/e17/libs/ewl/src/bin/tests/io_manager/ewl_io_manager.c,v retrieving revision 1.6 retrieving revision 1.7 diff -u -3 -r1.6 -r1.7 --- ewl_io_manager.c 23 Aug 2007 05:26:45 -0000 1.6 +++ ewl_io_manager.c 15 Nov 2007 04:05:48 -0000 1.7 @@ -81,22 +81,21 @@ fd = EWL_FILEDIALOG(w); s = ewl_filedialog_selected_file_get(fd); - snprintf(path, sizeof(path), "%s/%s", - ewl_filedialog_directory_get(fd), s); - if (s) free(s); ewl_widget_destroy(w); scroll = ewl_widget_name_find("scroll"); ewl_container_reset(EWL_CONTAINER(scroll)); - t = ewl_io_manager_uri_read(path); + t = ewl_io_manager_uri_read(s); if (!t) { - printf("Unable to create widget from file (%s)\n", path); + printf("Unable to create widget from file (%s)\n", s); return; } ewl_container_child_append(EWL_CONTAINER(scroll), t); ewl_widget_show(t); + + free(s); } |
From: Enlightenment C. <no...@cv...> - 2007-11-15 04:06:27
|
Enlightenment CVS committal Author : jethomas Project : e17 Module : libs/ewl Dir : e17/libs/ewl/src/bin/tests/image Modified Files: ewl_image.c Log Message: Fix tests as filedialog now returns full path to file =================================================================== RCS file: /cvs/e/e17/libs/ewl/src/bin/tests/image/ewl_image.c,v retrieving revision 1.10 retrieving revision 1.11 diff -u -3 -r1.10 -r1.11 --- ewl_image.c 11 Nov 2007 08:03:39 -0000 1.10 +++ ewl_image.c 15 Nov 2007 04:05:48 -0000 1.11 @@ -343,32 +343,14 @@ e = ev; if (e->response == EWL_STOCK_OK) { - const char *path; char *filename; - char *file; - int l1; - int l2; - path = ewl_filedialog_directory_get (EWL_FILEDIALOG (w)); filename = ewl_filedialog_selected_file_get (EWL_FILEDIALOG (w)); - l1 = strlen (path); - l2 = strlen (filename); - - if (!path || (path[0] == '\0')) - file = strdup (filename); - else { - file = (char *)malloc (sizeof (char) * (l1 + l2 + 2)); - memcpy (file, path, l1); - file[l1] = '/'; - memcpy (file + l1 + 1, filename, l2); - file [l1 + l2 + 1] = '\0'; - } - - printf("File open from image test: %s\n", file); - if (file) { - ewl_text_text_set(EWL_TEXT(entry), file); + printf("File open from image test: %s\n", filename); + if (filename) { + ewl_text_text_set(EWL_TEXT(entry), filename); image_load(); - free (file); + free (filename); // free(path); FIXME: Is text widget allocated correctly? } } |
From: Enlightenment C. <no...@cv...> - 2007-11-17 00:01:57
|
Enlightenment CVS committal Author : jethomas Project : e17 Module : libs/ewl Dir : e17/libs/ewl/src/lib Modified Files: ewl_combo.c ewl_filelist.c ewl_filepicker.c ewl_filepicker.h Log Message: - Don't enter directory we don't have permission to read - Fix various memory leaks =================================================================== RCS file: /cvs/e/e17/libs/ewl/src/lib/ewl_combo.c,v retrieving revision 1.63 retrieving revision 1.64 diff -u -3 -r1.63 -r1.64 --- ewl_combo.c 12 Nov 2007 22:42:22 -0000 1.63 +++ ewl_combo.c 17 Nov 2007 00:01:55 -0000 1.64 @@ -353,6 +353,8 @@ item = view->fetch(model->fetch(mvc_data, idx->row, 0), idx->row, 0); } + + FREE(idx); } else if (view->header_fetch) =================================================================== RCS file: /cvs/e/e17/libs/ewl/src/lib/ewl_filelist.c,v retrieving revision 1.40 retrieving revision 1.41 diff -u -3 -r1.40 -r1.41 --- ewl_filelist.c 16 Nov 2007 18:50:57 -0000 1.40 +++ ewl_filelist.c 17 Nov 2007 00:01:55 -0000 1.41 @@ -258,8 +258,10 @@ if (dir == NULL) fl->directory = NULL; - else if ((!fl->directory) || (strcmp(dir, fl->directory))) + else if (((!fl->directory) || (strcmp(dir, fl->directory))) + && (ecore_file_can_read(dir))) { + IF_FREE(fl->directory); fl->directory = strdup(dir); data = ewl_mvc_data_get(EWL_MVC(fl->controller)); =================================================================== RCS file: /cvs/e/e17/libs/ewl/src/lib/ewl_filepicker.c,v retrieving revision 1.37 retrieving revision 1.38 diff -u -3 -r1.37 -r1.38 --- ewl_filepicker.c 14 Nov 2007 20:07:59 -0000 1.37 +++ ewl_filepicker.c 17 Nov 2007 00:01:55 -0000 1.38 @@ -81,8 +81,6 @@ ewl_filepicker_init(Ewl_Filepicker *fp) { Ewl_Widget *o, *box; - Ewl_Model *model; - Ewl_View *view; DENTER_FUNCTION(DLEVEL_STABLE); DCHECK_PARAM_PTR_RET(fp, FALSE); @@ -99,23 +97,27 @@ ewl_object_preferred_inner_size_set(EWL_OBJECT(fp), 400, 300); - model = ewl_model_ecore_list_get(); + fp->mvc_path.model = ewl_model_ecore_list_get(); - view = ewl_label_view_get(); + fp->mvc_path.view = ewl_label_view_get(); fp->path = ecore_list_new(); ecore_list_free_cb_set(fp->path, ECORE_FREE_CB(free)); - fp->path_combo = ewl_combo_new(); - ewl_container_child_append(EWL_CONTAINER(fp), fp->path_combo); - ewl_mvc_model_set(EWL_MVC(fp->path_combo), model); - ewl_mvc_view_set(EWL_MVC(fp->path_combo), view); - ewl_mvc_data_set(EWL_MVC(fp->path_combo), fp->path); - ewl_callback_append(fp->path_combo, EWL_CALLBACK_VALUE_CHANGED, - ewl_filepicker_cb_path_change, fp); - ewl_object_fill_policy_set(EWL_OBJECT(fp->path_combo), + fp->mvc_path.combo = ewl_combo_new(); + ewl_container_child_append(EWL_CONTAINER(fp), + fp->mvc_path.combo); + ewl_mvc_model_set(EWL_MVC(fp->mvc_path.combo), + fp->mvc_path.model); + ewl_mvc_view_set(EWL_MVC(fp->mvc_path.combo), + fp->mvc_path.view); + ewl_mvc_data_set(EWL_MVC(fp->mvc_path.combo), fp->path); + ewl_callback_append(fp->mvc_path.combo, + EWL_CALLBACK_VALUE_CHANGED, + ewl_filepicker_cb_path_change, fp); + ewl_object_fill_policy_set(EWL_OBJECT(fp->mvc_path.combo), EWL_FLAG_FILL_HFILL | EWL_FLAG_FILL_VSHRINK); - ewl_widget_show(fp->path_combo); + ewl_widget_show(fp->mvc_path.combo); o = ewl_hbox_new(); ewl_container_child_append(EWL_CONTAINER(fp), o); @@ -149,28 +151,36 @@ fp->filters = ecore_list_new(); ecore_list_free_cb_set(fp->filters, - ECORE_FREE_CB(ewl_filepicker_filter_free_cb)); + ECORE_FREE_CB(ewl_filepicker_filter_free_cb)); ewl_filepicker_filter_add(fp, "All files", NULL); - model = ewl_model_new(); - ewl_model_data_fetch_set(model, ewl_filepicker_cb_type_fetch); - ewl_model_data_count_set(model, ewl_filepicker_cb_type_count); - - view = ewl_view_clone(ewl_label_view_get()); - ewl_view_header_fetch_set(view, ewl_filepicker_cb_type_header); - - fp->type_combo = ewl_combo_new(); - ewl_mvc_model_set(EWL_MVC(fp->type_combo), model); - ewl_mvc_view_set(EWL_MVC(fp->type_combo), view); - ewl_mvc_data_set(EWL_MVC(fp->type_combo), fp); - ewl_mvc_selected_set(EWL_MVC(fp->type_combo), NULL, fp, 0, 0); - ewl_combo_editable_set(EWL_COMBO(fp->type_combo), TRUE); - ewl_callback_append(fp->type_combo, EWL_CALLBACK_VALUE_CHANGED, - ewl_filepicker_cb_type_change, fp); - ewl_container_child_append(EWL_CONTAINER(box), fp->type_combo); - ewl_object_fill_policy_set(EWL_OBJECT(fp->type_combo), + fp->mvc_filters.model = ewl_model_new(); + ewl_model_data_fetch_set(fp->mvc_filters.model, + ewl_filepicker_cb_type_fetch); + ewl_model_data_count_set(fp->mvc_filters.model, + ewl_filepicker_cb_type_count); + + fp->mvc_filters.view = ewl_label_view_get(); + ewl_view_header_fetch_set(fp->mvc_filters.view, + ewl_filepicker_cb_type_header); + + fp->mvc_filters.combo = ewl_combo_new(); + ewl_mvc_model_set(EWL_MVC(fp->mvc_filters.combo), + fp->mvc_filters.model); + ewl_mvc_view_set(EWL_MVC(fp->mvc_filters.combo), + fp->mvc_filters.view); + ewl_mvc_data_set(EWL_MVC(fp->mvc_filters.combo), fp); + ewl_mvc_selected_set(EWL_MVC(fp->mvc_filters.combo), + NULL, fp, 0, 0); + ewl_combo_editable_set(EWL_COMBO(fp->mvc_filters.combo), TRUE); + ewl_callback_append(fp->mvc_filters.combo, + EWL_CALLBACK_VALUE_CHANGED, + ewl_filepicker_cb_type_change, fp); + ewl_container_child_append(EWL_CONTAINER(box), + fp->mvc_filters.combo); + ewl_object_fill_policy_set(EWL_OBJECT(fp->mvc_filters.combo), EWL_FLAG_FILL_HFILL | EWL_FLAG_FILL_VSHRINK); - ewl_widget_show(fp->type_combo); + ewl_widget_show(fp->mvc_filters.combo); box = ewl_vbox_new(); ewl_container_child_append(EWL_CONTAINER(o), box); @@ -565,7 +575,6 @@ fp = data; e = ev; - /* XXX need to correctly deal with multiselect files in here */ if (e->response == EWL_FILELIST_EVENT_DIR_CHANGE) { char *dir; @@ -577,8 +586,11 @@ } else if ((e->response == EWL_FILELIST_EVENT_SELECTION_CHANGE) && (!fl->multiselect)) + { + ewl_text_clear(EWL_TEXT(fp->file_entry)); ewl_text_text_set(EWL_TEXT(fp->file_entry), ewl_filelist_selected_file_get(fl)); + } else if (e->response == EWL_FILELIST_EVENT_MULTI_TRUE) { @@ -701,7 +713,10 @@ DCHECK_PARAM_PTR(path); DCHECK_TYPE(fp, EWL_FILEPICKER_TYPE); - ecore_list_clear(fp->path); + /* Clear the list and free the data first */ + while ((p = ecore_list_first_remove(fp->path))) + FREE(p); + ecore_list_append(fp->path, strdup("/")); p = path; @@ -718,7 +733,7 @@ if (p && (*(p + 1) != '\0')) ecore_list_prepend(fp->path, strdup(path)); - ewl_mvc_dirty_set(EWL_MVC(fp->path_combo), TRUE); + ewl_mvc_dirty_set(EWL_MVC(fp->mvc_path.combo), TRUE); DLEAVE_FUNCTION(DLEVEL_STABLE); } @@ -789,9 +804,7 @@ ewl_filepicker_cb_destroy(Ewl_Widget *w, void *ev __UNUSED__, void *data __UNUSED__) { - char *file; Ewl_Filepicker *fp; - Ewl_Filepicker_Filter *filter; DENTER_FUNCTION(DLEVEL_STABLE); DCHECK_PARAM_PTR(w); @@ -799,16 +812,10 @@ fp = EWL_FILEPICKER(w); - while ((file = ecore_list_first_remove(fp->path))) - FREE(file); - - while ((filter = ecore_list_first_remove(fp->filters))) - { - FREE(filter->name); - IF_FREE(filter->filter); - FREE(filter); - } - + IF_FREE(fp->mvc_path.model); + IF_FREE(fp->mvc_path.view); + IF_FREE(fp->mvc_filters.model); + IF_FREE(fp->mvc_filters.view); IF_FREE_LIST(fp->path); IF_FREE_LIST(fp->filters); =================================================================== RCS file: /cvs/e/e17/libs/ewl/src/lib/ewl_filepicker.h,v retrieving revision 1.12 retrieving revision 1.13 diff -u -3 -r1.12 -r1.13 --- ewl_filepicker.h 14 Nov 2007 20:07:59 -0000 1.12 +++ ewl_filepicker.h 17 Nov 2007 00:01:55 -0000 1.13 @@ -3,6 +3,8 @@ #define EWL_FILEPICKER_H #include "ewl_box.h" +#include "ewl_view.h" +#include "ewl_model.h" /** * @addtogroup Ewl_Filepicker Ewl_Filepicker: Allows selecting files from a list @@ -56,6 +58,13 @@ Ecore_List *path; /**< The path components */ Ecore_List *filters; /**< The type filters */ + + struct + { + Ewl_Model *model; + Ewl_View *view; + Ewl_Widget *combo; + } mvc_filters, mvc_path; unsigned char show_favorites:1; /**< Show the favorite box */ }; |
From: Enlightenment C. <no...@cv...> - 2007-11-17 16:57:58
|
Enlightenment CVS committal Author : jethomas Project : e17 Module : libs/ewl Dir : e17/libs/ewl/src/lib Modified Files: ewl_filepicker.c Log Message: Fix more memory leaks =================================================================== RCS file: /cvs/e/e17/libs/ewl/src/lib/ewl_filepicker.c,v retrieving revision 1.38 retrieving revision 1.39 diff -u -3 -r1.38 -r1.39 --- ewl_filepicker.c 17 Nov 2007 00:01:55 -0000 1.38 +++ ewl_filepicker.c 17 Nov 2007 16:57:56 -0000 1.39 @@ -566,6 +566,7 @@ Ewl_Filepicker *fp; Ewl_Filelist *fl; Ewl_Event_Action_Response *e; + char *file; DENTER_FUNCTION(DLEVEL_STABLE); DCHECK_PARAM_PTR(w); @@ -575,35 +576,32 @@ fp = data; e = ev; + /* clear the text and get the selected file */ + ewl_text_clear(EWL_TEXT(fp->file_entry)); + file = ewl_filelist_selected_file_get(fl); + if (e->response == EWL_FILELIST_EVENT_DIR_CHANGE) { char *dir; dir = strdup(ewl_filelist_directory_get(fl)); ewl_filepicker_path_populate(fp, dir); - ewl_text_clear(EWL_TEXT(fp->file_entry)); FREE(dir); } else if ((e->response == EWL_FILELIST_EVENT_SELECTION_CHANGE) && (!fl->multiselect)) - { - ewl_text_clear(EWL_TEXT(fp->file_entry)); - ewl_text_text_set(EWL_TEXT(fp->file_entry), - ewl_filelist_selected_file_get(fl)); - } + ewl_text_text_set(EWL_TEXT(fp->file_entry), file); else if (e->response == EWL_FILELIST_EVENT_MULTI_TRUE) - { - ewl_text_clear(EWL_TEXT(fp->file_entry)); ewl_widget_disable(EWL_WIDGET(fp->file_entry)); - } else if (e->response == EWL_FILELIST_EVENT_MULTI_FALSE) { ewl_widget_enable(EWL_WIDGET(fp->file_entry)); - ewl_text_text_set(EWL_TEXT(fp->file_entry), - ewl_filelist_selected_file_get(fl)); + ewl_text_text_set(EWL_TEXT(fp->file_entry), file); } + + FREE(file); DLEAVE_FUNCTION(DLEVEL_STABLE); } |
From: Enlightenment C. <no...@cv...> - 2007-11-17 16:58:28
|
Enlightenment CVS committal Author : jethomas Project : e17 Module : libs/ewl Dir : e17/libs/ewl/src/bin/tests/filepicker Modified Files: ewl_filepicker.c Log Message: Fix more memory leaks =================================================================== RCS file: /cvs/e/e17/libs/ewl/src/bin/tests/filepicker/ewl_filepicker.c,v retrieving revision 1.10 retrieving revision 1.11 diff -u -3 -r1.10 -r1.11 --- ewl_filepicker.c 14 Nov 2007 20:07:58 -0000 1.10 +++ ewl_filepicker.c 17 Nov 2007 16:57:56 -0000 1.11 @@ -4,6 +4,7 @@ #include "ewl_filepicker.h" #include <stdio.h> +#include <stdlib.h> #include <string.h> /** @@ -130,7 +131,10 @@ if (!file) printf("No file selected.\n"); else + { printf("%s\n", file); + free(file); + } break; } default: |
From: Enlightenment C. <no...@cv...> - 2007-11-17 16:58:30
|
Enlightenment CVS committal Author : jethomas Project : e17 Module : libs/ewl Dir : e17/libs/ewl/src/bin/tests/filedialog Modified Files: ewl_filedialog.c Log Message: Fix more memory leaks =================================================================== RCS file: /cvs/e/e17/libs/ewl/src/bin/tests/filedialog/ewl_filedialog.c,v retrieving revision 1.6 retrieving revision 1.7 diff -u -3 -r1.6 -r1.7 --- ewl_filedialog.c 23 Aug 2007 05:26:44 -0000 1.6 +++ ewl_filedialog.c 17 Nov 2007 16:57:56 -0000 1.7 @@ -5,6 +5,7 @@ #include "ewl_filedialog.h" #include "ewl_label.h" #include <stdio.h> +#include <stdlib.h> static int create_test(Ewl_Container *box); static void dialog_cb_single_clicked(Ewl_Widget *w, void *ev, void *data); @@ -117,15 +118,12 @@ } fd = EWL_FILEDIALOG(w); - if (ewl_filedialog_multiselect_get(fd)) - { - Ecore_List *l; - l = ewl_filedialog_selected_files_get(fd); - ecore_list_for_each(l, fd_append, list); - } - else - fd_append(ewl_filedialog_selected_file_get(fd), list); + Ecore_List *l; + l = ewl_filedialog_selected_files_get(fd); + ecore_list_free_cb_set(l, ECORE_FREE_CB(free)); + ecore_list_for_each(l, fd_append, list); + ecore_list_destroy(l); ewl_widget_destroy(w); } |
From: Enlightenment C. <no...@cv...> - 2007-11-18 21:43:38
|
Enlightenment CVS committal Author : jethomas Project : e17 Module : libs/ewl Dir : e17/libs/ewl/src/lib Modified Files: ewl_filelist_view.c Log Message: Make the filelist icons a bit less cramped. =================================================================== RCS file: /cvs/e/e17/libs/ewl/src/lib/ewl_filelist_view.c,v retrieving revision 1.1 retrieving revision 1.2 diff -u -3 -r1.1 -r1.2 --- ewl_filelist_view.c 14 Nov 2007 20:07:59 -0000 1.1 +++ ewl_filelist_view.c 18 Nov 2007 21:43:35 -0000 1.2 @@ -20,6 +20,7 @@ /* Create icon */ ret = ewl_icon_simple_new(); + ewl_icon_constrain_set(EWL_ICON(ret), 32); ewl_box_orientation_set(EWL_BOX(ret), EWL_ORIENTATION_HORIZONTAL); ewl_object_alignment_set(EWL_OBJECT(ret), EWL_FLAG_ALIGN_LEFT); |
From: Enlightenment C. <no...@cv...> - 2007-11-27 21:35:24
|
Enlightenment CVS committal Author : jethomas Project : e17 Module : libs/ewl Dir : e17/libs/ewl/src/bin/tests/media Modified Files: ewl_media.c Log Message: Unbreak the test =================================================================== RCS file: /cvs/e/e17/libs/ewl/src/bin/tests/media/ewl_media.c,v retrieving revision 1.8 retrieving revision 1.9 diff -u -3 -r1.8 -r1.9 --- ewl_media.c 14 Nov 2007 21:15:00 -0000 1.8 +++ ewl_media.c 27 Nov 2007 21:35:21 -0000 1.9 @@ -196,14 +196,9 @@ { int len; char *file = NULL; - char buf[PATH_MAX]; file = ewl_filedialog_selected_file_get(EWL_FILEDIALOG(w)); - snprintf(buf, PATH_MAX, "%s/%s", - ewl_filedialog_directory_get(EWL_FILEDIALOG(w)), - file); - - ewl_media_media_set(EWL_MEDIA(video), buf); + ewl_media_media_set(EWL_MEDIA(video), file); if (file) free(file); len = ewl_media_length_get(EWL_MEDIA(video)); |
From: Enlightenment C. <no...@cv...> - 2007-11-29 03:50:57
|
Enlightenment CVS committal Author : jethomas Project : e17 Module : libs/ewl Dir : e17/libs/ewl/src/lib Modified Files: ewl_colorpicker.c ewl_filelist_model.h ewl_grid.h ewl_tree2_view_freebox.h ewl_tree2_view_scrolled.h Log Message: Fix a bunch of typos =================================================================== RCS file: /cvs/e/e17/libs/ewl/src/lib/ewl_colorpicker.c,v retrieving revision 1.43 retrieving revision 1.44 diff -u -3 -r1.43 -r1.44 --- ewl_colorpicker.c 14 Nov 2007 21:15:00 -0000 1.43 +++ ewl_colorpicker.c 29 Nov 2007 03:50:44 -0000 1.44 @@ -110,12 +110,12 @@ Ewl_Color_Mode mode; int max; } modes[] = { - {"h", EWL_COLOR_MODE_HSV_HUE, 360}, - {"s", EWL_COLOR_MODE_HSV_SATURATION, 100}, - {"v", EWL_COLOR_MODE_HSV_VALUE, 100}, - {"r", EWL_COLOR_MODE_RGB_RED, 255}, - {"g", EWL_COLOR_MODE_RGB_GREEN, 255}, - {"b", EWL_COLOR_MODE_RGB_BLUE, 255}, + {"H", EWL_COLOR_MODE_HSV_HUE, 360}, + {"S", EWL_COLOR_MODE_HSV_SATURATION, 100}, + {"V", EWL_COLOR_MODE_HSV_VALUE, 100}, + {"R", EWL_COLOR_MODE_RGB_RED, 255}, + {"G", EWL_COLOR_MODE_RGB_GREEN, 255}, + {"B", EWL_COLOR_MODE_RGB_BLUE, 255}, {NULL, EWL_COLOR_MODE_RGB_RED, 0} }; const char *types[] = { "application/x-color", NULL }; =================================================================== RCS file: /cvs/e/e17/libs/ewl/src/lib/ewl_filelist_model.h,v retrieving revision 1.4 retrieving revision 1.5 diff -u -3 -r1.4 -r1.5 --- ewl_filelist_model.h 12 Nov 2007 03:18:56 -0000 1.4 +++ ewl_filelist_model.h 29 Nov 2007 03:50:44 -0000 1.5 @@ -2,7 +2,7 @@ #define EWL_FILELIST_MODEL_H /** - * @addtogroup Ewl_Filelist_Model Ewl_Filelist_Model The model for the filelist + * @addtogroup Ewl_Filelist_Model: Ewl_Filelist_Model The model for the filelist * @brief A model for the filelist * * @{ =================================================================== RCS file: /cvs/e/e17/libs/ewl/src/lib/ewl_grid.h,v retrieving revision 1.30 retrieving revision 1.31 diff -u -3 -r1.30 -r1.31 --- ewl_grid.h 11 Nov 2007 06:07:46 -0000 1.30 +++ ewl_grid.h 29 Nov 2007 03:50:44 -0000 1.31 @@ -3,7 +3,7 @@ #define EWL_GRID_H /** - * @addtogroup Ewl_Grid Ewl_Grid The ewl grid widget + * @addtogroup Ewl_Grid: Ewl_Grid The ewl grid widget * @brief The Ewl Grid widget * * @remarks Inherits from Ewl_Container. =================================================================== RCS file: /cvs/e/e17/libs/ewl/src/lib/ewl_tree2_view_freebox.h,v retrieving revision 1.3 retrieving revision 1.4 diff -u -3 -r1.3 -r1.4 --- ewl_tree2_view_freebox.h 11 Nov 2007 06:07:46 -0000 1.3 +++ ewl_tree2_view_freebox.h 29 Nov 2007 03:50:44 -0000 1.4 @@ -5,7 +5,7 @@ #include "ewl_tree2_view.h" /** - * @addtogroup Ewl_Tree2_View_Freebox Ewl_Tree2_View_Freebox The freebox tree view + * @addtogroup Ewl_Tree2_View_Freebox: Ewl_Tree2_View_Freebox The freebox tree view * @brief A freebox view for the tree * @remarks Inherits from Ewl_Tree2_View * =================================================================== RCS file: /cvs/e/e17/libs/ewl/src/lib/ewl_tree2_view_scrolled.h,v retrieving revision 1.9 retrieving revision 1.10 diff -u -3 -r1.9 -r1.10 --- ewl_tree2_view_scrolled.h 11 Nov 2007 06:07:46 -0000 1.9 +++ ewl_tree2_view_scrolled.h 29 Nov 2007 03:50:44 -0000 1.10 @@ -5,7 +5,7 @@ #include "ewl_tree2_view.h" /** - * @addtogroup Ewl_Tree2_View_Scrolled Ewl_Tree2_View_Scrolled The scrolled tree view + * @addtogroup Ewl_Tree2_View_Scrolled: Ewl_Tree2_View_Scrolled The scrolled tree view * @brief A scrolled view for the tree * * @remarks Inherits from Ewl_Box. |
From: Enlightenment C. <no...@cv...> - 2007-11-29 03:51:20
|
Enlightenment CVS committal Author : jethomas Project : e17 Module : libs/ewl Dir : e17/libs/ewl/src/bin/tests/engine Modified Files: ewl_engine.c Log Message: Fix a bunch of typos =================================================================== RCS file: /cvs/e/e17/libs/ewl/src/bin/tests/engine/ewl_engine.c,v retrieving revision 1.9 retrieving revision 1.10 diff -u -3 -r1.9 -r1.10 --- ewl_engine.c 23 Aug 2007 05:26:44 -0000 1.9 +++ ewl_engine.c 29 Nov 2007 03:50:43 -0000 1.10 @@ -61,7 +61,7 @@ o = ewl_entry_new(); ewl_text_text_set(EWL_TEXT(o), "The image below is copied from an\n" "evas buffer engine, and reacts because of events\n" - "fed to it from the image widget"); + "fed to it from the image widget."); ewl_entry_editable_set(EWL_ENTRY(o), FALSE); ewl_object_fill_policy_set(EWL_OBJECT(o), EWL_FLAG_FILL_HFILL); ewl_container_child_append(EWL_CONTAINER(box), o); |
From: Enlightenment C. <no...@cv...> - 2007-11-29 03:51:20
|
Enlightenment CVS committal Author : jethomas Project : e17 Module : libs/ewl Dir : e17/libs/ewl/src/bin/tests/border Modified Files: ewl_border.c Log Message: Fix a bunch of typos =================================================================== RCS file: /cvs/e/e17/libs/ewl/src/bin/tests/border/ewl_border.c,v retrieving revision 1.7 retrieving revision 1.8 diff -u -3 -r1.7 -r1.8 --- ewl_border.c 14 Nov 2007 21:15:00 -0000 1.7 +++ ewl_border.c 29 Nov 2007 03:50:42 -0000 1.8 @@ -36,7 +36,7 @@ Ewl_Widget *button_check; border = ewl_border_new(); - ewl_border_label_set(EWL_BORDER(border), "box title"); + ewl_border_label_set(EWL_BORDER(border), "Box Title"); ewl_container_child_append(EWL_CONTAINER(box), border); ewl_widget_show(border); |
From: Enlightenment C. <no...@cv...> - 2007-11-29 03:51:20
|
Enlightenment CVS committal Author : jethomas Project : e17 Module : libs/ewl Dir : e17/libs/ewl/src/bin/tests/dialog Modified Files: ewl_dialog.c Log Message: Fix a bunch of typos =================================================================== RCS file: /cvs/e/e17/libs/ewl/src/bin/tests/dialog/ewl_dialog.c,v retrieving revision 1.8 retrieving revision 1.9 diff -u -3 -r1.8 -r1.9 --- ewl_dialog.c 14 Nov 2007 20:02:58 -0000 1.8 +++ ewl_dialog.c 29 Nov 2007 03:50:42 -0000 1.9 @@ -77,7 +77,7 @@ ewl_widget_show(o); o = ewl_button_new(); - ewl_button_label_set(EWL_BUTTON(o), "Lanuch Dialog"); + ewl_button_label_set(EWL_BUTTON(o), "Launch Dialog"); ewl_callback_append(o, EWL_CALLBACK_CLICKED, run_dialog, chain); ewl_container_child_append(box, o); ewl_widget_show(o); |
From: Enlightenment C. <no...@cv...> - 2007-11-29 03:51:21
|
Enlightenment CVS committal Author : jethomas Project : e17 Module : libs/ewl Dir : e17/libs/ewl/src/bin/tests/layer Modified Files: ewl_layer.c Log Message: Fix a bunch of typos =================================================================== RCS file: /cvs/e/e17/libs/ewl/src/bin/tests/layer/ewl_layer.c,v retrieving revision 1.5 retrieving revision 1.6 diff -u -3 -r1.5 -r1.6 --- ewl_layer.c 23 Aug 2007 05:26:46 -0000 1.5 +++ ewl_layer.c 29 Nov 2007 03:50:43 -0000 1.6 @@ -53,7 +53,7 @@ */ for (i = 0; i < 20; i++) { w = ewl_button_new(); - ewl_button_label_set(EWL_BUTTON(w), "hide"); + ewl_button_label_set(EWL_BUTTON(w), "Hide"); ewl_container_child_append(EWL_CONTAINER(c), w); ewl_widget_layer_priority_set(w, i - 10); ewl_object_fill_policy_set(EWL_OBJECT(w), EWL_FLAG_FILL_NONE); @@ -69,7 +69,7 @@ */ for (i = 0; i < 20; i++) { w = ewl_button_new(); - ewl_button_label_set(EWL_BUTTON(w), "show"); + ewl_button_label_set(EWL_BUTTON(w), "Show"); ewl_container_child_append(EWL_CONTAINER(c), w); ewl_widget_layer_priority_set(w, 10 - i); ewl_object_fill_policy_set(EWL_OBJECT(w), EWL_FLAG_FILL_NONE); @@ -84,7 +84,7 @@ * the dynamicly layered button */ w = ewl_button_new(); - ewl_button_label_set(EWL_BUTTON(w), "up/down"); + ewl_button_label_set(EWL_BUTTON(w), "Up/Down"); ewl_container_child_append(EWL_CONTAINER(c), w); ewl_widget_layer_priority_set(w, 3); ewl_object_fill_policy_set(EWL_OBJECT(w), EWL_FLAG_FILL_NONE); @@ -97,7 +97,7 @@ * the disabled button */ w = ewl_button_new(); - ewl_button_label_set(EWL_BUTTON(w), "disabled"); + ewl_button_label_set(EWL_BUTTON(w), "Disabled"); ewl_widget_layer_priority_set(w, 2); ewl_container_child_append(EWL_CONTAINER(c), w); ewl_object_fill_policy_set(EWL_OBJECT(w), EWL_FLAG_FILL_NONE); |
From: Enlightenment C. <no...@cv...> - 2007-11-29 03:51:21
|
Enlightenment CVS committal Author : jethomas Project : e17 Module : libs/ewl Dir : e17/libs/ewl/src/bin/tests/modal Modified Files: ewl_modal.c Log Message: Fix a bunch of typos =================================================================== RCS file: /cvs/e/e17/libs/ewl/src/bin/tests/modal/ewl_modal.c,v retrieving revision 1.5 retrieving revision 1.6 diff -u -3 -r1.5 -r1.6 --- ewl_modal.c 23 Aug 2007 05:26:46 -0000 1.5 +++ ewl_modal.c 29 Nov 2007 03:50:43 -0000 1.6 @@ -32,7 +32,7 @@ ewl_widget_show(vbox); o = ewl_button_new(); - ewl_button_label_set(EWL_BUTTON(o), "launch modal window"); + ewl_button_label_set(EWL_BUTTON(o), "Launch modal window"); ewl_container_child_append(EWL_CONTAINER(vbox), o); ewl_callback_append(o, EWL_CALLBACK_CLICKED, ewl_widget_cb_click, NULL); ewl_widget_show(o); @@ -59,7 +59,7 @@ ewl_widget_show(vbox); o = ewl_button_new(); - ewl_button_label_set(EWL_BUTTON(o), "go modal"); + ewl_button_label_set(EWL_BUTTON(o), "Go modal"); ewl_callback_append(o, EWL_CALLBACK_CLICKED, ewl_widget_cb_go_modal, emb); ewl_container_child_append(EWL_CONTAINER(vbox), o); |
From: Enlightenment C. <no...@cv...> - 2007-11-29 03:51:22
|
Enlightenment CVS committal Author : jethomas Project : e17 Module : libs/ewl Dir : e17/libs/ewl/src/bin/tests/table Modified Files: ewl_table.c Log Message: Fix a bunch of typos =================================================================== RCS file: /cvs/e/e17/libs/ewl/src/bin/tests/table/ewl_table.c,v retrieving revision 1.4 retrieving revision 1.5 diff -u -3 -r1.4 -r1.5 --- ewl_table.c 23 Aug 2007 05:26:48 -0000 1.4 +++ ewl_table.c 29 Nov 2007 03:50:43 -0000 1.5 @@ -23,7 +23,7 @@ create_test(Ewl_Container *box) { Ewl_Widget *table, *button[10]; - char *headers[] = { "one", "two", "three", "four" }; + char *headers[] = { "One", "Two", "Three", "Four" }; table = ewl_table_new(4, 5, headers); ewl_container_child_append(box, table); |
From: Enlightenment C. <no...@cv...> - 2007-11-29 03:51:22
|
Enlightenment CVS committal Author : jethomas Project : e17 Module : libs/ewl Dir : e17/libs/ewl/src/bin/tests/grid Modified Files: ewl_grid.c Log Message: Fix a bunch of typos =================================================================== RCS file: /cvs/e/e17/libs/ewl/src/bin/tests/grid/ewl_grid.c,v retrieving revision 1.4 retrieving revision 1.5 diff -u -3 -r1.4 -r1.5 --- ewl_grid.c 23 Aug 2007 05:26:45 -0000 1.4 +++ ewl_grid.c 29 Nov 2007 03:50:43 -0000 1.5 @@ -63,13 +63,13 @@ /* fill the hbox with content */ w = ewl_button_new(); - ewl_button_label_set(EWL_BUTTON(w), "append"); + ewl_button_label_set(EWL_BUTTON(w), "Append"); ewl_container_child_append(EWL_CONTAINER(hbox), w); ewl_callback_append(w, EWL_CALLBACK_CLICKED, child_append_cb, grid); ewl_widget_show(w); w = ewl_button_new(); - ewl_button_label_set(EWL_BUTTON(w), "prepend"); + ewl_button_label_set(EWL_BUTTON(w), "Prepend"); ewl_container_child_prepend(EWL_CONTAINER(hbox), w); ewl_callback_append(w, EWL_CALLBACK_CLICKED, child_prepend_cb, grid); ewl_widget_show(w); @@ -85,7 +85,7 @@ ewl_widget_show(w); w = ewl_button_new(); - ewl_button_label_set(EWL_BUTTON(w), "This row is 50px heigh"); + ewl_button_label_set(EWL_BUTTON(w), "This row is 50px height"); ewl_container_child_append(EWL_CONTAINER(grid), w); ewl_grid_child_position_set(EWL_GRID(grid), w, 1, 2, 3, 3); ewl_callback_append(w, EWL_CALLBACK_CLICKED, button_clicked_cb, NULL); @@ -93,7 +93,7 @@ w = ewl_entry_new(); ewl_text_text_set(EWL_TEXT(w), "This row use the\n" - "preferred heigth"); + "preferred height"); ewl_container_child_append(EWL_CONTAINER(grid), w); ewl_grid_child_position_set(EWL_GRID(grid), w, 3, 4, 2, 2); ewl_widget_show(w); @@ -107,7 +107,7 @@ Ewl_Widget *button; button = ewl_button_new(); - ewl_button_label_set(EWL_BUTTON(button), "append"); + ewl_button_label_set(EWL_BUTTON(button), "Append"); ewl_container_child_append(EWL_CONTAINER(d), button); ewl_callback_append(button, EWL_CALLBACK_CLICKED, button_clicked_cb, NULL); @@ -120,7 +120,7 @@ Ewl_Widget *button; button = ewl_button_new(); - ewl_button_label_set(EWL_BUTTON(button), "prepend"); + ewl_button_label_set(EWL_BUTTON(button), "Prepend"); ewl_container_child_prepend(EWL_CONTAINER(d), button); ewl_callback_append(button, EWL_CALLBACK_CLICKED, button_clicked_cb, NULL); |
From: Enlightenment C. <no...@cv...> - 2007-11-29 03:51:22
|
Enlightenment CVS committal Author : jethomas Project : e17 Module : libs/ewl Dir : e17/libs/ewl/src/bin Modified Files: main.c Log Message: Fix a bunch of typos =================================================================== RCS file: /cvs/e/e17/libs/ewl/src/bin/main.c,v retrieving revision 1.86 retrieving revision 1.87 diff -u -3 -r1.86 -r1.87 --- main.c 17 Nov 2007 13:00:31 -0000 1.86 +++ main.c 29 Nov 2007 03:50:42 -0000 1.87 @@ -410,7 +410,7 @@ char info[1024]; stat = ewl_widget_name_find("statusbar"); - snprintf(info, sizeof(info), "%s Information/Tests\n", text); + snprintf(info, sizeof(info), "%s Information/Tests", text); ewl_statusbar_push(EWL_STATUSBAR(stat), info); } |
From: Enlightenment C. <no...@cv...> - 2007-11-29 03:51:22
|
Enlightenment CVS committal Author : jethomas Project : e17 Module : libs/ewl Dir : e17/libs/ewl/src/bin/tests/widget Modified Files: ewl_widget.c Log Message: Fix a bunch of typos =================================================================== RCS file: /cvs/e/e17/libs/ewl/src/bin/tests/widget/ewl_widget.c,v retrieving revision 1.17 retrieving revision 1.18 diff -u -3 -r1.17 -r1.18 --- ewl_widget.c 11 Nov 2007 18:11:09 -0000 1.17 +++ ewl_widget.c 29 Nov 2007 03:50:43 -0000 1.18 @@ -203,14 +203,14 @@ ewl_widget_show(b2); o = ewl_button_new(); - ewl_button_label_set(EWL_BUTTON(o), "first button"); + ewl_button_label_set(EWL_BUTTON(o), "First button"); ewl_widget_name_set(o, "first_widget"); ewl_container_child_append(EWL_CONTAINER(b2), o); ewl_callback_append(o, EWL_CALLBACK_CLICKED, ewl_widget_cb_first_click, NULL); ewl_widget_show(o); o = ewl_button_new(); - ewl_button_label_set(EWL_BUTTON(o), "second button"); + ewl_button_label_set(EWL_BUTTON(o), "Second button"); ewl_widget_name_set(o, "second_widget"); ewl_container_child_append(EWL_CONTAINER(b2), o); ewl_callback_append(o, EWL_CALLBACK_CLICKED, ewl_widget_cb_second_click, NULL); @@ -266,14 +266,14 @@ ewl_widget_cb_first_click(Ewl_Widget *w __UNUSED__, void *ev __UNUSED__, void *data __UNUSED__) { - printf("first clicked\n"); + printf("First clicked\n"); } static void ewl_widget_cb_second_click(Ewl_Widget *w __UNUSED__, void *ev __UNUSED__, void *data __UNUSED__) { - printf("second clicked\n"); + printf("Second clicked\n"); } static void |