Commit Graph

37 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
Daniel Kolesa 1f4d919cf9 eolian: update type/var name APIs 2018-03-12 16:28:28 +01:00
Daniel Kolesa edcd81ee49 eolian: update class name APIs 2018-03-12 16:03:37 +01:00
Daniel Kolesa d47610a732 eolian: do not require unit when stringifying types
As it is no longer necessary to pass unit when evaluating exprs,
it is not necessary to pass it here either. Convert all the APIs
to the new style and update all instances in our tree.
2018-01-16 16:39:05 +01:00
Daniel Kolesa dd2e579fec eolian: do not require unit for expr eval APIs
The necessary information is now stored directly in the expr
during database validation.

Also enable expr validation for params.
2018-01-16 16:37:52 +01:00
Daniel Kolesa c6436337a4 eolian: aliased_base_get funcs don't need unit 2018-01-12 18:05:13 +01:00
Daniel Kolesa 19c16b671e eolian: type_typedecl_get doesn't need a unit 2018-01-12 18:05:13 +01:00
Daniel Kolesa 18e18ca74c eolian: remove remaining global state (+ modify APIs accordingly) 2017-12-15 17:11:11 +01:00
Felipe Magno de Almeida 66eb8ddfeb eolian: Add inarray and inlist to source generation 2017-12-04 20:34:47 -02:00
Daniel Kolesa 4f8a9b50f4 eolian: make inherits_get return a list of classes, not strings
Most of the time you need to retrieve the class from the string
anyway, so remove this relic of old Eolian and gain some small
performance benefits and extra convenience.

Subtly breaks API but everything should be updated.
2017-10-25 16:25:41 +02:00
Daniel Kolesa b88132932a eolian: fix setter generation for @auto functions
Because of a typo in generator source (and overlooked error in
tests) we were previously generating incorrect code for setters
with the @auto qualifier. This was brought up in D5306 and is
now fixed.
2017-10-13 23:49:57 +02:00
Chris Michael 81d76776be eolian-bin: Free previously allocated eina_strbuf
Coverity reports that the eina_strbuf 'param_call' leaks when it goes
out of scope here, so fix the leak by freeing the strbuf

Fixes CID1381502

@fix

Signed-off-by: Chris Michael <cp.michael@samsung.com>
2017-10-05 09:46:18 -04:00
Daniel Kolesa f73d794132 eolian gen: simplify generate_normal_free a bit 2017-09-29 13:00:07 +02:00
Marcel Hollerbach fc071d5aa9 eolian: generate free function for owned parameters
With this commit owned parameters are freed if the object function
cannot be called, this means bla(NULL,param) will not leak anymore
2017-09-29 11:28:15 +02: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
Daniel Kolesa e288f5160b eolian: change C type serialization API to account for returns
This will allow proper handling of const.
2017-08-10 12:12:38 +02:00
Daniel Kolesa d5bca5b0cb eolian: always generate a class initializer
Because there might be hidden C implements defined, we need to
always generate the appropriate class initializer. This does not
hurt anything as the contents would have been called automatically
by Eo anyway.

@fix T5736
2017-07-17 11:04:29 +02:00
Lauro Moura 1634c14169 eolian: function pointers
First steps toward explicit function pointer support in eolian.

To declare a function pointer type, use the following syntax, similar to
a regular eolian method declaration.

