edje: Improve error report with efl_part misuse
authorJean-Philippe Andre <jp.andre@samsung.com>
Thu, 22 Jun 2017 00:05:41 +0000 (09:05 +0900)
committerJean-Philippe Andre <jp.andre@samsung.com>
Thu, 22 Jun 2017 07:16:21 +0000 (16:16 +0900)
commit56a74238d1fd475546373f2e2eddbd7ef55dd3fa
treea79744684bcbd9ec1bc79123d55945c536ffdaf6
parent5a98f78ce8c350b470dfd72ceac70392c68414b4
edje: Improve error report with efl_part misuse

This improves a rare error message when a function is called on an
efl_part() that does not implement it. Example: calling a swallow
function on a non-swallow part.

This isn't entirely fool-proof but should already help quite a bit.

This also changes how the efl_part proxies are stored: the variable
is not reset to NULL every time we use it, instead we check it in
the del intercept.

Note: _part_reuse_error() can not be enabled inside
_internal_proxy_get because there are valid use cases such as:

  func1(efl_part(obj, part), func2(efl_part(obj, part), ...), ...)

Here we use two efl_part() at the same time, on the same object,
but we haven't entered "func1" yet when we are reaching the second
call to efl_part(). This is completely valid and there is pretty
much no way to detect this.

I think I will improve this later with a core function on
Efl.Object like "debug_string".

Ref T5584
src/lib/edje/edje_part.c
src/lib/edje/edje_part_box.c
src/lib/edje/edje_part_external.c
src/lib/edje/edje_part_helper.h
src/lib/edje/edje_part_swallow.c
src/lib/edje/edje_part_table.c
src/lib/edje/edje_part_text.c