Commit Graph

23273 Commits

Author SHA1 Message Date
Daniel Kolesa bc182e69d7 eolian: flush defer table before parsing 2018-03-22 15:37:25 +01:00
Cedric BAIL bc18b7e7ad efl: replace efl_del with efl_unref for cases where no parent exists
Signed-off-by: Mike Blumenkrantz <zmike@osg.samsung.com>
2018-03-20 17:20:57 -07:00
Cedric BAIL 168849e8a0 eo: use unref instead of del when constructor fails without parent
Signed-off-by: Mike Blumenkrantz <zmike@osg.samsung.com>
2018-03-20 17:20:57 -07:00
Cedric BAIL db92072338 edje: implement invalidate method and unset device callbacks here
prevent crashing in dangling callbacks

ref d26124a6d818f62d892e178d92098f5159a8c9e0

Signed-off-by: Mike Blumenkrantz <zmike@osg.samsung.com>
2018-03-20 17:20:57 -07:00
Cedric BAIL cd8952cc6c efl_ui_win: match return value to function type in elm_win_window_id_get
ref 08c9f99134

Signed-off-by: Mike Blumenkrantz <zmike@osg.samsung.com>
2018-03-20 17:20:57 -07:00
Cedric BAIL 21f96c2a71 edje: remove device callbacks on canvas del
avoid some race conditions when devices change during destructor

Signed-off-by: Mike Blumenkrantz <zmike@osg.samsung.com>
2018-03-20 17:20:57 -07:00
Cedric BAIL de667f889e tests: fix misuse of eina_file in evas mesh tests
Signed-off-by: Mike Blumenkrantz <zmike@osg.samsung.com>
2018-03-20 17:20:57 -07:00
Cedric BAIL 6b2923c8de edje: avoid triggering errors when deleting edje file if canvas is deleted
Signed-off-by: Mike Blumenkrantz <zmike@osg.samsung.com>
2018-03-20 17:20:57 -07:00
Cedric BAIL 4c4177ac20 efl: use efl_add_ref to create objects which have no parent
Signed-off-by: Mike Blumenkrantz <zmike@osg.samsung.com>
2018-03-20 17:20:56 -07:00
Cedric Bail a1bf513920 eo: start reporting abuse of efl_del 2018-03-20 17:20:56 -07:00
Lauro Moura f9586a831b csharp: Add support for efl parts as Properties
Instead of
   var bg = efl.ui.Background.static_cast(myobj.Part("background"));

Now do
   var bg = myobj.Background;

Also a couple helper functions were added.
2018-03-20 16:50:30 -03:00
Lauro Moura 9a6dd32cb1 eolian_cxx: Fill documentation of part_def. 2018-03-20 16:50:30 -03:00
Lauro Moura 38bf8cc923 eolian-cxx: Add helper method to get all parts
Line get_all_methods, gets everything from the inherits too.
2018-03-20 16:50:30 -03:00
Lauro Moura 7fc20c08ee csharp: Use the library mapping on linux too.
Now the generated DllImport call will have the actual library name
instead of placeholders on Linux. Before we relied on dlsym being able
to search for the symbols on all loaded so's while Windows needed you to
specify the correct library to call GetProcAddress.

This fixes the case when someone call an function from an efl interface
defined in efl.so (e.g. efl_part) and the library is not loaded yet.
2018-03-20 16:50:30 -03:00
Derek Foreman 94ddefc6fb ecore_wl2: Send a mouse-up event on reentry after client initiated resize
Apparently when we initiate a client side move in ecore_wl2 we flag that
and send a mouse-up immediately on the next pointer enter.

Do the same for resize.

At some point this might need to be revisited, we should probably be
sending a "cancel" at the start of client initiated move/resize instead
of an up at the end?

