Commit Graph

274 Commits

Author SHA1 Message Date
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
Carsten Haitzler 318d16846f Revert "Revert "ecore: make efl_loop_promise_new a function of Efl.Loop_Consumer.""
This reverts commit 42e886d8d6.
2018-12-26 17:50:09 +00:00
Marcel Hollerbach 42e886d8d6 Revert "ecore: make efl_loop_promise_new a function of Efl.Loop_Consumer."
This reverts commit 9b5155c9f1.

For now lets revert this, this breaks copy and paste, further more it
has the potential to break a lot more things, as eio_model tends to use
efl_loop_promise new, and then eina_promise_data_set, which is
explicitly forbidden.

This fixes crashing terminology instances.
2018-12-26 12:31:08 +01:00
Cedric BAIL 9b5155c9f1 ecore: make efl_loop_promise_new a function of Efl.Loop_Consumer.
I am not sure this is the right way to do it as binding would have to likely
to bind it manually.

Reviewed-by: Lauro Neto <Lauro Moura <lauromoura@expertisesolutions.com.br>>
Differential Revision: https://phab.enlightenment.org/D7492
2018-12-20 12:42:34 -08:00
Marcel Hollerbach c1dd57d210 meson: use eolian_gen with -S
this ensures that eolian does not parse installed .eo files

Differential Revision: https://phab.enlightenment.org/D7405
2018-12-03 19:00:26 +01:00
Cedric BAIL 221600ea10 eio: simplify code by using helper that generate future directly.
The new helper help replace call to eina_future_resolved and eina_future_rejected with
a scheduler lookup to just one function call.

Reviewed-by: Xavi Artigas <xavierartigas@yahoo.es>
Reviewed-by: Vitor Sousa da Silva <vitorsousa@expertisesolutions.com.br>
Differential Revision: https://phab.enlightenment.org/D7339
2018-11-30 14:58:19 -08:00
Cedric BAIL 1c238298ee eio: we do not need to actually loop explicitely for the loop here.
Actually efl_loop_future_scheduler_get does lookup on the object and its provider
someone that could be a loop provider and find a scheduler. There is no need to
custom look for a loop provider.

Reviewed-by: Xavi Artigas <xavierartigas@yahoo.es>
Reviewed-by: Vitor Sousa da Silva <vitorsousa@expertisesolutions.com.br>
Differential Revision: https://phab.enlightenment.org/D7338
2018-11-30 14:58:17 -08:00
Cedric BAIL 959024ae80 eio: simplify code by using proper helper.
efl_loop_promise_new is a helper function that does automatically figure out an
available scheduler and create a promise from it. Basically replacing the call to
eina_promise_new(efl_loop_future_scheduler_get(o), ...).

Reviewed-by: Xavi Artigas <xavierartigas@yahoo.es>
Reviewed-by: Vitor Sousa da Silva <vitorsousa@expertisesolutions.com.br>
Differential Revision: https://phab.enlightenment.org/D7334
2018-11-30 14:58:08 -08:00
Xavi Artigas 05682eed7d eo-docs: Remove Doxygen tags from efl*.eo files
Summary:
- Replace '\@ref name' with '@name'
- Remove unused \@internal tag
    This tag affects text AFTER it, and there is no text after it.
- Remove \@note tag
    Replaced with a simple NOTE: text, since eolian does not have an equivalent tag.
- Remove spurious \@Efl... tags
    They should really be @Efl...
- Remove \@p tags
    There is no eolian equivalent, and a simpler $ suffices in this case.

Fixes T7482

Reviewers: q66

Reviewed By: q66

Subscribers: cedric, #reviewers, #committers

Tags: #efl

Maniphest Tasks: T7482

