1 #ifndef ELM_WIDGET_CTXPOPUP_H
2 #define ELM_WIDGET_CTXPOPUP_H
4 #include "elm_widget_layout.h"
6 #define MAX_ITEMS_PER_VIEWPORT 8
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
19 * @section elm-ctxpopup-class The Elementary Ctxpopup Class
21 * Elementary, besides having the @ref Elm_Ctxpopup widget, exposes its
22 * foundation -- the Elementary Ctxpopup Class -- in order to create other
23 * widgets which are a ctxpopup with some more logic on top.
26 typedef struct _Elm_Ctxpopup_Item_Data Elm_Ctxpopup_Item_Data;
29 * Base widget smart data extended with ctxpopup instance data.
31 typedef struct _Elm_Ctxpopup_Data Elm_Ctxpopup_Data;
32 struct _Elm_Ctxpopup_Item_Data
34 Elm_Widget_Item_Data *base;
42 Evas_Smart_Cb org_func_cb;
48 struct _Elm_Ctxpopup_Data
60 Elm_Ctxpopup_Direction dir;
61 Elm_Ctxpopup_Direction dir_priority[4];
65 Eina_Bool horizontal : 1;
66 Eina_Bool visible : 1;
67 Eina_Bool auto_hide : 1;
68 Eina_Bool mouse_down : 1;
69 //******************** TIZEN Only
70 Eina_Bool pressed : 1;
71 //****************************
78 #define ELM_CTXPOPUP_DATA_GET(o, sd) \
79 Elm_Ctxpopup_Data * sd = eo_data_scope_get(o, ELM_CTXPOPUP_CLASS)
81 #define ELM_CTXPOPUP_DATA_GET_OR_RETURN(o, ptr) \
82 ELM_CTXPOPUP_DATA_GET(o, ptr); \
83 if (EINA_UNLIKELY(!ptr)) \
85 CRI("No widget data for object %p (%s)", \
86 o, evas_object_type_get(o)); \
90 #define ELM_CTXPOPUP_DATA_GET_OR_RETURN_VAL(o, ptr, val) \
91 ELM_CTXPOPUP_DATA_GET(o, ptr); \
92 if (EINA_UNLIKELY(!ptr)) \
94 CRI("No widget data for object %p (%s)", \
95 o, evas_object_type_get(o)); \
99 #define ELM_CTXPOPUP_CHECK(obj) \
100 if (EINA_UNLIKELY(!eo_isa((obj), ELM_CTXPOPUP_CLASS))) \
103 #define ELM_CTXPOPUP_ITEM_CHECK_OR_RETURN(it, ...) \
104 ELM_WIDGET_ITEM_CHECK_OR_RETURN(it->base, __VA_ARGS__); \
105 ELM_CTXPOPUP_CHECK(it->base->widget) __VA_ARGS__;
107 #define ELM_CTXPOPUP_ITEM_DATA_GET(o, sd) \
108 Elm_Ctxpopup_Item_Data *sd = eo_data_scope_get(o, ELM_CTXPOPUP_ITEM_CLASS)