Commit Graph

96 Commits

Author SHA1 Message Date
Marcel Hollerbach 11da918983 Replace strncmp code
the structure "!strcmp(X, "foo", strlen("foo"))" is equal to
"eina_has_prefix(X, "foo")", and the later is nicer to read, hence this
replaces it.

Reviewed-by: Stefan Schmidt <stefan@datenfreihafen.org>
Reviewed-by: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Differential Revision: https://phab.enlightenment.org/D11620
2020-04-03 14:51:11 +02:00
Mike Blumenkrantz 01fc7eae35 elm: fix macro for group_calc function naming
this should be efl_canvas_group_group_calculate to match eolian function
naming

no functional changes

Reviewed-by: Marcel Hollerbach <mail@marcel-hollerbach.de>
Differential Revision: https://phab.enlightenment.org/D9685
2019-08-23 07:33:52 +02:00
Carsten Haitzler b0ad81d927 elm ctxpopup - be consistent with scope data checks
makes coverity happy.

CID 1403898
2019-08-11 12:47:38 +01:00
Mike Blumenkrantz 7e517e2a11 elm/efl_ui: remove elm_layout_sizing_eval implementations
Summary:
historically there have been two methods of calculating sizes in elm:
* elm_layout_sizing_eval
* evas_object_smart_calculate (now efl_canvas_group_calculate)

the former was used to set size hints on widgets, while the latter was
used to perform internal size calcs for the widget. for things to
work correctly, these functions had to be triggered in just the right
order at just the right time. many hard-to-fix bugs related to widget
sizing over the years have been the result of this split

this patch removes elm_layout_sizing_eval implementations so that all
widgets perform both internal size calcs and size hint setting all
in the same function, ensuring that these are always in sync

the result is that in the vast majority of cases, far fewer recalcs
happen for widgets, and they are quicker to achieve their final size

Depends on D9438

Reviewers: bu5hm4n

Reviewed By: bu5hm4n

Subscribers: bu5hm4n, cedric, #reviewers, #committers

Tags: #efl_widgets

Maniphest Tasks: T8059

Differential Revision: https://phab.enlightenment.org/D9439
2019-07-30 13:12:52 -04:00
Mike Blumenkrantz 62d4d4c5b8 elm/ctxpopup: check list existence before trying to delete list items
this is kinda gross, but if the list is already deleted then the list
items are also gone and this is an invalid object access

@fix

Reviewed-by: Marcel Hollerbach <mail@marcel-hollerbach.de>
Differential Revision: https://phab.enlightenment.org/D9402
2019-07-29 16:06:19 +02: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
Marcel Hollerbach ccbc27f24d efl_ui_widget: remove widget_parent overwritting
before the widget_parent have been only set once. The call to the set
was in the constructor and carried the efl_parent. In the next commit
widget_parent is getting a refactor, which gives it more meaning, where
it is actaully called, which means, the behaviour will change. In order
to not break every existing usage of the here changed widgets, we move
the code to the constructor, and feed it with the efl_parent, just like
before.

Differential Revision: https://phab.enlightenment.org/D8041
2019-03-09 11:12:25 +01:00
Mike Blumenkrantz 441049ea2d elm_ctxpopup: 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/D8163
2019-03-07 14:15:05 -08:00
Mike Blumenkrantz 9a361ac917 efl_access_object: remove all legacy usage from eo files
this takes the current generated output from eolian for legacy code in
evas 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/D8131
2019-03-06 13:03:02 -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
Marcel Hollerbach 98b4a7bfa7 elementary: remove unnecessessary disabled setter
summary_:
those objects are disabled anyways, because disabled is applied to the
objects in a tree. Which means, subobjects of a widget are disabled
whenever the widget is disabled anyways.

Depends on D8015

Reviewers: cedric, zmike, segfaultxavi, stefan_schmidt

Reviewed By: segfaultxavi

Subscribers: cedric, #reviewers, #committers

Tags: #efl

Reviewed-by: Xavi Artigas <xavierartigas@yahoo.es>
Differential Revision: https://phab.enlightenment.org/D8016
2019-02-27 20:19:22 +01:00
Marcel Hollerbach 5235f1da85 efl_ui_widget: remove focused_item
focused_item is only used in item containers. This API is now moved into
a widget item container, which *can* have a focused item.

ref T7553

Reviewed-by: WooHyun Jung <woohyun0705@gmail.com>
Differential Revision: https://phab.enlightenment.org/D8013
2019-02-25 10:37:44 +01:00
Xavi Artigas 6b7346b7b2 Remove individual class BETA guards
Summary:
Eolian adds a per-class BETA guard (like EFL_UI_WIN_BETA) to any method tagged
as @beta. This means that any app (and the EFL code) wanting to use BETA features
has to enable them class by class, which is cumbersome.
This commit replaces the individual guards with the global EFL_BETA_API_SUPPORT
guard, so apps only need to define one symbol to access BETA features.

