1 #ifndef ELM_WIDGET_PANES_H
2 #define ELM_WIDGET_PANES_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-panes-class The Elementary Panes Class
17  *
18  * Elementary, besides having the @ref Panes widget, exposes its
19  * foundation -- the Elementary Panes Class -- in order to create other
20  * widgets which are a panes with some more logic on top.
21  */
22 
23 /**
24  * Base layout smart data extended with panes instance data.
25  */
26 typedef struct _Efl_Ui_Panes_Data Efl_Ui_Panes_Data;
27 struct _Efl_Ui_Panes_Data
28 {
29    Evas_Object *event;
30    struct
31    {
32       int       x_diff;
33       int       y_diff;
34       Eina_Bool move;
35    } move;
36 
37    Efl_Ui_Layout_Orientation  dir;
38    double                     left_min_relative_size;
39    double                     right_min_relative_size;
40    Eina_Size2D                first_min, second_min;
41    double                     first_min_split_ratio, second_min_split_ratio;
42 
43    Evas_Coord                 left_min_size;
44    Evas_Coord                 right_min_size;
45    Eina_Bool                  double_clicked : 1;
46    Eina_Bool                  fixed : 1;
47    Eina_Bool                  left_min_size_is_relative : 1;
48    Eina_Bool                  right_min_size_is_relative : 1;
49    Eina_Bool                  first_hint_min_allow : 1;
50    Eina_Bool                  second_hint_min_allow : 1;
51 };
52 
53 /**
54  * @}
55  */
56 
57 #define EFL_UI_PANES_DATA_GET(o, sd) \
58   Efl_Ui_Panes_Data * sd = efl_data_scope_get(o, EFL_UI_PANES_CLASS)
59 
60 #define EFL_UI_PANES_DATA_GET_OR_RETURN(o, ptr)         \
61   EFL_UI_PANES_DATA_GET(o, ptr);                        \
62   if (EINA_UNLIKELY(!ptr))                           \
63     {                                                \
64        ERR("No widget data for object %p (%s)",      \
65            o, evas_object_type_get(o));              \
66        return;                                       \
67     }
68 
69 #define EFL_UI_PANES_DATA_GET_OR_RETURN_VAL(o, ptr, val) \
70   EFL_UI_PANES_DATA_GET(o, ptr);                         \
71   if (EINA_UNLIKELY(!ptr))                            \
72     {                                                 \
73        ERR("No widget data for object %p (%s)",       \
74            o, evas_object_type_get(o));               \
75        return val;                                    \
76     }
77 
78 #define EFL_UI_PANES_CHECK(obj)                              \
79   if (EINA_UNLIKELY(!efl_isa((obj), EFL_UI_PANES_CLASS))) \
80     return
81 
82 #endif
83