Commit Graph

172 Commits

Author SHA1 Message Date
Mike Blumenkrantz b6bd20a844 elm/image: restore legacy behavior of elm_image_file_get
Summary:
this should operate on the internal image object to reflect the file
state there instead of the outer object

Reviewers: kimcinoo, Hermet

Reviewed By: Hermet

Subscribers: cedric, #reviewers, #committers

Tags: #efl

Differential Revision: https://phab.enlightenment.org/D11396
2020-02-25 12:17:12 +09:00
Xavi Artigas 697308a16f Efl.Ui.Image: Add fallback when icon is not found in default theme
Summary:
If _icon_standard_set() fails, _icon_freedesktop_set() is tried.

This was causing missing icons in the homescreen example, which uses
application icons which are obviously not present in the default theme.

Thanks to @bu5hm4n!

Test Plan: The homescreen sample application from the examples repository now correctly shows all missing icons.

Reviewers: bu5hm4n, zmike

Reviewed By: zmike

Subscribers: cedric, #reviewers, #committers, bu5hm4n

Tags: #efl

Differential Revision: https://phab.enlightenment.org/D11381
2020-02-24 09:02:30 -05:00
Shinwoo Kim bfdb01161a efl_ui_image: unload file before memfile_set
Summary:
If memfile_set does not remove prev file information, it is not possilbe to
load image using the same file information after memefile_set.

It means that below line 3 does not work because the same file information
remains for Efl.Ui.Image_Legacy.

1 |  elm_image_file_set(obj, "1.jpg", NULL)
2 |  elm_image_memfile_set(obj, img, size, "jpg", NULL)
3 |  elm_image_file_set(obj, "1.jpg", NULL)

This patch removes line calling _efl_ui_image_file_set_do becasue it is called
in efl_file_unload > _efl_ui_image_efl_file_unload.

Test Plan:
[Sample Code]
{F3848315}

[Reproduce Step]
1. File2
2. Memfile
3. File2

Reviewers: Hermet, jsuya

Reviewed By: Hermet

Subscribers: cedric, #reviewers, #committers

Tags: #efl

Differential Revision: https://phab.enlightenment.org/D11392
2020-02-21 13:16:57 +09:00
junsu choi 2ba77c0a33 efl_ui_image : Avoid integral division
Summary:
Assigning a result of integral division to a double type variable
is not useful for division calculation.

Test Plan: N/A

Reviewers: Hermet, YOhoho

Reviewed By: YOhoho

Subscribers: cedric, #reviewers, #committers

Tags: #efl

Differential Revision: https://phab.enlightenment.org/D11344
2020-02-14 16:26:52 +09:00
junsu choi 6c6ac71f56 Revert "efl_ui_image: Call unload file when calling file_set"
Summary:
This reverts commit 93bd970259.
efl.ui.image using prev and current inner image object.
Unloading the efl.ui.image class can be unloaded up to the prev image.
And because efl.ui.image is using the image caching feature together,
it may get unexpected errors. Therefore, revert this patch.

Test Plan: N/A

Reviewers: Hermet

Reviewed By: Hermet

Subscribers: cedric, #reviewers, #committers

Tags: #efl

Differential Revision: https://phab.enlightenment.org/D11157
2020-01-23 17:36:41 +09:00
junsu choi 93bd970259 efl_ui_image: Call unload file when calling file_set
Summary:
We have checked that unload is not called even if different files
call again elm_image_file_set on the same object.
If file_set is called repeatedly, I think a potential error can occur.
So, modify to call unload when doing file_set by referring to efl_ui_zoomable.

Test Plan: N/A

Reviewers: Hermet, zmike

Reviewed By: zmike

Subscribers: cedric, #reviewers, #committers

Tags: #efl

Differential Revision: https://phab.enlightenment.org/D11148
2020-01-22 11:57:26 -05:00
Hermet Park 991ca66681 ui_image: fix wrong scale_method expand behavior.
Previous fix 46ee203331 is not perfect
at some cases, its condition should be this.
2020-01-02 14:16:40 +09:00
junsu choi 3dc3deba62 Efl.Player: Add setter of playback_progress
Summary:
The setter of Efl.Player.playback_progress is implemented in each class below.
Efl.Ui.Animation_View
Efl.Ui.Image
Efl.Ui.Image_Zoomable
Efl.Canvas.Video

