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 e_fileman_smart.c e_icon.c
e_icon.h e_thumb.c e_thumb.h
Log Message:
- being icon overhaul
- icons look bad for now, until everthing is fixed.
===================================================================
RCS file: /cvsroot/enlightenment/e17/apps/e/src/bin/e_fileman_icon.c,v
retrieving revision 1.14
retrieving revision 1.15
diff -u -3 -r1.14 -r1.15
--- e_fileman_icon.c 3 Nov 2005 15:26:46 -0000 1.14
+++ e_fileman_icon.c 4 Nov 2005 03:33:22 -0000 1.15
@@ -136,11 +136,13 @@
sd->thumb_object = e_thumb_evas_object_get(sd->file->path,
sd->evas,
sd->iw,
- sd->ih);
+ sd->ih,
+ 1);
evas_object_smart_member_add(sd->thumb_object, sd->obj);
sd->image_object = edje_object_add(sd->evas);
edje_extern_object_min_size_set(sd->image_object, sd->iw, sd->ih);
+ edje_extern_object_max_size_set(sd->image_object, sd->iw, sd->ih);
e_theme_edje_object_set(sd->image_object, "base/theme/fileman",
"fileman/icon_thumb");
edje_object_part_swallow(sd->image_object, "icon_swallow",
@@ -160,7 +162,8 @@
_e_fm_icon_type_set(sd);
- //edje_object_size_min_calc(sd->icon_object, &icon_w, &icon_h);
+ edje_object_size_min_calc(sd->icon_object, &icon_w, &icon_h);
+ printf("INTERNAL SIZE: %d %d\n", 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);
@@ -179,6 +182,7 @@
//if (sd->icon_object) edje_object_part_text_set(sd->icon_object,
"icon_title", title);
if(sd->icon_object)
{
+#if 0
Evas_Textblock_Style *e_editable_text_style;
Evas_Coord fw, fh, il, ir, it, ib;
@@ -187,7 +191,7 @@
evas_object_textblock_style_set(sd->title_object,
e_editable_text_style);
- evas_object_textblock_text_markup_set(sd->title_object, sd->file->name);
+ evas_object_textblock_text_markup_set(sd->title_object, title);
evas_object_resize(sd->title_object, sd->w, 1);
evas_object_textblock_size_formatted_get(sd->title_object, &fw, &fh);
@@ -200,6 +204,8 @@
evas_object_resize(sd->icon_object, sd->w, sd->h);
evas_object_resize(sd->obj, sd->w, sd->h);
edje_object_part_swallow(sd->icon_object, "icon_title",
sd->title_object);
+#endif
+ edje_object_part_text_set(sd->icon_object, "icon_title", title);
}
}
@@ -253,7 +259,16 @@
sd->ih = h;
evas_object_resize(sd->image_object, w, h);
}
+
+void
+e_fm_icon_size_min_calc(Evas_Object *obj, Evas_Coord *w, Evas_Coord *h)
+{
+ E_Smart_Data *sd;
+ sd = evas_object_smart_data_get(obj);
+ if (!sd) return;
+ edje_object_size_min_calc(sd->icon_object, w, h);
+}
/* local subsystem functions */
static void
@@ -361,7 +376,7 @@
evas_object_resize(sd->event_object, sd->w, sd->h);
if (sd->icon_object) evas_object_resize(sd->icon_object, sd->w, sd->h);
-
+ printf("resize to %d %d\n", sd->w, sd->h);
//if (sd->image_object) evas_object_resize(sd->image_object, w, h);
}
@@ -417,12 +432,13 @@
if (!e_theme_edje_object_set(sd->image_object,
"base/theme/fileman", part))
e_theme_edje_object_set(sd->image_object, "base/theme/fileman",
"icons/fileman/file");
-
+
free(ext);
}
else
e_theme_edje_object_set(sd->image_object, "base/theme/fileman",
"icons/fileman/file");
}
+ edje_extern_object_min_size_set(sd->image_object, sd->iw, sd->ih);
}
static void
@@ -473,19 +489,21 @@
sd->thumb_object = e_thumb_evas_object_get(sd->file->path,
sd->evas,
sd->iw,
- sd->ih);
+ sd->ih,
+ 1);
evas_object_smart_member_add(sd->thumb_object, sd->obj);
sd->image_object = edje_object_add(sd->evas);
- edje_extern_object_min_size_set(sd->image_object, sd->iw, sd->ih);
e_theme_edje_object_set(sd->image_object, "base/theme/fileman",
"fileman/icon_thumb");
edje_object_part_swallow(sd->image_object, "icon_swallow",
sd->thumb_object);
+ edje_extern_object_min_size_set(sd->image_object, sd->iw, sd->ih);
+ edje_extern_object_max_size_set(sd->image_object, sd->iw, sd->ih);
edje_object_part_swallow(sd->icon_object, "icon_swallow",
sd->image_object);
- edje_object_part_swallow(sd->icon_object, "icon_title",
- sd->title_object);
+// edje_object_part_swallow(sd->icon_object, "icon_title",
+// sd->title_object);
}
pid = -1;
@@ -516,6 +534,8 @@
if (sd->image_object)
{
+ edje_extern_object_min_size_set(sd->image_object, sd->iw, sd->ih);
+ edje_extern_object_max_size_set(sd->image_object, sd->iw, sd->ih);
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);
@@ -523,6 +543,7 @@
if(sd->saved_title)
{
+#if 0
Evas_Textblock_Style *e_editable_text_style;
Evas_Coord fw, fh, il, ir, it, ib;
@@ -531,7 +552,7 @@
evas_object_textblock_style_set(sd->title_object,
e_editable_text_style);
- evas_object_textblock_text_markup_set(sd->title_object, sd->file->name);
+ evas_object_textblock_text_markup_set(sd->title_object,
sd->saved_title);
evas_object_resize(sd->title_object, sd->w, 1);
evas_object_textblock_size_formatted_get(sd->title_object, &fw, &fh);
@@ -544,9 +565,12 @@
evas_object_resize(sd->icon_object, sd->w, sd->h);
evas_object_resize(sd->obj, sd->w, sd->h);
edje_object_part_swallow(sd->icon_object, "icon_title",
sd->title_object);
+#endif
+ edje_object_part_text_set(sd->icon_object, "icon_title",
sd->saved_title);
}
else
{
+#if 0
Evas_Textblock_Style *e_editable_text_style;
Evas_Coord fw, fh, il, ir, it, ib;
@@ -568,5 +592,7 @@
evas_object_resize(sd->icon_object, sd->w, sd->h);
evas_object_resize(sd->obj, sd->w, sd->h);
edje_object_part_swallow(sd->icon_object, "icon_title",
sd->title_object);
+#endif
+ 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.4
retrieving revision 1.5
diff -u -3 -r1.4 -r1.5
--- e_fileman_icon.h 2 Nov 2005 01:37:11 -0000 1.4
+++ e_fileman_icon.h 4 Nov 2005 03:33:22 -0000 1.5
@@ -24,6 +24,8 @@
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);
EAPI void e_fm_icon_image_resize(Evas_Object *obj, Evas_Coord w,
Evas_Coord h);
+EAPI void e_fm_icon_size_min_calc(Evas_Object *obj, Evas_Coord *w,
Evas_Coord *h);
+
#endif
#endif
===================================================================
RCS file: /cvsroot/enlightenment/e17/apps/e/src/bin/e_fileman_smart.c,v
retrieving revision 1.77
retrieving revision 1.78
diff -u -3 -r1.77 -r1.78
--- e_fileman_smart.c 3 Nov 2005 15:26:46 -0000 1.77
+++ e_fileman_smart.c 4 Nov 2005 03:33:22 -0000 1.78
@@ -1378,6 +1378,7 @@
icon = E_NEW(E_Fm_Icon, 1);
if (icon)
{
+ Evas_Coord w, h;
snprintf(path, sizeof(path), "%s/..", sd->dir);
icon->file = e_fm_file_new(path);
icon->file->mode = 0040000;
@@ -1385,6 +1386,8 @@
icon->icon_object = e_fm_icon_add(sd->evas);
icon->sd = sd;
e_fm_icon_file_set(icon->icon_object, icon->file);
+ e_fm_icon_size_min_calc(icon->icon_object, &w, &h);
+ evas_object_resize(icon->icon_object, 64, 64);
sd->files = evas_list_prepend(sd->files, icon);
}
}
@@ -1399,8 +1402,8 @@
icon = l->data;
- //evas_object_resize(icon->icon_object, sd->icon_info.w,
sd->icon_info.h);
- e_fm_icon_image_resize(icon->icon_object, sd->icon_info.w,
sd->icon_info.h);
+ evas_object_resize(icon->icon_object, sd->icon_info.w, sd->icon_info.h);
+ //e_fm_icon_image_resize(icon->icon_object, sd->icon_info.w,
sd->icon_info.h);
evas_object_show(icon->icon_object);
evas_object_geometry_get(icon->icon_object, NULL, NULL, &icon_w,
&icon_h);
D(("_e_fm_dir_set: Icon, w=%d h=%d\n", icon_w, icon_h));
@@ -1478,6 +1481,9 @@
icon->sd = sd;
e_fm_icon_file_set(icon->icon_object, icon->file);
e_fm_icon_image_resize(icon->icon_object, sd->icon_info.w,
sd->icon_info.h);
+ e_fm_icon_size_min_calc(icon->icon_object, &w, &h);
+ printf("icon size: %d %d\n", w, h);
+ //evas_object_resize(icon->icon_object, w, h);
files = evas_list_append(files, icon);
}
}
@@ -1555,7 +1561,9 @@
icon->sd = sd;
e_icon_layout_freeze(sd->layout);
e_fm_icon_file_set(icon->icon_object, icon->file);
- e_fm_icon_image_resize(icon->icon_object, sd->icon_info.w,
sd->icon_info.h);
+ //e_fm_icon_image_resize(icon->icon_object, sd->icon_info.w,
sd->icon_info.h);
+ e_fm_icon_size_min_calc(icon->icon_object, &w, &h);
+ evas_object_resize(icon->icon_object, sd->icon_info.w, sd->icon_info.h);
evas_object_show(icon->icon_object);
e_icon_layout_pack(sd->layout, icon->icon_object);
evas_object_event_callback_add(icon->icon_object,
EVAS_CALLBACK_MOUSE_DOWN, _e_fm_icon_mouse_down_cb, icon);
===================================================================
RCS file: /cvsroot/enlightenment/e17/apps/e/src/bin/e_icon.c,v
retrieving revision 1.6
retrieving revision 1.7
diff -u -3 -r1.6 -r1.7
--- e_icon.c 27 Oct 2005 02:44:36 -0000 1.6
+++ e_icon.c 4 Nov 2005 03:33:23 -0000 1.7
@@ -58,13 +58,32 @@
_e_icon_smart_reconfigure(sd);
}
+void
+e_icon_file_edje_set(Evas_Object *obj, const char *file, const char *part)
+{
+ E_Smart_Data *sd;
+
+ sd = evas_object_smart_data_get(obj);
+ /* smart code here */
+ if(sd->obj)
+ evas_object_del(sd->obj);
+ sd->obj = edje_object_add(evas_object_evas_get(obj));
+ edje_object_file_set(sd->obj, file, part);
+ _e_icon_smart_reconfigure(sd);
+}
+
const char *
e_icon_file_get(Evas_Object *obj)
{
E_Smart_Data *sd;
char *file;
- sd = evas_object_smart_data_get(obj);
+ sd = evas_object_smart_data_get(obj);
+ if(!strcmp(evas_object_type_get(sd->obj), "edje"))
+ {
+ edje_object_file_get(sd->obj, &file, NULL);
+ return file;
+ }
evas_object_image_file_get(sd->obj, &file, NULL);
return file;
}
@@ -75,6 +94,8 @@
E_Smart_Data *sd;
sd = evas_object_smart_data_get(obj);
+ if(!strcmp(evas_object_type_get(sd->obj), "edje"))
+ return;
evas_object_image_smooth_scale_set(sd->obj, smooth);
}
@@ -84,6 +105,8 @@
E_Smart_Data *sd;
sd = evas_object_smart_data_get(obj);
+ if(!strcmp(evas_object_type_get(sd->obj), "edje"))
+ return;
return evas_object_image_smooth_scale_get(sd->obj);
}
@@ -92,7 +115,9 @@
{
E_Smart_Data *sd;
- sd = evas_object_smart_data_get(obj);
+ sd = evas_object_smart_data_get(obj);
+ if(!strcmp(evas_object_type_get(sd->obj), "edje"))
+ return;
evas_object_image_alpha_set(sd->obj, alpha);
}
@@ -101,7 +126,9 @@
{
E_Smart_Data *sd;
- sd = evas_object_smart_data_get(obj);
+ sd = evas_object_smart_data_get(obj);
+ if(!strcmp(evas_object_type_get(sd->obj), "edje"))
+ return;
return evas_object_image_alpha_get(sd->obj);
}
@@ -142,6 +169,8 @@
E_Smart_Data *sd;
sd = evas_object_smart_data_get(obj);
+ if(!strcmp(evas_object_type_get(sd->obj), "edje"))
+ return;
evas_object_image_size_set(sd->obj, w, h);
evas_object_image_data_copy_set(sd->obj, data);
}
@@ -152,6 +181,8 @@
E_Smart_Data *sd;
sd = evas_object_smart_data_get(obj);
+ if(!strcmp(evas_object_type_get(sd->obj), "edje"))
+ return;
evas_object_image_size_get(sd->obj, w, h);
return evas_object_image_data_get(sd->obj, 0);
}
@@ -165,7 +196,10 @@
ih = 0;
ih = 0;
- evas_object_image_size_get(sd->obj, &iw, &ih);
+ if(!strcmp(evas_object_type_get(sd->obj), "edje"))
+ edje_object_size_min_calc(sd->obj, &iw, &ih);
+ else
+ evas_object_image_size_get(sd->obj, &iw, &ih);
if (iw < 1) iw = 1;
if (ih < 1) ih = 1;
===================================================================
RCS file: /cvsroot/enlightenment/e17/apps/e/src/bin/e_icon.h,v
retrieving revision 1.7
retrieving revision 1.8
diff -u -3 -r1.7 -r1.8
--- e_icon.h 20 Oct 2005 15:07:45 -0000 1.7
+++ e_icon.h 4 Nov 2005 03:33:23 -0000 1.8
@@ -9,6 +9,7 @@
EAPI Evas_Object *e_icon_add (Evas *evas);
EAPI void e_icon_file_set (Evas_Object *obj, const char *file);
EAPI void e_icon_file_key_set (Evas_Object *obj, const char *file,
const char *key);
+EAPI void e_icon_file_edje_set (Evas_Object *obj, const char *file,
const char *part);
EAPI const char *e_icon_file_get (Evas_Object *obj);
EAPI void e_icon_smooth_scale_set (Evas_Object *obj, int smooth);
EAPI int e_icon_smooth_scale_get (Evas_Object *obj);
===================================================================
RCS file: /cvsroot/enlightenment/e17/apps/e/src/bin/e_thumb.c,v
retrieving revision 1.12
retrieving revision 1.13
diff -u -3 -r1.12 -r1.13
--- e_thumb.c 31 Oct 2005 09:31:04 -0000 1.12
+++ e_thumb.c 4 Nov 2005 03:33:23 -0000 1.13
@@ -290,7 +290,7 @@
/* get evas object containing image of the thumb */
Evas_Object *
-e_thumb_evas_object_get(char *file, Evas *evas, Evas_Coord width, Evas_Coord
height)
+e_thumb_evas_object_get(char *file, Evas *evas, Evas_Coord width, Evas_Coord
height, int shrink)
{
Eet_File *ef;
char *thumb, *ext;
@@ -322,8 +322,8 @@
else
{
D(("e_thumb_evas_object_get: creating eap thumb\n"));
- im = edje_object_add(evas);
- edje_object_file_set(im, file, "icon");
+ im = e_icon_add(evas);
+ e_icon_file_edje_set(im, file, "icon");
e_object_unref(E_OBJECT(app));
D(("e_thumb_evas_object_get: returning eap thumb\n"));
return im;
@@ -357,6 +357,12 @@
im = e_icon_add(evas);
e_icon_file_key_set(im, thumb, "/thumbnail/data");
+ if (shrink)
+ {
+ Evas_Coord sw, sh;
+ e_icon_size_get(im, &sw, &sh);
+ evas_object_resize(im, sw, sh);
+ }
e_icon_fill_inside_set(im, 1);
free(thumb);
eet_close(ef);
===================================================================
RCS file: /cvsroot/enlightenment/e17/apps/e/src/bin/e_thumb.h,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -3 -r1.2 -r1.3
--- e_thumb.h 23 Oct 2005 15:18:47 -0000 1.2
+++ e_thumb.h 4 Nov 2005 03:33:23 -0000 1.3
@@ -14,7 +14,7 @@
EAPI char *e_thumb_file_get(char *file);
EAPI int e_thumb_exists(char *file);
EAPI int e_thumb_create(char *file, Evas_Coord w, Evas_Coord
h);
-EAPI Evas_Object *e_thumb_evas_object_get(char *file, Evas *evas,
Evas_Coord width, Evas_Coord height);
+EAPI Evas_Object *e_thumb_evas_object_get(char *file, Evas *evas,
Evas_Coord width, Evas_Coord height, int shrink);
#endif
#endif
-------------------------------------------------------
SF.Net email is sponsored by:
Tame your development challenges with Apache's Geronimo App Server. Download
it for free - -and be entered to win a 42" plasma tv or your very own
Sony(tm)PSP. Click here to play: http://sourceforge.net/geronimo.php
_______________________________________________
enlightenment-cvs mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/enlightenment-cvs