cedric pushed a commit to branch master.

http://git.enlightenment.org/core/efl.git/commit/?id=9f5ea9cdae92128e586f49778ce99db7a7214689

commit 9f5ea9cdae92128e586f49778ce99db7a7214689
Author: Vorobiov Vitalii <vi.vorob...@samsung.com>
Date:   Tue Apr 1 19:11:27 2014 +0900

    edje_edit: fix wrong generation of part's source code (effect field).
    
    There is a static array that is used for parsing the current effect
    (in Part's struction the effect type is represented by a number) from a 
number
    to text. But there is one type of effects (SHADOW) that has a number 
combined from
    two types. First four bits are always used for defining the effect's type,
    but if it is a SHADOW effect, then there is four more bits. They are 
representing
    the direction of the shadow in TEXT block.
    This patch fixes code regeneration after saving edje_edit object, so now
    it splits the number into two pieces, so we can fully regenerate type of 
effect.
    
    So, in this path:
    - added static array that represents shadow's direction.
    - part's source code generaton has been modified.
    
    Reviewers: seoz, raster, cedric
    
    Reviewed By: cedric
    
    CC: reutskiy.v.v, cedric
    
    Differential Revision: https://phab.enlightenment.org/D668
    
    Signed-off-by: Cedric BAIL <cedric.b...@free.fr>
---
 src/lib/edje/edje_edit.c | 19 +++++++++++++++----
 1 file changed, 15 insertions(+), 4 deletions(-)

diff --git a/src/lib/edje/edje_edit.c b/src/lib/edje/edje_edit.c
index 3d260e1..db301f1 100644
--- a/src/lib/edje/edje_edit.c
+++ b/src/lib/edje/edje_edit.c
@@ -7058,7 +7058,8 @@ edje_edit_script_error_list_get(Evas_Object *obj)
      }
 
 static const char *types[] = {"NONE", "RECT", "TEXT", "IMAGE", "SWALLOW", 
"TEXTBLOCK", "GRADIENT", "GROUP", "BOX", "TABLE", "EXTERNAL", "PROXY", 
"SPACER"};
-static const char *effects[] = {"NONE", "PLAIN", "OUTLINE", "SOFT_OUTLINE", 
"SHADOW", "SOFT_SHADOW", "OUTLINE_SHADOW", "OUTLINE_SOFT_SHADOW ", "FAR_SHADOW 
", "FAR_SOFT_SHADOW", "GLOW"};
+static const char *effects[] = {"NONE", "PLAIN", "OUTLINE", "SOFT_OUTLINE", 
"SHADOW", "SOFT_SHADOW", "OUTLINE_SHADOW", "OUTLINE_SOFT_SHADOW", "FAR_SHADOW", 
"FAR_SOFT_SHADOW", "GLOW"};
+static const char *shadow_direction[] = {"BOTTOM_RIGHT", "BOTTOM", 
"BOTTOM_LEFT", "LEFT", "TOP_LEFT", "TOP", "TOP_RIGHT", "RIGHT"};
 static const char *prefers[] = {"NONE", "VERTICAL", "HORIZONTAL", "BOTH"};
 
 static Eina_Bool
@@ -7807,8 +7808,18 @@ _edje_generate_source_of_part(Evas_Object *obj, 
Edje_Part *ep, Eina_Strbuf *buf)
         edje_edit_string_free(str);
      }
    if (edje_edit_part_effect_get(obj, part))
-     BUF_APPENDF(I4"effect: %s;\n",
-                effects[edje_edit_part_effect_get(obj, part)]);
+     {
+        int effect = edje_edit_part_effect_get(obj, part);
+        if (effect & EDJE_TEXT_EFFECT_MASK_SHADOW_DIRECTION)
+          {
+             BUF_APPENDF(I4"effect: %s %s;\n",
+                         effects[effect & 
~EDJE_TEXT_EFFECT_MASK_SHADOW_DIRECTION],
+                         shadow_direction[effect >> 4]);
+          }
+        else
+          BUF_APPENDF(I4"effect: %s;\n",
+                      effects[effect]);
+     }
 
    //Dragable
    if (edje_edit_part_drag_x_get(obj, part) ||
@@ -8526,4 +8537,4 @@ edje_edit_print_internal_status(Evas_Object *obj)
  */
 }
 
-#include "edje_edit.eo.c"
\ No newline at end of file
+#include "edje_edit.eo.c"

-- 


Reply via email to