Enlightenment CVS committal

Author  : titan
Project : e17
Module  : apps/ephoto

Dir     : e17/apps/ephoto/src/bin


Modified Files:
        ephoto.h ephoto_database.c ephoto_edit_view.c 
        ephoto_list_view.c ephoto_main.c ephoto_normal_view.c 


Log Message:
Add editing tools!

===================================================================
RCS file: /cvs/e/e17/apps/ephoto/src/bin/ephoto.h,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -3 -r1.1 -r1.2
--- ephoto.h    15 Feb 2007 10:20:21 -0000      1.1
+++ ephoto.h    18 Feb 2007 01:02:43 -0000      1.2
@@ -52,6 +52,9 @@
 unsigned int *rotate_right(Ewl_Widget *image);
 void update_image(Ewl_Widget *image, int w, int h, unsigned int *data);
 
+/* Ephoto Edit View */
+void add_edit_tools(Ewl_Widget *c);
+
 /* Ephoto List View */
 Ewl_Widget *add_ltree(Ewl_Widget *c);
 
@@ -83,6 +86,8 @@
 extern Ewl_Widget *currenta; 
 extern Ewl_Widget *currentf;
 extern Ewl_Widget *currenti;
+extern Ewl_Widget *toolbar;
+extern Ewl_Widget *edit_tools;
 extern Ecore_List *images;
 
 /* NLS */
===================================================================
RCS file: /cvs/e/e17/apps/ephoto/src/bin/ephoto_database.c,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -3 -r1.1 -r1.2
--- ephoto_database.c   15 Feb 2007 10:20:21 -0000      1.1
+++ ephoto_database.c   18 Feb 2007 01:02:43 -0000      1.2
@@ -181,7 +181,7 @@
 
        for(i = 0; i < argc; i++)
        {
-               ecore_list_append(images_list, strdup(argv[i] ? argv[i] : 
"NULL"));
+               ecore_dlist_append(images_list, strdup(argv[i] ? argv[i] : 
"NULL"));
        }
 
        return 0;
@@ -211,13 +211,13 @@
 
        if(images_list)
        {
-               ecore_list_destroy(images_list);
+               ecore_dlist_destroy(images_list);
        }
        if(image_ids)
        {
                ecore_list_destroy(image_ids);
        }
-       images_list = ecore_list_new();
+       images_list = ecore_dlist_new();
        image_ids = ecore_list_new();
        
        snprintf(command, PATH_MAX, "SELECT id FROM albums WHERE name = '%s';", 
album);
===================================================================
RCS file: /cvs/e/e17/apps/ephoto/src/bin/ephoto_edit_view.c,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -3 -r1.1 -r1.2
--- ephoto_edit_view.c  15 Feb 2007 10:20:21 -0000      1.1
+++ ephoto_edit_view.c  18 Feb 2007 01:02:43 -0000      1.2
@@ -1,6 +1,8 @@
 #include "ephoto.h"
 
 /*Ephoto Image Manipulation*/
+static void previous_image(Ewl_Widget *w, void *event, void *data);
+static void next_image(Ewl_Widget *w, void *event, void *data);
 static void flip_image_horizontal(Ewl_Widget *w, void *event, void *data);
 static void flip_image_vertical(Ewl_Widget *w, void *event, void *data);
 static void rotate_image_left(Ewl_Widget *w, void *event, void *data);
@@ -10,11 +12,78 @@
 void show_edit_view(Ewl_Widget *w, void *event, void *data)
 {
         ewl_notebook_visible_page_set(EWL_NOTEBOOK(view_box), edit_vbox);
+       ecore_dlist_goto_first(images);
+       ewl_widget_show(edit_tools);
         ewl_widget_hide(atree);
         ewl_widget_hide(tbar);
         ewl_widget_hide(ilabel);
         ewl_widget_reparent(eimage);
 }