Fix T6422
2018-03-20 14:30:39 -05:00
Daniel Kolesa 2db8e8e914 eolian: make use of panics for certain alloc errors 2018-03-20 17:34:51 +01:00
Daniel Kolesa 7c6d8010a8 eolian: no need for printf-style for internal log funcs 2018-03-20 17:34:51 +01:00
Daniel Kolesa a1ae5cd918 eolian: use new error logging for all recoverable errors 2018-03-20 17:34:51 +01:00
Woochan Lee 008d990181 efl_ui_clock: Fix wrong target to compare with.
Summary:
It breaks API action.

It missed when implement efl_ui_clock i think.

@fix

Test Plan: elementary_test -> efl_ui_clock sample.

Reviewers: cedric, woohyun, Jaehyun_Cho

Reviewed By: Jaehyun_Cho

Subscribers: cedric

Differential Revision: https://phab.enlightenment.org/D5826
2018-03-20 21:09:30 +09:00
Carsten Haitzler 6391a13558 efl.task - move to returning future insead of bool + exit event
title says it all...
2018-03-20 20:56:46 +09:00
Cedric Bail 2a14a283e8 eo: slight improvement of invalidate code as parent_set(NULL) will be valid on an invalidated object. 2018-03-19 16:47:28 -07:00
Cedric Bail 21164b5a56 eo: automatically cancel a future that is attached to an invalidated object. 2018-03-19 16:38:07 -07:00
Cedric Bail 08c9f99134 elementary: make sure windows are not born orfan and properly have at least a main loop as parent. 2018-03-19 15:39:14 -07:00
Cedric Bail 1fcb33f422 elementary: make global object lifecycle depends on the main loop. 2018-03-19 15:38:26 -07:00
Cedric Bail 2c336d3063 evas: use efl_add_ref for the container, might consider using a parent later on. 2018-03-19 15:36:58 -07:00
Cedric Bail 90bae9b271 evas: technically the evas canvas is using the main loop, so let's make canvas depend on it for their lifecycle. 2018-03-19 15:36:18 -07:00
Cedric Bail 2d973475ee edje: global class should actually be bound to the main loop. 2018-03-19 15:33:44 -07:00
Cedric Bail c3c5620c1c ecore: the main loop has no parent and only one ref, let's properly create it. 2018-03-19 15:33:11 -07:00
Cedric Bail fccaeb182e eo: update tests to also use efl_add_ref correctly. 2018-03-19 14:27:01 -07:00
Cedric BAIL a5bb8bf3df eo: check return in efl_add before performing more operations
this fixes a crash on objects which fail to be created using efl_add_ref

Signed-off-by: Mike Blumenkrantz <zmike@osg.samsung.com>
2018-03-19 13:04:45 -07:00
Cedric BAIL e1a53fe125 eo: start printing warning when instanciating object with efl_add and no parent. 2018-03-19 13:04:45 -07:00
Cedric BAIL 3f5ac71ad6 eldbus: ensure the lifetime of the eldbus object path is monitored for proxies
the object is instantly destroyed when connection is lost

Signed-off-by: Mike Blumenkrantz <zmike@osg.samsung.com>
2018-03-19 13:00:25 -07:00
Cedric BAIL 67b135ab87 eldbus: use efl_del when clearing the model connection child list
it is an error to delete an object with an existing parent

