Commit Graph

283 Commits

Author SHA1 Message Date
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
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
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
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
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
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
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
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 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
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
Subodh Kumar 2854702f8e edje: Add support for map zoom to use other part center.
Summary:
Current:
In edc, zoom is supposed to happen from object center, there is no way to
change the center of the zoom.

Changes:
Adding support to change the center of zooming just like map rotation by using
other part's center.

@feature

Reviewers: cedric, zmike

Reviewed By: zmike

Subscribers: zmike, cedric, #reviewers, #committers

Tags: #efl

Differential Revision: https://phab.enlightenment.org/D9115
2019-07-12 12:04:06 -04:00
Mike Blumenkrantz 66213df2f5 edje: fix reapplying markup text on file/group change
Summary:
this was being stored as regular text when it was actually markup

@fix

Depends on D9208

Reviewers: cedric

Reviewed By: cedric

Subscribers: #reviewers, #committers

Tags: #efl

Differential Revision: https://phab.enlightenment.org/D9209
2019-07-10 14:40:42 -04:00
Mike Blumenkrantz aa921c553b edje: change 'user_defined' member of Edje struct to be a hash
Summary:
this is where all user-added data (e.g., swallowed objects, table/box packs,
text strings) are stored. with this patch, it is now a hash by part name,
storing a list of user-defined data for that part

this simplifies a bit of code by deconstructing some list walks, and
should end up being slightly faster for large edje objects with lots of
user-defined data

ideally no functional changes

Depends on D9206

Reviewers: cedric

Reviewed By: cedric

Subscribers: #reviewers, #committers

Tags: #efl

Differential Revision: https://phab.enlightenment.org/D9208
2019-07-10 14:40:42 -04:00
Mike Blumenkrantz d82a14c3b0 edje: remove _edje_user_definition_fetch()
Summary: this is an internal function which is never used

Reviewers: cedric

Reviewed By: cedric

Subscribers: #reviewers, #committers

Tags: #efl

Differential Revision: https://phab.enlightenment.org/D9205
2019-07-10 14:40:42 -04:00
Carsten Haitzler 613e1715be edje messages - avoid nasty On2 walk of message lists with skipping
so to process a single obj we added a lot of mesgs to the message
queueue only then to wak most and SKIP most msgs again and again -
when this adds up to 1000's of messages and 10k+ then literally moving
a window in e hangs for multiple seconds and we walk such lists in On2
like complexity. this gets it down to O(1) along with some other minor
optimizations of not adding to tmp list only then to add them to the
nex queue/list.

there is more i can optimize here as well now we track messages for an
edje in th edje. that's next.
2019-06-15 08:43:44 +01:00
Carsten Haitzler bda708d38f edje messages - track all messages for an edge obj in the edje
this is the basis for some future speedups to avoid full message queue
walks - get this right first.
2019-06-15 08:43:33 +01:00
Carsten Haitzler e667dd8b2c edje messages - make it use inlist to fragment ram less
using regular lists means we double our indirect ptr jumps and
fragment ram more - this is step one in improving performance of
message handling in some nasty corner cases i have found. first this
so it can be identified as an issue on its own if it is one. i've
tested it and it seems ok. so this si stage 1.
2019-06-15 08:43:18 +01:00
Vincent Torri a5267d3d9c remove Evil.h when not necessary, include evil_private.h when necessary
Test Plan: compilation

Reviewers: zmike, raster, cedric

Reviewed By: zmike

Subscribers: #reviewers, #committers

Tags: #efl

Differential Revision: https://phab.enlightenment.org/D8925
2019-05-20 09:10:00 -04:00
Shinwoo Kim e9b2e3c6c3 Revert "edje_calc: make INTP use TO_INT_ROUND"
Summary:
This reverts commit be00af9bc3 which has
incorrect calculation. For more information please refer to:

https://phab.enlightenment.org/D8665

Reviewers: Hermet

Subscribers: cedric, #reviewers, #committers

Tags: #efl

Differential Revision: https://phab.enlightenment.org/D8666
2019-04-19 17:25:13 +09:00
Shinwoo Kim be00af9bc3 edje_calc: make INTP use TO_INT_ROUND
Summary:
The edje_part_recalc calculates next postion(p3).
Please refer to following line.

   p3->final.y = INTP(p1->final.y, p2->final.y, pos);

If the condition is as blow, then p3->final.y becomes -50 only if pos is 1.0.
Because INP uses TO_INT not TO_INT_ROUND.

   p1->final.y == -32
   p2->final.y == -50

