Commit Graph

165 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
Carsten Haitzler 80d317f20e evas - revert evas variation sequence support - out of bound accesses
This code is filled with out of bounds accesses now after the reverted
patch. All those base_char+1, itr+1 etc. in
evas_common_font_query_run_font_end_get() are accessing BEYOND
the end of the run. textgrid shows this instantly to fall over as it
uses single unicode codepoint chars with no nul terminator. As this
api takes an explicit run_len we should never access beyond the end of
the run_len.

Please revisit this code and keep in mind proper memory/bounds
accessing. If there was ano run_len and it assumed strings were
regular strings that had to be nul terminated... then it might be ok,
but not here.

of course if i put in guards for these +1's then it ends up in
infintie loops, so enough debugging and send it back for a rethink. :)

....

Revert "evas_object_textblock: add support for variation sequences"

This reverts commit 46f2d8acdc.
2019-10-31 12:31:52 +00:00
Ali Alzyod 46f2d8acdc evas_object_textblock: add support for variation sequences
Summary: update font processing to handle variation sequences unicodes to select proper glypg in respect to variation seqences

Test Plan:
```
#define EFL_EO_API_SUPPORT 1
#define EFL_BETA_API_SUPPORT 1
#include <Eina.h>
#include <Efl.h>
#include <Elementary.h>

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

   elm_policy_set(ELM_POLICY_QUIT, ELM_POLICY_QUIT_LAST_WINDOW_CLOSED);

   win = elm_win_util_standard_add("Main", "");
   elm_win_autodel_set(win, EINA_TRUE);
   textblock = evas_object_textblock_add(win);
   efl_canvas_text_style_set(textblock,NULL,"DEFAULT='font=DejaVuSans font_fallbacks=SamsungColorEmoji color=#000 font_size=20'");
   evas_object_textblock_text_markup_set(textblock, "8&#xfe0f;&#x20E3;&#x262a;&#xfe0f;AAA&#x262a;&#xfe0E;1234567&#xfe0f;&#x20E3;");

   evas_object_size_hint_weight_set(textblock, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
   evas_object_size_hint_align_set(textblock, EVAS_HINT_FILL, EVAS_HINT_FILL);
   evas_object_show(textblock);
   evas_object_move(textblock, 0, 0);
   evas_object_resize(textblock, 320, 320);
   evas_object_resize(win, 320, 320);
   evas_object_show(win);
   elm_run();
   return 0;

}

ELM_MAIN()

```

Reviewers: woohyun, bowonryu, segfaultxavi, cedric, bu5hm4n

Reviewed By: woohyun, cedric

Subscribers: bu5hm4n, subodh6129, herdsman, segfaultxavi, zmike, cedric, #committers, #reviewers

Tags: #efl

Differential Revision: https://phab.enlightenment.org/D9053
2019-10-19 14:01:36 +09:00
junsu choi 3f51e30976 elementary_test: Add the value provider test for animation_view
Summary:
Add an Value Provider item to test vector animation on elementary_test.
This test is to apply Efl.Gfx.Vg.Value_Provider to the loaded efl_ui_animation object.
If Evas Vg Json(Lottie) Loader is not supported,
use the vector class to output the svg file.

Depends on D9874
Depends on D9897

Test Plan: elementary_test -> Value Provider

Reviewers: Hermet, kimcinoo, smohanty

Reviewed By: Hermet

Subscribers: cedric, #committers, #reviewers

Tags: #efl

Differential Revision: https://phab.enlightenment.org/D10015
2019-10-02 14:38:45 +09:00
Cedric Bail d5a21c7998 elementary: add a basic test for MVVM infrastructure.
Differential Revision: https://phab.enlightenment.org/D10063
2019-09-24 11:12:46 -07:00
Mike Blumenkrantz 696627ffcd elm_test: mark image_zoomable test as non-legacy
Reviewers: segfaultxavi

Reviewed By: segfaultxavi