ref T8476
Depends on D10915

Test Plan: N/A

Reviewers: Hermet, bu5hm4n, kimcinoo, Jaehyun_Cho, segfaultxavi, zmike

Reviewed By: zmike

Subscribers: zmike, cedric, #reviewers, #committers

Tags: #efl

Maniphest Tasks: T8476

Differential Revision: https://phab.enlightenment.org/D10931
2019-12-31 09:53:10 -05:00
Hermet Park 46ee203331 ui image: fix scale_method expand behavior.
As efl_gfx_image_expand specification,
it scales the image to cover the entire object area on one axis
while maintaining the aspect ratio though image may become larger than the object.

Thus, this option must work as one of fit_width / fit_height
by detertimining either way.

Previously, it was logically wrong.

@fix
2019-12-23 15:42:17 +09:00
WooHyun Jung 5a684e0855 efl_ui_image: fix backward compatibility issue
Summary:
Previously, "anim" property was saved before checking
evas-image's "animated" stated. This patch just corrects
the issue.

Reviewers: zmike, bu5hm4n, segfaultxavi

Reviewed By: zmike

Subscribers: cedric, #reviewers, #committers

Tags: #efl

Differential Revision: https://phab.enlightenment.org/D10293
2019-10-07 10:03:48 -04:00
Mike Blumenkrantz a50bd311ab efl_ui/image fix null derefs
Summary:
CID 1405781, 1405780
Depends on D10209

Reviewers: cedric

Reviewed By: cedric

Subscribers: cedric, #reviewers, #committers

Tags: #efl

Differential Revision: https://phab.enlightenment.org/D10210
2019-09-26 17:59:54 -04:00
WooHyun Jung 23bbf2bf3a efl_ui_image: fix a wrong return value of legacy API
Summary:
elm_image_animated_play_get needs to return opposite
value of animated_PAUSED_get.

Reviewers: zmike, segfaultxavi, bu5hm4n

Reviewed By: zmike, segfaultxavi

Subscribers: cedric, #reviewers, #committers

Tags: #efl

Differential Revision: https://phab.enlightenment.org/D10186
2019-09-26 09:00:09 -04:00
Mike Blumenkrantz a4597c8326 efl_ui/image: fix playback_speed timer calcs
I accidentally inverted this; the frame timing needs to be divided by
the playback speed to have the correct time here

Reviewed-by: Cedric BAIL <cedric.bail@free.fr>
Differential Revision: https://phab.enlightenment.org/D10147
2019-09-25 11:30:59 -07:00
Mike Blumenkrantz 3e7b7a47e7 efl_ui/image: implement efl.player::playback_speed methods
Reviewed-by: Cedric BAIL <cedric.bail@free.fr>
Differential Revision: https://phab.enlightenment.org/D10121
2019-09-24 15:23:26 -07:00
Mike Blumenkrantz 5555c8e879 efl_ui/image: implement efl.player::playback_progress method
Reviewed-by: Cedric BAIL <cedric.bail@free.fr>
Differential Revision: https://phab.enlightenment.org/D10120
2019-09-24 15:23:24 -07:00
Mike Blumenkrantz e4ce41d6a6 efl_ui/image: implement required efl.player::playback_position methods
Reviewed-by: Cedric BAIL <cedric.bail@free.fr>
Differential Revision: https://phab.enlightenment.org/D10119
2019-09-24 15:23:22 -07:00
Mike Blumenkrantz 3d3cdc5955 efl/player: rename 'play' property to 'pause'
this is a bit of an overhaul wherein the existing 'play' mechanics are
all inverted. 'pause' is a state which stops playback but does not affect
the playback_position property.

this patch also includes implementations of Efl.Player::playing for
a couple classes which (now) only implement pause, as this is a requirement
for the objects to actually activate their animations

test cases:
* unit tests
* all elm_test animation cases
* elm_test video
* rage

Reviewed-by: Cedric BAIL <cedric.bail@free.fr>
Differential Revision: https://phab.enlightenment.org/D10114
2019-09-24 15:23:15 -07:00
Mike Blumenkrantz 5c2ea620a1 efl/player: prune properties duplicated in efl.playable
efl.playable implements a number of properties which are also present
in efl.player. playable was intended to be separate, so enforce this
split in all classes which use player

ref T7877

Reviewed-by: Cedric BAIL <cedric.bail@free.fr>
Differential Revision: https://phab.enlightenment.org/D10109
2019-09-24 15:23:09 -07:00
Marcel Hollerbach b051cb52fa efl_ui_image: implement Efl.Gfx.Image and Efl.Gfx.Image_Load_Controller
at first i tried to implement that with composition, however, this does
not work, caused by the fact that the edje_object does not implement
efl.gfx.image nor load controller. which would mean i would have to
differentiate based on the type what kind of composition i would attach,
additionally, i would have to write an additional object which would
implement the correct behaviour.

To shortcut this overdone approach, this commit simply implements the
APIs in the image object.

Reviewed-by: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Differential Revision: https://phab.enlightenment.org/D10068
2019-09-21 18:22:45 +02:00
Marcel Hollerbach 8a029d5c04 efl_ui_image: implement missing API
the API calls have not been implemented, this revision implements these
APIs as redirects to the image if those are a edje object.

Normally this should be a calling the legacy edje API. However, this is
here really hard as imitating the correct callback behaviour is hard.
And the correct behaviour with the eina value type is also just leading
to copying the implementation from edje. So in order to keep the amount
of code low here, this just uses the efl-api to redirect the requests.

Reviewed-by: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Differential Revision: https://phab.enlightenment.org/D9989
2019-09-17 15:45:26 +02:00
Xavi Artigas 944d5f37c7 efl/image: Efl.Gfx.Image_Scale_Type -> Efl.Gfx.Image_Scale_Method
ref T7927, T7875
Depends on D9931
2019-09-16 11:06:02 +02:00
Mike Blumenkrantz e84ecd9552 efl_ui/image: scalable -> efl.gfx.image::can_up/downscale
this removes the property from the image class to use the properties
from the interface

ref T7873

Reviewed-by: Marcel Hollerbach <mail@marcel-hollerbach.de>
Differential Revision: https://phab.enlightenment.org/D9704
2019-08-23 07:33:58 +02:00
Mike Blumenkrantz ad0c805545 efl/gfx: redo image scale_type enum
this is ideally a bit more clear and flexible than the previous enum names

Reviewed-by: Cedric BAIL <cedric.bail@free.fr>
Differential Revision: https://phab.enlightenment.org/D9691
2019-08-23 07:33:56 +02:00
Mike Blumenkrantz 81183e0423 efl_ui/image: implement efl.gfx.arrangement content_align to replace align prop
this is effectively the same thing. no uses of this functionality exist anywhere

ref T7873

Reviewed-by: Marcel Hollerbach <mail@marcel-hollerbach.de>
Differential Revision: https://phab.enlightenment.org/D9688
2019-08-23 07:33:55 +02:00
Mike Blumenkrantz 7442ae7092 efl_ui/image: remove geometry from internal struct, clean up geometry methods
these methods exist only to trigger efl_canvas_group_change on geometry
change and apply image sizing policies, there's no need to duplicate existing
functionality as well

Reviewed-by: Marcel Hollerbach <mail@marcel-hollerbach.de>
Differential Revision: https://phab.enlightenment.org/D9687
2019-08-23 07:33:54 +02:00
Mike Blumenkrantz 28fff16739 efl_ui/image: add group_calc implementation, use deferred calc for sizing
this changes image internals to use the more standardized group_calc method
of sizing and causes all previous operations on the image which would have
resulted in an immediate recalc to instead defer the calc until the
group_calc function is called

Reviewed-by: Cedric BAIL <cedric.bail@free.fr>
Differential Revision: https://phab.enlightenment.org/D9686
2019-08-23 07:33:53 +02:00
Mike Blumenkrantz e1fda2cbdb efl/hints: add restricted and combined max size hints
these function the same as the min size hint versions and enable
distinction between internally-set max size hints and user-set max size
hints

@feature

ref T8122

Reviewed-by: Cedric BAIL <cedric.bail@free.fr>
Reviewed-by: Xavi Artigas <xavierartigas@yahoo.es>
Differential Revision: https://phab.enlightenment.org/D9553
2019-08-14 12:08:13 -07:00
Yeongjong Lee 51a644d966 efl_ui: remove duplicated hint_min_set code
Summary:
evas_object_size_hint_min_set call efl_gfx_hint_size_restricted_min_set
internally.

Reviewers: zmike

Reviewed By: zmike

Subscribers: cedric, #reviewers, #committers

Tags: #efl

Differential Revision: https://phab.enlightenment.org/D9567
2019-08-14 09:56:42 -04: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
WooHyun Jung 53649030db efl_ui_action_connector: rename clickable_util to action_connector
efl_ui_clickable_util was only for efl_input_clickable interface,
but there can be more cases which want to connect object event
to specific action interfaces (such as scrolling) in the future.
For that extension, efl_ui_action_connector seems better.

ref: T7847

Reviewed-by: Marcel Hollerbach <mail@marcel-hollerbach.de>
Differential Revision: https://phab.enlightenment.org/D9486
2019-08-05 17:44:32 +02:00
Mike Blumenkrantz adc510f9ee efl_ui: change calls to elm_layout_sizing_eval to efl_canvas_group_change
Summary:
elm_layout_sizing_eval is a legacy function which should not need to be called
on new widgets

Reviewers: segfaultxavi, bu5hm4n

Reviewed By: bu5hm4n

Subscribers: segfaultxavi, cedric, #reviewers, #committers

Tags: #efl_widgets

Maniphest Tasks: T8059

Differential Revision: https://phab.enlightenment.org/D9434
2019-07-30 13:12:52 -04:00
WooHyun Jung 77e268e6ab efl_input_clickable: rename efl_ui_clickable to efl_input_clickable
Summary:
Renamed all efl_ui_clickable_XXX to efl_input_clickable_XXX based on
the discussion in T7847

ref T7847 T7976

Reviewers: zmike, bu5hm4n, segfaultxavi

Reviewed By: segfaultxavi

Subscribers: cedric, #reviewers, #committers

Tags: #efl

Maniphest Tasks: T7976, T7847

Differential Revision: https://phab.enlightenment.org/D9427
2019-07-29 11:43:01 +02:00
Cedric BAIL a68e18a903 elementary: Efl.Ui.Image now rely on event to update model binding.
Reviewed-by: Marcel Hollerbach <mail@marcel-hollerbach.de>
Differential Revision: https://phab.enlightenment.org/D9289
2019-07-17 21:57:50 +02:00
Hosang Kim 7d33cf977f Rename orientation -> image_orientation.
Summary:
Efl.Gfx.Image_Orientable and Efl.Ui.Layout_Orientable have same property name.
So when class extends both interfaces, it makes conflict.

Relates to T7924

Reviewers: woohyun, segfaultxavi

Reviewed By: segfaultxavi

Subscribers: cedric, #reviewers, #committers

Tags: #efl

Differential Revision: https://phab.enlightenment.org/D9299
2019-07-12 10:32:20 +02:00
Mike Blumenkrantz 5e3532655b efl_ui/image: check image object existence before using it in sizing
Summary:
when triggered before the image is loaded, this code cannot be run

@fix
Depends on D8978

Reviewers: devilhorns

Reviewed By: devilhorns

Subscribers: cedric, #reviewers, #committers

Tags: #efl

Differential Revision: https://phab.enlightenment.org/D8979
2019-05-29 12:29:04 -04:00
Xavi Artigas 12cab54b9c Rename Efl.Gfx.Orientation -> Efl.Gfx.Image_Orientation
Summary:
This will help disambiguate later on when we rename Efl.Ui.Direction
to Efl.Ui.Layout_Orientation.

Relates to T7919

Test Plan: Everything still builds and passes tests.

Reviewers: zmike

Reviewed By: zmike

Subscribers: cedric, #reviewers, #committers

Tags: #efl

Differential Revision: https://phab.enlightenment.org/D8934
2019-05-22 14:16:16 -04:00
Xavi Artigas e9eb1c825a Rename Efl.Orient -> Efl.Gfx.Orientation
Summary:
And the Efl.Orientation interface -> Efl.Gfx.Orientable
(with proper c_prefix so it is not too cumbersome to use from C).
Also, turned the theme_rotation_apply() parameter into an int to avoid confusion.