So we had nonsmooth ending of transition.

Test Plan:
Sample application to check this issue. Please look carefully when the rect moves from bottom to top.

{F3627740}

{F3627739}

Reviewers: cedric, Hermet, jypark

Reviewed By: Hermet

Subscribers: zmike, akanad, #reviewers, #committers

Tags: #efl

Differential Revision: https://phab.enlightenment.org/D7842
2019-03-08 13:28:22 +09:00
Mike Blumenkrantz 6326e18b3f efl.file: improve api a bit
Summary:
the previous implementation/api had a number of issues:
* "file" property contained both "file" and "key" values
  - also performed file loading operation
* "load_error" property which was specific to image objects
* no methods for controlling file loading/unloading

this patch attempts the following changes:
* split "file" property into "file" and "key" properties
  - also remove "key" from existing "mmap" property
* remove "load_error"
* directly return error codes from operations
* add "load" and "unload" methods for directly controlling load state
* add implicit file loading if file/mmap is set during construction
* rewrite all efl.file implementations to move file loading into load() method
* rewrite all usage of efl.file api based on these changes
* add C extension functions to mimic previous behavior

ref T7577

Reviewers: segfaultxavi, bu5hm4n, cedric

Reviewed By: segfaultxavi

Subscribers: vitor.sousa, #reviewers, #committers

Tags: #efl_api

Maniphest Tasks: T7577

Differential Revision: https://phab.enlightenment.org/D8018
2019-02-27 13:17:10 -05:00
Xavi Artigas 6b7346b7b2 Remove individual class BETA guards
Summary:
Eolian adds a per-class BETA guard (like EFL_UI_WIN_BETA) to any method tagged
as @beta. This means that any app (and the EFL code) wanting to use BETA features
has to enable them class by class, which is cumbersome.
This commit replaces the individual guards with the global EFL_BETA_API_SUPPORT
guard, so apps only need to define one symbol to access BETA features.

Any usage of the per-class guards has been removed from the EFL code and examples.
When building EFL the global guard is defined by configure, so all EFL methods
already have access to BETA API.
Efl_Core.h and Efl_Ui.h no longer define EFL_BETA_API_SUPPORT. Apps wanting to
use BETA API have to define this symbol before including any EFL header
(It has been added to the examples requiring it).

Test Plan:
make && make check && make examples still work, but there's a lot less #defines
in the code

Reviewers: zmike, bu5hm4n, q66

Reviewed By: q66

Subscribers: cedric, #reviewers, #committers

Tags: #efl

Maniphest Tasks: T6788

Differential Revision: https://phab.enlightenment.org/D7924
2019-02-13 18:09:17 +01:00
Mike Blumenkrantz 56dbd2bf86 edje: apply maps to textblock cursors and backgrounds
when a map is applied to an edje part, it is expected that all components of
the part respect the map attributes. this requires that, in the case of
textblock parts, all the sub-parts which are internal to the textblock
(entry) object also go through the map populate and apply codepaths

fix T4977
@fix

Reviewed-by: Cedric BAIL <cedric.bail@free.fr>
Differential Revision: https://phab.enlightenment.org/D7648
2019-02-11 15:10:45 -08:00
Mike Blumenkrantz 1b568327c4 efl_gfx_color_class: make this a mixin and move color_class_code here
Summary:
color_class_code seems to only have been added to efl_gfx_color in order to
share the hex conversion code, but this is trivial to do when it's in another
class and makes the api more sensible

ref T7559

Reviewers: segfaultxavi, bu5hm4n, cedric

Reviewed By: segfaultxavi

Subscribers: #reviewers, #committers

Tags: #efl_api

Maniphest Tasks: T7559

Differential Revision: https://phab.enlightenment.org/D7898
2019-02-11 12:34:12 +01:00
Cedric BAIL f484ca0951 edje: migrate Eo API to use Eo callback instead of opaque type.
Summary: Depends on D7869

Reviewers: zmike, q66, segfaultxavi, bu5hm4n

Reviewed By: zmike

Subscribers: #reviewers, #committers

Tags: #efl

Maniphest Tasks: T7671

Differential Revision: https://phab.enlightenment.org/D7870
2019-02-06 13:48:43 -05:00
Cedric BAIL 917e0aa0fe edje: make legacy edje call rely directly on edje internal.
Reviewers: zmike, q66, segfaultxavi, bu5hm4n

Reviewed By: zmike

Subscribers: #reviewers, #committers

Tags: #efl

Maniphest Tasks: T7671