Subscribers: cedric, #reviewers, #committers

Tags: #efl

Differential Revision: https://phab.enlightenment.org/D10053
2019-09-23 12:57:22 +02:00
junsu choi 7a7d6a858d elementary_test: Add the animation view test
Summary:
Add an animation view item to test vector animation on elementary_test.
If Evas Vg Json(Lottie) Loader is not supported,
use the vector class to output the svg file.

Depends {D9451}

Test Plan:
elementart_test
Animation View

Reviewers: Hermet, smohanty, kimcinoo, zmike

Subscribers: zmike, cedric, #reviewers, #committers

Tags: #efl

Differential Revision: https://phab.enlightenment.org/D9472
2019-08-21 18:03:00 +09:00
Marcel Hollerbach 7610920ed0 elementary_test: add a test to show our frame widget
it does not work yet, but we at least have the chance of seeing it.

Reviewed-by: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Differential Revision: https://phab.enlightenment.org/D9194
2019-08-01 11:41:30 +02:00
Marcel Hollerbach 6883087ac7 Revert "evas_object_textblock: add support for variation sequences"
This reverts commit f7ce771e32.
2019-07-30 19:09:12 +02:00
Marcel Hollerbach 764f35b7a3 elm_test: add a example that shows efl_ui_item instances
this is just a little showcase to show the possible items

Reviewed-by: Cedric BAIL <cedric.bail@free.fr>
Differential Revision: https://phab.enlightenment.org/D9430
2019-07-29 11:17:42 -07:00
Mike Blumenkrantz 7f2ce2f99a elm_test: add option for running all tests on startup
this is useful for doing quick testing when making invasive changes that
affect a large number of widgets, such as rewriting all sizing calc code

Reviewed-by: Cedric BAIL <cedric.bail@free.fr>
Differential Revision: https://phab.enlightenment.org/D9407
2019-07-29 11:17:40 -07:00
Ali Alzyod f7ce771e32 evas_object_textblock: add support for variation sequences
update font processing to handle variation sequences unicodes to select proper glypg in respect to variation seqences

Reviewed-by: Cedric BAIL <cedric.bail@free.fr>
Differential Revision: https://phab.enlightenment.org/D9053
2019-07-29 11:17:35 -07:00
Mike Blumenkrantz d01885ec8b elm_test: add keybinds to rapidly flip between tests
when not using --test-win-only, allow opening new tests forward and
backward with alt+. and alt+,

Reviewed-by: Marcel Hollerbach <mail@marcel-hollerbach.de>
Differential Revision: https://phab.enlightenment.org/D9406
2019-07-29 16:06:22 +02:00
Mike Blumenkrantz e1f2b9d235 elm_test: replace bespoke arg handling with a for loop
this fixes handling of --help regardless of its position in the arg array

Reviewed-by: Marcel Hollerbach <mail@marcel-hollerbach.de>
Differential Revision: https://phab.enlightenment.org/D9405
2019-07-29 16:06:21 +02:00
Vincent Torri a6ade14c5e Evil: remove pwd code in Evil and fix compilation failures after the removal
Summary: remove pwd code in Evil

Test Plan: compilation

Reviewers: zmike, cedric, raster

Subscribers: #reviewers, #committers

Tags: #efl

Differential Revision: https://phab.enlightenment.org/D9420
2019-07-28 09:27:27 +01:00
Marcel Hollerbach a4f7baa911 rename efl_ui_item_container -> efl_ui_collection
this is the first rename of the main widget, the renames of the test
suites will follow

Reviewed-by: Cedric BAIL <cedric.bail@free.fr>
Differential Revision: https://phab.enlightenment.org/D9408
2019-07-25 20:27:39 +02:00
Marcel Hollerbach 577b82dad6 Introduce Efl.Ui.Item_Container
this is a new widget which aims to replace Efl.Ui.Grid / Efl.Ui.List.
The widget is split up in a widget and a interface for item placement.

