Enlightenment CVS committal

Author  : balony
Project : e17
Module  : proto

Dir     : e17/proto/exhibit/src/bin


Modified Files:
        exhibit_comment_jpeg.c exhibit_file.c exhibit_file.h 
        exhibit_image.c exhibit_main.c exhibit_menus.c 
        exhibit_options.c exhibit_options.h exhibit_sort.c 
        exhibit_sort.h exhibit_thumb.c exhibit_thumb.h 


Log Message:


- Only handle the viewable files and dirs when monitoring.
- Yet more code polishing...

===================================================================
RCS file: /cvs/e/e17/proto/exhibit/src/bin/exhibit_comment_jpeg.c,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -3 -r1.5 -r1.6
--- exhibit_comment_jpeg.c      2 Aug 2006 17:31:03 -0000       1.5
+++ exhibit_comment_jpeg.c      2 Sep 2006 01:43:23 -0000       1.6
@@ -1,4 +1,11 @@
 /*
+ * vim:ts=8:sw=3:sts=8:noexpandtab:cino=>5n-3f0^-2{2
+ */
+
+#include "exhibit.h"
+#include "exhibit_comment_jpeg.h"
+
+/*
  *   Updated by HandyAndE
  *
  * based on:
@@ -9,10 +16,18 @@
  *
  */
 
-#include <stdlib.h>
-#include <sys/types.h>
-#include <stdio.h>
-#include <string.h>
+static int _ex_comment_jpeg_read_1_byte (FILE *infile, int *c);
+static int _ex_comment_jpeg_read_2_bytes (FILE *infile, unsigned int *c);
+static void _ex_comment_jpeg_write_1_byte (FILE *outfile, int c);
+static void _ex_comment_jpeg_write_2_bytes (FILE *outfile, unsigned int val);  
 
+static void _ex_comment_jpeg_write_marker(FILE *outfile, int marker);
+static void _ex_comment_jpeg_copy_rest_of_file(FILE *infile, FILE *outfile);
+static int _ex_comment_jpeg_next_marker (FILE *infile, int *c);
+static int _ex_comment_jpeg_first_marker (FILE *infile, int *c);
+static int _ex_comment_jpeg_skip_variable (FILE *infile);
+static int _ex_comment_jpeg_copy_variable (FILE *infile, FILE *outfile);
+static int _ex_comment_jpeg_read_process_COM (FILE *infile, unsigned int *len, 
char **com);
+static int _ex_comment_jpeg_write_scan_header (FILE *infile, FILE *outfile, 
int *ret, int keep_COM);
 
 /* Read one byte, testing for EOF */
 static int
@@ -536,7 +551,7 @@
    fclose(infile);
    fclose(outfile);
    rename((const char*) tmp_file, (const char*) file);
-   free(tmp_file);
+   E_FREE(tmp_file);
    return 1;
 }
 
===================================================================
RCS file: /cvs/e/e17/proto/exhibit/src/bin/exhibit_file.c,v
retrieving revision 1.9
retrieving revision 1.10
diff -u -3 -r1.9 -r1.10
--- exhibit_file.c      28 Jul 2006 16:04:47 -0000      1.9
+++ exhibit_file.c      2 Sep 2006 01:43:23 -0000       1.10
@@ -1,3 +1,6 @@
+/*
+ * vim:ts=8:sw=3:sts=8:noexpandtab:cino=>5n-3f0^-2{2
+ */
 #include "exhibit.h"
 #include <Edje.h>
 
===================================================================
RCS file: /cvs/e/e17/proto/exhibit/src/bin/exhibit_file.h,v
retrieving revision 1.7
retrieving revision 1.8
diff -u -3 -r1.7 -r1.8
--- exhibit_file.h      28 Jul 2006 16:04:47 -0000      1.7
+++ exhibit_file.h      2 Sep 2006 01:43:23 -0000       1.8
@@ -1,3 +1,6 @@
+/*
+ * vim:ts=8:sw=3:sts=8:noexpandtab:cino=>5n-3f0^-2{2
+ */
 #ifndef _EX_FILE_H
 #define _EX_FILE_H
 
