Commit Graph

232 Commits

Author SHA1 Message Date
Carsten Haitzler a4a0dc7a75 eldbus - fix warning about buffer being a bit small for string
@fix
2022-05-18 12:16:08 +01:00
Carsten Haitzler 39b48ca430 Revert "fix warnings about redefinting EWAPI etc. due to windows EAPI changes"
This reverts commit e2d6691d52.
This reverts commit c02b796fdb.
This reverts commit 6c969f6b7d.
This reverts commit 74204bccd7.
This reverts commit 1304d95717.
This reverts commit 7c85be9674.

revert the EAPI changes that break cxx bindings build. sorry :( more
fixes needed than i thought
2021-05-26 15:46:25 +01:00
Felipe Magno de Almeida 1304d95717 eldbus: Rename EAPI macro to ELDBUS_API in Eldbus library
Summary:
=  The Rationale =

EAPI was designed to be able to pass
`__attribute__ ((visibility ("default")))` for symbols with
GCC, which would mean that even if -fvisibility=hidden was used
when compiling the library, the needed symbols would get exported.

MSVC __almost__ works like GCC (or mingw) in which you can
declare everything as export and it will just work (slower, but
it will work). But there's a caveat: global variables will not
work the same way for MSVC, but works for mingw and GCC.

For global variables (as opposed to functions), MSVC requires
correct DSO visibility for MSVC: instead of declaring a symbol as
export for everything, you need to declare it as import when
importing from another DSO and export when defining it locally.

With current EAPI definitions, we get the following example
working in mingw and MSVC (observe it doesn't define any global
variables as exported symbols).

Example 1:
dll1:
```
EAPI void foo(void);

EAPI void bar()
{
  foo();
}
```
dll2:
```
EAPI void foo()
{
  printf ("foo\n");
}
```

This works fine with API defined as __declspec(dllexport) in both
cases and for gcc defining as
`__atttribute__((visibility("default")))`.

However, the following:
Example 2:

dll1:

```
EAPI extern int foo;
EAPI void foobar(void);

EAPI void bar()
{
  foo = 5;
  foobar();
}
```

dll2:

```
EAPI int foo = 0;
EAPI void foobar()
{
  printf ("foo %d\n", foo);
}
```

This will work on mingw but will not work for MSVC. And that's why
EAPI is the only solution that worked for MSVC.

Co-authored-by: João Paulo Taylor Ienczak Zanette <jpaulotiz@gmail.com>
Co-authored-by: Ricardo Campos <ricardo.campos@expertise.dev>
Co-authored-by: Lucas Cavalcante de Sousa <lucks.sousa@gmail.com>

Reviewers: vtorri, raster

Subscribers: raster, cedric, #reviewers, #committers

Tags: #efl

Differential Revision: https://phab.enlightenment.org/D12270
2021-05-23 20:47:13 +01:00
Felipe Magno de Almeida 1aef7c697a eldbus: Add Eldbus.h include entry point header to eldbus_instrospection.h
Summary:
Add #include Eldbus.h so we can have EAPI definition for
eldbus_instrospection.h header

Reviewers: jptiz, lucas, vtorri, woohyun

Reviewed By: vtorri

Subscribers: cedric, #reviewers, #committers

Tags: #efl

Differential Revision: https://phab.enlightenment.org/D12202
2020-12-06 12:39:32 -03:00
Elyes HAOUAS dc4fd17a9c Fix typos - (Part #5)
Fix some typos

Reviewed-by: Stefan Schmidt <stefan@datenfreihafen.org>
Differential Revision: https://phab.enlightenment.org/D12019
2020-06-25 09:03:07 +02:00
Elyes HAOUAS 17151e2eb8 Get rid of trailing whitespaces (10 / 14)
Remove trailing whitespaces
Differential Revision: https://phab.enlightenment.org/D12009
2020-06-23 10:30:36 +02:00
Hermet Park 8559602bcc eldbus: fix the data size issue.
Summary:
dbus message requires the void* value for the message data,
the returned value of dbus_message_iter_get_basic() can be mismatched by to the architure,
This could bring the returned va_argues memory corrupted among the series of values.

We can use the defined type for exceptions.

Reviewers: herb, kimcinoo, jsuya, raster

Subscribers: cedric, #reviewers, #committers

Tags: #efl

Differential Revision: https://phab.enlightenment.org/D11940
2020-06-08 11:00:27 +09:00
Marcel Hollerbach 8e3606698e refactor build
libraries are split into deps, external deps, and pub deps.
Evas engines are refactored to use the predefined engine deps.

this is preparation work for efl-one.

Reviewed-by: Stefan Schmidt <stefan@datenfreihafen.org>
Differential Revision: https://phab.enlightenment.org/D11806
2020-05-27 11:06:46 +02:00
Stefan Schmidt 3ca9d72825 build: lib: harmonize the use of package_c_args in all libs
Add it to subprojects which are not using it and remove and old
ELEMENTARY_BUILD define we no longer use. This allows us to have a
central place in the main meson.build file to set this variable.

Reviewed-by: Marcel Hollerbach <mail@marcel-hollerbach.de>
Reviewed-by: Vincent Torri <vincent.torri@gmail.com>
Reviewed-by: João Paulo Taylor Ienczak Zanette <joao.tiz@expertisesolutions.com.br>
Differential Revision: https://phab.enlightenment.org/D11854
2020-05-26 10:15:21 +02:00
Carsten Haitzler 63b5d81983 Revert "Fix EAPI definition by defining EFL_BUILD for each built DLL"
This reverts commit 3ade45cbc8.
2020-05-18 11:13:59 +01:00
Vincent Torri 3ade45cbc8 Fix EAPI definition by defining EFL_BUILD for each built DLL
Summary: EAPI must be defined to dllexport when building DLL, and to dllimport when using these DLL. To achieve this, define EFL_BUILD for each library and module, and set DLL_EXPORT unconditionally. Static library are and will be not supported

Test Plan: compilation

Reviewers: zmike, raster, jptiz

Subscribers: cedric, #reviewers, #committers

Tags: #efl

Differential Revision: https://phab.enlightenment.org/D11834
2020-05-18 09:51:48 +01:00
Marcel Hollerbach 8cb311357c meson: do not install namespace problem legacy files
these files are not required for the unified API, but they have
namespace problems, so for now, do not install them

Differential Revision: https://phab.enlightenment.org/D11665
2020-04-14 12:25:59 +02:00
Xavi Artigas 9f4b5458ea doxygen: fix duplicated toc sections 2020-02-28 11:44:19 +01:00
junsu choi 65dae7876d eldbus_service: Prevent memory leak
Summary:
If obj->introspection_data is null, the function returns
without freeing the memory.

Test Plan: N/A

Reviewers: Hermet, YOhoho

Reviewed By: YOhoho

Subscribers: cedric, #reviewers, #committers

Tags: #efl

Differential Revision: https://phab.enlightenment.org/D11345
2020-02-14 16:27:12 +09:00
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
Cedric BAIL 3f3b725945 eldbus: only free the data when the future is resolved or rejected.
Reviewed-by: Stefan Schmidt <stefan@datenfreihafen.org>
Differential Revision: https://phab.enlightenment.org/D10684
2019-11-18 11:46:11 +01:00
Cedric BAIL 5cc9ea90c4 eldbus: properly cleanup local variable during destruction.
Summary: Depends on D10288

Reviewers: zmike, bu5hm4n, segfaultxavi, stefan_schmidt, jsuya

Reviewed By: zmike

Subscribers: ProhtMeyhet, #reviewers, #committers

Tags: #efl

Differential Revision: https://phab.enlightenment.org/D10289
2019-10-07 10:04:18 -04:00
Cedric BAIL d28870daa7 eldbus: connection are destroyed on invalidate, there is no point for any object to not cleanup on invalidate.
Summary:
This solve a bug when there is a change in order of destruction and you would expect the model to still work.
Depends on D10287

Reviewers: zmike, bu5hm4n, segfaultxavi, stefan_schmidt, jsuya

Reviewed By: bu5hm4n

Subscribers: #reviewers, #committers

Tags: #efl

Differential Revision: https://phab.enlightenment.org/D10288
2019-10-07 10:04:12 -04:00
Cedric BAIL 7f91f6280d eldbus: Eldbus_Proxy require to handle self desctruction as refcounting doesn't fully protect.
Summary:
If the connection is destroyed before the proxy, the proxy will clear itself and self destroy.
Before that it will trigger the free callback to handle proper cleanup. Refcounting it doesn't
protect it from this self destruction scenario. So it is mandatory to always have a free callback
set on a proxy to handle its death properly.
Depends on D10286

Reviewers: zmike, bu5hm4n, segfaultxavi, stefan_schmidt, jsuya

Reviewed By: zmike

Subscribers: #reviewers, #committers

Tags: #efl

Differential Revision: https://phab.enlightenment.org/D10287
2019-10-07 10:04:05 -04:00
Cedric BAIL e0187ce2ec eldbus: properly call parent finalize during creation of Eldbus.Model_Method.
Summary: @fix

Reviewers: zmike, bu5hm4n, segfaultxavi, stefan_schmidt, jsuya

Reviewed By: bu5hm4n

Subscribers: #reviewers, #committers

Tags: #efl

Differential Revision: https://phab.enlightenment.org/D10286
2019-10-07 10:03:58 -04:00
junsu choi 65be14db24 eldbus_proxy: Prevent dangling pointer. 2019-09-06 11:25:22 +09: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
Carsten Haitzler cb513df377 eldbus - fix null node last on introspection parse
this fixes CID 1402721
2019-08-11 12:47:38 +01:00
Daniel Kolesa 635a2df7e7 eolian: ban void_ptr in stable APIs
This required some refactoring in eldbus and tests but otherwise
seems good to go.
2019-07-26 13:35:27 +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
Carsten Haitzler 297fa2bca0 optimize - avoid eina_inlist_last where not needed
really minor places.
2019-06-15 09:31:51 +01:00
Mike Blumenkrantz dded40c73b eldbus: don't print warnings for user-canceled calls
Summary:
these are intentionally canceled and not something to be concerned with

@fix
Depends on D8974

Reviewers: devilhorns

Reviewed By: devilhorns

Subscribers: cedric, #reviewers, #committers

Tags: #efl

Differential Revision: https://phab.enlightenment.org/D8976
2019-05-29 12:29:04 -04:00
Christopher Michael be9343eeb0 eldbus: Fix resource leak
Summary:
Coverity reports that we leak 'data' here (which can happen if we
error on 'eina_value_dup(value)'). Iniitalize 'data' to NULL, and add a
'free' call to cleanup 'data' before we return a rejected future.

Fixes Coverity CID1399097

@fix

Depends on D8350

Reviewers: raster, cedric, zmike, bu5hm4n, stefan_schmidt

Reviewed By: cedric

Subscribers: #reviewers, #committers

Tags: #efl

Differential Revision: https://phab.enlightenment.org/D8352
2019-03-19 08:57:59 -04:00
Christopher Michael 25797aaca0 eldbus: Fix dereference after null check
Summary:
Coverity reports we are passing NULL variable 'properties' to
eina_array_pop here which dereferences it. Wrap the 'end' block in an
if which checks for valid 'properties' variable

Fixes Coverity CID1399422

@fix

Depends on D8350

Reviewers: raster, cedric, zmike, bu5hm4n, stefan_schmidt

Reviewed By: cedric

Subscribers: #reviewers, #committers

Tags: #efl

Differential Revision: https://phab.enlightenment.org/D8351
2019-03-15 12:14:19 -04: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
Cedric BAIL 6bb197caa9 efl: for consistency and effiency move Efl.Model event to send stringshare like Property_Bind event.
Reviewed-by: Vitor Sousa da Silva <vitorsousa@expertisesolutions.com.br>
Differential Revision: https://phab.enlightenment.org/D7946
2019-03-08 14:31:06 -08:00
Mike Blumenkrantz 12e78b5059 headers: ensure Efl.h is always included behind BETA define guards
Reviewed-by: Cedric BAIL <cedric.bail@free.fr>
Differential Revision: https://phab.enlightenment.org/D8244
2019-03-08 12:06:22 -08: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
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
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 e43f090265 cmake: remove!
This build was never complete and also was not maintained probebly.

It is also dropped in favour of meson which is cool, merged, works & is fast.

Differential Revision: https://phab.enlightenment.org/D7010
2018-12-20 20:07:26 +01:00
Carsten Haitzler 03f9cfb0b2 eldbus model - remove unused vars warn 2018-12-04 08:33:46 +00:00
Carsten Haitzler 0ebc6c6a8c eldbus model - fix signed compare warn 2018-12-04 08:33:28 +00: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 f9958821e9 eldbus: simplify code by using helper that create 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/D7340
2018-11-30 14:58:22 -08:00
Cedric BAIL 6a8d4d8159 eldbus: 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/D7335
2018-11-30 14:58:10 -08:00
Yeongjong Lee e93dbf21a2 eldbus: add brackets
Summary: assignment expression is always true.

Test Plan: make

Reviewers: cedric, devilhorns

Reviewed By: devilhorns

Subscribers: #reviewers, #committers

Tags: #efl

Differential Revision: https://phab.enlightenment.org/D7357
2018-11-29 07:05:23 -05: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 da01f169d0 eldbus: switch Eldbus.Model to inherit from Efl.Model_Loop.
Reviewed-by: Vitor Sousa da Silva <vitorsousa@expertisesolutions.com.br>
Differential Revision: https://phab.enlightenment.org/D7326
2018-11-23 11:39:41 -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
Carsten Haitzler 64975b1e95 eldbus- fix warning by casting through void
so eldbus does silly things like use a cb ptr with a different type of
cb - very explicitly. so it casts but warnigns don't like it and
assume it maybe a bug, so use void *'s so have some silence for this
bit of evil.
2018-11-09 11:43:59 +00:00