Efl_Ui_Item_Position_Manager: The interface contains API which is used
by the Item_Container to place the items, there is also a set of common
tests which tests for the casual tripping wires, and ensures that the
events are emitted in the correct moments (the later part still can be
improved)

Efl_Ui_Item_Container: The widget itself, it contains the API for the
enduser to add Items to the widget, it handles the different modes for
selection type and emits the events for selection changes. The pack API
is conform with the spec unit test. An additional set of tests is
defined which should be able to be run on every widget with a specific
position_manager beeing set.

Reviewed-by: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Reviewed-by: Cedric BAIL <cedric.bail@free.fr>
Differential Revision: https://phab.enlightenment.org/D9285
2019-07-24 10:38:22 -07:00
Mike Blumenkrantz 8399f2698b elm_test: add efl.ui.scroller test with big table
same as the simple efl.ui.scroller test but with a 2 column table

Reviewed-by: Cedric BAIL <cedric.bail@free.fr>
Differential Revision: https://phab.enlightenment.org/D9347
2019-07-19 10:55:05 -07:00
Mike Blumenkrantz 1dd5feb22f elm_test: rename efl.ui.scroller simple test function name
Reviewed-by: Marcel Hollerbach <mail@marcel-hollerbach.de>
Differential Revision: https://phab.enlightenment.org/D9345
2019-07-19 10:55:01 -07:00
Mike Blumenkrantz 4016de252c elm_test: add comparable "simple" scroller tests
this should be roughly identical and can be more directly compared in
terms of performance (which is not good in either case)

Reviewed-by: Cedric BAIL <cedric.bail@free.fr>
Differential Revision: https://phab.enlightenment.org/D9334
2019-07-17 10:17:50 -07:00
Cedric BAIL 47c5736ef9 elementary: rename Activew_View to Spotlight.
View is something that is expected in the context of MVVM, so using it somewhere else is
going to lead to some confusion. Spotlight does descrive the objective of all of this
widget in actually a more explicit way as they all give the spotlight to one sub widget
at a time.

I have also renamed the View_Manager to be just Manager as the View there wasn't useful.
2019-07-05 19:18:22 +02:00
Mike Blumenkrantz 0e65d0c651 efl_ui: remove nstate widget
Summary:
this doesn't seem to serve a purpose anymore and there's no point in
keeping it in tree

fix T7866

Reviewers: woohyun, Jaehyun_Cho

Reviewed By: Jaehyun_Cho

Subscribers: cedric, #reviewers, #committers

Tags: #efl_widgets

Maniphest Tasks: T7866

Differential Revision: https://phab.enlightenment.org/D9176
2019-06-26 10:25:14 -04:00
Ali Alzyod 673bce2b91 evas_common_format_color_parse: support color names
Summary:
efl user can now specify colors by there names ( not only Hex RGB/RGBA values), which is very convenient specially for first time users (where user may think it is supported by default)

<color=#FF0000> == <color=red> == <color==RED>

there are two main types of color names and values ( X11, web colors), here we are using X11 color.

============
Update for documentation pages should be added like:
https://www.enlightenment.org/_legacy_embed/evas_textblock_style_page.html#evas_textblock_style_color