===================================================================
RCS file: /cvs/e/e17/proto/exhibit/src/bin/exhibit_image.c,v
retrieving revision 1.37
retrieving revision 1.38
diff -u -3 -r1.37 -r1.38
--- exhibit_image.c     1 Sep 2006 20:23:50 -0000       1.37
+++ exhibit_image.c     2 Sep 2006 01:43:23 -0000       1.38
@@ -444,10 +444,10 @@
          {
          }
      }
-   free(as);
-   free(rs);
-   free(gs);
-   free(bs);
+   E_FREE(as);
+   E_FREE(rs);
+   E_FREE(gs);
+   E_FREE(bs);
    
    evas_object_image_data_set(im->image_object, data);
    evas_object_image_data_update_add(im->image_object, 0, 0, w, h);   
@@ -1149,7 +1149,7 @@
        snprintf(esetroot, strlen("Esetroot ") + strlen(esetroot_opt) + 
strlen(im->filename) + 2,
                 "Esetroot %s %s", esetroot_opt, im->filename);
        system(esetroot);
-       free(esetroot);
+       E_FREE(esetroot);
        exit(0);
      }
 }
===================================================================
RCS file: /cvs/e/e17/proto/exhibit/src/bin/exhibit_main.c,v
retrieving revision 1.73
retrieving revision 1.74
diff -u -3 -r1.73 -r1.74
--- exhibit_main.c      1 Sep 2006 23:39:22 -0000       1.73
+++ exhibit_main.c      2 Sep 2006 01:43:23 -0000       1.74
@@ -269,8 +269,6 @@
    Epsilon *ep;
    Etk_Tree_Row *row;
    
-   if(!_ex_file_is_viewable(basename((char *) file)))
-     return;
    
    ep = epsilon_new(file);
    epsilon_thumb_size(ep, EPSILON_THUMB_NORMAL);
@@ -319,44 +317,52 @@
 static void
 _ex_main_monitor_dir(void *data, Ecore_File_Monitor *ecore_file_monitor, 
Ecore_File_Event event, const char *path)
 {
+   struct stat st;
+   
+   /* TODO: update non-visible tabs too */
+   
    /* Only do changes if tree's are visible */
    if (ecore_file_monitor != e->cur_tab->monitor)
      return;
 
-   /* TODO: update non-visible tabs too */
-   
-   switch (event)
+   stat(path, &st);
+
+   if(_ex_file_is_viewable(basename((char *) path)) || 
+        S_ISDIR(st.st_mode))
      {
-      case ECORE_FILE_EVENT_CREATED_DIRECTORY:
-        etk_tree_clear(ETK_TREE(e->cur_tab->dtree));
-        _ex_main_populate_files(NULL, EX_TREE_UPDATE_DIRS);
-        break;
-      case ECORE_FILE_EVENT_DELETED_DIRECTORY:
-        etk_tree_clear(ETK_TREE(e->cur_tab->dtree));
-        _ex_main_populate_files(NULL, EX_TREE_UPDATE_DIRS);
-        break;
-      case ECORE_FILE_EVENT_DELETED_SELF:
-        etk_tree_clear(ETK_TREE(e->cur_tab->dtree));
-        etk_tree_clear(ETK_TREE(e->cur_tab->itree));
-        _ex_main_populate_files(NULL, EX_TREE_UPDATE_ALL);
-        break;
-      case ECORE_FILE_EVENT_MODIFIED:
-        etk_tree_clear(ETK_TREE(e->cur_tab->itree));
-        _ex_main_populate_files(NULL, EX_TREE_UPDATE_FILES);
-        break;
-      case ECORE_FILE_EVENT_DELETED_FILE:
-        etk_tree_clear(ETK_TREE(e->cur_tab->itree));
-        _ex_main_populate_files(NULL, EX_TREE_UPDATE_FILES);
-        break;
-      case ECORE_FILE_EVENT_CREATED_FILE:
-        _ex_main_itree_add(path, path);
-        break;
-      default:
-        D(("Unknown ecore file event occured\n"));
-        break;
+       switch (event)
+         {
+          case ECORE_FILE_EVENT_CREATED_DIRECTORY:
+             etk_tree_clear(ETK_TREE(e->cur_tab->dtree));
+             _ex_main_populate_files(NULL, EX_TREE_UPDATE_DIRS);
+             break;
+          case ECORE_FILE_EVENT_DELETED_DIRECTORY:
+             etk_tree_clear(ETK_TREE(e->cur_tab->dtree));
+             _ex_main_populate_files(NULL, EX_TREE_UPDATE_DIRS);
+             break;
+          case ECORE_FILE_EVENT_DELETED_SELF:
+             etk_tree_clear(ETK_TREE(e->cur_tab->dtree));
+             etk_tree_clear(ETK_TREE(e->cur_tab->itree));
+             _ex_main_populate_files(NULL, EX_TREE_UPDATE_ALL);
+             break;
+          case ECORE_FILE_EVENT_MODIFIED:
+             /* Careful with what to do here.. */
+             break;
+          case ECORE_FILE_EVENT_DELETED_FILE:
+             /* TODO: remove the correct item from tree, don't refresh all */
+             etk_tree_clear(ETK_TREE(e->cur_tab->itree));
+             _ex_main_populate_files(NULL, EX_TREE_UPDATE_FILES);
+             break;
+          case ECORE_FILE_EVENT_CREATED_FILE:
+             _ex_main_itree_add(path, path);
+             break;
+          default:
+             D(("Unknown ecore file event occured\n"));
+             break;
+         }
+       
+       D(("Monitor event %d happened in %s\n", event, path));
      }
-   
-   D(("Monitor event %d happened in %s\n", event, path));
 }
 
 static void
