Commit Graph

1040 Commits

Author SHA1 Message Date
Marcel Hollerbach 14b6f23cb3 eo: there is no need to count callbacks here
we are going to add this description anyways, no need to count here
again. I think this is not really making anything really faster, its
more keeping things consistance.

Reviewed-by: Cedric BAIL <cedric.bail@free.fr>
Differential Revision: https://phab.enlightenment.org/D10689
2019-11-20 10:15:21 +01:00
Cedric BAIL 75301b3a1a eo: do not over compute the hash when propagating events.
This should slightly improve speed in theory. In practice, I have not seen
a benchmark which would budge by 5%, so I am not sure it improve speed that
much.

Reviewed-by: Marcel Hollerbach <mail@marcel-hollerbach.de>
Differential Revision: https://phab.enlightenment.org/D10660
2019-11-17 12:12:28 +01:00
Cedric BAIL 6d20f32cef eo: no need to oversize type.
Reviewed-by: Marcel Hollerbach <mail@marcel-hollerbach.de>
Differential Revision: https://phab.enlightenment.org/D10659
2019-11-17 12:12:26 +01:00
Cedric BAIL c355616043 eo: refactor shortcut for EFL_EVENT_DESTRUCT event.
Reviewed-by: Marcel Hollerbach <mail@marcel-hollerbach.de>
Differential Revision: https://phab.enlightenment.org/D10658
2019-11-17 12:12:23 +01:00
Daniel Kolesa 9ca573f40f eo: fix UB in the eo event code (edje_cc hangs etc.)
Today I started experiencing mysterious hanging of edje_cc
during build. "The French are at it again" I thought, and
after spending a while bisecting, I found the culprit.
It's 7f53d91583.

So, what is happening in here?

The idea here was fundamentally sound; compute a special
hash value for event descriptors, taking range between 0
and 63 (on 64-bit systems) and 0 and 31 (on 32-bit systems),
then use a mask sized 32-bit or 64-bit (depending on your
system) and check early if to bail out from callback_call,
saving some resources. So far so good.

The problem is in the way the mask is handled. We're applying
the hash as the shift value like, `x |= (1 << hash)`. On 32-bit
systems this is okay, but on 64-bit systems, C's dumb silent
coercion rules kick in, since the left side of the expression
is 1, a literal with type signed int; that means our shifting
range is limited to 31 and what we get is... undefined behavior.

This is obviously not what we want, so take a 1ULL value as a
base. The previous thing seemingly worked on x86_64 (nobody
reported any issues) and interestingly it worked for me too
for a while (on ppc64le), but undefined behavior can be
unpredictable, so...

This shouldn't need a commit message as long as this, but I'm
making it proportional to the amount of time I wasted on this.
2019-11-14 04:18:46 +01:00
Cedric BAIL 620dd43db2 eo: make sure to return the right value for efl_event_callback_call.
EINA_FALSE is to be returned only if one of the callback did call
efl_event_callback_stop not if their was no callback called.

Reviewed-by: Marcel Hollerbach <mail@marcel-hollerbach.de>
Differential Revision: https://phab.enlightenment.org/D10620
2019-11-07 22:24:07 +01:00
Marcel Hollerbach 1a621c9109 eo_base_class: move shift init to the first call
Summary:
this cannot be evalulated in compile time, so this must be evalulated in
runtime, at the first call.

This should fix OSX build.

Co-authored-by: Cedric Bail <cedric.bail@free.fr>

Reviewers: zmike, cedric, raster

Reviewed By: zmike

Subscribers: #reviewers, #committers

Tags: #efl

