Commit Graph

313 Commits

Author SHA1 Message Date
Lauro Moura f203c164d8 eo files: Avoid container<ptr(value_type)> usage.
Summary:
Value types are already assumed to be stored by pointer (e.g.
`int val = *(node->data);`)

This commit just changes the current usage of the `ptr` modifier in the
ptr, not affecting the parser.

Reviewers: q66, segfaultxavi, bu5hm4n, felipealmeida

Reviewed By: q66

Subscribers: cedric, #reviewers, #committers, brunobelo

Tags: #efl

Differential Revision: https://phab.enlightenment.org/D10769
2019-11-29 17:22:07 -03:00
Carsten Haitzler 3d5e735704 eio - fbsd - make fd for monitored file close on exec
this fixes T7486
2019-10-12 13:02:31 +01:00
Mike Blumenkrantz 64799b32a1 eio/dir: fix null deref
Summary:
above cases may fail, causing target to be null

CID 1399103
Depends on D10210

Reviewers: cedric

Reviewed By: cedric

Subscribers: cedric, #reviewers, #committers

Tags: #efl

Differential Revision: https://phab.enlightenment.org/D10211
2019-09-26 17:59:59 -04:00
Marcel Hollerbach 1eb24301fd efl_io_model: next try to fix this race condition
what is happening is that a file gets announced through eio_model
listing code, at this point of time, the monitor does not yet know about
the file. If the file now gets deleted between the annoncing and the
learning of the file from the monitor, then the file got an ADD event,
but no DEL event. Which is a bug.

With this commit there is a new API which asks the monitor if the file
already has the knowledge about the files existance, or not. A few
monitors like win32 inotify or cocoa do not have context about the file
directly, if the OS is now having the same bug, then we are again in
trouble, however, we canot do anything about that. In the case of kevent
or poll, this asks the context of the monitor if the file is already
there.

Reviewed-by: Cedric BAIL <cedric.bail@free.fr>
Differential Revision: https://phab.enlightenment.org/D10006
2019-09-19 14:50:42 -07:00
Marcel Hollerbach 5a7102a589 Revert "efl_io_model: remove custom counting logic"
Summary:
This reverts commit d794a0d3d9.

This breaks Efl_Io_Model.

Reviewers: cedric, zmike

Reviewed By: zmike

Subscribers: #reviewers, #committers

Tags: #efl

Differential Revision: https://phab.enlightenment.org/D10003
2019-09-18 08:21:00 -04:00
Vincent Torri 1f24762fc4 eio: fix warning
Test Plan: compillation

Reviewers: raster, cedric, zmike

Reviewed By: cedric

Subscribers: #reviewers, #committers

Tags: #efl

Differential Revision: https://phab.enlightenment.org/D9925
2019-09-12 14:45:58 -04:00
Daniel Kolesa 4f4b58bf4c efl: change all occurences of @owned to @move 2019-09-06 17:01:05 +02:00
Xavi Artigas 88948eeab4 docs: minor tweaks to efl_io_model
This file's docs are far from complete but this idea had to be
written down before it was forgotten.
Also, TABS.
2019-09-05 17:01:02 +02:00
Marcel Hollerbach d794a0d3d9 efl_io_model: remove custom counting logic
Summary:
this logic brings a few problems:

- When files are annonced here, without the monitor having the context
of the files, immidiat actions like deletion of the file are resulting
in no deletion event. Which is definitly a bug, so we need to wait here
for the monitor.

- When a new count is annonced before the files are there from the
monitor, we are heading towards the same issue - additionally, we might
already have files available, due to the custom counting that are not
annoncned through the monitor, which means, at a later pointer we are
annoncing a new file which is already available via the API.

Right now i do not see a way to continue with this code, it caused major
issues with our CI and the POLL backend, for now things do work again.
Depends on D9624

Reviewers: zmike, stefan_schmidt, cedric, felipealmeida

Reviewed By: zmike

Subscribers: cedric, #reviewers, #committers

Tags: #efl

Differential Revision: https://phab.enlightenment.org/D9625
2019-09-04 13:39:43 -04:00
Carsten Haitzler d6156d23d8 eio - don't call cb's after a cancel
i saw a segv in e/efm .. an eio call was called after it had been
canceled. this should never happen. ever. so ensure it does not once
an eio file has been canceled.

@fix
2019-08-30 12:43:24 +01:00
Mike Blumenkrantz 42704eccc7 eio/poll: avoid ever dereferencing the backend's parent in a thread
Summary:
when a monitor is destroyed, it unconditionally and immediately deletes
the monitor struct. this means that as soon as the monitor is dead, the
backend must never access the parent pointer again if its lifetime exceeds
the lifetime of the monitor (such as in threads)