@@ -488,7 +494,8 @@
             r = etk_tree_selected_row_get(ETK_TREE(e->cur_tab->itree));
             if(!r) return;
             
-            etk_tree_row_fields_get(r, 
etk_tree_nth_col_get(ETK_TREE(e->cur_tab->itree), 0), NULL, &icol_string, 
etk_tree_nth_col_get(ETK_TREE(e->cur_tab->itree), 1),NULL);
+            etk_tree_row_fields_get(r, 
etk_tree_nth_col_get(ETK_TREE(e->cur_tab->itree), 0), 
+                  NULL, &icol_string, 
etk_tree_nth_col_get(ETK_TREE(e->cur_tab->itree), 1), NULL);
             _ex_favorites_add(e, icol_string);
          }
        else if(!strcmp(ev->key, "x"))
@@ -563,16 +570,11 @@
 static void 
 _etk_main_drag_drop_cb(Etk_Object *object, void *event, void *data)
 {
-   Etk_Event_Selection_Request *ev;
+   Etk_Event_Selection_Request *ev = event;
    Etk_Selection_Data_Files *files;
-   Exhibit *e;
-   
    int i;
    
-   ev = event;
-   e = data;
-   
-   if(ev->content != ETK_SELECTION_CONTENT_FILES)
+   if (ev->content != ETK_SELECTION_CONTENT_FILES)
      return;
    
    files = ev->data;
@@ -601,7 +603,8 @@
        _ex_main_populate_files(ecore_file_get_file(file), EX_TREE_UPDATE_ALL);
        if (ecore_file_exists(file) && !ecore_file_is_dir(file))
          _ex_main_image_set(e, file);
-       etk_notebook_page_tab_label_set(ETK_NOTEBOOK(e->notebook), 
e->cur_tab->num, _ex_file_get(e->cur_tab->cur_path));
+       etk_notebook_page_tab_label_set(ETK_NOTEBOOK(e->notebook), 
e->cur_tab->num, 
+             _ex_file_get(e->cur_tab->cur_path));
        break;
      }
 }