Signed-off-by: Mike Blumenkrantz <zmike@osg.samsung.com>
2018-03-19 13:00:25 -07:00
Cedric BAIL 46992cbed5 tests: do not call unref on eldbus message objects after sending them
Signed-off-by: Mike Blumenkrantz <zmike@osg.samsung.com>
2018-03-19 13:00:25 -07:00
Davide Andreoli 97289953ec Pyolian: fix __repr__ for Documentation 2018-03-17 12:06:34 +01:00
Davide Andreoli 2cb896dfab Pyolian doc generator: update wrt name API changes
Argh, this has been difficult... hopefully I have done
this right
2018-03-17 11:37:13 +01:00
Davide Andreoli 35316db2f0 Pyolian: let ctypes automatically convert types
Not a big improvement and not so much automatically...
but for sure a bit less to type :)
2018-03-17 10:49:42 +01:00
Davide Andreoli ef3e487b0c Pyolian: use tuple instead of list in declarations
This is a bit more correct and (maybe) a bit more faster
2018-03-17 10:31:33 +01:00
Davide Andreoli 6ef5f30a85 Pyolian: new API eolian_unit_state_get 2018-03-17 10:19:28 +01:00
Davide Andreoli 0a00e4cca1 Pyolian: new API eolian_object_unit_get
Also implemented __repr__ for Unit and State
2018-03-17 10:01:24 +01:00
Davide Andreoli 1ab22e4f00 Pyolian: fix tests wrt name/short_name/full_name API changes 2018-03-17 09:46:17 +01:00
Davide Andreoli 81d15b7cd8 Pyolian: add support EOLIAN_SO_DIR env var
Thanks goes to @lauromoura for proposing this in D5840
2018-03-16 20:00:49 +01:00
Derek Foreman 7784405ad9 ecore_wl2: Silence a commit ERR on window hide
Cosmetic fix, should be functionally identical.  Hide can be called
asynchronously, so it's ok, and the ERR can be silenced.
2018-03-16 12:48:41 -05:00
Daniel Kolesa 9610459502 eolian: add APIs to get unit from object and state from unit 2018-03-16 16:16:16 +01:00
Daniel Kolesa 60c733670d eolian: intial API for a new error mechanism
Unlike panic, this will be used to handle regular errors
such as parse errors. There will be no jumps and you
will be able to pass in a pointer to get the error
data into some local memory. That way you will be
able to override printing error messages.
2018-03-16 16:07:12 +01:00
Daniel Kolesa 927bcfd60a eolian: initial API for a new panic mechanism
This will be used to handle unrecoverable errors.
For robustness, you will be able to set a custom
panic callback, jump and try to recover manually.
2018-03-16 15:41:57 +01:00
Lauro Moura 2705ea8531 csharp: Fix support for ptr(structs)
In general, ptr(struct) parameters behavior depends whether the
parameter has the @owned modifier or not.

If there is no @owned parameter (meaning no transfer of ownership
happens) and it is a "complex" struct, with reference type fields
(like strings), the struct is converted to the respective
<Struct>Internal struct and passed with "ref" to the DllImport'd
function. For @in parameters, after the function it returns, this
intermediate struct is converted to the public struct type and
assigned to the original parameter, updating it to the external
world.

When we have ownership transfers, the structure is copied to unmanaged
memory and given to the callee. We can't send managed memory directly as
the callee may try to free it. On the managed side, the original struct
is left to be garbage collected normally.
2018-03-16 11:12:49 -03:00
Lauro Moura 7c543d3c86 csharp: Change policy on ptr(struct) owned calls
When transferring the ownership of a ptr(struct) from Unamanaged to
managed, we should marshal the reference-typed fields or they can point
to Managed memory that would make no sense to access from C (for
example, strings would return garbage).

The downside is that it can cause potential leaks if the receiver of the
memory do not free it. In the current state of the EFL api this can
happen in two places:

- Efl.Ui.List.SegArray::remove
return -> ptr(Efl.Ui.List.LayoutItem) @owned
- Efl.Ui.Focus.Manager::fetch
return -> ptr(Efl.Ui.Focus.Relations) @owned

The resources copied by both structs may leak when those functions are
overriden in C# and the values returned to the C code.

Also hide some internal stuff instead of exporting it and generate
implicit conversion operators for struct external/internal.
2018-03-16 11:12:49 -03:00
Lauro Moura 78251aa0d2 eolian_cxx: Add 'unknown' to parameter direction
It'll be used in eolian_mono as the 'direction' of return types in some
helper functions.
2018-03-16 11:12:49 -03:00
Lauro Moura 0749a3f6af efl-cxx: Fix installation of efl_part_impl header
It was being installed directly into efl-cxx instead of efl-cxx/cxx.
2018-03-16 11:12:49 -03:00
Daniel Kolesa a848278782 eolian: simplify lexer init 2018-03-16 14:49:35 +01:00
Daniel Kolesa bf1e3a702f eolian: event/function_get_by_name -> by_name_get 2018-03-16 14:26:15 +01:00
Lauro Moura 47ac8689f1 eo: Orphan an object that is being invalidated.
Summary:
This will avoid infinite loops and errors when the parent tries
to orphan an invalidated child.