Any usage of the per-class guards has been removed from the EFL code and examples.
When building EFL the global guard is defined by configure, so all EFL methods
already have access to BETA API.
Efl_Core.h and Efl_Ui.h no longer define EFL_BETA_API_SUPPORT. Apps wanting to
use BETA API have to define this symbol before including any EFL header
(It has been added to the examples requiring it).

Test Plan:
make && make check && make examples still work, but there's a lot less #defines
in the code

Reviewers: zmike, bu5hm4n, q66

Reviewed By: q66

Subscribers: cedric, #reviewers, #committers

Tags: #efl

Maniphest Tasks: T6788

Differential Revision: https://phab.enlightenment.org/D7924
2019-02-13 18:09:17 +01:00
Cedric BAIL 88dbd866e0 elementary: rename Efl.Ui.Translatable -> Efl.Ui.L10n
If we are to choose Efl.Ui.I18n for the internationalization support, the localization API
should be named accordingly L10n.

Reviewed-by: Xavi Artigas <xavierartigas@yahoo.es>
Differential Revision: https://phab.enlightenment.org/D7507
2019-01-02 11:03:53 -08:00
Chris Michael 554573eaa9 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
junsu choi 9f2d1ae6ca ctxpopup: Add return value check
Summary:
Using elm_widget_theme_object_set without checking return value.
so add return value check and log message

Test Plan: N/A

Reviewers: herb, cedric, Hermet

Reviewed By: Hermet

Subscribers: Hermet, #reviewers, #committers

Tags: #efl

Differential Revision: https://phab.enlightenment.org/D7072
2018-09-21 19:33:10 +09:00
Mike Blumenkrantz 7a538cbc4a elm/ctxpopup: check for content object before removing callbacks during del
Summary: ref T7030

Reviewers: devilhorns

Reviewed By: devilhorns

Subscribers: cedric, #committers

Tags: #efl

Maniphest Tasks: T7030

Differential Revision: https://phab.enlightenment.org/D6541
2018-07-09 16:53:24 -04:00
Cedric BAIL a098ee4460 elementary: ctxpopup is using legacy Elm.List which use legacy Elm.Object.Item, fix accordingly. 2018-05-24 16:02:21 -07:00
Cedric BAIL 8a513a522e efl: major rewrite of efl_part.
The interface efl_part_get should not be directly called from C, but the efl_part
wrapper should. It rely on efl_noref to properly destroy the object. Binding can
control the lifecycle of the reference the way they want by either calling the
wrapper or efl_part_get directly. It also means that the ugly ___efl_auto_unref_set
doesn't need to be exposed outside of EFL anymore.

Differential Revision: https://phab.enlightenment.org/D6098
2018-05-24 16:02:18 -07:00
Cedric BAIL b265c5c887 elementary: make del_pre not return a bool and force rely on Eo ref counting.
Differential Revision: https://phab.enlightenment.org/D6071
2018-05-24 16:02:18 -07:00
Marcel Hollerbach 0090384ef5 elm_ctxpopup: prevent a giant load of errors
Summary:
i)  There have been 2 sorts of errors, first the items have been deleted
    after the list was deleted, thus the list items have already been
    destructed. which lead to the error as the popup items destroyed the list
    items on destruction as well.

ii) sd->box was attached to the ctxpopup when getting into group_del the
    box has already been destroyed by the cleanup logic.

Subscribers: cedric, zmike

Tags: #efl

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

Reviewed-by: Cedric BAIL <cedric@osg.samsung.com>
2018-05-24 16:02:17 -07:00
YeongJong Lee 495edbd995 elm: fix backward compatibility for "default" name part
Summary:
If you use legacy content/text set/get/unset with "default" part name,
_elm_layout_part_aliasing_eval change the part name to "elm.swallow.content".
Because internal _content_set/get/unset checked only "default" string,
legacy content/test set/get/unset with "default" part name was not working.
This patch fixes that bug.

Test Plan: elm_object_part_content/text_set(obj, "default", content)

Reviewers: Jaehyun_Cho, woohyun

Reviewed By: Jaehyun_Cho

Subscribers: cedric, zmike

Tags: #efl

Differential Revision: https://phab.enlightenment.org/D6185
2018-05-23 19:35:18 +09:00
Xavi Artigas 9dcc31ed4a Efl.Access.Object (from Efl.Access)
Ref https://phab.enlightenment.org/T6847

