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_list_view.c ephoto_main.c 
        ephoto_normal_view.c 


Log Message:
Make some changes to layout to make it seem more modular. Also change the 
toolbar to use image buttons.

===================================================================
RCS file: /cvs/e/e17/apps/ephoto/src/bin/ephoto.h,v
retrieving revision 1.6
retrieving revision 1.7
diff -u -3 -r1.6 -r1.7
--- ephoto.h    25 Feb 2007 04:30:57 -0000      1.6
+++ ephoto.h    11 Mar 2007 01:14:47 -0000      1.7
@@ -120,7 +120,6 @@
        Ewl_Widget *ltree;
        Ewl_Widget *tbar;
        Ewl_Widget *toolbar;
-       Ewl_Widget *vcombo;
        Ewl_Widget *view_box;
        Ewl_Widget *win;
        sqlite3 *db;
===================================================================
RCS file: /cvs/e/e17/apps/ephoto/src/bin/ephoto_edit_view.c,v
retrieving revision 1.7
retrieving revision 1.8
diff -u -3 -r1.7 -r1.8
--- ephoto_edit_view.c  24 Feb 2007 22:57:09 -0000      1.7
+++ ephoto_edit_view.c  11 Mar 2007 01:14:47 -0000      1.8
@@ -29,9 +29,6 @@
 {
         ewl_notebook_visible_page_set(EWL_NOTEBOOK(em->view_box), 
em->edit_vbox);
        ecore_dlist_goto_first(em->images);
-       ewl_widget_enable(em->edit_tools);
-        ewl_widget_hide(em->atree);
-        ewl_widget_hide(em->tbar);
         ewl_widget_hide(em->ilabel);
 }
 
===================================================================
RCS file: /cvs/e/e17/apps/ephoto/src/bin/ephoto_list_view.c,v
retrieving revision 1.9
retrieving revision 1.10
diff -u -3 -r1.9 -r1.10
--- ephoto_list_view.c  25 Feb 2007 04:30:57 -0000      1.9
+++ ephoto_list_view.c  11 Mar 2007 01:14:47 -0000      1.10
@@ -26,9 +26,6 @@
 {
         ewl_notebook_visible_page_set(EWL_NOTEBOOK(em->view_box), 
em->list_vbox);
         ewl_mvc_dirty_set(EWL_MVC(em->ltree), 1);
-       ewl_widget_disable(em->edit_tools);
-        ewl_widget_show(em->atree);
-        ewl_widget_show(em->tbar);
        ewl_widget_hide(em->ilabel);
 }
 
===================================================================
RCS file: /cvs/e/e17/apps/ephoto/src/bin/ephoto_main.c,v
retrieving revision 1.8
retrieving revision 1.9
diff -u -3 -r1.8 -r1.9
--- ephoto_main.c       24 Feb 2007 23:30:49 -0000      1.8
+++ ephoto_main.c       11 Mar 2007 01:14:47 -0000      1.9
@@ -1,14 +1,12 @@
 #include "ephoto.h"
 
 /*Ewl Callbacks*/
-static void combo_changed(Ewl_Widget *w, void *event, void *data);
 static void destroy(Ewl_Widget *w, void *event, void *data);
 static void populate(Ewl_Widget *w, void *event, void *data);
 static void window_fullscreen(Ewl_Widget *w, void *event, void *data);
 
 /*Ephoto Create Callbacks*/
 static Ewl_Widget *add_atree(Ewl_Widget *c);
-static Ewl_Widget *add_vcombo(Ewl_Widget *c);
 
 /*Ephoto MVC Callbacks*/
 static Ewl_Widget *album_view_new(void);
@@ -16,9 +14,6 @@
 static Ewl_Widget *album_header_fetch(void *data, int column);
 static void *album_data_fetch(void *data, unsigned int row, unsigned int 
column);
 static int album_data_count(void *data);
-static Ewl_Widget *views_header_fetch(void *data, int column);
-static void *views_data_fetch(void *data, unsigned int row, unsigned int 
column);
-static int views_data_count(void *data);
 
 /*Ephoto Global Variables*/
 Ephoto_Main *em;