Differential Revision: https://phab.enlightenment.org/D10582
2019-10-31 12:48:27 -04:00
Cedric Bail ff14c84fcb eo: add debug ability to detect long chain of event handler.
Reviewed-by: Marcel Hollerbach <mail@marcel-hollerbach.de>
Differential Revision: https://phab.enlightenment.org/D10484
2019-10-31 14:52:56 +01:00
Cedric Bail db93501e66 eo: reduce memory use to track event registration and callback call.
Reviewed-by: Marcel Hollerbach <mail@marcel-hollerbach.de>
Differential Revision: https://phab.enlightenment.org/D10482
2019-10-31 14:52:52 +01:00
Cedric Bail 474b1b2c2d eo: add infrastructure to attach an Eina_Future_Scheduler to any source of event.
Reviewed-by: Marcel Hollerbach <mail@marcel-hollerbach.de>
Differential Revision: https://phab.enlightenment.org/D10480
2019-10-31 14:52:46 +01:00
Cedric Bail 2401dae848 ecore: remove unecessary field in data structure.
Reviewed-by: Marcel Hollerbach <mail@marcel-hollerbach.de>
Differential Revision: https://phab.enlightenment.org/D10476
2019-10-31 14:52:35 +01:00
Cedric Bail 7f53d91583 eo: prevent unecessary callback call walk.
This patch introduce a small hash (64 or 32bits) that cache all existing
Efl_Event_Description callback handler registered on an object. It slightly
reduce the time needed to do an unecessary call and cost just a few bytes
per object.

Reviewed-by: Marcel Hollerbach <mail@marcel-hollerbach.de>
Differential Revision: https://phab.enlightenment.org/D10475
2019-10-31 14:52:31 +01:00
Mike Blumenkrantz 8218fb0e20 eo: block "invalidate" event emission when there are no subscribers
Summary:
this should be handled like the rest of eo internal events

ref T8321
Depends on D10353

Reviewers: bu5hm4n, cedric

Reviewed By: bu5hm4n, cedric

Subscribers: cedric, #reviewers, #committers

Tags: #efl

Maniphest Tasks: T8321

Differential Revision: https://phab.enlightenment.org/D10354
2019-10-14 09:29:30 -04:00
Daniel Kolesa 71c83d2005 efl: add code to enforce presence of @since tags
This is not yet enabled because there's too many instances where
this is broken.

Ref T7704
2019-09-30 20:12:35 +02:00
Xavi Artigas 3b53749149 docs: Typos in Efl.Object 2019-09-23 10:41:46 +02:00
Marcel Hollerbach 21fe2bdc41 eo: custom created legacy events should be unfreezable
a while back we have moved event submission from custom lists to eo
events. We also merged together the freeze and thaw functions, however,
this brought up one bug. smart_callbacks and the likes (those that used
custom lists before) are not effected by the legacy freeze and thaw
functions. This means, we should declare these legacy wrapper objects
unfreezable in order to obtain this behaviour.

Reviewed-by: Cedric BAIL <cedric.bail@free.fr>
Reviewed-by: SangHyeon Jade Lee <sh10233.lee@samsung.com>
Differential Revision: https://phab.enlightenment.org/D10016
2019-09-19 14:37:21 -07:00
Xavi Artigas 8c09c1cae8 docs: Move property docs to property level instead of set/get
Eolian @properties should be documented at the property level, and
documentation at the setter or getter level should be left to setter-
or getter-specific comments. There is usually no need at all to have
setter- or getter- specific comments.
Also, a property is not a method so descriptions should match that.

This patch removes lots of duplicated text, and will allow enabling
by default the eolian check that ensures that properties have proper
property-level docs.

No functional changes.
2019-09-13 12:30:03 +02:00
Marcel Hollerbach 84487d8257 efl_object: insert @ to link docs proberly
Summary: Depends on D9919

Reviewers: segfaultxavi

Reviewed By: segfaultxavi

Subscribers: cedric, #reviewers, #committers

Tags: #efl

