summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJean-Philippe Andre <jp.andre@samsung.com>2017-08-03 10:29:21 +0900
committerJean-Philippe Andre <jp.andre@samsung.com>2017-08-04 11:52:16 +0900
commitf0730f6f4ce7e9da485a6b9ddf0f5571c4b1a93e (patch)
treec5969331b2e9a9dd3cea931dacab50d63f4c0053
parentaebd37cab88c5e64cc3e63a218af24100718140b (diff)
downloadefl-f0730f6f4ce7e9da485a6b9ddf0f5571c4b1a93e.tar.gz
layout: Move edje_get to legacy only
Here's the reasoning: 1. We will expose as many edje APIs as possible (and meaningful) through the elm layout class. 2. Access to internal objects is usually risky, as it allows apps to bypass EFL in some ways, leading to potentially undefined behaviours. 3. If the need arises we can still add a similar API back to EO, later. Back to #1, it seems that the need for edje_get() was mostly to call manual sizing functions, or the missing message_send(). I will make sure these are accessible from the layout itself. Ref T5315
-rw-r--r--src/lib/elementary/elm_layout.c5
-rw-r--r--src/lib/elementary/elm_layout.eo19
-rw-r--r--src/lib/elementary/elm_layout_legacy.h20
3 files changed, 23 insertions, 21 deletions
diff --git a/src/lib/elementary/elm_layout.c b/src/lib/elementary/elm_layout.c
index 1e3962b7a3..21ece8b98b 100644
--- a/src/lib/elementary/elm_layout.c
+++ b/src/lib/elementary/elm_layout.c
@@ -1641,9 +1641,10 @@ _elm_layout_table_clear(Eo *obj, Elm_Layout_Smart_Data *sd, const char *part, Ei
return EINA_TRUE;
}
-EOLIAN static Evas_Object*
-_elm_layout_edje_get(Eo *obj, Elm_Layout_Smart_Data *_pd EINA_UNUSED)
+EAPI Evas_Object*
+elm_layout_edje_get(const Eo *obj)
{
+ EINA_SAFETY_ON_FALSE_RETURN_VAL(efl_isa(obj, MY_CLASS), NULL);
ELM_WIDGET_DATA_GET_OR_RETURN(obj, wd, NULL);
return wd->resize_obj;
diff --git a/src/lib/elementary/elm_layout.eo b/src/lib/elementary/elm_layout.eo
index bdd91673a6..4a13d85cb8 100644
--- a/src/lib/elementary/elm_layout.eo
+++ b/src/lib/elementary/elm_layout.eo
@@ -43,25 +43,6 @@ class Elm.Layout (Elm.Widget, Efl.Part, Efl.Container, Efl.File,
style: string; [[The style to used.]]
}
}
- @property edje {
- get {
- [[Get the edje layout
-
- This returns the edje object. It is not expected to be used
- to then swallow objects via \@ref edje_object_part_swallow
- for example. Use \@ref elm_layout_content_set instead so
- child object handling and sizing is done properly.
-
- Note: This function should only be used if you really need
- to call some low level Edje function on this edje object.
- All the common stuff (setting text, emitting signals,
- hooking callbacks to signals, etc.) can be done with
- proper elementary functions.
- ]]
- return: Efl.Canvas.Object; [[An Evas_Object with the edje layout
- settings loaded \@ref elm_layout_file_set.]]
- }
- }
sizing_eval {
[[Eval sizing.
diff --git a/src/lib/elementary/elm_layout_legacy.h b/src/lib/elementary/elm_layout_legacy.h
index 0769014eaf..3fd1058a69 100644
--- a/src/lib/elementary/elm_layout_legacy.h
+++ b/src/lib/elementary/elm_layout_legacy.h
@@ -12,6 +12,26 @@
EAPI Evas_Object *elm_layout_add(Evas_Object *parent);
/**
+ * @brief Get the edje layout
+ *
+ * This returns the edje object. It is not expected to be used to then swallow
+ * objects via @ref edje_object_part_swallow for example. Use @ref
+ * elm_layout_content_set instead so child object handling and sizing is done
+ * properly.
+ *
+ * @note This function should only be used if you really need to call some low
+ * level Edje function on this edje object. All the common stuff (setting text,
+ * emitting signals, hooking callbacks to signals, etc.) can be done with
+ * proper elementary functions.
+ *
+ * @return An Evas_Object with the edje layout settings loaded @ref
+ * elm_layout_file_set.
+ *
+ * @ingroup Elm_Layout
+ */
+EAPI Efl_Canvas_Object *elm_layout_edje_get(const Evas_Object *obj);
+
+/**
* Get the list of swallow parts of a given container widget
*
* @param obj The layout object