I do not know how to update it :(

Test Plan:
```
#define EFL_EO_API_SUPPORT 1
#define EFL_BETA_API_SUPPORT 1

#include <Eina.h>
#include <Elementary.h>
#include <Efl_Ui.h>

static void
_gui_quit_cb(void *data EINA_UNUSED, const Efl_Event *event EINA_UNUSED)
{
   efl_exit(0);
}

static void
_gui_setup()
{
   Eo *win, *box;

   win = efl_add(EFL_UI_WIN_CLASS, efl_main_loop_get(),
                 efl_ui_win_type_set(efl_added, EFL_UI_WIN_TYPE_BASIC),
                 efl_text_set(efl_added, "Hello World"),
                 efl_ui_win_autodel_set(efl_added, EINA_TRUE));

   // when the user clicks "close" on a window there is a request to delete
   efl_event_callback_add(win, EFL_UI_WIN_EVENT_DELETE_REQUEST, _gui_quit_cb, NULL);

   box = efl_add(EFL_UI_BOX_CLASS, win,
                efl_content_set(win, efl_added),
                efl_gfx_hint_size_min_set(efl_added, EINA_SIZE2D(360, 240)));

   efl_add(EFL_UI_TEXT_CLASS, box,
           efl_text_markup_set(efl_added,
           "<color=red>this is red color line(color = red)<color><br>"
           "<color=#0000FF>this is blue color line (color = #0000FF)<color><br>"
           "<color=gray>this is gray color line (color = gray)<color><br>"),
           efl_gfx_hint_weight_set(efl_added, 1.0, 0.9),
           efl_gfx_hint_align_set(efl_added, 0.5, 0.5),
           efl_text_multiline_set(efl_added,EINA_TRUE),
           efl_pack(box, efl_added));

   efl_add(EFL_UI_BUTTON_CLASS, box,
           efl_text_set(efl_added, "Quit"),
           efl_gfx_hint_weight_set(efl_added, 1.0, 0.1),
           efl_pack(box, efl_added),
           efl_event_callback_add(efl_added, EFL_UI_EVENT_CLICKED,
                                  _gui_quit_cb, efl_added));
}

EAPI_MAIN void
efl_main(void *data EINA_UNUSED, const Efl_Event *ev EINA_UNUSED)
{
   _gui_setup();
}
EFL_MAIN()

```

Reviewers: woohyun, bowonryu, segfaultxavi, vtorri

Reviewed By: segfaultxavi, vtorri

Subscribers: vtorri, cedric, #reviewers, #committers

Tags: #efl

Differential Revision: https://phab.enlightenment.org/D9153
2019-06-25 19:28:12 +02:00
Marcel Hollerbach c9177a9f8d Introduce Efl.Ui.Radio_Group & Efl.Ui.Radio_Box
Radio_Group is a interface that manages that radio groups can be grouped inside a
external object, the current API of radio was considered confusing in
that regard. It is implemented in the Radio_Group_Internal class which
is private to EFL, a instance of it can be found with get due to the
class function in efl_ui_radio.eo. This architecture was taken like
this, in order to have implementation and interface seperated. With
those two seperated we can inherit from regular widgets, implement the
interface, and composite attach the internal object to the regular
widget. This makes a lot of things easier.

Radio_Box is a class which is extending Efl.Ui.Box, which has an
internal Radio_Group. This is extremly usefull for cases where you just
want to have a list of radio buttons in your UI. The radio group is also
exposed using composition to the internal object. Simular things can be
done for the table.

For now i did not add API to find the group of a radio button. However,
this can be quickly added if requested.

ref T7867

Reviewed-by: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Reviewed-by: Xavi Artigas <xavierartigas@yahoo.es>
Differential Revision: https://phab.enlightenment.org/D9058
2019-06-20 16:02:00 +02:00
Marcel Hollerbach 0a4beb291d efl_ui_stack: remove!
this can now be done with active_view. This is done in order to reduce
the LOC in elementary that basically do the same.

Differential Revision: https://phab.enlightenment.org/D8920
2019-06-19 07:38:08 +02:00
Marcel Hollerbach 37266b93a5 efl.ui.pager: remove!
This can be done with Efl.Ui.Active_View

Reviewed-by: Jaehyun Cho <jae_hyun.cho@samsung.com>
Differential Revision: https://phab.enlightenment.org/D8907
2019-05-30 11:48:18 +02:00
Marcel Hollerbach 79fe0121ee efl_ui_active_view: introduce a experimental new widget
this widget tries to replace efl.ui.stack efl.ui.flip & efl.ui.pager
In general those widgets do the same thing, they get content. And
display them with some sort of animations. The new idea here is, that
the basic widget active_view only handles the ownership etc. of the
content that gets added to this. Then there is a view_manager object. The
view_manager object gets notified over the new contents, and requests for
displaying particular contents. The transition then handles those
things.

The version here is feature complete with Efl.Ui.Stack and Efl.Ui.Pager.
Additional features can be implemented in the corresponsing transition
classes. Examples and tests will follow

Reviewed-by: Jaehyun Cho <jae_hyun.cho@samsung.com>
Reviewed-by: Cedric BAIL <cedric.bail@free.fr>
Differential Revision: https://phab.enlightenment.org/D8784
2019-05-30 11:48:16 +02:00
Mike Blumenkrantz 748b762697 elm_test: add efl.ui.image tests which mimic elm_image tests
Summary:
these should look and feel the same as the original tests.

should.
Depends on D8914

Reviewers: segfaultxavi

Reviewed By: segfaultxavi

Subscribers: segfaultxavi, cedric, #reviewers, #committers

Tags: #efl

Differential Revision: https://phab.enlightenment.org/D8915
2019-05-20 18:23:55 +02:00
Carsten Haitzler 01f634b7db elm test - add tests ofr other styles for panes provided by default 2019-04-15 13:34:20 +01:00
Yeongjong Lee 77f2782d29 ui.box_stack: refactor layout_update
Summary:
This patch remove evas_box function from Efl.Ui.Box_Stack and add unit test.

Depends on D8214

Test Plan:
1. make check
2. elementary_test -to 'efl.ui.box_stack'

Reviewers: zmike, Jaehyun_Cho, cedric

Reviewed By: zmike, Jaehyun_Cho, cedric

Subscribers: cedric, #reviewers, #committers

Tags: #efl

Differential Revision: https://phab.enlightenment.org/D8094
2019-03-20 10:37:42 -04:00
Mike Blumenkrantz 14df465ce3 elm: explicitly include Efl_Ui.h in binaries
it looks like people have been relying on Elementary.h to include
eo apis even though this obviously makes no sense

Reviewed-by: Cedric BAIL <cedric.bail@free.fr>
Differential Revision: https://phab.enlightenment.org/D8223
2019-03-07 14:16:57 -08:00
Marcel Hollerbach 422ee8d323 efl_canvas_object: get rid of event_animation set/get
the API is a little bit problematic. The API takes events as an
parameter. However, only the hide and show events can be used, because
move for example is not intercepted, which leads to a situation that you
cannot attach a translation animation to the event. Further more,
handling the animations directory instead of pipeing them through events
seems to be a little bit easier as the case study of the previous events
have shown. Further more, we should never ever overwrite the
callback_call function of a eo base object, those methods are an
incredible hotpath, by the time we would have 1-2 animations on a
object, the event submission would be significetly slowned down.

ref T7555

Reviewed-by: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Differential Revision: https://phab.enlightenment.org/D8009
2019-02-25 10:37:40 +01:00
Yeongjong Lee 3118bfc34b efl_ui_relative_layout: introduce new relative container
Summary:
Efl.Ui.Relative_Layout is a container which allows you to position and size with
relation to each other.
it is possible to position and size using relation like edje even though
you don't know a edc script.
Position and size can be changed dynamically using widget APIs.

@feature

ref T5487

Test Plan:
make check
examples
elementary_test -to 'efl.ui.relative_layout'

Reviewers: cedric, Hermet, Jaehyun_Cho, zmike, bu5hm4n, jpeg, segfaultxavi

Reviewed By: Jaehyun_Cho, segfaultxavi

Subscribers: segfaultxavi, kimcinoo

Tags: #efl

Maniphest Tasks: T5487

Differential Revision: https://phab.enlightenment.org/D7524
2019-02-22 19:47:47 +09:00
Xavi Artigas 220f17ee8d Rename Efl.Gfx.Map -> Efl.Gfx.Mapping
Summary:
For clarity, since there are all kinds of maps, including a navigation map
widget.
Also, corrected some misspellings.

Test Plan: make && make check && make examples all work

Reviewers: cedric, zmike, bu5hm4n

Reviewed By: cedric

Subscribers: Jaehyun_Cho, #reviewers, #committers

Tags: #efl

Maniphest Tasks: T7564

Differential Revision: https://phab.enlightenment.org/D7974
2019-02-21 19:20:09 +01:00
Stefan Schmidt 41977fd19e Revert "Revert "efl_ui_pager: add tests for efl_ui_pager""
This reverts commit a686b7d9fe.

Turns out in my eagerness to un-break the build I did not check the
patch queue before reverting. If I would have done this I would have
seen the fix for the break alreay being submitted by Junsu Choi.

This is my bad, the two reverts could have been avoid. Sorry.
Note to self: give yourself a moment, and check the patch queue, before
rushing out a revert. :/
2019-01-25 09:49:49 +01:00
Stefan Schmidt a686b7d9fe Revert "efl_ui_pager: add tests for efl_ui_pager"
This reverts commit 0b79064f4c.

Appreciating the new tests but they are breaking the meson build.

/usr/bin/ld: src/bin/elementary/aea5856@@elementary_test@exe/test.c.o: in function `my_win_main':
test.c:(.text+0x501e): undefined reference to `test_ui_pager'
/usr/bin/ld: test.c:(.text+0x504d): undefined reference to `test_ui_pager_scroll'
collect2: error: ld returned 1 exit status

Once the meson build break is fixed this could go in again.
2019-01-25 09:32:46 +01:00
Jaeun Choi 0b79064f4c efl_ui_pager: add tests for efl_ui_pager 2019-01-25 14:32:26 +09:00
Woochanlee d9a222ecf5 Intruduce Efl.Ui.Panel (Create Efl Ui Widget from elm widget(elm_panel))
Summary: Create Efl Ui Widget from elm widget(elm_panel)

Test Plan: elementary_test -> efl_ui_panel

Reviewers: woohyun, Jaehyun_Cho, segfaultxavi

Reviewed By: Jaehyun_Cho, segfaultxavi

Subscribers: segfaultxavi, cedric, #reviewers, #committers

Tags: #efl

Differential Revision: https://phab.enlightenment.org/D7238
2018-12-20 11:32:28 +09:00
Marcel Hollerbach dfc9cd8a67 elm_focus: implement elm_object_focus_next_item_set / get
you can use this now to let the focus move to the widget container of
the passed item.

I know this patch contains a whitespace change, but i have to get out
this whitespace each & every time i am editing the file - which is
annoying. So remove it once, which makes further work easier.

fixes T6183.

Reviewed-by: YeongJong Lee <yj34.lee@samsung.com>
Differential Revision: https://phab.enlightenment.org/D7408
2018-12-17 09:12:22 +01:00
Marcel Hollerbach 80bdbc8b54 elm_scroller: update behaviour to match legacy behaviour more closely
This implements scrolling the scroller when the scroller is not in the
maximum position of the requested relation, but there is no more focus
object in that relation.

Summing up, the scroller is scrolled manually, when the focus object is
not fitting in the viewport, and the object is beeing out of the
viewport in the requested direction. Or the scroller is not at its max
position in the requested direction, and there is no more focusable
object in this requested direction.

ref T6804

Differential Revision: https://phab.enlightenment.org/D7382
2018-12-04 08:45:49 +01:00
Marcel Hollerbach 1ede2302d3 efl_ui_focus_manager_root_focus: ensure that adapter is part of viewport
This ensures that the adapter part is part of the viewport elements and
border elements. This is done in order to support cases where a
elm_scroller content is not focusable. Before the element was not
correctly in viewport, and so not correctly registered.

ref T6804

Differential Revision: https://phab.enlightenment.org/D7364
2018-12-04 08:45:49 +01:00
Jaehyun Cho d4526f44b8 elementary: rename Efl.Ui.Popup classes
Summary:
Efl.Ui.Popup classes are renamed intuitively from backward order to
forward order.

Efl.Ui.Popup_Alert        -> Efl.Ui.Alert_Popup
Efl.Ui.Popup_Alert_Scroll -> Efl.Ui.Scroll_Alert_Popup
Efl.Ui.Popup_Alert_Text   -> Efl.Ui.Text_Alert_Popup

Reviewers: segfaultxavi, bu5hm4n, cedric

Reviewed By: segfaultxavi

Subscribers: herb, SanghyeonLee, woohyun, cedric, #reviewers, #committers

Tags: #efl

Differential Revision: https://phab.enlightenment.org/D7292
2018-11-16 11:26:57 +01:00
Daniel Hirt 26c1f2477c Ui text: port widget to new interfaces
This is a big rewrite. In addition to implementing functionality with
the new Efl interfaces, a lot of legacy (Elm) code was removed.

A lot of work is squashed in this patch as the widget would've been
completely broken otherwise.

The major changes are:

Life-cycle:
  - Code was split to have 'finalize'
  - Item anchors (emoticons, images) were rewritten to have proper
  life-cycle

Scrolling logic:
  - Efl.Ui.Internal_Text_Scroller widget was added, and replaces the old
  Elm.Interface_Scrollable implementation. Singe-line and multi-line
  modes were fixed as well as sizing calculations. The object is now
  swallowed inside the Ui.Text widget.

Copy and paste:
  - Code was converted to Efl.Selection logic.

Modified tests:
    elementary_test -to "efl.ui.text"
    elementary_test -to "efl.ui.text label"

Added tests:
    elementary_test -to "efl.ui.text inputfield"

Removed test:
    elementary_test -to "efl.ui.text.async"
2018-11-05 18:17:42 +02:00
chris 02f6e58f3e Elementary test : add a checkbox to hide beta apis.
Reviewers: zmike

Subscribers: cedric, #reviewers, #committers, zmike

Tags: #efl

Differential Revision: https://phab.enlightenment.org/D6817
2018-08-13 10:55:53 -04:00
Carsten Haitzler 132ef5e224 elm test - expand --help to also do -h and -help 2018-07-24 13:21:02 +09:00
Carsten Haitzler 9f9cd4c200 elm test - unbreak elm test ...
7ebcb710d2 / D6668 breaks elm test. a
fix actually that breaks it even more. before only --help didn't
work... now -to/--test-win-only is broken which is the actually useful
option... :)
2018-07-24 13:18:35 +09:00
Mike Blumenkrantz 7ebcb710d2 elm_test: fix arg parsing
Summary:
recent changes to ecore changed arg numbering again and no callers
outside of test suites were updated

ref 9c8749b99a

Reviewers: devilhorns

Reviewed By: devilhorns

Subscribers: cedric, #committers

Tags: #efl_widgets

Differential Revision: https://phab.enlightenment.org/D6668
2018-07-23 13:34:48 -04:00
Andy Williams 1485cf9df5 elm_code: (cherry-pick) Support indentation styles that are purely tab based
read: Allow non-EFL style indentation.
This is off by default but is switched on if you turn 'tabs insert spaces' off
2018-07-22 17:02:23 +01:00
Hosang Kim 5db61e4d64 efl_ui_slider: refactor slider widget.
Test Plan: elementary_test -> Efl.Ui.Slider, Efl.Ui.Slider_Interval, slider

Reviewers: woohyun, cedric, Jaehyun_Cho

Reviewed By: Jaehyun_Cho

Subscribers: zmike, cedric

Tags: #efl

Differential Revision: https://phab.enlightenment.org/D5908
2018-05-15 14:16:00 +09:00