summaryrefslogtreecommitdiff
path: root/src/lib/elementary/elm_widget_index.h
diff options
context:
space:
mode:
authorCedric BAIL <cedric@osg.samsung.com>2016-03-23 12:56:14 -0700
committerCedric BAIL <cedric@osg.samsung.com>2016-03-23 13:24:41 -0700
commitc2a1c49ab2042f559b28e840e54feb8494888e0e (patch)
treec6eb110b7c479499854eede9d0c3ab0a80c9a11a /src/lib/elementary/elm_widget_index.h
parent9340855597e7e465435c69b6278650346688da14 (diff)
elementary: move all legacy files to their expected new location.
Diffstat (limited to 'src/lib/elementary/elm_widget_index.h')
-rw-r--r--src/lib/elementary/elm_widget_index.h115
1 files changed, 115 insertions, 0 deletions
diff --git a/src/lib/elementary/elm_widget_index.h b/src/lib/elementary/elm_widget_index.h
new file mode 100644
index 0000000..f48330d
--- /dev/null
+++ b/src/lib/elementary/elm_widget_index.h
@@ -0,0 +1,115 @@
1#ifndef ELM_WIDGET_INDEX_H
2#define ELM_WIDGET_INDEX_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-index-class The Elementary Index Class
17 *
18 * Elementary, besides having the @ref Index widget, exposes its
19 * foundation -- the Elementary Index Class -- in order to create other
20 * widgets which are a index with some more logic on top.
21 */
22
23/**
24 * Base layout smart data extended with index instance data.
25 */
26typedef struct _Elm_Index_Data Elm_Index_Data;
27struct _Elm_Index_Data
28{
29 Evas_Object *event_rect[2]; /**< rectangle objects for event handling */
30 Evas_Object *bx[2]; // 2 - for now all that's supported
31 Eina_List *items; /* 1 list. N levels, but only 2
32 * for now and # of items will be
33 * small */
34 Eina_List *omit;
35
36 int level;
37 Evas_Coord dx, dy;
38 Ecore_Timer *delay;
39 double delay_change_time;
40 Eina_Bool level_active[2]; /**< a flag for the activeness of a
41 level. activeness means the box is
42 filled with contents. */
43 int group_num, default_num;
44 int show_group, next_group;
45
46 Eina_Bool mouse_down : 1;
47 Eina_Bool horizontal : 1;
48 Eina_Bool autohide_disabled : 1;
49 Eina_Bool indicator_disabled : 1;
50 Eina_Bool omit_enabled : 1;
51};
52
53typedef struct _Elm_Index_Item_Data Elm_Index_Item_Data;
54struct _Elm_Index_Item_Data
55{
56 Elm_Widget_Item_Data *base;
57
58 const char *letter;
59 int level;
60 Evas_Smart_Cb func;
61
62 Eina_List *omitted;
63 Elm_Index_Item_Data *head;
64
65 int priority;
66 Eina_Bool selected : 1; /**< a flag that remembers an item is selected. this is set true when mouse down/move occur above an item and when elm_index_item_selected_set() API is called. */
67};
68
69typedef struct _Elm_Index_Omit Elm_Index_Omit;
70struct _Elm_Index_Omit
71{
72 int offset;
73 int count;
74};
75
76/**
77 * @}
78 */
79#define ELM_INDEX_DATA_GET(o, sd) \
80 Elm_Index_Data * sd = eo_data_scope_get(o, ELM_INDEX_CLASS)
81
82#define ELM_INDEX_DATA_GET_OR_RETURN(o, ptr) \
83 ELM_INDEX_DATA_GET(o, ptr); \
84 if (EINA_UNLIKELY(!ptr)) \
85 { \
86 CRI("No widget data for object %p (%s)", \
87 o, evas_object_type_get(o)); \
88 return; \
89 }
90
91#define ELM_INDEX_DATA_GET_OR_RETURN_VAL(o, ptr, val) \
92 ELM_INDEX_DATA_GET(o, ptr); \
93 if (EINA_UNLIKELY(!ptr)) \
94 { \
95 CRI("No widget data for object %p (%s)", \
96 o, evas_object_type_get(o)); \
97 return val; \
98 }
99
100#define ELM_INDEX_CHECK(obj) \
101 if (EINA_UNLIKELY(!eo_isa((obj), ELM_INDEX_CLASS))) \
102 return
103
104#define ELM_INDEX_ITEM_CHECK(it) \
105 if (EINA_UNLIKELY(!eo_isa((it->base->eo_obj), ELM_INDEX_ITEM_CLASS))) \
106 return
107
108#define ELM_INDEX_ITEM_CHECK_OR_RETURN(it, ...) \
109 if (EINA_UNLIKELY(!eo_isa((it->base->eo_obj), ELM_INDEX_ITEM_CLASS))) \
110 return __VA_ARGS__;
111
112#define ELM_INDEX_ITEM_DATA_GET(o, sd) \
113 Elm_Index_Item_Data *sd = eo_data_scope_get(o, ELM_INDEX_ITEM_CLASS)
114
115#endif