Commit Graph

19 Commits

Author SHA1 Message Date
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
Jean-Philippe Andre 001fa5af11 edje: add invalid part handler 2018-01-16 19:35:54 +09:00
Amitesh Singh 54ae9cc18b edje: rename Edje.Object to Efl.Canvas.Layout 2017-12-06 13:12:29 +09:00
Jean-Philippe Andre 79a1fd94ee edje: Use EO's beta auto_unref API for parts
This simplifies code and avoids unwanted leaks.
2017-10-18 11:02:16 +09:00
Jean-Philippe Andre 419f3935c6 edje: Add part_type_get API
For now I made this EO-only but this definitely could be expose in
legacy API as well.

This simply gives exact information about the type of part, after doing
a recursive search. Edit Edit doesn't do a recursive search, only a
direct one, which can yield invalid results (eg. RECT or NONE instead of
TEXT in case of "elm.units.max" for a slider).

@feature
2017-09-21 12:28:20 +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 13da5e980e efl_gfx: Use Eina.Rectangle for geometry (EO)
This saves a few lines already (without even having the proper helpers
for stack rectangles).
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 ff96e30c72 edje: Better debug logs for invalid calls to swallow
These error messages will be triggered when efl_part() is used, and the
part is not a swallow part.
2017-09-08 09:50:48 +09:00
Jean-Philippe Andre e65e90a660 edje: Fix part reuse, fixes make check
An error was spotted when using an efl_part() handle for more
than one call (valid if you do efl_ref on the handle).

Thanks @stefan for the report!
2017-06-28 17:18:21 +09:00
Jean-Philippe Andre 56a74238d1 edje: Improve error report with efl_part misuse
This improves a rare error message when a function is called on an
efl_part() that does not implement it. Example: calling a swallow
function on a non-swallow part.

This isn't entirely fool-proof but should already help quite a bit.

This also changes how the efl_part proxies are stored: the variable
is not reset to NULL every time we use it, instead we check it in
the del intercept.

Note: _part_reuse_error() can not be enabled inside
_internal_proxy_get because there are valid use cases such as:

  func1(efl_part(obj, part), func2(efl_part(obj, part), ...), ...)

Here we use two efl_part() at the same time, on the same object,
but we haven't entered "func1" yet when we are reaching the second
call to efl_part(). This is completely valid and there is pretty
much no way to detect this.

I think I will improve this later with a core function on
Efl.Object like "debug_string".

Ref T5584
2017-06-22 16:16:21 +09:00
Daniel Hirt 6e1b5fdd10 Canvas layout: port part_text to efl_part
You now use the following:

  efl_text_set(efl_part(edje_obj, "part"), "text");
  const char *text = efl_text_get(efl_part(edje_obj, "part"));

The former method of edje_object_part_text_set/get is now legacy.

Also, adjusted 'tests/emotion/emotion_test_main-eo.c' with
this change.
2017-06-12 00:10:04 +03:00
Jean-Philippe Andre f767e8bea4 edje: Move part drag APIs to efl_part
This moves all part_drag APIs to legacy and implements them for
EO using efl_part(). All parts now support these APIs, even if
they are not draggable. Making this more fine grained would
probably be much extra work for little gain.

This creates a new interface Efl.Ui.Drag.
2017-05-31 15:41:20 +09:00
Jean-Philippe Andre 63518c4c2c edje: Implement part proxy for all parts
This is required for part_state_get, which is now based
on the EO API internally. This fixes the test case introduced
in the following commmit.
2017-05-30 13:54:35 +09:00
Jean-Philippe Andre 554dd9facf edje: Move external_param_set to a efl_part API
This adds a new class: Efl.Canvas.Layout.External.
I hate this long name...

This class represents an external part, and for now only
supports param_set/get as well as param_type_get. For now
param_type_get() still returns an Edje_External_Param_Type and
not another more generic type.

TODO: enumerate choices, return object, return content
2017-05-30 13:54:34 +09:00
Jean-Philippe Andre 11d4daf90a edje: Move part_state_get to efl_part 2017-05-29 10:49:17 +09:00
Jean-Philippe Andre da2a7e6587 edje: Implement part_geometry_get with Efl.Part
This refactors even more the edje part eo internals. But now
common part APIs can easily be implemented in edje_part.c

The API now looks like:
  efl_gfx_geometry_get(efl_part(edje, "part"), &x, &y, &w, &h)
2017-05-29 10:49:17 +09:00
Jean-Philippe Andre 42403cd3df edje: Refactor a bit internal parts for edje objects (EO)
1. Make internal part "real_part_set" an internal function (EO)
2. Use a common class rather than an interface:
  - Cost: 1 extra call to efl_data_scope_get() as we don't have
    the data inside the EO function call implementation.
  - Gain: Ability to implement common code, such as part_geometry_get
2017-05-29 10:49:17 +09:00
Daniel Hirt 03856913c2 Edje containers: split logic
This splits the current Efl.Part implementation for the edje container
objects. These are now split to a edje_part.c, edje_part_helper.h and
separate sources for swallow, box and table.

It's going to make things a bit easier for porting the rest of the
logic.
2016-11-10 18:23:21 +02:00