Differential Revision: https://phab.enlightenment.org/D9920
2019-09-12 13:26:24 +02:00
Xavi Artigas 96d8b9bc3e docs: nicer formatting of the NULL keyword, everywhere 2019-09-10 16:05:44 +02:00
Daniel Kolesa 31658e6e14 efl: replace usage of ptr() in all stable APIs 2019-09-10 14:29:06 +02:00
Daniel Kolesa 4f4b58bf4c efl: change all occurences of @owned to @move 2019-09-06 17:01:05 +02:00
Xavi Artigas dc05cbbee8 docs: Fix typos and wrap EO files to 120 chars
As per our style guide:
https://www.enlightenment.org/contrib/docs/eo-guide.md
2019-09-02 16:24:26 +02:00
Daniel Kolesa 9c018613ee eolian: drop @cref
In the end this was just a failed experiment that didn't turn
out to be practical. For now, revert back to ptr(const(T)) until
a proper replacement for pointer syntax is added.
2019-08-29 13:58:16 +02:00
WooHyun Jung cfc1d3d38b efl_object: set @beta to name_find
This property should not be used by application developers
with current status.
There is no way to trace child objects from parents, because
many codes are internally calling efl_parent_set.

Reviewed-by: Marcel Hollerbach <mail@marcel-hollerbach.de>
Differential Revision: https://phab.enlightenment.org/D9768
2019-08-28 18:08:32 +02:00
Vincent Torri 01b987df59 make mman.h private
Summary:
integrate mman.h to make Evil private to the EFL, as mman.h does not exist on Windows. After a discussion with raster, i include sys/mman.h only on non Windows platform.

One issue, though, is that src/modules/emotion/generic/Emotion_Generic_Plugin.h has inlined functions using mmap()

Test Plan: compilation on Windows

Reviewers: cedric, raster, zmike

Subscribers: #reviewers, #committers

Tags: #efl

Differential Revision: https://phab.enlightenment.org/D9542
2019-08-19 09:55:13 -04:00
Daniel Kolesa 8a8a833837 eolian: rename @class on methods to @static
Ref https://phab.enlightenment.org/T8118
Ref https://phab.enlightenment.org/T7675
2019-08-16 16:27:00 +02:00
Boris Faure cdb920ab08 get rid of shadow variables
Summary: gl: add some EINA_FALLTHROUGH

Reviewers: #reviewers, zmike

Reviewed By: zmike

Subscribers: zmike, cedric, #reviewers, #committers

Tags: #efl

Differential Revision: https://phab.enlightenment.org/D9525
2019-08-08 17:18:46 -04:00
Daniel Kolesa d964a04da1 eo: remove Efl_Event definition (replace with builtin) 2019-07-26 13:21:14 +02:00
Marcel Hollerbach 3eb7b3793b eolian: start to express ownership transfere
before @owned was not even expressed in the api definitions of the
generated APIs, this adds support for it.

@owned is now expressed with EFL_TRANSFER_OWNERSHIP in a arguments. And
that preprocessor directive is documented.

Reviewed-by: Daniel Kolesa <daniel@octaforge.org>
Differential Revision: https://phab.enlightenment.org/D9369
2019-07-23 18:09:36 +02:00
Marcel Hollerbach a0952b0c01 eo: add helper for checking the ownable state
if a object is ownable, then there is one free reference. If not, a
error will be printed.

Reviewed-by: Cedric BAIL <cedric.bail@free.fr>
Differential Revision: https://phab.enlightenment.org/D9332
2019-07-19 10:54:57 -07:00
Cedric BAIL 9e6d3b44e6 eo: add ability to register provider on the Eo object directly.
This should reduce the need for custom implementation of efl_object_provider_bind.
It also enable the ability to register provider from user code on any Efl_Object.

