### Library
edje_eolian_files = \
+ lib/edje/efl_canvas_layout_calc.eo \
lib/edje/edje_object.eo \
lib/edje/efl_canvas_layout_internal.eo \
lib/edje/efl_canvas_layout_internal_box.eo \
#include <Efl.h>
+#include "efl_canvas_layout_calc.eo.h"
#include "edje_object.eo.h"
#include "edje_edit.eo.h"
EAPI const Efl_Canvas_Object *edje_object_part_object_get(const Edje_Object *obj, const char * part);
/**
+ * @brief Whether this object updates its size hints automatically.
+ *
+ * By default edje doesn't set size hints on itself. If this property is set to
+ * @c true, size hints will be updated after recalculation. Be careful, as
+ * recalculation may happen often, enabling this property may have a
+ * considerable performance impact as other widgets will be notified of the
+ * size hints changes.
+ *
+ * A layout recalculation can be triggered by @ref edje_object_size_min_calc(),
+ * @ref edje_object_size_min_restricted_calc(),
+ * @ref edje_object_parts_extends_calc() or even any other internal event.
+ *
+ * Enable or disable auto-update of size hints.
+ *
+ * @param[in] update Whether or not update the size hints.
+ *
+ * @ingroup Edje_Object
+ */
+EAPI void edje_object_update_hints_set(Edje_Object *obj, Eina_Bool update);
+
+/**
+ * @brief Whether this object updates its size hints automatically.
+ *
+ * By default edje doesn't set size hints on itself. If this property is set to
+ * @c true, size hints will be updated after recalculation. Be careful, as
+ * recalculation may happen often, enabling this property may have a
+ * considerable performance impact as other widgets will be notified of the
+ * size hints changes.
+ *
+ * A layout recalculation can be triggered by @ref edje_object_size_min_calc(),
+ * @ref edje_object_size_min_restricted_calc(),
+ * @ref edje_object_parts_extends_calc() or even any other internal event.
+ *
+ * Whether this object updates its size hints automatically.
+ *
+ * @return Whether or not update the size hints.
+ *
+ * @ingroup Edje_Object
+ */
+EAPI Eina_Bool edje_object_update_hints_get(const Edje_Object *obj);
+
+/**
+ * @brief Calculates the minimum required size for a given Edje object.
+ *
+ * This call works exactly as edje_object_size_min_restricted_calc(), with the
+ * last two arguments set to 0. Please refer to its documentation, then.
+ *
+ * @param[out] minw The minimum required width (return value)
+ * @param[out] minh The minimum required height (return value)
+ *
+ * @ingroup Edje_Object
+ */
+EAPI void edje_object_size_min_calc(Edje_Object *obj, int *minw, int *minh);
+
+/**
+ * @brief Calculates the minimum required size for a given Edje object.
+ *
+ * This call will trigger an internal recalculation of all parts of the object,
+ * in order to return its minimum required dimensions for width and height. The
+ * user might choose to impose those minimum sizes, making the resulting
+ * calculation to get to values equal or larger than @c restrictedw and
+ * @c restrictedh, for width and height, respectively.
+ *
+ * @note At the end of this call, the object won't be automatically resized to
+ * the new dimensions, but just return the calculated sizes. The caller is the
+ * one up to change its geometry or not.
+ *
+ * @warning Be advised that invisible parts in the object will be taken into
+ * account in this calculation.
+ *
+ * @param[out] minw The minimum required width (return value)
+ * @param[out] minh The minimum required height (return value)
+ * @param[in] restrictedw The minimum width constraint as input, @c minw can
+ * not be lower than this
+ * @param[in] restrictedh The minimum height constraint as input, @c minh can
+ * not be lower than this
+ *
+ * @ingroup Edje_Object
+ */
+EAPI void edje_object_size_min_restricted_calc(Edje_Object *obj, int *minw, int *minh, int restrictedw, int restrictedh);
+
+/**
+ * @brief Calculates the geometry of the region, relative to a given Edje
+ * object's area, occupied by all parts in the object.
+ *
+ * This function gets the geometry of the rectangle equal to the area required
+ * to group all parts in obj's group/collection. The x and y coordinates are
+ * relative to the top left corner of the whole obj object's area. Parts placed
+ * out of the group's boundaries will also be taken in account, so that x and y
+ * may be negative.
+ *
+ * @note On failure, this function will make all non-$null geometry pointers'
+ * pointed variables be set to zero.
+ *
+ * @param[out] x The parts region's X coordinate
+ * @param[out] y The parts region's Y coordinate
+ * @param[out] w The parts region's width
+ * @param[out] h The parts region's height
+ *
+ * @return @c true on success, @c false otherwise
+ *
+ * @ingroup Edje_Object
+ */
+EAPI Eina_Bool edje_object_parts_extends_calc(Edje_Object *obj, int *x, int *y, int *w, int *h);
+
+/**
+ * @brief Forces a Size/Geometry calculation.
+ *
+ * Forces the object to recalculate its layout regardless of freeze/thaw.
+ *
+ * See also @ref edje_object_freeze and @ref edje_object_thaw.
+ *
+ * @ingroup Edje_Object
+ */
+EAPI void edje_object_calc_force(Edje_Object *obj);
+
+/**
+ * @brief Freezes the Edje object.
+ *
+ * This function puts all changes on hold. Successive freezes will nest,
+ * requiring an equal number of thaws.
+ *
+ * See also @ref edje_object_thaw()
+ *
+ * @return The frozen state or 0 on error
+ *
+ * @ingroup Edje_Object
+ */
+EAPI int edje_object_freeze(Edje_Object *obj);
+
+/**
+ * @brief Thaws the Edje object.
+ *
+ * This function thaws the given Edje object.
+ *
+ * @note If sucessive freezes were done, an equal number of thaws will be
+ * required.
+ *
+ * See also @ref edje_object_freeze()
+ *
+ * @return The frozen state or 0 if the object is not frozen or on error.
+ *
+ * @ingroup Edje_Object
+ */
+EAPI int edje_object_thaw(Edje_Object *obj);
+
+
+
+/**
* @ingroup Edje_Object_Communication_Interface_Message
*
* @{
if (ed->text_change.func)
ed->text_change.func(ed->text_change.data, obj, part);
}
+
+/* Calc interface APIs */
+
+EAPI void
+edje_object_update_hints_set(Edje_Object *obj, Eina_Bool update)
+{
+ efl_canvas_layout_calc_auto_update_hints_set(obj, update);
+}
+
+EAPI Eina_Bool
+edje_object_update_hints_get(const Edje_Object *obj)
+{
+ return efl_canvas_layout_calc_auto_update_hints_get(obj);
+}
+
+EAPI void
+edje_object_size_min_calc(Edje_Object *obj, int *minw, int *minh)
+{
+ efl_canvas_layout_calc_size_min(obj, minw, minh);
+}
+
+EAPI void
+edje_object_size_min_restricted_calc(Edje_Object *obj, int *minw, int *minh, int restrictedw, int restrictedh)
+{
+ efl_canvas_layout_calc_size_min_restricted(obj, minw, minh, restrictedw, restrictedh);
+}
+
+EAPI Eina_Bool
+edje_object_parts_extends_calc(Edje_Object *obj, int *x, int *y, int *w, int *h)
+{
+ return efl_canvas_layout_calc_parts_extends(obj, x, y, w, h);
+}
+
+EAPI int
+edje_object_freeze(Edje_Object *obj)
+{
+ return efl_canvas_layout_calc_freeze(obj);
+}
+
+EAPI int
+edje_object_thaw(Edje_Object *obj)
+{
+ return efl_canvas_layout_calc_thaw(obj);
+}
+
+EAPI void
+edje_object_calc_force(Edje_Object *obj)
+{
+ efl_canvas_layout_calc_force(obj);
+}
// FIXME: This EO doc needs a direct link to the "edcref" doc
class Edje.Object (Efl.Canvas.Group.Clipped, Efl.File, Efl.Container, Efl.Part,
- Efl.Observer, Efl.Ui.Base)
+ Efl.Observer, Efl.Ui.Base, Efl.Canvas.Layout_Calc)
{
[[Edje object class]]
legacy_prefix: edje_object;
}
}
- /* EDJE CALC APIS BEGIN ---------------------------------------------- */
- @property calc_update_hints {
- [[Whether this object updates its size hints automatically.
-
- By default edje doesn't set size hints on itself. If this property
- is set to $true, size hints will be updated after recalculation.
- Be careful, as recalculation may happen often, enabling this
- property may have a considerable performance impact as other widgets
- will be notified of the size hints changes.
-
- A layout recalculation can be triggered by @.size_min_calc(),
- @.size_min_restricted_calc(), @.parts_extends_calc() or even any
- other internal event.
- ]]
- set {
- [[Enable or disable auto-update of size hints.]]
- legacy: edje_object_update_hints_set;
- }
- get {
- [[Whether this object updates its size hints automatically.]]
- legacy: edje_object_update_hints_get;
- }
- values {
- update: bool(false); [[Whether or not update the size hints.]]
- }
- }
- // FIXME: Prefix with calc_ ?
- size_min_calc {
- [[Calculates the minimum required size for a given Edje object.
-
- This call works exactly as edje_object_size_min_restricted_calc(),
- with the last two arguments set to 0. Please refer to its
- documentation, then.
- ]]
- // FIXME: Return a 2D size type (no @out values)
- params {
- @out minw: int; [[The minimum required width (return value)]]
- @out minh: int; [[The minimum required height (return value)]]
- }
- }
- // FIXME: Prefix with calc_ ?
- size_min_restricted_calc {
- [[Calculates the minimum required size for a given Edje object.
-
- This call will trigger an internal recalculation of all parts of
- the object, in order to return its minimum required dimensions for
- width and height. The user might choose to impose those minimum
- sizes, making the resulting calculation to get to values equal or
- larger than $restrictedw and $restrictedh, for width and height,
- respectively.
-
- Note: At the end of this call, the object won't be automatically
- resized to the new dimensions, but just return the calculated sizes.
- The caller is the one up to change its geometry or not.
-
- Warning: Be advised that invisible parts in the object will be taken
- into account in this calculation.
- ]]
- // FIXME: Return a 2D size type (no @out values)
- params {
- @out minw: int; [[The minimum required width (return value)]]
- @out minh: int; [[The minimum required height (return value)]]
- @in restrictedw: int; [[The minimum width constraint as input,
- $minw can not be lower than this]]
- @in restrictedh: int; [[The minimum height constraint as input,
- $minh can not be lower than this]]
- }
- }
- // FIXME: Prefix with calc_ ?
- parts_extends_calc {
- [[Calculates the geometry of the region, relative to a given Edje
- object's area, occupied by all parts in the object.
-
- This function gets the geometry of the rectangle equal to the area
- required to group all parts in obj's group/collection. The x
- and y coordinates are relative to the top left corner of the
- whole obj object's area. Parts placed out of the group's
- boundaries will also be taken in account, so that x and y
- may be negative.
-
- Note: On failure, this function will make all non-$null geometry
- pointers' pointed variables be set to zero.
- ]]
- return: bool; [[$true on success, $false otherwise]]
- /* FIXME: Return a 2D size type (no @out values) */
- params {
- @out x: int; [[The parts region's X coordinate]]
- @out y: int; [[The parts region's Y coordinate]]
- @out w: int; [[The parts region's width]]
- @out h: int; [[The parts region's height]]
- }
- }
- calc_force {
- [[Forces a Size/Geometry calculation.
-
- Forces the object to recalculate its layout regardless of
- freeze/thaw.
-
- See also @.calc_freeze and @.calc_thaw.
- ]]
- }
- calc_freeze {
- [[Freezes the Edje object.
-
- This function puts all changes on hold. Successive freezes will
- nest, requiring an equal number of thaws.
-
- See also @.calc_thaw()
- ]]
- return: int; [[The frozen state or 0 on error]]
- legacy: edje_object_freeze;
- }
- calc_thaw {
- [[Thaws the Edje object.
-
- This function thaws the given Edje object.
-
- Note: If sucessive freezes were done, an equal number of thaws will
- be required.
-
- See also @.calc_freeze()
- ]]
- return: int; [[The frozen state or 0 if the object is not frozen or on error.]]
- legacy: edje_object_thaw;
- }
- /* EDJE CALC APIS END ------------------------------------------------ */
-
/* EDJE GROUP DATA APIS BEGIN ---------------------------------------- */
@property group_size_min {
get {
Efl.Canvas.Object.no_render { set; }
Efl.Canvas.Object.paragraph_direction { set; }
Efl.Canvas.Group.group_calculate;
+ Efl.Canvas.Layout_Calc.calc_auto_update_hints { get; set; }
+ Efl.Canvas.Layout_Calc.calc_size_min;
+ Efl.Canvas.Layout_Calc.calc_size_min_restricted;
+ Efl.Canvas.Layout_Calc.calc_parts_extends;
+ Efl.Canvas.Layout_Calc.calc_freeze;
+ Efl.Canvas.Layout_Calc.calc_thaw;
+ Efl.Canvas.Layout_Calc.calc_force;
Efl.Ui.Base.mirrored { set; get; }
Efl.Ui.Base.language { set; get; }
Efl.Ui.Base.scale { set; get; }
#endif
#define EFL_CANVAS_OBJECT_PROTECTED
+#define EFL_CANVAS_LAYOUT_CALC_PROTECTED
#include <Eina.h>
#include <Eet.h>
EFL_OBJECT_OP_FUNC(efl_dbg_info_get, _edje_object_efl_object_dbg_info_get)
#include "edje_object.eo.c"
+#include "efl_canvas_layout_calc.eo.c"
}
EOLIAN int
-_edje_object_calc_freeze(Eo *obj EINA_UNUSED, Edje *ed)
+_edje_object_efl_canvas_layout_calc_calc_freeze(Eo *obj EINA_UNUSED, Edje *ed)
{
unsigned short i;
}
EOLIAN int
-_edje_object_calc_thaw(Eo *obj EINA_UNUSED, Edje *ed)
+_edje_object_efl_canvas_layout_calc_calc_thaw(Eo *obj EINA_UNUSED, Edje *ed)
{
unsigned short i;
}
EOLIAN void
-_edje_object_calc_force(Eo *obj EINA_UNUSED, Edje *ed)
+_edje_object_efl_canvas_layout_calc_calc_force(Eo *obj EINA_UNUSED, Edje *ed)
{
int pf, pf2;
}
EOLIAN void
-_edje_object_size_min_calc(Eo *obj, Edje *_pd EINA_UNUSED, Evas_Coord *minw, Evas_Coord *minh)
+_edje_object_efl_canvas_layout_calc_calc_size_min(Eo *obj, Edje *_pd EINA_UNUSED, Evas_Coord *minw, Evas_Coord *minh)
{
edje_object_size_min_restricted_calc(obj, minw, minh, 0, 0);
}
EOLIAN Eina_Bool
-_edje_object_parts_extends_calc(Eo *obj EINA_UNUSED, Edje *ed, Evas_Coord *x, Evas_Coord *y, Evas_Coord *w, Evas_Coord *h)
+_edje_object_efl_canvas_layout_calc_calc_parts_extends(Eo *obj EINA_UNUSED, Edje *ed, Evas_Coord *x, Evas_Coord *y, Evas_Coord *w, Evas_Coord *h)
{
Evas_Coord xx1 = INT_MAX, yy1 = INT_MAX;
Evas_Coord xx2 = 0, yy2 = 0;
}
EOLIAN void
-_edje_object_size_min_restricted_calc(Eo *obj EINA_UNUSED, Edje *ed, Evas_Coord *minw, Evas_Coord *minh, Evas_Coord restrictedw, Evas_Coord restrictedh)
+_edje_object_efl_canvas_layout_calc_calc_size_min_restricted(Eo *obj EINA_UNUSED, Edje *ed, Evas_Coord *minw, Evas_Coord *minh, Evas_Coord restrictedw, Evas_Coord restrictedh)
{
const int CALC_COUNT_LIMIT = 255;
}
EOLIAN void
-_edje_object_calc_update_hints_set(Eo *obj EINA_UNUSED, Edje *ed, Eina_Bool update)
+_edje_object_efl_canvas_layout_calc_calc_auto_update_hints_set(Eo *obj EINA_UNUSED, Edje *ed, Eina_Bool update)
{
if (!ed) return;
if (ed->update_hints == !!update) return;
}
EOLIAN Eina_Bool
-_edje_object_calc_update_hints_get(Eo *obj EINA_UNUSED, Edje *ed)
+_edje_object_efl_canvas_layout_calc_calc_auto_update_hints_get(Eo *obj EINA_UNUSED, Edje *ed)
{
return ed->update_hints;
}
--- /dev/null
+interface Efl.Canvas.Layout_Calc
+{
+ [[This interface defines a common set of APIs used to trigger calculations
+ with layout objects.
+
+ This defines all the APIs supported by legacy "Edje" object, known in EO
+ API as Efl.Canvas.Layout.
+
+ @since 1.21
+ ]]
+ methods {
+ @property calc_auto_update_hints {
+ [[Whether this object updates its size hints automatically.
+
+ By default edje doesn't set size hints on itself. If this property
+ is set to $true, size hints will be updated after recalculation.
+ Be careful, as recalculation may happen often, enabling this
+ property may have a considerable performance impact as other widgets
+ will be notified of the size hints changes.
+
+ A layout recalculation can be triggered by @.calc_size_min(),
+ @.calc_size_min_restricted(), @.calc_parts_extends() or even any
+ other internal event.
+ ]]
+ set {
+ [[Enable or disable auto-update of size hints.]]
+ }
+ get {
+ [[Whether this object updates its size hints automatically.]]
+ }
+ values {
+ update: bool(false); [[Whether or not update the size hints.]]
+ }
+ }
+ calc_size_min {
+ [[Calculates the minimum required size for a given Edje object.
+
+ This call works exactly as edje_object_size_min_restricted_calc(),
+ with the last two arguments set to 0. Please refer to its
+ documentation, then.
+ ]]
+ // FIXME: Return a 2D size type (no @out values)
+ params {
+ @out minw: int; [[The minimum required width (return value)]]
+ @out minh: int; [[The minimum required height (return value)]]
+ }
+ }
+ calc_size_min_restricted {
+ [[Calculates the minimum required size for a given layout object.
+
+ This call will trigger an internal recalculation of all parts of
+ the object, in order to return its minimum required dimensions for
+ width and height. The user might choose to impose those minimum
+ sizes, making the resulting calculation to get to values equal or
+ larger than $restrictedw and $restrictedh, for width and height,
+ respectively.
+
+ Note: At the end of this call, the object won't be automatically
+ resized to the new dimensions, but just return the calculated sizes.
+ The caller is the one up to change its geometry or not.
+
+ Warning: Be advised that invisible parts in the object will be taken
+ into account in this calculation.
+ ]]
+ // FIXME: Return a 2D size type (no @out values)
+ params {
+ @out minw: int; [[The minimum required width (return value)]]
+ @out minh: int; [[The minimum required height (return value)]]
+ @in restrictedw: int @optional; [[The minimum width constraint as
+ input, $minw can not be lower than this]]
+ @in restrictedh: int @optional; [[The minimum height constraint as
+ input, $minh can not be lower than this]]
+ }
+ }
+ calc_parts_extends {
+ [[Calculates the geometry of the region, relative to a given layout
+ object's area, occupied by all parts in the object.
+
+ This function gets the geometry of the rectangle equal to the area
+ required to group all parts in obj's group/collection. The x
+ and y coordinates are relative to the top left corner of the
+ whole obj object's area. Parts placed out of the group's
+ boundaries will also be taken in account, so that x and y
+ may be negative.
+
+ Note: On failure, this function will make all non-$null geometry
+ pointers' pointed variables be set to zero.
+ ]]
+ return: bool; [[$true on success, $false otherwise]]
+ /* FIXME: Return a 2D size type (no @out values) */
+ params {
+ @out x: int; [[The parts region's X coordinate]]
+ @out y: int; [[The parts region's Y coordinate]]
+ @out w: int; [[The parts region's width]]
+ @out h: int; [[The parts region's height]]
+ }
+ }
+ calc_freeze {
+ [[Freezes the layout object.
+
+ This function puts all changes on hold. Successive freezes will
+ nest, requiring an equal number of thaws.
+
+ See also @.calc_thaw.
+ ]]
+ return: int; [[The frozen state or 0 on error]]
+ }
+ calc_thaw {
+ [[Thaws the layout object.
+
+ This function thaws (in other words "unfreezes") the given layout
+ object.
+
+ Note: If sucessive freezes were done, an equal number of thaws will
+ be required.
+
+ See also @.calc_freeze.
+ ]]
+ return: int; [[The frozen state or 0 if the object is not frozen or on error.]]
+ }
+ calc_force @protected {
+ [[Forces a Size/Geometry calculation.
+
+ Forces the object to recalculate its layout regardless of
+ freeze/thaw. This API should be used carefully.
+
+ See also @.calc_freeze and @.calc_thaw.
+ ]]
+ }
+ }
+}
#define ELM_INTERFACE_ATSPI_IMAGE_PROTECTED
#define ELM_INTERFACE_ATSPI_ACCESSIBLE_PROTECTED
#define ELM_INTERFACE_ATSPI_WIDGET_ACTION_PROTECTED
+#define EFL_CANVAS_LAYOUT_CALC_PROTECTED
#include <Elementary.h>
}
EOLIAN static void
-_efl_ui_image_edje_object_calc_force(Eo *obj EINA_UNUSED, Efl_Ui_Image_Data *sd)
+_efl_ui_image_efl_canvas_layout_calc_calc_force(Eo *obj EINA_UNUSED, Efl_Ui_Image_Data *sd)
{
if (sd->edje)
edje_object_calc_force(sd->img);
}
EOLIAN static void
-_efl_ui_image_edje_object_size_min_calc(Eo *obj EINA_UNUSED, Efl_Ui_Image_Data *sd, int *w, int *h)
+_efl_ui_image_efl_canvas_layout_calc_calc_size_min(Eo *obj EINA_UNUSED, Efl_Ui_Image_Data *sd, int *w, int *h)
{
if (sd->edje)
edje_object_size_min_calc(sd->img, w, h);
Efl.File, Efl.Image, Efl.Image.Load, Efl.Player, Efl.Gfx.View,
Elm.Interface.Atspi_Image, Elm.Interface.Atspi_Widget_Action,
Edje.Object, Efl.Orientation, Efl.Flipable,
- Efl.Ui.View, Efl.Ui.Model.Connect)
+ Efl.Ui.View, Efl.Ui.Model.Connect, Efl.Canvas.Layout_Calc)
{
[[ Efl UI image class]]
event_prefix: efl_ui_image;
Edje.Object.signal_emit;
Edje.Object.group_size_min { get; }
Edje.Object.group_size_max { get; }
- Edje.Object.size_min_calc;
- Edje.Object.calc_force;
+ Efl.Canvas.Layout_Calc.calc_size_min;
+ Efl.Canvas.Layout_Calc.calc_force;
Efl.Canvas.Object.clip { set; }
Efl.Canvas.Group.group_member_add;
Efl.Ui.Draggable.drag_target { get; set; }