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
This commit is contained in:
Jean-Philippe Andre 2017-06-09 16:36:25 +09:00
parent 1b918594f2
commit 07a25fc88c
4 changed files with 44 additions and 17 deletions

View File

@ -1104,6 +1104,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

View 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;

View 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)
{

View 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).]]
}
}
}
}