Enlightenment CVS committal Author : essiene Project : e17 Module : proto
Dir : e17/proto/entrance_edit_gui/src/gui Modified Files: Egui.h background.c egui_graphics_dialog.c egui_graphics_dialog.h theme.c Log Message: Killed some more todo items. Moving towards general consumption. - We can now list (and select) backgrounds from multiple locations, currently: - PREFIX/share/enlightenment/data/backgrounds/ - ~/.e/e/backgrounds I'm thinking there should be another entrance specific location, so you can still have a list if you're not using E. Probably: ~/.entrance/backgrounds ? thoughts? - Cleaned up egui_graphics_dialog subsystem. - TODO -- =================================================================== RCS file: /cvs/e/e17/proto/entrance_edit_gui/src/gui/Egui.h,v retrieving revision 1.14 retrieving revision 1.15 diff -u -3 -r1.14 -r1.15 --- Egui.h 6 Nov 2006 09:56:18 -0000 1.14 +++ Egui.h 6 Nov 2006 15:14:24 -0000 1.15 @@ -1,5 +1,6 @@ #ifndef _EGUI_H #define _EGUI_H +#include "../config.h" #include "egui_graphics_dialog.h" #define EGUI_TYPE_BUTTON 0 =================================================================== RCS file: /cvs/e/e17/proto/entrance_edit_gui/src/gui/background.c,v retrieving revision 1.12 retrieving revision 1.13 diff -u -3 -r1.12 -r1.13 --- background.c 29 Sep 2006 02:36:38 -0000 1.12 +++ background.c 6 Nov 2006 15:14:24 -0000 1.13 @@ -9,9 +9,25 @@ void egui_background_dialog_show(void* data) { + Ecore_List *bg_paths = ecore_list_new(); + char e_bg_path[PATH_MAX]; + + char* home_dir = getenv("HOME"); + if(home_dir != NULL) + { + snprintf(e_bg_path, PATH_MAX, "%s/.e/e/backgrounds", home_dir); + ecore_list_append(bg_paths, e_bg_path); + } + + /*TODO: do not add this yet, the preview is still wrong, it should eventually show + * currently choosen bg/theme on presently configured theme/bg*/ + /*ecore_list_append(bg_paths, PREFIX "/share/entrance/themes");*/ + Egui_Graphics_Dialog_Settings background_settings = { "background", - "/usr/share/enlightenment/data/backgrounds", + /*this is an artifact that will have to go, once ew_*list can handle selected first member automagically*/ + PREFIX "/share/enlightenment/data/backgrounds", + bg_paths, "e/desktop/background", "Entrance Configuration - Background", "Backgrounds", =================================================================== RCS file: /cvs/e/e17/proto/entrance_edit_gui/src/gui/egui_graphics_dialog.c,v retrieving revision 1.3 retrieving revision 1.4 diff -u -3 -r1.3 -r1.4 --- egui_graphics_dialog.c 6 Nov 2006 09:56:18 -0000 1.3 +++ egui_graphics_dialog.c 6 Nov 2006 15:14:24 -0000 1.4 @@ -19,11 +19,14 @@ static void _gd_cb_close(void *, void *); static void _gd_cb_browse(void*, void*); +static void _cb_dirs(void *list_data, void *data); + static char* _gd_get_path(Egui_Graphics_Dialog, const char *); static void _gd_close(void*); static int _gd_apply(void*); static char* _gd_populate_list(Egui_Graphics_Dialog); static void _gd_load_preview(Egui_Graphics_Dialog, const char *); +static char* _gd_process_dir(Egui_Graphics_Dialog, char *dir); static Egui_Graphics_Dialog _egui_gd_create_widgets(Egui_Graphics_Dialog egd); @@ -99,8 +102,6 @@ if(!egd) return; - printf("egd->win = %s\n", egd->win); - if(egd->win == NULL) egd = _egui_gd_create_widgets(egd); @@ -175,13 +176,14 @@ return 0; } - if(egd->egds.use_full_path) + + /*if(egd->egds.use_full_path) { char *full_path = _gd_get_path(egd, graphic); entrance_edit_string_set(egd->egds.entrance_edit_key, full_path); free(full_path); } - else + else */ entrance_edit_string_set(egd->egds.entrance_edit_key, graphic); if(!entrance_edit_save()) @@ -202,13 +204,20 @@ return; ew_dialog_destroy(egd->win); egd->win = NULL; - printf("egd->win has been set to null\n"); } static char* -_gd_populate_list(Egui_Graphics_Dialog egd) +_gd_process_dir(Egui_Graphics_Dialog egd, char *dir) { - Ecore_List *glist = ecore_file_ls(egd->egds.files_path); + char full_path[PATH_MAX]; + + if(dir == NULL) + return; + + if(egd == NULL) + return; + + Ecore_List *glist = ecore_file_ls(dir); char* first; if(glist && !ecore_list_is_empty(glist)) @@ -218,26 +227,70 @@ char* graphic; first = strdup(ecore_list_first(glist)); + while((graphic = ecore_list_next(glist))) { char *graphic_no_ext = ecore_file_strip_ext(graphic); - ew_textlist_add(egd->list_thumbs, graphic_no_ext, graphic, strlen(graphic) + 1, _gd_cb_selected, egd); + if(egd->egds.use_full_path) + snprintf(full_path, PATH_MAX, "%s/%s", dir, graphic); + else + snprintf(full_path, PATH_MAX, "%s", graphic); + + ew_textlist_add(egd->list_thumbs, graphic_no_ext, full_path, strlen(full_path) + 1, _gd_cb_selected, egd); free(graphic_no_ext); } ecore_list_destroy(glist); } + char *res = calloc(sizeof(char), PATH_MAX); + if (egd->egds.use_full_path) + snprintf(res, PATH_MAX, "%s/%s", dir, first); + else + snprintf(res, PATH_MAX, "%s", first); + + return res; +} + +static char* +_gd_populate_list(Egui_Graphics_Dialog egd) +{ + + char* first = _gd_process_dir(egd, egd->egds.files_path); + + if (egd->egds.extra_file_paths != NULL) + { + ecore_list_for_each(egd->egds.extra_file_paths, _cb_dirs, egd); + } + + return first; } +static void +_cb_dirs(void *list_data, void *data) +{ + char* apath = list_data; + Egui_Graphics_Dialog egd = data; + + _gd_process_dir(egd, apath); +} + + + static void _gd_load_preview(Egui_Graphics_Dialog egd, const char *graphic) { if(!egd) return; - char *file = _gd_get_path(egd, graphic); + char *file = NULL; + + if(egd->egds.use_full_path) + file = strdup(graphic); + else + file = _gd_get_path(egd, graphic); + static Evas *evas = NULL; if(evas == NULL || egd->newly_created == 1) evas = ew_preview_evas_get(egd->img_preview, PREVIEW_WIDTH, PREVIEW_HEIGHT, PREVIEW_V_WIDTH, PREVIEW_V_HEIGHT); @@ -262,4 +315,3 @@ /*FIXME: selecting the first row doesn't work - maybe we select first row while adding elements to the list:(*/ /*ew_list_first_row_select(list_thumbs);*/ } - =================================================================== RCS file: /cvs/e/e17/proto/entrance_edit_gui/src/gui/egui_graphics_dialog.h,v retrieving revision 1.1 retrieving revision 1.2 diff -u -3 -r1.1 -r1.2 --- egui_graphics_dialog.h 28 Sep 2006 22:09:50 -0000 1.1 +++ egui_graphics_dialog.h 6 Nov 2006 15:14:24 -0000 1.2 @@ -1,9 +1,12 @@ #ifndef _EGUI_GRAPHICS_DIALOG_H #define _EGUI_GRAPHICS_DIALOG_H +#include <Ecore_Data.h> + typedef struct { char *name; char *files_path; + Ecore_List *extra_file_paths; char *preview_edje_part; char *dialog_title; char *list_title; =================================================================== RCS file: /cvs/e/e17/proto/entrance_edit_gui/src/gui/theme.c,v retrieving revision 1.12 retrieving revision 1.13 diff -u -3 -r1.12 -r1.13 --- theme.c 28 Sep 2006 22:09:50 -0000 1.12 +++ theme.c 6 Nov 2006 15:14:24 -0000 1.13 @@ -11,7 +11,8 @@ { Egui_Graphics_Dialog_Settings theme_settings = { "theme", - "/usr/share/entrance/themes", + PREFIX "/share/entrance/themes", + NULL, "Preview", "Entrance Configuration - Themes", "Themes", ------------------------------------------------------------------------- Using Tomcat but need to do more? Need to support web services, security? Get stuff done quickly with pre-integrated technology to make your job easier Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642 _______________________________________________ enlightenment-cvs mailing list enlightenment-cvs@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/enlightenment-cvs