aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJean-Philippe Andre <jp.andre@samsung.com>2017-11-29 17:35:43 +0900
committerJean-Philippe Andre <jp.andre@samsung.com>2017-11-30 10:48:24 +0900
commit73e3a82bc2046f26de3c76e38c525fd1218df088 (patch)
tree241699b8b0d85b8959b50c137da3138282385b3f
parentelm_code: If showing line numbers don't resize at 10 lines. (diff)
downloadefl-73e3a82bc2046f26de3c76e38c525fd1218df088.tar.gz
edje: Move perspective to legacy
Note: Edje.Perspective is not bound to EO, and this is the only reason why I'm moving this to legacy only. Marking as beta would mean the legacy APIs would not be generated, so that would have almost the same effect as moving to legacy. It would be nice to actually support this in EO, though this seems like a rarely used feature. Ref https://phab.enlightenment.org/T5315
-rw-r--r--src/lib/edje/Edje_Common.h118
-rw-r--r--src/lib/edje/Edje_Legacy.h152
-rw-r--r--src/lib/edje/edje_object.eo30
-rw-r--r--src/lib/edje/edje_util.c11
4 files changed, 159 insertions, 152 deletions
diff --git a/src/lib/edje/Edje_Common.h b/src/lib/edje/Edje_Common.h
index 69e4585e55..c347589a66 100644
--- a/src/lib/edje/Edje_Common.h
+++ b/src/lib/edje/Edje_Common.h
@@ -2022,124 +2022,6 @@ EAPI void edje_message_signal_process (void);
*/
/**
- * @defgroup Edje_Perspective Edje Perspective
- * @ingroup Edje_Object_Group
- *
- * @brief Functions that deal with 3D projection of an 2D object.
- *
- * Perspective is a graphical tool that makes objets represented in 2D
- * look like they have a 3D appearance.
- *
- * Edje allows us to use perspective on any edje object. This group of
- * functions deal with the use of perspective, by creating and configuring
- * a perspective object that must set to a edje object or a canvas,
- * affecting all the objects inside that have no particular perspective
- * set already.
- *
- * @{
- */
-
-/**
- * @brief Creates a new perspective in the given canvas.
- *
- * @param e The given canvas (Evas).
- * @return An @ref Edje_Perspective object for this canvas, or @c NULL on errors.
- *
- * This function creates a perspective object that can be set on an Edje
- * object, or globally to all Edje objects on this canvas.
- *
- * @see edje_perspective_set()
- * @see edje_perspective_free()
- */
-EAPI Edje_Perspective *edje_perspective_new (Evas *e);
-/**
- * @brief Deletes the given perspective object.
- *
- * @param ps A valid perspective object, or @c NULL.
- *
- * This function will delete the perspective object. If the perspective
- * effect was being applied to any Edje object or part, this effect won't be
- * applied anymore.
- *
- * @see edje_perspective_new()
- */
-EAPI void edje_perspective_free (Edje_Perspective *ps);
-/**
- * @brief Sets up the transform for this perspective object.
- *
- * This sets the parameters of the perspective transformation. X, Y and Z
- * values are used. The px and py points specify the "infinite distance" point
- * in the 3D conversion (where all lines converge to like when artists draw
- * 3D by hand). The @p z0 value specifies the z value at which there is a 1:1
- * mapping between spatial coordinates and screen coordinates. Any points
- * on this z value will not have their X and Y values modified in the transform.
- * Those further away (Z value higher) will shrink into the distance, and
- * those less than this value will expand and become bigger. The @p foc value
- * determines the "focal length" of the camera. This is in reality the distance
- * between the camera lens plane itself (at or closer than this rendering
- * results are undefined) and the "z0" z value. This allows for some "depth"
- * control and @p foc must be greater than 0.
- *
- * @param ps The perspective object
- * @param px The perspective distance X coordinate
- * @param py The perspective distance Y coordinate
- * @param z0 The "0" z plane value
- * @param foc The focal distance
- */
-EAPI void edje_perspective_set (Edje_Perspective *ps, Evas_Coord px, Evas_Coord py, Evas_Coord z0, Evas_Coord foc);
-/**
- * @brief Makes this perspective object be global for its canvas.
- *
- * @param ps The given perspective object
- * @param global @c EINA_TRUE if the perspective should be global, @c
- * EINA_FALSE otherwise.
- *
- * The canvas which this perspective object is being set as global is the one
- * given as argument upon the object creation (the @p evas parameter on the
- * function @c edje_perspective_new(evas) ).
- *
- * There can be only one global perspective object set per canvas, and if
- * a perspective object is set to global when there was already another
- * global perspective set, the old one will be set as non-global.
- *
- * A global perspective just affects a part if its Edje object doesn't have a
- * perspective object set to it, and if the part doesn't point to another
- * part to be used as perspective.
- *
- * @see edje_object_perspective_set()
- * @see edje_perspective_global_get()
- * @see edje_perspective_new()
- */
-EAPI void edje_perspective_global_set (Edje_Perspective *ps, Eina_Bool global);
-/**
- * @brief Gets whether the given perspective object is global or not.
- *
- * @param ps The given perspective object.
- * @return @c EINA_TRUE if this perspective object is global, @c EINA_FALSE
- * otherwise.
- *
- * @see edje_perspective_global_set()
- */
-EAPI Eina_Bool edje_perspective_global_get (const Edje_Perspective *ps);
-/**
- * @brief Gets the global perspective object set for this canvas.
- *
- * @param e The given canvas (Evas).
- * @return The perspective object set as global for this canvas. Or @c NULL
- * if there is no global perspective set and on errors.
- *
- * This function will return the perspective object that was set as global
- * with edje_perspective_global_set().
- *
- * @see edje_perspective_global_set()
- * @see edje_perspective_global_get()
- */
-EAPI const Edje_Perspective *edje_evas_global_perspective_get(const Evas *e);
-/**
- * @}
- */
-
-/**
* @defgroup Edje_Audio Edje Audio
* @ingroup Edje
*
diff --git a/src/lib/edje/Edje_Legacy.h b/src/lib/edje/Edje_Legacy.h
index 0c35d4ac42..78d9656bfe 100644
--- a/src/lib/edje/Edje_Legacy.h
+++ b/src/lib/edje/Edje_Legacy.h
@@ -2933,6 +2933,158 @@ EAPI void edje_object_size_max_get(const Edje_Object *obj, int *maxw, int *maxh)
*/
EAPI Eina_Bool edje_object_part_exists(const Edje_Object *obj, const char *part);
+
+/**
+ * @defgroup Edje_Perspective Edje Perspective
+ * @ingroup Edje_Object_Group
+ *
+ * @brief Functions that deal with 3D projection of an 2D object.
+ *
+ * Perspective is a graphical tool that makes objets represented in 2D
+ * look like they have a 3D appearance.
+ *
+ * Edje allows us to use perspective on any edje object. This group of
+ * functions deal with the use of perspective, by creating and configuring
+ * a perspective object that must set to a edje object or a canvas,
+ * affecting all the objects inside that have no particular perspective
+ * set already.
+ *
+ * @{
+ */
+
+/**
+ * @brief Creates a new perspective in the given canvas.
+ *
+ * @param e The given canvas (Evas).
+ * @return An @ref Edje_Perspective object for this canvas, or @c NULL on errors.
+ *
+ * This function creates a perspective object that can be set on an Edje
+ * object, or globally to all Edje objects on this canvas.
+ *
+ * @see edje_perspective_set()
+ * @see edje_perspective_free()
+ */
+EAPI Edje_Perspective *edje_perspective_new (Evas *e);
+/**
+ * @brief Deletes the given perspective object.
+ *
+ * @param ps A valid perspective object, or @c NULL.
+ *
+ * This function will delete the perspective object. If the perspective
+ * effect was being applied to any Edje object or part, this effect won't be
+ * applied anymore.
+ *
+ * @see edje_perspective_new()
+ */
+EAPI void edje_perspective_free (Edje_Perspective *ps);
+/**
+ * @brief Sets up the transform for this perspective object.
+ *
+ * This sets the parameters of the perspective transformation. X, Y and Z
+ * values are used. The px and py points specify the "infinite distance" point
+ * in the 3D conversion (where all lines converge to like when artists draw
+ * 3D by hand). The @p z0 value specifies the z value at which there is a 1:1
+ * mapping between spatial coordinates and screen coordinates. Any points
+ * on this z value will not have their X and Y values modified in the transform.
+ * Those further away (Z value higher) will shrink into the distance, and
+ * those less than this value will expand and become bigger. The @p foc value
+ * determines the "focal length" of the camera. This is in reality the distance
+ * between the camera lens plane itself (at or closer than this rendering
+ * results are undefined) and the "z0" z value. This allows for some "depth"
+ * control and @p foc must be greater than 0.
+ *
+ * @param ps The perspective object
+ * @param px The perspective distance X coordinate
+ * @param py The perspective distance Y coordinate
+ * @param z0 The "0" z plane value
+ * @param foc The focal distance
+ */
+EAPI void edje_perspective_set (Edje_Perspective *ps, Evas_Coord px, Evas_Coord py, Evas_Coord z0, Evas_Coord foc);
+/**
+ * @brief Makes this perspective object be global for its canvas.
+ *
+ * @param ps The given perspective object
+ * @param global @c EINA_TRUE if the perspective should be global, @c
+ * EINA_FALSE otherwise.
+ *
+ * The canvas which this perspective object is being set as global is the one
+ * given as argument upon the object creation (the @p evas parameter on the
+ * function @c edje_perspective_new(evas) ).
+ *
+ * There can be only one global perspective object set per canvas, and if
+ * a perspective object is set to global when there was already another
+ * global perspective set, the old one will be set as non-global.
+ *
+ * A global perspective just affects a part if its Edje object doesn't have a
+ * perspective object set to it, and if the part doesn't point to another
+ * part to be used as perspective.
+ *
+ * @see edje_object_perspective_set()
+ * @see edje_perspective_global_get()
+ * @see edje_perspective_new()
+ */
+EAPI void edje_perspective_global_set (Edje_Perspective *ps, Eina_Bool global);
+/**
+ * @brief Gets whether the given perspective object is global or not.
+ *
+ * @param ps The given perspective object.
+ * @return @c EINA_TRUE if this perspective object is global, @c EINA_FALSE
+ * otherwise.
+ *
+ * @see edje_perspective_global_set()
+ */
+EAPI Eina_Bool edje_perspective_global_get (const Edje_Perspective *ps);
+/**
+ * @brief Gets the global perspective object set for this canvas.
+ *
+ * @param e The given canvas (Evas).
+ * @return The perspective object set as global for this canvas. Or @c NULL
+ * if there is no global perspective set and on errors.
+ *
+ * This function will return the perspective object that was set as global
+ * with edje_perspective_global_set().
+ *
+ * @see edje_perspective_global_set()
+ * @see edje_perspective_global_get()
+ */
+EAPI const Edje_Perspective *edje_evas_global_perspective_get(const Evas *e);
+
+/**
+ * @brief Sets the given perspective object on this Edje object.
+ *
+ * Make the given perspective object be the default perspective for this Edje
+ * object.
+ *
+ * There can be only one perspective object per Edje object, and if a previous
+ * one was set, it will be removed and the new perspective object will be used.
+ *
+ * An Edje perspective will only affect a part if it doesn't point to another
+ * part to be used as perspective.
+ *
+ * @ref edje_object_perspective_new() See also
+ * @ref edje_object_perspective_get() @ref edje_perspective_set()
+ *
+ * @param[in] obj The object.
+ * @param[in] ps The perspective object that will be used.
+ */
+EAPI void edje_object_perspective_set(Edje_Object *obj, Edje_Perspective *ps);
+
+/**
+ * @brief Gets the current perspective used on this Edje object.
+ *
+ * See also @ref edje_object_perspective_set()
+ *
+ * @param[in] obj The object.
+ *
+ * @return The perspective object that will be used.
+ */
+EAPI const Edje_Perspective *edje_object_perspective_get(const Edje_Object *obj);
+
+/**
+ * @}
+ */
+
+
typedef Efl_Canvas_Layout_Part_Type Edje_Part_Type;
#define EDJE_PART_TYPE_NONE EFL_CANVAS_LAYOUT_PART_TYPE_NONE
#define EDJE_PART_TYPE_RECTANGLE EFL_CANVAS_LAYOUT_PART_TYPE_RECTANGLE
diff --git a/src/lib/edje/edje_object.eo b/src/lib/edje/edje_object.eo
index 90fd21ac2d..d077b6a3e0 100644
--- a/src/lib/edje/edje_object.eo
+++ b/src/lib/edje/edje_object.eo
@@ -35,36 +35,6 @@ class Edje.Object (Efl.Canvas.Group, Efl.File, Efl.Container, Efl.Part,
on: bool; [[The animation state, $true by default.]]
}
}
- @property perspective {
- set {
- [[Sets the given perspective object on this Edje object.
-
- Make the given perspective object be the default perspective for this Edje
- object.
-
- There can be only one perspective object per Edje object, and if a
- previous one was set, it will be removed and the new perspective object
- will be used.
-
- An Edje perspective will only affect a part if it doesn't point to another
- part to be used as perspective.
-
- \@ref edje_object_perspective_new()
- See also @.perspective.get()
- \@ref edje_perspective_set()]]
- values {
- ps: ptr(Edje.Perspective); [[The perspective object that will be used.]]
- }
- }
- get {
- [[Gets the current perspective used on this Edje object.
-
- See also @.perspective.set()]]
- values {
- @cref ps: Edje.Perspective; [[The perspective object that will be used.]]
- }
- }
- }
access_part_iterate @beta {
[[Iterates over all accessibility-enabled part names.]]
diff --git a/src/lib/edje/edje_util.c b/src/lib/edje/edje_util.c
index f1b00c7eb4..fc47e43b13 100644
--- a/src/lib/edje/edje_util.c
+++ b/src/lib/edje/edje_util.c
@@ -4920,9 +4920,10 @@ edje_evas_global_perspective_get(const Evas *e)
return evas_object_data_get(obj, "_edje_perspective");
}
-EOLIAN void
-_edje_object_perspective_set(Eo *obj, Edje *ed, Edje_Perspective *ps)
+EAPI void
+edje_object_perspective_set(Eo *obj, Edje_Perspective *ps)
{
+ Edje *ed = _edje_fetch(obj);
if (!ed) return;
if (ed->persp == ps) return;
if (ed->persp != ps)
@@ -4937,9 +4938,11 @@ _edje_object_perspective_set(Eo *obj, Edje *ed, Edje_Perspective *ps)
_edje_recalc_do(ed);
}
-EOLIAN const Edje_Perspective *
-_edje_object_perspective_get(Eo *obj EINA_UNUSED, Edje *ed)
+EAPI const Edje_Perspective *
+edje_object_perspective_get(const Eo *obj)
{
+ Edje *ed =_edje_fetch(obj);
+ if (!ed) return NULL;
return ed->persp;
}