Commit Graph

154 Commits

Author SHA1 Message Date
Amitesh Singh 2faeffde71 efl.ui.image: fix the old align behaviour in img.
After ab23a53094, evas_object_size_hint_align_set()
has stopped working on elm img and that patch was perfectly right
to do so but we don't change the old behaviour.
This patch is an effort to make evas_object_size_hint_align_set()
to work with elm img again.
make sure not to mix both eo apis and legacy apis.

Thanks to dave for reporting and jpeg to show the right fix.

fixes T4635
2017-07-06 18:35:06 +09:00
Jean-Philippe Andre 06b14827b7 widget: Implement scale from Efl.Ui.Base 2017-06-12 11:50:30 +09:00
Amitesh Singh 75aa39ff8d Efl.Ui.Image: fix efl.player.playable.get API
an edje obj is always playable. return TRUE always.

@fix
2017-06-07 18:52:08 +09:00
Amitesh Singh 5882d343f0 efl.ui.image: fix icon_get API
If icon set is failed, icon_get should return NULL,
not the old icon name.

@fix
2017-06-05 17:09:19 +09:00
jiin.moon 2c119f54af elm_image: Fix previous image visible issue
Summary: Previous image still visible when elm_image_file_set has wrong file path.

Test Plan: self

Reviewers: jpeg, jypark, singh.amitesh

Reviewed By: singh.amitesh

Subscribers: singh.amitesh, minkyu, cedric

Differential Revision: https://phab.enlightenment.org/D4888
2017-05-31 19:01:04 +09:00
Jean-Philippe Andre ce0d15ecb3 edje: Reshuffle a bit edje_object.eo
This changes a few method names:
 - freeze -> calc_freeze
 - thaw -> calc_thaw
 - update_hints -> calc_update_hints

Otherwise this is mostly about reshuffling the EO file itself
and changing documentation.

Ref T5315
2017-05-31 18:42:28 +09:00
Jean-Philippe Andre b114f8c66d evas/elm: Add Efl.Image.image_size read-only property
Following a remark in the mailing list, it is pretty clear that
Efl.Gfx.View.view_size is not as simple as "image_size".

I have defined this new image_size as being the size of the
image file, and not what's currently loaded. So it will not
apply to proxies, gl views, 3d scenes, etc... but only to
standard image files loaded with file_set or mmap_set.
Supported objects:
 - Efl.Canvas.Image (evas image)
 - Efl.Ui.Image (elm image)
 - Elm.Photocam (note: still needs some interface work)

@feature
2017-05-24 15:24:13 +09:00
Jean-Philippe Andre 55b529cebc evas/elm: Make group_add/group_del internal functions
This hides those two legacy functions from the EO API.
2017-05-19 14:07:00 +09:00
Jean-Philippe Andre 331bf9f746 elm_image: Fix file_set when preload is disabled
If we disable preload, then the second file set on an elm_image
object would not trigger a deletion of the first image. As a
consequence, both images would be visible... really bad if there's
alpha or different dimensions!

Thanks Anand Kumar for the report!

@fix
2017-04-20 18:54:59 +09:00
Larry Jr 093c592188 efl: add efl_model and efl_ui_view classes
Efl.Model.Container and Efl.Model.Item to efl/interfaces are used
to create Efl.Model objects with predefined property values.
This is useful to any situation where we want an Efl.Model with
explicit defined property values.

Efl.Ui.View and Efl.Ui.Factory are used to connect Efl.Models with
Widgets, Elm.Layout and Efl.Ui.Image has changed to use news interfaces

Signed-off-by: Cedric BAIL <cedric@osg.samsung.com>
2017-02-06 15:26:21 -08:00
Cedric BAIL 8f1c071d6a eina: rename EINA_{FLT,DBL}_CMP to EINA_{FLT,DBL}_EQ. 2017-01-06 15:58:46 -08:00
Jee-Yong Um 6d0a2398ad Elm.Widget: rename "event.*" methods to solve name conflict
Summary:
Elm.Widget.event_callback_add conflicts with Efl.Object.event_callback_add.
To solve this problem, "widget_" prefix is added to methods starting with
"event".

Reviewers: cedric, jpeg

Differential Revision: https://phab.enlightenment.org/D4521
2017-01-03 10:59:49 +09:00
Cedric BAIL c994976cdb elementary: fix float warning in Efl.Ui.Image. 2016-12-20 16:39:30 -08:00
Gustavo Sverzut Barbieri fa8630a9b1 elm: convert downloads to efl_net_dialer_http.
Remove Elm_Url and use efl_net_dialer_http with an efl_io_copier to
fetch stuff.

