1 #ifndef ELM_WIDGET_PANEL_H
2 #define ELM_WIDGET_PANEL_H
3 
4 #include "elm_interface_scrollable.h"
5 #include "elm_widget_layout.h"
6 #include "elm_panel_eo.h"
7 
8 /* DO NOT USE THIS HEADER UNLESS YOU ARE PREPARED FOR BREAKING OF YOUR
9  * CODE. THIS IS ELEMENTARY'S INTERNAL WIDGET API (for now) AND IS NOT
10  * FINAL. CALL elm_widget_api_check(ELM_INTERNAL_API_VERSION) TO CHECK
11  * IT AT RUNTIME.
12  */
13 
14 /**
15  * @addtogroup Widget
16  * @{
17  *
18  * @section elm-panel-class The Elementary Panel Class
19  *
20  * Elementary, besides having the @ref Panel widget, exposes its
21  * foundation -- the Elementary Panel Class -- in order to create other
22  * widgets which are a panel with some more logic on top.
23  */
24 
25 /**
26  * Base layout smart data extended with panel instance data.
27  */
28 typedef struct _Elm_Panel_Data Elm_Panel_Data;
29 struct _Elm_Panel_Data
30 {
31    Evas_Object                          *bx, *content;
32    Evas_Object                          *event;
33    Evas_Object                          *scr_ly;
34    Evas_Object                          *hit_rect, *panel_edje, *scr_edje;
35    Evas_Object                          *scr_panel, *scr_event;
36 
37 
38    Elm_Panel_Orient                      orient;
39 
40    double                                content_size_ratio;
41    Evas_Coord                            down_x, down_y;
42    Evas_Coord                            handler_size;
43    Ecore_Timer                          *timer;
44 
45    Eina_Bool                             hidden : 1;
46    Eina_Bool                             delete_me : 1;
47    Eina_Bool                             scrollable : 1;
48    Eina_Bool                             freeze: 1;
49    Eina_Bool                             callback_added: 1;
50 };
51 
52 /**
53  * @}
54  */
55 
56 #define ELM_PANEL_DATA_GET(o, sd) \
57   Elm_Panel_Data * sd = efl_data_scope_get(o, ELM_PANEL_CLASS)
58 
59 #define ELM_PANEL_DATA_GET_OR_RETURN(o, ptr)         \
60   ELM_PANEL_DATA_GET(o, ptr);                        \
61   if (EINA_UNLIKELY(!ptr))                           \
62     {                                                \
63        ERR("No widget data for object %p (%s)",      \
64            o, evas_object_type_get(o));              \
65        return;                                       \
66     }
67 
68 #define ELM_PANEL_DATA_GET_OR_RETURN_VAL(o, ptr, val) \
69   ELM_PANEL_DATA_GET(o, ptr);                         \
70   if (EINA_UNLIKELY(!ptr))                            \
71     {                                                 \
72        ERR("No widget data for object %p (%s)",       \
73            o, evas_object_type_get(o));               \
74        return val;                                    \
75     }
76 
77 #define ELM_PANEL_CHECK(obj)                              \
78   if (EINA_UNLIKELY(!efl_isa((obj), ELM_PANEL_CLASS))) \
79     return
80 
81 #endif
82