Enlightenment CVS committal Author : titan Project : e17 Module : proto
Dir : e17/proto/ephoto/src Modified Files: ephoto.c ephoto_browsing.c Log Message: First of several great changes to come for ephoto. =================================================================== RCS file: /cvs/e/e17/proto/ephoto/src/ephoto.c,v retrieving revision 1.23 retrieving revision 1.24 diff -u -3 -r1.23 -r1.24 --- ephoto.c 28 Mar 2006 23:00:06 -0000 1.23 +++ ephoto.c 29 Mar 2006 03:34:26 -0000 1.24 @@ -262,7 +262,7 @@ m->win = ewl_window_new(); ewl_window_title_set(EWL_WINDOW(m->win), "ephoto"); ewl_window_name_set(EWL_WINDOW(m->win), "ephoto"); - ewl_object_size_request(EWL_OBJECT(m->win), 600, 480); + ewl_object_size_request(EWL_OBJECT(m->win), 640, 480); ewl_callback_append(m->win, EWL_CALLBACK_DELETE_WINDOW, destroy_cb, NULL); ewl_widget_show(m->win); mainwin = 1; @@ -299,26 +299,6 @@ ewl_object_maximum_size_set(EWL_OBJECT(m->imagetree), 200, 160); ewl_widget_show(m->imagetree); - m->songs = ewl_border_new(); - ewl_border_text_set(EWL_BORDER(m->songs), "Select Audio For Slideshow"); - ewl_border_label_alignment_set(EWL_BORDER(m->songs), EWL_FLAG_ALIGN_CENTER); - ewl_container_child_append(EWL_CONTAINER(m->vbox), m->songs); - ewl_object_alignment_set(EWL_OBJECT(m->songs), EWL_FLAG_ALIGN_CENTER); - ewl_object_size_request(EWL_OBJECT(m->songs), 250, 210); - ewl_widget_show(m->songs); - - m->directorya = ewl_entry_new(); - ewl_text_text_set(EWL_TEXT(m->directorya), home); - ewl_object_alignment_set(EWL_OBJECT(m->directorya), EWL_FLAG_ALIGN_CENTER); - ewl_container_child_append(EWL_CONTAINER(m->songs), m->directorya); - ewl_callback_append(m->directorya, EWL_CALLBACK_VALUE_CHANGED, populatea_cb, NULL); - ewl_widget_show(m->directorya); - - m->audiotree = ewl_tree_new(1); - ewl_container_child_append(EWL_CONTAINER(m->songs), m->audiotree); - ewl_object_maximum_size_set(EWL_OBJECT(m->audiotree), 200, 160); - ewl_widget_show(m->audiotree); - m->notebook = ewl_notebook_new(); ewl_notebook_tabbar_position_set(EWL_NOTEBOOK(m->notebook), EWL_POSITION_TOP); ewl_container_child_append(EWL_CONTAINER(m->hbox), m->notebook); @@ -333,8 +313,7 @@ ewl_object_fill_policy_set(EWL_OBJECT(m->viewbox), EWL_FLAG_FILL_ALL); ewl_widget_show(m->viewbox); - m->viewscroll = ewl_vbox_new(); - ewl_theme_data_str_set(m->viewscroll, "/vbox/group", "entry"); + m->viewscroll = ewl_scrollpane_new(); ewl_container_child_append(EWL_CONTAINER(m->viewbox), m->viewscroll); ewl_object_alignment_set(EWL_OBJECT(m->viewscroll), EWL_FLAG_ALIGN_CENTER); ewl_object_fill_policy_set(EWL_OBJECT(m->viewscroll), EWL_FLAG_FILL_ALL); @@ -344,8 +323,7 @@ if ( argimage != NULL ) { ewl_image_file_set(EWL_IMAGE(m->vimage), argimage, NULL); } - ewl_object_fill_policy_set(EWL_OBJECT(m->vimage), EWL_FLAG_FILL_ALL); - ewl_image_proportional_set(EWL_IMAGE(m->vimage), TRUE); + ewl_object_fill_policy_set(EWL_OBJECT(m->vimage), EWL_FLAG_FILL_SHRINK); ewl_container_child_append(EWL_CONTAINER(m->viewscroll), m->vimage); ewl_widget_show(m->vimage); @@ -370,6 +348,14 @@ ewl_notebook_page_tab_text_set(EWL_NOTEBOOK(m->notebook), m->vbox2, "Slideshow/Presentation"); + m->songs = ewl_vbox_new(); + ewl_container_child_append(EWL_CONTAINER(m->notebook), m->songs); + ewl_object_alignment_set(EWL_OBJECT(m->songs), EWL_FLAG_ALIGN_CENTER); + ewl_box_spacing_set(EWL_BOX(m->songs), 10); + ewl_widget_show(m->songs); + + ewl_notebook_page_tab_text_set(EWL_NOTEBOOK(m->notebook), m->songs, "Select/Preview Audio"); + m->content = ewl_border_new(); ewl_border_text_set(EWL_BORDER(m->content), "Content"); ewl_border_label_alignment_set(EWL_BORDER(m->content), EWL_FLAG_ALIGN_CENTER); @@ -509,7 +495,7 @@ ewl_object_alignment_set(EWL_OBJECT(m->text), EWL_FLAG_ALIGN_CENTER); ewl_text_font_size_set(EWL_TEXT(m->text), 12); ewl_text_text_set(EWL_TEXT(m->text), "Width"); - ewl_widget_show(m->text); + ewl_widget_show(m->text); m->wsize = ewl_entry_new(); ewl_text_text_set(EWL_TEXT(m->wsize), argwidth); =================================================================== RCS file: /cvs/e/e17/proto/ephoto/src/ephoto_browsing.c,v retrieving revision 1.10 retrieving revision 1.11 diff -u -3 -r1.10 -r1.11 --- ephoto_browsing.c 22 Mar 2006 03:17:02 -0000 1.10 +++ ephoto_browsing.c 29 Mar 2006 03:34:26 -0000 1.11 @@ -51,6 +51,7 @@ if ( ecore_file_is_dir(pathf) ) { /**********Get the lists going!***********/ + audiofiles = ecore_list_new(); imagefiles = ecore_list_new(); files = ecore_list_new(); /*****************************************/ @@ -61,8 +62,8 @@ m->imagetree = ewl_tree_new(1); ewl_container_child_append(EWL_CONTAINER(m->images), m->imagetree); - ewl_object_maximum_size_set(EWL_OBJECT(m->imagetree), 200, 175); - ewl_tree_headers_visible_set(EWL_TREE(m->imagetree), 0); + ewl_object_maximum_size_set(EWL_OBJECT(m->imagetree), 200, 425); + ewl_tree_headers_visible_set(EWL_TREE(m->imagetree), FALSE); ewl_widget_show(m->imagetree); /******************************************/ @@ -122,6 +123,18 @@ if ( fnmatch("*.[Jj][Pp][Ee][Gg]", pathw, 0) == 0 ) { ecore_list_append(imagefiles, strdup(pathw)); } + + if ( fnmatch("*.[Mm][Pp][3]", pathw, 0) == 0 ) { + ecore_list_append(audiofiles, strdup(pathw)); + } + + if ( fnmatch("*.[Oo][Gg][Gg]", pathw, 0) == 0 ) { + ecore_list_append(audiofiles, strdup(pathw)); + } + + if ( fnmatch("*.[Ww][Aa][Vv]", pathw, 0) == 0 ) { + ecore_list_append(audiofiles, strdup(pathw)); + } bname = basename(pathw); @@ -170,7 +183,7 @@ m->text = ewl_text_new(); ewl_widget_name_set(m->text, itemp); ewl_text_text_set(EWL_TEXT(m->text), bname2); - ewl_object_minimum_size_set(EWL_OBJECT(m->text), 10, 16); + ewl_object_minimum_size_set(EWL_OBJECT(m->text), 10, 16); ewl_object_fill_policy_set(EWL_OBJECT(m->text), EWL_FLAG_FILL_ALL); ewl_container_child_append(EWL_CONTAINER(m->hbox), m->text); ewl_widget_show(m->text); @@ -182,155 +195,6 @@ free(itemp); } /***********************************************************************/ - ecore_list_destroy(files); - ecore_list_destroy(imagefiles); - } -} - -void -populatea_cb(Ewl_Widget *w, void *event, void *data) -{ - /*********Setup Variables********/ - char *bname; - char *bname2; - char fn[PATH_MAX]; - char *itemp; - const char *pathi; - char pathf[PATH_MAX]; - char pathg[PATH_MAX]; - char pathw[PATH_MAX]; - char path[PATH_MAX]; - char *temp; - char *up = ".."; - /*************************/ - - /*******Lets find out what directory we are workin with******/ - if (w == m->directorya) { - pathi = ewl_text_text_get(EWL_TEXT(w)); - } - - else { - pathi = ewl_widget_name_get(w); - } - - ewl_text_text_set(EWL_TEXT(m->directorya), pathi); - - /***********************************************************/ - - /***********Make sure there is a trailing / *************/ - snprintf(fn, PATH_MAX, "%s", pathi); - - if (fn[strlen(fn)-1] != '/') { - snprintf(pathf, PATH_MAX, "%s/", pathi); - } - - else { - snprintf(pathf, PATH_MAX, "%s", pathi); - } - /**********************************************************/ - - - /********Add the directories to the tree!***********/ - if ( ecore_file_is_dir(pathf) ) { - /********Prepare the lists********/ - audiofiles = ecore_list_new(); - files = ecore_list_new(); - /*********************************/ - - /**********Prepare the tree************/ - ewl_widget_destroy(m->audiotree); - - m->audiotree = ewl_tree_new(1); - ewl_tree_expandable_rows_set(EWL_TREE(m->audiotree), FALSE); - ewl_container_child_append(EWL_CONTAINER(m->songs), m->audiotree); - ewl_object_maximum_size_set(EWL_OBJECT(m->audiotree), 200, 175); - ewl_widget_show(m->audiotree); - - /*************************************/ - - /*****Setup parent directory row*****/ - m->hbox = ewl_hbox_new(); - ewl_box_spacing_set(EWL_BOX(m->hbox), 5); - ewl_widget_show(m->hbox); - - m->image = ewl_image_new(); - ewl_image_file_set(EWL_IMAGE(m->image), PACKAGE_DATA_DIR "/images/up.png", NULL); - ewl_container_child_append(EWL_CONTAINER(m->hbox), m->image); - ewl_tree_headers_visible_set(EWL_TREE(m->audiotree), 0); - ewl_widget_show(m->image); - - m->texta = ewl_text_new(); - ewl_widget_name_set(m->texta, pathi); - ewl_text_text_set(EWL_TEXT(m->texta), up); - ewl_object_minimum_size_set(EWL_OBJECT(m->texta), 10, 16); - ewl_object_fill_policy_set(EWL_OBJECT(m->texta), EWL_FLAG_FILL_ALL); - ewl_container_child_append(EWL_CONTAINER(m->hbox), m->texta); - ewl_widget_show(m->texta); - - m->children[0] = m->hbox; - m->children[1] = NULL; - m->row = ewl_tree_row_add(EWL_TREE(m->audiotree), NULL, m->children); - ewl_callback_append(m->texta, EWL_CALLBACK_CLICKED, up_cb, NULL); - - files = ecore_file_ls(pathf); - - while(!ecore_list_is_empty(files)) { - - temp = ecore_list_remove_first(files); - snprintf(path, PATH_MAX, "%s", pathf); - - if (path[strlen(path)-1] != '/') { - snprintf(pathg, PATH_MAX, "%s/", path); - } - - else { - snprintf(pathg, PATH_MAX, "%s", path); - } - - snprintf(pathw, PATH_MAX, "%s%s", pathg, temp); - - - if ( fnmatch("*.[Mm][Pp][3]", pathw, 0) == 0 ) { - ecore_list_append(audiofiles, strdup(pathw)); - } - - if ( fnmatch("*.[Oo][Gg][Gg]", pathw, 0) == 0 ) { - ecore_list_append(audiofiles, strdup(pathw)); - } - - if ( fnmatch("*.[Ww][Aa][Vv]", pathw, 0) == 0 ) { - ecore_list_append(audiofiles, strdup(pathw)); - } - - - bname = basename(pathw); - - if (ecore_file_is_dir(pathw) && *bname != '.') { - - m->hbox = ewl_hbox_new(); - ewl_box_spacing_set(EWL_BOX(m->hbox), 5); - ewl_widget_show(m->hbox); - - m->image = ewl_image_new(); - ewl_image_file_set(EWL_IMAGE(m->image), PACKAGE_DATA_DIR "/images/folder.png", NULL); - ewl_container_child_append(EWL_CONTAINER(m->hbox), m->image); - ewl_widget_show(m->image); - - m->text = ewl_text_new(); - ewl_widget_name_set(m->text, pathw); - ewl_text_text_set(EWL_TEXT(m->text), bname); - ewl_object_minimum_size_set(EWL_OBJECT(m->text), 10, 16); - ewl_object_fill_policy_set(EWL_OBJECT(m->text), EWL_FLAG_FILL_ALL); - ewl_container_child_append(EWL_CONTAINER(m->hbox), m->text); - ewl_widget_show(m->text); - - m->children[0] = m->hbox; - m->children[1] = NULL; - m->row = ewl_tree_row_add(EWL_TREE(m->audiotree), NULL, m->children); - ewl_callback_append(m->text, EWL_CALLBACK_CLICKED, populatea_cb, NULL); - } - } - /**********************************************************************/ /*************Add the audio file to the slideshow**************/ while( !ecore_list_is_empty(audiofiles) ) { itemp = ecore_list_remove_first(audiofiles); @@ -357,16 +221,17 @@ m->children[0] = m->hbox; m->children[1] = NULL; - m->row = ewl_tree_row_add(EWL_TREE(m->audiotree), NULL, m->children); + m->row = ewl_tree_row_add(EWL_TREE(m->imagetree), NULL, m->children); ewl_callback_append(m->text, EWL_CALLBACK_CLICKED, audio_cb, NULL); free(itemp); } /**********************************************************************/ - ecore_list_destroy(files); - ecore_list_destroy(audiofiles); + + ecore_list_destroy(files); + ecore_list_destroy(imagefiles); + ecore_list_destroy(audiofiles); } } - void up_cb(Ewl_Widget *w, void *event, void *data) ------------------------------------------------------- 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