summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMike Blumenkrantz <zmike@osg.samsung.com>2015-04-09 16:35:31 -0400
committerMike Blumenkrantz <zmike@osg.samsung.com>2015-04-09 16:36:41 -0400
commite569758fef50b8e9d23b4bb10b6efa88537ea8a8 (patch)
tree09ed4c300dc06ad63e2ea356a7ef2fa67462715a
parentaeca417ebe0f2d88d9736222490303ec38e238a3 (diff)
remove csel widget
no longer used
-rw-r--r--po/POTFILES.in1
-rw-r--r--src/bin/Makefile.mk2
-rw-r--r--src/bin/e_includes.h1
-rw-r--r--src/bin/e_widget_csel.c311
-rw-r--r--src/bin/e_widget_csel.h6
5 files changed, 0 insertions, 321 deletions
diff --git a/po/POTFILES.in b/po/POTFILES.in
index 4c493c5..0d1f11f 100644
--- a/po/POTFILES.in
+++ b/po/POTFILES.in
@@ -103,7 +103,6 @@ src/bin/e_widget_button.c
103src/bin/e_widget_check.c 103src/bin/e_widget_check.c
104src/bin/e_widget_color_well.c 104src/bin/e_widget_color_well.c
105src/bin/e_widget_config_list.c 105src/bin/e_widget_config_list.c
106src/bin/e_widget_csel.c
107src/bin/e_widget_cslider.c 106src/bin/e_widget_cslider.c
108src/bin/e_widget_entry.c 107src/bin/e_widget_entry.c
109src/bin/e_widget_filepreview.c 108src/bin/e_widget_filepreview.c
diff --git a/src/bin/Makefile.mk b/src/bin/Makefile.mk
index 279cbc5..a2ff154 100644
--- a/src/bin/Makefile.mk
+++ b/src/bin/Makefile.mk
@@ -167,7 +167,6 @@ src/bin/e_widget_button.h \
167src/bin/e_widget_check.h \ 167src/bin/e_widget_check.h \
168src/bin/e_widget_color_well.h \ 168src/bin/e_widget_color_well.h \
169src/bin/e_widget_config_list.h \ 169src/bin/e_widget_config_list.h \
170src/bin/e_widget_csel.h \
171src/bin/e_widget_cslider.h \ 170src/bin/e_widget_cslider.h \
172src/bin/e_widget_bgpreview.h \ 171src/bin/e_widget_bgpreview.h \
173src/bin/e_widget_entry.h \ 172src/bin/e_widget_entry.h \
@@ -329,7 +328,6 @@ src/bin/e_widget.c \
329src/bin/e_widget_check.c \ 328src/bin/e_widget_check.c \
330src/bin/e_widget_color_well.c \ 329src/bin/e_widget_color_well.c \
331src/bin/e_widget_config_list.c \ 330src/bin/e_widget_config_list.c \
332src/bin/e_widget_csel.c \
333src/bin/e_widget_cslider.c \ 331src/bin/e_widget_cslider.c \
334src/bin/e_widget_bgpreview.c \ 332src/bin/e_widget_bgpreview.c \
335src/bin/e_widget_entry.c \ 333src/bin/e_widget_entry.c \
diff --git a/src/bin/e_includes.h b/src/bin/e_includes.h
index 359aa73..a8d21f9 100644
--- a/src/bin/e_includes.h
+++ b/src/bin/e_includes.h
@@ -106,7 +106,6 @@
106#include "e_widget_spectrum.h" 106#include "e_widget_spectrum.h"
107#include "e_widget_cslider.h" 107#include "e_widget_cslider.h"
108#include "e_widget_color_well.h" 108#include "e_widget_color_well.h"
109#include "e_widget_csel.h"
110#include "e_color_dialog.h" 109#include "e_color_dialog.h"
111#include "e_sys.h" 110#include "e_sys.h"
112#include "e_obj_dialog.h" 111#include "e_obj_dialog.h"
diff --git a/src/bin/e_widget_csel.c b/src/bin/e_widget_csel.c
deleted file mode 100644
index e616ffe..0000000
--- a/src/bin/e_widget_csel.c
+++ /dev/null
@@ -1,311 +0,0 @@
1#include "e.h"
2
3typedef struct _E_Widget_Data E_Widget_Data;
4struct _E_Widget_Data
5{
6 Evas_Object *obj;
7 Eina_List *sliders;
8 Eina_List *entries;
9 Evas_Object *spectrum, *vert, *well;
10 E_Color *cv;
11 char **values;
12 int mode;
13 int changing;
14};
15
16static void
17_e_wid_del_hook(Evas_Object *obj)
18{
19 E_Widget_Data *wd;
20 int i = 0;
21
22 wd = e_widget_data_get(obj);
23 if (!wd) return;
24
25 for (i = 0; i < E_COLOR_COMPONENT_MAX; i++)
26 E_FREE(wd->values[i]);
27
28 E_FREE(wd->values);
29
30 eina_list_free(wd->sliders);
31 eina_list_free(wd->entries);
32
33 E_FREE(wd);
34}
35
36static void
37_e_wid_cb_radio_changed(void *data, Evas_Object *o EINA_UNUSED)
38{
39 E_Widget_Data *wd = data;
40
41 e_widget_spectrum_mode_set(wd->spectrum, wd->mode);
42 e_widget_cslider_mode_set(wd->vert, wd->mode);
43}
44
45static void
46_e_wid_cb_color_changed(void *data, Evas_Object *o)
47{
48 E_Widget_Data *wd = data;
49 Eina_List *l;
50 Evas_Object *eo, *so;
51 int changed = -1, i = 0;
52
53 if (wd->changing) return;
54
55 wd->changing = 1;
56
57 /* entry changed */
58 EINA_LIST_FOREACH(wd->entries, l, eo)
59 {
60 if (o == eo)
61 {
62 changed = i;
63 switch (i)
64 {
65 case E_COLOR_COMPONENT_R:
66 wd->cv->r = atoi(wd->values[i]);
67 if (wd->cv->r > 255) wd->cv->r = 255;
68 if (wd->cv->r < 0) wd->cv->r = 0;
69 break;
70
71 case E_COLOR_COMPONENT_G:
72 wd->cv->g = atoi(wd->values[i]);
73 if (wd->cv->g > 255) wd->cv->g = 255;
74 if (wd->cv->g < 0) wd->cv->g = 0;
75 break;
76
77 case E_COLOR_COMPONENT_B:
78 wd->cv->b = atoi(wd->values[i]);
79 if (wd->cv->b > 255) wd->cv->b = 255;
80 if (wd->cv->b < 0) wd->cv->b = 0;
81 break;
82
83 case E_COLOR_COMPONENT_H:
84 wd->cv->h = atof(wd->values[i]);
85 if (wd->cv->h > 360) wd->cv->h = 360;
86 if (wd->cv->h < 0) wd->cv->h = 0;
87 break;
88
89 case E_COLOR_COMPONENT_S:
90 wd->cv->s = atof(wd->values[i]);
91 if (wd->cv->s > 1) wd->cv->s = 1;
92 if (wd->cv->s < 0) wd->cv->s = 0;
93 break;
94
95 case E_COLOR_COMPONENT_V:
96 wd->cv->v = atof(wd->values[i]);
97 if (wd->cv->v > 1) wd->cv->v = 1;
98 if (wd->cv->v < 0) wd->cv->v = 0;
99 break;
100 }
101 break;
102 }
103 i++;
104 }
105
106 if (changed != -1)
107 {
108 if (changed >= E_COLOR_COMPONENT_H)
109 e_color_update_hsv(wd->cv);
110 else if (changed >= E_COLOR_COMPONENT_R)
111 e_color_update_rgb(wd->cv);
112 }
113
114 if (o == wd->vert)
115 changed = wd->mode;
116 else
117 e_widget_cslider_update(wd->vert);
118
119 /* update the sliders */
120 i = 0;
121 EINA_LIST_FOREACH(wd->sliders, l, so)
122 {
123 if (o != so)
124 e_widget_cslider_update(so);
125 else
126 changed = i;
127 i++;
128 }
129
130 /* update the spectrum */
131 if (o != wd->spectrum /* && changed != -1*/)
132 e_widget_spectrum_update(wd->spectrum, 1);
133
134 e_widget_color_well_update(wd->well);
135
136 /* now update the text fields to show current values */
137 i = 0;
138 EINA_LIST_FOREACH(wd->entries, l, eo)
139 {
140 char buf[10];
141
142 if (o == eo) continue;
143 switch (i)
144 {
145 case E_COLOR_COMPONENT_R:
146 snprintf(buf, 10, "%i", wd->cv->r);
147 break;
148
149 case E_COLOR_COMPONENT_G:
150 snprintf(buf, 10, "%i", wd->cv->g);
151 break;
152
153 case E_COLOR_COMPONENT_B:
154 snprintf(buf, 10, "%i", wd->cv->b);
155 break;
156
157 case E_COLOR_COMPONENT_H:
158 snprintf(buf, 10, "%.0f", wd->cv->h);
159 break;
160
161 case E_COLOR_COMPONENT_S:
162 snprintf(buf, 10, "%.2f", wd->cv->s);
163 break;
164
165 case E_COLOR_COMPONENT_V:
166 snprintf(buf, 10, "%.2f", wd->cv->v);
167 break;
168
169 default:
170 break;
171 }
172 e_widget_entry_text_set(eo, buf);
173 i++;
174 }
175
176 wd->changing = 0;
177
178 e_widget_change(wd->obj);
179}
180
181static void
182_e_wid_cb_alpha_changed(void *data, Evas_Object *o EINA_UNUSED)
183{
184 _e_wid_cb_color_changed(data, NULL);
185}
186
187Evas_Object *
188e_widget_csel_add(Evas *evas, E_Color *color, Eina_Bool alpha_enabled)
189{
190 Evas_Object *obj, *o;
191 Evas_Object *frame, *table;
192 int i = 0;
193 E_Radio_Group *grp = NULL;
194 char *labels[6] = { N_("R"), N_("G"), N_("B"), N_("H"), N_("S"), N_("V") };
195 E_Widget_Data *wd;
196 Evas_Coord mw, mh;
197
198 obj = e_widget_add(evas);
199 e_widget_del_hook_set(obj, _e_wid_del_hook);
200
201 wd = calloc(1, sizeof(E_Widget_Data));
202 wd->mode = 1;
203 wd->cv = color;
204 wd->obj = obj;
205 e_widget_data_set(obj, wd);
206
207 table = e_widget_table_add(e_win_evas_win_get(evas), 0);
208 e_widget_sub_object_add(obj, table);
209 e_widget_resize_object_set(obj, table);
210
211 frame = e_widget_table_add(e_win_evas_win_get(evas), 0);
212 e_widget_sub_object_add(obj, frame);
213 grp = e_widget_radio_group_new(&wd->mode);
214
215 wd->values = calloc(E_COLOR_COMPONENT_MAX, sizeof(char *));
216
217 for (i = 0; i < E_COLOR_COMPONENT_MAX; i++)
218 {
219 wd->values[i] = calloc(10, sizeof(char));
220 switch (i)
221 {
222 case E_COLOR_COMPONENT_R:
223 snprintf(wd->values[i], 10, "%i", wd->cv->r);
224 break;
225
226 case E_COLOR_COMPONENT_G:
227 snprintf(wd->values[i], 10, "%i", wd->cv->g);
228 break;
229
230 case E_COLOR_COMPONENT_B:
231 snprintf(wd->values[i], 10, "%i", wd->cv->b);
232 break;
233
234 case E_COLOR_COMPONENT_H:
235 snprintf(wd->values[i], 10, "%.0f", wd->cv->h);
236 break;
237
238 case E_COLOR_COMPONENT_S:
239 snprintf(wd->values[i], 10, "%.2f", wd->cv->s);
240 break;
241
242 case E_COLOR_COMPONENT_V:
243 snprintf(wd->values[i], 10, "%.2f", wd->cv->v);
244 break;
245
246 default:
247 break;
248 }
249
250 o = e_widget_radio_add(evas, _(labels[i]), i, grp);
251 e_widget_sub_object_add(obj, o);
252 e_widget_on_change_hook_set(o, _e_wid_cb_radio_changed, wd);
253 e_widget_table_object_append(frame, o, 0, i, 1, 1, 1, 1, 0, 0);
254
255 o = e_widget_cslider_add(evas, i, wd->cv, 0, 0);
256 e_widget_sub_object_add(obj, o);
257 evas_object_show(o);
258 wd->sliders = eina_list_append(wd->sliders, o);
259 e_widget_on_change_hook_set(o, _e_wid_cb_color_changed, wd);
260 e_widget_size_min_set(o, 32, 16);
261 e_widget_table_object_append(frame, o, 1, i, 6, 1, 1, 1, 1, 0);
262
263 o = e_widget_entry_add(e_win_evas_win_get(evas), &(wd->values[i]), NULL, NULL, NULL);
264 e_widget_sub_object_add(obj, o);
265 evas_object_show(o);
266 wd->entries = eina_list_append(wd->entries, o);
267 e_widget_table_object_append(frame, o, 7, i, 3, 1, 1, 1, 1, 0);
268 e_widget_on_change_hook_set(o, _e_wid_cb_color_changed, wd);
269 }
270
271 if (alpha_enabled)
272 {
273 o = e_widget_label_add(evas, _("Alpha"));
274 e_widget_table_object_append(frame, o, 0, i, 1, 1, 1, 1, 0, 0);
275 o = e_widget_slider_add(evas, 1, 0, "%0.0f", 0, 255, 1, 0, NULL,
276 &(wd->cv->a), 100);
277 e_widget_on_change_hook_set(o, _e_wid_cb_alpha_changed, wd);
278 e_widget_table_object_append(frame, o, 1, i, 10, 1, 1, 1, 0, 0);
279 }
280
281 e_widget_table_object_append(table, frame, 2, 0, 1, 2, 1, 0, 1, 0);
282
283 o = e_widget_spectrum_add(evas, wd->mode, wd->cv);
284 e_widget_sub_object_add(obj, o);
285 evas_object_show(o);
286 e_widget_on_change_hook_set(o, _e_wid_cb_color_changed, wd);
287 wd->spectrum = o;
288 e_widget_size_min_set(o, 120, 120);
289 e_widget_table_object_append(table, o, 0, 0, 1, 2, 1, 1, 1, 1);
290
291 o = e_widget_cslider_add(evas, wd->mode, wd->cv, 1, 1);
292 e_widget_sub_object_add(obj, o);
293 e_widget_on_change_hook_set(o, _e_wid_cb_color_changed, wd);
294 e_widget_size_min_set(o, 16, 16);
295 evas_object_show(o);
296 wd->vert = o;
297 e_widget_table_object_append(table, o, 1, 0, 1, 2, 0, 1, 0, 1);
298
299 o = e_widget_color_well_add(evas, wd->cv, 0);
300 e_widget_sub_object_add(obj, o);
301 evas_object_show(o);
302 wd->well = o;
303 e_widget_size_min_set(o, 32, 32);
304 e_widget_table_object_append(table, o, 0, 2, 3, 1, 1, 1, 0, 0);
305
306 e_widget_size_min_get(table, &mw, &mh);
307 e_widget_size_min_set(obj, mw, mh);
308
309 return obj;
310}
311
diff --git a/src/bin/e_widget_csel.h b/src/bin/e_widget_csel.h
deleted file mode 100644
index 0f4dbfe..0000000
--- a/src/bin/e_widget_csel.h
+++ /dev/null
@@ -1,6 +0,0 @@
1#ifndef E_WIDGET_CSEL_H
2#define E_WIDGET_CSEL_H
3
4Evas_Object *e_widget_csel_add(Evas *evas, E_Color *color, Eina_Bool alpha_enabled);
5
6#endif