Enlightenment CVS committal Author : titan Project : e17 Module : proto
Dir : e17/proto/ephoto/src Modified Files: ephoto.c ephoto.h ephoto_misc.c ephoto_browsing.c Log Message: Working on a combo for ephoto :) =================================================================== RCS file: /cvs/e/e17/proto/ephoto/src/ephoto.c,v retrieving revision 1.30 retrieving revision 1.31 diff -u -3 -r1.30 -r1.31 --- ephoto.c 5 Apr 2006 00:49:01 -0000 1.30 +++ ephoto.c 5 Apr 2006 14:58:40 -0000 1.31 @@ -593,25 +593,13 @@ ewl_text_underline_color_set(EWL_TEXT(m->text), 128, 128, 128, 128); ewl_text_text_set(EWL_TEXT(m->text), "Audio"); ewl_widget_show(m->text); - -// m->data = _data_setup(); -// -// m->model = ewl_model_new(); -// ewl_model_fetch_set(m->model, _data_fetch); -// ewl_model_count_set(m->model, _data_count_get); -// -// m->view = ewl_view_new(); -// ewl_view_contructor_set(m->view, ewl_label_new); -// ewl_view_assign_set(m->view, EWL_VIEW_ASSIGN(ewl_label_text_set)); -// ewl_view_header_fetch_set(m->view, _data_header_fetch); -// -// m->atext = ewl_combo_new(); -// ewl_container_child_append(EWL_CONTAINER(m->settings), m->atext); -// ewl_object_alignment_set(EWL_OBJECT(m->atext), EWL_FLAG_ALIGN_CENTER); -// ewl_combo_model_set(EWL_COMBO(m->atext), m->model); -// ewl_combo_view_set(EWL_COMBO(m->atext), m->view); -// ewl_combo_data_set(EWL_COMBO(m->atext), m->data); -// ewl_widget_show(m->atext); + + m->data = _data_setup(); + + m->atext = ewl_combo_new(); + ewl_container_child_append(EWL_CONTAINER(m->settings), m->atext); + ewl_object_alignment_set(EWL_OBJECT(m->atext), EWL_FLAG_ALIGN_CENTER); + ewl_widget_show(m->atext); m->hboxv = ewl_hbox_new(); ewl_container_child_append(EWL_CONTAINER(m->settings), m->hboxv); @@ -674,12 +662,26 @@ // } //} /**********************************************************/ - /************LETS POPULATE THEM TREES******************/ - ewl_callback_call(m->directory, EWL_CALLBACK_VALUE_CHANGED); - ewl_callback_call(m->directorya, EWL_CALLBACK_VALUE_CHANGED); - /******************************************************/ - ewl_main(); + + /************LETS POPULATE THEM TREES******************/ + ewl_callback_call(m->directory, EWL_CALLBACK_VALUE_CHANGED); + /******************************************************/ + m->data = _data_setup(); + + m->model = ewl_model_new(); + ewl_model_fetch_set(m->model, _data_fetch); + ewl_model_count_set(m->model, _data_count_get); + + m->view = ewl_view_new(); + ewl_view_constructor_set(m->view, ewl_label_new); + ewl_view_assign_set(m->view, EWL_VIEW_ASSIGN(ewl_label_text_set)); + ewl_view_header_fetch_set(m->view, _data_header_fetch); + + ewl_combo_model_set(EWL_COMBO(m->atext), m->model); + ewl_combo_view_set(EWL_COMBO(m->atext), m->view); + ewl_combo_data_set(EWL_COMBO(m->atext), m->data); + ewl_main(); return 0; } } =================================================================== RCS file: /cvs/e/e17/proto/ephoto/src/ephoto.h,v retrieving revision 1.12 retrieving revision 1.13 diff -u -3 -r1.12 -r1.13 --- ephoto.h 4 Apr 2006 18:16:41 -0000 1.12 +++ ephoto.h 5 Apr 2006 14:58:40 -0000 1.13 @@ -37,10 +37,10 @@ void play_cb(Ewl_Widget *w, void *event, void *data); void ephoto_men_cb(Ewl_Widget *w, void *event, void *data); void destroywin_cb(Ewl_Widget *w, void *event, void *data); -void *_data_setup(void); -Ewl_Widget *_data_header_fetch(void*data__UNUSED__,int col__UNUSED__); -void *_data_fetch(void*data,unsigned int row, unsigned int col__UNUSED__); -int _data_count_get(void*data); +void *_data_setup(); +Ewl_Widget *_data_header_fetch(); +void *_data_fetch(); +int _data_count_get(); typedef struct _Main Main; typedef struct _Slide Slide; @@ -92,8 +92,8 @@ Ewl_Widget *viewscroll; Ewl_Widget *dirtree; Ewl_Widget *spacer; - Ewl_Widget *model; - Ewl_Widget *view; + Ewl_Model *model; + Ewl_View *view; Ewl_Widget *menubar; Ewl_Widget *menu; Ewl_Widget *menu_item; =================================================================== RCS file: /cvs/e/e17/proto/ephoto/src/ephoto_misc.c,v retrieving revision 1.5 retrieving revision 1.6 diff -u -3 -r1.5 -r1.6 --- ephoto_misc.c 1 Apr 2006 05:17:27 -0000 1.5 +++ ephoto_misc.c 5 Apr 2006 14:58:40 -0000 1.6 @@ -125,3 +125,42 @@ ewl_widget_show(cancel); } +void * +_data_setup() +{ + m->data = audiofiles; + return m->data; +} + +Ewl_Widget * +_data_header_fetch() +{ + Ewl_Widget *header; + + header = ewl_label_new(); + ewl_label_text_set(EWL_LABEL(header), "Select Audio"); + ewl_widget_show(header); + + return header; +} + +void * +_data_fetch() +{ + char *path; + path = ecore_list_next(audiofiles); + if ( path != NULL ) { + return path; + } + else { + return NULL; + } +} + +int +_data_count_get() +{ + int items; + items = ecore_list_nodes(audiofiles); + return items; +} =================================================================== RCS file: /cvs/e/e17/proto/ephoto/src/ephoto_browsing.c,v retrieving revision 1.18 retrieving revision 1.19 diff -u -3 -r1.18 -r1.19 --- ephoto_browsing.c 5 Apr 2006 01:49:24 -0000 1.18 +++ ephoto_browsing.c 5 Apr 2006 14:58:40 -0000 1.19 @@ -51,6 +51,9 @@ if ( ecore_file_is_dir(pathf) ) { /**********Get the lists going!***********/ + if ( audiofiles != NULL ) { + ecore_list_destroy(audiofiles); + } audiofiles = ecore_list_new(); imagefiles = ecore_list_new(); files = ecore_list_new(); @@ -257,7 +260,6 @@ ecore_list_destroy(files); ecore_list_destroy(imagefiles); - ecore_list_destroy(audiofiles); } } ------------------------------------------------------- This SF.Net email is sponsored by xPML, a groundbreaking scripting language that extends applications into web and mobile media. Attend the live webcast and join the prime developer group breaking into this new coding territory! http://sel.as-us.falkag.net/sel?cmd=lnk&kid=110944&bid=241720&dat=121642 _______________________________________________ enlightenment-cvs mailing list enlightenment-cvs@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/enlightenment-cvs