Authors++
authortitan <titan>
Mon, 14 Aug 2006 17:42:45 +0000 (17:42 +0000)
committertitan <titan@7cbeb6ba-43b4-40fd-8cce-4c39aea84d33>
Mon, 14 Aug 2006 17:42:45 +0000 (17:42 +0000)
Allow an e_thumb api for e_widget_preview.
Fixup the file selector preview to use this new api.

SVN revision: 24696

AUTHORS
src/bin/e_eap_editor.c
src/bin/e_int_config_wallpaper_import.c
src/bin/e_widget_fsel.c
src/bin/e_widget_preview.c
src/bin/e_widget_preview.h

diff --git a/AUTHORS b/AUTHORS
index 43ddf97..c9dde38 100644 (file)
--- a/AUTHORS
+++ b/AUTHORS
@@ -12,3 +12,4 @@ Viktor Kojouharov <vkojouharov@gmail.com>
 ilLogict <illogict@online.fr>
 Stafford Horne <shorne@softhome.net>
 Cedric Bail <cedric.bail@free.fr>
+LinuxTitan (Stephen Houston) <linuxtitan@gmail.com>
index b02ac84..4349e36 100644 (file)
@@ -426,7 +426,7 @@ _e_eap_editor_cb_icon_select(void *data1, void *data2)
 
    o = e_widget_fsel_add(dia->win->evas, "~/", "/", NULL, NULL,
                         _e_eap_edit_select_cb, cfdata,
-                        _e_eap_edit_change_cb, cfdata, 0);
+                        _e_eap_edit_change_cb, cfdata, 1);
    evas_object_show(o);
    e_widget_min_size_get(o, &mw, &mh);
    e_dialog_content_set(dia, o, mw, mh);
index a7ac682..25718ae 100644 (file)
@@ -138,7 +138,7 @@ e_int_config_wallpaper_import(E_Config_Dialog *parent)
      }
    ofm = e_widget_fsel_add(evas, fdev, fpath, NULL, NULL,
                           _import_cb_sel_selected, import,
-                          _import_cb_sel_change, import, 0
+                          _import_cb_sel_change, import, 1
                           );
    import->fsel_obj = ofm;
    e_widget_list_object_append(o, ofm, 1, 1, 0.5);
index 49bc8e7..9356748 100644 (file)
@@ -450,6 +450,7 @@ e_widget_fsel_selection_path_get(Evas_Object *obj)
 static void
 _e_wid_fsel_preview_file(E_Widget_Data *wd)
 {
+   Evas_Coord mw = 0, mh = 0;
    char *size, *owner, *perms, *time;
    struct stat st;
  
@@ -459,7 +460,16 @@ _e_wid_fsel_preview_file(E_Widget_Data *wd)
    owner = _e_wid_file_user_get(st.st_uid);
    perms = _e_wid_file_perms_get(st.st_mode, st.st_uid, st.st_gid);
    time = _e_wid_file_time_get(st.st_mtime); 
-
+   
+   e_widget_preview_thumb_set(wd->o_preview_preview, wd->path, "background", 120, 120);
+   
+   /*e_table_unpack(wd->o_preview_preview);
+   e_table_pack(wd->o_preview_preview_table, wd->o_preview_preview, 0, 0, 1, 1);
+   e_widget_min_size_get(wd->o_preview_preview, &mw, &mh);
+   e_table_pack_options_set(wd->o_preview_preview, 1, 1, 1, 1, 0.5, 0.5, mw, mh, 99999, 99999);
+   e_table_min_size_get(wd->o_preview_preview_table, &mw, &mh);
+   e_widget_min_size_set(wd->o_preview_preview_table, mw, mh);*/
+   
    e_widget_entry_text_set(wd->o_preview_size_entry, size);
    e_widget_entry_text_set(wd->o_preview_owner_entry, owner);
    e_widget_entry_text_set(wd->o_preview_perms_entry, perms);
index 07d4dc3..03b59a8 100644 (file)
@@ -10,7 +10,7 @@ struct _E_Widget_Data
 };
 
 static void _e_wid_del_hook(Evas_Object *obj);
-
+static void _e_wid_preview_thumb_gen(void *data, Evas_Object *obj, void *event_info);
 /* local subsystem functions */
 
 /* externally accessible functions */
@@ -56,7 +56,10 @@ e_widget_preview_file_set(Evas_Object *obj, const char *file, const char *key)
    E_Widget_Data *wd;
    
    wd = e_widget_data_get(obj);
-   if (wd->o_thumb) evas_object_del(wd->o_thumb);
+   
+   if (wd->o_thumb) 
+      evas_object_del(wd->o_thumb);
+
    wd->o_thumb = e_icon_add(e_livethumb_evas_get(wd->img));
    e_icon_file_key_set(wd->o_thumb, file, key);
    evas_object_show(wd->o_thumb);
@@ -65,6 +68,38 @@ e_widget_preview_file_set(Evas_Object *obj, const char *file, const char *key)
 }
 
 EAPI int
+e_widget_preview_thumb_set(Evas_Object *obj, const char *file, const char *key, int w, int h)
+{
+   E_Widget_Data *wd;
+
+   wd = e_widget_data_get(obj);
+
+   if (wd->img)
+      evas_object_del(wd->img);
+
+   wd->img = e_thumb_icon_add(evas_object_evas_get(obj));
+   e_thumb_icon_file_set(wd->img, file, key);
+   e_thumb_icon_size_set(wd->img, w, h);
+   e_thumb_icon_begin(wd->img);
+   evas_object_smart_callback_add(wd->img, "e_thumb_gen", _e_wid_preview_thumb_gen, wd);
+   
+   edje_object_part_swallow(wd->o_frame, "item", wd->img);
+   evas_object_show(wd->img);
+   return 1;
+}
+
+static void
+_e_wid_preview_thumb_gen(void *data, Evas_Object *obj, void *event_info)
+{
+   Evas_Coord w, h;
+   E_Widget_Data *wd;
+   wd = data;
+
+   e_icon_size_get(wd->img, &w, &h);
+   evas_object_resize(wd->o_frame, w, h);
+}
+
+EAPI int
 e_widget_preview_edje_set(Evas_Object *obj, const char *file, const char *group)
 {
    E_Widget_Data *wd;
index eabe720..1c18e61 100644 (file)
@@ -8,6 +8,7 @@
 
 EAPI Evas_Object     *e_widget_preview_add(Evas *evas, int minw, int minh);
 EAPI int              e_widget_preview_file_set(Evas_Object *obj, const char *file, const char *key);
+EAPI int             e_widget_preview_thumb_set(Evas_Object *obj, const char *file, const char *key, int w, int h);
 EAPI int              e_widget_preview_edje_set(Evas_Object *obj, const char *file, const char *group);
     
 #endif