Commit Graph

1768 Commits

Author SHA1 Message Date
Wonki Kim 7da106ec68 edje: modify to respect user set fixed property
Summary:
this patch is related with @D11365.

rather than undoing optimization edje calc,
this patch introduces a user_set property which enables edje_calc
to respect user set property.

Reviewers: bu5hm4n, eagleeye, YOhoho, Hermet, zmike

Reviewed By: zmike

Subscribers: zmike, cedric, #reviewers, #committers, woohyun, eagleeye, bu5hm4n

Tags: #efl

Differential Revision: https://phab.enlightenment.org/D11366
2020-02-19 12:40:39 -05:00
junsu choi a4311f73ee edje: Disable the json vector animation feature with a flag.
Summary:
Json vector animation requires the json loader to be loaded.
Therefore, if the loader does not load,
it prints an appropriate error message and disables the feature.

Depends on D11228

Test Plan: N/A

Reviewers: Hermet, Jaehyun_Cho, id213sin

Reviewed By: Hermet

Subscribers: raster, cedric, #reviewers, #committers

Tags: #efl

Differential Revision: https://phab.enlightenment.org/D11230
2020-02-17 19:14:14 +09:00
YoungBok Shin 2fe158ce65 edje: add json file support feature
Summary:
It also starts to support following new edc properties.
This is backported patch from Tizen 5.0

1. frame
desc { "default"
   vector {
      frame: 0.5; // 0.0 ~ 1.0
   }
}

2. actions
program { "vector_animation";
   // VG_ANIM_PLAY, VG_ANIM_PLAY_BACK, VG_ANIM_LOOP,
   // VG_ANIM_STOP, VG_ANIM_PAUSE, VG_ANIM_RESUME
   action: VG_ANIM_PLAY;
   target: "your_vector_part";
}

@feature

Co-authored-by: Jaehyun Cho <jae_hyun.cho@samsung.com>
  - Fix to remove Efl.Canvas.Animation_Player on edje

Test Plan:
{F3840540}
{F3840542}
{F3840543}
make and test attached file

edje_cc -beta -id ./ json_edc.edc json.edj
gcc -o test test_edc.c -g `pkg-config --cflags --libs evas elementary rlottie`
./test

Reviewers: Hermet, Jaehyun_Cho, id213sin

Reviewed By: Hermet

Subscribers: segfaultxavi, raster, cedric, #reviewers, #committers

Tags: #efl

Differential Revision: https://phab.enlightenment.org/D11228
2020-02-17 18:59:09 +09:00
Yeongjong Lee 225b8f3ad8 edje_multisense: fix a compiler warning for pulseaudio disable mode
Summary: `_out_fail` is not used when edje is compiled without pulseaudio.

Test Plan: meson build -Dpulseaudio=false

Reviewers: zmike, Hermet, Jaehyun_Cho

Reviewed By: Hermet

Subscribers: cedric, #reviewers, #committers

Tags: #efl

Differential Revision: https://phab.enlightenment.org/D11361
2020-02-17 15:35:57 +09:00
WooHyun Jung ac85816283 edje_load: just remove unreachable code 2020-02-14 10:57:22 +09:00
WooHyun Jung fe7a7fa3af edje_calc: add null checking and remove unreachable code 2020-02-14 10:38:24 +09:00
ProhtMeyhet 5af0e65bff edje: use EINA_UNUSED consistently after in function signatures -- part2
Sorry, I've overlooked these as they are on a new line,
or at the beginning of a function, but I think I've got them all now.

Reviewed-by: Marcel Hollerbach <mail@marcel-hollerbach.de>
Differential Revision: https://phab.enlightenment.org/D11254
2020-01-31 14:31:54 +01:00
Proht 1f2a97cd24 edje: use EINA_UNUSED consistently after declaration in function signatures
Reviewed-by: Marcel Hollerbach <mail@marcel-hollerbach.de>
Differential Revision: https://phab.enlightenment.org/D11237
2020-01-30 17:36:48 +01:00
Proht 0c39030011 edje_legacy: avoid calling any functions if part is NULL
This avoids calling any functions like _edje_fetch if part is NULL, because it's unnecessary. This does not fix any null pointers, the EINA_SAFE* macros are just used for convenience.

Differential Revision: https://phab.enlightenment.org/D11189
2020-01-29 12:45:23 +01:00
Subodh Kumar 5eb7ae8b58 edje_entry: Add matching tag.
When textblock has several other tags
which are closing as </>, textblock
is not able to find the matching one.

@fix

Reviewed-by: Cedric BAIL <cedric.bail@free.fr>
Differential Revision: https://phab.enlightenment.org/D11172
2020-01-29 09:51:44 +01:00
Carsten Haitzler 68d7f584cb edje - store original size in edje struct and dont exceed max size
evas can tell us max texture size. in edje when we have image sets
(multiple images that make up mipmaps effectively for a logical
image), we now can avoid choosing an image that exceeds max texture
size. this actually fixes bugs i have seen on the rpi3 which has a max
texture size of 2048 which makes it easy to exceed it with wallpapers
or even terminology's default theme.

so combo of new feature and fix... but requires a rebuild of the edj
files...

@feat + @fix
2020-01-22 23:34:05 +00:00
WooHyun Jung 04d4aeb8b7 edje_entry: fix some preediting bugs
1. Attributes can come with random sequence.
   So, attribute list should be sorted based on start_index.
2. None tag can be used for some languages' preediting.
   So, the tag also needs to be handled the same with other tags.

Reviewed-by: Marcel Hollerbach <mail@marcel-hollerbach.de>
Differential Revision: https://phab.enlightenment.org/D11059
2020-01-14 17:19:58 +01:00
Woochanlee 8f5f63cafa edje_load: Delete wrong free callback set for hash.
Summary:
This hash free callback already sets in the creating time.

Invalid free callback is being called additionally.
Therefore, the existing callback(_edje_user_definition_list_free_internal) could not be called, and a memory leak is occurring.

Reviewers: zmike, cedric

Reviewed By: zmike

Subscribers: cedric, #reviewers, #committers

Tags: #efl

Differential Revision: https://phab.enlightenment.org/D11030
2020-01-07 10:13:04 -05:00
Ali Alzyod 36a50f4d82 efl.text_style: remame underline2 and glow2
Summary: rename underline2 into secondary_underline and glow2 into secondary_glow

Reviewers: woohyun, segfaultxavi

Reviewed By: segfaultxavi

Subscribers: cedric, #reviewers, #committers

Tags: #efl

Maniphest Tasks: T7857

Differential Revision: https://phab.enlightenment.org/D11024
2020-01-07 09:32:03 +01:00
a.srour 0aaad623a0 edje: implement text_class override at object level
implement text_class override at object level, where you can change the text_class for single textblock object instead of override all objects that share same text class.
This imported from TIZEN

Note:
This also fix edje_textblock font/font_size parsing by adding condition

Reviewed-by: Cedric BAIL <cedric.bail@free.fr>
Differential Revision: https://phab.enlightenment.org/D10598
2020-01-02 11:00:04 -08:00
Ali Alzyod 3c54f6458f Efl.Text.Font.Properties: rename Efl.Text_Font_Properties
Efl.Text.Font.Properties: rename Efl.Text_Font_Properties

Reviewed-by: Marcel Hollerbach <mail@marcel-hollerbach.de>
Differential Revision: https://phab.enlightenment.org/D10990
2020-01-02 12:43:46 +01:00
a.srour 0164162a48 Edje: edc text_class applied without font or font_size in style
Summary:
The issue with `text_class` in Edc styles has to be within a string containing `font` & `font_size` properties to effect style, if font or font_size not presented in the same string text_class will be ignored.

So in the following Edc example, `text_class` will be ignored:
```
collections {
   text_classes {
      text_class {
         name: "tc1";
         font: "Sans";
         size: 20;
      }
   }
   styles {
      style {
         name: "style1";
         base: "color=#00FF00 text_class=tc1";
         tag: "br" "\n";
      }
   }
}
```

To apply text_class `tc1`, font and font_size has to be added to `styles.style.base` value, to be as follows:
```
...
base: "font=Serif font_size=15 color=#00FF00 text_class=tc1";
...
```

NOTE: The produced font will be `Sans` and font_size equal to `20`