Reviewed-by: Cedric Bail <cedric@osg.samsung.com>
2018-04-24 09:03:24 -07:00
Daniel Kolesa fcae7cab27 eolian gen: enable constness generation on property getter impls
This changes a lot of things all across the EFL. Previously,
methods tagged @const had both their external prototype and
internal impl generated with const on object, while property
getters only had const on the external API. This is now changed
and it all has const everywhere.

Ref T6859.
2018-04-17 20:31:55 +02:00
SangHyeon Lee 9c8ebc9dfc elm_menu, toolbar, ctxpopup : remove unnecesary interface efl_ui_item and efl_ui_menu
Summary:
Legacy menu toolbar and ctxpopup are not new efl interface widget,
but it have efl interfaces, efl_ui_item and efl_ui_menu.
if we plan to implement this two, it should be a class not a interface,
so I remove it on legacy widget.

Subscribers: cedric

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

Reviewed-by: Cedric BAIL <cedric@osg.samsung.com>
2018-04-16 11:03:02 -07:00
Mike Blumenkrantz f45e972c8c Elm.Widget.Item: focus -> item_focus 2018-02-15 13:11:00 -05:00
Mike Blumenkrantz 5263f311f4 efl_widget_item: remove 'del'
this now uses regular efl_del
2018-02-15 13:11:00 -05:00
Amitesh Singh 44d3227beb widget: rename elm widget to Efl.Ui.Widget. 2018-01-08 21:28:10 +09:00
Jaehyun Cho 4b18e754de elm_part_helper: Change macro name for default content part 2017-11-29 13:43:21 +09:00
Lukasz Stanislawski 2f294aeb88 elm: add "activate" action to ctxpopup items
Summary: Change-Id: I0974c3bec02a05d3d46d7cc0fd86572e32248a3b

Subscribers: jenkins, cedric, jpeg

Differential Revision: https://phab.enlightenment.org/D5493
2017-11-20 12:03:29 +09:00
Jean-Philippe Andre e9ebe5c676 elm: Define and rename internal atspi struct in EO
This thing is used by only 2 EO APIs that are marked as @beta. I wonder
if the @beta tag or the ptr() expression made it work for eolian,
because it simply wasn't defined in EO.

I'm renaming it just so that it's more consistent with the new names
used by atspi (and EO API in general).
2017-11-16 12:00:18 +09:00
Lukasz Stanislawski c838e30a24 elm: Rename elm_interface_atspi_widget_action mixin
Reviewers: jpeg

Subscribers: jenkins, cedric, jpeg

Differential Revision: https://phab.enlightenment.org/D5400
2017-11-16 12:00:18 +09:00
Godly T.Alias 67313bf8aa CtxPopup: Add implementation for getting focused item
Summary:
Adding the focused_item_get implementation for ctxpopup widget for
getting the focused item

Signed-off-by: Godly T.Alias <godlytalias@yahoo.co.in>

Test Plan: elm_object_focused_item_get

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

Reviewed By: shilpasingh

Subscribers: Jaehyun_Cho, Blackmole, jpeg, rajeshps, shilpasingh

Differential Revision: https://phab.enlightenment.org/D5474
2017-11-15 19:29:00 +09:00
JinYong Park d96f3bb4f3 Ctxpopup: resizing ctxpopup after its content is removed
Summary:
When ctxpopup's content is removed,
ctxpopup doesn't recalculate its size, so empty space is remaind.
To fix this problem, ctxpopup recalculate its size when content is removed.
This patch is about T6327

@fix

Test Plan:
1. run elementary_test -to ctxpopup
2. select 10st item
3. click button in ctxpopup

Reviewers: jpeg, Jaehyun_Cho, zmike

Subscribers: cedric

Differential Revision: https://phab.enlightenment.org/D5462
2017-11-15 16:46:01 +09:00
Jean-Philippe Andre d39bbc1491 elm: Create legacy widgets with elm_legacy_add
This will be used to solve issues around style_set:
if the widget is legacy or pure eo we may need to select a different
style. So in the constructor we need to know whether we are legacy or
eo. Note that calling style_set in finalize only is too late as we would
lose information such as efl_text_set() called inside efl_add().
2017-11-07 14:50:31 +09:00
Jean-Philippe Andre 824792f09d elm: Major cleanup of EO files
This prevents legacy EO classes from being exposed through .eo.h headers
or .eo in share/eolian/includes. Also removes a slew of useless xxx_eo.h
intermediate headers.

Notes:
 - elm_systray has no proper API: it's not clear if the EO API should be
   released (in which case it needs to be renamed to efl_something) and
   there is no legacy API to create a systray object.
 - Some files have been placed in a "FIXME" section, as I believe they
   are necessary within EO land, but at the same time still don't
   conform to the interfaces (eg. name starts with elm_).
 - elm_interface_scrollable is required by photocam. This means photocam
   needs to be adapted to fit the EO scroller API (still to be
   completed, I believe).

