Commit Graph

69 Commits

Author SHA1 Message Date
Jean-Philippe Andre 8fb194d969 efl: Use Eina.Position2D for Efl.Gfx.position
Note: This is a little bit more cumbersome in some places but in most
it's more convenient than (x,y).
2017-09-18 13:22:54 +09:00
Jean-Philippe Andre f3eff6eb3e efl: Introduce Eina.Rect and switch EO APIs to it
It's a complex struct but defined in EO as a simple struct. ABI-wise
it's equivalent to Eina_Rectangle. Some macros that use Eina_Rectangle
also work on Eina_Rect out of the box, most of the code dealing with
x,y,w,h will require no modifications either.

But Eina_Rect provides direct access to a size or position 2d component,
as well as the usual x,y,w,h. The field "rect" is provided as a
convenience for code dealing with both Eina_Rectangle and Eina_Rect. We
may or may not require it.

Note: Size2D could use unsigned values but I have spotted a few places
in the code that actually use -1 to indicate invalid size (as opposed to
0x0).

@feature
2017-09-18 13:22:52 +09:00
Jean-Philippe Andre c0d7ea4af0 widget: Rename on_focus to on_focus_update (EO)
on_focus seems to imply that focus was just given to the widget, but
that function is called on any focus change (in and out).

Ref T5363
2017-09-01 10:09:37 +09:00
Jean-Philippe Andre b6bab481aa widget: Mark old focus API as beta.
It's not beta. It's about to die.
Also, move #define ELM_WIDGET_BETA to the common header file, as it is
consequently required by ALL widgets. :(

Ping @bu5hm4n :)

Ref T5363
2017-08-31 11:22:04 +09:00
Jean-Philippe Andre 692282e67a widget: Move item_loop_enabled to scrollable (EO)
I was told that the scrollable interface is being redesigned for EO.
This API definitely does not belong to the base Widget class, as it's
quite specific to item-based scrollable widgets, such as lists and
grids. Since Elm.Interface_Scrollable is itself being revamped, it is a
good place to move that EO API for now.

Ref T5363
2017-08-30 17:29:52 +09:00
Jean-Philippe Andre 00862c3c9c widget: Use rectangle on the stack for region_show
Follow @k-s recommendation and simply use rectangles on the stack rather
than by pointer.

Ref T5363
2017-08-30 17:29:52 +09:00
Jean-Philippe Andre 8c1f771a67 widget: Use rectangle for focus_hilight
Ref T5363
2017-08-29 16:22:47 +09:00
Jean-Philippe Andre 233068c30c widget: Simplify code with rectangle (EO)
This replaces x,y,w,h with a rectangle in parts of the focus_region
code.

Ref T5363
2017-08-29 14:30:39 +09:00
Jean-Philippe Andre d928ba989a widget: Merge on_focus_region and focus_region_get
This simplifies code and API.

Ref T5363
2017-08-29 14:30:35 +09:00
Jean-Philippe Andre 0a0bbe5fda widget: Rename hook "access" (EO)
This is also another protected and beta API. Meant to be overridden by
subclasses, but belongs to a still unstable API.

The difference between the internal legacy and the EO API is really bad.
Same as with activate (previous commit).

Ref T5363
2017-08-29 10:40:53 +09:00
Jean-Philippe Andre 20a5968c12 elm: Use a macro to handle key bindings
This factorizes the code and makes most widgets handle key down events
in the same way:
 - check that the object is not disabled, event is not on hold
 - figure out the key binding based on the class name
 - mark event as on hold

The class name is usually MY_CLASS_NAME but in some cases it was
MY_CLASS_NAME_LEGACY which may be different from the EO class name (eg.
elm_win vs. Efl.Ui.Win). In that case the key bindings are broken.

This breaks key bindings for the following widgets:
 - Win (focus)
 - Image ("clicked")
 - Video (move, play)

This fixes key bindings for the following widgets:
 - Nstate

Some widgets remain broken:
 - Photocam / Efl.Ui.Image.Zoomable

