[prev in list] [next in list] [prev in thread] [next in thread] 

List:       enlightenment-svn
Subject:    E SVN: okra trunk/ephoto/src/bin
From:       "Enlightenment SVN" <no-reply () enlightenment ! org>
Date:       2011-06-30 16:04:18
Message-ID: 20110630160419.1A0661180C4 () e2 ! enlightenment ! org
[Download RAW message or body]

Log:
Add edje viewing capabilities.
  

Author:       okra
Date:         2011-06-30 09:04:18 -0700 (Thu, 30 Jun 2011)
New Revision: 60875
Trac:         http://trac.enlightenment.org/e/changeset/60875

Modified:
  trunk/ephoto/src/bin/ephoto.h trunk/ephoto/src/bin/ephoto_main.c \
trunk/ephoto/src/bin/ephoto_single_browser.c 

Modified: trunk/ephoto/src/bin/ephoto.h
===================================================================
--- trunk/ephoto/src/bin/ephoto.h	2011-06-30 15:27:38 UTC (rev 60874)
+++ trunk/ephoto/src/bin/ephoto.h	2011-06-30 16:04:18 UTC (rev 60875)
@@ -185,7 +185,8 @@
             (strcasecmp(ext, "png") == 0) ||
             (strcasecmp(ext, "gif") == 0) ||
             (strcasecmp(ext, "tif") == 0) ||
-            (strcasecmp(ext, "svg") == 0))
+            (strcasecmp(ext, "svg") == 0) ||
+            (strcasecmp(ext, "edj") == 0))
           return EINA_TRUE;
      }
 

Modified: trunk/ephoto/src/bin/ephoto_main.c
===================================================================
--- trunk/ephoto/src/bin/ephoto_main.c	2011-06-30 15:27:38 UTC (rev 60874)
+++ trunk/ephoto/src/bin/ephoto_main.c	2011-06-30 16:04:18 UTC (rev 60875)
@@ -401,8 +401,11 @@
      {
         Ethumb_Thumb_Format format;
         format = (long)evas_object_data_get(o, "ephoto_format");
-        ethumb_client_format_set(client, format);
-        elm_thumb_reload(o);
+        if (format)
+          {
+             ethumb_client_format_set(client, format);
+             elm_thumb_reload(o);
+          }
      }
 
  end:
@@ -441,10 +444,24 @@
 ephoto_thumb_add(Ephoto *ephoto, Evas_Object *parent, const char *path)
 {
    Evas_Object *o;
-
    EINA_SAFETY_ON_NULL_RETURN_VAL(parent, NULL);
 
-   o = elm_thumb_add(parent);
+   if (path)
+     {
+        const char *ext = strrchr(path, '.');
+        if (ext)
+          {
+             ext++;
+             if ((strcasecmp(ext, "edj") == 0))
+               o = elm_icon_add(parent);
+             else
+               o = elm_thumb_add(parent);
+          }
+        else
+          o = elm_thumb_add(parent);
+     }
+   else
+     o = elm_thumb_add(parent);
    if (!o) return NULL;
 
    if (path) ephoto_thumb_path_set(o, path);
@@ -458,6 +475,7 @@
 ephoto_thumb_path_set(Evas_Object *o, const char *path)
 {
    Ethumb_Thumb_Format format = ETHUMB_THUMB_FDO;
+   const char *group = NULL;
    const char *ext = strrchr(path, '.');
    if (ext)
      {
@@ -465,11 +483,24 @@
         if ((strcasecmp(ext, "jpg") == 0) ||
             (strcasecmp(ext, "jpeg") == 0))
           format = ETHUMB_THUMB_JPEG; /* faster! */
+        else if ((strcasecmp(ext, "edj") == 0))
+          {
+             if (edje_file_group_exists(path, "e,desktop,background"))
+               group = "e,desktop,background";
+             else
+               {
+                  Eina_List *g = edje_file_collection_list(path);
+                  group = eina_list_data_get(g);
+                  edje_file_collection_list_free(g);
+               }
+             elm_icon_file_set(o, path, group);
+             evas_object_data_set(o, "ephoto_format", NULL);
+             return;
+          }
      }
-
    ethumb_client_format_set(elm_thumb_ethumb_client_get(), format);
    evas_object_data_set(o, "ephoto_format", (void*)(long)format);
-   elm_thumb_file_set(o, path, NULL);
+   elm_thumb_file_set(o, path, group);
 }
 
 Ephoto_Entry *

Modified: trunk/ephoto/src/bin/ephoto_single_browser.c
===================================================================
--- trunk/ephoto/src/bin/ephoto_single_browser.c	2011-06-30 15:27:38 UTC (rev 60874)
+++ trunk/ephoto/src/bin/ephoto_single_browser.c	2011-06-30 16:04:18 UTC (rev 60875)
@@ -92,13 +92,30 @@
    else
      {
         Evas_Coord w, h;
+        const char *group = NULL;
+        const char *ext = strrchr(path, '.');
+        if (ext)
+          {
+             ext++;
+             if ((strcasecmp(ext, "edj") == 0))
+               {
+                  if (edje_file_group_exists(path, "e,desktop,background"))
+                    group = "e,desktop,background";
+                  else
+                    {
+                       Eina_List *g = edje_file_collection_list(path);
+                       group = eina_list_data_get(g);
+                       edje_file_collection_list_free(g);
+                    }
+               }
+           }
         obj = v->scroller = elm_scroller_add(parent);
         EINA_SAFETY_ON_NULL_GOTO(obj, error);
-        v->image = evas_object_image_filled_add(evas_object_evas_get(parent));
-        evas_object_image_file_set(v->image, path, NULL);
+        v->image = elm_image_add(parent);
+        elm_image_file_set(v->image, path, group);
         err = evas_object_image_load_error_get(v->image);
         if (err != EVAS_LOAD_ERROR_NONE) goto load_error;
-        evas_object_image_size_get(v->image, &w, &h);
+        elm_image_object_size_get(v->image, &w, &h);
         evas_object_size_hint_align_set(v->image, 0.5, 0.5);
         evas_object_size_hint_min_set(v->image, w, h);
         evas_object_size_hint_max_set(v->image, w, h);
@@ -128,7 +145,7 @@
    else
      {
         Evas_Coord w, h;
-        evas_object_image_size_get(v->image, &w, &h);
+        elm_image_object_size_get(v->image, &w, &h);
         w *= zoom;
         h *= zoom;
         evas_object_size_hint_min_set(v->image, w, h);
@@ -150,7 +167,7 @@
    else
      {
         evas_object_geometry_get(v->scroller, NULL, NULL, &cw, &ch);
-        evas_object_image_size_get(v->image, &iw, &ih);
+        elm_image_object_size_get(v->image, &iw, &ih);
      }
 
    if ((cw <= 0) || (ch <= 0)) return; /* object still not resized */


------------------------------------------------------------------------------
All of the data generated in your IT infrastructure is seriously valuable.
Why? It contains a definitive record of application performance, security 
threats, fraudulent activity, and more. Splunk takes this data and makes 
sense of it. IT sense. And common sense.
http://p.sf.net/sfu/splunk-d2d-c2
_______________________________________________
enlightenment-svn mailing list
enlightenment-svn@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/enlightenment-svn


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic