Commit Graph

154 Commits

Author SHA1 Message Date
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
Mike Blumenkrantz 6326e18b3f efl.file: improve api a bit
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
2019-02-27 13:17:10 -05:00
Mike Blumenkrantz e4b98a243b api: efl.gfx.hints.change,size,hints -> efl.gfx.hints.hints,changed
Summary:
this is consistent with other "changed" event naming

ref T7563

Depends on D7977

Reviewers: segfaultxavi, cedric, bu5hm4n

Reviewed By: segfaultxavi

Subscribers: cedric, #reviewers, #committers

Tags: #efl

Maniphest Tasks: T7563

Differential Revision: https://phab.enlightenment.org/D7978
2019-02-21 18:46:36 +01: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
SangHyeon Jade Lee 053146598c efl_ui : rename model connect and factory connect to bind property and factory.
As we discussed in T7469 with V40,

efl_ui_model_connect
efl_ui_factory_model_connect

need to be renamed to

efl_ui_bind_property
efl_ui_bind_factory

for this work,
Efl.Ui.Model.Connect interface is changed as Efl.Ui.Bind,
and bind_property and bind_factory both method is supported by this interface.

bind_factory need Efl.Ui.Factory,
and Efl.Ui.Factory inheritted Efl.Ui.Bind,
so I little bit concerned about circular referencing, but so far, it works well.

Reviewed-by: Cedric BAIL <cedric.bail@free.fr>
Differential Revision: https://phab.enlightenment.org/D7529
2019-02-11 11:06:13 -08:00
Mike Blumenkrantz d6992432c8 efl_ui_image: implement efl.file.mmap_get
this returns the current file, though the result is that the "current file"
could be changed asynchronously after this function is called

ref T5719

Reviewed-by: Marcel Hollerbach <marcel-hollerbach@t-online.de>
Differential Revision: https://phab.enlightenment.org/D7781
2019-01-26 12:21:57 +01:00
Mike Blumenkrantz d483302a13 efl_ui_image: implement remaining efl.layout.calc methods
this is just proxying the method calls onto the inner edje object if
the image is an edje object

ref T5719

Reviewed-by: Marcel Hollerbach <marcel-hollerbach@t-online.de>
Differential Revision: https://phab.enlightenment.org/D7741
2019-01-24 08:24:33 +01:00
Marcel Hollerbach 04c2d313d7 efl_ui_image: implement the last two APIs from edje
Summary:
this just takes the API and redirects it to the internal edje object if
there is any. If there is no edje object, then just default values are
returned.

ref T5719
Depends on D7738

Reviewers: zmike

Reviewed By: zmike

Subscribers: cedric, #reviewers, #committers

Tags: #efl

Maniphest Tasks: T5719

Differential Revision: https://phab.enlightenment.org/D7739
2019-01-23 14:55:51 -05:00
Chris Michael 71baeab41d elementary: Reduce EO calls by using geometry_set
This patch reduces EO calls by using evas_object_geometry_set rather
than calling move & resize.
2018-11-21 11:25:58 -05: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
Hermet Park c4124f8b36 efl_ui_image: apply some image options as retained way.
Summary:
load_size will be applied when file is set,
orientation, flip would be applied when starting sizing calc.

These will gurantee applying options whether image is preset or not.

This is a regression bug by ae51c81a686ca47c93eedc99beaf3a84f8a9cb96

Reviewers: #committers, zmike

Reviewed By: #committers, zmike

Subscribers: cedric, #reviewers, #committers, zmike

Tags: #efl

Differential Revision: https://phab.enlightenment.org/D6855
2018-08-21 10:38:54 -04:00
Yeongjong Lee e07b04f88c efl_ui_image: avoid a call to NULL
Summary:
Image object isn't created on constructor anymore. so that it need to check
whether image object exist.

Reviewers: Hermet, zmike

Reviewed By: zmike

Subscribers: cedric, #reviewers, #committers, zmike

Tags: #efl

Differential Revision: https://phab.enlightenment.org/D6834
2018-08-16 10:01:47 -04:00
Yeongjong Lee 07692dc640 elm_image: create image object before call elm_image_object_get
Summary:
image object was created in group_add before 868e3308. if you call
elm_image_object_get before file_set, you can get NULL.
this patch avoid that.

Test Plan:
obj = elm_image_add(...);
img = elm_image_object_get(obj);

img should not be NULL.

Reviewers: Hermet, zmike

Reviewed By: zmike

Subscribers: JackDanielZ, cedric, #reviewers, #committers, zmike

Tags: #efl

Differential Revision: https://phab.enlightenment.org/D6828
2018-08-16 10:01:37 -04:00
Hermet Park c4ff2cde25 elementary image: don't calc size using empty ones.
Summary:
Zero-sized image occasionally happens.
That occurs insane img/clipper region.

bj size => (w, h) then resize => (0, 0)
file_set(xx.jpg) then file_set (NULL)

Because of this, region could be flickered during prev/cur preloading images.

@fix

Reviewers: #committers, zmike

Subscribers: #reviewers, cedric, #committers, zmike

Tags: #efl

Differential Revision: https://phab.enlightenment.org/D6725
2018-08-08 15:52:37 +09:00
Hermet Park 868e3308b1 elementary image: apply lazy calculation and guarantee retained method.
Summary:
Image couldn't gurantee retained concept status.
This patch change to setting up image object on the request time,
recovering image status, removing unencessary jobs.

Reviewers: #committers

Subscribers: cedric, #committers, zmike

Tags: #efl

Differential Revision: https://phab.enlightenment.org/D6726
2018-08-02 09:25:27 -04:00
Marcel Hollerbach a6dea4007e efl_ui_image: apply the whole sizing eval
orientation no_scale etc. can have impact on the min max calculation.
Thus that should be called on every property set.

ref T7080

Differential Revision: https://phab.enlightenment.org/D6493
2018-07-02 18:17:20 +02:00
Larry Lira 0dfadc2322 elm: fix efl_model property_get and children_slice_get in views 2018-06-07 19:15:50 -03:00
Chris Michael 3920247ff6 elementary: Fix eina_safety return val
The function that this is used in returns Eina_Bool, but the safety
check was returning NULL
2018-05-04 07:07:41 -04:00
Jaeun Choi 473755fd66 efl_ui_image: add NULL check in elm_image_memfile_set() function
return EINA_FALSE if the data source is NULL elm_image_memfile_set()

@fix
2018-05-03 20:46:56 +09:00