Reviewed-by: Marcel Hollerbach <mail@marcel-hollerbach.de>
Differential Revision: https://phab.enlightenment.org/D9292
2019-07-17 21:57:53 +02:00
Daniel Kolesa fbdbf6b132 eolian: add builtin binbuf and event types
Binbuf is like strbuf and allows not using the Eina opaque wrapper
now, which will remove some ptr(). And event translates to
Efl.Event because otherwise there would be no way to get rid
of void_ptr.
2019-07-17 15:52:39 +02:00
Vitor Sousa ab26579cab Revert "Revert "efl: prevent usage of some Eina.* stub types in stable APIs""
EFL# support for slice and rw_slice was added in a previous commit.
So now it is safe to undo the reversion of this commit.

This reverts commit 25ef604467.
2019-07-15 15:45:13 -03:00
Vitor Sousa 25ef604467 Revert "efl: prevent usage of some Eina.* stub types in stable APIs"
C# does not support `slice` and `rw_slice` yet.
Reverting until proper support lands.

This reverts commit ec7bc0eddd.
2019-07-08 12:46:37 -03:00
Daniel Kolesa ec7bc0eddd efl: prevent usage of some Eina.* stub types in stable APIs 2019-07-08 17:01:40 +02:00
Vitor Sousa fb7f9d4ed3 eo: add an API entry for custom instantiation of Eo objects for binding usage
Add a new function in the Eo API in order to provide more options on object
instantiation for binding creators.

For the Eo lib to be able to construct objects that inherit from bindings in
many languages we should provide a way for bindings to call different kinds of
constructors, in a way that simply overriding the `efl_constructor` method is
not enough.
We need a way to differentiate at construction time if the Eo is being
constructed from C or from the binding, because if it is the
former we need too call the inherited object constructor from C and instantiate
a new object, and if it is the later we need to avoid instantiating a
new object because we are already in the middle of the process of creating
a new one.
`efl_constructor` alone does not provide any way of distinguishing between
those situations, so, being able to pass additional information for
efl_add_start (like a custom constructor pointer) is necessary to make the
right distinction.

Reviewed-by: Cedric BAIL <cedric.bail@free.fr>
Differential Revision: https://phab.enlightenment.org/D9070
2019-06-25 17:08:53 -07:00
Vitor Sousa a86a0931f1 eo: add events to track the ownership status of an Eo object
Some user code may want to track an object ownership in regard to whether it is
kept by just one owner or shared between many owners.

This is specially true for code provided by bindings to other programming
languages, where different kinds of resource management may take place.

The event `ownership,unique` is triggered whenever the object refcount goes
from two to one, as a signal that it has just one owner from now on.

The event `ownership,shared` is triggered whenever the object refcount goes
from one to two, as a signal that it has multiple owners from now on.
It will not trigger when further increasing the refcount to any value beyond
two.

We also add benchmarks for sharing (i.e. increasing the refcount) and them
unsharing objects, in order to evaluate the performance impact of this patch.

Reviewed-by: Cedric BAIL <cedric.bail@free.fr>
Differential Revision: https://phab.enlightenment.org/D8678
2019-05-29 15:53:23 -07:00
Daniel Kolesa 13ddc5dbc1 eolian: rename @warn_unused and its associated API
@warn_unused in syntax is now called @no_unused - this is because
"warning about unused" is a C thing (or rather, an extension to C)
and various languages might want to use stricter behavior for this.

Its associated API does the reverse now - it lets you query whether
being unused is allowed at all. This is to match future behavior
of Eolian (once it supports versioning) that will likely reverse it.

@feature
2019-05-26 17:41:22 +02:00
Daniel Kolesa d0fed247bb eolian: remove param @nonull
This has been deprecated for a while and is not strictly necessary
- as a part of an effort to stabilize Eolian, remove this. Eolian
will eventually gain support for versioning and use a reversed
behavior (i.e. no NULL by default), but the API it wlll use for
that will be very different. Features can always be added, it's
much harder to drop them.