the only member of the monitor data used by the fallback monitor is the
monitor path, so we can just copy it to the fallback data to avoid ever
needing to dereference this pointer

fixes reliability issues with efl sentry unit tests

@fix

Depends on D9708

Reviewers: cedric

Reviewed By: cedric

Subscribers: #reviewers, #committers

Tags: #efl

Differential Revision: https://phab.enlightenment.org/D9709
2019-08-23 13:38:33 -04:00
Mike Blumenkrantz 0b8605c35d efl/io: fix race condition with child model deletion
Summary:
if an event is emitted for a child that is added to the model during a
call to _efl_io_model_children_list(), it's possible that this child
will never be detected by the model's monitor/sentry if it is deleted
before the monitor can detect it, which means there will never be a
corresponding eio event emitted

in this case, ensure that we manually remove this child from the model
since we know we've just deleted it

this fixes reliability issues with efl io model monitor unit test

@fix

Reviewers: cedric

Reviewed By: cedric

Subscribers: #reviewers, #committers

Tags: #efl

Differential Revision: https://phab.enlightenment.org/D9708
2019-08-23 13:38:32 -04: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
Carsten Haitzler 9149767184 getenv - reduce continually calling getenv for the same vars do once
do it once and remember the result from the first one. drops overhead
for sure by a chunk i actually could see in perf reports like about 1-2%
of cpu...
2019-08-08 23:57:02 +01:00
Vincent Torri 5b51a6bb20 Eio: enable eio_file_chown if chown is available on the platform
Test Plan: compilation on Windows

Reviewers: zmike, raster, cedric

Reviewed By: raster

Subscribers: #reviewers, #committers

Tags: #efl

Differential Revision: https://phab.enlightenment.org/D9393
2019-07-28 09:38:26 +01:00
Cedric BAIL e0ee318fe1 eo: use efl_provider_{un,}register infrastructure instead of Efl_Loop one.
Reviewed-by: Marcel Hollerbach <mail@marcel-hollerbach.de>
Differential Revision: https://phab.enlightenment.org/D9296
2019-07-17 21:57:57 +02:00
Cedric BAIL fce5645d80 efl: use eina_streq for all property operation in model to avoid crash on NULL property name.
Reviewed-by: Marcel Hollerbach <mail@marcel-hollerbach.de>
Differential Revision: https://phab.enlightenment.org/D9266
2019-07-10 21:10:23 +02:00
Cedric BAIL 1f8d367138 eio: fix Efl.Io.Model properties iterator.
It kind of worked by luck for 6 months, but really shouldn't. This
is now a custom iterator that will walk the string part of the properties
only. It could become a generic iterator if necessary one day, but
for now, it is fine just here.

T7771

Reviewed-by: Marcel Hollerbach <mail@marcel-hollerbach.de>
Differential Revision: https://phab.enlightenment.org/D9075
2019-06-05 13:40:26 -07:00
Mike Blumenkrantz ca4b517414 efl/io_model: check for parent object existence before removing wref
Summary:
if the wref automatically removes this pointer then there's no need to
remove the wref on the pointer

@fix
Depends on D8973

Reviewers: cedric

Reviewed By: cedric

Subscribers: cedric, #reviewers, #committers

Tags: #efl

Differential Revision: https://phab.enlightenment.org/D8974
2019-05-29 12:29:04 -04:00
Vincent Torri 8db978aa4c include evil_private.h in last files, and disable symbolic links on Windows in a couple of files
Test Plan: compilation

Reviewers: zmike, raster, cedric

Reviewed By: zmike

Subscribers: #reviewers, #committers

Tags: #efl

Differential Revision: https://phab.enlightenment.org/D8933
2019-05-22 07:59:05 -04:00
Vincent Torri 03fffc3bdc Eio: avoid symbolic link on Windows
Summary: On Windows, symbolic links do not exist

Test Plan: compilation

Reviewers: zmike, raster, cedric

Reviewed By: zmike

Subscribers: #reviewers, #committers

Tags: #efl

Differential Revision: https://phab.enlightenment.org/D8931
2019-05-21 13:35:01 -04:00
Vincent Torri a5267d3d9c remove Evil.h when not necessary, include evil_private.h when necessary
Test Plan: compilation

Reviewers: zmike, raster, cedric

Reviewed By: zmike

Subscribers: #reviewers, #committers

Tags: #efl