@@ -683,7 +686,6 @@
    etk_container_add(ETK_CONTAINER(e->win), e->vbox);
                
    e->hpaned = etk_hpaned_new();
-   //etk_container_add(ETK_CONTAINER(e->win), e->hpaned);
    etk_box_append(ETK_BOX(e->vbox), e->hpaned, ETK_BOX_START, 
ETK_BOX_EXPAND_FILL, 0);   
 
    e->vpaned = etk_vpaned_new();
@@ -860,14 +862,12 @@
    e->notebook = etk_notebook_new();
    etk_notebook_tabs_visible_set(ETK_NOTEBOOK(e->notebook), ETK_FALSE);
    etk_paned_child2_set(ETK_PANED(e->hpaned), e->notebook, ETK_TRUE);
-   etk_signal_connect("current_page_changed", ETK_OBJECT(e->notebook), 
ETK_CALLBACK(_ex_main_window_tab_toggled_cb), e);
+   etk_signal_connect("current_page_changed", ETK_OBJECT(e->notebook), 
+        ETK_CALLBACK(_ex_main_window_tab_toggled_cb), NULL);
       
    e->hbox = etk_hbox_new(ETK_TRUE, 0);   
    etk_box_append(ETK_BOX(e->vbox), e->hbox, ETK_BOX_END, ETK_BOX_NONE, 0);
 