Test Plan:
`layout.edc`
```
// compile: edje_cc layout.edc
// play: edje_player layout.edj
collections {
    text_classes {
       text_class {
          name: "tc1";
          font: "Sans";
          size: 20;
       }
    }
    styles {
        style {
            name: "style1";
            base: "color=#FFFFFF text_class=tc1";
        }
    }
    group {
        name : "group1";
        parts {
           part {
              name : "tb1";
              type: TEXTBLOCK;
              scale: 1;
              entry_mode: NONE;
              description {
                  state: "default" 0.0;
                  rel1.relative: 0.0 0.0;
                  rel2.relative: 0.5 0.5;
                  text {
                     style: "style1";
                     align: 0.0 0.0;
                     text: "Hello EFL";
                  }
              }
           }
        }
    }
}

Reviewers: segfaultxavi, smohanty, ali.alzyod, cedric, zmike

Reviewed By: zmike

Subscribers: zmike, segfaultxavi, cedric, #reviewers, #committers

Tags: #efl

Maniphest Tasks: T8477, T8478

Differential Revision: https://phab.enlightenment.org/D10692
2019-12-30 11:12:37 -05:00
Ali Alzyod 7b105b33bb efl.text.style: strikethrough_type & Background_type enum rename
Summary:
rename **solid color** to **single**
rename **disabled** to **none**

Reviewers: woohyun, segfaultxavi

Reviewed By: segfaultxavi

Subscribers: cedric, #reviewers, #committers

Tags: #efl

Maniphest Tasks: T7942, T7941

Differential Revision: https://phab.enlightenment.org/D10974
2019-12-30 10:56:37 +09:00
Ali Alzyod 55e9d31569 efl.text.font: rename to efl.text.font.properties
Reviewers: segfaultxavi, woohyun, zmike, bu5hm4n

Subscribers: cedric, #reviewers, #committers

Tags: #efl

Maniphest Tasks: T7855

Differential Revision: https://phab.enlightenment.org/D10966
2019-12-26 18:08:00 +09:00
Ali Alzyod ed0572a33a edje_entry: avoid strstr undefined behaviour
strstr behaviour is undefined when passing null to it, we will check if null is passed, then skip.
elm_entry had issue, where crash happened when click on link for example.

elementry_test -> entry -> click on link (crash will happened)

T8535

Reviewed-by: Marcel Hollerbach <mail@marcel-hollerbach.de>
Reviewed-by: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Differential Revision: https://phab.enlightenment.org/D10877
2019-12-23 17:43:13 +01:00
Ali Alzyod 5cf7fa7670 efl.text.style: rename methods/properties and add text_ prefix
Summary:
efl.text.style: rename methods and properties

this change will avoid conflict in the future with other interfaces or class methods.

```
      Efl.Text_Style.text_color { set; get; }
      Efl.Text_Style.text_backing_type { set; get; }
      Efl.Text_Style.text_background_color { set; get;}  //this was backing_color
      Efl.Text_Style.text_underline_type { set; }
      Efl.Text_Style.text_underline_color { set; get; }
      Efl.Text_Style.text_underline2_color { set; get; }
      Efl.Text_Style.text_underline_dashed_color { set; get; }
      Efl.Text_Style.text_underline_height { set; }
      Efl.Text_Style.text_underline_dashed_width { set; }
      Efl.Text_Style.text_underline_dashed_gap { set; }
      Efl.Text_Style.text_strikethrough_type { set; }
      Efl.Text_Style.text_strikethrough_color { set; get; }
      Efl.Text_Style.text_effect_type { set; }
      Efl.Text_Style.text_shadow_direction { set; }
      Efl.Text_Style.text_outline_color { set; get; }
      Efl.Text_Style.text_shadow_color { set; get; }
      Efl.Text_Style.text_glow_color { set; get; }
      Efl.Text_Style.text_glow2_color { set; get; }
```

T8533

Reviewers: woohyun, segfaultxavi, bu5hm4n, zmike, cedric

Reviewed By: segfaultxavi

Subscribers: cedric, #reviewers, #committers

Tags: #efl

Differential Revision: https://phab.enlightenment.org/D10897
2019-12-20 09:58:27 +01:00
Ali Alzyod c3dbcb2447 edje_entry: real part protection check
Fix T8524

Reviewed-by: Cedric BAIL <cedric.bail@free.fr>
Differential Revision: https://phab.enlightenment.org/D10875
2019-12-13 16:35:32 -08:00
Ali Alzyod 8f87a2411a evas_textblock: content fit feature
Summary:
**Content Fit Feature for Evas_Object_Textblock**

This Feature is available at **Evas **object level.  And **Edje **level (where it is internally use evas functionality)
This feature will allow text block to fit its content font size to proper size to fit its area.

**Main Properties:**
Fit Modes        :   None=Default, Width, Height, All [Width+Height]
Fit Size Range :   Contains maximum and minimum font size to be used (and in between).
Fit Step Size    :   Step(Jump) value when trying fonts sizes between Size_Range max and min.
Fit Size Array   :   Other way to resize font, where you explicitly select font sizes to be uses    (for example [20, 50, 100] it will try 3 sizes only)

Text Fit feature was available in Edje but:
1- It doesn't effected by ellipsis or warping in font style (or do not handle the in right way)
2- Accuracy is not good (specially if you have fix pixel size elements (spaces,tabs,items))
3- No (Step size, Size Array) available.

Test Plan:
To check the Feature
> elementary_test
> fit
> textbock fit
You can modify all the modes and properties

These are two examples, One using Evas other uses Edje

**Evas**

```
#include <Elementary.h>

enum BUTTON{
   BUTTON_MODE             = 0,
   BUTTON_MAX              = 1,
   BUTTON_MIN              = 2,
   BUTTON_STEP             = 3,
   BUTTON_ARRAY            = 4,
   BUTTON_CONTENT          = 5,
   BUTTON_STYLE            = 6,
   BUTTON_ALL              = BUTTON_STYLE+1,
};

char* BUTTON_STR[BUTTON_ALL] ={
   "MODE",
   "MAX",
   "MIN",
   "STEP",
   "ARRAY",
   "CONTENT",
   "STYLE",
};

char *contents[] = {
   "Hello World",
   "This is Line<br>THis is other Line",
   "This text contains <font_size=20 color=#F00>SPECIFIC SIZE</font_size> that does not effected by fit mode"
   };

char *styles[] = {
   "DEFAULT='font=sans font_size=30 color=#000 wrap=mixed ellipsis=1.0'",
   "DEFAULT='font=sans font_size=30 color=#000 wrap=mixed'",
   "DEFAULT='font=sans font_size=30 color=#000 ellipsis=1.0'",
   "DEFAULT='font=sans font_size=30 color=#000'",
   };

char *styles_names[] = {
   "wrap=<color=#F00>mixed</color> ellipsis=<color=#F00>1.0</color>",
   "wrap=<color=#F00>mixed</color> ellipsis=<color=#F00>NONE</color>",
   "wrap=<color=#F00>NONE</color> ellipsis=<color=#F00>1.0</color>",
   "wrap=<color=#F00>NONE</color> ellipsis=<color=#F00>NONE</color>",
   };

typedef struct _APP
{
   Evas_Object *win, *box, *txtblock,*bg, *boxHor, *boxHor2;
   Eo *btn[BUTTON_ALL];
   Eo *lbl_status;
   char * str;
   unsigned int i_contnet, i_style;
} APP;
APP *app;

char * get_fit_status(Eo * textblock);

static void _btn_clicked(void *data EINA_UNUSED, Eo *obj, void *eventInfo EINA_UNUSED){
   if (obj == app->btn[BUTTON_MODE])
     {
        unsigned int options;
        evas_textblock_fit_options_get(app->txtblock, &options);
        if (options == TEXTBLOCK_FIT_MODE_NONE)
           evas_textblock_fit_options_set(app->txtblock, TEXTBLOCK_FIT_MODE_HEIGHT);
        else if (options == TEXTBLOCK_FIT_MODE_HEIGHT)
           evas_textblock_fit_options_set(app->txtblock, TEXTBLOCK_FIT_MODE_WIDTH);
        else if (options == TEXTBLOCK_FIT_MODE_WIDTH)
           evas_textblock_fit_options_set(app->txtblock, TEXTBLOCK_FIT_MODE_ALL);
        else if (options == TEXTBLOCK_FIT_MODE_ALL)
           evas_textblock_fit_options_set(app->txtblock, TEXTBLOCK_FIT_MODE_NONE);
     }
   else if (obj == app->btn[BUTTON_MAX])
     {
        unsigned int min, max;
        evas_textblock_fit_size_range_get(app->txtblock, &min, &max);
        max -= 5;
        evas_textblock_fit_size_range_set(app->txtblock, min, max);
     }
   else if (obj == app->btn[BUTTON_MIN])
     {
        unsigned int min, max;
        evas_textblock_fit_size_range_get(app->txtblock, &min, &max);
        min += 5;
        evas_textblock_fit_size_range_set(app->txtblock, min, max);
     }
   else if (obj == app->btn[BUTTON_STEP])
     {
        unsigned int step;
        evas_textblock_fit_step_size_get(app->txtblock, &step);
        step++;
        evas_textblock_fit_step_size_set(app->txtblock, step);
     }
   else if (obj == app->btn[BUTTON_ARRAY])
     {
        unsigned int font_size[] = {10, 50, 100 ,150};
        evas_textblock_fit_size_array_set(app->txtblock,font_size,4);
     }
   else if (obj == app->btn[BUTTON_CONTENT])
     {
        app->i_contnet++;
        if(app->i_contnet>=sizeof(contents)/sizeof(char*))
           app->i_contnet=0;
        evas_object_textblock_text_markup_set(app->txtblock,contents[app->i_contnet]);
     }
   else if (obj == app->btn[BUTTON_STYLE])
     {
        app->i_style++;
        if(app->i_style>=sizeof(styles)/sizeof(char*))
           app->i_style=0;

        Evas_Textblock_Style *style = evas_object_textblock_style_get(app->txtblock);
        evas_textblock_style_set(style,styles[app->i_style]);
     }

   elm_object_text_set(app->lbl_status, get_fit_status(app->txtblock));
}

char * get_fit_status(Eo * textblock)
{
   static char status[0xFFF];
   unsigned int options,min,max,step,size_array[256];
   size_t size_array_len;
   evas_textblock_fit_options_get(textblock,&options);
   evas_textblock_fit_size_range_get(textblock,&min,&max);
   evas_textblock_fit_step_size_get(textblock,&step);
   evas_textblock_fit_size_array_get(textblock,NULL,&size_array_len,0);
   if (size_array_len>255)
      size_array_len = 255;
   evas_textblock_fit_size_array_get(textblock,size_array,NULL,size_array_len);

   strcpy(status,"Mode : ");
   if (options == TEXTBLOCK_FIT_MODE_NONE)
      strcat(status,"MODE_NONE");
   else if (options == TEXTBLOCK_FIT_MODE_HEIGHT)
      strcat(status,"MODE_HEIGHT");
   else if (options == TEXTBLOCK_FIT_MODE_WIDTH)
      strcat(status,"MODE_WIDTH");
   else if (options == TEXTBLOCK_FIT_MODE_ALL)
      strcat(status,"MODE_ALL");

   strcat(status,"<br>");
   sprintf(status + strlen(status),"Max   : %d<br>",max);
   sprintf(status + strlen(status),"Min   : %d<br>",min);
   sprintf(status + strlen(status),"Step  : %d<br>",step);
   sprintf(status + strlen(status),"Array  : [ ");
   for (size_t i = 0 ; i < 10 ; i++)
     {
        if(i<size_array_len)
           sprintf(status + strlen(status)," %d,",size_array[i]);
     }

   if(10<size_array_len)
      sprintf(status + strlen(status)," ... ");
   sprintf(status + strlen(status)," ]");

   sprintf(status + strlen(status),"<br>");
   sprintf(status + strlen(status),"%s",styles_names[app->i_style]);

   return status;
}