Differential Revision: https://phab.enlightenment.org/D8925
2019-05-20 09:10:00 -04:00
Cedric BAIL c559bdf809 eio: correctly set reference count of cached child object.
Reviewed-by: SangHyeon Jade Lee <sh10233.lee@samsung.com>
Differential Revision: https://phab.enlightenment.org/D8793
2019-05-09 09:33:25 -07:00
Cedric BAIL 3b0261d552 eio: rely on inheritance and reflection for Efl.IoModel path property.
Reviewed-by: Marcel Hollerbach <mail@marcel-hollerbach.de>
Differential Revision: https://phab.enlightenment.org/D8653
2019-04-21 11:36:46 +02:00
Marcel Hollerbach 43a522b876 eio: ensure that the monitor starts when it is called to
Summary:
we need to to this here, otherwise we effectfily start the monitor
later, which means, we can miss a change in the filesystem. However,
this makes things a lot slower.

Reviewers: cedric

Reviewed By: cedric

Subscribers: cedric, #reviewers, #committers

Tags: #efl

Differential Revision: https://phab.enlightenment.org/D8526
2019-04-02 08:50:48 -04:00
Marcel Hollerbach c29dae34a0 efl_io_model: start early on monitoring
Summary:
Little introduction into what eio did before this commit:
Efl.Io.Model creation:
  - direct ls of a directory in a thread (A)
  - take all the contents of a directory and feed it slowly back into
the mainloop
  - when all events have been feeded back to the mainloop and have been
processed: start monitoring (B)

However, any file created between (A) and (B) will not be in the model,
since not the listing nor the monitoring did caputure it. Hence we need
to start monitoring before we actaully start listing. In the callbacks
we then check if we already published something.

ref T7311

Reviewers: zmike, cedric

Reviewed By: cedric

Subscribers: cedric, #reviewers, #committers

Tags: #efl

Maniphest Tasks: T7311

Differential Revision: https://phab.enlightenment.org/D8525
2019-04-02 08:50:34 -04: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
Cedric BAIL 150bc0fa14 eio: work around the lack of integration between Ecore_Thread and Eina_Future.
Ecore_Thread excpect resolution of the error and done case to be instantaneous,
while Eina_Future default scheduler linked with Ecore main loop is build around
asynchronous answer. This create a lot of potential. A better patch would be
to provide an Ecore_Thread helper that does the integration properly. Sadly
we are in release now, so this is basically what an helper would do, but
contained inside Efl_Io_Manager.

This also solve the same problem as D7970 and D8053, but it should avoid its
side effect.

Reviewed-by: YeongJong Lee <yj34.lee@samsung.com>
Differential Revision: https://phab.enlightenment.org/D8371
2019-03-27 15:03:33 -07:00
Cedric BAIL ed3165f928 eio: Efl.Io.Model should not make request when the object is invalidating itself.
Reviewed-by: Marcel Hollerbach <mail@marcel-hollerbach.de>
Differential Revision: https://phab.enlightenment.org/D8373
2019-03-27 15:03:29 -07:00
Cedric BAIL 4d1620f3f0 eio: remove unecessary use of weak reference.
There is no point in keeping a pointer to the main loop now that we
are using efl_future_then. This resolve potential bug with leftover
dangling weak reference as efl_future_then do require a free case
otherwise.

Reviewed-by: Marcel Hollerbach <mail@marcel-hollerbach.de>
Differential Revision: https://phab.enlightenment.org/D8374
2019-03-27 15:03:26 -07:00
Cedric BAIL f4426d2960 eio: guarantee that we will at least process one request per loop iteration for very slow system.
Reviewed-by: Marcel Hollerbach <mail@marcel-hollerbach.de>
Differential Revision: https://phab.enlightenment.org/D8447
2019-03-27 15:03:22 -07:00
Cedric BAIL 6b6faef3a3 eio: rely on efl_future_then to properly protect Eo object during the lifecycle of the future callback.
Reviewed-by: Marcel Hollerbach <mail@marcel-hollerbach.de>
Differential Revision: https://phab.enlightenment.org/D8334
2019-03-27 15:03:06 -07:00
Cedric BAIL a947d8e5b1 eio: path and filename property should always remind accessible even in case of error.
Reviewed-by: Marcel Hollerbach <mail@marcel-hollerbach.de>
Differential Revision: https://phab.enlightenment.org/D8335
2019-03-27 15:03:04 -07:00
Xavi Artigas bbd4b6e514 docs: Remove obsolete @since tags from EO files
Summary:
All legacy @since tags have already moved to the *.legacy.h files.
EO files are now devoid of @since tags (except some eldbus still
needed for legacy).
Upcoming patches will add @since 1.22 to those APIs which come out
of beta in this release.
APIs marked @beta do not need @since tags.