The code was also slightly improved, particularly in elm_photocam
destruction be explicit and clear the grid before deleting... this
will ensure any pending preload are stopped before we remove the
backing memory.
2016-11-22 13:24:16 -02:00
Daniel Zaoui 381d93f1e2 efl_ui_image: fix removal of the internal evas image
During the replacement of the image with the new preloaded one,
the previous image is deleted but not removed from the list of
children of the icon (efl_ui_image), leading to Eo errors when
walking over the icon children.

@fix
2016-11-21 12:24:16 +02:00
Jaehyun Cho e64fa28284 efl_ui_image: guarantee user's mouse up event callback is called.
Summary:
Without propagating event by hit_rect, user's mouse up event
callback may not be called if image file is replaced in user's mouse
down event callback.

Test Plan:
1. Register mouse up event callback for elm_image by calling
evas_object_event_callback_add() with EVAS_CALLBACK_MOUSE_UP.
2. Register mouse down event callback for elm_image by calling
evas_object_event_callback_add() with EVAS_CALLBACK_MOUSE_DOWN.
3. Replace image file of elm_image by calling elm_image_file_set() in
mouse down event callback.
4. Mouse down on elm_image.
5. Mouse up on elm_image.
6. Since image file object is newly created in mouse down event
callback, mouse up event is not triggered for the newly created image
file object. As a result, mouse up event is not propagated to elm_image
and user's mouse up callback for elm_image is not called.

Reviewers: cedric, woohyun, eunue, jpeg

Reviewed By: jpeg

Subscribers: jpeg

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

Signed-off-by: Cedric BAIL <cedric@osg.samsung.com>
2016-11-16 13:46:40 -08:00
Jean-Philippe Andre 9af981469d elm: Fix usage of invalid object type (image)
This fixes a a crash on NULL and ensures the EAPI call is
done on an elm_image. Just checking NULL is not good enough
as _efl_ui_image_sizing_eval() doesn't check the type first.
2016-11-03 17:22:14 +09:00
Jean-Philippe Andre a86e79141e elm: Fix disappearance of some elm images
After the commit 97c9fa64a4 (Remove group_show and group_hide),
some Efl.Ui.Image objects would not render properly. The reason
being that the object call to show() was aborted too early when
the image is still preloading.

This made for really random results as an image preload could
take more or less time, depending on chance.
2016-11-01 09:36:39 +02:00
Jean-Philippe Andre 8a9f0bd603 evas/elm: Remove function group_resize
This is an override of efl_gfx_size_set. Same as before, the
order of operations matter so it is possible that a corner
case will break. In particular, legacy code was:
 - intercept
 - smart resize (do stuff), super, super, super
 - evas object resize

The new code is more like:
 - intercept
 - super, super, super, evas object resize
 - do stuff

But unfortunately this broke elm_widget (read: all widgets) as
the internal resize was done before the object resize. So,
inside the resize event cb, the resize_obj size would not match
the smart object size. >_<
2016-10-12 11:25:56 +09:00
Jean-Philippe Andre 11b7cf6b72 evas/elm: Remove function group_move
This is an override of efl_gfx_position_set.
As for the other patches, I hope I didn't break anything.

A problem likely to happen is that the super call was inserted
too early or too late in the call flow. For instance:

  _myclass_position_set(obj, x, y) {
    position_set(super(obj), x, y);
    position_get(obj, &prevx, &prevy);
    do_something_with_delta_xy();
  }

The above code flow is obvisouly wrong, but may have crept in this
patch (such a bug sneaked in inside smart object, breaking
everything at first).
2016-10-12 11:25:56 +09:00
Jean-Philippe Andre 97c9fa64a4 evas/elm: Remove group_show and group_hide
These should be just overrides of Efl.Gfx.visible.set. Many
widgets were handling smart show() and hide() manually, which
means this patch is quite large.

Hopefully this doesn't break anything, obviously. But here are
some widgets known to be problematic, as the old code flow was
really strange (sometimes not calling the efl_super function):
 - window
 - notify
2016-10-12 11:25:56 +09:00
Jean-Philippe Andre 62abe2cbff evas: Move clip_unset to legacy, remove group_clip
Similarly to group_color_set, group_clip_[un]set should not
exist and should be a result of efl_super and inheritance.

