summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJean-Philippe Andre <jp.andre@samsung.com>2017-05-26 11:53:27 +0900
committerJean-Philippe Andre <jp.andre@samsung.com>2017-05-29 10:49:17 +0900
commit11d4daf90a04639dcb8c75f793bc6c976f3c1808 (patch)
tree30e3ea084e0f95683554eebe4f72e55fa9ba6fe1
parentda2a7e65879de8de51ce8a5b999a1d544abc8938 (diff)
edje: Move part_state_get to efl_part
-rw-r--r--src/lib/edje/Edje_Legacy.h12
-rw-r--r--src/lib/edje/edje_legacy.c8
-rw-r--r--src/lib/edje/edje_object.eo14
-rw-r--r--src/lib/edje/edje_part.c11
-rw-r--r--src/lib/edje/edje_private.h1
-rw-r--r--src/lib/edje/edje_util.c4
-rw-r--r--src/lib/edje/efl_canvas_layout_internal.eo26
7 files changed, 58 insertions, 18 deletions
diff --git a/src/lib/edje/Edje_Legacy.h b/src/lib/edje/Edje_Legacy.h
index 7a7b46da45..2b0ba0afa9 100644
--- a/src/lib/edje/Edje_Legacy.h
+++ b/src/lib/edje/Edje_Legacy.h
@@ -176,6 +176,18 @@ EAPI const char *edje_load_error_str (Edje_Load_Error error);
176EAPI Eina_Bool edje_object_part_geometry_get(const Edje_Object *obj, const char * part, int *x, int *y, int *w, int *h); 176EAPI Eina_Bool edje_object_part_geometry_get(const Edje_Object *obj, const char * part, int *x, int *y, int *w, int *h);
177 177
178/** 178/**
179 * @brief Returns the state of the Edje part.
180 *
181 * @param[in] part The part name
182 * @param[out] val_ret Part state value
183 *
184 * @return The part state: "default" for the default state "" for other states
185 *
186 * @ingroup Edje_Object
187 */
188EAPI const char *edje_object_part_state_get(const Edje_Object *obj, const char * part, double *val_ret);
189
190/**
179 * @brief Gets a handle to the Evas object implementing a given Edje part, in 191 * @brief Gets a handle to the Evas object implementing a given Edje part, in
180 * an Edje object. 192 * an Edje object.
181 * 193 *
diff --git a/src/lib/edje/edje_legacy.c b/src/lib/edje/edje_legacy.c
index 693fd316d5..c349adbefe 100644
--- a/src/lib/edje/edje_legacy.c
+++ b/src/lib/edje/edje_legacy.c
@@ -39,3 +39,11 @@ edje_object_part_geometry_get(const Edje_Object *obj, const char *part, int *x,
39 if (h) *h = rp->h; 39 if (h) *h = rp->h;
40 return EINA_TRUE; 40 return EINA_TRUE;
41} 41}
42
43EAPI const char *
44edje_object_part_state_get(const Edje_Object *obj, const char * part, double *val_ret)
45{
46 const char *str = "";
47 efl_canvas_layout_internal_state_get(efl_part(obj, part), &str, val_ret);
48 return str;
49}
diff --git a/src/lib/edje/edje_object.eo b/src/lib/edje/edje_object.eo
index 69b2ce7d12..9318103880 100644
--- a/src/lib/edje/edje_object.eo
+++ b/src/lib/edje/edje_object.eo
@@ -823,20 +823,6 @@ class Edje.Object (Efl.Canvas.Group.Clipped, Efl.File, Efl.Container, Efl.Part,
823 group]] 823 group]]
824 } 824 }
825 } 825 }
826 @property part_state {
827 get {
828 [[Returns the state of the Edje part.]]
829 return: string; [[The part state:
830 "default" for the default state
831 "" for other states]]
832 }
833 keys {
834 part: string; [[The part name]]
835 }
836 values {
837 val_ret: double; [[Part state value]]
838 }
839 }
840 @property part_drag_value { 826 @property part_drag_value {
841 set { 827 set {
842 [[Sets the dragable object location. 828 [[Sets the dragable object location.
diff --git a/src/lib/edje/edje_part.c b/src/lib/edje/edje_part.c
index 5f7c314048..fe2c23ad14 100644
--- a/src/lib/edje/edje_part.c
+++ b/src/lib/edje/edje_part.c
@@ -53,4 +53,15 @@ _efl_canvas_layout_internal_efl_gfx_geometry_get(Eo *obj EINA_UNUSED, Efl_Canvas
53 RETURN_VOID; 53 RETURN_VOID;
54} 54}
55 55
56EOLIAN static void
57_efl_canvas_layout_internal_state_get(Eo *obj EINA_UNUSED, Efl_Canvas_Layout_Internal_Data *pd, const char **name, double *val)
58{
59 const char *str;
60
61 if (!name && !val) return;
62 str = _edje_object_part_state_get(pd->ed, pd->part, val);
63 if (name) *name = str;
64 RETURN_VOID;
65}
66
56#include "efl_canvas_layout_internal.eo.c" 67#include "efl_canvas_layout_internal.eo.c"
diff --git a/src/lib/edje/edje_private.h b/src/lib/edje/edje_private.h
index 34fae264c0..2911bc2901 100644
--- a/src/lib/edje/edje_private.h
+++ b/src/lib/edje/edje_private.h
@@ -2506,6 +2506,7 @@ void _edje_seat_emit(Edje *ed, Efl_Input_Device *dev, const char *sig, const cha
2506void _edje_emit_full(Edje *ed, const char *sig, const char *src, void *data, void (*free_func)(void *)); 2506void _edje_emit_full(Edje *ed, const char *sig, const char *src, void *data, void (*free_func)(void *));
2507void _edje_emit_handle(Edje *ed, const char *sig, const char *src, Edje_Message_Signal_Data *data, Eina_Bool prop); 2507void _edje_emit_handle(Edje *ed, const char *sig, const char *src, Edje_Message_Signal_Data *data, Eina_Bool prop);
2508void _edje_signals_sources_patterns_clean(Edje_Signals_Sources_Patterns *ssp); 2508void _edje_signals_sources_patterns_clean(Edje_Signals_Sources_Patterns *ssp);
2509const char * _edje_object_part_state_get(Edje *ed, const char *part, double *val_ret);
2509 2510
2510void _edje_focused_part_set(Edje *ed, const char *seat_name, Edje_Real_Part *rp); 2511void _edje_focused_part_set(Edje *ed, const char *seat_name, Edje_Real_Part *rp);
2511Edje_Real_Part *_edje_focused_part_get(Edje *ed, const char *seat_name); 2512Edje_Real_Part *_edje_focused_part_get(Edje *ed, const char *seat_name);
diff --git a/src/lib/edje/edje_util.c b/src/lib/edje/edje_util.c
index 17c9a064a1..86e38958b3 100644
--- a/src/lib/edje/edje_util.c
+++ b/src/lib/edje/edje_util.c
@@ -3950,8 +3950,8 @@ again:
3950} 3950}
3951 3951
3952/* FIXME: Correctly return other states */ 3952/* FIXME: Correctly return other states */
3953EOLIAN const char * 3953const char *
3954_edje_object_part_state_get(Eo *obj EINA_UNUSED, Edje *ed, const char *part, double *val_ret) 3954_edje_object_part_state_get(Edje *ed, const char *part, double *val_ret)
3955{ 3955{
3956 const char *ret; 3956 const char *ret;
3957 3957
diff --git a/src/lib/edje/efl_canvas_layout_internal.eo b/src/lib/edje/efl_canvas_layout_internal.eo
index 0a523f3b8d..4fe1344d7e 100644
--- a/src/lib/edje/efl_canvas_layout_internal.eo
+++ b/src/lib/edje/efl_canvas_layout_internal.eo
@@ -1,9 +1,31 @@
1class Efl.Canvas.Layout_Internal (Efl.Object, Efl.Gfx) 1class Efl.Canvas.Layout_Internal (Efl.Object, Efl.Gfx)
2{ 2{
3 [[Common class for part proxy objects for $Efl.Canvas.Layout.]] 3 [[Common class for part proxy objects for $Efl.Canvas.Layout.
4
5 As an @Efl.Part implementation class, all objects of this class are meant
6 to be used for one and only one function call. In pseudo-code, the use
7 of object of this type looks like the following:
8 layout.part("somepart").geometry_get(&x, &y, &w, &h);
9
10 @since 1.20
11 ]]
12 methods {
13 @property state {
14 [[The name and value of the current state of this part (read-only).
15
16 This is the state name as it appears in EDC description blocks. A
17 state has both a name and a value (double). The default state is
18 "default" 0.0.
19 ]]
20 get {}
21 values {
22 state: string("default"); [[The name of the state.]]
23 val: double; [[The value of the state.]]
24 }
25 }
26 }
4 implements { 27 implements {
5 Efl.Object.finalize; 28 Efl.Object.finalize;
6 Efl.Gfx.geometry { get; } 29 Efl.Gfx.geometry { get; }
7 //Efl.Gfx.Size.size { get; }
8 } 30 }
9} 31}