Commit Graph

50 Commits

Author SHA1 Message Date
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
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
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
Cedric BAIL 323000c83b elementary: clear callbacks before destroying object to avoid crash.
@fix

T3188
2016-07-06 10:39:23 -07:00
Daniel Juyung Seo 3627fa7883 elm/gengrid: Fix null pointer dereferences.
CID: 1357210 and 1357209.
2016-07-04 07:31:15 +09:00
Jehun Lim effe9b1696 gengrid: fix focus issue when prev/next item is disabled
Summary:
After setting focus to disabled item, focus does not work properly.
It is necessary to consider disabled state of each item
when selecting next focused item.

Signed-off-by: Jehun Lim <jehun.lim@samsung.com>

Test Plan:
1. elementary_test -to 'gengrid disabled item focus'
2. check 'item select on focus disable'
3. move focus to disabled item
4. observe focus and compare before this patch

Reviewers: cedric

Subscribers: minkyu, cedric, jpeg

Differential Revision: https://phab.enlightenment.org/D4115
2016-07-01 17:20:40 +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 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 b2355d7da3 Evas: Rename Selectable_Interface to Efl.Ui.Selectable 2016-06-10 18:06:15 +09:00
Jean-Philippe Andre 31c4fd1f7c Evas: Rename Scrollable_Interface to Efl.Ui.Scrollable 2016-06-10 18:06:15 +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
Tom Hacohen a6a2338962 Revert "Eo: Remove eo_del() and make eo_unref() the replacement."
This reverts commit 546ff7bbba.

It seems that eo_del() is useful and removing it was creating bugs.
The issue is that the way we defined parents in eo, both the parent and
the programmer share a reference to the object. When we eo_unref() that
reference as the programmer, eo has no way to know it's this specific
reference we are freeing, and not a general one, so in some
circumstances, for example:
eo_ref(child);
eo_unref(child); // trying to delete here
eo_unref(container); // container is deleted here
eo_unref(child); // child already has 0 refs before this point.

We would have an issue with references and objects being freed too soon
and in general, issue with the references.

Having eo_del() solves that, because this one explicitly unparents if
there is a parent, meaning the reference ownership is explicitly taken
by the programmer.

eo_del() is essentially a convenience function around "check if has
parent, and if so unparent, otherwise, unref". Which should be used when
you want to delete an object although it has a parent, and is equivalent
to eo_unref() when it doesn't have one.
2016-06-01 13:33:21 +01:00
godly.talias afb4a194a8 Added feature to bring focused item to viewport on click
Summary:
Currently when an item in gengrid is focused and if it is scrolled
off the viewport halfly and if it user clicks on it, it won't be
scrolled into viewport. Only non-focused items will be scrolled into
viewport when clicked.

Test Plan:
elementary_test -> Gengrid focus -> Click an item ->
           Scroll it little bit out of viewport -> Click again

Reviewers: prince.dubey, shilpasingh, cedric, raster, SanghyeonLee

Subscribers: seoz, rajeshps, govi, jpeg

Differential Revision: https://phab.enlightenment.org/D3977
2016-05-30 14:39:37 +09:00
Tom Hacohen 546ff7bbba Eo: Remove eo_del() and make eo_unref() the replacement.
We used to have eo_del() as the mirrored action to eo_add(). No longer,
now you just always eo_unref() to delete an object. This change makes it
so the reference of the parent is shared with the reference the
programmer has. So eo_parent_set(obj, NULL) can free an object, and so
does eo_unref() (even if there is a parent).

This means Eo no longer complains if you have a parent during deletion.
2016-05-17 16:23:23 +01:00
Cedric BAIL c2a1c49ab2 elementary: move all legacy files to their expected new location. 2016-03-23 13:24:41 -07:00