Enlightenment CVS committal

Author  : titan
Project : e17
Module  : apps/ephoto

Dir     : e17/apps/ephoto/src/bin


Modified Files:
        ephoto_edit_view.c ephoto_list_view.c ephoto_main.c 
        ephoto_normal_view.c ephoto_single_view.c 


Log Message:
Add functionality to go to single view when an image from normal view or list 
view is clicked.
Also add functionality to keep the current image when moving to edit view.

===================================================================
RCS file: /cvs/e/e17/apps/ephoto/src/bin/ephoto_edit_view.c,v
retrieving revision 1.12
retrieving revision 1.13
diff -u -3 -r1.12 -r1.13
--- ephoto_edit_view.c  19 Apr 2007 03:17:11 -0000      1.12
+++ ephoto_edit_view.c  19 Apr 2007 04:09:15 -0000      1.13
@@ -70,7 +70,6 @@
 void show_edit_view(Ewl_Widget *w, void *event, void *data)
 {
         ewl_notebook_visible_page_set(EWL_NOTEBOOK(em->main_nb), 
em->edit_vbox);
-       ecore_dlist_goto_first(em->images);
        ewl_image_file_path_set(EWL_IMAGE(em->eimage), 
ecore_dlist_current(em->images));
        return;
 }
===================================================================
RCS file: /cvs/e/e17/apps/ephoto/src/bin/ephoto_list_view.c,v
retrieving revision 1.18
retrieving revision 1.19
diff -u -3 -r1.18 -r1.19
--- ephoto_list_view.c  3 Apr 2007 20:12:01 -0000       1.18
+++ ephoto_list_view.c  19 Apr 2007 04:09:15 -0000      1.19
@@ -2,7 +2,9 @@
 
 static Ewl_Widget *list_view_new(void *data, unsigned int row, unsigned int 
column);
 static Ewl_Widget *list_header_fetch(void *data, unsigned int column);
+static void iterate(char *point2);
 static void *list_data_fetch(void *data, unsigned int row, unsigned int 
column);
+static void list_item_clicked(Ewl_Widget *w, void *event, void *data);
 static unsigned int list_data_count(void *data);
 
 /*Add the list view*/
@@ -23,6 +25,32 @@
         ewl_notebook_visible_page_set(EWL_NOTEBOOK(em->view_box), 
em->list_vbox);
 }
 
+/*Iterate the list to our spot*/
+static void iterate(char *point2)
+{
+        char *point1;
+
+        ecore_dlist_goto_first(em->images);
+        while(ecore_dlist_current(em->images))
+        {
+                point1 = ecore_dlist_current(em->images);
+                if (!strcmp(point1, point2)) return;
+                ecore_dlist_next(em->images);
+        }
+}
+
+/*Go to single view*/
+static void list_item_clicked(Ewl_Widget *w, void *event, void *data)
+{
+       char *image;
+
+       image = data;
+       iterate(image);
+       show_single_view(NULL, NULL, NULL);
+
+       free(image);
+}
+
 /*Create and Add a Tree to the Container c*/
 Ewl_Widget *add_ltree(Ewl_Widget *c)
 {
@@ -71,7 +99,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, list_item_clicked, 
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.23
retrieving revision 1.24
diff -u -3 -r1.23 -r1.24
--- ephoto_main.c       19 Apr 2007 03:17:11 -0000      1.23
+++ ephoto_main.c       19 Apr 2007 04:09:15 -0000      1.24
@@ -221,7 +221,7 @@
                 imagef = ecore_dlist_current(em->images);
 
                 thumb = add_image(em->fbox, imagef, 1, freebox_image_clicked, 
NULL);
-               ewl_image_constrain_set(EWL_IMAGE(thumb), 64);
+               ewl_image_constrain_set(EWL_IMAGE(thumb), 81);
                ewl_object_alignment_set(EWL_OBJECT(thumb), 
EWL_FLAG_ALIGN_CENTER);
                ewl_widget_name_set(thumb, imagef);
 
@@ -284,7 +284,7 @@
                        imagef = ecore_dlist_current(em->images);
        
                        thumb = add_image(em->fbox, imagef, 1, 
freebox_image_clicked, NULL);
-                       ewl_image_constrain_set(EWL_IMAGE(thumb), 64);
+                       ewl_image_constrain_set(EWL_IMAGE(thumb), 81);
                                ewl_object_alignment_set(EWL_OBJECT(thumb), 
EWL_FLAG_ALIGN_CENTER);
                        ewl_widget_name_set(thumb, imagef);
 
===================================================================
RCS file: /cvs/e/e17/apps/ephoto/src/bin/ephoto_normal_view.c,v
retrieving revision 1.11
retrieving revision 1.12
diff -u -3 -r1.11 -r1.12
--- ephoto_normal_view.c        30 Mar 2007 02:47:16 -0000      1.11
+++ ephoto_normal_view.c        19 Apr 2007 04:09:15 -0000      1.12
@@ -1,5 +1,7 @@
 #include "ephoto.h"
 
+static void iterate(char *point2);
+
 /*Add the normal view*/
 Ewl_Widget *add_normal_view(Ewl_Widget *c)
 {
@@ -28,13 +30,29 @@
        ewl_notebook_visible_page_set(EWL_NOTEBOOK(em->view_box), 
em->fbox_vbox);
 }
 
+/*Find our spot in the list*/
+static void iterate(char *point2)
+{
+       char *point1;
+       
+       ecore_dlist_goto_first(em->images);
+       while(ecore_dlist_current(em->images))
+       {
+               point1 = ecore_dlist_current(em->images);
+               if (!strcmp(point1, point2)) return;
+               ecore_dlist_next(em->images);
+       }
+}
+
 /*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));
+       iterate(strdup(path));
+       show_single_view(NULL, NULL, NULL);
 
        return;
 }
===================================================================
RCS file: /cvs/e/e17/apps/ephoto/src/bin/ephoto_single_view.c,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -3 -r1.1 -r1.2
--- ephoto_single_view.c        19 Apr 2007 03:17:11 -0000      1.1
+++ ephoto_single_view.c        19 Apr 2007 04:09:15 -0000      1.2
@@ -36,7 +36,6 @@
 void show_single_view(Ewl_Widget *w, void *event, void *data)
 {
         ewl_notebook_visible_page_set(EWL_NOTEBOOK(em->view_box), 
em->single_vbox);
-       ecore_dlist_goto_first(em->images);
        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

Reply via email to