int elm_main(int argc, char **argv)
{
  app = calloc(sizeof(APP), 1);

   elm_policy_set(ELM_POLICY_QUIT, ELM_POLICY_QUIT_LAST_WINDOW_CLOSED);

   app->win = elm_win_util_standard_add("Main", "App");
   elm_win_autodel_set(app->win, EINA_TRUE);

   app->box = elm_box_add(app->win);
   app->boxHor = elm_box_add(app->box);
   app->boxHor2 = elm_box_add(app->box);
   app->txtblock = evas_object_textblock_add(app->box);
   app->bg = elm_bg_add(app->box);
   elm_bg_color_set(app->bg,255,255,255);

   Evas_Textblock_Style *style = evas_textblock_style_new();
   evas_textblock_style_set(style,styles[0]);
   evas_object_textblock_style_set(app->txtblock,style);
   evas_object_textblock_text_markup_set(app->txtblock,contents[0]);

   elm_box_horizontal_set(app->boxHor, EINA_TRUE);
   elm_box_horizontal_set(app->boxHor2, EINA_TRUE);

   evas_object_size_hint_weight_set(app->box, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
   evas_object_size_hint_align_set(app->box, EVAS_HINT_FILL, EVAS_HINT_FILL);

   evas_object_size_hint_weight_set(app->box, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
   evas_object_size_hint_align_set(app->box, EVAS_HINT_FILL, EVAS_HINT_FILL);

   evas_object_show(app->txtblock);
   evas_object_show(app->bg);
   evas_object_show(app->box);
   evas_object_show(app->boxHor);
   evas_object_show(app->boxHor2);

   elm_box_pack_end(app->box, app->bg);
   elm_box_pack_end(app->box, app->boxHor);
   elm_box_pack_end(app->box, app->boxHor2);

   elm_object_content_set(app->bg,app->txtblock);

   elm_win_resize_object_add(app->win, app->box);
   evas_object_resize(app->win, 320, 480);

   for(int i = 0 ; i < BUTTON_ALL ; i++)
     {
        app->btn[i] = elm_button_add(app->boxHor);
        evas_object_smart_callback_add(app->btn[i], "clicked", _btn_clicked, NULL);
        elm_object_text_set(app->btn[i], BUTTON_STR[i]);
        elm_box_pack_end(app->boxHor, app->btn[i]);
        evas_object_show(app->btn[i]);
     }

   app->lbl_status = elm_label_add(app->boxHor2);
   elm_object_text_set(app->lbl_status, get_fit_status(app->txtblock));
   elm_box_pack_end(app->boxHor2, app->lbl_status);
   evas_object_show(app->lbl_status);

   evas_object_size_hint_weight_set(app->txtblock, EVAS_HINT_EXPAND,EVAS_HINT_EXPAND);
   evas_object_size_hint_align_set(app->txtblock, EVAS_HINT_FILL, EVAS_HINT_FILL);

   evas_object_size_hint_weight_set(app->bg, EVAS_HINT_EXPAND,EVAS_HINT_EXPAND);
   evas_object_size_hint_align_set(app->bg, EVAS_HINT_FILL, EVAS_HINT_FILL);

   evas_object_show(app->win);
   elm_run();
   return 0;
}

ELM_MAIN()
```

**Edje**

```
// compile: edje_cc source.edc
// run: edje_player source.edje
collections {
   styles
   {
      style
      {
         name: "text_style";
         base: "font=sans font_size=30 color=#FFF wrap=mixed ellipsis=1.0";
         tag: "br" "\n";
         tag: "ps" "ps";
         tag: "tab" "\t";
         tag: "b" "+ font_weight=Bold";
      }
   }
   group {
      name: "my_group"; // must be the same as in source.c
      parts {

         part
         {
            name: "background";
            type: RECT;
            scale: 1;
            description
            {
               color: 0 0 0 0;
               rel1.relative: 0.0 0.0;
               rel2.relative: 1.0 1.0;
            }
         }

         part
         {
            name: "text";
            type: TEXTBLOCK;
            scale: 1;
            entry_mode: NONE;
            effect: OUTLINE_SHADOW;
            description
            {
               state: "default" 0.0;
               rel1.to : "background";
               rel1.relative: 0.0 0.0;
               rel2.to : "background";
               rel2.relative: 1.0 1.0;
               text
               {
                  style: "text_style";
                  align: 0.0 0.0;
                  text: "Hello World This is Me";
                  fit: 1 1;
                  fit_step: 1;
                  size_range: 30 200;
                  //fit_size_array: 20 40 60 80 100 200;
               }
            }
         }
      }
   }
}
```

Found Task T5724 relative to this Feature

Reviewers: woohyun, bowonryu, cedric, raster

Reviewed By: woohyun

Subscribers: a.srour, #committers, #reviewers, cedric

Tags: #efl

Differential Revision: https://phab.enlightenment.org/D9280
2019-12-12 14:22:46 +09:00
Woochanlee 6830414e95 edje_entry: Fix resource leak.
Reviewers: Jaehyun_Cho, Hermet, ali.alzyod

Subscribers: cedric, #reviewers, #committers

Tags: #efl

Differential Revision: https://phab.enlightenment.org/D10854
2019-12-11 15:49:44 +09:00
Ali Alzyod 621d2cdecf Efl.Canvas.Text rename into Efl.Canvas.Textblock
Summary:
Efl.Canvas.Text                renamed into **Efl.Canvas.Textblock**
Efl.Canvas.Text_Factory  renamed into **Efl.Canvas.Textblock_Factory**

Reviewers: woohyun, segfaultxavi, zmike, bu5hm4n, YOhoho

Reviewed By: segfaultxavi

Subscribers: cedric, #committers, #reviewers

Tags: #efl

Differential Revision: https://phab.enlightenment.org/D10808
2019-12-10 17:39:59 +09:00
Subodh Kumar f86dbae7e3 edje: Add text change signal
There is no way to know about text changes in edc.
This signal will help developer to know about text changes
and do some operation based on that.

@feature

Co-authored-by: Cedric BAIL <cedric.bail@free.fr>

Reviewed-by: Cedric BAIL <cedric.bail@free.fr>
Differential Revision: https://phab.enlightenment.org/D10780
2019-12-04 12:21:26 -08:00
Bowon Ryu 8cb0b193ea edje_entry: converting plain_text to '*' using unicode units.
Summary:
When converting plain_text to '*' in retrieve_surrounding_cb,
always convert it to '*' in 1 byte unit.

For example,
2 byte character is converted to "* *"
and 3 byte character is converted to "* * *"

However, this does not match the number of '*' printed in the entry.
Because, '*' in the entry is printed according to number of unicode characters.

This patch converts plain_text into unicode units
when converting plain_text to '*'

Test Plan: N/A

Reviewers: woohyun

Reviewed By: woohyun

Subscribers: cedric, #reviewers, jihoon, #committers

Tags: #efl

Differential Revision: https://phab.enlightenment.org/D10792
2019-12-04 17:09:33 +09:00
Carsten Haitzler adbf79a3a8 edje - min calc - ix more regressions due to optimizations
again 37b55172b0 broke min size calc.
this time it was for mouse cursors. the entry cursor was 0 sized after
commit 37b55172b0. this disables the
"don't cacle if its 0 sized) which isnt a valid thing to skip - you
caqn min size calc a 0x0 edje ... and it should then return a valid
min size given that design/layout.
2019-12-01 22:56:15 +00:00
Ali Alzyod 7bdb63d045 Polish text interface methods
Summary:
This patch is set to rename some properties of `Efl.Text_Font` & `Efl.Text_Format` interfaces.

1- efl_text_font_set/get become (efl_text_font_family_set/get, efl_text_font_size_set/get)

2- efl_text_valign/halign   become efl_text_vertical/horizontal_align

3- efl_text_halign_auto_type  become  efl_text_horizontal_align_auto_type

Reviewers: ali.alzyod, woohyun, segfaultxavi, bu5hm4n, zmike, cedric

Reviewed By: woohyun

Subscribers: zmike, #committers, #reviewers, cedric

Tags: #efl

Differential Revision: https://phab.enlightenment.org/D10716
2019-11-28 16:55:27 +09:00
Carsten Haitzler 2ca6c301e4 edje - fix min size calc after being broken by previous commit
37b55172b0 breaks min size calc. elm
toolbar was being squashed. e toolbars also were becoming 0 sized.
Just because a swallow does not have content does not mean it does not
affect the minimum size. there still could be a min size set on it
anyway etc. ...
2019-11-28 00:06:15 +00:00
Woochanlee 4ebbe0ad04 edje_calc: Creation macro that perform edje calc, regardless of the edje size.
Summary: edje_recalc_do() needs to be executed regardless of the size of edje in order to deliver edje properties for the API that the user calls.

Reviewers: cedric, Hermet, Jaehyun_Cho, smohanty

Reviewed By: Hermet

Subscribers: cedric, #reviewers, #committers

Tags: #efl

Differential Revision: https://phab.enlightenment.org/D10724
2019-11-26 13:57:16 +09:00
Ali Alzyod d7352f4db4 Efl.Text.Cursor
Summary:
Implementation of new cursor text object.

This Patch Contains :
1- Remove Efl.Text.Cursor & Efl.Text_Markup_Interactive interfaces and replace them with one Class Efl.Text.Cursor
   => there are some modifications on cursor methods

2- Update all related classes to use Efl.Text.Cursor object instead of the old interfaces

3- If class uses Efl.Text_Cursor_Cursor (handle), mainly annotation it will stay as it is until we update other annotations into attribute_factory

4- Add main cursor property into efl.text.interactive

5- Add cursor_new method in efl.ui.text  (I think we may move it into efl.text.interactive interface)

There still some parts that need discussion: especially cursor movement functionality, I prefer to move function with Enum, instead of special function for each movement.

```
enum @beta Efl.Text.Cursor_Move_Type
{
   [[Text cursor movement types]]
   char_next,       [[Advances to the next character]]
   char_prev,       [[Advances to the previous character]]
   cluster_next,    [[Advances to the next grapheme cluster]]
   cluster_prev,    [[Advances to the previous grapheme cluster]]
   paragraph_start, [[Advances to the first character in this paragraph]]
   paragraph_end,   [[Advances to the last character in this paragraph]]
   word_start,      [[Advance to current word start]]
   word_end,        [[Advance to current word end]]
   line_start,      [[Advance to current line first character]]
   line_end,        [[Advance to current line last character]]
   paragraph_first, [[Advance to current paragraph first character]]
   paragraph_last,  [[Advance to current paragraph last character]]
   paragraph_next,  [[Advances to the start of the next text node]]
   paragraph_prev   [[Advances to the end of the previous text node]]
}
move {
         [[Move the cursor]]
         params {
            @in type: Efl.Text.Cursor_Move_Type; [[The type of movement]]
         }
         return: bool; [[True if actually moved]]
      }
```

or old way:
```
char_next {
         [[Advances to the next character]]
         // FIXME: Make the number of characters we moved by? Useful for all the other functions
         return: bool; [[True if actually moved]]
      }
      char_prev {
         [[Advances to the previous character]]
         return: bool; [[True if actually moved]]
      }

      char_delete {
         [[Deletes a single character from position pointed by given cursor.]]
      }

      cluster_next {
         [[Advances to the next grapheme cluster]]
         return: bool; [[True if actually moved]]
      }
      cluster_prev {
         [[Advances to the previous grapheme cluster]]
         return: bool; [[True if actually moved]]
      }

      // FIXME: paragraph_end is inconsistent with word_end. The one goes to the last character and the other after the last character.
      paragraph_start {
         [[Advances to the first character in this paragraph]]
         return: bool; [[True if actually moved]]
      }
      paragraph_end {
         [[Advances to the last character in this paragraph]]
         return: bool; [[True if actually moved]]
      }
      word_start {
         [[Advance to current word start]]
         return: bool; [[True if actually moved]]
      }
      word_end {
         [[Advance to current word end]]
         return: bool; [[True if actually moved]]
      }
      line_start {
         [[Advance to current line first character]]
         return: bool; [[True if actually moved]]
      }
      line_end {
          [[Advance to current line last character]]
         return: bool; [[True if actually moved]]
      }
      paragraph_first {
         [[Advance to current paragraph first character]]
         return: bool; [[True if actually moved]]
      }
      paragraph_last {
         [[Advance to current paragraph last character]]
         return: bool; [[True if actually moved]]
      }
      paragraph_next {
         [[Advances to the start of the next text node]]
         return: bool; [[True if actually moved]]
      }
      paragraph_prev {
         [[Advances to the end of the previous text node]]
         return: bool; [[True if actually moved]]
      }
```

Reviewers: woohyun, tasn, segfaultxavi

Reviewed By: woohyun

Subscribers: a.srour, bu5hm4n, segfaultxavi, cedric, #reviewers, #committers

Tags: #efl

Differential Revision: https://phab.enlightenment.org/D10542
2019-11-22 17:35:54 +09:00
Xavi Artigas 9bb2df9966 Unify "animated" flags
There exist several flags to indicate whether an object should be animated, with inconsistent names:
Efl.Canvas.Layout.animation: bool indicating if Edje animations should be played
Efl.Ui.Spotlight_Manager.animation_enabled: bool indicating if page transitions should be animated
Efl.Canvas.Animation_Player.animation: Efl.Canvas.Animation object

This commit unifies all of them: "animated" is now a flag, and "animation" is an object.

Note: Animation_Player is in the process of being replaced by an "animation" property in the
Efl.Canvas.Object, hence the need for non-clashing animation flags.

Reviewed-by: Marcel Hollerbach <mail@marcel-hollerbach.de>
Differential Revision: https://phab.enlightenment.org/D10645
2019-11-20 09:58:23 +01:00
Carsten Haitzler 9876a78fd3 edje - box - calc min size correctly at start ...
this fixes a logic hole where no chosen desc has been applied yet to a
box and thus it has no start layout thus no way to calc a min size.
this breaks min size calcs you do when setting up and object. this
fixes that by forcing the chosen desk on a min size calc so there is
one.

@fix
2019-11-16 14:22:48 +00:00
abdulleh Ghujeh 2b71b63022 Edje : textblock_styles strncmp improvement
Summary: Improve string comparison

Reviewers: cedric, ali.alzyod, woohyun, bu5hm4n

Reviewed By: woohyun

Subscribers: bu5hm4n, cedric, #reviewers, #committers

Tags: #efl

Differential Revision: https://phab.enlightenment.org/D10635
2019-11-15 10:14:03 +09:00
Lauro Moura 4832d9bfb8 edje: Remove warnings
Missing declaration from another file and removing unused variable.

After D10605

Reviewed-by: Cedric BAIL <cedric.bail@free.fr>
Differential Revision: https://phab.enlightenment.org/D10674
2019-11-14 10:52:04 -08:00
Woochanlee 37b55172b0 edje_calc: Exception handling if no calculation is required.
If there is no object swllowed, do not run part_calc on it.
This swallow will be calculated if there is an associated part, otherwise it will not need to be calculated.

When the app is launched, a lot of edje calculation logic is executed.
Most of the edje size is missing, so the calculation result is meaningless.
Added code to prevent this.

Reviewed-by: Cedric BAIL <cedric.bail@free.fr>
Differential Revision: https://phab.enlightenment.org/D10605
2019-11-14 10:08:56 -08:00
Carsten Haitzler 39240fa3e7 Revert "evas_textblock: content fit feature"
This reverts commit 2f676a6591.

This causes segv's in edje_cc - i suspect the eet changes (or in combo
to how they are used in edje):

AddressSanitizer:DEADLYSIGNAL
=================================================================
==8991==ERROR: AddressSanitizer: SEGV on unknown address 0x000001010000 (pc 0xffff9f002604 bp 0xfffffa747700 sp 0xfffffa747700 T0)
==8991==The signal is caused by a READ memory access.
    #0 0xffff9f002600 in _eet_hash_gen ../src/lib/eet/eet_utils.c:25
    #1 0xffff9efdd024 in eet_dictionary_string_add ../src/lib/eet/eet_dictionary.c:103
    #2 0xffff9efbe324 in eet_data_put_string ../src/lib/eet/eet_data.c:849
    #3 0xffff9efc1c4c in eet_data_put_type ../src/lib/eet/eet_data.c:1427
    #4 0xffff9efd9128 in eet_data_put_unknown ../src/lib/eet/eet_data.c:4730
    #5 0xffff9efdb320 in _eet_data_descriptor_encode ../src/lib/eet/eet_data.c:5108
    #6 0xffff9efd5958 in eet_data_put_variant ../src/lib/eet/eet_data.c:4309
    #7 0xffff9efdb320 in _eet_data_descriptor_encode ../src/lib/eet/eet_data.c:5108
    #8 0xffff9efd9270 in eet_data_put_unknown ../src/lib/eet/eet_data.c:4739
    #9 0xffff9efdb320 in _eet_data_descriptor_encode ../src/lib/eet/eet_data.c:5108
    #10 0xffff9efd8ca0 in eet_data_put_array ../src/lib/eet/eet_data.c:4692
    #11 0xffff9efdb320 in _eet_data_descriptor_encode ../src/lib/eet/eet_data.c:5108
    #12 0xffff9efc7768 in eet_data_write_cipher ../src/lib/eet/eet_data.c:2403
    #13 0xffff9efc78a4 in eet_data_write ../src/lib/eet/eet_data.c:2420
    #14 0xaaaabb151dcc in data_thread_group ../src/bin/edje/edje_cc_out.c:2045
    #15 0xaaaabb152130 in data_write_groups ../src/bin/edje/edje_cc_out.c:2086
    #16 0xaaaabb157734 in data_write ../src/bin/edje/edje_cc_out.c:2866
    #17 0xaaaabb14122c in main ../src/bin/edje/edje_cc.c:456
    #18 0xffff9dbd92a0 in __libc_start_main (/usr/lib/aarch64-linux-gnu/libc.so.6+0x242a0)
    #19 0xaaaabb13ea00  (/home/raster/C/git/efl/build/src/bin/edje/edje_cc+0x38a00)

AddressSanitizer can not provide additional info.
SUMMARY: AddressSanitizer: SEGV ../src/lib/eet/eet_utils.c:25 in _eet_hash_gen
==8991==ABORTING
Aborted (core dumped)

When compiling breaks... it's certainly time to revert ASAP :(
2019-11-07 10:23:58 +00:00
Woochanlee 249ffd6a50 edje_calc: UNLIKELY changed to LIKELY.
It should takes true almost all times when it checks.

Reviewed-by: Cedric BAIL <cedric.bail@free.fr>
Differential Revision: https://phab.enlightenment.org/D10606
2019-11-06 03:01:56 -08:00
Ali Alzyod 2f676a6591 evas_textblock: content fit feature
Summary:
**Content Fit Feature for Evas_Object_Textblock**

This Feature is available at **Evas **object level.  And **Edje **level (where it is internally use evas functionality)
This feature will allow text block to fit its content font size to proper size to fit its area.

**Main Properties:**
Fit Modes        :   None=Default, Width, Height, All [Width+Height]
Fit Size Range :   Contains maximum and minimum font size to be used (and in between).
Fit Step Size    :   Step(Jump) value when trying fonts sizes between Size_Range max and min.
Fit Size Array   :   Other way to resize font, where you explicitly select font sizes to be uses    (for example [20, 50, 100] it will try 3 sizes only)

Text Fit feature was available in Edje but:
1- It doesn't effected by ellipsis or warping in font style (or do not handle the in right way)
2- Accuracy is not good (specially if you have fix pixel size elements (spaces,tabs,items))
3- No (Step size, Size Array) available.

Test Plan:
To check the Feature
> elementary_test
> fit
> textbock fit
You can modify all the modes and properties

These are two examples, One using Evas other uses Edje

**Evas**

```
#include <Elementary.h>

enum BUTTON{
   BUTTON_MODE             = 0,
   BUTTON_MAX              = 1,
   BUTTON_MIN              = 2,
   BUTTON_STEP             = 3,
   BUTTON_ARRAY            = 4,
   BUTTON_CONTENT          = 5,
   BUTTON_STYLE            = 6,
   BUTTON_ALL              = BUTTON_STYLE+1,
};

char* BUTTON_STR[BUTTON_ALL] ={
   "MODE",
   "MAX",
   "MIN",
   "STEP",
   "ARRAY",
   "CONTENT",
   "STYLE",
};

char *contents[] = {
   "Hello World",
   "This is Line<br>THis is other Line",
   "This text contains <font_size=20 color=#F00>SPECIFIC SIZE</font_size> that does not effected by fit mode"
   };

char *styles[] = {
   "DEFAULT='font=sans font_size=30 color=#000 wrap=mixed ellipsis=1.0'",
   "DEFAULT='font=sans font_size=30 color=#000 wrap=mixed'",
   "DEFAULT='font=sans font_size=30 color=#000 ellipsis=1.0'",
   "DEFAULT='font=sans font_size=30 color=#000'",
   };

char *styles_names[] = {
   "wrap=<color=#F00>mixed</color> ellipsis=<color=#F00>1.0</color>",
   "wrap=<color=#F00>mixed</color> ellipsis=<color=#F00>NONE</color>",
   "wrap=<color=#F00>NONE</color> ellipsis=<color=#F00>1.0</color>",
   "wrap=<color=#F00>NONE</color> ellipsis=<color=#F00>NONE</color>",
   };

typedef struct _APP
{
   Evas_Object *win, *box, *txtblock,*bg, *boxHor, *boxHor2;
   Eo *btn[BUTTON_ALL];
   Eo *lbl_status;
   char * str;
   unsigned int i_contnet, i_style;
} APP;
APP *app;

char * get_fit_status(Eo * textblock);

static void _btn_clicked(void *data EINA_UNUSED, Eo *obj, void *eventInfo EINA_UNUSED){
   if (obj == app->btn[BUTTON_MODE])
     {
        unsigned int options;
        evas_textblock_fit_options_get(app->txtblock, &options);
        if (options == TEXTBLOCK_FIT_MODE_NONE)
           evas_textblock_fit_options_set(app->txtblock, TEXTBLOCK_FIT_MODE_HEIGHT);
        else if (options == TEXTBLOCK_FIT_MODE_HEIGHT)
           evas_textblock_fit_options_set(app->txtblock, TEXTBLOCK_FIT_MODE_WIDTH);
        else if (options == TEXTBLOCK_FIT_MODE_WIDTH)
           evas_textblock_fit_options_set(app->txtblock, TEXTBLOCK_FIT_MODE_ALL);
        else if (options == TEXTBLOCK_FIT_MODE_ALL)
           evas_textblock_fit_options_set(app->txtblock, TEXTBLOCK_FIT_MODE_NONE);
     }
   else if (obj == app->btn[BUTTON_MAX])
     {
        unsigned int min, max;
        evas_textblock_fit_size_range_get(app->txtblock, &min, &max);
        max -= 5;
        evas_textblock_fit_size_range_set(app->txtblock, min, max);
     }
   else if (obj == app->btn[BUTTON_MIN])
     {
        unsigned int min, max;
        evas_textblock_fit_size_range_get(app->txtblock, &min, &max);
        min += 5;
        evas_textblock_fit_size_range_set(app->txtblock, min, max);
     }
   else if (obj == app->btn[BUTTON_STEP])
     {
        unsigned int step;
        evas_textblock_fit_step_size_get(app->txtblock, &step);
        step++;
        evas_textblock_fit_step_size_set(app->txtblock, step);
     }
   else if (obj == app->btn[BUTTON_ARRAY])
     {
        unsigned int font_size[] = {10, 50, 100 ,150};
        evas_textblock_fit_size_array_set(app->txtblock,font_size,4);
     }
   else if (obj == app->btn[BUTTON_CONTENT])
     {
        app->i_contnet++;
        if(app->i_contnet>=sizeof(contents)/sizeof(char*))
           app->i_contnet=0;
        evas_object_textblock_text_markup_set(app->txtblock,contents[app->i_contnet]);
     }
   else if (obj == app->btn[BUTTON_STYLE])
     {
        app->i_style++;
        if(app->i_style>=sizeof(styles)/sizeof(char*))
           app->i_style=0;

        Evas_Textblock_Style *style = evas_object_textblock_style_get(app->txtblock);
        evas_textblock_style_set(style,styles[app->i_style]);
     }

   elm_object_text_set(app->lbl_status, get_fit_status(app->txtblock));
}

char * get_fit_status(Eo * textblock)
{
   static char status[0xFFF];
   unsigned int options,min,max,step,size_array[256];
   size_t size_array_len;
   evas_textblock_fit_options_get(textblock,&options);
   evas_textblock_fit_size_range_get(textblock,&min,&max);
   evas_textblock_fit_step_size_get(textblock,&step);
   evas_textblock_fit_size_array_get(textblock,NULL,&size_array_len,0);
   if (size_array_len>255)
      size_array_len = 255;
   evas_textblock_fit_size_array_get(textblock,size_array,NULL,size_array_len);

   strcpy(status,"Mode : ");
   if (options == TEXTBLOCK_FIT_MODE_NONE)
      strcat(status,"MODE_NONE");
   else if (options == TEXTBLOCK_FIT_MODE_HEIGHT)
      strcat(status,"MODE_HEIGHT");
   else if (options == TEXTBLOCK_FIT_MODE_WIDTH)
      strcat(status,"MODE_WIDTH");
   else if (options == TEXTBLOCK_FIT_MODE_ALL)
      strcat(status,"MODE_ALL");

   strcat(status,"<br>");
   sprintf(status + strlen(status),"Max   : %d<br>",max);
   sprintf(status + strlen(status),"Min   : %d<br>",min);
   sprintf(status + strlen(status),"Step  : %d<br>",step);
   sprintf(status + strlen(status),"Array  : [ ");
   for (size_t i = 0 ; i < 10 ; i++)
     {
        if(i<size_array_len)
           sprintf(status + strlen(status)," %d,",size_array[i]);
     }

   if(10<size_array_len)
      sprintf(status + strlen(status)," ... ");
   sprintf(status + strlen(status)," ]");

   sprintf(status + strlen(status),"<br>");
   sprintf(status + strlen(status),"%s",styles_names[app->i_style]);

   return status;
}

int elm_main(int argc, char **argv)
{
  app = calloc(sizeof(APP), 1);

   elm_policy_set(ELM_POLICY_QUIT, ELM_POLICY_QUIT_LAST_WINDOW_CLOSED);

   app->win = elm_win_util_standard_add("Main", "App");
   elm_win_autodel_set(app->win, EINA_TRUE);

   app->box = elm_box_add(app->win);
   app->boxHor = elm_box_add(app->box);
   app->boxHor2 = elm_box_add(app->box);
   app->txtblock = evas_object_textblock_add(app->box);
   app->bg = elm_bg_add(app->box);
   elm_bg_color_set(app->bg,255,255,255);

   Evas_Textblock_Style *style = evas_textblock_style_new();
   evas_textblock_style_set(style,styles[0]);
   evas_object_textblock_style_set(app->txtblock,style);
   evas_object_textblock_text_markup_set(app->txtblock,contents[0]);

   elm_box_horizontal_set(app->boxHor, EINA_TRUE);
   elm_box_horizontal_set(app->boxHor2, EINA_TRUE);

   evas_object_size_hint_weight_set(app->box, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
   evas_object_size_hint_align_set(app->box, EVAS_HINT_FILL, EVAS_HINT_FILL);

   evas_object_size_hint_weight_set(app->box, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
   evas_object_size_hint_align_set(app->box, EVAS_HINT_FILL, EVAS_HINT_FILL);

   evas_object_show(app->txtblock);
   evas_object_show(app->bg);
   evas_object_show(app->box);
   evas_object_show(app->boxHor);
   evas_object_show(app->boxHor2);

   elm_box_pack_end(app->box, app->bg);
   elm_box_pack_end(app->box, app->boxHor);
   elm_box_pack_end(app->box, app->boxHor2);

   elm_object_content_set(app->bg,app->txtblock);

   elm_win_resize_object_add(app->win, app->box);
   evas_object_resize(app->win, 320, 480);

   for(int i = 0 ; i < BUTTON_ALL ; i++)
     {
        app->btn[i] = elm_button_add(app->boxHor);
        evas_object_smart_callback_add(app->btn[i], "clicked", _btn_clicked, NULL);
        elm_object_text_set(app->btn[i], BUTTON_STR[i]);
        elm_box_pack_end(app->boxHor, app->btn[i]);
        evas_object_show(app->btn[i]);
     }

   app->lbl_status = elm_label_add(app->boxHor2);
   elm_object_text_set(app->lbl_status, get_fit_status(app->txtblock));
   elm_box_pack_end(app->boxHor2, app->lbl_status);
   evas_object_show(app->lbl_status);

   evas_object_size_hint_weight_set(app->txtblock, EVAS_HINT_EXPAND,EVAS_HINT_EXPAND);
   evas_object_size_hint_align_set(app->txtblock, EVAS_HINT_FILL, EVAS_HINT_FILL);

   evas_object_size_hint_weight_set(app->bg, EVAS_HINT_EXPAND,EVAS_HINT_EXPAND);
   evas_object_size_hint_align_set(app->bg, EVAS_HINT_FILL, EVAS_HINT_FILL);

   evas_object_show(app->win);
   elm_run();
   return 0;
}

ELM_MAIN()
```

**Edje**

```
// compile: edje_cc source.edc
// run: edje_player source.edje
collections {
   styles
   {
      style
      {
         name: "text_style";
         base: "font=sans font_size=30 color=#FFF wrap=mixed ellipsis=1.0";
         tag: "br" "\n";
         tag: "ps" "ps";
         tag: "tab" "\t";
         tag: "b" "+ font_weight=Bold";
      }
   }
   group {
      name: "my_group"; // must be the same as in source.c
      parts {

         part
         {
            name: "background";
            type: RECT;
            scale: 1;
            description
            {
               color: 0 0 0 0;
               rel1.relative: 0.0 0.0;
               rel2.relative: 1.0 1.0;
            }
         }

         part
         {
            name: "text";
            type: TEXTBLOCK;
            scale: 1;
            entry_mode: NONE;
            effect: OUTLINE_SHADOW;
            description
            {
               state: "default" 0.0;
               rel1.to : "background";
               rel1.relative: 0.0 0.0;
               rel2.to : "background";
               rel2.relative: 1.0 1.0;
               text
               {
                  style: "text_style";
                  align: 0.0 0.0;
                  text: "Hello World This is Me";
                  fit: 1 1;
                  fit_step: 1;
                  size_range: 30 200;
                  //fit_size_array: 20 40 60 80 100 200;
               }
            }
         }
      }
   }
}
```

Found Task T5724 relative to this Feature

Reviewers: woohyun, bowonryu, cedric, raster

Subscribers: #committers, #reviewers, cedric

Tags: #efl

Differential Revision: https://phab.enlightenment.org/D9280
2019-11-05 20:40:59 +09:00
Cedric Bail 7dc98ab3d0 evas: move efl_input_device into evas/Efl_Canvas.h
Summary:
The internal and the API we would like is mostly a canvas API. A lot of the code
in evas is working around the fact that efl_input_device is not defined inside Evas.
This patch is the first step to try to clean this up.

Depends on D10487

Reviewers: zmike, raster, bu5hm4n, Hermet

Reviewed By: zmike

Subscribers: #reviewers, #committers

Tags: #efl

Maniphest Tasks: T8321

Differential Revision: https://phab.enlightenment.org/D10488
2019-10-31 13:29:56 -04:00
Cedric Bail e502da8345 edje: load edje seat callback only when necessary.
Summary:
This reduce in elementary_test the number of callback registered on the
canvas from hundreds to around 10.

Depends on D10486

Reviewers: zmike, raster, bu5hm4n, Hermet

Reviewed By: zmike

Subscribers: #reviewers, #committers

Tags: #efl

Maniphest Tasks: T8321

Differential Revision: https://phab.enlightenment.org/D10487
2019-10-31 09:17:46 -04:00
Cedric Bail 27e1bf2fe3 edje: improve callback count on Evas canvas.
Summary:
This reduce by 3 the amount of callback registered on the canvas. Another
potential improvement would be to only register those callback if someone
is listening for a 'seat,*' event or if the edje file define seat filters.

Depends on D10484

Reviewers: zmike, raster, bu5hm4n, Hermet

Reviewed By: zmike

Subscribers: #reviewers, #committers

Tags: #efl

Maniphest Tasks: T8321

Differential Revision: https://phab.enlightenment.org/D10486
2019-10-31 09:17:40 -04:00
Woochanlee d5bd2ed2d0 edje_calc: Remove unused flag.
Summary: This has marked remove me.

Reviewers: raster, Hermet, zmike, devilhorns

Reviewed By: devilhorns

Subscribers: cedric, #reviewers, #committers

Tags: #efl

Differential Revision: https://phab.enlightenment.org/D10561
2019-10-30 08:10:09 -04:00
Mike Blumenkrantz 2477dfaf59 edje: selectively inhibit content,changed events when changing swallowed parts
ref T8321

Reviewed-by: Marcel Hollerbach <mail@marcel-hollerbach.de>
Differential Revision: https://phab.enlightenment.org/D10508
2019-10-29 16:17:48 +01:00
Woochanlee 8536c066eb edje_calc: Delete duplicated conditional statement.
Summary: this is identical to the conditional above and can be merged
to improve code clarity

Reviewers: raster, Hermet, zmike

Reviewed By: zmike

Subscribers: cedric, #reviewers, #committers

Tags: #efl

Differential Revision: https://phab.enlightenment.org/D10549
2019-10-29 10:19:43 -04:00
Mike Blumenkrantz b1a2d82417 edje: block "recalc" event emission if it isn't being subscribed to
Summary:
this gets called a ton

ref T8321
Depends on D10356

Reviewers: bu5hm4n, cedric

Reviewed By: bu5hm4n, cedric

Subscribers: cedric, #reviewers, #committers

Tags: #efl

Maniphest Tasks: T8321

Differential Revision: https://phab.enlightenment.org/D10357
2019-10-14 09:29:50 -04:00
Xavi Artigas 5a447ed327 docs: Remove redundant documentation
Lots of EO files had the same information at the property and set/get level.
Removed the redundant bits, and moved to the property level the common ones.
Set and Get documentation should be used only to clarify setter-only or
getter-only behavior.
2019-10-07 16:40:50 +02:00
Mike Blumenkrantz 1d27c9d2e4 edje/edit: add api for checking 'required' property of parts
Summary: this is useful for verifying api compliance

Reviewers: cedric

Reviewed By: cedric

Subscribers: segfaultxavi, cedric, #reviewers, #committers

Tags: #efl

Differential Revision: https://phab.enlightenment.org/D10055
2019-10-02 12:15:10 +02:00
Mike Blumenkrantz e55a6f6778 edje: add Efl_Layout.h for eo-based layout headers
this includes all related headers

ref T8274

Additional Authors: Lauro Moura <lauromoura@expertisesolutions.com.br>

Reviewed-by: Marcel Hollerbach <mail@marcel-hollerbach.de>
Differential Revision: https://phab.enlightenment.org/D10228
2019-09-30 10:33:27 +02:00
Mike Blumenkrantz 7a82dfbcc7 edje: rename edje_types.eot to efl_canvas_types.eot and move include
this has no relation to legacy and should not be included in legacy headers

Reviewed-by: Marcel Hollerbach <mail@marcel-hollerbach.de>
Differential Revision: https://phab.enlightenment.org/D10227
2019-09-30 10:33:25 +02:00
Daniel Kolesa 6d93dc4cbf eolian: rename event_prefix to event_c_prefix for consistency 2019-09-26 16:47:22 +02:00
WooHyun Jung 3bdd50e412 edje_legacy: add validation check to return legacy default value
Summary:
When invalid object comes, the return value should be
EINA_FALSE.

Reviewers: zmike, bu5hm4n, segfaultxavi

Reviewed By: zmike

Subscribers: cedric, #reviewers, #committers

Tags: #efl

Differential Revision: https://phab.enlightenment.org/D10185
2019-09-26 08:59:31 -04:00
Mike Blumenkrantz b730443e2d efl/player: play_speed -> playback_speed
no functional changes

ref T7877

Reviewed-by: Cedric BAIL <cedric.bail@free.fr>
Differential Revision: https://phab.enlightenment.org/D10115
2019-09-24 15:23:16 -07:00
Mike Blumenkrantz 3d3cdc5955 efl/player: rename 'play' property to 'pause'
this is a bit of an overhaul wherein the existing 'play' mechanics are
all inverted. 'pause' is a state which stops playback but does not affect
the playback_position property.

this patch also includes implementations of Efl.Player::playing for
a couple classes which (now) only implement pause, as this is a requirement
for the objects to actually activate their animations

test cases:
* unit tests
* all elm_test animation cases
* elm_test video
* rage

Reviewed-by: Cedric BAIL <cedric.bail@free.fr>
Differential Revision: https://phab.enlightenment.org/D10114
2019-09-24 15:23:15 -07:00
Mike Blumenkrantz 5c2ea620a1 efl/player: prune properties duplicated in efl.playable
efl.playable implements a number of properties which are also present
in efl.player. playable was intended to be separate, so enforce this
split in all classes which use player

ref T7877

Reviewed-by: Cedric BAIL <cedric.bail@free.fr>
Differential Revision: https://phab.enlightenment.org/D10109
2019-09-24 15:23:09 -07:00
Carsten Haitzler e3610b92b9 edje - physics - remove warning of unused arg if physics disabled
simple warning removal. no core changes.
2019-09-16 01:26:16 +01:00
Xavi Artigas 8c09c1cae8 docs: Move property docs to property level instead of set/get
Eolian @properties should be documented at the property level, and
documentation at the setter or getter level should be left to setter-
or getter-specific comments. There is usually no need at all to have
setter- or getter- specific comments.
Also, a property is not a method so descriptions should match that.

This patch removes lots of duplicated text, and will allow enabling
by default the eolian check that ensures that properties have proper
property-level docs.

No functional changes.
2019-09-13 12:30:03 +02:00
Mike Blumenkrantz 5489482484 efl: check file's mtime in efl.file::file_set to determine if file is the same
Summary:
historically, if the mtime of an edj file changes after being loaded,
the edje file should be reloaded. this needs to occur in a single call
with the previous user definitions intact, so verify that the mtime is
the same in efl.file::file_set when using the same file name

@fix

Reviewers: cedric

Reviewed By: cedric

Subscribers: #reviewers, #committers

Tags: #efl

Differential Revision: https://phab.enlightenment.org/D9877
2019-09-11 13:38:21 -04:00
Marcel Hollerbach 3d03d4031d build: fix disabling of audio
Summary: this supports disabling audio building in efl.

Reviewers: tasn, zmike

Reviewed By: zmike

Subscribers: zmike, cedric, #reviewers, #committers

Tags: #efl

Differential Revision: https://phab.enlightenment.org/D9873
2019-09-09 09:17:30 -04:00
Daniel Kolesa 4f4b58bf4c efl: change all occurences of @owned to @move 2019-09-06 17:01:05 +02:00
junsu choi 35f188239a edje_edit: Prevent dangling pointer. 2019-09-06 11:08:59 +09:00
Carsten Haitzler e6d9ea7539 fix more edje file set breaks
if group does change unloaidng first is bad because of the same
reasons - losing swallowed etc. content. so disable entirely.
2019-09-05 14:33:00 +01:00
Carsten Haitzler a70808fb96 fix a bunch of breaks that having a blind file unload has brought
We can't blindly unload here - this loses swallowed content (in swallows,
boxes, tables etc.) ... this here along with an actual implementation of file
unload broke the pager in E for starters as shading then unshading (double
click titlebar) a window would lose the mini preview image obj swallowed in.
also fullscreening would do it. this also broke gadget bar, the xkb gadget in
it too and more... so this is a particularly bad thing break.

@fix
2019-09-05 14:24:21 +01:00
Ali Alzyod 7a05d8d769 elm_entry: handle cursor delete/backspace with clusters consist of one or multible glyphs
Summary:
Cluster consist of one glyph, expected to be removed on backspace or delete key.
Cluster consist of multible glyph, expectd to remove part of on backspace or delete key.

This is behaviour founded in Android. (our current way of handling similar to Qt)

**New Behaviour**
{F3750386}

**Old Behaviour**
{F3750387}

Test Plan:
Auto Testing is challenging because there are no easy way to emulate keyboard down on elm_entry
```
#include <Elementary.h>

EAPI_MAIN int
elm_main(int argc, char **argv)
{
   Evas_Object *win,*box,*entry;

   elm_policy_set(ELM_POLICY_QUIT, ELM_POLICY_QUIT_LAST_WINDOW_CLOSED);

   win = elm_win_util_standard_add("", "");
   elm_win_autodel_set(win, EINA_TRUE);

   box = elm_box_add(win);
   entry = elm_entry_add(box);

   evas_object_size_hint_weight_set(box,EVAS_HINT_EXPAND,EVAS_HINT_EXPAND);
   evas_object_size_hint_align_set(box,EVAS_HINT_FILL,EVAS_HINT_FILL);

   elm_entry_entry_set(entry,"<font=NotoColorEmoji wrap=mixed >🇧🇬อั🇧🇬อั&#x1F600;&#x1F600;&#x1F600;&#x1F600;&#x1F600;อั</font>");
   evas_object_size_hint_weight_set(entry,EVAS_HINT_EXPAND,0.9);
   evas_object_size_hint_align_set(entry,EVAS_HINT_FILL,EVAS_HINT_FILL);
   evas_object_show(entry);
   evas_object_show(box);

   elm_box_pack_end(box,entry);
   elm_win_resize_object_add(win,box);
   evas_object_resize(win,320,480);

   evas_object_size_hint_weight_set(entry,EVAS_HINT_EXPAND,0.1);
   evas_object_size_hint_align_set(entry,EVAS_HINT_FILL,EVAS_HINT_FILL);

   evas_object_show(win);
   elm_run();

   return 0;
}
ELM_MAIN()

```

Reviewers: tasn, woohyun, bowonryu

Subscribers: cedric, #reviewers, #committers

Tags: #efl

Differential Revision: https://phab.enlightenment.org/D9628
2019-09-05 14:52:51 +09:00
subhransu mohanty 5370c2e795 edje/optimization: refactor edje_color_class_set() api.
Summary:
During _elm_config_color_overlay_apply() application can call this api
100's of time depending on how many overlay it wants add . As each color_class
set triggers the global color class apply chain 3 times (for color , outline and shadow)
just club them once and emit single color_class,set event.

Reviewers: Hermet, ali.alzyod, zmike

Reviewed By: zmike

Subscribers: cedric, #reviewers, #committers

Tags: #efl

Differential Revision: https://phab.enlightenment.org/D9784
2019-08-29 14:31:52 -04:00
subhransu mohanty 35e385a1ec edje/style: append file prefix to textblock_style api that affects on file level
Summary:
All those api's are working on the Edje_file level so by appending the file prefix
and changing the argument to Edje_File leads to easy maintainability.

Depends on D9776

Reviewers: Hermet, ali.alzyod, zmike

Reviewed By: zmike

Subscribers: cedric, #reviewers, #committers

Tags: #efl

Differential Revision: https://phab.enlightenment.org/D9777
2019-08-29 13:21:11 -04:00
Mike Blumenkrantz 9e0a285eea efl: implement efl.file::unload for classes that implement load
unload is a crucial method for classes that implement load, as this is
the method which is called during e.g., efl_file_simple_load() when
a new file is specified in order to destroy the previous object data

Reviewed-by: Marcel Hollerbach <mail@marcel-hollerbach.de>
Differential Revision: https://phab.enlightenment.org/D9786
2019-08-29 17:17:08 +02:00
Hermet Park d723adf1ee Edje: ease the warning level.
We already take care the case, it's not so serious as to error.
2019-08-29 14:34:43 +09:00
subhransu mohanty e2663ba8f3 edje/style/optimization: Enable lazy computaion of styles.
Summary:
As user request for the evas_textblock_style through _edje_textblock_style_get()
api and that api implements lazy computation of the styles. By just marking the
style dirty (stl->cache=false) will be enough. no need to calculate the style
computaion at that time.

Reviewers: Hermet, ali.alzyod, kimcinoo, woohyun

Reviewed By: Hermet

Subscribers: cedric, #reviewers, #committers

Tags: #efl

Differential Revision: https://phab.enlightenment.org/D9776
2019-08-29 14:32:28 +09:00
subhransu mohanty 5f70cacd92 edje/textblock: Added edje_textblock_style_get() api.
Summary:
Now all textblock_style functionality are wrapped under api
for easy of optimization. so going forward no one should directly
acess the styles from the File . the styles should be acesses by
the internal api's provided by edje_textblock_style.

Reviewers: Hermet, ali.alzyod, woohyun, kimcinoo

Reviewed By: kimcinoo

Subscribers: cedric, #reviewers, #committers

Tags: #efl

Differential Revision: https://phab.enlightenment.org/D9774
2019-08-29 11:35:24 +09:00
subhransu mohanty 4b511671de edje: refactor _edje_object_file_set_internal() part 2.
Summary:
- split functionality into smaller helper class
  _edje_process_colorclass() , _edje_process_sizeclass() and
 _edje_process_physics() for easy redability and maintenance.

Reviewers: Hermet, zmike

Reviewed By: Hermet

Subscribers: cedric, #reviewers, #committers

Tags: #efl

Differential Revision: https://phab.enlightenment.org/D9764
2019-08-28 16:23:55 +09:00
subhransu mohanty d7d9ed856f edje/style: remove dead code.
Summary: leftover from last refactoring.

Reviewers: Hermet, ali.alzyod

Reviewed By: Hermet

Subscribers: cedric, #reviewers, #committers

Tags: #efl

Differential Revision: https://phab.enlightenment.org/D9763
2019-08-28 14:07:05 +09:00
subhransu mohanty 4b2403d80c edje: refactor _edje_object_file_set_internal() function
Summary:
move the file related function to edje_cache so that code
is easy to read and maintainable and we don't have to do unnecessary
stuff for each edje object creation.

Reviewers: Hermet

Reviewed By: Hermet

Subscribers: cedric, #reviewers, #committers

Tags: #efl

Differential Revision: https://phab.enlightenment.org/D9761
2019-08-28 13:18:42 +09:00
subhransu mohanty 05ea1854a9 edje/load: pass Edje_File instead of Edje to _edje_extract_mo_files()
Summary:
Why :
1. The function operates on the Edje_File level not on Edje object
   level , so express it clearly in the function argument.
2. if its clear that this function works on file level then
   this should be called when the theme file loaded for the first time
   not on every Edje object creation.

Reviewers: Hermet, zmike, raster, cedric

Reviewed By: zmike

Subscribers: cedric, #reviewers, #committers

Tags: #efl

Differential Revision: https://phab.enlightenment.org/D9753
2019-08-27 08:04:43 -04:00
subhransu mohanty fcc235b329 edje/optimization: replace eina_list with eina_array.
Summary:
We were creating 3 eina_list and destroying inside a for loop.
replace that with creating a single eina_array at start and use
eina_array_clean() function ro reuse the array.

Reviewers: Hermet, zmike, cedric, raster

Reviewed By: zmike

Subscribers: cedric, #reviewers, #committers

Tags: #efl

Differential Revision: https://phab.enlightenment.org/D9745
2019-08-27 07:42:14 -04:00
Yeongjong Lee 9c52484caf efl_pack_table: rename table_position to cell_column, cell_row
Summary:
Rename ambiguous `table_position` property. it is actually related to child
column, row.

ref T7900

Reviewers: segfaultxavi, zmike

Reviewed By: segfaultxavi

Subscribers: cedric, #reviewers, #committers

Tags: #efl_api

Maniphest Tasks: T7900

Differential Revision: https://phab.enlightenment.org/D9611
2019-08-27 12:57:35 +02:00
subhransu mohanty 02b63b8260 edje/cache: Refactor _edje_cache_file_coll_open()
Summary:
This function does lot of things
- can be called only to load the file (by passing coll as null)
- can be called to load both file and open the collection from the file.
- handles the file_cache logic
- handles fixing the collection after reading from file.

this patch is targeting to split the responsibility to
smaller function for easy maintenance and code readability.

future patch to follow for splitting the file opening and collection
opening to two different function.

Reviewers: Hermet, raster, cedric, zmike

Reviewed By: zmike

Subscribers: zmike, cedric, #reviewers, #committers

Tags: #efl

Differential Revision: https://phab.enlightenment.org/D9715
2019-08-26 08:31:08 -04:00
subhransu mohanty e742bf67e4 edje/style: optimize style_update function.
Summary:
If the style is readonly then we know for sure it dosen't have any text_class/color_class.
If a style has text_class tag then call update only once not for each text_class tag it has.

Reviewers: ali.alzyod, Hermet, cedric, raster

Subscribers: cedric, #reviewers, #committers

Tags: #efl

Differential Revision: https://phab.enlightenment.org/D9641
2019-08-26 14:22:43 +09:00
Carsten Haitzler 8145d90ce7 edje signal matches - try number 3 to try plug all the holes
i found some more cases where the hash may change, so del and add from
the hash when this happens...

and... i found a nasty. _edje_signal_match_key_cmp compared pointers
like:

int return = ptr_a - ptr_b;

what happens if .... ptr_a and ptr_b are more than 2^31 (2gb) apart?
overflow (or underflow) and we return the wrong thing. i suspect this
is part of the problem and why my has remove/adds have not been
working because ... i suspect that maybe the hash dels have not been
finding things. i can't be sure right now, but it is an obvious
problem that i fixed by just doing if's and returning -1 or 1. also i
found a double-add or overwrite int he hash - when we shuffled with
_edje_signal_callback_move_last the matches CAN match exactly
something already in the hash thus adding it in will conflict with
what is already there as keys match. handle this cvase now and i have
seen segv's go away for now.

@fix
2019-08-23 19:36:42 +01:00
Carsten Haitzler a7273fc864 edje signal - let's not crash if something odd happens
better we dont just crash but err log it which can be set to abort
anyway.

@fix
2019-08-23 19:36:42 +01:00
subhransu mohanty 1e079a7568 edje/style: Enable lazy computaion of styles.
Summary:
Instead of updating all the styles in an Edje_File just mark them
dirty so that subsequent  call to style will recompute the new style before
returning the style.

Reviewers: ali.alzyod, Hermet, raster, cedric

Reviewed By: cedric

Subscribers: cedric, #reviewers, #committers

Tags: #efl

Differential Revision: https://phab.enlightenment.org/D9697
2019-08-23 11:11:05 +09:00
Carsten Haitzler 456419f468 edje - signal callback matches/patterns try fix number 2
so i think there was also another bug as i saw this again now. this
should hopefully plug the signal/mtach memory bugs now by removing
and adding back to hash as the hash key relies on the memory addresses
of signal/src in the matches array which change on realloc. a bit
brute-forceey but... better than crashes.

@fix
2019-08-22 19:53:03 +01:00
subhransu mohanty cce73a2b4b edje/style: fix memory leak because of typo.
Summary:
We already have a escaped string for the font_source so
this code is unnecessary.

Reviewers: Hermet

Subscribers: cedric, #reviewers, #committers

Tags: #efl

Differential Revision: https://phab.enlightenment.org/D9698
2019-08-22 14:22:23 +09:00
subhransu mohanty 7c08d7b97c edje/style: Avoid unnecessary evas_textblock_style computation.
Summary:
If the style is not readonly we always compute the style again when
requested by edje. so this computation is unnecessary.
By avoiding the computation here we will avoid style computation of all the styles in the edje
that is not readonly hence saving memory.

Reviewers: ali.alzyod, Hermet, cedric, raster

Subscribers: cedric, #reviewers, #committers

Tags: #efl

Differential Revision: https://phab.enlightenment.org/D9693
2019-08-22 10:53:36 +09:00
Carsten Haitzler e15d9c86df eina file refs in edje/evas - audit them and plug holes where refs stay
in 1 situation at least we delete the eina file (close it) but keep
the ptr around (during destruction) which could cause issues with
callbaks and events on del and so on.... which may lead to multiple
closes where only one should happen ... which would explain my invalid
eina file ref problems i'm seeing. i carefully matched eina file
handle stores/opens/dups to closes in edje/evas and they seemed to all
match up so this audit with comments and fixes seems to have plugged
that now.

@fix
2019-08-21 20:02:24 +01:00
Carsten Haitzler 14e355692b edje - handle errors and eina file handles and vpath properly
@fix
2019-08-21 20:02:23 +01:00
Carsten Haitzler d436971958 edje calc - merge 2 switch statements that are doing 2 phases
we have nigh identical switch logic, so merge these to avoid multiple
switches and type matches. it localises per-type logic too which is
nicer.
2019-08-21 20:02:23 +01:00
Carsten Haitzler cfa8224140 edje recalc - move rare recalc code out of hot path
we rarely use tables in edje, so move it out of the hot path for
intruction prefetch/cache. also for calc single - move things to sub
funcs so things like mesh, light and so on code is always out of the
hot path as much as possible. we probably can merge our 2 switch
statements as well. this really just restructures the code to move
stuff into sub functions which also does make the calc funcs look
simpler and easier to read.
2019-08-21 20:02:23 +01:00
Carsten Haitzler fa28f5a5f8 edje signal matches/patterns - handle re/alloc errors and missing ptrs
also a general cleanup of the code to make it easier to follow/read as
this seems to have problems but i cant reproduce them enough to find
them. i noted a realloc would have invalidated pre-stored pattern
ptrs that would cause segv's for sure. also code paths where reallocs may
fail and not handling those cases at all etc.

@fix
2019-08-21 20:02:23 +01:00
subhransu mohanty 10501b170f edje/optimization: keep a style hash for fast retrival of styles
As edje mostly deals with style string. to get the style data each time
it linearly search through list to find out the style which is not very
cache friendly so keep a hash to do first lookup with less impact on cache.

Reviewed-by: Cedric BAIL <cedric.bail@free.fr>
Differential Revision: https://phab.enlightenment.org/D9547
2019-08-20 10:40:22 -07:00
subhransu mohanty 676835458f edje/style: optimize updation of styles for a given text_style
Currently we do 2 pass updation. first we scan through all the styles
and check if they have text_style which matches the test_style we need to update
then we mark them dirty. then we call style_all_update() to go through the list
again and update those styles.
By combining them both in a single function we avoid scanning through the whole
list again.

Reviewed-by: Cedric BAIL <cedric.bail@free.fr>
Differential Revision: https://phab.enlightenment.org/D9639
2019-08-20 10:40:19 -07:00
subhransu mohanty 6f0730cef3 edje/style: refactor style parsing to remove temporary dynamic string creation.
Summary:
pass a buffer to reparse() function for reuse.
create fontsource once and reuse.

Reviewers: ali.alzyod, Hermet, cedric, raster

Reviewed By: Hermet

Subscribers: cedric, #reviewers, #committers

Tags: #efl

Differential Revision: https://phab.enlightenment.org/D9636
2019-08-20 14:36:22 +09:00
subhransu mohanty dafd3dc7b8 edje/style: refactor to avoid creating temporary strings.
Summary: param_parse() was creating unnecessary 2 temporary string and destroying it.

Reviewers: ali.alzyod, cedric, Hermet, raster

Reviewed By: Hermet

Subscribers: cedric, #reviewers, #committers

Tags: #efl

Differential Revision: https://phab.enlightenment.org/D9610
2019-08-19 19:38:35 +09:00
subhransu mohanty a880a756cd edje/styles: avoid redundant style tag addition by providing extra checks.
Summary:
we should only add font_size tag if the new size is different.
we should only add font tag if there is a new font.

Reviewers: ali.alzyod, Hermet, cedric, raster

Reviewed By: Hermet

Subscribers: cedric, #reviewers, #committers

Tags: #efl

Differential Revision: https://phab.enlightenment.org/D9613
2019-08-19 19:33:56 +09:00
subhransu mohanty 1d930427a3 edje/styles: keep an escaped string of font_set. As eina_ecaped_string() creates a new string just make it once and use when needed.
Reviewers: Hermet, ali.alzyod

Reviewed By: Hermet

Subscribers: cedric, #reviewers, #committers

Tags: #efl

Differential Revision: https://phab.enlightenment.org/D9615
2019-08-19 19:21:47 +09:00
Hermet Park f10a3c9ee3 edje: fix compatibility issue.
Obviously previous edje object file set would try reload file
even though the file is already loaded.

This brings different result if the file data has been modified or changed.
2019-08-19 18:07:04 +09:00
subhransu mohanty d672d55107 edje/optimization: keep a readonly flag on edje_style.
Just to check if the edje style has text_class tag we do
lot of pointer hopping by linearly scan through the tags in the
style which is not very cache efficient.

by keeping a readonly flag we can avoid those acess if the style dosen't
have any text_class tags. and if we have those tags then we can start
updating the style straight away.

Reviewed-by: Cedric BAIL <cedric.bail@free.fr>
Differential Revision: https://phab.enlightenment.org/D9546
2019-08-14 12:08:17 -07:00
Mike Blumenkrantz e1fda2cbdb efl/hints: add restricted and combined max size hints
these function the same as the min size hint versions and enable
distinction between internally-set max size hints and user-set max size
hints

@feature

ref T8122

Reviewed-by: Cedric BAIL <cedric.bail@free.fr>
Reviewed-by: Xavi Artigas <xavierartigas@yahoo.es>
Differential Revision: https://phab.enlightenment.org/D9553
2019-08-14 12:08:13 -07:00
Mike Blumenkrantz 304f4ce9bb efl: remove Efl.Ui.I18n from canvas object inheritance
Summary:
canvas objects do not need localization because they are not directly user-facing

this should only be inherited by objects which need to be localized
Depends on D9559

Reviewers: q66

Reviewed By: q66

Subscribers: cedric, #reviewers, #committers

Tags: #efl

Differential Revision: https://phab.enlightenment.org/D9560
2019-08-14 19:25:09 +02:00