Fixes T7919
Depends on D8912

Test Plan: Everything continues to build and pass tests

Reviewers: zmike, bu5hm4n, cedric, Hermet, Jaehyun_Cho

Reviewed By: zmike

Subscribers: #reviewers, #committers

Tags: #efl

Maniphest Tasks: T7919

Differential Revision: https://phab.enlightenment.org/D8926
2019-05-20 11:52:10 -04:00
Xavi Artigas b24fde6787 Merge Efl.Orient and Efl.Flip into the same enum
Summary:
This is similar to how it is in Evas, and simplifies the Efl.Orientation
interface, which only needs one property now.

Relates to T7919

Test Plan: Everything builds and tests pass. There's only one example of efl_orientation_set() so there's not much to test yet.

Reviewers: zmike, bu5hm4n, cedric, Hermet, Jaehyun_Cho

Reviewed By: zmike

Subscribers: #reviewers, #committers

Tags: #efl

Maniphest Tasks: T7919

Differential Revision: https://phab.enlightenment.org/D8912
2019-05-20 11:51:56 -04:00
Marcel Hollerbach 8429ffba9c efl_ui_image: migrate to efl.ui.clickable
Summary:
the mixin is now used to emit the events of the mixins. This is verified
by the testsuite. The testsuite needs a special treatment for the
object, because a missing image-file of the object would result in a 0x0
image size.

Depends on D8822

Reviewers: zmike, segfaultxavi, cedric

Reviewed By: zmike

Subscribers: #reviewers, #committers

Tags: #efl

Differential Revision: https://phab.enlightenment.org/D8823
2019-05-14 15:50:39 -04:00
Marcel Hollerbach 41e1dadbf1 elementary: do not emit new events in legacy
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
2019-05-13 15:14:13 -04: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
Mike Blumenkrantz d31adef9fe efl_ui_image: fix warning about calling smooth_scale_set on non-image
Summary: this is triggered during object construction when no image exists

Reviewers: devilhorns

Reviewed By: devilhorns

Subscribers: cedric, #reviewers, #committers

Tags: #efl

Differential Revision: https://phab.enlightenment.org/D8617
2019-04-16 08:55:11 -04:00
Hermet Park 620eb070f4 efl_ui_image: remove job in sizing calc.
Originally, this job task was introduced for trick optimization to avoid
unnecessary duplicated compuation.

But this introduced a regression bug as well, image geometry updation was
delayed by this.

So, we remove the job here.

@fix T7360
2019-03-25 19:49:54 +09:00
Cedric BAIL 98e5a71974 efl: add an event for the View to know if someone did bound a property.
Reviewed-by: Vitor Sousa da Silva <vitorsousa@expertisesolutions.com.br>
Differential Revision: https://phab.enlightenment.org/D7945
2019-03-08 14:31:04 -08:00
Cedric BAIL e7afae9a8b elementary: Efl.Ui.Image now rely on Efl.Ui.Widget infrastructure for View and Property_Bind.
Reviewed-by: Vitor Sousa da Silva <vitorsousa@expertisesolutions.com.br>
Differential Revision: https://phab.enlightenment.org/D7942
2019-03-08 14:31:01 -08:00
Cedric BAIL d0b70ef4e7 efl: Property_Bind should actually tell us if it succeeded or failed by returning an Eina.Error.
Reviewed-by: Marcel Hollerbach <marcel-hollerbach@t-online.de>
Reviewed-by: Xavi Artigas <xavierartigas@yahoo.es>
Differential Revision: https://phab.enlightenment.org/D7939
2019-03-07 09:58:54 -08:00
Mike Blumenkrantz 2f20d97f10 efl_ui_image: 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/D8140
2019-03-06 15:21:41 -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
Mike Blumenkrantz a5e183ad5d efl.canvas.object: clip -> clipper && clipees -> clipped_objects
Summary:
also clipees_has -> clipped_objects_count

ref T7555

Depends on D8039

Reviewers: segfaultxavi

Reviewed By: segfaultxavi

Subscribers: segfaultxavi, cedric, #reviewers, #committers

Tags: #efl

Maniphest Tasks: T7555

Differential Revision: https://phab.enlightenment.org/D8040
2019-02-27 13:17:37 -05:00