this fixes warnings from gcc specifically:
lib/edje/edje_entry.c: In function ‘_edje_entry_imf_cursor_info_set’:
lib/edje/edje_entry.c:4104:4: warning: ‘dir’ may be used uninitialized
in this function [-Wmaybe-uninitialized]
ecore_imf_context_bidi_direction_set(en->imf_context,
(Ecore_IMF_BiDi_Direction)dir);
^
lib/edje/edje_entry.c:4099:24: note: ‘dir’ was declared here
Evas_BiDi_Direction dir;
^
lib/edje/edje_entry.c:4103:4: warning:
‘ch’ may be used uninitialized in this function [-Wmaybe-uninitialized]
ecore_imf_context_cursor_location_set(en->imf_context, cx, cy, cw,
ch);
^
lib/edje/edje_entry.c:4098:27: note: ‘ch’ was declared here
Evas_Coord cx, cy, cw, ch;
^
lib/edje/edje_entry.c:4103:4:
warning: ‘cw’ may be used uninitialized in this function
[-Wmaybe-uninitialized]
ecore_imf_context_cursor_location_set(en->imf_context, cx, cy, cw,
ch);
^
lib/edje/edje_entry.c:4098:23: note: ‘cw’ was declared here
Evas_Coord cx, cy, cw, ch;
^
lib/edje/edje_entry.c:4103:4: warning:
‘cy’ may be used uninitialized in this function [-Wmaybe-uninitialized]
ecore_imf_context_cursor_location_set(en->imf_context, cx, cy, cw,
ch);
^
lib/edje/edje_entry.c:4098:19: note: ‘cy’ was declared here
Evas_Coord cx, cy, cw, ch;
^
lib/edje/edje_entry.c:4103:4: warning:
‘cx’ may be used uninitialized in this function [-Wmaybe-uninitialized]
ecore_imf_context_cursor_location_set(en->imf_context, cx, cy, cw,
ch);
^
lib/edje/edje_entry.c:4098:15: note: ‘cx’ was declared here
Evas_Coord cx, cy, cw, ch;
^
lib/edje/edje_entry.c: In function
‘_edje_part_move_cb’:
lib/edje/edje_entry.c:4104:4: warning: ‘dir’ may be used uninitialized
in this function [-Wmaybe-uninitialized]
ecore_imf_context_bidi_direction_set(en->imf_context,
(Ecore_IMF_BiDi_Direction)dir);
^
lib/edje/edje_entry.c:4099:24: note: ‘dir’ was declared here
Evas_BiDi_Direction dir;
^
lib/edje/edje_entry.c:4103:4: warning:
‘ch’ may be used uninitialized in this function [-Wmaybe-uninitialized]
ecore_imf_context_cursor_location_set(en->imf_context, cx, cy, cw,
ch);
^
lib/edje/edje_entry.c:4098:27: note: ‘ch’ was declared here
Evas_Coord cx, cy, cw, ch;
^
lib/edje/edje_entry.c:4103:4:
warning: ‘cw’ may be used uninitialized in this function
[-Wmaybe-uninitialized]
ecore_imf_context_cursor_location_set(en->imf_context, cx, cy, cw,
ch);
^
lib/edje/edje_entry.c:4098:23: note: ‘cw’ was declared here
Evas_Coord cx, cy, cw, ch;
^
lib/edje/edje_entry.c:4103:4: warning:
‘cy’ may be used uninitialized in this function [-Wmaybe-uninitialized]
ecore_imf_context_cursor_location_set(en->imf_context, cx, cy, cw,
ch);
^
lib/edje/edje_entry.c:4098:19: note: ‘cy’ was declared here
Evas_Coord cx, cy, cw, ch;
^
lib/edje/edje_entry.c:4103:4: warning:
‘cx’ may be used uninitialized in this function [-Wmaybe-uninitialized]
ecore_imf_context_cursor_location_set(en->imf_context, cx, cy, cw,
ch);
^
lib/edje/edje_entry.c:4098:15: note: ‘cx’ was declared here
Evas_Coord cx, cy, cw, ch;
^
and the likes...
Summary:
When text is changed, all of objects for item tag are deleted
and recreated. It is unnecessary work and can cause performance
issues. Actually, many of application developers wonder why
item provider callback functions are called every text changes.
@fix
Test Plan:
Run elementary_test -to "entry emoticon"
When you make a very little change on text,
36 emoticon objects are recreated.
Reviewers: woohyun, jaehwan, herdsman, tasn
Reviewed By: tasn
Subscribers: cedric, jpeg
Differential Revision: https://phab.enlightenment.org/D3537
Summary:
Fix memory leak
If user or extra cursor is used, these should be free on
shutdown.
@fix
Test Plan: NA
Reviewers: tasn, herdsman
Subscribers: shilpasingh, cedric, jpeg
Projects: #efl
Differential Revision: https://phab.enlightenment.org/D3550
Summary:
Do not update cursor for non editable entry.
If entry is not editable there must not be any need to query tb cursor
geometry and run other codes related to it. This may improve some
performance of non-editable entry.
Test Plan: NA
Reviewers: tasn, herdsman, thiepha
Subscribers: shilpasingh, cedric, jpeg
Projects: #efl
Differential Revision: https://phab.enlightenment.org/D3532
Summary:
Fix cursor position on mouse up/down
When mouse down/up over top and bottom part textblock is not able to set the
char coordinate as it is not inside actual text, edje entry tries to manage it
but textblock has that handling. As a result the cursor jump to first char for
single line and at the last in the multiline last line.
So this patch fixes this and manage to keep the the mouse coordinate inside
the textblock.
In mobile device this is not really acceptable when user taps over the entry
at some position and cursor jumps to some arbitrary position.
@fix
Test Plan:
1. Elementary Test
2. Entry 3 (any entry)
3. Try to click little below or above the text in first entry
single line.Observe cursor jumps to first position
4. Do as above for multiline entry (try to click at the last line little below)
observe cursor jumps to last char.
Reviewers: thiepha, herdsman, tasn
Subscribers: jpeg, tasn, cedric
Differential Revision: https://phab.enlightenment.org/D3257
Summary:
Use markup text for password in preedit mode
Problem is that when text comes in preedit mode
it is always markup text and when it is committed
to entry it got committed with markup tags along with
the original string, so for preedit mode password
should be filtered all markup to set the proper text.
@fix
Test Plan:
In preedit mode, enter any character say 'A'
preedit markup like <preedit>A</preedit>
will come in preedit changed callback
Result: Text is set as plain text like below
<preedit>A</preedit>
Reviewers: thiepha, jihoon, herdsman, shilpasingh, tasn
Reviewed By: shilpasingh, tasn
Subscribers: cedric
Differential Revision: https://phab.enlightenment.org/D2929
Summary:
When text is selected, crash happens due to double free as rectangles are freed both in _sel_update
and _evas_textblock_selection_iterator_free hence removing free from _sel_update.
@fix T2910
Test Plan:
1. Launch elementary test
2. launch entry demo
3. select text
Reviewers: cedric, herdsman
Subscribers: jpeg
Maniphest Tasks: T2910
Differential Revision: https://phab.enlightenment.org/D3401
Adding a check for the selection range on extend/preextend.
If there is no range, then emit "selection,reset".
Expected handling on the theme end for this signal is to show the
cursor.
This improves cursor visuals, as it will show the cursor again once the
selection range ends up being 0.
Summary:
In entry, when selection_get function is called, selection is not
always returned the current selection.
Scenario:
- In select mode, entry has selection (e.g, by double click).
- When selection handler is moved, set the cursor the current coordinate
with edje_object_part_text_cursor_pos_set() API.
- Edje emits "selection,changed" signal.
- Elementary gets current selection and stores it.
- Elementary does not get selection as visual selection (e.g, text is
highlighted with "entry test", but the selection returned
from edje is "entry").
- If we copy and then paste to the entry, the pasted text is not same as
selected text.
Reason:
- In _edje_entry_cursor_coord_set function, if entry has selection, we only
emit "selection,changed" signal without freeing en->selection.
- When _edje_entry_selection_get is called, we check the en->selection,
since it is existed, we just return it which is not updated one.
This patch clears en->selection, so that it is updated at _selection_get,
and the updated selection is returned to caller.
@fix
Test Plan:
In mobile profile, open entry
- Right click, choose select, double click -> selection handlers are shown.
- Drag selection handlers to change selection.
- Right click, do copy.
- Right click, do paste.
- See the pasted text is not same as selection.
Reviewers: raster, tasn, herdsman
Subscribers: seoz, JackDanielZ, cedric
Differential Revision: https://phab.enlightenment.org/D2746
Summary:
Remove dead code
If anchor sel is not there, code inside
while can not execute.
Test Plan: NA
Reviewers: tasn, herdsman, cedric
Reviewed By: cedric
Subscribers: cedric
Differential Revision: https://phab.enlightenment.org/D3190
Signed-off-by: Cedric BAIL <cedric@osg.samsung.com>
Summary:
Object not created if theme source is not available.
In many case we dont need or define all the
theme sources for entry, even if the sources are
null, edje object is being created.
Test Plan: NA
Reviewers: tasn, herdsman, cedric
Reviewed By: cedric
Subscribers: cedric
Differential Revision: https://phab.enlightenment.org/D3199
Signed-off-by: Cedric BAIL <cedric@osg.samsung.com>
Summary:
Edje entry: Make cursors to null after free
To prevent any illegal access of cursors
can lead to crash
@fix
Test Plan: NA
Reviewers: tasn
Reviewed By: tasn
Subscribers: shilpasingh, cedric
Differential Revision: https://phab.enlightenment.org/D3093
Summary:
The keys Home/End/PgUp/PgDown are changes the entry cursor
position in the same way as arrow keys. For unified behavior
callback "cursor,changed,manual", added emitting signal for
those keys events.
Reviewers: tasn, cedric, herdsman, thiepha
Subscribers: cedric
Differential Revision: https://phab.enlightenment.org/D3055
Summary:
The result of evas_object_textblock_cursor_content_get() API has to be cleaned
by outside. _edje_entry_cursor_content_get() is calling free() inside of the
function for handle the result using static pointer. But, the caller of
_edje_entry_cursor_content_get() is already handling the result using free().
It can cause double free problem.
The bigger issue is in elementary. See elm_entry_cursor_content_get() API's
document. The document advice developers to free the result when it is done.
@fix
Test Plan: N/A
Reviewers: tasn, raster, woohyun
Subscribers: cedric
Differential Revision: https://phab.enlightenment.org/D2991
Summary:
change position of the main textblock cursor
in depends of the selection is present. Change cursor position to
the start or end of selection only when selection is present.
@fix
Test Plan:
Press "Up" and "Down" arrow keys on selected and normal text.
For selected text: the entry cursor should be placed one line
above or below selection block (in depends from pressed button).
For normal text: the entry cursor should be placed one line
above or below of the current cursor position.
Reviewers: tasn, Hermet, herdsman
Subscribers: cedric
Differential Revision: https://phab.enlightenment.org/D2948
Summary:
After the commit D2904
this commented code and comments are not required
Test Plan: NA
Reviewers: tasn
Subscribers: cedric
Differential Revision: https://phab.enlightenment.org/D2938
Summary:
Fix to delete selection when preedit status has not ended
In preedit mode when selection is made and input any letter,
there is duplicate character appeared because the selection
is cleared when commit happens so delete the selection in
preedit last stage.
@fix
Test Plan: Test in Tizen devices.
Reviewers: woohyun, id213sin, shilpasingh, tasn
Subscribers: rajeshps, cedric, govi
Differential Revision: https://phab.enlightenment.org/D2837
Summary:
When commit string comes from key_down text filter is applied before deleting
the range but when commit string comes from imf filter is applied after deleting
the range. Moreover when format is prepended range is deleted before applying
insert filter. Please check the _edje_key_down_cb and
_edje_entry_imf_event_commit_cb routines.
@fix
Test Plan: Tested in Tizen device
Reviewers: herdsman, thiepha, shilpasingh, raster, tasn
Subscribers: cedric
Differential Revision: https://phab.enlightenment.org/D2904
Summary:
Elementary widgets dealing with Evas Events usually mask event_flags with
EVAS_EVENT_FLAG_ON_HOLD, to show that this event is already handled.
However, widget like Elm_Button, it does not handle EVAS_CALLBACK_MOUSE_DOWN directly,
but it handles Edje_Signal instead, so there's no chance to mask event_flags.
Developers can block event propagation by putting rectangle the very last part of EDC,
but this instruction can help the case making elementary widget with only Edje_Signal handling.
This is not required essentially, so please check the necessity of this function.
Reviewers: Hermet, cedric
Reviewed By: cedric
Subscribers: cedric, Hermet
Differential Revision: https://phab.enlightenment.org/D2764
Signed-off-by: Cedric BAIL <cedric@osg.samsung.com>
Summary:
When caps lock is "On" and we press control + (x,a,y,z,m,c) none of
these operations work issue fix.
@fix
Test Plan:
1. Caps lock On
2. Input some text
3. Press ctrl+a, ctrl+c etc:-
4. Select, copy, cut etc:- operations does not work
Reviewers: tasn
Subscribers: raster, rajeshps, govi, poornima.srinivasan, navnbeet, subodh6129, cedric
Differential Revision: https://phab.enlightenment.org/D2633
Summary:
Check for have_selection flag when left/arrow keys are pressed to jump
across the selected text, to avoid unnecessary function calls of
comparision, copy of sel_start and sel_end pointers.
Test Plan: Press left and right arrow keys on selected and normal text.
Reviewers: herdsman, tasn
Subscribers: SubodhKumar, navnbeet, cedric
Differential Revision: https://phab.enlightenment.org/D2621
Summary:
When edje entry is not inside the canvas view port, anchors update is aborted to improve the scrolling performance
in case of large number of anchors.
@feature
Test Plan:
1. Should have many entries inside scroller.
2. Each entry should contain large number of anchors.
3. Scroll it, scrolling is not smooth.
Reviewers: seoz, cedric, thiepha, woohyun, tasn, raster, shilpasingh, herdsman, JackDanielZ
Reviewed By: shilpasingh
Subscribers: poornima.srinivasan, rajeshps, cedric, govi
Differential Revision: https://phab.enlightenment.org/D2108
Summary: Coverity reports idential code for different branches here.
Not sure WHY that was done, but I commented out the existing if
statement for posterity.
@fix
Signed-off-by: Chris Michael <cp.michael@samsung.com>
Summary:
The selection performance is slow if we select large chunk of text.
This is caused by many rectangles created and deleted.
This patch provides a way to improve it by combine selection rectangles
of line in middle into one rectangles (i.e, if we have N lines,
the selection rectangle for lines 2 to N-1 will be combined into one.)
@feature
Reviewers: raster, cedric, tasn
Subscribers: herdsman, woohyun, cedric
Differential Revision: https://phab.enlightenment.org/D1508
Summary:
There is copy-paste bug, when _anchors_get works in the same way like
_items_get. edje_object_part_text_item_list_get and
edje_object_part_text_item_geometry_get didn't work.
@fix
Reviewers: seoz, Hermet, raster, cedric
Reviewed By: cedric
Subscribers: cedric
Differential Revision: https://phab.enlightenment.org/D1641
Signed-off-by: Cedric BAIL <cedric@osg.samsung.com>
this fixes CID 1039647 - it caught a real bug. we were not skipping
out on an empty + or - push/pop format fomamnt if it had nothing
there. not actually something people do - but possible. fix!
Summary:
This dpi is used to get the scale for each collection.
If each collection has a described dpi, it calculates a proper scale
based on the dpi and dpi which is described in the collection.
@feature
Test Plan:
If add dpi to collection of edc, the edje will save the value as the dpi of the collection.
For example, if the dpi of your device is 100, you just set dpi: 100 in the collection of edc.
If the edj is loaded in another device(dpi is 200), it will scaled 2 times.
It is possible that the described dpi of application and theme are different.
In that case, application and theme have a different scale.
It makes the edj that made in different environment works in one device.
Reviewers: seoz, zmike, JackDanielZ, Hermet, woohyun, cedric, raster
Reviewed By: raster
Subscribers: cedric
Differential Revision: https://phab.enlightenment.org/D1190
Summary:
When text is hidden by password character, "changed" signal should be emitted.
But, even if there is no visible text, the signal was emitted.
@fix
Reviewers: woohyun, tasn, cedric
Reviewed By: cedric
CC: cedric
Differential Revision: https://phab.enlightenment.org/D604
Signed-off-by: Cedric BAIL <cedric.bail@samsung.com>
Summary:
Link anchors are set to allow event propagation. In some cases, this
might lead to unwanted results in entry.
Adding a flag to event_flags allows to control this in Elementary.
One example that this fixes is having wrong mouse cursor handling when
having the mouse out of the link anchor, back to the entry parent
(in this case, additional handling in els_cursor.c is required so this
event is ignored if event_flag is set with EVAS_EVENT_FLAG_ON_HOLD.
Fixes T878.
Reviewers: tasn
CC: cedric
Maniphest Tasks: T878
Differential Revision: https://phab.enlightenment.org/D561