1 #ifndef ELM_WIDGET_CONFORMANT_H
2 #define ELM_WIDGET_CONFORMANT_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-conformant-class The Elementary Conformant Class
17  *
18  * Elementary, besides having the @ref Conformant widget, exposes its
19  * foundation -- the Elementary Conformant Class -- in order to create other
20  * widgets which are a conformant with some more logic on top.
21  */
22 
23 /**
24  * Base layout smart data extended with conformant instance data.
25  */
26 typedef struct _Elm_Conformant_Data Elm_Conformant_Data;
27 struct _Elm_Conformant_Data
28 {
29    Evas_Object                   *win;
30    Evas_Object                   *portrait_indicator;
31    Evas_Object                   *landscape_indicator;
32    Evas_Object                   *softkey;
33    Evas_Object                   *virtualkeypad;
34    Evas_Object                   *clipboard;
35    Evas_Object                   *scroller;
36 #ifdef HAVE_ELEMENTARY_X
37    Ecore_Event_Handler           *prop_hdl;
38    Ecore_X_Virtual_Keyboard_State vkb_state;
39    Ecore_X_Illume_Clipboard_State clipboard_state;
40 #endif
41    struct
42    {
43       Ecore_Animator *animator; // animation timer
44       double          start; // time started
45       Evas_Coord      auto_x, auto_y; // desired delta
46       Evas_Coord      x, y; // current delta
47    } delta;
48    Ecore_Job                     *show_region_job;
49    Elm_Win_Indicator_Mode         indmode;
50    Elm_Win_Indicator_Opacity_Mode ind_o_mode;
51    Ecore_Timer                   *land_indi_timer;
52    Ecore_Timer                   *port_indi_timer;
53 
54    int                            rot;
55    Eina_Bool                      win_hidden;
56 };
57 
58 /* Enum to identify conformant swallow parts */
59 typedef enum _Conformant_Part_Type Conformant_Part_Type;
60 enum _Conformant_Part_Type
61 {
62    ELM_CONFORMANT_INDICATOR_PART      = 1,
63    ELM_CONFORMANT_SOFTKEY_PART        = 2,
64    ELM_CONFORMANT_VIRTUAL_KEYPAD_PART = 4,
65    ELM_CONFORMANT_CLIPBOARD_PART    = 8
66 };
67 
68 /**
69  * @}
70  */
71 
72 #define ELM_CONFORMANT_DATA_GET(o, sd) \
73   Elm_Conformant_Data * sd = efl_data_scope_get(o, ELM_CONFORMANT_CLASS)
74 
75 #define ELM_CONFORMANT_DATA_GET_OR_RETURN(o, ptr)    \
76   ELM_CONFORMANT_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_CONFORMANT_DATA_GET_OR_RETURN_VAL(o, ptr, val) \
85   ELM_CONFORMANT_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_CONFORMANT_CHECK(obj)                              \
94   if (EINA_UNLIKELY(!efl_isa((obj), ELM_CONFORMANT_CLASS))) \
95     return
96 
97 #endif
98