A patch will be applied to restore the key bindings for the above
breaks.
2017-08-23 11:16:45 +09:00
Jean-Philippe Andre 069747b9de widget: Add eo event info inside widget_event
This is an internal function that should probably become an overridable
protected method, as it's required for proper event handling in widgets.
Next step: use eo_event_info in the widgets implementations. Then remove
legacy event struct.

Ref T5363
2017-08-23 11:16:45 +09:00
Marcel Hollerbach d4cd85aa55 efl_ui_focus_manager: split this of tinto a class and a interface
it turns out to be very handy to have a interface for the moving and
border elements, that is unconnected to the way of how widgets are
registering themself.

This for example enables us to get a simple focus manager that just
redirects the call into a internal 2 dimensional data struct
2017-08-10 20:55:50 +02:00
Jean-Philippe Andre dee61f4097 elm: Cleanup theme and style set functions
This makes efl_ui_layout_theme_set() return a Theme_Apply error
code. The type is now public as Efl.Ui.Theme.Apply.

Ref T5329
Ref T5363
2017-08-09 17:08:24 +09:00
Jean-Philippe Andre 6864495c99 elm: Move elm_layout_sizing_eval to legacy
elm_layout_sizing_eval() marks an object as requiring recalc.

Unfortunately, it's been massively abused by various widgets into
actually doing the calc, or the min calc. So we end up with one API
that has 3 different definitions depending on the widget type:
1. Mark as requiring recalc (correct, respects doc, elm_layout)
2. Calculate min size and other size hints
3. Actually do some geometry modification

I believe we need to clarify these 3 requirements into 3 very clear
and specific APIs in elementary. Right now we have similar functions
in evas for 1 (evas_object_smart_changed) and 3 (smart_calculate).
But their exact definition also isn't necessarily what we want for
elementary.

Another clear problem is that layout_eval does not do any calculation
(in theory), so the "eval" word is a bit of a stretch here.

Once we're sure about the exact API we want, we can add this back to
EO and make it work across our EO widgets. For now let's just keep
the legacy API, and its EO overrides, as is.

Ref T5315
2017-08-08 11:10:56 +09:00
Jean-Philippe Andre 242127a96b evas,edje,elm: Mark all legacy objects as such 2017-07-07 13:21:18 +09:00
Marcel Hollerbach 9600542547 elm_gengrid: remove duplicated code 2017-06-30 10:27:45 +02:00
Marcel Hollerbach f046394d0f elm_gengrid: refactor duplicated code
this brings the simple selection move into a single spot
2017-06-30 10:27:45 +02:00
Marcel Hollerbach 31c11925eb elm_gengrid: refactor single selection move 2017-06-30 10:27:45 +02:00
Marcel Hollerbach a7ca960025 elm_gengrid: refactor focus movement
This removes duplicated code and brings it into a smaller way more
readable function
2017-06-30 10:27:45 +02:00
Marcel Hollerbach 377311cd66 elm_gengrid: gengrid never sets the focus objects this is always NULL 2017-06-30 10:27:45 +02:00
Marcel Hollerbach 65feeb1b0b elm_gengrid: refactor reorder mode
Its breaking the logic down into 3 little functions that could be reused
later. Overall this reduces the code duplication
2017-06-30 10:27:45 +02:00
Mike Blumenkrantz 990a9d485d elm_list/genlist/gengrid: don't unselect items when moving the mouse out of them
this seems wrong since it's using smart object geometry to determine
event-based positioning within an edje object. considering it from a user pov,
it definitely is wrong because why would you deselect items based on mouse
movement?

ref D2622
ref da81eff897

@fix
2017-06-23 17:43:44 -04:00
Mike Blumenkrantz b4057ef6cc gengrid: implement reusable content based on genlist implementation
@feature
2017-06-23 17:43:44 -04:00
Jean-Philippe Andre ed41adf791 widget: Implement mirrored from Efl.Ui.Base
Ref T5363
2017-06-14 11:02:05 +09:00
Jean-Philippe Andre 06b14827b7 widget: Implement scale from Efl.Ui.Base 2017-06-12 11:50:30 +09:00
SangHyeon Lee dc98fd4f5e elm_gen : apply Elm_Theme_Apply enum return types for theme_object_get of item view.
elm_widget_theme_object_get now return Elm_Theme_Apply enum not bools.
only ELM_THEME_APPLY_FAILED case, need to re-apply default item edje.

