diff options
author | Marcel Hollerbach <mail@marcel-hollerbach.de> | 2019-11-20 17:06:58 +0100 |
---|---|---|
committer | Marcel Hollerbach <mail@marcel-hollerbach.de> | 2019-11-20 17:06:58 +0100 |
commit | 014ee1e6794746800a9ff8d239d074c6efd01ea3 (patch) | |
tree | 742bfd441520ec7ecba2215d7010c7b0ca617085 | |
parent | 7b03abd12b57f440e2de0e499376726b080898f8 (diff) |
remove unused code filedevs/bu5hm4n/spotlight_work
-rw-r--r-- | src/lib/elementary/efl_page_indicator_icon.c | 191 |
1 files changed, 0 insertions, 191 deletions
diff --git a/src/lib/elementary/efl_page_indicator_icon.c b/src/lib/elementary/efl_page_indicator_icon.c deleted file mode 100644 index fadd3dae4d..0000000000 --- a/src/lib/elementary/efl_page_indicator_icon.c +++ /dev/null | |||
@@ -1,191 +0,0 @@ | |||
1 | #ifdef HAVE_CONFIG_H | ||
2 | # include "elementary_config.h" | ||
3 | #endif | ||
4 | |||
5 | #include <Elementary.h> | ||
6 | #include "elm_priv.h" | ||
7 | |||
8 | #include "efl_page_indicator_icon.h" | ||
9 | #include "efl_page_indicator.h" | ||
10 | #include "efl_ui_widget_pager.h" | ||
11 | |||
12 | #define MY_CLASS EFL_PAGE_INDICATOR_ICON_CLASS | ||
13 | |||
14 | |||
15 | |||
16 | EOLIAN static void | ||
17 | _efl_page_indicator_icon_update(Eo *obj, | ||
18 | Efl_Page_Indicator_Icon_Data *pd, | ||
19 | double pos) | ||
20 | { | ||
21 | EFL_PAGE_INDICATOR_DATA_GET(obj, spd); | ||
22 | double delta = fabs(pos); | ||
23 | |||
24 | if (pd->curr) | ||
25 | { | ||
26 | eina_value_set(pd->v, 0.0); | ||
27 | efl_layout_signal_message_send(pd->curr, 1, *(pd->v)); | ||
28 | if (pd->adj) efl_layout_signal_message_send(pd->adj, 1, *(pd->v)); | ||
29 | } | ||
30 | |||
31 | efl_page_indicator_update(efl_super(obj, MY_CLASS), pos); | ||
32 | |||
33 | pd->curr = eina_list_nth(pd->items, spd->curr_idx); | ||
34 | eina_value_set(pd->v, (1.0 - delta)); | ||
35 | efl_layout_signal_message_send(pd->curr, 1, *(pd->v)); | ||
36 | |||
37 | if (pos < 0) | ||
38 | pd->adj = eina_list_nth(pd->items, (spd->curr_idx - 1 + spd->cnt) % spd->cnt); | ||
39 | else if (pos > 0) | ||
40 | pd->adj = eina_list_nth(pd->items, (spd->curr_idx + 1 + spd->cnt) % spd->cnt); | ||
41 | else pd->adj = NULL; | ||
42 | |||
43 | if (pd->adj) | ||
44 | { | ||
45 | eina_value_set(pd->v, delta); | ||
46 | efl_layout_signal_message_send(pd->adj, 1, *(pd->v)); | ||
47 | } | ||
48 | } | ||
49 | |||
50 | EOLIAN static void | ||
51 | _efl_page_indicator_icon_pack(Eo *obj, | ||
52 | Efl_Page_Indicator_Icon_Data *pd, | ||
53 | int index) | ||
54 | { | ||
55 | EFL_PAGE_INDICATOR_DATA_GET(obj, spd); | ||
56 | Eo *item, *existing; | ||
57 | |||
58 | item = efl_add(EFL_CANVAS_LAYOUT_CLASS, spd->idbox); | ||
59 | elm_widget_theme_object_set(spd->idbox, item, | ||
60 | "spotlight", "indicator", "default"); | ||
61 | efl_gfx_hint_align_set(item, 0.5, 0.5); | ||
62 | efl_gfx_hint_weight_set(item, 0, 0); | ||
63 | efl_gfx_hint_fill_set(item, 0, 0); | ||
64 | |||
65 | if (index == spd->cnt) | ||
66 | { | ||
67 | pd->items = eina_list_append(pd->items, item); | ||
68 | efl_pack_end(spd->idbox, item); | ||
69 | } | ||
70 | else | ||
71 | { | ||
72 | existing = eina_list_nth(pd->items, index); | ||
73 | pd->items = eina_list_prepend_relative(pd->items, item, existing); | ||
74 | efl_pack_before(spd->idbox, item, existing); | ||
75 | } | ||
76 | |||
77 | efl_page_indicator_pack(efl_super(obj, MY_CLASS), index); | ||
78 | |||
79 | if (!pd->curr) | ||
80 | { | ||
81 | pd->curr = eina_list_nth(pd->items, spd->curr_idx); | ||
82 | eina_value_set(pd->v, 1.0); | ||
83 | efl_layout_signal_message_send(pd->curr, 1, *(pd->v)); | ||
84 | } | ||
85 | } | ||
86 | |||
87 | EOLIAN static void | ||
88 | _efl_page_indicator_icon_unpack(Eo *obj, | ||
89 | Efl_Page_Indicator_Icon_Data *pd, | ||
90 | int index) | ||
91 | { | ||
92 | EFL_PAGE_INDICATOR_DATA_GET(obj, spd); | ||
93 | Eo *item; | ||
94 | |||
95 | item = eina_list_nth(pd->items, index); | ||
96 | pd->items = eina_list_remove(pd->items, item); | ||
97 | efl_pack_unpack(spd->idbox, item); | ||
98 | efl_del(item); | ||
99 | |||
100 | if (index == spd->curr_idx) pd->curr = NULL; | ||
101 | |||
102 | efl_page_indicator_unpack(efl_super(obj, MY_CLASS), index); | ||
103 | |||
104 | if ((pd->curr == NULL) && (spd->curr_idx != -1)) | ||
105 | { | ||
106 | pd->curr = eina_list_nth(pd->items, spd->curr_idx); | ||
107 | eina_value_set(pd->v, 1.0); | ||
108 | efl_layout_signal_message_send(pd->curr, 1, *(pd->v)); | ||
109 | } | ||
110 | } | ||
111 | |||
112 | EOLIAN static void | ||
113 | _efl_page_indicator_icon_unpack_all(Eo *obj, | ||
114 | Efl_Page_Indicator_Icon_Data *pd) | ||
115 | { | ||
116 | Eo *item; | ||
117 | |||
118 | EINA_LIST_FREE(pd->items, item) | ||
119 | { | ||
120 | efl_del(item); | ||
121 | } | ||
122 | |||
123 | pd->curr = NULL; | ||
124 | |||
125 | efl_page_indicator_unpack_all(efl_super(obj, MY_CLASS)); | ||
126 | } | ||
127 | |||
128 | EOLIAN static void | ||
129 | _efl_page_indicator_icon_efl_page_indicator_bind(Eo *obj, | ||
130 | Efl_Page_Indicator_Icon_Data *pd, | ||
131 | Eo *pager, | ||
132 | Efl_Canvas_Group *idbox) | ||
133 | { | ||
134 | EFL_PAGE_INDICATOR_DATA_GET(obj, spd); | ||
135 | Eo *item; | ||
136 | int i, page; | ||
137 | |||
138 | if (spd->pager.obj) | ||
139 | { | ||
140 | EINA_LIST_FREE(pd->items, item) | ||
141 | { | ||
142 | efl_del(item); | ||
143 | } | ||
144 | } | ||
145 | |||
146 | efl_page_indicator_bind(efl_super(obj, MY_CLASS), pager, idbox); | ||
147 | |||
148 | if (spd->pager.obj) | ||
149 | { | ||
150 | efl_ui_layout_orientation_set(spd->idbox, EFL_UI_LAYOUT_ORIENTATION_HORIZONTAL); | ||
151 | efl_gfx_arrangement_content_padding_set(spd->idbox, 15, 15); | ||
152 | |||
153 | pd->v = eina_value_float_new(0.0); | ||
154 | |||
155 | if (spd->cnt != 0) | ||
156 | { | ||
157 | for (i = 0; i < spd->cnt; i++) | ||
158 | { | ||
159 | item = efl_add(EFL_CANVAS_LAYOUT_CLASS, spd->idbox); | ||
160 | pd->items = eina_list_append(pd->items, item); | ||
161 | |||
162 | elm_widget_theme_object_set(spd->idbox, item, | ||
163 | "pager", "indicator", "default"); | ||
164 | efl_gfx_hint_align_set(item, 0.5, 0.5); | ||
165 | efl_gfx_hint_weight_set(item, 0, 0); | ||
166 | efl_gfx_hint_fill_set(item, 0, 0); | ||
167 | efl_pack_end(spd->idbox, item); | ||
168 | } | ||
169 | |||
170 | page = efl_ui_pager_current_page_get(spd->pager.obj); | ||
171 | item = eina_list_nth(pd->items, page); | ||
172 | eina_value_set(pd->v, 1.0); | ||
173 | efl_layout_signal_message_send(item, 1, *(pd->v)); | ||
174 | |||
175 | pd->curr = item; | ||
176 | } | ||
177 | } | ||
178 | } | ||
179 | |||
180 | |||
181 | #define EFL_PAGE_INDICATOR_ICON_EXTRA_OPS \ | ||
182 | EFL_OBJECT_OP_FUNC(efl_page_indicator_update, \ | ||
183 | _efl_page_indicator_icon_update), \ | ||
184 | EFL_OBJECT_OP_FUNC(efl_page_indicator_pack, \ | ||
185 | _efl_page_indicator_icon_pack), \ | ||
186 | EFL_OBJECT_OP_FUNC(efl_page_indicator_unpack, \ | ||
187 | _efl_page_indicator_icon_unpack), \ | ||
188 | EFL_OBJECT_OP_FUNC(efl_page_indicator_unpack_all, \ | ||
189 | _efl_page_indicator_icon_unpack_all) | ||
190 | |||
191 | #include "efl_page_indicator_icon.eo.c" | ||