Commit Graph

68 Commits

Author SHA1 Message Date
Elyes HAOUAS 9170072d47 Fix typos - (Part #2)
Fix some typos

Reviewed-by: Stefan Schmidt <stefan@datenfreihafen.org>
Differential Revision: https://phab.enlightenment.org/D12016
2020-07-06 10:52:49 +02:00
Marcel Hollerbach 80bf4ace91 efl_input_text: rename namespace
Efl.Input_Text is a namespace which should not be a interface in the
same moment. So rename this to Efl.Input_Text.Entity

ref T8648

Reviewed-by: Xavi Artigas <xavierartigas@yahoo.es>
Differential Revision: https://phab.enlightenment.org/D11664
2020-04-14 12:25:58 +02:00
Xavi Artigas f526ad8c26 Fix namespace clashes for Efl.Text.Cursor
Three renames are applied here:
Efl.Text.Cursor -> Efl.Text_Cursor.Object (class)
Efl.Text.Cursor_Type -> Efl.Text_Cursor.Type (enum)
Efl.Text.Cursor_Move_Type -> Efl.Text_Cursor.Move_Type (enum)

Nothing changes for the enums on the C side. For the class... Well,
the method names are a bit more verbose now.

These renames are required to avoid clashing with the Efl.Text interface.
This did not cause trouble to C# because interfaces are prefixed with "I",
but it did cause trouble to Eolian when the EO files were installed and
somebody tried to use them.
Ref T8648

Differential Revision: https://phab.enlightenment.org/D11663
2020-04-14 12:25:55 +02:00
Hermet Park 680eb03276 ui text: code refactoring
replace unreacheable code with EINA_UNUSED properly
2020-02-13 18:53:33 +09:00
abdulleh Ghujeh 7c058d5e61 efl_text_change_info: change text change type property( bool -> enum)
changed the insertion property to be an enum instead of a boolean property.
this will be clearer for usage and provide the ability to add more types in the future.

Reviewed-by: Xavi Artigas <xavierartigas@yahoo.es>
Differential Revision: https://phab.enlightenment.org/D11272
2020-02-04 09:54:58 +01:00
Ali Alzyod fc0c60ca8c efll.ui.internal_text_interactive: remove useless condition
Summary: Remove useless condition and unreachable return value

Reviewers: woohyun, segfaultxavi, bu5hm4n

Reviewed By: segfaultxavi

Subscribers: cedric, #reviewers, #committers

Tags: #efl

Differential Revision: https://phab.enlightenment.org/D11231
2020-01-29 19:34:19 +01:00
Ali Alzyod 279f2eca06 efl.ui.textbox: move file implementation in to internal class
We want to keep implementation for file interface in a safe place and remove it from our side world (eo).

This is a simple copy-paste, from efl.ui.textbox into efl_ui_internal_text_interactive

Reviewed-by: Marcel Hollerbach <mail@marcel-hollerbach.de>
Differential Revision: https://phab.enlightenment.org/D11153
2020-01-23 10:04:08 +01:00
Ali Alzyod 4cdd5505e9 efl_text_interactive: selection enhancment
1- Implement setting selection range programmatically by modifying selection cursors from **efl_text_interactive_selection_cursors_get**
2- Add setter with **efl_text_interactive_selection_cursors_set** to set the range at once (modify start and end)

Reviewed-by: Marcel Hollerbach <mail@marcel-hollerbach.de>
Reviewed-by: WooHyun Jung <wh0705.jung@samsung.com>
Differential Revision: https://phab.enlightenment.org/D10968
2020-01-23 09:05:12 +01:00
Ali Alzyod 3d2f99af9e efl.text.interactive: use Eina_Int_Range for selection range event
Summary:
1- add new Eina type  (Eina_Int_Range). which represents int range (start, Len).
2- Use this type instead of  Efl.Text_Range  with selection events.

Reviewers: cedric, woohyun, bu5hm4n, segfaultxavi, zmike

Reviewed By: woohyun

Subscribers: cedric, #reviewers, #committers

Tags: #efl

Maniphest Tasks: T8570

Differential Revision: https://phab.enlightenment.org/D11128
2020-01-23 16:07:42 +09:00
Marcel Hollerbach 0049155c1a Revert "efl_text_interactive: selection enhancment"
This reverts commit 09f0d66d90.

This breaks CI, and tests do not pass anymore, hence no other revision
can be verified.

The revision is reopened. lets take a second look at this.
2020-01-21 17:15:11 +01:00
Ali Alzyod 09f0d66d90 efl_text_interactive: selection enhancment
Summary:
1- Implement setting selection range programmatically by modifying selection cursors from **efl_text_interactive_selection_cursors_get**
2- Add setter with **efl_text_interactive_selection_cursors_set** to set the range at once (modify start and end)

Reviewers: woohyun, segfaultxavi, zmike, bu5hm4n

Subscribers: cedric, #reviewers, #committers

Tags: #efl

Maniphest Tasks: T8521, T8522

Differential Revision: https://phab.enlightenment.org/D10968
2020-01-21 07:39:15 +09:00
Ali Alzyod 085bfb7eaf efl.input.text.hints_type: rename into content_type
Reviewers: woohyun, segfaultxavi

Reviewed By: woohyun, segfaultxavi

Subscribers: cedric, #reviewers, #committers

Tags: #efl

Maniphest Tasks: T8541

Differential Revision: https://phab.enlightenment.org/D11130
2020-01-20 21:25:43 +09:00
Ali Alzyod ad63375199 efl.text.cursor: movement types rename
Summary: replace prev with previous, replace char with character

Reviewers: woohyun, segfaultxavi

Reviewed By: segfaultxavi

Subscribers: cedric, #reviewers, #committers

Tags: #efl

Maniphest Tasks: T8567

Differential Revision: https://phab.enlightenment.org/D11095
2020-01-20 10:07:40 +09:00
a.srour 05bb02cbb0 Efl.Ui.Textbox: Fix Ctrl+Backspace & Ctrl+Delete keys
Summary:
This should fix the behaviour of Ctrl+Backspace & Ctrl+Delete key down on `Efl.Ui.Textbox`.
Also added two tests for it.

Reviewers: woohyun, ali.alzyod, cedric, bu5hm4n

Reviewed By: woohyun

Subscribers: ProhtMeyhet, stefan_schmidt, segfaultxavi, bu5hm4n, #committers, #reviewers

Tags: #efl

Differential Revision: https://phab.enlightenment.org/D11040
2020-01-16 17:53:36 +09:00
Ali Alzyod e894c9bff8 efl.input.text: add variation enums + remove @since word
Summary: efl.input.text: add variation enums + remove @since word

Reviewers: woohyun, segfaultxavi

Reviewed By: segfaultxavi

Subscribers: cedric, #reviewers, #committers

Tags: #efl

Maniphest Tasks: T8541

Differential Revision: https://phab.enlightenment.org/D11066
2020-01-14 10:42:06 +09:00
Ali Alzyod b2829634fc efl.ui.textbox: use efl_del with efl_duplicate
Reviewed-by: Marcel Hollerbach <mail@marcel-hollerbach.de>
Differential Revision: https://phab.enlightenment.org/D11069
2020-01-13 12:50:57 +01:00
Ali Alzyod 3249b53d1c efl.ui.textbox: Enter on keyboard will add \n instead of paragraph separator
Summary: Becuase multiline_set(false) does not work with paragraphs, if user insert text by keyboard with multible line, then set multiline into false, multilines will still shown to user.

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

static void
_multiline_click_callback(void *data, const Efl_Event *event EINA_UNUSED)
{
   Eo *tb = (Eo*) data;
   efl_text_multiline_set(tb, !efl_text_multiline_get(tb));
}

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

EAPI_MAIN void
efl_main(void *data EINA_UNUSED, const Efl_Event *ev EINA_UNUSED)
{
   Eo *win, *box;

   win = efl_add(EFL_UI_WIN_CLASS, efl_main_loop_get(),
                  efl_text_set(efl_added, "Hello world"),
                  efl_ui_win_autodel_set(efl_added, EINA_TRUE));
   efl_event_callback_add(win, EFL_UI_WIN_EVENT_DELETE_REQUEST, _quit_cb, NULL);
   efl_gfx_entity_size_set(win, EINA_SIZE2D(400, 240));

   box = efl_add(EFL_UI_BOX_CLASS, win,
                 efl_content_set(win, efl_added),
                 efl_ui_layout_orientation_set(efl_added, EFL_UI_LAYOUT_ORIENTATION_VERTICAL));

   Eo *tb = efl_add(EFL_UI_TEXTBOX_CLASS, box,
            efl_gfx_hint_weight_set(efl_added, EFL_GFX_HINT_EXPAND, 0.9),
            efl_pack(box, efl_added));

   Eo *btn = efl_add(EFL_UI_BUTTON_CLASS, box,
             efl_text_set(efl_added, "multiline switch"),
             efl_gfx_hint_weight_set(efl_added, EFL_GFX_HINT_EXPAND, 0.1),
             efl_event_callback_add(efl_added, EFL_INPUT_EVENT_CLICKED, _multiline_click_callback, tb),
             efl_pack(box, efl_added));
}
EFL_MAIN()
```

Reviewers: woohyun, segfaultxavi

Reviewed By: woohyun

Subscribers: cedric, #reviewers, #committers

Tags: #efl

Differential Revision: https://phab.enlightenment.org/D11070
2020-01-13 12:46:57 +09:00
Ali Alzyod 1a02745a88 efl.text.cursor: change to abstract class
Summary:
1- Change cursor to abstract class
2- Remove copy method from cursor
3- remove cursor_Add method from efl.canvas.textblock and efl.ui.textbox

Reviewers: woohyun, segfaultxavi, bu5hm4n

Reviewed By: bu5hm4n

Subscribers: lauromoura, YOhoho, cedric, #reviewers, #committers

Tags: #efl

Maniphest Tasks: T8299, T8454

Differential Revision: https://phab.enlightenment.org/D11034
2020-01-09 22:33:07 +09:00
WooHyun Jung 4b7e7b732d efl_text_change_info: rename some properties
insert -> insertion
merge -> mergeable

ref T7933

Reviewed-by: Marcel Hollerbach <mail@marcel-hollerbach.de>
Differential Revision: https://phab.enlightenment.org/D11016
2020-01-07 11:00:38 +01:00
Ali Alzyod a95a509cfd efl.text.interactive: remove event freeze when keyboard button is pressed
this event freeze will prevent submission of EFL_UI_TEXTBOX_EVENT_CHANGED on efl.ui.textbox object, when inserting text using the keyboard.

Reviewed-by: Marcel Hollerbach <mail@marcel-hollerbach.de>
Differential Revision: https://phab.enlightenment.org/D10979
2020-01-02 12:03:08 +01:00
Ali Alzyod 5154b5a8fc efl_ui_text: support focus navigation
With this commit you can move the focus from the textbox widget to the surrounding widgets, (as it is done in legacy).

ref T8538
ref T8522

Reviewed-by: Marcel Hollerbach <mail@marcel-hollerbach.de>
Differential Revision: https://phab.enlightenment.org/D10987
2019-12-31 11:56:59 +01:00
WooHyun Jung 4efaebfc70 efl_ui_internal_text_interactive: prevent from freed memory accessing
If node_format_remove_pair frees node, then next for loop can lead
invalid memory accessing. This patch prevents from that case by keeping
the next node before freeing.
2019-12-13 10:33:00 +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
Xavi Artigas 39758346ef Efl.Ui.Internal_Text_Interactive: missed renames from previous commit 2019-12-09 11:04:56 +01:00
Ali Alzyod 9c67a71e00 efl_text_cursor: rename enums
Summary:
rename two movement enums

**paragraph_first**: to just **first**  this will move the cursor to the beginning of the text

**paragraph_last**: to just **last**  this will move the cursor to the end of the text

These two are not directly related to paragraph the will move the cursor depending on the whole content

or maybe **start** and **end**  what do you think ?

Reviewers: woohyun, segfaultxavi

Reviewed By: segfaultxavi

Subscribers: cedric, #reviewers, #committers

Tags: #efl

Differential Revision: https://phab.enlightenment.org/D10810
2019-12-09 10:54:48 +01:00
Ali Alzyod c00db387c3 Efl.Ui.Text : all related interfaces
Summary:
Change summary:

Removed :
- efl_ui_text_selectable.eo and add it functionality into efl_text_interactive.eo
- efl_ui_text_editable.eo because it is same as efl_ui_text.eo (just set one property by default)

Modifications:
- Move all Text Input enums and functionality from efl_ui_text class into its own interface,  this interface will be implemented at efl_ui_internal_text_interactive class.

- Rename selection_allowed property to selectable (same as other "editable" property) in efl_text_interactive

- Add select_all function into efl_text_interactive interface

- Add have_selection property into efl_text_interactive interface

- Move user_change , selection_start/change/clear   and undo/redo events into efl_text_interactive interface.

- Move methods and events of copy/paste/cut into efl_ui_text

- Fix password-related functionality

- Remove context menu clear and add_item methods.  (these should be added later with better design)

- Remove Validation event from EFL_UI_TEXT.  (these should be added later with better design)

Reviewers: woohyun, tasn, segfaultxavi, zmike, bu5hm4n

Subscribers: stefan_schmidt, a.srour, q66, zmike, segfaultxavi, cedric

Tags: #efl

Differential Revision: https://phab.enlightenment.org/D10711
2019-12-09 10:58:39 +09:00
Ali Alzyod c7f37fe618 Efl.Text.Attribute_Factory
Summary:
Implementation of new Efl.Text.Attribute_Factory class which replace the annotation interface.

Currently, we have two public methods:

```
void efl_text_attribute_factory_attribute_insert(const Efl_Text_Cursor *start, const Efl_Text_Cursor *end, const char *format)
unsigned int efl_text_attribute_factory_attribute_clear(const Efl_Text_Cursor *start, const Efl_Text_Cursor *end);
```

Other methods will be internal methods, for the time being, we will redesign internal methods

Reviewers: woohyun, tasn, segfaultxavi, bu5hm4n, zmike

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

Tags: #efl

Differential Revision: https://phab.enlightenment.org/D10646
2019-11-27 13:04:32 +09:00
WooHyun Jung d2ed28bd8a efl_ui_internal_text_interactive: fix undefined symbol issue
Summary: This fixes an issue from d7352f4db4.

Reviewers: segfaultxavi, bu5hm4n

Reviewed By: segfaultxavi

Subscribers: cedric, #reviewers, #committers

Tags: #efl

Differential Revision: https://phab.enlightenment.org/D10725
2019-11-22 12:51:26 +01: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 ca86b98e40 build: fix elm header usage
.c files in src/lib/elementary should only include elm_priv.h to ensure
that all the include ordering is correct and that all necessary headers
are pulled in

.c files outside of src/lib/elementary should include either/both
Efl_Ui.h, Elementary.h as needed

Reviewed-by: Stefan Schmidt <stefan@datenfreihafen.org>
Differential Revision: https://phab.enlightenment.org/D9978
2019-09-18 18:04:55 +02:00
Mike Blumenkrantz 3eb121a769 efl.text.interactive: rename events to avoid conflicts
Reviewed-by: Cedric BAIL <cedric.bail@free.fr>
Differential Revision: https://phab.enlightenment.org/D8265
2019-03-08 12:18:04 -08:00
Mike Blumenkrantz ef5853b6d5 efl_text_cursor: remove all legacy usage from eo files
this takes the current generated output from eolian for legacy code in
evas and adds it to the tree, then removes legacy references from the
corresponding eo files. in the case where the entire eo file was for
a legacy object, that eo file has been removed from the tree

ref T7724

Reviewed-by: Cedric BAIL <cedric.bail@free.fr>
Differential Revision: https://phab.enlightenment.org/D8119
2019-03-06 13:02:36 -08:00
Mike Blumenkrantz 765fad936b efl_ui_text: emit EFL_UI_TEXT_EVENT_CHANGED events properly
Summary:
these should be emitted any time text is changed in the object

fix T7615, T7417, T6978, T6979
Depends on D7883

Reviewers: bu5hm4n, cedric, segfaultxavi

Reviewed By: segfaultxavi

Subscribers: #reviewers, #committers

Tags: #efl_widgets

Maniphest Tasks: T7615, T7417, T6979, T6978

Differential Revision: https://phab.enlightenment.org/D7884
2019-02-07 12:41:52 +01:00
Daniel Hirt b77fc4ed4f Ui text interactive: emit changed,user event correctly 2018-11-26 13:17:07 +02:00
Carsten Haitzler aaecb2579a efl ui text -0 fix warns on unused params/vars 2018-11-09 11:43:59 +00:00
Daniel Hirt b5c739acae Ui text interactive: swap cursors on cursors_get if needed 2018-11-05 17:31:06 +02:00
Daniel Hirt f172de86d6 Ui text interactive: don't use freeze when using legacy cursor_copy 2018-11-05 17:31:06 +02:00
Daniel Hirt 91a43cc723 Ui text interactive: emit selection,changed on selection changes, not cursor 2018-11-05 17:31:06 +02:00
Daniel Hirt 5b29de0388 Ui text interactive: add select_none
This is intended for Ui.Text to clear the selection on selection loss.
2018-11-05 17:31:06 +02: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
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
Jean-Philippe Andre 2bc583e3e7 text: Another event info fix
I shouldn't have pushed so fast! :)
2017-12-13 15:44:48 +09:00
Jean-Philippe Andre efe99b08ae text: Fix event info in one case
Dunno how to test... but this seems pretty obvious.
2017-12-13 15:41:23 +09:00
Jean-Philippe Andre e5d80f1ced text: Don't use legacy events
Efl.Ui.Text is an EO object, why use the legacy event API?
2017-12-13 15:36:10 +09:00
Jean-Philippe Andre 315c4f761e text: Merge changed,user events
Efl.Ui.Text and Efl.Ui.Text.Interactive were both defining it.
2017-12-13 15:36:10 +09:00
Jean-Philippe Andre 7155256422 text: Fix event propagation (changed,user) 2017-12-13 15:36:10 +09:00
Jean-Philippe Andre 6cea4993e0 elm: Don't do anything before construction
Obviously ui.win is still the ugly exception.
2017-11-07 14:43:22 +09:00
Daniel Hirt 4dc2001dac Ui text: reduce calls to update functions
Reduces calls to update functions when entering text.
Also, remaining calls to update the cursors were moved to the decoration
jobs.
2017-09-12 08:47:12 +03:00
Carsten Haitzler 7abf4715f2 efl ui text - remove useless else + free
string is null so no need to free. not a bug but cleaner and analysers
dont like it.

found by PVS studio
2017-07-29 11:11:21 +09:00
Daniel Hirt d5f781da2b Efl text: replace all usages of cursor handle to same type
Changes cursor handle name from 'Efl.Text.Cursor.Cursor_Data' to
'Efl.Text.Cursor.Cursor'.
Also, replace all usages of Efl_Canvas_Text_Cursor
with Efl_Text_Cursor_Cursor as the handle for the cursor.
2017-07-17 16:51:45 +03:00