Commit Graph

60 Commits

Author SHA1 Message Date
Stefan Schmidt c02dcf6966 efl_ui_textpath: make sure variables are not uses uninitialized
First and last could have been uninitialized for their first use in some
cases. Make sure we set the x y coordinates to 0 to begin with.

Coverity IDs: 1401458, 1404747

Reviewed-by: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Differential Revision: https://phab.enlightenment.org/D10044
2019-09-23 11:16:35 +02:00
Hermet Park 21bebe0422 efl_ui_textpath: clear up path data when it's destructed.
This fixes path data memory leak.

@fix
2019-08-09 13:43:50 +09:00
Mike Blumenkrantz f34f92bb29 efl_ui: use unified size hints api and be explicit about which hint is changed
unified widgets should use unified api internally and also be more explicit
about which min size hint (restricted or user) is being set in order to improve
readability of code

when unified widgets also implement legacy wrappers, legacy api should be used
for the legacy objects

no functional changes

Reviewed-by: Marcel Hollerbach <mail@marcel-hollerbach.de>
Differential Revision: https://phab.enlightenment.org/D9495
2019-08-07 14:48:39 +02: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
Hermet Park ac75934d06 textpath: + null handling. 2019-07-24 14:28:29 +09:00
Hermet Park bf7e05586f efl_ui_textpath: introduce efl_ui_textpath_circular_set() interface.
Summary:
This patch revises efl_ui_textpath_circle_set() interface.

Current circle_set() behavior is wrongly working,
it makes object minimal size with (x * 2, y * 2).
Insanely, how big size if the object is far from the screen origin.

Secondly, current interface requires center position,
How this center position could be guranteed if user wants to put it into a container?

Third, actual textpath output could be out of the textpath boundary,
since the textpath is originated to middle of text height.
the display boundary can be outside of the textpath geometry by (half of text height).

All in all, put altogether in fix,
I confirmed there is no methods without any compatibility break.

This brings elm_textpath_circular_set() api introduced.

@feature

Reviewers: #committers, kimcinoo, jsuya

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

Tags: #efl

Differential Revision: https://phab.enlightenment.org/D9260
2019-07-22 16:47:43 +09:00
Hermet Park 4fe9edaa26 efl_ui_textpath: adjust angle only for circle text. 2019-07-10 14:33:29 +09:00
Hermet Park 52a7ae56cd efl_ui_textpath: code refactoring.
less symbol calls, no logic changes.
2019-07-10 12:40:53 +09:00
Hermet Park 6f8d883991 efl_ui_textpath: remove unnecessary set.
Textpath positioning is completed manually,
this is duplicated request, remove it.
2019-07-10 12:34:04 +09:00
Hermet Park fa30eb6205 efl_ui_textpath: fix a center align but that doesn't happen at text_set().
When textpath obj has a new text data, it must update center align position
based on the new text length. Previously, it missed that logic.

@fix
2019-06-24 21:30:57 +09:00
Hermet Park 7eef03a041 efl_ui_textpath: redraw text properly.
It needs redraw since text draw depends on the obj' size.
2019-05-27 14:36:44 +09:00
Shinwoo Kim 451959973d Efl.Ui.Textpath: fix a size problem
Summary:
Textpath set its hint_size using its position and calulated path information.
The path information is calculated using center postion, radius & start angle.
For example, if textpath position is 0,0 and center positon of path is 100,100
and radius 50, then text will be located on the rigth side of textpath object.

Moreover there is another problem.

[Step to reproduce]
1. Launch elementary_test
2. open Efl.Ui.Textpath
3. see circle is not center aligned.
4. click Clockwise 1 ~ 2 times center position is changed repeatedly.

This occurs because textpath size is calculated by position_set.
It does not make sense that changing postion defines its size.

So this patch is setting textpath hint_size using only given center position.
The text will position on the middle of textpath object always.

Reviewers: Hermet, jsuya

Reviewed By: Hermet

Subscribers: cedric, #reviewers, #committers

Tags: #efl

Differential Revision: https://phab.enlightenment.org/D8930
2019-05-23 20:11:44 +09:00
Shinwoo Kim 205e5a5fe8 Efl.Ui.Textpath: support center align for each direction
Summary:
The textpath draws text from the start_angle. User needs to set correct
start_angle to center the text. This start_angle could be changed according to
each parameters of circle_set such as x, y, radius, direction and text itself.

