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
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
the scrolbars have been displayed wrongly before. Reason for this is
that the theme displays the bars per default, the code however works
with hidden by default. This was worked arround before with the fact
that we are explicitly hiding the vbar/hbar before.
The reason this previous code was not working proberly is that entry
decided to retheme a object that was already set to the interface
scrollable object. Which means, it was not detected by the code. With
the newly introduced reset function you can tell the interface, that you
have changed the group, signals will be emitted accordingly.
Reviewed-by: Cedric BAIL <cedric.bail@free.fr>
Differential Revision: https://phab.enlightenment.org/D10622
in revision D9859 the scroll events have been renamed. However this also
renamed the legacy widgets, which also renamed the evas smart events,
which is a bug. With this commit we are back to plain old
evas_smart_callback_call calls, as these just take the string, and do
not need the bypassing through the eo events.
This fixes:
- elm_test gengrid,toolbar,panel (the events are now shown correctly
again)
- scrolling in elm_code_widget
- elm_map in a touchscreen
Reviewed-by: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Differential Revision: https://phab.enlightenment.org/D10240
these are internal apis for managing part aliasing on the C side,
but they apply to efl_ui_layout and not elm_layout
no functional changes
Reviewed-by: Xavi Artigas <xavierartigas@yahoo.es>
Differential Revision: https://phab.enlightenment.org/D10090
Summary:
Event name is applied in the past tense.
Meaning of 'stop' is 'stop it early', so I changed it to 'finish'
Test Plan: elementary_test -> efl.ui.scroller
Reviewers: segfaultxavi, woohyun
Reviewed By: segfaultxavi
Subscribers: zmike, cedric, #reviewers, #committers
Tags: #efl
Differential Revision: https://phab.enlightenment.org/D9859
this should be efl_canvas_group_group_calculate to match eolian function
naming
no functional changes
Reviewed-by: Marcel Hollerbach <mail@marcel-hollerbach.de>
Differential Revision: https://phab.enlightenment.org/D9685
hoversel doesn't implement group calc or do any sane type of sizing
so just manually call these on demand to ensure the correct size is used
fix T8127
Reviewed-by: Cedric BAIL <cedric.bail@free.fr>
Differential Revision: https://phab.enlightenment.org/D9632
the hoversel must be created before it can be shown, and its internal
hover object may be destroyed when it is hidden
@fix
Reviewed-by: Cedric BAIL <cedric.bail@free.fr>
Differential Revision: https://phab.enlightenment.org/D9631
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
Summary:
this eliminates a number of errors triggered when processing class hierarchy
to reach the desired subobject with these edje functions
@fix
Depends on D8958
Reviewers: bu5hm4n
Reviewed By: bu5hm4n
Subscribers: cedric, #reviewers, #committers
Tags: #efl
Differential Revision: https://phab.enlightenment.org/D8959
Summary:
sd->cursor_pos is updated in _entry_cursor_changed_signal_cb.
Generally, there is no problem.
But in some cases, before the _entry_cursor_changed_signal_cb is called
there is a situation in which cursor_pos is updated through _elm_entry_efl_ui_widget_theme_apply.
In this case,
before _entry_cursor_changed_signal_cb is called,
in _elm_entry_efl_ui_widget_theme_apply ()
cursor_pos = sd->cursor_pos; The wrong cursor_pos is set here.
Because it is the value before sd->cursor_pos is updated.
This causes an invalid cursor position when entering a key into the entry.
This patch prevents sd->cursor_pos from being updated with invalid values.
Reviewers: zmike, woohyun
Reviewed By: zmike
Subscribers: cedric, #reviewers, #committers
Tags: #efl
Differential Revision: https://phab.enlightenment.org/D8923
Summary:
This commits prepares the tree in order to mess with the events in the
Efl.Ui.Clickable event. Events which have been emitted in a none legacy
widget, are now emitted either with evas, when the widget is legacy due
to inheritance. Or via the normal event and normal event functions.
In case the widget is a legacy only widget (not used at all in the new
api), then the events are for now emitted with
evas_object_smart_callback_call.
Cases where event handlers have been added to legacy widgets, smart
events are now used, and not the eo one anymore.
ref T7844
Depends on D8813
Reviewers: cedric, zmike, segfaultxavi
Reviewed By: zmike
Subscribers: #reviewers, #committers
Tags: #efl
Maniphest Tasks: T7844
Differential Revision: https://phab.enlightenment.org/D8816
This patch deal with two cases:
1- Setting text in Entry (elm_entry_entry_set) , as the one get using (elm_entry_entry_get), caused the entry to become empty.
* becase entry string was free inside the elm_entry_entry_set function, without checking new passed string.
Now we check if same string was passed to the function, then nothing need to be changed.
```
// Old Behaviour : Entry will become empty
// New Behaviour : Entry will Skip setting same text
elm_entry_entry_set(app->entry, elm_entry_entry_get(app->entry));
```
2- Setting text in Entry (elm_entry_entry_set) , with same content string.
* internally entry will set empty string then set passed string, which will case recalculation and re-render the entry element.
Now we check if same string data that is passed to the function is the same of the entry content, then nothing need to be changed.
```
// This will be skiped internally since same text is set
elm_entry_entry_set(app->entry, "aaaaa");
elm_entry_entry_set(app->entry, "aaaaa"); //skipped
```
Reviewed-by: Marcel Hollerbach <mail@marcel-hollerbach.de>
Differential Revision: https://phab.enlightenment.org/D8572
since commit a1addad60e, To add myself as a sub object of parent object will be
done in Efl.Ui.Widget constructor.
Reviewed-by: Marcel Hollerbach <mail@marcel-hollerbach.de>
Differential Revision: https://phab.enlightenment.org/D8280
Summary:
1- Speed up detecting new lines.
```
if (!strncmp(text, "<br", 3) || !strncmp(text, "<ps", 3))
```
This will cause 6 comparisons (if one of conditions did not meet), or at least 3 comparisons.
this is changed to
```
if (!strncmp(text, "<", 1))
```
2- Speedup detecting lines
If this condition is true, we should increment the string for next iteration 3 times, not just one
```
if (!strncmp(text, "<br", 3) || !strncmp(text, "<ps", 3))
```
if '<' founded then 'pr' or 'br', we will skip 3 characters for next iteration.
```
if (!strncmp(text, "<", 1))
{
text++;
len--;
if (!strncmp(text, "br", 2) || !strncmp(text, "ps", 2))
{
text += 2;
len -= 2;
```
3- Prevent reading invalid memory out of the string
```
if (text[3] == '>' || ((text[3] == '/') && (text[4] == '>')))
```
string could reach last char in string (original string ends with "<br")
but now we will check if remaining string length allow comparison :
```
if (text[0] == '>' || (len > 1 && ((text[0] == '/') && (text[1] == '>'))))
```
Test Plan:
```
static int
oldFunc(const char *text)
{
if (!text)
return 0;
while (*text)
{
if (!strncmp(text, "<br", 3) || !strncmp(text, "<ps", 3))
{
if (text[3] == '>' || ((text[3] == '/') && (text[4] == '>')))
{
return 1;
}
}
text++;
}
return 0;
}
static int
newFunc(const char *text)
{
if (!text)
return 0;
char *pTemp = (char *)text;
while (pTemp = strchr(pTemp, '<'))
{
pTemp++;
if (!strncmp(pTemp, "br", 2) || !strncmp(pTemp, "ps", 2))
{
pTemp += 2;
if (pTemp[0] != '\0' && (pTemp[0] == '>' || (pTemp[0] == '/' && pTemp[1] == '>')))
{
return 1;
}
}
}
return 0;
}
int main()
{
int counter = 1000;
srand(time(NULL));
char pStr[50001] = {0};
char AllChars[] = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789<>";
int AllCharsLen = strlen(AllChars);
for (int i = 0; i < 50000; i++)
pStr[i] = AllChars[rand() % AllCharsLen];
clock_t start, end;
double total_Time1 = 0;
int i;
for (int j = 0; j < 3; j++)
{
if (j == 0)
{
printf("random String\n");
}
else if (j == 1)
{
printf("With Random <br/>\n");
int location = rand()%(5000 - 5);
pStr[location++] = '<';
pStr[location++] = 'b';
pStr[location++] = 'r';
pStr[location++] = '/';
pStr[location++] = '>';
}
else if (j == 2)
{
printf("With Random <ps>\n");
int location = rand()%(5000 - 4);
pStr[location++] = '<';
pStr[location++] = 'p';
pStr[location++] = 's';
pStr[location++] = '>';
}
start = clock();
for (i = 0; i < counter; i++)
oldFunc(pStr);
end = clock();
total_Time1 = ((double)(end - start)) / CLOCKS_PER_SEC;
printf("original = %f has new Line = %i\n", total_Time1, oldFunc(pStr));
start = clock();
for (i = 0; i < counter; i++)
newFunc(pStr);
end = clock();
total_Time1 = ((double)(end - start)) / CLOCKS_PER_SEC;
printf("modified = %f has new line = %i\n\n", total_Time1, newFunc(pStr));
}
}
```
output:
random String
original = 2.523000 has new Line = 0
modified = 0.090000 has new line = 0
With Random <br/>
original = 0.081000 has new Line = 1
modified = 0.003000 has new line = 1
With Random <ps>
original = 0.016000 has new Line = 1
modified = 0.001000 has new line = 1
Reviewers: zmike, woohyun, bowonryu
Reviewed By: zmike
Subscribers: bu5hm4n, segfaultxavi, zmike, cedric, #reviewers, #committers
Tags: #efl
Differential Revision: https://phab.enlightenment.org/D8497
eo methods should not be called on legacy objects
Reviewed-by: Marcel Hollerbach <mail@marcel-hollerbach.de>
Differential Revision: https://phab.enlightenment.org/D8487
Summary:
By reworking on efl_file, logic flow for entry has been changed.
and it causes autosave making a file that is passed to elm_entry_file_set empty.
Test Plan:
1. call elm_entry_file_set for a file.
2. check the file is not empty after calling the function.
Reviewers: zmike, bu5hm4n
Reviewed By: zmike
Subscribers: cedric, #reviewers, #committers
Tags: #efl
Differential Revision: https://phab.enlightenment.org/D8362
Summary:
When moving the magnifier in elm_entry, _magnifier_move
function occured infinite loop problem by calling
evas_object_move twice with different positions.
So, I changed it to call evas_object_move once.
ref T7202
Test Plan:
1. Set profile to "mobile"
2. elementary_test
3. entry
4. long press mouse button on elm_entry
5. when the magnifier is shown, try to move it
Reviewers: zmike, bu5hm4n, bowonryu, id213sin
Reviewed By: zmike
Subscribers: cedric, #reviewers, #committers
Tags: #efl
Maniphest Tasks: T7202
Differential Revision: https://phab.enlightenment.org/D8462
Summary:
This reverts commit f629f11bed.
This breaks legacy events. As the selected event is used in legacy
widgets. Also this commits mixed up two different concepts, selection in
a entry etc. and selection of a item.
Depends on D8411
Reviewers: zmike
Reviewed By: zmike
Subscribers: cedric, #reviewers, #committers
Tags: #efl
Differential Revision: https://phab.enlightenment.org/D8412
Summary:
Fix issue where **_entry_has_new_line** will not detect '<br>' or '<ps>' inside markup text as new lines indicators.
this functionlity effect following public function:
**elm_entry_single_line_set()**
Reviewers: woohyun, bowonryu, ManMower, cedric, raster, segfaultxavi
Reviewed By: bowonryu, segfaultxavi
Subscribers: segfaultxavi, cedric, #reviewers, #committers
Tags: #efl
Differential Revision: https://phab.enlightenment.org/D8323
Summary:
if passing NULL as filename to elm_entry_file_set,
elm_entry_entry_get NULL as return value before.
and it doesn't now.
Test Plan:
1. passing a existing file to efl_entry_file_set
2. passing NULL as file to efl_entry_file_set
3. check return value of elm_entry_entry_get
Reviewers: zmike, bu5hm4n
Reviewed By: zmike
Subscribers: cedric, #reviewers, #committers
Tags: #efl
Differential Revision: https://phab.enlightenment.org/D8363
Summary:
if format is not specified, it should return some error code.
this is a kind of a patch to keep backward compatability of the api.
Reviewers: zmike, bu5hm4n
Reviewed By: zmike
Subscribers: cedric, #reviewers, #committers
Tags: #efl
Differential Revision: https://phab.enlightenment.org/D8337
this takes the current generated output from eolian for legacy code in
efl 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/D8166
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/D8134
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/D8131
Summary:
now that the error codes have been change to be compatible with eina_error,
this can be removed and will work through eina_error naturally
fix T7718
Depends on D8067
Reviewers: cedric
Reviewed By: cedric
Subscribers: cedric, #reviewers, #committers
Tags: #efl_api
Maniphest Tasks: T7718
Differential Revision: https://phab.enlightenment.org/D8068
Summary:
this swaps the values of "no error" and "error" in order to maintain
consistency with the rest of efl where the zero value means "no error"
Depends on D8060
Reviewers: cedric
Reviewed By: cedric
Subscribers: segfaultxavi, cedric, #reviewers, #committers
Tags: #efl_api
Differential Revision: https://phab.enlightenment.org/D8063
before the disable property was a bit weird. Setting something to
disabled=true will disable all children of the widget that is changed.
However, only the update function of the children will get the false flag,
not the flag itself. Which means, to query the real disabled state, we
need to walk up the parent relations.
With this patch, every change to disabled will go through the disabled
property, which mean, a implementor can just overwrite the disabled
property, and adjust its internal state there. Just be carefull, a set
to disabled=true still might result in disabled=false. This makes the
function on_disable_update unneccesary. Which also cleans up the
Efl.Ui.Widget class.
ref T7553
Depends on D8016
Reviewed-by: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Differential Revision: https://phab.enlightenment.org/D8017
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
Until this commit eo did class functions as part of the vtable, which
enabled those functions to be overwritten in classes inheriting another
class. However in task T7675 we decided that this is not really good for
bindings, as most OOP languages do not support this sort of feature.
After this commit eolian realizes class function completly outside of
the vtable, the c-symbol that is the class funciton is now just directly
redirecting to a implementation, without the involvement of the vtable.
This also means a change to the syntax created by eo:
Calling before:
class_function(CLASS_A);
Calling after:
class_function();
Implementation before:
class_function(const Eo *obj, void *pd) { ... }
Implementation after:
class_function(void) { ... }
This fixes T7675.
Co-authored-by: lauromauro <lauromoura@expertisesolutions.com.br>
Reviewed-by: Daniel Kolesa <daniel@octaforge.org>
Differential Revision: https://phab.enlightenment.org/D7901
a file which has no data is still a valid file and should be correctly
opened
fix T6562
@fix
Reviewed-by: Cedric BAIL <cedric.bail@free.fr>
Differential Revision: https://phab.enlightenment.org/D7647
Summary:
Efl.Ui.Theme class is required to support language bindings.
Efl.Ui.Theme works based on current elm_theme features.
This patch fixes T7357.
Reviewers: segfaultxavi, cedric, lauromoura, woohyun, zmike, SanghyeonLee
Reviewed By: segfaultxavi, SanghyeonLee
Subscribers: SanghyeonLee, herdsman, #reviewers, #committers
Tags: #efl
Maniphest Tasks: T7357
Differential Revision: https://phab.enlightenment.org/D7244
Summary:
Efl.Ui.Layout namespace is removed to keep consistency with other
widgets.
Consequently, "Efl.Ui.Layout.Object" is renamed to "Efl.Ui.Layout" and
"Efl.Ui.Layout." is renamed to "Efl.Ui.Layout_".
Reviewers: segfaultxavi, bu5hm4n, cedric
Reviewed By: segfaultxavi
Subscribers: #reviewers, #committers, SanghyeonLee, woohyun
Tags: #efl
Differential Revision: https://phab.enlightenment.org/D7291
so gcc likes to warn even if the truncation is intended. there are
verious ways around this, but in this case it's really just writing
your own ... which is pretty simple.
there is just too much warning noise for efl.
Summary:
When an entry is scrollable, its resize object is scr_edje.
So, to apply scale properly, elm_entry needs to apply scale
to its entry_edje, too.
@fix
Test Plan: Apply scale to scrollable entry
Reviewers: herdsman, woohyun, cedric, eagleeye
Reviewed By: eagleeye
Subscribers: #reviewers, #committers
Tags: #efl
Differential Revision: https://phab.enlightenment.org/D7140
Summary:
the hoversel is added to a entry while entrys are not build for handling
children focus. Disabling this prevents wrong focus operations.
fix T7163
Reviewers: zmike, #committers, netstar
Reviewed By: netstar
Subscribers: cedric, #committers, zmike
Tags: #efl
Maniphest Tasks: T7163
Differential Revision: https://phab.enlightenment.org/D6695
The interface efl_part_get should not be directly called from C, but the efl_part
wrapper should. It rely on efl_noref to properly destroy the object. Binding can
control the lifecycle of the reference the way they want by either calling the
wrapper or efl_part_get directly. It also means that the ugly ___efl_auto_unref_set
doesn't need to be exposed outside of EFL anymore.
Differential Revision: https://phab.enlightenment.org/D6098
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>
Summary:
The mixin encapsulates the correct
- creation
- composition attaching
- Lifecycle handling
of the focus managers that are assosiated with the object.
This fixes error messages on shutdown, and additionally lifetime issues
where the composite_attached object was deleted before the object was
deleted.
Reviewers: cedric, zmike
Reviewed By: zmike
Subscribers: segfaultxavi, zmike
Tags: #efl
Differential Revision: https://phab.enlightenment.org/D6108