Enlightenment CVS committal

Author  : codewarrior
Project : e17
Module  : proto

Dir     : e17/proto/exhibit/src/bin


Modified Files:
        Makefile.am exhibit.h exhibit_main.c exhibit_main.h 
        exhibit_menus.c 
Added Files:
        exhibit_slideshow.c exhibit_slideshow.h 


Log Message:
exhibit:
- couple of bug fixes (and a segv)
- add slideshow support (ctrl-s to start / stop, delay is 5.0 secs right now, 
when options window is added, the user can change that)


===================================================================
RCS file: /cvsroot/enlightenment/e17/proto/exhibit/src/bin/Makefile.am,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -3 -r1.3 -r1.4
--- Makefile.am 26 Dec 2005 12:17:29 -0000      1.3
+++ Makefile.am 2 Jan 2006 14:47:45 -0000       1.4
@@ -16,7 +16,8 @@
 exhibit_menus.h \
 exhibit_sort.h \
 exhibit_thumb.h \
-exhibit_tab.h
+exhibit_tab.h \
+exhibit_slideshow.h
 
 exhibit_SOURCES = \
 exhibit_file.c \
@@ -26,6 +27,7 @@
 exhibit_sort.c \
 exhibit_thumb.c \
 exhibit_tab.c \
+exhibit_slideshow.c \
 $(exhibit_includes)
 
 exhibit_LDADD = @my_libs@
===================================================================
RCS file: /cvsroot/enlightenment/e17/proto/exhibit/src/bin/exhibit.h,v
retrieving revision 1.9
retrieving revision 1.10
diff -u -3 -r1.9 -r1.10
--- exhibit.h   1 Jan 2006 23:49:22 -0000       1.9
+++ exhibit.h   2 Jan 2006 14:47:45 -0000       1.10
@@ -72,31 +72,21 @@
    Etk_Widget    *menu_bar;
    Etk_Widget    *statusbar[4];
    Etk_Widget    *notebook;
-//   Etk_Widget    *scrolled_view;
-//   Etk_Widget    *alignment;
    Etk_Widget    *table;
    Etk_Widget    *hpaned;
    Etk_Widget    *vpaned;
-//   Etk_Widget    *dtree;
-//   Etk_Widget    *itree;
    Etk_Widget    *entry[2];
    Etk_Widget    *zoom_in[2];
    Etk_Widget    *zoom_out[2];
    Etk_Widget    *fit[2];
    Etk_Widget    *original[2];
-//   Etk_Widget    *image;
    Etk_Widget    *sort;
    Etk_Widget    *sizebar;
    Etk_Widget    *resbar;
    Etk_Widget    *zoombar;
-//   Etk_Tree_Col  *dcol;
-//   Etk_Tree_Col  *icol;
    Etk_Widget    *menu;
    Etk_Widget    *win;
 
-//   Evas_List     *images;
-//   Evas_List     *dirs;
-
    char          *dir;
    char           cur_path[PATH_MAX];   
 
@@ -112,6 +102,12 @@
       int x;
       int y;
    } mouse;
+   
+   struct {
+      double       interval;
+      Ecore_Timer *timer;
+      Etk_Bool     active;
+   } slideshow;
 };
 
 struct _Ex_Thumb
@@ -146,5 +142,6 @@
 #include "exhibit_sort.h"
 #include "exhibit_thumb.h"
 #include "exhibit_tab.h"
-  
+#include "exhibit_slideshow.h"
+
 #endif
===================================================================
RCS file: /cvsroot/enlightenment/e17/proto/exhibit/src/bin/exhibit_main.c,v
retrieving revision 1.28
retrieving revision 1.29
diff -u -3 -r1.28 -r1.29
--- exhibit_main.c      1 Jan 2006 23:49:22 -0000       1.28
+++ exhibit_main.c      2 Jan 2006 14:47:45 -0000       1.29
@@ -212,8 +212,9 @@
    Exhibit *e;
 
    e = data;
+   _ex_slideshow_stop(e);
+   
    tree = ETK_TREE(object);
-
    etk_tree_row_fields_get(row, etk_tree_nth_col_get(tree, 0), NULL, NULL, 
&dcol_string, NULL);
 
    free(e->dir);
@@ -444,8 +445,11 @@
           thumb->e = e;
           thumb->name = strdup(dir_entry->d_name);
           thumb_list = evas_list_append(thumb_list, thumb);
-          if(!strcmp(selected_file, dir_entry->d_name))
-            thumb->selected = TRUE;
+          if(selected_file)
+            {
+               if(!strcmp(selected_file, dir_entry->d_name))
+                 thumb->selected = TRUE;
+            }
           else
             thumb->selected = FALSE;
           if(pid == -1) _ex_thumb_generate();