+
+/*Add edit tools to container c*/
+void add_edit_tools(Ewl_Widget *c)
+{
+       Ewl_Widget *image;
+
+        image = add_image(c, PACKAGE_DATA_DIR 
"/images/media-seek-backward.png", 0, previous_image, NULL);
+        ewl_image_constrain_set(EWL_IMAGE(image), 30);
+
+        image = add_image(c, PACKAGE_DATA_DIR 
"/images/media-seek-forward.png", 0, next_image, NULL);
+        ewl_image_constrain_set(EWL_IMAGE(image), 30);
+
+       image = add_image(c, PACKAGE_DATA_DIR "/images/undo.png", 0, 
rotate_image_left, NULL);
+       ewl_image_constrain_set(EWL_IMAGE(image), 30);
+
+        image = add_image(c, PACKAGE_DATA_DIR "/images/redo.png", 0, 
rotate_image_right, NULL);
+        ewl_image_constrain_set(EWL_IMAGE(image), 30);
+
+        image = add_image(c, PACKAGE_DATA_DIR "/images/go-next.png", 0, 
flip_image_horizontal, NULL);
+        ewl_image_constrain_set(EWL_IMAGE(image), 30);
+
+        image = add_image(c, PACKAGE_DATA_DIR "/images/go-down.png", 0, 
flip_image_vertical, NULL);
+        ewl_image_constrain_set(EWL_IMAGE(image), 30);
+
+       return;
+}
+
+/*Go to the previous image*/
+static void previous_image(Ewl_Widget *w, void *event, void *data)
+{
+        char *image;
+
+        ecore_dlist_previous(images);
+        image = ecore_dlist_current(images);
+       if(!image)
+       {
+               ecore_dlist_goto_last(images);
+               image = ecore_dlist_current(images);
+       }
+        ewl_image_file_path_set(EWL_IMAGE(eimage), image);
+        ewl_widget_configure(eimage->parent);
+
+        return;
+}
+
+
+/*Go to the next image*/
+static void next_image(Ewl_Widget *w, void *event, void *data)
+{
+       char *image;
+
+       ecore_dlist_next(images);
+       image = ecore_dlist_current(images);
+       if(!image)
+       {
+               ecore_dlist_goto_first(images);
+               image = ecore_dlist_current(images);
+       }
+       ewl_image_file_path_set(EWL_IMAGE(eimage), image);
+       ewl_widget_configure(eimage->parent);
+
+       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_list_view.c,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -3 -r1.1 -r1.2
--- ephoto_list_view.c  15 Feb 2007 10:20:21 -0000      1.1
+++ ephoto_list_view.c  18 Feb 2007 01:02:43 -0000      1.2
@@ -11,7 +11,8 @@
 {
         ewl_notebook_visible_page_set(EWL_NOTEBOOK(view_box), list_vbox);
         ewl_mvc_dirty_set(EWL_MVC(ltree), 1);
-        ewl_widget_hide(ilabel);
+        ewl_widget_hide(edit_tools);
+       ewl_widget_hide(ilabel);
         ewl_widget_show(atree);
         ewl_widget_show(tbar);
 }
===================================================================
RCS file: /cvs/e/e17/apps/ephoto/src/bin/ephoto_main.c,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -3 -r1.2 -r1.3
--- ephoto_main.c       16 Feb 2007 05:06:34 -0000      1.2
+++ ephoto_main.c       18 Feb 2007 01:02:43 -0000      1.3
@@ -30,8 +30,8 @@
 static int views_data_count(void *data);
 
 /*Ephoto Global Variables*/
-Ewl_Widget *atree, *tbar, *vcombo, *view_box, *fbox_vbox, *edit_vbox, 
*list_vbox; 
-Ewl_Widget *fbox, *eimage, *ltree, *ilabel, *currenta, *currentf, *currenti;
+Ewl_Widget *atree, *tbar, *vcombo, *view_box, *fbox_vbox, *edit_vbox, 
*list_vbox, *fbox; 
+Ewl_Widget *eimage, *ltree, *ilabel, *currenta, *currentf, *currenti, 
*toolbar, *edit_tools;
 Ecore_List *images;
 
 
@@ -68,10 +68,8 @@
 /*Create the Main Ephoto Window*/
 void create_main_gui(void)
 {
-       Ecore_List *images;
-
        Ewl_Widget *win, *vbox, *spacer, *text, *entry, *hbox;
-       Ewl_Widget *rvbox, *sp, *hsep, *toolbar, *vsep, *image;
+       Ewl_Widget *rvbox, *sp, *hsep, *vsep, *image;
        Ewl_Widget *shbox, *seeker;
 
        win = ewl_window_new();
@@ -206,16 +204,24 @@
         image = add_image(toolbar, PACKAGE_DATA_DIR "/images/get_exif.png", 0, 
display_exif_dialog, NULL);
         ewl_image_constrain_set(EWL_IMAGE(image), 30);
 
-        vsep = ewl_vseparator_new();
-        ewl_container_child_append(EWL_CONTAINER(toolbar), vsep);
-        ewl_widget_show(vsep);
-
         image = add_image(toolbar, PACKAGE_DATA_DIR 
"/images/stock_fullscreen.png", 0, window_fullscreen, win);
         ewl_image_constrain_set(EWL_IMAGE(image), 30);
 
         image = add_image(toolbar, PACKAGE_DATA_DIR 
"/images/x-office-presentation.png", 0, NULL, NULL);
         ewl_image_constrain_set(EWL_IMAGE(image), 30);
 
+        vsep = ewl_vseparator_new();
+        ewl_container_child_append(EWL_CONTAINER(toolbar), vsep);
+        ewl_widget_show(vsep);
+
+       edit_tools = ewl_hbox_new();
+       ewl_object_fill_policy_set(EWL_OBJECT(edit_tools), EWL_FLAG_FILL_HFILL);
+       ewl_container_child_append(EWL_CONTAINER(toolbar), edit_tools);
+       ewl_widget_show(edit_tools);
+
+       add_edit_tools(edit_tools);
+       ewl_widget_hide(edit_tools);
+
        albums = ecore_list_new();
        db = ephoto_db_init();
        albums = ephoto_db_list_albums(db);
@@ -254,31 +260,31 @@
 
        if (images)
        {
-               ecore_list_destroy(images);
+               ecore_dlist_destroy(images);
        }
 
-       images = ecore_list_new();
+       images = ecore_dlist_new();
        images = ephoto_db_list_images(db, album);
 
-       ecore_list_goto_first(images);
+       ecore_dlist_goto_first(images);
        ewl_container_reset(EWL_CONTAINER(fbox));
-        while (ecore_list_current(images))
+        while (ecore_dlist_current(images))
         {
-                imagef = ecore_list_current(images);
+                imagef = ecore_dlist_current(images);
 
                 thumb = add_image(fbox, imagef, 1, set_info, NULL);
                ewl_object_alignment_set(EWL_OBJECT(thumb), 
EWL_FLAG_ALIGN_CENTER);
                ewl_widget_name_set(thumb, imagef);
 
-               ecore_list_next(images);
+               ecore_dlist_next(images);
         }
 
-       ecore_list_goto_first(images);
+       ecore_dlist_goto_first(images);
 
         ewl_mvc_data_set(EWL_MVC(ltree), images);
        ewl_mvc_dirty_set(EWL_MVC(ltree), 1);
        
-       ewl_image_file_set(EWL_IMAGE(eimage), ecore_list_current(images), NULL);
+       ewl_image_file_set(EWL_IMAGE(eimage), ecore_dlist_current(images), 
NULL);
 
        return;
 }
===================================================================
RCS file: /cvs/e/e17/apps/ephoto/src/bin/ephoto_normal_view.c,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -3 -r1.1 -r1.2
--- ephoto_normal_view.c        15 Feb 2007 10:20:21 -0000      1.1
+++ ephoto_normal_view.c        18 Feb 2007 01:02:43 -0000      1.2
@@ -7,6 +7,7 @@
         ewl_widget_show(atree);
         ewl_widget_show(tbar);
         ewl_widget_show(ilabel);
+       ewl_widget_hide(edit_tools);
         ewl_widget_configure(fbox);
 }
 



-------------------------------------------------------------------------
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

Reply via email to