Fixes T6780

Test Plan: Run `make check`

Reviewers: cedric

Maniphest Tasks: T6780

Differential Revision: https://phab.enlightenment.org/D5839

Reviewed-by: Cedric BAIL <cedric@osg.samsung.com>
2018-03-15 22:10:27 -07:00
Daniel Kolesa 6c0180d7f8 eolian: more stringent and fine-grained validation 2018-03-16 00:14:13 +01:00
Daniel Kolesa fed326a3ef eolian: fix unit child management
Also pass correct unit to validation for performance.
2018-03-16 00:10:13 +01:00
Daniel Kolesa 2760f047d3 eolian: merge objects in units 2018-03-15 23:32:20 +01:00
Daniel Kolesa 978ba5052d eolian: reduce the number of database traversals during validation
This significantly improves performance by not iterating certain
paths multiple times.
2018-03-15 23:25:35 +01:00
Derek Foreman f0a96ec53c ee_drm: prevent extra flips
Similarly to commit 8b962d24ac prevent
extra flips in the drm engine.

These are potentially more harmful to DRM as they can cause frame
drops and missed render opportunities.
2018-03-15 14:49:56 -05:00
Derek Foreman 8b962d24ac ee_wayland: Prevent extra commits
It's possible that we unregister then reregister an animator so quickly
that the ecore_evas idle enter/exiters haven't had a chance to run yet.
In this case a render will come shortly anyway and we shouldn't use a
'false' commit to kick off a frame callback.

Silences an ERR and unmeasurably improves protocol utilization.
2018-03-15 14:41:15 -05:00
Daniel Kolesa 2c59abc878 eolian: fix minor memory leaks 2018-03-15 16:45:23 +01:00
Daniel Kolesa edc73c4c4c eolian: make sure dtors are always run correctly 2018-03-15 16:34:39 +01:00
Daniel Kolesa df83efcef9 eolian: remove the temps system 2018-03-15 16:34:39 +01:00
Daniel Kolesa 5178b15ac5 eolian: manage exprs through node system 2018-03-15 16:34:39 +01:00
Daniel Kolesa da47159dbd eolian: manage typedecls through node system 2018-03-15 16:34:39 +01:00
Daniel Kolesa 80445f5160 eolian: manage class/vars through new node system 2018-03-15 16:34:39 +01:00
Daniel Kolesa aa313ccfb6 eolian: store types in node hash 2018-03-15 16:34:39 +01:00
Daniel Kolesa cd49130df7 eolian: generic dtor management for lexer 2018-03-15 16:34:39 +01:00
Daniel Kolesa 916c8cb046 eolian: unified node allocation api 2018-03-15 16:34:39 +01:00
Daniel Kolesa 938acf22c0 eolian: in-lexer-state current class storage 2018-03-15 16:34:39 +01:00
Marcel Hollerbach 432deb1129 efl_ui_focus_manager_root_focus: switch to focus adapter 2018-03-15 15:39:12 +01:00
Marcel Hollerbach c8ba7a070f efl_ui_focus_manager_calc: set redirect before setting focus
settings the redirect might result in unfocus calls, that might unset
evas_object_focus on a object that might be registered in two managers
due to border linking. This fixes mysterical disapearing focus.
2018-03-15 15:39:12 +01:00
Marcel Hollerbach 875a7eb0da efl_ui_focus_manager_calc: do not set focus on a deletion manager
otherwise objects might already be on the way out, without a elementary
parent.
2018-03-15 15:39:12 +01:00
Marcel Hollerbach 8746c275f5 elm_interface_scrollable: make sure to have the content always focusable 2018-03-15 15:39:12 +01:00
Marcel Hollerbach 1d3209a9ec elm_widget_item_static_focus: move canvas_object_set to later
We dont delete the adapeter when we are still focused, to set anyway the
correct view to it, we need to set the view to the adapeter as often as
possible
2018-03-15 15:39:12 +01:00
Marcel Hollerbach 02a062ba67 elm_genlist: support immidiate focus once the item is realized
this supports the case of item.focus = true before the item is realized.
2018-03-15 15:39:12 +01:00
Marcel Hollerbach be3cfcec66 elm_genlist: move focus recovering to first_touch instead of
focus_update