@@ -558,6 +562,7 @@
    
    if(!strcmp(ev->key, "Return") || !strcmp(ev->key, "KP_Enter"))
      {
+       _ex_slideshow_stop(e);
         e->cur_tab->dir = 
strdup((char*)etk_entry_text_get(ETK_ENTRY(e->entry[0])));
         etk_tree_clear(ETK_TREE(e->cur_tab->itree));
         etk_tree_clear(ETK_TREE(e->cur_tab->dtree));
@@ -621,6 +626,23 @@
          {
             etk_main_quit();
          }
+       else if(!strcmp(ev->key, "s"))
+         {
+            _ex_main_window_slideshow_toggle(e);
+         }
+     }
+}
+
+void
+_ex_main_window_slideshow_toggle(Exhibit *e)
+{
+   if(e->slideshow.active)
+     {
+       _ex_slideshow_stop(e);
+     }
+   else
+     {
+       _ex_slideshow_start(e);
      }
 }
 
@@ -631,6 +653,7 @@
    Ex_Tab  *tab;
    
    e = data;
+   _ex_slideshow_stop(e);
    tab = evas_list_nth(e->tabs, 
etk_notebook_current_page_get(ETK_NOTEBOOK(object)));
 
    e->cur_tab = tab;
@@ -674,7 +697,9 @@
    e->mouse.down = 0;
    e->menu = NULL;
    e->tabs = NULL;
-
+   e->slideshow.active = FALSE;
+   e->slideshow.interval = 5.0;
+   
    file = NULL;
    tab = NULL;
    
@@ -873,7 +898,7 @@
    e->statusbar[2] = etk_statusbar_new();
    etk_statusbar_has_resize_grip_set(ETK_STATUSBAR(e->statusbar[2]), FALSE);   
    etk_box_pack_start(ETK_BOX(e->hbox), e->statusbar[2], TRUE, TRUE, 0);   
-   etk_statusbar_push(ETK_STATUSBAR(e->statusbar[2]), "1:1", 0); // <=- temp.
+   etk_statusbar_push(ETK_STATUSBAR(e->statusbar[2]), "1:1", 0);
    
    e->statusbar[3] = etk_statusbar_new();
    etk_box_pack_start(ETK_BOX(e->hbox), e->statusbar[3], FALSE, FALSE, 0);
===================================================================
RCS file: /cvsroot/enlightenment/e17/proto/exhibit/src/bin/exhibit_main.h,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -3 -r1.5 -r1.6
--- exhibit_main.h      1 Jan 2006 23:49:22 -0000       1.5
+++ exhibit_main.h      2 Jan 2006 14:47:45 -0000       1.6
@@ -16,6 +16,8 @@
 int          _ex_main_dtree_compare_cb(Etk_Tree *tree, Etk_Tree_Row *row1, 
Etk_Tree_Row *row2, Etk_Tree_Col *col, void *data);
 void         _ex_main_populate_files(Exhibit *e, char *selected_file);
 void         _ex_main_entry_dir_key_down_cb(Etk_Object *object, void *event, 
void *data);
+int          _ex_main_window_slideshow_next(void *data);
+void         _ex_main_window_slideshow_toggle(Exhibit *e);    
 void         _ex_main_goto_dir_clicked_cb(Etk_Object *object, void *data);
 Etk_Bool     _ex_main_window_deleted_cb(void *data);
 void         _ex_main_window_key_down_cb(Etk_Object *object, void *event, void 
*data);
===================================================================
RCS file: /cvsroot/enlightenment/e17/proto/exhibit/src/bin/exhibit_menus.c,v
retrieving revision 1.12
retrieving revision 1.13
diff -u -3 -r1.12 -r1.13
--- exhibit_menus.c     26 Dec 2005 12:17:30 -0000      1.12
+++ exhibit_menus.c     2 Jan 2006 14:47:45 -0000       1.13
@@ -307,8 +307,11 @@
 void
 _ex_menu_toggle_slideshow_cb(Etk_Object *obj, void *data)
 {
+   Exhibit      *e;   
    EX_MENU_ITEM_GET_RETURN(obj);
-   printf("toggle slideshow\n");
+   
+   e = data;   
+   _ex_main_window_slideshow_toggle(e);
 }
 
 void




-------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc. Do you grep through log files
for problems?  Stop!  Download the new AJAX search engine that makes
searching your log files as easy as surfing the  web.  DOWNLOAD SPLUNK!
http://ads.osdn.com/?ad_id=7637&alloc_id=16865&op=click
_______________________________________________
enlightenment-cvs mailing list
enlightenment-cvs@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/enlightenment-cvs

Reply via email to