Test Plan: Everything builds, EO docs (like DocFX) have no Since tags.

Reviewers: zmike, bu5hm4n, lauromoura, cedric

Reviewed By: cedric

Subscribers: cedric, #reviewers, #committers

Tags: #efl

Differential Revision: https://phab.enlightenment.org/D8430
2019-03-20 20:16:05 +01:00
Daniel Kolesa 58b8a3d163 efl: remove EFL_EO_API_SUPPORT macro
Summary:
Since we're now going to be shipping some eo classes as stable,
there is no point in keeping the eo api behind a macro, and it
should be enabled by default. Another case is beta classes, but
those are behind the EFL_BETA_API_SUPPORT guard.

This also changes includes around the place where things are
clearly broken (such as an included header needing something
from another header but that other header being guarded, notably
efl_ui_widget.h needing focus manager but focus manager being
behind beta in Elementary.h)

Reviewers: zmike, cedric, bu5hm4n, stefan_schmidt, segfaultxavi

Reviewed By: cedric, segfaultxavi

Subscribers: segfaultxavi, #reviewers, #committers

Tags: #efl

Differential Revision: https://phab.enlightenment.org/D8322
2019-03-18 12:13:59 +01:00
Marcel Hollerbach 30bb8395c3 build: add a option to disable eo file installation
Summary:
this is done because .eo files are not stable, and in order to stop
people depending on it, its better for now to disable the installation
of them for now.

ref T7676

Reviewers: stefan_schmidt, cedric, zmike, devilhorns

Reviewed By: zmike

Subscribers: #reviewers, #committers

Tags: #efl

Maniphest Tasks: T7676

Differential Revision: https://phab.enlightenment.org/D7897
2019-03-14 12:44:00 -04:00
Daniel Kolesa d3c5384cd0 eolian: enable checking of beta/stable contexts in all classes
Summary:
This enables all the checks unconditionally, without ignoring
classes that don't have an Efl namespace. This required a lot
of beta marking to make it build. It most likely doesn't
mark types correctly, as that is not fully enabled yet.

Reviewers: zmike, cedric, segfaultxavi, bu5hm4n

Reviewed By: segfaultxavi

Subscribers: #reviewers, #committers

Tags: #efl

Differential Revision: https://phab.enlightenment.org/D8266
2019-03-11 13:42:29 +01:00
Mike Blumenkrantz a4ad866bc1 eo files: mark a bunch of types with @beta
Summary:
these are all types that we do not currently want to release

Depends on D8102

Reviewers: segfaultxavi

Reviewed By: segfaultxavi

Subscribers: segfaultxavi, cedric

Tags: #efl_api

Differential Revision: https://phab.enlightenment.org/D8241
2019-03-08 16:40:40 +01:00
Cedric BAIL 86e2b208c7 eio: Efl.Io.Model doesn't have a parent class that actually provide any property.
Reviewed-by: Vitor Sousa da Silva <vitorsousa@expertisesolutions.com.br>
Differential Revision: https://phab.enlightenment.org/D8088
2019-03-01 17:10:38 -08:00
Hermet Park 25470a56d3 eio: fix not to overflow data by performing arithmetic. 2019-02-27 19:20:29 +09:00
Cedric BAIL 301b05502c eio: enforce proper lifecycle for all Efl.Io_Model and fix discovered lifecycle bugs.
Summary:
This make sure that the object returned by children_slice_get are properly
destroyed when the refcount drop to only the parent holding a reference on
it. This make it clear that the user of the api can rely on efl_ref/efl_unref
to actually manage its use of the returned object.

Additionnaly we are cleaning up the created object that we are using to build our own
request inside the Efl.Io.Model and avoid internal leak.

Depends on D7864

Reviewers: felipealmeida, segfaultxavi, SanghyeonLee, zmike, bu5hm4n

Reviewed By: zmike

Subscribers: #reviewers, #committers

Tags: #efl

Maniphest Tasks: T7528

Differential Revision: https://phab.enlightenment.org/D7865
2019-02-23 08:57:48 -05:00
Jaehyun Cho c8cee32929 efl_io_model: fix not to cause memory overflow by strcpy
Since the destination string size is EINA_PATH_MAX, the string is copied
up to EINA_PATH_MAX size.
2019-02-22 13:57:37 +09:00
Wonki Kim e7e62c54cd eio: fix a potentional BOF problem
if length of path arguments are longer than PATH_MAX,
there could be a BOF problem potentionally.
this patch fixes it.