Differential Revision: https://phab.enlightenment.org/D7869
2019-02-06 13:08:19 -05:00
Derek Foreman a9d9ccefe4 edje: convert var timer list to inlist
Since these are only ever on one list, inlist is better.

Signed-off-by: Derek Foreman <derek.foreman.samsung@gmail.com>
Reviewed-by: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Reviewed-by: Cedric BAIL <cedric.bail@free.fr>
Differential Revision: https://phab.enlightenment.org/D7697
2019-01-18 14:11:05 -06:00
Derek Foreman 1933580efb edje: Remove _edje_animators list
I guess this used to do something...

Now it's a list that we never add anything to but frequently try to remove
things from.

Signed-off-by: Derek Foreman <derek.foreman.samsung@gmail.com>
Reviewed-by: Cedric BAIL <cedric.bail@free.fr>
Reviewed-by: Chris Michael <cp.michael@samsung.com>
Differential Revision: https://phab.enlightenment.org/D7621
2019-01-15 13:47:20 -06:00
Daniel Hirt face90632e Canvas layout: support more Efl.Text.* with efl_part
This adds many Efl.Text.* that are useful for manipulating the
underlying TEXTBLOCK object's propeties using efl_part.

This has been implemented as part of the "user-defined" properties of
the layout part, so that the changes on the part persist across load of
different groups.

Note that text styles have precedence over the TEXTBLOCK (Canvas.Text)
object's properties. if an edc provides a style, the properties it
manipulates as part of the "base:" string would not be affected by this
API.

In general, this helps reducing the amount of styles for objects (or
modes of the same objects) that share the same setup, but are different
in some properties (e.g.  ellipsis, wrap etc).

@feature

Canvas layout: add text part "expand" property

This adds "expansion modes", which are essentially the same as min/max
hints in the edje part's 'description.text' fields.

The user can then customize his widget to different modes without being
forced to create a new edje group in the theme.

Note that there is an added check in case one of the min/max text flags
are provided from the theme. In such case, all flags from this new API
will be ignored.
This fortifies misuse where the flags are set both in theme and the API.

@feature
2018-11-06 18:33:56 +02:00
SubodhKumar f107ea2432 edje: Remove hack code
Summary:
special calculation for textblock is for fit calculation.
This is obvious from code that fit is being calculated
before text is actually been set to textblock.
I am not sure whether this is intentional or mistake
but it make sense to calculate fit after text is being
set so that formatted and native calculation can be proper.

@fix

Test Plan: NA

Reviewers: cedric, zmike, herdsman, devilhorns

Subscribers: stefan_schmidt, #reviewers, #committers, shilpasingh

Tags: #efl

Differential Revision: https://phab.enlightenment.org/D6045
2018-09-17 17:38:24 +03:00
Hermet Park 2663dceaf1 Revert "edje: code refactoring for readibility."
This reverts commit 7fb47fc064.

subsequential revert for previous one.

90a89d1ab2b5d23b29ad0f2680b77b5ba7f56b42.
2018-06-21 19:33:41 +09:00
Hermet Park 7fb47fc064 edje: code refactoring for readibility.
collection.part is too ambigious, since group has parts as well.
Normally we regard it as "name" (of group) instead of part.
2018-06-07 17:53:12 +09:00
Jihoon Kim 379ee0d0db elm_entry: add elm_entry_prediction_hint_hash_set/del API
elm_entry_prediction_hint_hash_set API sets the prediction hint data at the specified key, and
elm_entry_prediction_hint_hash_del API is for deleting the prediction hint data identified by a key.

@feature

Signed-off-by: Jihoon Kim <jihoon48.kim@samsung.com>
2018-05-23 11:27:34 +09:00
SubodhKumar b8c691ebd2 edje: Fix to support translation for textblock part
Summary:
Text translation in edc for textblock is missing.
Added to support it.

@fix

Reviewers: cedric, zmike

Reviewed By: cedric, zmike

Subscribers: shilpasingh, zmike

Tags: #efl

Differential Revision: https://phab.enlightenment.org/D6164
2018-05-15 12:44:29 -04:00
Derek Foreman 1982046315 edje: Pass extra signal data to program_run
Summary: Depends on D6114

Reviewers: zmike, cedric

Reviewed By: zmike

Tags: #efl

Differential Revision: https://phab.enlightenment.org/D6115
2018-05-08 12:26:13 -05:00
Derek Foreman 6d4f78d676 edje: Add edje_emit_full_data
Summary:
This is an even fuller emit_full, that takes a pre-made signal data
struct.  The original edje_emit_full is now implemented as a call to it.
Depends on D6113

