edje: warn at compile time about forgotten image.
authorcedric <cedric@7cbeb6ba-43b4-40fd-8cce-4c39aea84d33>
Fri, 13 Jul 2012 02:50:58 +0000 (02:50 +0000)
committercedric <cedric@7cbeb6ba-43b4-40fd-8cce-4c39aea84d33>
Fri, 13 Jul 2012 02:50:58 +0000 (02:50 +0000)
NOTE: You need to enable at least Eina_Log warning level
to see them.

git-svn-id: svn+ssh://svn.enlightenment.org/var/svn/e/trunk/edje@73784 7cbeb6ba-43b4-40fd-8cce-4c39aea84d33

ChangeLog
NEWS
src/bin/edje_cc_out.c
src/lib/edje_calc.c

index 431f32d..969d850 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
        * Text classes: Fixed edje_text_class_set to behave like
        edje_object_text_class_set (and as expected) wrt NULL fonts.
 
+2012-07-12  Cedric Bail
+
+       * Warn at compile time about forgotten image definition.
+
diff --git a/NEWS b/NEWS
index 2f32496..1bb829e 100644 (file)
--- a/NEWS
+++ b/NEWS
@@ -11,6 +11,7 @@ Additions:
     process (Use it to replace RECT part that are never visible and never catch any event).
     * Add accessibility flags and API to retrieve the relevant part.
     * Emit signal when flagged part size get to zero.
+    * Warn at compile time about forgotten image.
 
 Improvements:
     * Allocate once and reuse Evas_Map.
index 6b25f3e..d576b82 100644 (file)
@@ -226,12 +226,11 @@ check_image_part_desc(Edje_Part_Collection *pc, Edje_Part *ep,
 {
    unsigned int i;
    
-#if 0 /* FIXME: This check sounds like not a useful one */
-   if (epd->image.id == -1)
-     ERR(ef, "Collection %s(%i): image attributes missing for "
-        "part \"%s\", description \"%s\" %f\n",
+   /* FIXME: This check sounds like not a useful one */
+   if (epd->image.id == -1 && epd->common.visible)
+     WRN("Collection %s(%i): image attributes missing for "
+        "part \"%s\", description \"%s\" %f",
         pc->part, pc->id, ep->name, epd->common.state.name, epd->common.state.value);
-#endif
 
    for (i = 0; i < epd->image.tweens_count; ++i)
      {
index baa870b..79e5438 100644 (file)
@@ -420,10 +420,10 @@ _edje_real_part_image_set(Edje *ed, Edje_Real_Part *ep, FLOAT_T pos)
            {
               if (image_num == (image_count - 1))
                 {
-                  image_id = _edje_image_find(ep->object, ed,
-                                              &ep->param2->set,
-                                              (Edje_Part_Description_Image*) ep->param2->description,
-                                              NULL);
+                    image_id = _edje_image_find(ep->object, ed,
+                                                &ep->param2->set,
+                                                (Edje_Part_Description_Image*) ep->param2->description,
+                                                NULL);
                 }
               else
                 {
@@ -435,11 +435,13 @@ _edje_real_part_image_set(Edje *ed, Edje_Real_Part *ep, FLOAT_T pos)
            }
        if (image_id < 0)
          {
-            ERR("¨Part \"%s\" has description, "
-                "\"%s\" %3.3f with a missing image id!!!",
+            ERR("¨Part \"%s\" description, "
+                "\"%s\" %3.3f with image %i index has a missing image id in a set of %i !!!",
                 ep->part->name,
                 ep->param1.description->state.name,
-                ep->param1.description->state.value);
+                ep->param1.description->state.value,
+                image_num,
+                image_count);
          }
        else
          {