Commit Graph

13 Commits

Author SHA1 Message Date
Ali Alzyod 3cc8ea77fa efl_ui_text: scroller mode clean up
simplify code, and reduce calls:

It is only required to set scroll mode in two cases:
- When creating scroller
- When changing multiline property

Reviewed-by: Marcel Hollerbach <mail@marcel-hollerbach.de>
Differential Revision: https://phab.enlightenment.org/D10981
2020-01-02 12:41:13 +01: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
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
Mike Blumenkrantz 3638b632c8 efl_ui/text_scroller: fix null derefs
Summary: CIDs 1403890, 1396964, 1396945

Reviewers: cedric, vtorri

Reviewed By: cedric

Subscribers: vtorri, #reviewers, #committers

Tags: #efl

Differential Revision: https://phab.enlightenment.org/D10447
2019-10-25 09:54:19 -04:00
Mike Blumenkrantz 11d2202635 efl_ui/text_scroller: remove erroneous max size hint setting
this makes no sense

ref T8122

Reviewed-by: Cedric BAIL <cedric.bail@free.fr>
Differential Revision: https://phab.enlightenment.org/D9554
2019-08-14 12:08:15 -07:00
Mike Blumenkrantz d17ec12faf efl_ui: always set restricted_min size hints internally
Summary:
regular min size hint is for users, internal calcs should use restricted

@fix

Depends on D9441

Reviewers: bu5hm4n

Reviewed By: bu5hm4n

Subscribers: bu5hm4n, cedric, #reviewers, #committers

Tags: #efl_widgets

Maniphest Tasks: T8059

Differential Revision: https://phab.enlightenment.org/D9442
2019-07-30 13:12:52 -04:00
Mike Blumenkrantz 7e517e2a11 elm/efl_ui: remove elm_layout_sizing_eval implementations
Summary:
historically there have been two methods of calculating sizes in elm:
* elm_layout_sizing_eval
* evas_object_smart_calculate (now efl_canvas_group_calculate)

the former was used to set size hints on widgets, while the latter was
used to perform internal size calcs for the widget. for things to
work correctly, these functions had to be triggered in just the right
order at just the right time. many hard-to-fix bugs related to widget
sizing over the years have been the result of this split

this patch removes elm_layout_sizing_eval implementations so that all
widgets perform both internal size calcs and size hint setting all
in the same function, ensuring that these are always in sync

the result is that in the vast majority of cases, far fewer recalcs
happen for widgets, and they are quicker to achieve their final size

Depends on D9438

Reviewers: bu5hm4n

Reviewed By: bu5hm4n

Subscribers: bu5hm4n, cedric, #reviewers, #committers

Tags: #efl_widgets

Maniphest Tasks: T8059

Differential Revision: https://phab.enlightenment.org/D9439
2019-07-30 13:12:52 -04:00
Mike Blumenkrantz f886941b11 api: efl.gfx.size_hints -> efl.gfx.hints
Summary:
these hints are not strictly size-related, so renaming them is more consistent
with their actual function

ref T7563

Depends on D7968

Reviewers: segfaultxavi, cedric, bu5hm4n

Subscribers: segfaultxavi, cedric, #reviewers, #committers

Tags: #efl

Maniphest Tasks: T7563

Differential Revision: https://phab.enlightenment.org/D7977
2019-02-21 18:43:12 +01: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
Daniel Hirt c87d23f942 Ui text: remove unused code from internal scroller 2018-11-26 13:17:07 +02:00
Daniel Hirt 3e5616b346 Ui text scroller: add usage of a guide 2018-11-26 13:17:07 +02:00
Daniel Hirt 1f5c016900 Ui internal text scroller: move .eo.h to internal usage
This fixes the broken `Elementary.h` header.
2018-11-06 00:10:33 +02:00
Daniel Hirt 86a8f832ae Ui text scroller: add scroller for internal usage
This class inherits Efl.Ui.Scroller and has its own sizing_eval logic to
handle the text content sizing as needed.

It's kept internal as it only serves Efl.Ui.Text in a scrollable mode.
2018-11-05 17:31:06 +02:00