function FunctionName {
  params {
    ...
  }
  return: Return type
}
2017-06-18 12:09:22 -03:00
Daniel Kolesa c234b5ee69 eolian: expr eval APIs now take units 2017-05-30 17:15:54 +02:00
Daniel Kolesa 45a73a0878 eolian: pass unit to class get_by_name/file 2017-05-30 17:15:53 +02:00
Daniel Kolesa 6d453bc694 eolian gen: pass the unit around 2017-05-30 17:15:53 +02:00
Daniel Kolesa 53fef30db0 eolian: allow extending eolian-generated classes from within C
If you define either the macro MY_CLASS_EXTRA_OPS for normal
methods/properties or MY_CLASS_EXTRA_CLASS_OPS for class methods
or properties, which contains a comma-delimited list of ops defs
(i.e. EFL_OBJECT_OP_FUNC(...), ...) right before including the
generated my_class.eo.c file, the definitions from these will
be included in the actual class. This can be used to override
certain things in a class internally without exposing it to
Eolian, or for testing/debugging.
2017-04-13 15:56:15 +02:00
Daniel Kolesa 35c5e89269 eolian: remove/add APIs and clean up implements system
As there is no need to have separate is_auto, is_empty and
is_pure_virtual for functions and implements (each function has
its own base implement by default) I removed the function ones.
Instead, I added a way to retrieve a function's base implement
so that you can instead do the checks on the implement even when
you only have the function.

I also moved base implement build directly into the parser instead
of the database filler. That allows for significant cleanup. I
also removed distinction of implement pointers in Eolian_Function
for get and set as implements now always contain an entire thing
so the pointer was always the same anyway.

Things should still behave more or less the same, but ordering
of generated functions has changed because ordering of implements
has changed.
2017-01-16 15:55:06 +01:00
Daniel Kolesa 692ae7adb6 eolian: use consistent pure_virtual naming in API
Previously one API used just virtual (incorrect) and one used
virtual_pure (which just sounds weird). So unify with a single
name, pure_virtual, similar as in other lanugages.

This does not change eo file syntax yet.
2017-01-13 15:40:29 +01:00
Daniel Kolesa deb1e58e06 eolian gen: do not use EOLIAN_UNRESOLVED/PROPERTY for lookups 2017-01-12 15:13:30 +01:00
Daniel Kolesa baaa482ebf eolian: fine-grained is_auto/is_empty for implements 2017-01-11 19:26:21 +01:00
Daniel Kolesa 72b8dbc30d eolian gen: properly deal with __eolian wrappers and mixed prop impls 2016-12-27 17:16:17 +01:00
Daniel Kolesa db9e6354c3 eolian gen: specialize default values by type
Now we can generate NULL for stuff that is pointers and empty
struct literals for struct instead of just 0 for everything. The
previous behavior was incorrect for those cases and generated
broken code.
2016-12-14 18:23:16 +01:00
Daniel Kolesa 698631578f eolian gen: remove dead code
Cedric forgot to remove all of the promise code.

Fixes CID1365652.
2016-12-08 14:06:09 +01:00
Daniel Kolesa 8d4de0d787 eolian: use the generic class name instead of C name in source
This changes the string in Efl_Class_Description to use the real
class name (with namespaces) instead of the C class name. The
reason for this is that this string is generic, not C-related.
2016-12-07 13:31:54 +00:00
Cedric BAIL 997249e6c2 eolian: remove generation of Eina_Promise. 2016-11-07 13:43:11 -08:00
Daniel Kolesa db7b6dd7e0 eolian gen: use EWAPI for events instead of EOAPI
Apparently only methods/properties can be EOAPI.
2016-10-20 16:48:41 +02:00
Jee-Yong Um c0a41034cd eolian: fix build warning
Differential Revision: https://phab.enlightenment.org/D4356
2016-10-19 23:50:49 +02:00
Daniel Kolesa 2515556673 eolian gen: better checks for whether to add space after type 2016-10-14 15:31:49 +02:00
Daniel Kolesa 57fb92e952 eolian gen: use the new data type API to simplify the code 2016-10-13 15:04:20 +02:00
Daniel Kolesa d3d63ea8d3 eolian gen: utilize the new class C name getter instead of manual concat 2016-10-12 15:05:46 +02:00
Daniel Kolesa 9553fd9640 eolian gen2: move to eolian gen (as the old one is gone) 2016-10-07 13:34:47 +02:00