Enlightenment CVS committal Author : titan Project : e17 Module : apps/ephoto
Dir : e17/apps/ephoto/src/bin Modified Files: ephoto.h ephoto_edit_view.c ephoto_exif.c ephoto_imaging.c ephoto_main.c ephoto_single_view.c Log Message: Cleanups, move exif button out of edit view and into toolbar, start album work. =================================================================== RCS file: /cvs/e/e17/apps/ephoto/src/bin/ephoto.h,v retrieving revision 1.17 retrieving revision 1.18 diff -u -3 -r1.17 -r1.18 --- ephoto.h 27 Apr 2007 05:55:37 -0000 1.17 +++ ephoto.h 28 Apr 2007 04:12:24 -0000 1.18 @@ -84,6 +84,7 @@ unsigned int *rotate_left(Ewl_Widget *image); unsigned int *rotate_right(Ewl_Widget *image); void update_image(Ewl_Widget *image, int w, int h, unsigned int *data); +void save_image(Ewl_Widget *image, const char *file); /* Ephoto Edit View */ Ewl_Widget *add_edit_view(Ewl_Widget *c); @@ -138,6 +139,7 @@ Ewl_Widget *main_nb; Ewl_Widget *main_vbox; Ewl_Widget *simage; + Ewl_Widget *single_sp; Ewl_Widget *single_vbox; Ewl_Widget *toolbar; Ewl_Widget *view; =================================================================== RCS file: /cvs/e/e17/apps/ephoto/src/bin/ephoto_edit_view.c,v retrieving revision 1.16 retrieving revision 1.17 diff -u -3 -r1.16 -r1.17 --- ephoto_edit_view.c 27 Apr 2007 04:37:40 -0000 1.16 +++ ephoto_edit_view.c 28 Apr 2007 04:12:24 -0000 1.17 @@ -77,16 +77,6 @@ { Ewl_Widget *button; - button = add_button(c, "Get Exif", PACKAGE_DATA_DIR "/images/get_exif.png", NULL, NULL); - ewl_button_image_size_set(EWL_BUTTON(button), 30, 30); - ewl_button_label_set(EWL_BUTTON(button), "You do not have libexif 0.6.13"); - ewl_object_alignment_set(EWL_OBJECT(button), EWL_FLAG_ALIGN_LEFT); - ewl_object_fill_policy_set(EWL_OBJECT(button), EWL_FLAG_FILL_HFILL); -#ifdef BUILD_EXIF_SUPPORT - ewl_callback_append(button, EWL_CALLBACK_CLICKED, display_exif_dialog, NULL); - ewl_button_label_set(EWL_BUTTON(button), "View Exif Data"); -#endif - button = add_button(c, "Rotate Left", PACKAGE_DATA_DIR "/images/undo.png", rotate_image_left, NULL); ewl_button_image_size_set(EWL_BUTTON(button), 30, 30); ewl_object_alignment_set(EWL_OBJECT(button), EWL_FLAG_ALIGN_LEFT); =================================================================== RCS file: /cvs/e/e17/apps/ephoto/src/bin/ephoto_exif.c,v retrieving revision 1.14 retrieving revision 1.15 diff -u -3 -r1.14 -r1.15 --- ephoto_exif.c 30 Mar 2007 00:45:12 -0000 1.14 +++ ephoto_exif.c 28 Apr 2007 04:12:24 -0000 1.15 @@ -59,7 +59,7 @@ { const char *img = NULL; - if (VISIBLE(em->edit_vbox)) img = ewl_image_file_path_get(EWL_IMAGE(em->eimage)); + img = ecore_dlist_current(em->images); if(!img) return NULL; return strdup(img); } =================================================================== RCS file: /cvs/e/e17/apps/ephoto/src/bin/ephoto_imaging.c,v retrieving revision 1.1 retrieving revision 1.2 diff -u -3 -r1.1 -r1.2 --- ephoto_imaging.c 15 Feb 2007 10:20:21 -0000 1.1 +++ ephoto_imaging.c 28 Apr 2007 04:12:24 -0000 1.2 @@ -136,3 +136,19 @@ evas_object_image_data_update_add(EWL_IMAGE(image)->image, 0, 0, w, h); } } + +void save_image(Ewl_Widget *image, const char *file) +{ + pid_t pid; + + if(image && file) + { + pid = fork(); + if(pid == 0) + { + evas_object_image_save(EWL_IMAGE(image)->image, file, NULL, NULL); + exit(0); + } + } + return; +} =================================================================== RCS file: /cvs/e/e17/apps/ephoto/src/bin/ephoto_main.c,v retrieving revision 1.28 retrieving revision 1.29 diff -u -3 -r1.28 -r1.29 --- ephoto_main.c 27 Apr 2007 05:55:37 -0000 1.28 +++ ephoto_main.c 28 Apr 2007 04:12:24 -0000 1.29 @@ -1,9 +1,12 @@ #include "ephoto.h" /*Ewl Callbacks*/ +static void add_album(Ewl_Widget *w, void *event, void *data); +static void cancel(Ewl_Widget *w, void *event, void *data); static void destroy(Ewl_Widget *w, void *event, void *data); static void populate_albums(Ewl_Widget *w, void *event, void *data); static void populate_directories(Ewl_Widget *w, void *event, void *data); +static void save(Ewl_Widget *w, void *event, void *data); static void update_view(Ewl_Widget *w, void *event, void *data); static void window_fullscreen(Ewl_Widget *w, void *event, void *data); @@ -23,6 +26,7 @@ /*Ephoto Global Variables*/ Ephoto_Main *em; +Ewl_Widget *ae, *de; /*Destroy the Main Window*/ static void destroy(Ewl_Widget *w, void *event, void *data) @@ -82,6 +86,63 @@ return; } +/*Cancel the Album Dialog*/ +static void cancel(Ewl_Widget *w, void *event, void *data) +{ + Ewl_Widget *win; + + win = data; + + ewl_widget_destroy(win); +} + +/*Save the Album*/ +static void save(Ewl_Widget *w, void *event, void *data) +{ + char *album, *description; + Ewl_Widget *win; + sqlite3 *db; + + win = data; + + album = ewl_text_text_get(EWL_TEXT(ae)); + description = ewl_text_text_get(EWL_TEXT(de)); + + if (album) + { + db = ephoto_db_init(); + ephoto_db_add_album(db, album, description); + ephoto_db_close(db); + ewl_widget_destroy(win); + ewl_notebook_visible_page_set(EWL_NOTEBOOK(em->browser), em->atree); + populate_albums(NULL, NULL, NULL); + } +} + +/*Add an Album to Ephoto*/ +static void add_album(Ewl_Widget *w, void *event, void *data) +{ + Ewl_Widget *window, *label, *button, *vbox, *hbox; + + window = NULL; + window = add_window("Add Album", 200, 100, cancel, window); + + vbox = add_box(window, EWL_ORIENTATION_VERTICAL, 3); + ewl_object_fill_policy_set(EWL_OBJECT(vbox), EWL_FLAG_FILL_ALL); + + label = add_label(vbox, "Enter a name for the new album:"); + ae = add_entry(vbox, NULL, NULL, NULL); + + label = add_label(vbox, "Enter a description for the album:"); + de = add_entry(vbox, NULL, NULL, NULL); + + hbox = add_box(vbox, EWL_ORIENTATION_HORIZONTAL, 2); + ewl_object_fill_policy_set(EWL_OBJECT(hbox), EWL_FLAG_FILL_SHRINK); + + button = add_button(hbox, "Save", PACKAGE_DATA_DIR "/images/stock_save.png", save, window); + button = add_button(hbox, "Cancel", PACKAGE_DATA_DIR "/images/dialog-close.png", cancel, window); +} + /*Create the Main Ephoto Window*/ void create_main_gui(void) { @@ -102,6 +163,8 @@ mb = add_menubar(vbox); menu = add_menu(mb, "File"); mi = add_menu_item(menu, "Exit", PACKAGE_DATA_DIR "/images/exit.png", destroy, NULL); + menu = add_menu(mb, "Albums"); + mi = add_menu_item(menu, "Add Album", PACKAGE_DATA_DIR "/images/add.png", add_album, NULL); hbox = add_box(vbox, EWL_ORIENTATION_HORIZONTAL, 2); ewl_object_fill_policy_set(EWL_OBJECT(hbox), EWL_FLAG_FILL_ALL); @@ -180,6 +243,16 @@ ewl_container_child_append(EWL_CONTAINER(em->toolbar), vsep); ewl_widget_show(vsep); + button = add_button(em->toolbar, NULL, PACKAGE_DATA_DIR "/images/get_exif.png", NULL, NULL); + ewl_button_image_size_set(EWL_BUTTON(button), 30, 30); + ewl_attach_tooltip_text_set(button, "You do not have libexif 0.6.13"); + ewl_object_alignment_set(EWL_OBJECT(button), EWL_FLAG_ALIGN_LEFT); + ewl_object_fill_policy_set(EWL_OBJECT(button), EWL_FLAG_FILL_HFILL); +#ifdef BUILD_EXIF_SUPPORT + ewl_callback_append(button, EWL_CALLBACK_CLICKED, display_exif_dialog, NULL); + ewl_attach_tooltip_text_set(button, "View Exif Data"); +#endif + button = add_button(em->toolbar, NULL, PACKAGE_DATA_DIR "/images/stock_fullscreen.png", window_fullscreen, NULL); ewl_button_image_size_set(EWL_BUTTON(button), 30, 30); ewl_attach_tooltip_text_set(button, "Toggle Fullscreen"); @@ -202,12 +275,8 @@ ewl_object_fill_policy_set(EWL_OBJECT(button), EWL_FLAG_FILL_SHRINK); ewl_object_alignment_set(EWL_OBJECT(button), EWL_FLAG_ALIGN_CENTER); - em->albums = ecore_list_new(); em->db = ephoto_db_init(); - em->albums = ephoto_db_list_albums(em->db); - ewl_mvc_data_set(EWL_MVC(em->atree), em->albums); - em->current_album = strdup("Complete Library"); em->current_directory = strdup(getenv("HOME")); @@ -231,11 +300,20 @@ album = ewl_widget_name_get(w); em->current_album = strdup(album); } + if (!ecore_list_is_empty(em->albums)) + { + ecore_list_destroy(em->albums); + } if (!ecore_list_is_empty(em->images)) { ecore_dlist_destroy(em->images); } + em->albums = ecore_list_new(); + em->albums = ephoto_db_list_albums(em->db); + ewl_mvc_data_set(EWL_MVC(em->atree), em->albums); + ewl_mvc_dirty_set(EWL_MVC(em->atree), 1); + em->images = ecore_dlist_new(); em->images = ephoto_db_list_images(em->db, em->current_album); =================================================================== RCS file: /cvs/e/e17/apps/ephoto/src/bin/ephoto_single_view.c,v retrieving revision 1.5 retrieving revision 1.6 diff -u -3 -r1.5 -r1.6 --- ephoto_single_view.c 27 Apr 2007 04:37:40 -0000 1.5 +++ ephoto_single_view.c 28 Apr 2007 04:12:24 -0000 1.6 @@ -43,6 +43,7 @@ ewl_notebook_visible_page_set(EWL_NOTEBOOK(em->main_nb), em->main_vbox); ewl_notebook_visible_page_set(EWL_NOTEBOOK(em->view_box), em->single_vbox); ewl_image_file_path_set(EWL_IMAGE(em->simage), ecore_dlist_current(em->images)); + return; } ------------------------------------------------------------------------- This SF.net email is sponsored by DB2 Express Download DB2 Express C - the FREE version of DB2 express and take control of your XML. No limits. Just data. Click to get it now. http://sourceforge.net/powerbar/db2/ _______________________________________________ enlightenment-cvs mailing list enlightenment-cvs@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/enlightenment-cvs