this means that the function is called more reliable, and not only based
on focus state, but also based on the redirect situation.
2018-03-15 15:39:12 +01:00
Marcel Hollerbach 844854d3e8 efl_ui_focus_manager_calc: add onedirection to dirty 2018-03-15 15:39:12 +01:00
Marcel Hollerbach 7d2d6c7e1d elm_genlist: performe elm_item_focus_set
this means all neccessary fields with last focus and current focused
item are updated correctly
2018-03-15 15:39:12 +01:00
Marcel Hollerbach df55911967 efl_ui_focus_composition: redirect canvas move events to the adapter
otherwise a moving canvas object will not be recalculated, as the
manager does not know about the new focus geometry
2018-03-15 15:39:12 +01:00
Marcel Hollerbach b7a5a9298d elm_widget_item_static_focus: fix fetching of the item 2018-03-15 15:39:12 +01:00
Marcel Hollerbach 0b1d67e793 elm_widget_item_static_focus: delete adapter when deleted or unrealized
somehow genlist leaks the view sometimes, thus the adapter is not
deleted when the item is deleted. This resulted in strange ghost focus
objects in the window.
2018-03-15 15:39:12 +01:00
Marcel Hollerbach e5af7c914a elm_genlist: set focus to the item when a user calls the function 2018-03-15 15:39:12 +01:00
Marcel Hollerbach 8410659bb6 elm_genlist: set focus to the item when a user calls the function 2018-03-15 15:39:12 +01:00
Marcel Hollerbach 44a3e2b7c4 efl_ui_focus_manager_sub: flush the border if we cannot find a candidate
after that someone probebly wants to check where the last focus was on,
if the set of boder elements has changed since the last border flush, then the
element might not be registered in the parent manager
2018-03-15 15:39:12 +01:00
Derek Foreman 984d8bd4ce ecore_wl2_window: Silence some spurious warnings
ecore_wl2_window_commit() must be called during window size negotiation,
but this currently trips a warning when no frame callback has been
received for the first commit.  We can't even have frame callbacks at
that point because no buffer is attached.

Don't set up the commit_pending logic until after we have a buffer.
2018-03-14 16:10:14 -05:00
Derek Foreman b55b8110a9 evas_render: Don't render from norender
commit 4dee873a appears to have accidentally flipped a flag in
_evas_canvas_norender causing it to actually try to render.
2018-03-14 16:08:07 -05:00
Derek Foreman 812ab64413 ee_wayland: Set window visible before trying to render it
if we try to render before setting ee->visible the results aren't
likely to be... visible.
2018-03-14 16:08:07 -05:00
Daniel Kolesa ab43e61ef6 eolian: turn some state APIs into inlines over unit APIs 2018-03-14 17:20:49 +01:00
Daniel Kolesa 4fd0d5b436 pyolian: remove unneeded bindings in eolian_state 2018-03-14 17:08:36 +01:00
Daniel Kolesa 0ee6410add elua: inherit state from unit in eolian bindings 2018-03-14 17:03:33 +01:00
Daniel Kolesa 2d0a25c995 eolian: refactor doc ref resolution API 2018-03-14 16:51:11 +01:00
Cedric BAIL 425a447379 eo: fix invalidate to always happen. 2018-03-13 15:29:21 -07:00
Jean-Philippe Andre fd82c2521e genlist: fix "insane" order [BUG COMPATIBILITY]
This patch implements bug compatibility.