@@ -55,8 +50,8 @@
 /*Create the Main Ephoto Window*/
 void create_main_gui(void)
 {
-       Ewl_Widget *vbox, *spacer, *entry, *hbox;
-       Ewl_Widget *rvbox, *hsep, *vsep, *image;
+       Ewl_Widget *vbox, *entry, *hbox;
+       Ewl_Widget *rvbox, *hsep, *vsep, *button;
 
        em = NULL;
        em = calloc(1, sizeof(Ephoto_Main));
@@ -80,14 +75,6 @@
        ewl_container_child_append(EWL_CONTAINER(vbox), em->tbar);
        ewl_widget_show(em->tbar);
 
-       em->vcombo = add_vcombo(em->tbar);
-       
-       spacer = ewl_spacer_new();
-       ewl_object_minimum_w_set(EWL_OBJECT(spacer), 100);
-       ewl_object_maximum_w_set(EWL_OBJECT(spacer), 100);
-       ewl_container_child_append(EWL_CONTAINER(em->tbar), spacer);
-       ewl_widget_show(spacer);
-
        entry = ewl_entry_new();
        ewl_object_minimum_size_set(EWL_OBJECT(entry), 157, 22);
        ewl_object_maximum_size_set(EWL_OBJECT(entry), 157, 22);
@@ -135,62 +122,34 @@
        ewl_container_child_append(EWL_CONTAINER(vbox), em->toolbar);
        ewl_widget_show(em->toolbar);
 
-        image = add_image(em->toolbar, PACKAGE_DATA_DIR 
"/images/normal_view.png", 0, show_normal_view, NULL);
-        ewl_image_constrain_set(EWL_IMAGE(image), 30);
-       ewl_attach_tooltip_text_set(image, "Normal View");
-
-        vsep = ewl_vseparator_new();
-        ewl_container_child_append(EWL_CONTAINER(em->toolbar), vsep);
-        ewl_widget_show(vsep);
-
-        image = add_image(em->toolbar, PACKAGE_DATA_DIR 
"/images/list_view.png", 0, show_list_view, NULL);
-        ewl_image_constrain_set(EWL_IMAGE(image), 30);
-       ewl_attach_tooltip_text_set(image, "List View");      
-
-        vsep = ewl_vseparator_new();
-        ewl_container_child_append(EWL_CONTAINER(em->toolbar), vsep);
-        ewl_widget_show(vsep);
-
-       image = add_image(em->toolbar, PACKAGE_DATA_DIR 
"/images/edit_view.png", 0, show_edit_view, NULL);
-        ewl_image_constrain_set(EWL_IMAGE(image), 30);
-       ewl_attach_tooltip_text_set(image, "Edit View");
+        button = add_button(em->toolbar, NULL, PACKAGE_DATA_DIR 
"/images/normal_view.png", show_normal_view, NULL);
+        ewl_image_size_set(EWL_IMAGE(EWL_BUTTON(button)->image_object), 30, 
30);
+       ewl_attach_tooltip_text_set(button, "Normal View");
+
+        button = add_button(em->toolbar, NULL, PACKAGE_DATA_DIR 
"/images/list_view.png", show_list_view, NULL);
+        ewl_image_size_set(EWL_IMAGE(EWL_BUTTON(button)->image_object), 30, 
30);
+       ewl_attach_tooltip_text_set(button, "List View");      
+
+       button = add_button(em->toolbar, NULL, PACKAGE_DATA_DIR 
"/images/edit_view.png", show_edit_view, NULL);
+        ewl_image_size_set(EWL_IMAGE(EWL_BUTTON(button)->image_object), 30, 
30);
+       ewl_attach_tooltip_text_set(button, "Single View");
 
        vsep = ewl_vseparator_new();
        ewl_container_child_append(EWL_CONTAINER(em->toolbar), vsep);
        ewl_widget_show(vsep);
 
-        image = add_image(em->toolbar, PACKAGE_DATA_DIR 
"/images/get_exif.png", 0, display_exif_dialog, NULL);
-        ewl_image_constrain_set(EWL_IMAGE(image), 30);
-       ewl_attach_tooltip_text_set(image, "View Exif");
-
-        vsep = ewl_vseparator_new();
-        ewl_container_child_append(EWL_CONTAINER(em->toolbar), vsep);
-        ewl_widget_show(vsep);
-
-        image = add_image(em->toolbar, PACKAGE_DATA_DIR 
"/images/stock_fullscreen.png", 0, window_fullscreen, NULL);
-        ewl_image_constrain_set(EWL_IMAGE(image), 30);
-       ewl_attach_tooltip_text_set(image, "Fullscreen");
-
-        vsep = ewl_vseparator_new();
-        ewl_container_child_append(EWL_CONTAINER(em->toolbar), vsep);
-        ewl_widget_show(vsep);
-
-        image = add_image(em->toolbar, PACKAGE_DATA_DIR 
"/images/x-office-presentation.png", 0, NULL, NULL);
-        ewl_image_constrain_set(EWL_IMAGE(image), 30);
-       ewl_attach_tooltip_text_set(image, "Slideshow");
-
-        vsep = ewl_vseparator_new();
-        ewl_container_child_append(EWL_CONTAINER(em->toolbar), vsep);
-        ewl_widget_show(vsep);
-
-       em->edit_tools = ewl_hbox_new();
-       ewl_object_fill_policy_set(EWL_OBJECT(em->edit_tools), 
EWL_FLAG_FILL_HFILL);
-       ewl_container_child_append(EWL_CONTAINER(em->toolbar), em->edit_tools);
-       ewl_widget_show(em->edit_tools);
+        button = add_button(em->toolbar, NULL, PACKAGE_DATA_DIR 
"/images/get_exif.png", display_exif_dialog, NULL);
+        ewl_image_size_set(EWL_IMAGE(EWL_BUTTON(button)->image_object), 30, 
30);
+       ewl_attach_tooltip_text_set(button, "View Exif Data");
+
+        button = add_button(em->toolbar, NULL, PACKAGE_DATA_DIR 
"/images/stock_fullscreen.png", window_fullscreen, NULL);
+        ewl_image_size_set(EWL_IMAGE(EWL_BUTTON(button)->image_object), 30, 
30);
+       ewl_attach_tooltip_text_set(button, "Toggle Fullscreen");
+
+        button = add_button(em->toolbar, NULL, PACKAGE_DATA_DIR 
"/images/x-office-presentation.png", NULL, NULL);
+       ewl_image_size_set(EWL_IMAGE(EWL_BUTTON(button)->image_object), 30, 30);
+       ewl_attach_tooltip_text_set(button, "Start a Slideshow");
 
-       add_edit_tools(em->edit_tools);
-       ewl_widget_disable(em->edit_tools);
-       
        em->albums = ecore_list_new();
        em->db = ephoto_db_init();
        em->albums = ephoto_db_list_albums(em->db);
@@ -255,87 +214,6 @@
        ewl_mvc_dirty_set(EWL_MVC(em->ltree), 1);
        
        ewl_image_file_set(EWL_IMAGE(em->eimage), 
ecore_dlist_current(em->images), NULL);
-
-       return;
-}
-
-/*Create the view combo*/
-static Ewl_Widget *add_vcombo(Ewl_Widget *c)
-{
-       Ewl_Widget *combo;
-       Ewl_Model *model;
-       Ewl_View *view;
-
-       em->views = calloc(3, sizeof(char *));
-       em->views[0] = strdup("Normal");
-       em->views[1] = strdup("List");
-       em->views[2] = strdup("Edit");
-
-       model = ewl_model_new();
-       ewl_model_fetch_set(model, views_data_fetch);
-       ewl_model_count_set(model, views_data_count);
-
-       view = ewl_view_new();
-       ewl_view_constructor_set(view, ewl_label_new);
-       ewl_view_assign_set(view, EWL_VIEW_ASSIGN(ewl_label_text_set));
-       ewl_view_header_fetch_set(view, views_header_fetch);
-
-       combo = ewl_combo_new();
-       ewl_mvc_model_set(EWL_MVC(combo), model);
-       ewl_mvc_view_set(EWL_MVC(combo), view);
-       ewl_mvc_data_set(EWL_MVC(combo), em->views);
-       ewl_object_fill_policy_set(EWL_OBJECT(combo), EWL_FLAG_FILL_SHRINK);
-       ewl_container_child_append(EWL_CONTAINER(c), combo);
-       ewl_callback_append(combo, EWL_CALLBACK_VALUE_CHANGED, combo_changed, 
NULL);
-       ewl_widget_show(combo);
-
-       return combo;
-}
-
-/*Create a header for the view combo*/
-static Ewl_Widget *views_header_fetch(void *data, int col)
-{
-       Ewl_Widget *header;
-
-       header = ewl_label_new();
-       ewl_label_text_set(EWL_LABEL(header), "Select a View");
-       ewl_widget_show(header);
-
-       return header;
-}
-
-/*Get the data for the view combo*/
-static void *views_data_fetch(void *data, unsigned int row, unsigned int col)
-{
-       if (row < 3) return em->views[row];
-       else return NULL;
-}
-
-/*Show the number of items in the view*/
-static int views_data_count(void *data)
-{
-       return 3;
-}
-
-/*Switch between views when the combo changes*/
-static void combo_changed(Ewl_Widget *w, void *event, void *data)
-{
-       Ewl_Selection_Idx *idx;
-
-       idx = ewl_mvc_selected_get(EWL_MVC(w));
-
-       if (!strcmp(em->views[idx->row], "Normal"))
-       {
-               show_normal_view(NULL, NULL, NULL);
-       }
-       else if (!strcmp(em->views[idx->row], "Edit"))
-       {
-               show_edit_view(NULL, NULL, NULL);
-       }
-       else if (!strcmp(em->views[idx->row], "List"))
-       {
-               show_list_view(NULL, NULL, NULL);
-       }
 
        return;
 }
===================================================================
RCS file: /cvs/e/e17/apps/ephoto/src/bin/ephoto_normal_view.c,v
retrieving revision 1.7
retrieving revision 1.8
diff -u -3 -r1.7 -r1.8
--- ephoto_normal_view.c        25 Feb 2007 04:47:38 -0000      1.7
+++ ephoto_normal_view.c        11 Mar 2007 01:14:47 -0000      1.8
@@ -32,9 +32,6 @@
 void show_normal_view(Ewl_Widget *w, void *event, void *data)
 {
        ewl_notebook_visible_page_set(EWL_NOTEBOOK(em->view_box), 
em->fbox_vbox);
-       ewl_widget_disable(em->edit_tools);
-        ewl_widget_show(em->atree);
-        ewl_widget_show(em->tbar);
         ewl_widget_show(em->ilabel);
 }
 



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