Enlightenment CVS committal Author : titan Project : e17 Module : apps/ephoto
Dir : e17/apps/ephoto/src/bin Modified Files: ephoto.c ephoto.h ephoto_edit_view.c ephoto_gui.c ephoto_list_view.c ephoto_main.c ephoto_normal_view.c ephoto_slideshow.c Log Message: Add edit tools back. I really need a better design. =================================================================== RCS file: /cvs/e/e17/apps/ephoto/src/bin/ephoto.c,v retrieving revision 1.3 retrieving revision 1.4 diff -u -3 -r1.3 -r1.4 --- ephoto.c 28 Mar 2007 17:50:49 -0000 1.3 +++ ephoto.c 30 Mar 2007 02:47:16 -0000 1.4 @@ -266,9 +266,9 @@ bind_textdomain_codeset(PACKAGE, "UTF-8"); textdomain(PACKAGE); #endif - /*Use our own custom theme*/ + /*Use our own theme*/ ewl_theme_theme_set(PACKAGE_DATA_DIR "/themes/ephoto.edj"); - + /*Start the GUI*/ create_main_gui(); =================================================================== RCS file: /cvs/e/e17/apps/ephoto/src/bin/ephoto.h,v retrieving revision 1.14 retrieving revision 1.15 diff -u -3 -r1.14 -r1.15 --- ephoto.h 30 Mar 2007 00:45:12 -0000 1.14 +++ ephoto.h 30 Mar 2007 02:47:16 -0000 1.15 @@ -72,6 +72,7 @@ Ewl_Widget *add_label(Ewl_Widget *c, const char *lbl); Ewl_Widget *add_menubar(Ewl_Widget *c); Ewl_Widget *add_menu(Ewl_Widget *c, const char *lbl); +Ewl_Widget *add_menu_item(Ewl_Widget *c, const char *lbl, const char *img, void *cb, void *data); Ewl_Widget *add_text(Ewl_Widget *c, const char *text); Ewl_Widget *add_shadow(Ewl_Widget *c); Ewl_Widget *add_window(const char *name, int width, int height, void *cb, void *data); =================================================================== RCS file: /cvs/e/e17/apps/ephoto/src/bin/ephoto_edit_view.c,v retrieving revision 1.10 retrieving revision 1.11 diff -u -3 -r1.10 -r1.11 --- ephoto_edit_view.c 30 Mar 2007 00:45:12 -0000 1.10 +++ ephoto_edit_view.c 30 Mar 2007 02:47:16 -0000 1.11 @@ -19,21 +19,21 @@ ewl_object_alignment_set(EWL_OBJECT(em->eimage), EWL_FLAG_ALIGN_CENTER); ewl_object_fill_policy_set(EWL_OBJECT(em->eimage), EWL_FLAG_FILL_SHRINK); + em->edit_tools = add_box(em->edit_vbox, EWL_ORIENTATION_HORIZONTAL, 3); + ewl_object_alignment_set(EWL_OBJECT(em->edit_tools), EWL_FLAG_ALIGN_CENTER); + ewl_object_fill_policy_set(EWL_OBJECT(em->edit_tools), EWL_FLAG_FILL_SHRINK); + add_edit_tools(em->edit_tools); + return em->edit_vbox; } /*Show the edit view*/ void show_edit_view(Ewl_Widget *w, void *event, void *data) { - char *path = data; - ewl_notebook_visible_page_set(EWL_NOTEBOOK(em->view_box), em->edit_vbox); - if (path) - { - ewl_image_file_path_set(EWL_IMAGE(em->eimage), path); - free(path); - } - else ewl_image_file_path_set(EWL_IMAGE(em->eimage), ecore_dlist_current(em->images)); + ecore_dlist_goto_first(em->images); + ewl_image_file_path_set(EWL_IMAGE(em->eimage), ecore_dlist_current(em->images)); + return; } /*Add edit tools to container c*/ @@ -71,14 +71,12 @@ image = add_image(c, PACKAGE_DATA_DIR "/images/media-seek-backward.png", 0, previous_image, NULL); ewl_image_constrain_set(EWL_IMAGE(image), 30); - ewl_object_alignment_set(EWL_OBJECT(image), EWL_FLAG_ALIGN_RIGHT); ewl_attach_tooltip_text_set(image, "Previous Image"); image = add_image(c, PACKAGE_DATA_DIR "/images/media-seek-forward.png", 0, next_image, NULL); ewl_image_constrain_set(EWL_IMAGE(image), 30); - ewl_object_alignment_set(EWL_OBJECT(image), EWL_FLAG_ALIGN_RIGHT); ewl_attach_tooltip_text_set(image, "Next Image"); - + return; } @@ -118,8 +116,6 @@ return; } - - /*Flip the image 180 degrees horizontally*/ static void flip_image_horizontal(Ewl_Widget *w, void *event, void *data) =================================================================== RCS file: /cvs/e/e17/apps/ephoto/src/bin/ephoto_gui.c,v retrieving revision 1.6 retrieving revision 1.7 diff -u -3 -r1.6 -r1.7 --- ephoto_gui.c 30 Mar 2007 00:45:12 -0000 1.6 +++ ephoto_gui.c 30 Mar 2007 02:47:16 -0000 1.7 @@ -115,11 +115,29 @@ Ewl_Widget *menu; menu = ewl_menu_new(); - if(lbl) ewl_label_text_set(EWL_LABEL(menu), lbl); + if(lbl) ewl_button_label_set(EWL_BUTTON(menu), lbl); + ewl_object_fill_policy_set(EWL_OBJECT(menu), EWL_FLAG_FILL_NONE); if(c) ewl_container_child_append(EWL_CONTAINER(c), menu); ewl_widget_show(menu); return menu; +} + +/*Create and Add a Menu Item to the Container c*/ +Ewl_Widget *add_menu_item(Ewl_Widget *c, const char *lbl, const char *img, void *cb, void *data) +{ + Ewl_Widget *mi; + + mi = ewl_menu_item_new(); + if(img) ewl_button_image_set(EWL_BUTTON(mi), img, NULL); + if(lbl) ewl_button_label_set(EWL_BUTTON(mi), lbl); + ewl_object_alignment_set(EWL_OBJECT(mi), EWL_FLAG_ALIGN_CENTER); + ewl_object_fill_policy_set(EWL_OBJECT(mi), EWL_FLAG_FILL_ALL); + if(c) ewl_container_child_append(EWL_CONTAINER(c), mi); + if(cb) ewl_callback_append(mi, EWL_CALLBACK_CLICKED, cb, data); + ewl_widget_show(mi); + + return mi; } /*Create and Add a Shadow to the Container c*/ =================================================================== RCS file: /cvs/e/e17/apps/ephoto/src/bin/ephoto_list_view.c,v retrieving revision 1.16 retrieving revision 1.17 diff -u -3 -r1.16 -r1.17 --- ephoto_list_view.c 30 Mar 2007 00:45:12 -0000 1.16 +++ ephoto_list_view.c 30 Mar 2007 02:47:16 -0000 1.17 @@ -71,7 +71,7 @@ hbox = add_box(NULL, EWL_ORIENTATION_HORIZONTAL, 10); ewl_object_fill_policy_set(EWL_OBJECT(hbox), EWL_FLAG_FILL_HFILL); - ewl_callback_append(hbox, EWL_CALLBACK_CLICKED, show_edit_view, strdup(image)); +// ewl_callback_append(hbox, EWL_CALLBACK_CLICKED, show_edit_view, strdup(image)); ewl_widget_name_set(hbox, image); img = add_image(hbox, image, 1, NULL, NULL); =================================================================== RCS file: /cvs/e/e17/apps/ephoto/src/bin/ephoto_main.c,v retrieving revision 1.20 retrieving revision 1.21 diff -u -3 -r1.20 -r1.21 --- ephoto_main.c 30 Mar 2007 00:45:12 -0000 1.20 +++ ephoto_main.c 30 Mar 2007 02:47:16 -0000 1.21 @@ -49,7 +49,7 @@ void create_main_gui(void) { Ewl_Widget *vbox, *hbox, *hsep, *vsep, *button; - Ewl_Widget *mb, *menu; + Ewl_Widget *mb, *menu, *mi; em = NULL; em = calloc(1, sizeof(Ephoto_Main)); @@ -63,6 +63,7 @@ mb = add_menubar(vbox); menu = add_menu(mb, "File"); + mi = add_menu_item(menu, "Exit", PACKAGE_DATA_DIR "/images/exit.png", destroy, NULL); hbox = add_box(vbox, EWL_ORIENTATION_HORIZONTAL, 2); ewl_object_fill_policy_set(EWL_OBJECT(hbox), EWL_FLAG_FILL_ALL); =================================================================== RCS file: /cvs/e/e17/apps/ephoto/src/bin/ephoto_normal_view.c,v retrieving revision 1.10 retrieving revision 1.11 diff -u -3 -r1.10 -r1.11 --- ephoto_normal_view.c 30 Mar 2007 00:45:12 -0000 1.10 +++ ephoto_normal_view.c 30 Mar 2007 02:47:16 -0000 1.11 @@ -28,13 +28,13 @@ ewl_notebook_visible_page_set(EWL_NOTEBOOK(em->view_box), em->fbox_vbox); } -/*Set the info that is in the info label on normal view*/ +/*Action when an image is clicked*/ void freebox_image_clicked(Ewl_Widget *w, void *event, void *data) { const char *path; path = ewl_widget_name_get(w); - show_edit_view(NULL, NULL, strdup(path)); +// show_edit_view(NULL, NULL, strdup(path)); return; } =================================================================== RCS file: /cvs/e/e17/apps/ephoto/src/bin/ephoto_slideshow.c,v retrieving revision 1.3 retrieving revision 1.4 diff -u -3 -r1.3 -r1.4 --- ephoto_slideshow.c 30 Mar 2007 00:45:12 -0000 1.3 +++ ephoto_slideshow.c 30 Mar 2007 02:47:16 -0000 1.4 @@ -52,7 +52,7 @@ { Ewl_Widget *cell, *image; - win = add_window("Ephoto Slideshow!", 600, 400, destroy, NULL); + win = add_window("Ephoto Slideshow!", 0, 0, destroy, NULL); ewl_window_fullscreen_set(EWL_WINDOW(win), 1); ewl_callback_append(win, EWL_CALLBACK_CLICKED, destroy, NULL); ------------------------------------------------------------------------- Take Surveys. Earn Cash. Influence the Future of IT Join SourceForge.net's Techsay panel and you'll get the chance to share your opinions on IT & business topics through brief surveys-and earn cash http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV _______________________________________________ enlightenment-cvs mailing list enlightenment-cvs@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/enlightenment-cvs