-   e->sort = etk_label_new("Sort by date");
-   /* size is different than statusbar, how do we make it look good? */
-   //etk_box_append(ETK_BOX(e->hbox), e->sort, ETK_BOX_START, 
ETK_BOX_EXPAND_FILL, 0);
      {
        Etk_Widget *menu;
        Etk_Widget *menu_item;
===================================================================
RCS file: /cvs/e/e17/proto/exhibit/src/bin/exhibit_menus.c,v
retrieving revision 1.33
retrieving revision 1.34
diff -u -3 -r1.33 -r1.34
--- exhibit_menus.c     1 Sep 2006 23:39:22 -0000       1.33
+++ exhibit_menus.c     2 Sep 2006 01:43:23 -0000       1.34
@@ -167,22 +167,17 @@
 void
 _ex_menu_options_cb(Etk_Object *obj, void *data)
 {
-   Exhibit *e = data;
-   
    EX_MENU_ITEM_GET_RETURN(obj);
-   _ex_options_window_show(e);
+   _ex_options_window_show();
 }
 
 void
 _ex_menu_quit_cb(Etk_Object *obj, void *data)
 {
-   Exhibit *e;
-
    EX_MENU_ITEM_GET_RETURN(obj);
 
-   e = (Exhibit *)data;
    if (e)     
-     free(e);     
+     E_FREE(e);     
 
    etk_main_quit();   
 }
@@ -433,12 +428,10 @@
 void
 _ex_menu_add_to_fav_cb(Etk_Object *obj, void *data)
 {
-   Exhibit      *e;
    Etk_Tree_Row *r;
    char         *icol_string;
    EX_MENU_ITEM_GET_RETURN(obj);
    
-   e = data;
    r = etk_tree_selected_row_get(ETK_TREE(e->cur_tab->itree));
       if(!r) return;
    
@@ -450,12 +443,10 @@
 void
 _ex_menu_remove_from_fav_cb(Etk_Object *obj, void *data)
 {
-   Exhibit      *e;
    Etk_Tree_Row *r;
    char         *icol_string;
    EX_MENU_ITEM_GET_RETURN(obj);
    
-   e = data;
    r = etk_tree_selected_row_get(ETK_TREE(e->cur_tab->itree));
       if(!r) return;
    
@@ -467,12 +458,9 @@
 void
 _ex_menu_go_to_fav_cb(Etk_Object *obj, void *data)
 {    
-   Exhibit      *e;
    EX_MENU_ITEM_GET_RETURN(obj);
    
-   e = data;
-   
-   _ex_slideshow_stop(e);
+   _ex_slideshow_stop();
    E_FREE(e->cur_tab->dir);
    e->cur_tab->dir = strdup(e->options->fav_path);
    etk_tree_clear(ETK_TREE(e->cur_tab->itree));
===================================================================
RCS file: /cvs/e/e17/proto/exhibit/src/bin/exhibit_options.c,v
retrieving revision 1.16
retrieving revision 1.17
diff -u -3 -r1.16 -r1.17
--- exhibit_options.c   1 Sep 2006 21:51:38 -0000       1.16
+++ exhibit_options.c   2 Sep 2006 01:43:23 -0000       1.17
@@ -812,7 +812,7 @@
 }
 
 void
-_ex_options_window_show(Exhibit *e)
+_ex_options_window_show()
 {
    Etk_Widget *win;
    Etk_Widget *vbox;
===================================================================
RCS file: /cvs/e/e17/proto/exhibit/src/bin/exhibit_options.h,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -3 -r1.4 -r1.5
--- exhibit_options.h   10 Aug 2006 04:01:10 -0000      1.4
+++ exhibit_options.h   2 Sep 2006 01:43:23 -0000       1.5
@@ -11,6 +11,6 @@
 void            _ex_options_free(Exhibit *e);
 int             _ex_options_save(Exhibit *e);
 int             _ex_options_load(Exhibit *e);
-void            _ex_options_window_show(Exhibit *e);
+void            _ex_options_window_show();
 
 #endif
===================================================================
RCS file: /cvs/e/e17/proto/exhibit/src/bin/exhibit_sort.c,v
retrieving revision 1.6
retrieving revision 1.7
diff -u -3 -r1.6 -r1.7
--- exhibit_sort.c      11 Aug 2006 02:30:57 -0000      1.6
+++ exhibit_sort.c      2 Sep 2006 01:43:23 -0000       1.7
@@ -1,3 +1,6 @@
+/*
+ * vim:ts=8:sw=3:sts=8:noexpandtab:cino=>5n-3f0^-2{2
+ */
 #include "exhibit.h"
 
 static Ecore_Evas *ee_buf;
===================================================================
RCS file: /cvs/e/e17/proto/exhibit/src/bin/exhibit_sort.h,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -3 -r1.2 -r1.3
--- exhibit_sort.h      23 Dec 2005 01:19:34 -0000      1.2
+++ exhibit_sort.h      2 Sep 2006 01:43:23 -0000       1.3
@@ -1,3 +1,6 @@
+/*
+ * vim:ts=8:sw=3:sts=8:noexpandtab:cino=>5n-3f0^-2{2
+ */
 #ifndef _EX_SORT_H
 #define _EX_SORT_H
 
===================================================================
RCS file: /cvs/e/e17/proto/exhibit/src/bin/exhibit_thumb.c,v
retrieving revision 1.8
retrieving revision 1.9
diff -u -3 -r1.8 -r1.9
--- exhibit_thumb.c     1 Sep 2006 21:51:38 -0000       1.8
+++ exhibit_thumb.c     2 Sep 2006 01:43:23 -0000       1.9
@@ -1,3 +1,6 @@
+/*
+ * vim:ts=8:sw=3:sts=8:noexpandtab:cino=>5n-3f0^-2{2
+ */
 #include "exhibit.h"
 #include "exhibit_file.h"
 
===================================================================
RCS file: /cvs/e/e17/proto/exhibit/src/bin/exhibit_thumb.h,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -3 -r1.1 -r1.2
--- exhibit_thumb.h     14 Dec 2005 11:33:30 -0000      1.1
+++ exhibit_thumb.h     2 Sep 2006 01:43:23 -0000       1.2
@@ -1,3 +1,6 @@
+/*
+ * vim:ts=8:sw=3:sts=8:noexpandtab:cino=>5n-3f0^-2{2
+ */
 #ifndef _EX_THUMB_H
 #define _EX_THUMB_H
 



-------------------------------------------------------------------------
Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
_______________________________________________
enlightenment-cvs mailing list
enlightenment-cvs@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/enlightenment-cvs

Reply via email to