Reviewed-by: Cedric BAIL <cedric.bail@free.fr>
Differential Revision: https://phab.enlightenment.org/D7919
2019-02-21 11:12:13 -08:00
Xavi Artigas 333330a6e5 Mark BETA classes individually
Summary:
Instead of surrounding all the #include "*.eo.h" lines in Efl.h
with #ifdef EFL_BETA_API_SUPPORT, include these files unconditionally, but mark
all classes as @beta in the eo files.
This will allow taking them out of beta one by one as we deem them stable enough.
Otherwise, the current procedure involves moving the #include line out of the
ifdef block, which is cumbersome and messes include order.

Depends on D7950
Fixes T7692

Test Plan: Nothing changes

Reviewers: zmike, bu5hm4n, cedric

Subscribers: #reviewers, #committers

Tags: #efl

Maniphest Tasks: T7692

Differential Revision: https://phab.enlightenment.org/D7951
2019-02-14 17:46:50 +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
SangHyeon Jade Lee 5525c89a3d efl_model : rename all efl_model based classes.
Summary:
As the result of discussion in T7458,
we need to rename all efl_model based classes with efl_XXX_Model sequence.
I've run few vote for this, see V42, V43
few classes are totally renamed as our consideration of misnaming.

| Efl.Model_Loop | Efl.Loop_Model |
| Efl.Model_Item | Efl.Generic_Model |
| Efl.Model_Container | Efl.Container_Model |
| Efl.Model_Container_Item | Efl.Container_Model_Item |
| Efl.Model_Composite | Efl.Composite_Model |
| Efl.Model_Composite_Boolean | Efl.Boolean_Model |
| Efl.Model_Composite_Boolean_Chlidren | Efl.Boolean_Model_Item |
| Efl.Model_Composite_Selection | Efl.Select_Model |
| Efl.Model_Composite_Selection_Chlidren | Efl.Select_Model_Item |
| Efl.Model_View | Efl.View_Model |
| Eio.Model | Efl.Io.Model |
| Efl.Ui.Model_State | Efl.Ui.State_Model |
| Efl.Ui.Model_Size | Efl.Ui.Size_Model |
| Efl.Ui.Model_Exact | Efl.Ui.Exact_Model |
| Efl.Ui.Model_Average | Efl.Ui.Average_Model |
| Efl.Ui.Model_Homogeneous | Efl.Ui.Homogeneous_Model |

I worried about Efl.Io.Model changes, cause it is widely used,
but as I tested, there is no issue found yet.

Eldbus.Model also may can changed Efl.Dbus.Model,
but I cannot found any class who using Efl.Dbus namespace,
so I left it future work.

Test Plan:
Run the Make Test,
it works well except Efl test about selection.
there are class inheritance problem exist in select_model,
I reported it and will fix it in another patch.

Reviewers: cedric, felipealmeida, woohyun, Hermet

Reviewed By: cedric

Subscribers: lauromoura

Tags: #efl, #do_not_merge

Differential Revision: https://phab.enlightenment.org/D7533
2019-01-31 14:59:37 +09:00
Xavi Artigas c55299ca51 docs: Fix assorted typos in legacy documentation
Samsung reported a long list of typos in our legacy docs, this fixes them.
2019-01-28 13:14:20 +01:00
Marcel Hollerbach 34efdfb1b1 efl: convert all classes to the new eolian syntax
ref T7459

Reviewed-by: Daniel Kolesa <daniel@octaforge.org>
Reviewed-by: Xavi Artigas <xavierartigas@yahoo.es>
Differential Revision: https://phab.enlightenment.org/D7684
2019-01-18 16:31:26 +01:00
Cedric BAIL 563f91eaf9 ecore: remove data parameters of Efl.Loop_Consumer.promise_new to reduce the risk of inadvertently using the wrong data.
If you need data, use a efl_future_then as done in every case here to get the same feature.

Reviewed-by: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Differential Revision: https://phab.enlightenment.org/D7577
2019-01-16 14:33:26 -08:00
Cedric BAIL 04090f3e7a eio: remove use of eina_promise_data_set.
eina_promise_data_set is a misleading API and result in conflicted use by
multiple independent piece of code leading to bug and crash. It is also not
necessary and we can avoid using it completely.

Reviewed-by: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Differential Revision: https://phab.enlightenment.org/D7572
2019-01-16 14:33:16 -08:00