Signed-off-by: SangHyeon Lee <sh10233.lee@samsung.com>
2017-06-02 10:32:07 +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
Amitesh Singh ecd89e0591 gengrid: fix the crash in _elm_gengrid_item_edge_check
_elm_gengrid_item_edge_check can have eo_it as NULL if none of widget item
is focused. This could happen if item_focus is not enabled on items.

test case: elm test -> gengrid 2 (enable only "focus hightligt set") and move focus.

@fix

Signed-off-by: Amitesh Singh <amitesh.sh@samsung.com>
2017-03-26 20:48:02 +05:30
Umesh Tanwar dd627324f9 Gengrid: Bring the item into view scope before swapping.
Summary:
The gengrid item should be into view scope while reordering the items.

@fix
Signed-off-by: Umesh Tanwar <umesh.tanwar@samsung.com>

Test Plan: elmementary_test -> gengrid 2 -> horizontal mode + reordering

Reviewers: singh.amitesh, cedric

Subscribers: cedric, atulfokk, jpeg

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

Signed-off-by: Amitesh Singh <amitesh.sh@samsung.com>
2017-03-26 20:26:15 +05:30
Vyacheslav Reutskiy 6723c3b1c3 gengrid: avoid call select callback twice in mode ELM_OBJECT_MULTI_SELECT_MODE_WITH_CONTROL
If multi select mode is ELM_OBJECT_MULTI_SELECT_MODE_WITH_CONTROL and
user code try unselect a item and select another part which not
realized select callback calls twice in this case. For avoid this no
needs focus newly selected item.

@fix
2017-03-17 09:10:13 +02:00
Umesh Tanwar d4dd0b20df Gengrid: Correct double comparision.
Summary:
 Use the more accurate EINA_DBL_EQ for double comparision.

@fix

Signed-off-by: Umesh Tanwar <umesh.tanwar@samsung.com>

Reviewers: singh.amitesh, cedric, jpeg, raster

Reviewed By: singh.amitesh

Subscribers: atulfokk, cedric, jpeg

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

Signed-off-by: Amitesh Singh <amitesh.sh@samsung.com>
2017-03-10 12:00:42 +05:30
Minkyu Kang e62d78d594 elementary gengrid: fix for working item reorder mode correctly
Summary:
Change the item indexing to start 1 after reordering animation.
Change the logic of edge checking to get the row or col correctly.

Signed-off-by: Minkyu Kang <mk7.kang@samsung.com>

Test Plan:
elementary_test -to gengrid2
append 6 items
enable the reorder mode
check reordering is working properly (4 to 1)

@fix

Reviewers: singh.amitesh, cedric

Subscribers: jehun.lim, jpeg

Differential Revision: https://phab.enlightenment.org/D4676
2017-02-21 15:18:11 +05:30
Jean-Philippe Andre af0d850a9d gengrid: Remove duplicated smart callbacks
WRN... evas_smart.c:219 evas_smart_cb_descriptions_fix() duplicated
  smart callback description with name 'item,focused' and type ''
2017-02-16 22:05:58 +09:00
Jean-Philippe Andre a568d26f72 evas & elm: Fix invalid uses of efl_data_ref(obj, NULL)
The data class should be specified for debug purposes.
Also, this fixes invalid uses inside the smart object
implementation where it assumed that the smart data was part
of the eo data. It may not (legacy objects).
2017-02-15 15:35:38 +09:00
Vyacheslav Reutskiy d37de735eb gengrid: fix serach items in genlist by text
If a part name is NULL get text for search from TEXT part 'elm.text".

@fix
2017-01-26 10:54:30 +02:00
SangHyeon Lee bec54fc870 gengrid : fix mirrored position calculate to apply pan width instead of object width
the pan object width can be different with object width,
because of padding and bar area, so we should using pan's width
instead of object width for mirrored calculation.

