Enlightenment CVS committal

Author  : codewarrior
Project : e17
Module  : apps/e

Dir     : e17/apps/e/src/bin


Modified Files:
        e_fileman_icon.c e_fileman_icon.h 


Log Message:
- add support for list view (not selectable yet)


===================================================================
RCS file: /cvsroot/enlightenment/e17/apps/e/src/bin/e_fileman_icon.c,v
retrieving revision 1.9
retrieving revision 1.10
diff -u -3 -r1.9 -r1.10
--- e_fileman_icon.c    27 Oct 2005 10:19:43 -0000      1.9
+++ e_fileman_icon.c    29 Oct 2005 11:48:18 -0000      1.10
@@ -23,6 +23,8 @@
    E_Fm_File       *file;
       
    unsigned char    visible : 1;
+   
+   int              type;
 };
 
 /* local subsystem functions */
@@ -39,6 +41,9 @@
 static void  _e_fm_icon_thumb_generate(void);
 static int   _e_fm_icon_thumb_cb_exe_exit(void *data, int type, void *event);
 
+static void  _e_fm_icon_type_set(E_Smart_Data *sd);
+    
+
 /* local subsystem globals */
 static Evas_Smart *e_smart = NULL;
 
@@ -98,16 +103,29 @@
 }
 
 void
+e_fm_icon_type_set(Evas_Object *obj, int type)
+{
+   E_Smart_Data *sd;
+   
+   if(sd->type == type)
+     return;
+   
+   sd->type = type;
+   _e_fm_icon_type_set(sd);
+}
+
+void
 e_fm_icon_file_set(Evas_Object *obj, E_Fm_File *file)
 {
    E_Smart_Data *sd;
+   Evas_Coord icon_w, icon_h;   
 
    sd = evas_object_smart_data_get(obj);
    if (!sd) return;
    e_object_ref(E_OBJECT(file));
    sd->file = file;
    file->icon_object = obj;
-   
+        
    if (e_fm_file_can_preview(sd->file))
      {
        sd->thumb_path = e_thumb_file_get(sd->file->path);
@@ -128,18 +146,12 @@
        _e_fm_icon_icon_mime_get(sd);
      }
    
-   if (sd->image_object)
-     {
-       edje_object_part_swallow(sd->icon_object, "icon_swallow", 
sd->image_object);
-       evas_object_smart_member_add(sd->image_object, obj);
-       evas_object_show(sd->image_object);
-     }
-   
-   if(sd->saved_title)
-     edje_object_part_text_set(sd->icon_object, "icon_title", sd->saved_title);
-   else
-     edje_object_part_text_set(sd->icon_object, "icon_title", sd->file->name);
+   _e_fm_icon_type_set(sd);
    
+   edje_object_size_min_calc(sd->icon_object, &icon_w, &icon_h);
+   evas_object_resize(sd->icon_object, icon_w, icon_h);
+   evas_object_resize(sd->event_object, icon_w, icon_h);
+   evas_object_resize(sd->obj, icon_w, icon_h);   
 }
 
 void
@@ -206,6 +218,7 @@
    sd->evas = evas_object_evas_get(obj);
    sd->obj = obj;
    sd->saved_title = NULL;
+   sd->type = E_FM_ICON_NORMAL;
    sd->event_object = evas_object_rectangle_add(sd->evas);
    evas_object_color_set(sd->event_object, 0, 0, 0, 0);
    evas_object_smart_member_add(sd->event_object, obj);
@@ -214,20 +227,10 @@
      
    sd->visible = 1;
    sd->icon_object = edje_object_add(sd->evas);
-   e_theme_edje_object_set(sd->icon_object, "base/theme/fileman",
-                           "fileman/icon");
    evas_object_smart_member_add(sd->icon_object, obj);
    
    evas_object_show(sd->icon_object);
-   evas_object_show(sd->event_object);
-   
-    {
-       Evas_Coord icon_w, icon_h;
-       edje_object_size_min_calc(sd->icon_object, &icon_w, &icon_h);
-       evas_object_resize(sd->icon_object, icon_w, icon_h);
-       evas_object_resize(sd->event_object, icon_w, icon_h);
-       evas_object_resize(sd->obj, icon_w, icon_h);       
-    }
+   evas_object_show(sd->event_object);   
 }
 
 
@@ -408,3 +411,37 @@
    _e_fm_icon_thumb_generate();
    return 1;
 }
+
+static void
+_e_fm_icon_type_set(E_Smart_Data *sd)
+{
+   switch(sd->type)
+     {
+      case E_FM_ICON_NORMAL:   
+       e_theme_edje_object_set(sd->icon_object, "base/theme/fileman",
+                               "fileman/icon_normal"); 
+       break;
+       
+      case E_FM_ICON_LIST:
+       e_theme_edje_object_set(sd->icon_object, "base/theme/fileman",
+                               "fileman/icon_list");
+       break;
+       
+      default:
+       e_theme_edje_object_set(sd->icon_object, "base/theme/fileman",
+                               "fileman/icon_normal");
+       break;
+     }   
+   
+   if (sd->image_object)
+     {
+       edje_object_part_swallow(sd->icon_object, "icon_swallow", 
sd->image_object);
+       evas_object_smart_member_add(sd->image_object, sd->obj);        
+       evas_object_show(sd->image_object);
+     }
+   
+   if(sd->saved_title)
+     edje_object_part_text_set(sd->icon_object, "icon_title", sd->saved_title);
+   else
+     edje_object_part_text_set(sd->icon_object, "icon_title", sd->file->name);
+}
===================================================================
RCS file: /cvsroot/enlightenment/e17/apps/e/src/bin/e_fileman_icon.h,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -3 -r1.2 -r1.3
--- e_fileman_icon.h    23 Oct 2005 15:18:47 -0000      1.2
+++ e_fileman_icon.h    29 Oct 2005 11:48:18 -0000      1.3
@@ -3,15 +3,24 @@
  */
 #ifdef E_TYPEDEFS
 
+typedef enum   _E_Fm_Icon_Type E_Fm_Icon_Type;
+
 #else
 #ifndef E_FILEMAN_FILE_SMART_H
 #define E_FILEMAN_FILE_SMART_H
 
+enum E_Fm_Icon_Type
+{
+   E_FM_ICON_NORMAL,
+   E_FM_ICON_LIST
+};
+
 EAPI int          e_fm_icon_init(void);
 EAPI int          e_fm_icon_shutdown(void);
 EAPI Evas_Object *e_fm_icon_add(Evas *evas);
 EAPI void         e_fm_icon_file_set(Evas_Object *obj, E_Fm_File *file);
 EAPI void         e_fm_icon_title_set(Evas_Object *obj, const char *title);
+EAPI void         e_fm_icon_type_set(Evas_Object *obj, int type);
 EAPI void         e_fm_icon_edit_entry_set(Evas_Object *obj, Evas_Object 
*entry);
 EAPI void         e_fm_icon_signal_emit(Evas_Object *obj, const char *source, 
const char *emission);
 




-------------------------------------------------------
This SF.Net email is sponsored by the JBoss Inc.
Get Certified Today * Register for a JBoss Training Course
Free Certification Exam for All Training Attendees Through End of 2005
Visit http://www.jboss.com/services/certification for more information
_______________________________________________
enlightenment-cvs mailing list
enlightenment-cvs@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/enlightenment-cvs

Reply via email to