summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJean-Philippe Andre <jp.andre@samsung.com>2017-06-09 16:36:25 +0900
committerJean-Philippe Andre <jp.andre@samsung.com>2017-06-12 11:50:30 +0900
commit07a25fc88ce23763ec94183e1b8043e0c6ca7328 (patch)
tree82e22226f5a492a5829b3923755e7964810b6eb3
parent1b918594f2f7d192f4415764450f3ce44a553014 (diff)
downloadefl-07a25fc88ce23763ec94183e1b8043e0c6ca7328.tar.gz
edje: Move base_scale to Efl.Ui.Base
This API is used by elementary widgets like: edje_object_base_scale_get(elm_layout_edje_get(ly)); This means elm_layout in fact should also expose it directly. Ref T5315
-rw-r--r--src/lib/edje/Edje_Legacy.h14
-rw-r--r--src/lib/edje/edje_object.eo16
-rw-r--r--src/lib/edje/edje_util.c10
-rw-r--r--src/lib/efl/interfaces/efl_ui_base.eo21
4 files changed, 44 insertions, 17 deletions
diff --git a/src/lib/edje/Edje_Legacy.h b/src/lib/edje/Edje_Legacy.h
index 6022363e83..b2e8dae8b8 100644
--- a/src/lib/edje/Edje_Legacy.h
+++ b/src/lib/edje/Edje_Legacy.h
@@ -1105,6 +1105,20 @@ EAPI Eina_Bool edje_object_scale_set(Edje_Object *obj, double scale);
EAPI double edje_object_scale_get(const Edje_Object *obj);
/**
+ * @brief Gets a given Edje object's base_scale factor.
+ *
+ * This function returns the base_scale factor set on the obj Edje object. The
+ * base_scale can be set in the collection of edc. If it isn't set, the default
+ * value is 1.0
+ *
+ * @return The base_scale factor (the default value is @ 1.0, that means the
+ * edc file is made based on scale 1.0.
+ *
+ * @ingroup Edje_Object
+ */
+EAPI double edje_object_base_scale_get(const Edje_Object *obj);
+
+/**
* @defgroup Edje_Part_Drag Edje Drag
* @ingroup Edje_Object_Part
*
diff --git a/src/lib/edje/edje_object.eo b/src/lib/edje/edje_object.eo
index 62e6b3b04e..c2613d1013 100644
--- a/src/lib/edje/edje_object.eo
+++ b/src/lib/edje/edje_object.eo
@@ -104,21 +104,6 @@ class Edje.Object (Efl.Canvas.Group.Clipped, Efl.File, Efl.Container, Efl.Part,
}
}
- @property base_scale {
- get {
- [[Gets a given Edje object's base_scale factor.
-
- This function returns the base_scale factor set on the
- obj Edje object.
- The base_scale can be set in the collection of edc.
- If it isn't set, the default value is 1.0]]
- }
- values {
- base_scale: double(1.0); [[The base_scale factor (the default value is @ 1.0,
- that means the edc file is made based on scale 1.0.]]
- }
- }
-
// TODO: Legacy only. EO may rely on futures.
preload {
[[Preloads the images on the Edje Object in the background.
@@ -1184,6 +1169,7 @@ class Edje.Object (Efl.Canvas.Group.Clipped, Efl.File, Efl.Container, Efl.Part,
Efl.Ui.Base.mirrored { set; get; }
Efl.Ui.Base.language { set; get; }
Efl.Ui.Base.scale { set; get; }
+ Efl.Ui.Base.base_scale { get; }
Efl.File.file { get; set; }
Efl.File.mmap { get; set; }
Efl.Container.content_remove;
diff --git a/src/lib/edje/edje_util.c b/src/lib/edje/edje_util.c
index c200bb4350..db1d0d0798 100644
--- a/src/lib/edje/edje_util.c
+++ b/src/lib/edje/edje_util.c
@@ -398,12 +398,18 @@ _edje_object_efl_ui_base_scale_get(Eo *obj EINA_UNUSED, Edje *ed)
}
EOLIAN double
-_edje_object_base_scale_get(Eo *obj EINA_UNUSED, Edje *ed)
+_edje_object_efl_ui_base_base_scale_get(Eo *obj EINA_UNUSED, Edje *ed)
{
- if (!(ed->file)) return 1.0;
+ if (!ed->file) return 1.0;
return TO_DOUBLE(ed->file->base_scale);
}
+EAPI double
+edje_object_base_scale_get(const Eo *obj)
+{
+ return efl_ui_base_scale_get(obj);
+}
+
EOLIAN Eina_Bool
_edje_object_efl_ui_base_mirrored_get(Eo *obj EINA_UNUSED, Edje *ed)
{
diff --git a/src/lib/efl/interfaces/efl_ui_base.eo b/src/lib/efl/interfaces/efl_ui_base.eo
index 5c3b144a07..8e49edb4dd 100644
--- a/src/lib/efl/interfaces/efl_ui_base.eo
+++ b/src/lib/efl/interfaces/efl_ui_base.eo
@@ -58,5 +58,26 @@ interface Efl.Ui.Base
meaning individual scaling is not set)]]
}
}
+ @property base_scale {
+ [[The base scale of a layout object (read-only).
+
+ The base scale refers to the scale for which the backing EDC file
+ was designed. By default it is 1.0 which means the EDC file was
+ designed for a scale of 1.0.
+
+ This base scale can be specified in an EDC file as the
+ collections' "base_scale" field.
+
+ If the object is not a layout, this will return 1.0.
+ ]]
+ get {
+ [[Gets a given layout object's base_scale factor.]]
+ }
+ values {
+ base_scale: double(1.0); [[The base_scale factor (the default value
+ is 1.0, meaning that the edc file was
+ designed based on scale 1.0).]]
+ }
+ }
}
}