@feature
2019-05-26 17:25:15 +02:00
Daniel Kolesa 5ea0195661 eolian: remove @nullable keyword
This was an experiment that never properly took off and was never
used by any generator. Its use was highly variable, so it could
not be relied upon. We will still want to reverse the current
behavior eventually (no null by default), but that will be
done with eo file versioning in the future.

@feature
2019-05-21 16:04:35 +02:00
Vincent Torri 7f45f94af0 Eo: replace Evil.h with evil_private.h
Test Plan: compilation

Reviewers: q66, raster, zmike

Reviewed By: q66

Subscribers: cedric, #reviewers, #committers

Tags: #efl

Differential Revision: https://phab.enlightenment.org/D8905
2019-05-16 14:36:12 +02:00
Daniel Kolesa 6312cafe20 eolian: move from eo_prefix to c_prefix 2019-05-09 16:17:44 +02:00
Xavi Artigas 68c530080b docs: Fix common misspellings in H files
Fixed all appearances of words from this list in H files:
https://en.wikipedia.org/wiki/Wikipedia:Lists_of_common_misspellings/For_machines
2019-04-02 13:28:48 +02:00
Xavi Artigas 57da0bee3d docs: Fix common misspellings in EO files
Fixed all appearances of words from this list in EO files:
https://en.wikipedia.org/wiki/Wikipedia:Lists_of_common_misspellings/For_machines
2019-04-02 11:32:05 +02:00
Lauro Moura 683958ee68 eo: Correctly name Realized classes.
The previous preprocessor rule was generating strings like
"\"Efl.App\"_Realized.

Reviewed-by: Marcel Hollerbach <mail@marcel-hollerbach.de>
Differential Revision: https://phab.enlightenment.org/D8527
2019-04-02 11:02:27 +02:00
Xavi Artigas 1ad9b246c0 docs: Add Eina.Value extern to eina_types.eot
Eina.Values are built-in eolian types, accessed through any_value and
any_value_ptr. However, these types cannot be used in doc references.
Adding a placeholder extern struct Eina.Value causes no harm, and will allow
referencing the type from EO docs later on.
In C#, Eina.Value is defined in the manual binding code so the doc reference
resolves to a valid type.

Reviewed-by: Marcel Hollerbach <mail@marcel-hollerbach.de>
Differential Revision: https://phab.enlightenment.org/D8510
2019-03-29 12:35:49 +01:00
Xavi Artigas 9f1cd60aeb docs: Document event info calling convention
Both at the emitter (efl_event_callback_call) and the receiver
(info field in the Efl.Event structure).
The Events tutorial should repeat this.
Fixes T7760

Reviewed-by: Marcel Hollerbach <mail@marcel-hollerbach.de>
Differential Revision: https://phab.enlightenment.org/D8486
2019-03-28 09:39:40 +01:00
Cedric BAIL adf4512a35 eo: refactor auto_unref logic used by efl_part.
This bring no functional change to Eo and efl_part.

Reviewed-by: Marcel Hollerbach <mail@marcel-hollerbach.de>
Differential Revision: https://phab.enlightenment.org/D8357
2019-03-27 15:03:18 -07:00
Cedric BAIL f11dfc0bc8 eo: enforce auto_unref logic at the end of efl_unref execution.
This allow for the safe use of efl_ref/efl_unref around an efl_part
without calling any function on that part.

Reviewed-by: Marcel Hollerbach <mail@marcel-hollerbach.de>
Differential Revision: https://phab.enlightenment.org/D8358
2019-03-27 15:03:16 -07:00
Xavi Artigas 205193f1ab docs: Add @since 1.22 to all stable classes' EO docs
Summary: Previous @since tags have already been removed from eo files.

Test Plan: Everything builds, but stable classes now have Since tags in the docs.

Reviewers: zmike, bu5hm4n

Reviewed By: bu5hm4n

Subscribers: cedric, #reviewers, #committers

Tags: #efl

Differential Revision: https://phab.enlightenment.org/D8446
2019-03-22 16:57:36 +01:00