1 #ifndef ELM_WIDGET_BOX_H
2 #define ELM_WIDGET_BOX_H
3 
4 #include "Elementary.h"
5 
6 /* DO NOT USE THIS HEADER UNLESS YOU ARE PREPARED FOR BREAKING OF YOUR
7  * CODE. THIS IS ELEMENTARY'S INTERNAL WIDGET API (for now) AND IS NOT
8  * FINAL. CALL elm_widget_api_check(ELM_INTERNAL_API_VERSION) TO CHECK
9  * IT AT RUNTIME.
10  */
11 
12 /**
13  * @addtogroup Widget
14  * @{
15  *
16  * @section elm-box-class The Elementary Box Class
17  *
18  * Elementary, besides having the @ref Box widget, exposes its
19  * foundation -- the Elementary Box Class -- in order to create
20  * other widgets which are a box with some more logic on top.
21  */
22 
23 /**
24  * Base widget smart data extended with box instance data.
25  */
26 typedef struct _Elm_Box_Data        Elm_Box_Data;
27 struct _Elm_Box_Data
28 {
29    Eina_Bool             homogeneous : 1;
30    Eina_Bool             delete_me : 1;
31    Eina_Bool             horizontal : 1;
32    Eina_Bool             recalc : 1;
33 };
34 
35 struct _Elm_Box_Transition
36 {
37    double          initial_time;
38    double          duration;
39    Ecore_Animator *animator;
40 
41    struct
42    {
43       Evas_Object_Box_Layout layout;
44       void                  *data;
45       void                   (*free_data)(void *data);
46    } start, end;
47 
48    void            (*transition_end_cb)(void *data);
49    void           *transition_end_data;
50    void            (*transition_end_free_data)(void *data);
51    Eina_List      *objs;
52    Evas_Object    *box;
53 
54    Eina_Bool       animation_ended : 1;
55    Eina_Bool       recalculate : 1;
56 };
57 
58 typedef struct _Transition_Animation_Data Transition_Animation_Data;
59 struct _Transition_Animation_Data
60 {
61    Evas_Object *obj;
62    struct
63    {
64       Evas_Coord x, y, w, h;
65    } start, end;
66 };
67 
68 /**
69  * @}
70  */
71 
72 #define ELM_BOX_DATA_GET(o, sd) \
73   Elm_Box_Data * sd = efl_data_scope_get(o, ELM_BOX_CLASS)
74 
75 #define ELM_BOX_DATA_GET_OR_RETURN(o, ptr)           \
76   ELM_BOX_DATA_GET(o, ptr);                          \
77   if (EINA_UNLIKELY(!ptr))                           \
78     {                                                \
79        ERR("No widget data for object %p (%s)",      \
80            o, evas_object_type_get(o));              \
81        return;                                       \
82     }
83 
84 #define ELM_BOX_DATA_GET_OR_RETURN_VAL(o, ptr, val)  \
85   ELM_BOX_DATA_GET(o, ptr);                          \
86   if (EINA_UNLIKELY(!ptr))                           \
87     {                                                \
88        ERR("No widget data for object %p (%s)",      \
89            o, evas_object_type_get(o));              \
90        return val;                                   \
91     }
92 
93 #define ELM_BOX_CHECK(obj)                              \
94   if (EINA_UNLIKELY(!efl_isa((obj), ELM_BOX_CLASS))) \
95     return
96 
97 #endif
98