So this patch is introducing direction EFL_UI_TEXTPATH_DIRECTION_CC(W)_CENTER.
The center of textpath will be located at the start_angle with this direction.

Test Plan: I will add example if this patch is acceptable.

Reviewers: Hermet, jsuya

Reviewed By: Hermet

Subscribers: cedric, #reviewers, #committers

Tags: #efl

Differential Revision: https://phab.enlightenment.org/D8892
2019-05-21 14:31:12 +09:00
Shinwoo Kim eaa2e12542 Efl.Ui.Textpath: draw text immediately in the position.set
Summary:
Efl.Ui.Textpath was drawing its text on the job. Because of this, textpath was
slower than other objects which are scrolling on the same scroller.
So this patch makes textpath not use job in the position.set.

Reviewers: Hermet, jsuya

Reviewed By: Hermet

Subscribers: cedric, #reviewers, #committers

Tags: #efl

Differential Revision: https://phab.enlightenment.org/D8924
2019-05-21 10:47:58 +09:00
Jaehyun Cho 6fd7c3f727 efl_ui: fix to use Efl.Ui.Widget's "background" and "shadow" part class
To use Efl.Ui.Widget's "background" and "shadow" part class, each widget
inheriting from Efl.Ui.Widget should not use their Part class for
"background" and "shadow" parts.
2019-05-15 19:06:50 +09:00
Shinwoo Kim 4e6539725e Efl.Ui.Textpath: enhance to support legacy API
Summary:
The legacy API is available after https://phab.enlightenment.org/D7033 but
internal function does not care of it. This change makes textpath work with
the legacy style file(./data/elementary/themes/edc/elm/textpath.edc).

Reviewers: Hermet, jsuya

Subscribers: cedric, #reviewers, #committers

Tags: #efl

Differential Revision: https://phab.enlightenment.org/D8875
2019-05-13 13:09:24 +09:00
Hermet Park 6d78454142 efl_ui_textpath: remove err log in none error case. 2019-05-07 17:35:06 +09:00
Yeongjong Lee 41136db8e8 ui.widget: remove elm_widget_sub_object_parent_add from each of widgets
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
2019-04-18 11:01:19 +02:00
Hermet Park 31cf281bdd efl_ui_textpath : enable anti-alising for better quality.
Summary:
Current textpath on sw rendering is too jiggled,
quaility is very poor to use.

This option uses better quality texture mapping logic
in order to improve the image quality.

Depends on D8106

Reviewers: #committers

Subscribers: cedric, #reviewers, #committers

Tags: #efl

Differential Revision: https://phab.enlightenment.org/D8465
2019-04-08 13:16:25 +09:00
Mike Blumenkrantz 054a4d4b17 efl_ui_textpath: remove all legacy usage from eo files
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/D8146
2019-03-06 15:21:57 -08:00
Mike Blumenkrantz bb6caaa471 efl.ui: remove Efl.Ui.Theme_Apply_Error
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
2019-03-04 13:37:07 -05:00
Mike Blumenkrantz 644b771fe4 efl.ui: Efl.Ui.Theme_Apply_Result -> Efl.Ui.Theme_Apply_Error
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
2019-03-04 13:36:41 -05:00
Youngbok Shin 45b475d9d4 elm textpath: reduces differences between actual pos and modified pos
Summary:
In a previous patch, textpath was modified to use differences between
prev/next values to decide next position. Actually, it improved rendering
quality. But, the modified position could have a big difference from actual position.
It caused a distortion problem.
So, this patch was made for reducing that differences.
@fix

Test Plan:
I'll attach some screenshots of before/after.

1. Modify text in text_ui_textpath.c to see distortion of text. ex) "―――――――――――――――――――..."
2. Build and install.
3. Run
   "ELM_SCALE=0.8 ELM_ACCEL=gl elementary_test -to efl.ui.textpath"

Reviewers: Hermet, raster, cedric

Reviewed By: Hermet

Subscribers: #reviewers, #committers

Tags: #efl

Differential Revision: https://phab.enlightenment.org/D7418
2019-02-25 15:27:00 +09: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
Hermet Park d2ec3ce170 efl gfx_path: remove EFL_GFX_PATH_EVENT_CHANGED
Summary:
Here is an additional optmization patch for removing
unnecessary updation of path,

For instance, let's assume this scenario:

