1 #ifndef ELM_WIDGET_SEPARATOR_H
2 #define ELM_WIDGET_SEPARATOR_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-separator-class The Elementary Separator Class
17  *
18  * Elementary, besides having the @ref Separator widget, exposes its
19  * foundation -- the Elementary Separator Class -- in order to create other
20  * widgets which are a separator with some more logic on top.
21  */
22 
23 /**
24  * Base layout smart data extended with separator instance data.
25  */
26 typedef struct _Elm_Separator_Data Elm_Separator_Data;
27 struct _Elm_Separator_Data
28 {
29    Eina_Bool             horizontal : 1;
30 };
31 
32 /**
33  * @}
34  */
35 
36 #define ELM_SEPARATOR_DATA_GET(o, sd) \
37   Elm_Separator_Data * sd = efl_data_scope_get(o, ELM_SEPARATOR_CLASS)
38 
39 #define ELM_SEPARATOR_DATA_GET_OR_RETURN(o, ptr)     \
40   ELM_SEPARATOR_DATA_GET(o, ptr);                    \
41   if (EINA_UNLIKELY(!ptr))                           \
42     {                                                \
43        ERR("No widget data for object %p (%s)",      \
44            o, evas_object_type_get(o));              \
45        return;                                       \
46     }
47 
48 #define ELM_SEPARATOR_DATA_GET_OR_RETURN_VAL(o, ptr, val) \
49   ELM_SEPARATOR_DATA_GET(o, ptr);                         \
50   if (EINA_UNLIKELY(!ptr))                                \
51     {                                                     \
52        ERR("No widget data for object %p (%s)",           \
53            o, evas_object_type_get(o));                   \
54        return val;                                        \
55     }
56 
57 #define ELM_SEPARATOR_CHECK(obj)                              \
58   if (EINA_UNLIKELY(!efl_isa((obj), ELM_SEPARATOR_CLASS))) \
59     return
60 
61 #endif
62