summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJean-Philippe Andre <jp.andre@samsung.com>2017-12-05 14:31:22 +0900
committerJean-Philippe Andre <jp.andre@samsung.com>2017-12-05 15:06:34 +0900
commit207a0cf3e3ce169b2e6400ca4bc1df512ea15a27 (patch)
tree25ef8280e607308de2e7cbf131c7064a6397291c
parent8cdb3184f8a1f3e5396d953b238ce2e217f0cb1c (diff)
downloadefl-207a0cf3e3ce169b2e6400ca4bc1df512ea15a27.tar.gz
eo: Move hacky API auto_unref to C only
This API is meant to be used by parts only, and by bindings dealing with part objects. This patch fixes make check which got broken in the after the previous one (cxx).
-rw-r--r--src/bindings/cxx/eo_cxx/efl_object_impl.hh3
-rw-r--r--src/lib/edje/edje_part_helper.h2
-rw-r--r--src/lib/edje/edje_private.h2
-rw-r--r--src/lib/efl/cxx/efl_part_impl.hh2
-rw-r--r--src/lib/elementary/elementary_config.h2
-rw-r--r--src/lib/elementary/elm_part_helper.h5
-rw-r--r--src/lib/eo/Eo.h1
-rw-r--r--src/lib/eo/efl_object.eo23
-rw-r--r--src/lib/eo/eo.c3
-rw-r--r--src/lib/eo/eo_base_class.c9
-rw-r--r--src/lib/eo/eo_private.h2
-rw-r--r--src/lib/eolian_cxx/grammar/part_implementation.hpp2
-rw-r--r--src/tests/eo/suite/eo_test_general.c9
13 files changed, 12 insertions, 53 deletions
diff --git a/src/bindings/cxx/eo_cxx/efl_object_impl.hh b/src/bindings/cxx/eo_cxx/efl_object_impl.hh
index ce61ed6200..734ed17df0 100644
--- a/src/bindings/cxx/eo_cxx/efl_object_impl.hh
+++ b/src/bindings/cxx/eo_cxx/efl_object_impl.hh
@@ -1,9 +1,6 @@
#ifndef EFL_OBJECT_MANUAL_IMPL_HH
#define EFL_OBJECT_MANUAL_IMPL_HH
-#define EFL_OBJECT_BETA
-#define EFL_OBJECT_PROTECTED
-
// Skip del. Must be implemented in eo::concrete.
#define EOLIAN_CXX_EFL_DEL_DECLARATION
#define EOLIAN_CXX_EFL_DEL_IMPLEMENTATION
diff --git a/src/lib/edje/edje_part_helper.h b/src/lib/edje/edje_part_helper.h
index c2b184fc7a..671bf657ae 100644
--- a/src/lib/edje/edje_part_helper.h
+++ b/src/lib/edje/edje_part_helper.h
@@ -101,7 +101,7 @@ end: \
__VA_ARGS__; \
if (!no_del_cb) efl_del_intercept_set(proxy, _ ## type ## _del_cb); \
efl_allow_parent_unref_set(proxy, 1); \
- efl_auto_unref_set(proxy, 1); \
+ ___efl_auto_unref_set(proxy, 1); \
return proxy; \
}
diff --git a/src/lib/edje/edje_private.h b/src/lib/edje/edje_private.h
index 3dc4634b30..c5238b3f69 100644
--- a/src/lib/edje/edje_private.h
+++ b/src/lib/edje/edje_private.h
@@ -40,8 +40,6 @@
#endif
// auto_unref
-#define EFL_OBJECT_BETA
-#define EFL_OBJECT_PROTECTED
#define EDJE_OBJECT_BETA
#define EFL_CANVAS_OBJECT_PROTECTED
#define EFL_CANVAS_LAYOUT_CALC_PROTECTED
diff --git a/src/lib/efl/cxx/efl_part_impl.hh b/src/lib/efl/cxx/efl_part_impl.hh
index f40292c6e0..b97dda1457 100644
--- a/src/lib/efl/cxx/efl_part_impl.hh
+++ b/src/lib/efl/cxx/efl_part_impl.hh
@@ -8,7 +8,7 @@
inline ::efl::Object Part::part(::efl::eina::string_view const& name) const \
{ \
::Eo *handle = ::efl_part(_eo_ptr(), name.c_str()); \
- ::efl_auto_unref_set(handle, false); \
+ ::___efl_auto_unref_set(handle, false); \
return ::efl::Object{handle}; \
}
diff --git a/src/lib/elementary/elementary_config.h b/src/lib/elementary/elementary_config.h
index b062509e22..38302542fa 100644
--- a/src/lib/elementary/elementary_config.h
+++ b/src/lib/elementary/elementary_config.h
@@ -15,8 +15,6 @@
#define EFL_CANVAS_OBJECT_PROTECTED
#define EFL_CANVAS_GROUP_PROTECTED
#define EFL_CANVAS_GROUP_BETA
-#define EFL_OBJECT_BETA
-#define EFL_OBJECT_PROTECTED
#define EFL_ACCESS_BETA
#define EFL_ACCESS_COMPONENT_BETA
#define EFL_ACCESS_EDITABLE_TEXT_BETA
diff --git a/src/lib/elementary/elm_part_helper.h b/src/lib/elementary/elm_part_helper.h
index 25001d714e..858dbb4d90 100644
--- a/src/lib/elementary/elm_part_helper.h
+++ b/src/lib/elementary/elm_part_helper.h
@@ -1,9 +1,6 @@
#ifndef _ELM_PART_HELPER_H
#define _ELM_PART_HELPER_H
-#define EFL_OBJECT_BETA
-#define EFL_OBJECT_PROTECTED
-
#include "Elementary.h"
#include "elm_priv.h"
#include "efl_ui_layout_part_legacy.eo.h"
@@ -75,7 +72,7 @@ _elm_part_initialize(Eo *proxy, Eo *obj, const char *part)
EINA_SAFETY_ON_FALSE_RETURN_VAL(pd && obj && part, NULL);
efl_allow_parent_unref_set(proxy, 1);
- efl_auto_unref_set(proxy, 1);
+ ___efl_auto_unref_set(proxy, 1);
pd->part = eina_tmpstr_add(part);
pd->obj = obj;
diff --git a/src/lib/eo/Eo.h b/src/lib/eo/Eo.h
index b3ba90ab88..e7e4bc3c96 100644
--- a/src/lib/eo/Eo.h
+++ b/src/lib/eo/Eo.h
@@ -2144,6 +2144,7 @@ EAPI Eina_Iterator *eo_objects_iterator_new(void);
/* Private for EFL internal use only. Do not use these! */
EAPI int ___efl_ref2_count(const Eo *obj_id);
EAPI void ___efl_ref2_reset(const Eo *obj_id);
+EAPI void ___efl_auto_unref_set(Eo *obj_id, Eina_Bool val);
#endif
diff --git a/src/lib/eo/efl_object.eo b/src/lib/eo/efl_object.eo
index 951a5748ce..1b7c0755bf 100644
--- a/src/lib/eo/efl_object.eo
+++ b/src/lib/eo/efl_object.eo
@@ -279,29 +279,6 @@ abstract Efl.Object ()
even if @.parent is not $null.]]
}
}
- @property auto_unref @protected @beta {
- [[Mark an object to be automatically deleted after a function call.
-
- This becomes effectives only after finalize is done. After any EO
- function has been called on this object, it will be unref'ed. This
- property will also be reset to $false. This is intended to simplify
- Part objects lifecycle.
-
- Note: This applies to any EO function call, even if the object was
- of the wrong type (call resolution failed).
-
- This is a write-only property as reading it would unref the object,
- and reset the flag.
-
- Warning: This is a beta API, do not use it unless you know exactly
- what you are doing.
- ]]
- set {}
- values {
- enable: bool(false);
- [[If $true, unref this object after the next call.]]
- }
- }
}
implements {
class.constructor;
diff --git a/src/lib/eo/eo.c b/src/lib/eo/eo.c
index 8365807e4e..0d443ef625 100644
--- a/src/lib/eo/eo.c
+++ b/src/lib/eo/eo.c
@@ -16,9 +16,6 @@
# include <mach/mach_time.h>
#endif
-#define EFL_OBJECT_BETA
-#define EFL_OBJECT_PROTECTED
-
#include "Eo.h"
#include "eo_ptr_indirection.h"
#include "eo_private.h"
diff --git a/src/lib/eo/eo_base_class.c b/src/lib/eo/eo_base_class.c
index 8eda874cb2..d55ab245c3 100644
--- a/src/lib/eo/eo_base_class.c
+++ b/src/lib/eo/eo_base_class.c
@@ -5,9 +5,6 @@
#include <Eina.h>
#include <fnmatch.h>
-#define EFL_OBJECT_BETA
-#define EFL_OBJECT_PROTECTED
-
#include "Eo.h"
#include "eo_ptr_indirection.h"
#include "eo_private.h"
@@ -2109,12 +2106,12 @@ _efl_object_allow_parent_unref_get(Eo *obj_id EINA_UNUSED, Efl_Object_Data *pd)
return pd->allow_parent_unref;
}
-EOLIAN static void
-_efl_object_auto_unref_set(Eo *obj_id EINA_UNUSED, Efl_Object_Data *pd EINA_UNUSED, Eina_Bool enable)
+EAPI void
+___efl_auto_unref_set(Eo *obj_id, Eina_Bool enable)
{
// Write-only property
EO_OBJ_POINTER(obj_id, obj);
- obj->auto_unref = enable ? 2 : 0;
+ obj->auto_unref = enable ? 1 : 0;
}
EOLIAN static Eo *
diff --git a/src/lib/eo/eo_private.h b/src/lib/eo/eo_private.h
index 676b0fbab6..38f8c9eb03 100644
--- a/src/lib/eo/eo_private.h
+++ b/src/lib/eo/eo_private.h
@@ -119,7 +119,7 @@ struct _Eo_Object
Eina_Bool del_triggered:1;
Eina_Bool destructed:1;
Eina_Bool manual_free:1;
- unsigned char auto_unref : 2; // unref after 1 call
+ unsigned char auto_unref : 1; // unref after 1 call - hack for parts
};
/* How we search and store the implementations in classes. */
diff --git a/src/lib/eolian_cxx/grammar/part_implementation.hpp b/src/lib/eolian_cxx/grammar/part_implementation.hpp
index 692ebca7c1..d88ae05b92 100644
--- a/src/lib/eolian_cxx/grammar/part_implementation.hpp
+++ b/src/lib/eolian_cxx/grammar/part_implementation.hpp
@@ -31,7 +31,7 @@ struct part_implementation_generator
if(!as_generator(string << ">::type "<< string << "::" << string << "() const\n{\n"
<< scope_tab << "::Eo *__return_value = ::efl_part"
<< "(this->_eo_ptr(), \"" << string << "\");\n"
- << scope_tab << "::efl_auto_unref_set(__return_value, false);\n")
+ << scope_tab << "::___efl_auto_unref_set(__return_value, false);\n")
.generate(sink, std::make_tuple(part.klass.eolian_name, klass_name, part.name, part.name), ctx))
return false;
if(!as_generator(scope_tab << "return ::" << *(string << "::"))
diff --git a/src/tests/eo/suite/eo_test_general.c b/src/tests/eo/suite/eo_test_general.c
index 2a26bf8dd1..46c351fdd9 100644
--- a/src/tests/eo/suite/eo_test_general.c
+++ b/src/tests/eo/suite/eo_test_general.c
@@ -9,9 +9,6 @@
# include <unistd.h>
#endif
-#define EFL_OBJECT_BETA
-#define EFL_OBJECT_PROTECTED
-
#include <Eo.h>
#include "eo_suite.h"
@@ -1740,7 +1737,7 @@ START_TEST(efl_object_auto_unref_test)
obj = efl_add(SIMPLE_CLASS, NULL);
fail_if(efl_ref_count(obj) != 1);
efl_event_callback_add(obj, EFL_EVENT_DEL, _auto_unref_del_cb, &_auto_unref_del);
- efl_auto_unref_set(obj, 1);
+ ___efl_auto_unref_set(obj, 1);
fail_if(_auto_unref_del);
fail_if(efl_ref_count(obj) != 1);
efl_name_set(obj, "name");
@@ -1751,7 +1748,7 @@ START_TEST(efl_object_auto_unref_test)
obj = efl_add(SIMPLE_CLASS, NULL);
fail_if(efl_ref_count(obj) != 1);
efl_event_callback_add(obj, EFL_EVENT_DEL, _auto_unref_del_cb, &_auto_unref_del);
- efl_auto_unref_set(obj, 1);
+ ___efl_auto_unref_set(obj, 1);
fail_if(_auto_unref_del);
fail_if(efl_ref_count(obj) != 1);
simple_no_implementation(obj);
@@ -1764,7 +1761,7 @@ START_TEST(efl_object_auto_unref_test)
fail_if(efl_ref_count(obj) != 1);
efl_allow_parent_unref_set(obj, 1);
efl_event_callback_add(obj, EFL_EVENT_DEL, _auto_unref_del_cb, &_auto_unref_del);
- efl_auto_unref_set(obj, 1);
+ ___efl_auto_unref_set(obj, 1);
fail_if(_auto_unref_del);
fail_if(efl_ref_count(obj) != 1);
efl_name_set(obj, "name");