This patch also removes clip_unset from the EO API and keeps
only clip_set(NULL). The reason is that it will avoid bad overrides
of clip_unset() vs. clip_unset(NULL). This also simplifies the code
a bit. Ideally we should be able to reintroduce clip_unset in EO
if we can have a "@final" tag (like java's final keyword), to
prevent overrides.
2016-10-12 11:25:56 +09:00
Jean-Philippe Andre 52969ccd9b evas: Remove method group_color_set
Widgets should simply override efl_gfx_color_set and call
super all the way up to evas object.

Legacy compatibility with call interceptors and early call
abortion (eg. delete_me or obj->layer == NULL) are implemented
with an internal call. See the previous commit introducing the
API.
2016-10-12 11:25:55 +09:00
Jean-Philippe Andre 63088b583c elm_image: Add smart cbs for async open
This adds a few callbacks to inform applications about
async open and preload:
- load,open
- load,ready
- load,error
- load,cancel

This patch adds a new EAPI as well: elm_image_async_open_set.
This is the only way to use async file open with the legacy APIs
and should be easily matched with whatever EO API we end up using
(be it based on promises or events).

Alter the test cases for make check as they were using the
unstable EO API which I just removed.

Thanks @arosis for the original patch. And sorry for the huge
delay in merging this.

See also: https://phab.enlightenment.org/D4215

@feature
2016-09-23 11:28:14 +09:00
Jean-Philippe Andre 97a2d7ff33 elm_image: Move back download events to legacy only
The events for (async) image download will be redefined by
@cedric later. So, remove them from eo now and only keep their
legacy implementation.

Also, improve elm_test example and add docs.
2016-09-22 15:02:45 +09:00
Cedric BAIL b5f47fbcb9 elementary: patch got pushed before the complete fix. 2016-09-19 16:12:31 -07:00
Cedric BAIL 0d0ca579c6 elementary: be more conservative on the amount of data requested from disk. 2016-09-19 16:07:03 -07:00
Cedric Bail 351af26271 elementary: properly handle refcounting of file in efl_ui_image asynchronous image openning. 2016-09-14 16:52:08 -07:00
Carsten Haitzler be29f3f4ec efl ui image - fix janky blocking async image preload thread handling
fix the elm image threaded image preload to be far simpler and
actually threadsafe without blocking the mainloop at all even on
object deletion. this also ensures ar least the first 512M of any
async precached file are loaded in so the preload doesnt stall on
headers that are outside maybe the first 4k of the file. i saw this
happening all over the place in the test i created.

@optimize
2016-09-08 17:30:59 +09:00
Cedric BAIL e6a810efa7 elementary: fix call to efl_data_scope_get from another thread.
This should fix the breakage on elm_suite.
2016-09-07 11:42:29 -07:00
Vitor Sousa 8356b16a49 Efl Object: remove legacy callback calls from event_callback_call
Efl.Object.event_callback_call no longer calls legacy smart callbacks;
calling only event callbacks registered with the given event description
pointer.

Create the method Efl.Object.event_callback_legacy_call to inherit the old
behavior from Efl.Object.event_callback_call, calling both Efl.Object events
and legacy smart callbacks.

Update all other files accordingly in order to still supply legacy
callbacks while they are necessary.
2016-08-26 15:45:07 -03:00
Tom Hacohen e65aae994e Eo: Finish the renaming of Eo to the EFL.
This renames all the rest of the API to the EFL namespace except for
Eo_Event that will follow soon.

Obviously breaks both API and ABI.
2016-08-15 15:07:42 +01:00
Jean-Philippe Andre 4e00d5a71f image: Remove all new EAPI that shouldn't exist
Remove EAPI symbols and functions that were
wrongfully added:
 - elm_image_scale_down_set
 - elm_image_scale_down_get
 - elm_image_scale_up_set
 - elm_image_scale_up_get
 - elm_image_fill_inside_set
 - elm_image_fill_inside_get
 - elm_image_scale_get
 - elm_image_scale_set

Doing this before the 1.18.x release announcement.

Fixes T4343
@fix
2016-08-12 09:24:41 +09:00
Jean-Philippe Andre c6bb29c4e4 elm_image: Remove EAPI sizing_eval
This is an internal API, should not be exposed as EAPI.
Doing this before the 1.18.x announcement.

@fix
2016-08-12 09:20:21 +09:00
Tom Hacohen c662934be8 Change the EFL to follow the new Eo rename. 2016-08-11 17:04:43 +01:00
Jean-Philippe Andre 28c917836c efl: Cleanup some code (return values)
This removes some useless code in various places, where the
switch from eo_do() to standard function call was not properly
refactored.

This changes:

type ret = 0;
ret = my_eo_function();
return ret;

To:

return my_eo_function();
2016-08-05 10:32:30 +09:00
Jean-Philippe Andre 26ee77ff67 evas image: Lower ERR message to WRN and fix it
In elm_image, efl_file_get() was called on a legacy Evas Image
object, which generated an ERR message. This was way too much
noise for something that actually works.

It's best not to call efl_file_get/set API on a legacy
object, but it can be convenient for smooth code transitions
from legacy to pure eo.

Also, add safety to those APIs.

Test case: elm_test genlist dnd, start dragging anything.
2016-08-05 10:32:30 +09:00
Carsten Haitzler a3e7413992 elm image - silence warnings of setting smooth if image is edje 2016-08-04 08:17:18 +09:00
Carsten Haitzler f23788dcb0 elm image - store smooth scale var in object as intended
this fixesa bug reported by davemds and kuuko in python bindings test
suite where setting smooth flag != getting it right after.
2016-08-03 18:27:57 +09:00
Carsten Haitzler 1b8643b9a0 efl ui image - fix view size get to NOT apply scaling
this fixes T3254
2016-07-26 15:24:13 +09:00
Carsten Haitzler 8c9adcb616 efl ui image async locking -fix CID 1356199 - locked data cant be messed with
this addresses a coverity issue that in theory looks right

fix CID 1356199

@fix
2016-07-24 18:44:15 +09:00
Carsten Haitzler 2936834d31 elementary - fix focus switching again after break
this fixes T4053

this was due to everal widgets haveing changed their class names and
are using the new names for mapping to keybinding config that used
legacy names to match binding to widget.
2016-07-12 18:06:13 +09:00
Jinyong Park 3271ec8d18 theme: return enum from elm_widget_style_set instead of bool
Summary:
if trying to apply incorrect theme, widget apply default theme and return TRUE.
so there is no way to check it really apply correct theme.
To resolve this problem, _elm_theme_set return three type enum

* related history : 4ca3ef4514
* elm_object_style_set is public api, so I didn't change it.
* typedef name [ Theme_Apply ] is temporarily, please suggest better one.

@fix

Reviewers: singh.amitesh, herb, Hermet, cedric, jpeg, raster

Subscribers: cedric, jpeg

Differential Revision: https://phab.enlightenment.org/D4073
2016-07-01 15:09:43 +09:00
Jean-Philippe Andre 7bf8da2baa evas: Rename Evas.Object to Efl.Canvas.Object
One step closer to make the EO inheritance tree look like
it's all Efl.
2016-06-21 14:35:19 +09:00
Jean-Philippe Andre cb523121be efl.ui.image: Fix min size of non-resizable images
Legacy API was setting a value that was not used in the size
computation.

This fixes the layout in elm_test "Icon Animation".
2016-06-20 20:08:05 +09:00
Jean-Philippe Andre 80b6750a83 elm: Fix default image scale type
Elementary image used to respect aspect ratio by default,
corresponding to the fit_inside policy.

Fixes T3914.
2016-06-20 11:18:18 +09:00
Jean-Philippe Andre 52f9220b3f Evas: Rename smart object into Efl.Canvas.Group 2016-06-17 19:32:43 +09:00
Jean-Philippe Andre 42b63f5507 Evas: Add smart_ prefix to all smart functions (eo)
This is a first step at separating legacy smart
object features away from standard efl interfaces.
2016-06-17 19:25:48 +09:00
Jean-Philippe Andre 9a052a740d Evas: Move smart_callbacks_descriptions to legacy 2016-06-17 19:25:47 +09:00
Jean-Philippe Andre d67171940f Evas: Rename Draggable_Interface to Efl.Ui.Draggable 2016-06-10 18:06:10 +09:00
Jean-Philippe Andre e691de04be Evas: Rename Clickable_Interface to Efl.Ui.Clickable
Event prefix is efl_ui:
 EFL_UI_EVENT_CLICKED
 EFL_UI_EVENT_CLICKED_DOUBLE
 ...

The event prefix could be reduced to efl but I personally
prefer with UI.
2016-06-10 17:33:53 +09:00
Jean-Philippe Andre 37625fca91 Evas/Edje/Elm: Use combined_min instead of min everywhere
This allows apps to set the objects min size with hint_min,
while letting the rest of EFL define the minimum size with
rstricted_min.

I don't like the property names much...
2016-06-09 16:37:49 +09:00
Jean-Philippe Andre b1e361e8de elm: Fix build (use efl_ui_image.eo) 2016-05-31 20:51:31 +09:00
Ji-Youn Park a0ec05cd8f elm_image: rename the elm_image into efl_ui_image. 2016-05-31 19:16:41 +08:30