If one vg object has 20 path nodes(shapes),
and every single nodes would have 50 path changes.
(like, append_cubic, append_rect, append_xxx ...);
There would 1000 events triggering.

Furthermore, if there are 20 vector objects in one view,
hese events would be triggered 20000 in one frame.

It's insane, actually I could figured out that happens.
and it took a lot of cpu consumption in some vector usages.

efl_gfx_path_commit() is my idea to avoid this.
When path is ready, the path need to get this api call in the last
 to make object changed properly.

@feature

Reviewers: #committers, cedric

Reviewed By: #committers, cedric

Subscribers: segfaultxavi, cedric, #reviewers, #committers

Tags: #efl

Differential Revision: https://phab.enlightenment.org/D7494
2018-12-28 12:20:15 +09:00
Hermet Park 0e278d1de8 Revert "efl gfx_path: remove EFL_GFX_PATH_EVENT_CHANGED"
This reverts commit 7c38c0c915.

Oops, didn't intend this patch.
2018-12-26 19:32:42 +09:00
Hermet Park 7c38c0c915 efl gfx_path: remove EFL_GFX_PATH_EVENT_CHANGED
Summary:
Here is an additional optmization patch for removing
unnecessary updation of path,

For instance, let's assume this scenario:

If one vg object has 20 path nodes(shapes),
and every single nodes would have 50 path changes.
(like, append_cubic, append_rect, append_xxx ...);
There would 1000 events triggering.

Furthermore, if there are 20 vector objects in one view,
hese events would be triggered 20000 in one frame.

It's insane, actually I could figured out that happens.
and it took a lot of cpu consumption in some vector usages.

efl_gfx_path_commit() is my idea to avoid this.
When path is ready, the path need to get this api call in the last
 to make object changed properly.

@feature

Reviewers: #committers, cedric

Subscribers: segfaultxavi, cedric, #reviewers, #committers

Tags: #efl

Differential Revision: https://phab.enlightenment.org/D7494
2018-12-26 19:29:10 +09:00
Jaehyun Cho 4f9c8d524c efl_ui_theme: Introduce Efl.Ui.Theme class
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
2018-11-20 13:56:37 +09:00
Youngbok Shin 32504a8cfa elementary textpath: support legacy APIs
Summary:
Efl.Ui.Textpath was added when we were developing new interfaces.
So, basically, it does not support 'legacy' APIs. ex) elm_textpath_add
But, in Tizen, the legacy APIs had been delivered in old version of EFL.
To reduce maintainning cost between the platforms, this patch will be helpful.
@feature

Test Plan: N/A

Reviewers: Hermet, woohyun, zmike, cedric, herdsman

Reviewed By: Hermet

Subscribers: #reviewers, #committers

Tags: #efl

Differential Revision: https://phab.enlightenment.org/D7033
2018-10-12 15:42:31 +09:00
Hermet Park bd3298dead elementary textpath: code refactoring.
Don't twist code unnecessarily.
logically same, round() is enough.
Differential Revision: https://phab.enlightenment.org/D6501
2018-07-05 23:01:00 +02:00
Hermet Park 9a25bad5bf elementary textpath: use job for deferred drawing task.
textpath performed drawing task multiple times unnecesarily.
It should be performed only one time after all setting up.
2018-05-28 15:39:23 +09:00
Hermet Park d1cce82565 elementary ui_textpath: remove autofit api.
Toggling this option is unlikely happened by user because with autofit=false,
it doesn't gurantee readable visual text.

We don't need this stupid api yet. So remove it.
2018-05-28 15:23:57 +09:00
Youngbok Shin 8d249c9445 elementary textpath: update Evas map when text is updated
Summary:
Evas map was not updated when text was updated.
@fix

Test Plan:
1. Run the following test case.
  elementary_test -to "efl.ui.textpath"
2. Toggle short text.
3. See a long line from the end of text which is wrong.
  If you change angle, Evas map will be updated properly.
  But, it should be updated when text is updated.

Reviewers: raster, cedric, thiepha, Hermet

Reviewed By: Hermet

Subscribers: Hermet, #committers, zmike

Tags: #efl

Differential Revision: https://phab.enlightenment.org/D6216
2018-05-28 14:48:41 +09:00
Youngbok Shin 455775c2e3 elementary textpath: improves text rendering quality of curved text
Summary:
There was wrong logic for calculating # of slices, dt, dist of each segment.
It caused bad rendering quality by putting too much slices on small text.

