edje: Move base_scale to Efl.Ui.Base
authorJean-Philippe Andre <jp.andre@samsung.com>
Fri, 9 Jun 2017 07:36:25 +0000 (16:36 +0900)
committerJean-Philippe Andre <jp.andre@samsung.com>
Mon, 12 Jun 2017 02:50:30 +0000 (11:50 +0900)
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

src/lib/edje/Edje_Legacy.h
src/lib/edje/edje_object.eo
src/lib/edje/edje_util.c
src/lib/efl/interfaces/efl_ui_base.eo

index 6022363..b2e8dae 100644 (file)
@@ -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
  *
index 62e6b3b..c2613d1 100644 (file)
@@ -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;
index c200bb4..db1d0d0 100644 (file)
@@ -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)
 {
index 5c3b144..8e49edb 100644 (file)
@@ -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).]]
+         }
+      }
    }
 }