This resolves a few issues and brings back the experimental features.
Also, disable some of the ugliest experiments:
- manual function overrides,
- define APIs only in eo_cxx namespace
Some APIs are generated behind EFL_CXXPERIMENT (eg. event_name_cb_add or
some weak pointer stuff). I believe they are useful but would like to
make sure there are no serious drawbacks with generating those.
It's VERY hacky, but works as expected: no leak, no extra unref. This is
a lucky case of simply overriding efl_part() implementation in C++,
without having to modify the declaration.
This is part of the experimental stuff.
Allows calling C functions without using ._eo_ptr() explicitly. Probably
not super useful, assuming the interfaces are done :)
I'll hide some controversial features behind this, until we come to an
agreement with @felipealmeida and people who actually know C++ (iow: not
just me^^).
Features protected:
- easy wref (using -> without locking)
- xxx_event_cb_add() functions in object classes
- instantiate(obj) to create a new object
- add as a synonym for instantiate (both in efl::eo)
When I first implemented the Efl.Container interface I made a mistake of
mixing "single slot" content API's with "multiple children" content
API's. This should fix that, by separating API's that are for a single
part and those that deal with a list of children.
Efl.Content: Single slot. This will be used a lot by efl_part()
objects, and for the default content of widgets (eg. the window
content).
Efl.Container: Multiple children. Used by lists, boxes, layouts
(edje/elm), etc...
I didn't see any class that implemented both interfaces (note: Layout
implements Container and Button implements Content, so technically
Button implements both through inheritance).
For now the eo_prefix is not changed in Efl.Container. I wonder if it
should be reset (to efl_container) or not. This would only affect the C
API.
Ref T5328
Note: this is C only, not legacy only.
The problem is that bindings will hold a strong reference to the window,
which will then die "under the rug" if autodel is enabled. This then
leads to at least ERR if not crashes.
Note:
elm_policy needs to support autodel and quit on last del only for C
applications. Bindings will require some other mechanism that doesn't
break all assumptions wrt. references.
The fix is not complete. We need to make efl_part() work nicely in C++:
- Get the refs work properly (maybe without auto-del)
- Generate the parts from the EO file as methods on the object
Final form should be close to:
slider.indicator().format_string_set("%1.2f");
Where everything autocompletes nicely :)
Summary:
9d2dcd92 requires elocation to build.
cxx examples still broken due to elm cleanup
Test Plan: make examples
Reviewers: jpeg, felipealmeida
Subscribers: cedric
Differential Revision: https://phab.enlightenment.org/D5426
make examples now builds all c++ examples but some of them are in fact
empty skeletons. Those either need some c++ love or the final eo api to
be ready (eg. menu, popup, ...).
I removed some examples that don't have an exact equivalent in EO since
the widget is legacy only.
This is more of an experiment than anything else.
@felipealmeida I would like to know what you think.
Notes:
- events still need a better API (event_add isn't part of the object
definition...).
- references are an issue, when you want to actually delete an object.
Reasons:
- This API has been confused with the min size of the widget, resulting
in badly laid out applications.
- The EO API was not very nice (Range is about numbers, the Gfx size
hint in a part is really ugly).
While I understand the value of this API and how it can be used in
scalable applications, it is in fact not absolutely necessary.
Alternatively to that span size, the widget min size can already be
defined from the application side, or the widget can simply be expanded
to fill in its parent.
This can obviously be reinstated later if the need arises for EO. For
now, keep this feature as legacy-only.
I think this closes the orientation vs. direction problem.
RTL vs. AnyRTL is not fully handled yet but this becomes a
widget-per-widget issue (eg. should a box in a RTL locale be mirrored if
set to horizontal?).
Fixes T5870
Some names have not been changed, hopefully making a distinction
between legacy APIs and internal code (elm_layout_blah) and valid EO
usages.
This means many internal functions are still elm_layout_ as their
sole purpose is to support the legacy API.
Ref T5315
Summary:
Applies same change as e8355c93 for evas, to the remaining examples.
This uses the shell command-line:
src/examples/evas$ grep -sr 'fprintf(stdout' . | cut -d: -f1 \
| uniq | xargs sed -i "s/fprintf(stdout/printf(/"
Note that use of the "fprintf(stdout" construct can generate warnings
when -Wformat-security is enabled, if the fprintf statement has no
format arguments, so in addition to the stylistic simplification this
also helps quell those spurious warnings.
Subscribers: cedric, jpeg
Differential Revision: https://phab.enlightenment.org/D4836
Signed-off-by: Cedric BAIL <cedric@osg.samsung.com>
This fixes all warnings for "make examples" for:
-Wunused-parameter
-Wshadow
-Wformat-security
-Wenum-conversion
Some remaining warnings include:
-Wdeprecated-delcarations
Efl.Model.Container and Efl.Model.Item to efl/interfaces are used
to create Efl.Model objects with predefined property values.
This is useful to any situation where we want an Efl.Model with
explicit defined property values.
Efl.Ui.View and Efl.Ui.Factory are used to connect Efl.Models with
Widgets, Elm.Layout and Efl.Ui.Image has changed to use news interfaces
Signed-off-by: Cedric BAIL <cedric@osg.samsung.com>
In commit 5929f0311d this was removed. While
the commits intend was to remove the cxx variant of this example only.
Bring this back so examples are building again.
Remove codegen_example_generated.h from codegen_example_SOURCES
and let it only on nodist_codegen_example_SOURCES and
on BUILT_SOURCES.
Also add dependency between codegen_example.c
and codegen_example_generated.h since it's required
to compile.
Avoid the following build error:
CODEGEN codegen_example_generated.c
codegen_example.c:26:39: fatal error: codegen_example_generated.h:
No such file or directory
compilation terminated.
Makefile:4960: recipe for target 'codegen_example.o' failed
It has been discussed on the ML (thread: "[RFC] rename efl_self") and
IRC, and has been decided we should rename it to this in order to avoid
confusion with the already established meaning of self which is very
similar to what we were using it for, but didn't have complete overlap.
Kudos to Marcel Hollerbach for initiating the discussion and
fighting for it until he convinced a significant mass. :)
This commit breaks API, and depending on compiler potentially ABI.
@feature
so efreet mime was loading a bunch of mime type info files, parsing
them on startup and allocating memory to store all this mime info -
globs, mimetype strings and more. all a big waste of memory as its
allocated on the heap per process where its the SAME data files loaded
every time.
so make an efreet mime cache file and a tool to create it from mime
files. mmap this file with all the hashes/strings in it so all that
data is mmaped once in memory and shared between all processes and it
is only paged in on demand - as actually read/needed so if your
process doesnt need to know about mime stuff.. it wont touch it anyway.
this saves about 240-300k or so of memory in my tests. this has not
covered the mime MAGIC files which still consume memory and are on the
heap. this is more complex so it will take more time to come up with a
nice file format for the data that is nicely mmaped etc.
@optimize
At some point we lost the \ after track_example_01 and in combination with the
commented out line right afterwards we lost all examples coming after this line.
This just surfaced with JPs latest commit when I did a distcheck build but was
there for a longer time. We now make sure all disabled examples are moved out of
the multi-line list.
Summary: The realized items list should be freed by either eina_list_free() or EINA_LIST_FREE when it is no longer needed
Reviewers: cedric, jpeg
Reviewed By: jpeg
Subscribers: minkyu
Differential Revision: https://phab.enlightenment.org/D4193
We are using cos() and sin() in the efl_thread examples here but never linked
to the math lib. Ubuntu 14.04 on Travis CI errored out with this:
/usr/bin/ld: efl_thread_1.o: undefined reference to symbol 'cos@@GLIBC_2.2.5'
//lib/x86_64-linux-gnu/libm.so.6: error adding symbols: DSO missing from command line
This reverts commit 546ff7bbba.
It seems that eo_del() is useful and removing it was creating bugs.
The issue is that the way we defined parents in eo, both the parent and
the programmer share a reference to the object. When we eo_unref() that
reference as the programmer, eo has no way to know it's this specific
reference we are freeing, and not a general one, so in some
circumstances, for example:
eo_ref(child);
eo_unref(child); // trying to delete here
eo_unref(container); // container is deleted here
eo_unref(child); // child already has 0 refs before this point.
We would have an issue with references and objects being freed too soon
and in general, issue with the references.
Having eo_del() solves that, because this one explicitly unparents if
there is a parent, meaning the reference ownership is explicitly taken
by the programmer.
eo_del() is essentially a convenience function around "check if has
parent, and if so unparent, otherwise, unref". Which should be used when
you want to delete an object although it has a parent, and is equivalent
to eo_unref() when it doesn't have one.
We used to have eo_del() as the mirrored action to eo_add(). No longer,
now you just always eo_unref() to delete an object. This change makes it
so the reference of the parent is shared with the reference the
programmer has. So eo_parent_set(obj, NULL) can free an object, and so
does eo_unref() (even if there is a parent).
This means Eo no longer complains if you have a parent during deletion.