In addition, textpath didn't care about smoothness of curve's slope changing.
The patch fixes to check differences of previous points and next points for Evas Map.
So, textpath can show more smoothly curved text.

Also, it fixes "autofit" bug when text is much huge than given circle's size.

@tix

Test Plan:
- I'll attach screenshots for comparing rendering quality.
- To see "autofit" bug.
1. Run the following command.
   ELM_ACCEL=gl ELM_SCALE=2.0 elementary_test -to "efl.ui.textpath"

2. Toggle "autofit" check box.
3. See the bug case. Textpath can't show all text properly.

Reviewers: raster, cedric, thiepha

Subscribers: #committers, zmike

Tags: #efl

Differential Revision: https://phab.enlightenment.org/D6195

Reviewed-by: Cedric BAIL <cedric@osg.samsung.com>
2018-05-25 09:59:04 -07:00
Cedric BAIL 8a513a522e efl: major rewrite of efl_part.
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
2018-05-24 16:02:18 -07:00
Taehyub Kim 6e49db0739 efl theme: remove the elm legacy name of efl ui theme
Summary: remove the elm legacy name of efl ui theme

Test Plan: run elementary_test and test efl ui widget cases

Reviewers: Jaehyun_Cho, woohyun, cedric, raster, jpeg

Reviewed By: Jaehyun_Cho

Differential Revision: https://phab.enlightenment.org/D5934
2018-04-26 19:41:03 +09:00
Xavi Artigas 55bd097a3d Efl.Gfx.Entity (from Efl.Gfx)
Ref https://phab.enlightenment.org/T6847

Reviewed-by: Cedric Bail <cedric@osg.samsung.com>
2018-04-24 09:03:32 -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
Amitesh Singh 44d3227beb widget: rename elm widget to Efl.Ui.Widget. 2018-01-08 21:28:10 +09:00
Jean-Philippe Andre 1fdbb00e22 efl: Move VG-specific change event to efl.gfx.path 2017-12-13 13:47:48 +09:00
Jean-Philippe Andre 2f465e1fbb widget: Rename EO APIs to efl_ui_widget_xxx
This only changes the eo_prefix for APIs.

Ref T5363
2017-10-24 14:30:21 +09:00
Thiep Ha 65a87eb575 textpath: get the right size of text object
Recent change to use EINA_SIZE2D made the size be gotten incorrectly.
This corrects it.
2017-10-18 10:51:04 +09:00
Carsten Haitzler 66cd5cf2d5 efl ui textpath - remove more unused vars 2017-09-29 14:52:04 +09:00
Carsten Haitzler 522488eed9 efl ui textpath - remove unused vars due to dead code removal
fix warning
2017-09-29 12:32:10 +09:00
Carsten Haitzler 35b65e0643 efl ui text - remove logically dead code
it is indeed pointless code. fix coverity CID 1380544
2017-09-28 15:28:00 +09:00
Carsten Haitzler bee7bf5767 efl ui text - fix resource leak of strbuf and pointless buffer code
edje_object_part_text_style_user_push() doesnt need you to
stringshare_add a string... some other code did it because it "gets"
the string from an obj that might free/delete the string on push etc.
or before so it keeps a copy but then it stringshare_del's it
anyway... the _textpath_ellipsis_set() code creates a trsbuf that
wasn't freed if enabled was false and it never stringshare_del'd the
string is stringshare_added... all of this was pointless code anyway.
you could just pass the constant string directly.

fixes CID 1380543
2017-09-28 15:28:00 +09:00
Jean-Philippe Andre 0339ad7740 elm: Move base implementation for efl_part in widget
This means that ALL part handles inherit from the base part class
Efl.Ui.Widget.Part. Layout is the only exception where Efl.Part is
specially overridden.

This is a first step towards generic part APIs, including background in
all widgets.
2017-09-21 12:27:33 +09:00
Jean-Philippe Andre 3bff7363b5 efl: Use Eina.Size2D for size hint min 2017-09-18 14:42:52 +09:00
Jean-Philippe Andre 4c634ed78e efl: Use Eina.Size2D for Efl.Gfx.size
Big patch as a lot of things call or reimplement size_set. Hopefully I
got it right... fingers crossed.
2017-09-18 13:34:50 +09:00