in elementary_test gengrid sample, you can see, when mirrored on,
the alignment is broken before merge this patch.

Signed-off-by: SangHyeon Lee <sh10233.lee@samsung.com>
2017-01-25 13:13:20 +09:00
SangHyeon Lee 30445b6ea6 gengrid: fix highlight bug in disabled item
Summary:
if item is disabled, item must be not highlighted by touch events.

Signed-off-by: SangHyeon Lee <sh10233.lee@samsung.com>
2017-01-10 13:59:46 +09:00
SangHyeon Lee 5284912511 gengrid: adding sizing eval when gengrid min size is changed
Adding sizing eval when gengrid min width and height is changed,
so need to re-evaluate properly.

Signed-off-by: SangHyeon Lee <sh10233.lee@samsung.com>
2017-01-04 14:46:50 +09:00
SangHyeon Lee e1b6e9b18a gengrid : enable layout sizing eval and content min limit feature in gengrid
Summary :
As the child of layout and scroll interface user,
gengrid need to support content min limit feature to set min size
by layout sizing eval.

Test Plan :
Set elm_scroller_content_min_limit to gengrid and get min size off
gengrid object.

Signed-off-by: SangHyeon Lee <sh10233.lee@samsung.com>
2017-01-03 17:35:39 +09: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
Shinwoo Kim e648f1e85e [elementary][atspi] change accessible description to char* from const char*
Summary:
The accessible name is char*, this could confuse API user.
If we provide user callback to get description, an user would return allocated string.
The usage of elm_interface_atspi_description_get/set should be same with elm_interface_atspi_name_get/set

Reviewers: lukasz.stanislawski, cedric, raster

Reviewed By: raster

Subscribers: stanluk, jpeg

Differential Revision: https://phab.enlightenment.org/D4378
2016-11-10 11:11:48 +09:00
Minkyu Kang a83643d134 elementary: gengrid - check the edge correctly
Summary:
The routine of checking edge of left side, divide position by row.
Since the result of fisrt item of last line is 1, that item was not checked as edge.
This patch is for fixing it.

Signed-off-by: Minkyu Kang <mk7.kang@samsung.com>

Test Plan:
elementary_test -to gengrid2
append items (about 6)
horizontal mode on and item loop enable
check item loop is working properly

Reviewers: cedric, jpeg, Hermet, SanghyeonLee

Subscribers: jehun.lim, SanghyeonLee, cedric, jpeg

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

Signed-off-by: Cedric Bail <cedric@osg.samsung.com>
2016-10-25 14:37:11 -07:00
SangHyeon Lee 73095ad7ad gengrid: support for non homogenous items
Summary:
Dimensions of gengrid items can be altered for
non homogenity.

Care must be taken however to set the homogenous
size for items using elm_gengrid_item_size_set().

In horizontal mode only the heights will change
and in vertical mode only the widths. Fixed dimension
will be as set with elm_gengrid_item_size_set().

This is forked by https://phab.enlightenment.org/D2422

Test Plan:
elementary_test -to "Gengrid Resized Items"
Current test program provides focus autoscroll
and item looping options.

Reviewers: raster

Subscribers: cedric, jpeg

Differential Revision: https://phab.enlightenment.org/D4330
2016-10-19 15:48:51 +09:00
Marcel Hollerbach 4b2d459783 gengrid: call this on the pam class not on the normal class
this fixes gengrid.
2016-10-13 16:27:38 +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
Jee-Yong Um 9f7ce792f0 elementary: remove unused SMART_NAME strings
Summary: Smart name strings are not used any more.

Reviewers: Hermet, cedric, jpeg

Differential Revision: https://phab.enlightenment.org/D4261
2016-09-01 11:33:04 +09: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
Jean-Philippe Andre 3b175fd7e9 elm: Fix some ERR messages following previous patch
This simply avoids calling functions on NULL objects, since
the previous patch would ERR out rather than silently ignore
the problem.

I just add explicit NULL checks before calling the functions,
so it's clear the object could be NULL (in the widget).
2016-08-26 17:15:05 +09:00