2012-05-03 15:41:26 -07:00
# ifndef ELM_WIDGET_LAYOUT_H
# define ELM_WIDGET_LAYOUT_H
# include "elm_widget_container.h"
2014-08-07 09:26:47 -07:00
/* DO NOT USE THIS HEADER UNLESS YOU ARE PREPARED FOR BREAKING OF YOUR
* CODE . THIS IS ELEMENTARY ' S INTERNAL WIDGET API ( for now ) AND IS NOT
* FINAL . CALL elm_widget_api_check ( ELM_INTERNAL_API_VERSION ) TO CHECK
* IT AT RUNTIME .
*/
2012-05-03 15:41:26 -07:00
/**
* @ addtogroup Widget
* @ {
*
* @ section elm - layout - class The Elementary Layout Class
*
2020-04-27 06:15:12 -07:00
* Elementary , besides having the @ ref Elm_Layout widget , exposes its
2012-05-03 15:41:26 -07:00
* foundation - - the Elementary Layout Class - - in order to create
* other widgets which are , basically , a certain layout with some more
* logic on top .
*
2012-05-31 16:02:54 -07:00
* The idea is to make the creation of that widgets as easy as possible ,
2012-05-03 15:41:26 -07:00
* factorizing code on this common base . For example , a button is a
* layout ( that looks like push button ) that happens to react on
* clicks and keyboard events in a special manner , calling its user
* back on those events . That ' s no surprise , then , that the @ ref
* Button implementation relies on # Elm_Layout_Smart_Class , if you go
* to check it .
*
* The Layout class inherits from
* # Elm_Container_Smart_Class . Container parts , here , map directly to
* Edje parts from the layout ' s Edje group . Besides that , there ' s a whole
* infrastructure around Edje files :
2012-05-31 16:02:54 -07:00
* - interfacing by signals ,
2012-05-03 15:41:26 -07:00
* - setting / retrieving text part values ,
* - dealing with table and box parts directly ,
* - etc .
*
* Take a look at # Elm_Layout_Smart_Class ' s ' virtual ' functions to
* understand the whole interface . Finally , layout objects will do
* < b > part aliasing < / b > for you , if you set it up properly . For that ,
* take a look at # Elm_Layout_Part_Alias_Description , where it ' s
* explained in detail .
*/
/**
2012-05-25 12:53:51 -07:00
* Base widget smart data extended with layout instance data .
2012-05-03 15:41:26 -07:00
*/
2019-07-30 10:11:54 -07:00
typedef struct _Efl_Ui_Layout_Data
2012-05-03 15:41:26 -07:00
{
2015-06-18 21:01:46 -07:00
Evas_Object * obj ; /**< The object itself */
Eina_List * subs ; /**< List of Elm_Layout_Sub_Object_Data structs, to hold the actual sub objects such as text, content and the children of box and table. */
Eina_List * edje_signals ; /**< The list of edje signal callbacks. */
Eina_List * parts_cursors ; /**< The list of cursor names of layout parts. This is a list of Elm_Layout_Sub_Object_Cursor struct. */
2019-09-25 14:55:29 -07:00
Eina_Inarray * deferred_signals ; /**< signals which were generated during construction */
2018-01-26 16:56:53 -08:00
struct {
Eina_Hash * properties ; /**< The list of properties connected to layout parts. */
Eina_Hash * signals ; /**< The list of signals connected. */
Eina_Hash * factories ; /**< The hash with parts connected to factories. */
Eina_Bool updating : 1 ;
} connect ;
2019-07-30 10:11:35 -07:00
unsigned int finger_size_multiplier_x , finger_size_multiplier_y ; /**< multipliers for finger_size during group_calc */
2019-09-24 13:59:39 -07:00
unsigned int version ; /**< version number specified in the widget's theme */
2019-07-30 10:11:35 -07:00
2019-09-23 06:30:03 -07:00
Eina_Bool frozen ; /**< Layout freeze state */
2014-01-01 16:23:03 -08:00
Eina_Bool can_access : 1 ; /**< This is true when all text(including textblock) parts can be accessible by accessibility. */
2017-08-07 19:48:31 -07:00
Eina_Bool destructed_is : 1 ; /**< This flag indicates if Efl.Ui.Layout destructor was called. This is needed to avoid unnecessary calculation of subobject deletion during layout object's deletion. */
Eina_Bool file_set : 1 ; /**< This flag indicates if Efl.Ui.Layout source is set from a file*/
2019-02-27 10:52:14 -08:00
Eina_Bool automatic_orientation_apply : 1 ;
2019-07-11 10:56:51 -07:00
Eina_Bool model_bound : 1 ; /**< Set to true once we are watching over a model*/
Eina_Bool model_watch : 1 ; /**< Set to true once we do watch for model change*/
2019-07-30 10:11:41 -07:00
Eina_Bool calc_subobjs : 1 ; /**< Set to true if group_calc should also handle subobjs during manual calc */
2019-10-14 06:30:10 -07:00
Eina_Bool cb_theme_changed : 1 ; /**< if theme,changed event subscriber has been added */
2019-11-26 07:49:55 -08:00
Eina_Bool needs_theme_apply : 1 ; /**< if theme has not been manually set during construction */
2020-03-31 09:40:25 -07:00
Eina_Bool frozen_changed : 1 ; /**< only set if object was changed while frozen */
2018-11-16 01:45:05 -08:00
} Efl_Ui_Layout_Data ;
2012-05-03 15:41:26 -07:00
2019-07-30 10:11:54 -07:00
typedef struct _Elm_Layout_Data
{
Eina_Bool needs_size_calc : 1 ; /**< This flag is set true when the layout sizing eval is already requested. This defers sizing evaluation until smart calculation to avoid unnecessary calculation. */
2019-07-30 10:12:00 -07:00
Eina_Bool restricted_calc_w : 1 ; /**< This is a flag to support edje restricted_calc in w axis. */
Eina_Bool restricted_calc_h : 1 ; /**< This is a flag to support edje restricted_calc in y axis. */
elm/layout: add some workarounds to try handling legacy min sizes
Summary:
if a legacy widget calls evas_object_size_hint_min_set, this actually sets
efl_gfx_hint_size_restricted_min now, which is supposed to be the hint that
is used internally by widgets. as a result, there is a conflict between the
size which the user expects and the size which the widget tries to calculate.
the user size should always be respected, however, so this adds some tracking
to determine whether the layout's min size was set by the layout during its own
calc or by something externally
@fix
Reviewers: eagleeye, CHAN, woohyun, Jaehyun_Cho, cedric
Reviewed By: cedric
Subscribers: cedric, #reviewers, #committers
Tags: #efl
Differential Revision: https://phab.enlightenment.org/D10373
2019-10-14 06:30:23 -07:00
Eina_Bool in_calc : 1 ; /**< object is currently in group_calc */
Eina_Bool user_min_sz : 1 ; /**< min size was set by user (legacy only has restricted min) */
2019-07-30 10:11:54 -07:00
} Elm_Layout_Data ;
2012-05-03 15:41:26 -07:00
/**
* @ }
*/
2017-08-07 21:28:50 -07:00
# define EFL_UI_LAYOUT_DATA_GET(o, sd) \
2019-02-27 10:17:16 -08:00
Efl_Ui_Layout_Data * sd = efl_data_scope_get ( o , EFL_UI_LAYOUT_BASE_CLASS )
2012-07-31 15:05:38 -07:00
2017-08-07 21:28:50 -07:00
# define EFL_UI_LAYOUT_CHECK(obj) \
2019-02-27 10:17:16 -08:00
if ( EINA_UNLIKELY ( ! efl_isa ( obj , EFL_UI_LAYOUT_BASE_CLASS ) ) ) \
2012-07-31 15:05:38 -07:00
return
2019-07-30 10:11:41 -07:00
void _efl_ui_layout_subobjs_calc_set ( Eo * obj , Eina_Bool set ) ;
2012-05-03 15:41:26 -07:00
# endif