genlist internally uses both a tree structure with Eina_List and a flat
Eina_Inlist to track its items. ALL of the items are in the inlist while
subitems appear in their parent's list. As a consequence both lists must
be kept in sync pretty tightly. Obviously this is not done at all and
has led to countless bugs, as soon as tree or groups are used:
 - Invalid order of items (visually)
 - Invalid order of items with sorted_insert
 - Glitches in the matrix
 - Crashes with sorted_insert
 - Odd/even styles not properly set
 - Promote/demote functions broken by design
 - Developers send to psychiatric hospitals
 - Etc...

Legacy genlist (1.19 and before) used an inlist order that basically
didn't make sense, as it didn't follow the logical order of elements (as
they appear visually). Unfortunately this has "worked" (really, that's a
huge stretch to use this word here) for a long time this way. As a
consequence, some applications (*cough* empc *cough*) have relied on
this order to implement "next album" or "previous album" where the
album title is a group node.

By changing the order of items in the inlist, this has broken the
assumptions made above, and ends up in cases that return NULL, leading
to SEGV. Sure, the app should have checked NULL, but that's not really
the point here. The behavior has been changed.

This patch implements "fixes" for the following functions:
 - elm_genlist_first_item_get(): Don't return a parent
 - elm_genlist_last_item_get(): Return a parent
 - elm_genlist_item_next_get(): return a parent upon reaching the last child
 - elm_genlist_item_prev_get(): return a child when a parent is passed

Important notes:
 - This does not cover 100% behavior compatibility here. The only way to
   have it would be to simply revert the entire genlist code to its
   original version and never touch it again, ever.
 - An explicit API is required for an application to specify which API
   level it targets, so that we can cherry-pick which bug compatibility
   features we want to enable. We are already doing this for EDC,
   unfortunately.

@fix

fix T5938

Signed-off-by: Mike Blumenkrantz <zmike@osg.samsung.com>
Signed-off-by: Cedric BAIL <cedric@osg.samsung.com>
2018-03-13 15:15:01 -07:00
Cedric BAIL 101f17d1c5 tests: add genlist test to verify group item api behaviour
ref T5938

Signed-off-by: Mike Blumenkrantz <zmike@osg.samsung.com>
2018-03-13 15:14:50 -07:00
Cedric BAIL 7c2a1932c7 efl_ui_clock: do not locally store clock module api
there is no corresponding code to unset this global pointer when the module
is unloaded, so this will crash if elm_shutdown is ever called

Signed-off-by: Mike Blumenkrantz <zmike@osg.samsung.com>
2018-03-13 15:14:50 -07:00
Cedric BAIL 067c9afa4e elm_gengrid: do not zero item cache if object is not finalized
this is a no-op case which causes unnecessary errors

Signed-off-by: Mike Blumenkrantz <zmike@osg.samsung.com>
2018-03-13 15:14:50 -07:00
Cedric BAIL 950e2c13bb efl_promise: avoid invalid calls when unsetting parent
if promise has no parent then the promise's loop is null

Signed-off-by: Mike Blumenkrantz <zmike@osg.samsung.com>
2018-03-13 15:14:50 -07:00
Cedric BAIL a1655cf9cb tests: remove invalid api usage from elm layout test
the comment here indicates that the author knew it was an invalid api use
so it should not have been here in the first place

Signed-off-by: Mike Blumenkrantz <zmike@osg.samsung.com>
2018-03-13 15:14:50 -07:00
Cedric BAIL ac5f11ed1f tests: disable elm glview tests when running in buffer engine
Signed-off-by: Mike Blumenkrantz <zmike@osg.samsung.com>
2018-03-13 15:14:50 -07:00
Cedric BAIL 0a6c302e9a elm_map: remove unnecessary error message in destructor
there is no check for the existence of this file so this will error most times
from it not existing

Signed-off-by: Mike Blumenkrantz <zmike@osg.samsung.com>
2018-03-13 15:14:50 -07:00