Reviewers: zmike, cedric

Reviewed By: zmike

Tags: #efl

Differential Revision: https://phab.enlightenment.org/D6114
2018-05-08 12:26:08 -05:00
Derek Foreman e12498f4d4 edje: Add seat data to extra data struct
Summary:
Since the extra data struct is already nicely refcounted, it's easy to
add the seat data to it instead of making a new struct with almost
identical code.
Depends on D6112

Reviewers: zmike, cedric

Reviewed By: zmike

Tags: #efl

Differential Revision: https://phab.enlightenment.org/D6113
2018-05-08 12:26:02 -05:00
Derek Foreman d21ff733df edje: Factor out signal extra data setup code
Reviewers: zmike, cedric

Reviewed By: zmike

Tags: #efl

Differential Revision: https://phab.enlightenment.org/D6111
2018-05-08 12:25:51 -05:00
Xavi Artigas 6b5ac687c1 Efl.Text_* (from Efl.Text.*)
Including:
Efl.Text.Cursor_* (from Efl.Text.Cursor.Cursor_*)
Efl.Text.Font_* (from Efl.Text.Font.*)
Efl.Text.Format_* (from Efl.Text.Format.*)
Efl.Text.Style_* (from Efl.Text.Style.*)
Efl.Ui.Text_* (from Efl.Ui.Text.*)

Ref https://phab.enlightenment.org/T6847

Reviewed-by: Cedric Bail <cedric@osg.samsung.com>
2018-04-24 09:03:49 -07:00
Xavi Artigas 55bd097a3d Efl.Gfx.Entity (from Efl.Gfx)
Ref https://phab.enlightenment.org/T6847

Reviewed-by: Cedric Bail <cedric@osg.samsung.com>
2018-04-24 09:03:32 -07:00
Daniel Kolesa fcae7cab27 eolian gen: enable constness generation on property getter impls
This changes a lot of things all across the EFL. Previously,
methods tagged @const had both their external prototype and
internal impl generated with const on object, while property
getters only had const on the external API. This is now changed
and it all has const everywhere.

Ref T6859.
2018-04-17 20:31:55 +02:00
Cedric BAIL db92072338 edje: implement invalidate method and unset device callbacks here
prevent crashing in dangling callbacks

ref d26124a6d818f62d892e178d92098f5159a8c9e0

Signed-off-by: Mike Blumenkrantz <zmike@osg.samsung.com>
2018-03-20 17:20:57 -07:00
Carsten Haitzler 1c74aaa7e9 Revert "cxx: Fix manual code after efl_app change."
This reverts commit 135154303b.

Revert "efl: move signal events from efl.loop to efl.app"
This reverts commit 3dbca39f98.

Revert "efl: add test suite for efl_app"
This reverts commit 3e94be5d73.

Revert "efl: create Efl.App class, the parent of Efl.Loop"
This reverts commit 28fe00b94e.

Go back to before efl.app because I think this should be done with
superclassing here not a parent object. reasons?

1. multiple loops per single thread make no sense. so if multilpe loop
objects they wont be contained in a single app object and then deleted
like this.
2. the app object is not really sharable in this design so it cant be
accessed from other threads
3. it makes it harder to get the main loop or app object (well 2 func
calls one calling the other and more typing. it is longer to type and
more work where it is not necessary, and again it can't work from
other threads unless we go duplicating efl.app per thread and then
what is the point of splittyign out the signal events from efl.loop
then?)

etc.
2018-03-03 13:40:33 +09:00
Mike Blumenkrantz 3d9dcbd478 edje: add ability to reference images from other edje files
this uses the just-added "id" property to allow referencing images
by name from that theme. example:

=FILE1=
id: "myfile";
images.image: "someimage.png" COMP;

=FILE2=
requires: "myfile";
images.image: "someimage.png" EXTERNAL "myfile";

FILE2 will now load someimage.png from FILE1 at runtime if FILE1 is
currently opened in edje, and FILE1 will be kept open until FILE2 is
closed

@feature
2018-02-28 16:02:38 -05:00
Mike Blumenkrantz 3a86768f3b edje_cc: add "id" toplevel property
this can be used by edje files to identify themselves
2018-02-28 16:02:37 -05:00
Mike Blumenkrantz 645c573efb edje: EDJE_IMAGE_SOURCE_TYPE_EXTERNAL -> EDJE_IMAGE_SOURCE_TYPE_USER
no functional changes, just a confusing define rename
2018-02-28 16:02:37 -05:00