Differential Revision: https://phab.enlightenment.org/D7372
2018-11-28 13:33:46 +01:00
Cedric BAIL 5de51f84fb eo: rename efl_future_Eina_FutureXXX_then in efl_future_then as this has been available for some time.
Reviewed-by: Vitor Sousa da Silva <vitorsousa@expertisesolutions.com.br>
Differential Revision: https://phab.enlightenment.org/D7327
2018-11-23 11:39:43 -08:00
Cedric BAIL de28f06ab4 eio: switch Eio.Model to inherit from Efl.Model_Loop.
Reviewed-by: Vitor Sousa da Silva <vitorsousa@expertisesolutions.com.br>
Differential Revision: https://phab.enlightenment.org/D7325
2018-11-23 11:39:39 -08:00
Cedric BAIL 88553eb9e8 eio: use the right type of Eina_Value to report error.
Reviewed-by: Vitor Sousa da Silva <vitorsousa@expertisesolutions.com.br>
Differential Revision: https://phab.enlightenment.org/D7322
2018-11-23 11:39:34 -08:00
Cedric BAIL d4d44d76f3 efl: make Efl.Model.properties_get return an Iterator<string>.
Reviewed-by: Vitor Sousa da Silva <vitorsousa@expertisesolutions.com.br>
Differential Revision: https://phab.enlightenment.org/D7289
2018-11-23 10:13:58 -08:00
Lauro Moura 021513923d eo: Avoid namespace clashes.
Summary:
This commit removes some clashes (i.e. names as classes and namespaces
at the same time). It'll avoid nested items that are either forbidden
(C#) or problematic (Python) in some languages.

Reviewers: segfaultxavi, bu5hm4n, felipealmeida

Reviewed By: segfaultxavi

Subscribers: cedric, #reviewers, #committers

Tags: #efl

Differential Revision: https://phab.enlightenment.org/D7260
2018-11-13 09:48:14 +01:00
Carsten Haitzler 665a75378f xxx - fix eina_future_then calls to pass sotrage val - fix warns 2018-11-09 11:43:59 +00:00
Daniel Kolesa 5a3d79d383 meson: add eolian custom dependencies support
This uses the meson/ninja depfile functionality + eolian to make
sure proper dependencies between generated files and .eo files
are managed, to ensure consistent re-generation of all generated
files that are affected upon .eo file modification.

For custom rules with multiple outputs, Ninja currently does not
support depfiles. Therefore, split those into two custom rules
so that the depfiles functionality can be enabled. While this
is ugly and slows down the process a little by having to invoke
Eolian twice instead of once, it has to be done and it's still
better than what we had in Autotools anyway.

Differential revision: D7187

Fixes T6700.
2018-10-24 12:02:55 +02:00
Marcel Hollerbach 347dc66ba9 meson: unify system properties
this unifies the system types into 4 boolean flags
This fixes the fact that meson changed the system string accross
versions.

Differential Revision: https://phab.enlightenment.org/D7144
2018-10-05 13:40:29 +02:00
Marcel Hollerbach 46d464e5bf here comes meson
a new shiny buildtool that currently completes in the total of ~ 4 min..
1 min. conf time
2:30 min. build time
Where autotools takes:
1:50 min. conf time
3:40 min. build time.

meson was taken because it went quite good for enlightenment, and is a traction gaining system that is also used by other mayor projects. Additionally, the DSL that is defined my meson makes the configuration of the builds a lot easier to read.

Further informations can be gathered from the README.meson

Right now, bindings & windows support are missing.

It is highly recommented to use meson 0.48 due to optimizations in meson
that reduced the time the meson call would need.

Co-authored-by: Mike Blumenkrantz <zmike@samsung.com>

Differential Revision: https://phab.enlightenment.org/D7012
Depends on D7011
2018-10-02 17:22:50 +02:00
Mike Blumenkrantz 9f8a7acfcf eio/sentry: destroy event handlers when deleting sentry
this will crash due to invalid memory access if an event is triggered after
the sentry is destroyed

Differential Revision: https://phab.enlightenment.org/D6845
2018-08-17 22:19:32 +02:00
Marcel Hollerbach c77ba1672e eio: fix poll backend
it seems that this should have been a pop call, not the function
pointer. This key eina_array_pop is never used. Nor would the array get
smaller, so i assume this should be a pop call.

Differential Revision: https://phab.enlightenment.org/D6814
2018-08-12 14:25:09 +02:00
Derek Foreman 35210b553d eio_model: Fix deleting files that don't have assigned types yet
Summary:
Trying to delete a file from a creation notification callback can
fail.  Sometimes the eio model test would sit forever in select()
waiting for events that will never occur because of this.

This happens since d84a268a71 broke
deleting of files that haven't yet been assigned a type.  Before
this commit a delete_me flag would be set before attempting to
build a stat buf asynchronously, and then on completion the file
would be deleted.

I think this was changed because that could potentially race with
other async calls and delete the file sooner than expected.  So
instead of reverting I've made a special delete path that shouldn't
race with non-delete paths.

Reviewers: devilhorns, zmike

Reviewed By: zmike

Subscribers: cedric, #committers, zmike

Tags: #efl

Differential Revision: https://phab.enlightenment.org/D6543
2018-07-10 09:43:55 -04:00
Mike Blumenkrantz ddc31e75ac eio/fallback: avoid emitting monitor events if the backend is pending deletion
emitting events if the delete_me flag is set may result in events being emitted
for an already-freed monitor, resulting in both invalid memory access and a
deadlock later on if eio_shutdown has been called at this point

this causes the monitoring thread to check the status of the backend during the
block where the main loop and thread are in sync, avoiding any data races which
could occur when checking the flag at another time, and also avoiding accessing
the internals of the Ecore_Thread which could also have been deallocated during
shutdown

fix T7086

Differential Revision: https://phab.enlightenment.org/D6449
2018-06-28 18:08:45 +02:00
Mike Blumenkrantz 7ed4b407e7 eio: add method for determining if a monitor is using the fallback mechanism
the fallback method of calling stat() on the monitored paths does not allow
for various eio events to be emitted, meaning that any application which relies
on those events can never receive them

this provides a method for checking a monitor to determine which functionality
is available, and also provides more explicit documentation regarding events
that are not provided by fallback monitoring

this method is marked as beta

@feature

Differential Revision: https://phab.enlightenment.org/D6447
2018-06-28 18:08:45 +02:00
Mike Blumenkrantz 65afddf2ae eio/fallback: do not modify the children hash while iterating it
this is invalid use of the hash api and will cause a crash

@fix

Differential Revision: https://phab.enlightenment.org/D6444
2018-06-28 18:08:45 +02:00
Mike Blumenkrantz f41b9ea204 eio/fallback: mark all fallback monitors as fallbacks, not just for win32
@fix

Differential Revision: https://phab.enlightenment.org/D6443
2018-06-28 18:08:45 +02:00
Mike Blumenkrantz 1544ec4808 eio/fallback: fix MODIFY event emission on base path when monitoring
previously this sent a DELETE event any time the target file was modified

@fix
fix T7042

Differential Revision: https://phab.enlightenment.org/D6442
2018-06-28 18:08:45 +02:00
Mike Blumenkrantz 062f6cabdd eio/fallback: remove intermediate idler
for some reason, the fallback thread would exit -> create timer ->
create idler -> create thread; the existence of the idler makes little
sense and introduces variability in the timer interval

@fix

Differential Revision: https://phab.enlightenment.org/D6441
2018-06-28 18:08:45 +02:00
Mike Blumenkrantz 1b18a4e679 eio/fallback: fix fallback shutdown when threads exist
threads should not be waited on here during shutdown since these same
threads may be waiting on the main loop anyway

instead, perform as much deallocation as possible,
mark the monitor as deleted, and then set the thread to canceled and
allow the thread to clean itself up during its cancel/end callback

@fix

Differential Revision: https://phab.enlightenment.org/D6440
2018-06-28 18:08:45 +02:00
Mike Blumenkrantz 4987fd4ab8 eio/fallback: always create timer hash on fallback init
this is a required call in order for the fallback system to work

Differential Revision: https://phab.enlightenment.org/D6439
2018-06-28 18:08:45 +02:00
Mike Blumenkrantz 2acb5e506a eio: add method for setting the global file polling rate for fallback monitors
Summary:
the default value for the fallback poll monitor timer interval is 60.0 seconds,
which is not useful for all cases, such as CI, where we don't care about cpu
usage and just want things to process as fast as possible at all times

this enables setting the interval to any value, ensuring that any existing
timers are modified to use that value immediately

@feature

Reviewers: stefan_schmidt, bu5hm4n, raster, devilhorns, ManMower

Reviewed By: bu5hm4n, ManMower

Subscribers: ManMower, raster, bu5hm4n, cedric, #committers

Tags: #efl

Differential Revision: https://phab.enlightenment.org/D6247
2018-06-19 13:33:14 -04:00
Larry Lira 1fb268ac3c Eio: fix eio_model children_slice_get all 2018-06-07 19:15:50 -03:00
Cedric BAIL 901eeb94e3 eio: enforce eio model to have a parent that provide main loop access. 2018-05-24 16:02:21 -07:00
Daniel Kolesa 577c00789a eolian: second batch of unused import removals
This fixes all remaining occurences introduced by false negatives
in 6bcd70f01d. The rest was already
fixed in 6be3809c04.
2018-05-13 18:13:12 +02:00
Cedric BAIL e8df3515d7 eio: on error/cancel properly destroy weak reference. 2018-05-05 21:15:55 -07:00
Cedric BAIL 382079bccd eio: cancel idler on Eio.Model destruction properly. 2018-05-05 21:15:24 -07:00
Cedric BAIL d84a268a71 eio: do not call efl_model_child_del at the end of build_st as that might result in the destruction of files. 2018-05-04 16:23:01 -07:00
Daniel Kolesa f58bdbf23a eolian: switch Eina.Future instances to future<T> 2018-05-03 17:14:39 +02:00
Cedric Bail c3072e77e6 eio: prevent asynchronous destruction of object while thread is still running. 2018-05-02 10:46:34 -07:00
Mike Blumenkrantz f1d411db2f eio: fix windows build
Summary: S_ISSOCK does not exist because sockets do not exist

Reviewers: vtorri, cedric

Reviewed By: cedric

Subscribers: cedric

Differential Revision: https://phab.enlightenment.org/D6035
2018-05-02 12:26:24 -04:00
Cedric BAIL a34a733b7b eio: remove last remnant of Efl_Promise. 2018-05-01 10:39:01 -07:00