Bugs:
 - This breaks most C++ examples. I KNOW. And I'm working on it.

Ref T5301
2017-11-01 21:23:31 +09:00
Jean-Philippe Andre 2f465e1fbb widget: Rename EO APIs to efl_ui_widget_xxx
This only changes the eo_prefix for APIs.

Ref T5363
2017-10-24 14:30:21 +09:00
Lukasz Stanislawski 57aefc53c1 elm: rename Elm_Interface_Atspi_Accessible interface
Subscribers: cedric, jpeg

Differential Revision: https://phab.enlightenment.org/D5341
2017-10-19 10:13:54 +09:00
Marcel Hollerbach 6ba107b899 elm: introduce efl_ui_focus_layer
what it does is described in the mixin

this commit refactors inwin hover popup ctxpopup to use that behaviour.
Since it should do exactly that.
2017-10-10 19:28:47 +02:00
Jean-Philippe Andre e9dfcb44ff widget: Implement translation API in layout
This moves the API entry points from Widget to Layout parts. I don't
think the other widgets support translation, but that is easy to fix.
The actual code implementation remains in elm_widget.c.

Legacy-only widgets are covered by Part_Legacy, while all EO widgets
that have text inherit from Layout (except Win but I don't think the
window title was translatable in legacy).

This removes 2/3 remaining part APIs from Widget.

Ref T5363
2017-09-26 17:58:07 +09:00
Jean-Philippe Andre 839c4ed395 elm: Introduce interface Efl.Ui.Translatable
This will be used to replace the part translation API in Elm.Widget. It
should work for both parts and non-parts (ie. the main text of a button,
for instance).

For now I'm taking the following approach:
 - All efl_text_set/get strings are untranslatable, i.e. get() returns
   the visible string, set replaces and can not be translated.
 - translatable_text_set/get needs to be used to enable automatic
   translation, which in turns calls efl_text_set to modify the visible
   string. Thus, translatable applications will have to use
   efl_ui_translatable_text_set a lot more than efl_text_set, unless
   they translate strings application-side.

Note that some other frameworks take a simpler approach equivalent to
calling efl_text_set() with an already translated text. This prevents
runtime language changes of the application, unless the application
handles them specifically.
2017-09-26 17:58:07 +09:00
Jean-Philippe Andre 0339ad7740 elm: Move base implementation for efl_part in widget
This means that ALL part handles inherit from the base part class
Efl.Ui.Widget.Part. Layout is the only exception where Efl.Part is
specially overridden.

This is a first step towards generic part APIs, including background in
all widgets.
2017-09-21 12:27:33 +09:00
Jean-Philippe Andre a72f3ec64e efl: Use Eina.Size2D for size hint combined min
For this patch I decided to add a pseudo legacy wrapper as the function
is called in a very large number of places. Fixing all those calls to
use the size2d form is a lot of work and a greater risk of b0rking
something.
2017-09-18 16:33:33 +09:00
Jean-Philippe Andre 0c46fc7103 evas: Use Eina_Rectangle internally
Instead of Evas_Coord_Rectangle which is exactly the same thing but with
a different name and typedefs.
2017-09-13 18:03:34 +09:00
Jean-Philippe Andre d5a31f3f30 edje/elm: Rename _internal_ to _part_ (EO)
In Edje and Elementary, we have part objects, which are what is returned
by the interface efl_part(). Those objects can't be of an opaque type as
this doesn't work nicely with strongly typed languages such as C++ or
C#. In JS, Lua, C the types are weak and mostly runtime-based so it
doesn't matter much.

As a consequence, the documentation and the types need to look nice in
this EO API. Thus, we remove the abusive term "internal" and explicitly
call all those classes "part" something.

Eventually we want the types to be declared in the EO file so bindings
(C#, C++, ...) can generate the proper access methods, returning the
best possible types.

Note that right now a few of those part types are used in the legacy API
but don't actually need to be exposed externally.

This is kind of a mega commit that does all the renaming at once, but
it's really just a big sed operation. The power of good IDEs :)

Ref T5315
Ref T5306
2017-09-13 13:53:49 +09:00
Jean-Philippe Andre e4a440797b ctxpopup: Avoid safety error on call on null obj
See 6aa309ffb8
2017-09-13 09:57:05 +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 f90d0d1501 widget: Simplify & document "translate"
This is a protected function. It doesn't need to return anything, as all
implementation just returned true, always. Also, the legacy API was just
a wrapper doing nothing special (except verify that we have a widget,
which the recursive code already does).

Tested with fr_FR :)

Ref T5363
2017-08-30 18:54:59 +09:00