summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMike Blumenkrantz <zmike@osg.samsung.com>2015-04-06 14:43:16 -0400
committerMike Blumenkrantz <zmike@osg.samsung.com>2015-04-06 15:26:36 -0400
commit6e4710cc91564f0b856be752f02fea8540c63864 (patch)
tree499323479f108488931e589efdec7fa95662a33d
parent2fc7b0169c8e712d18c59cc1a7a1bbfd7368377b (diff)
remove e_color_class
-rw-r--r--po/POTFILES.in1
-rw-r--r--src/bin/Makefile.mk2
-rw-r--r--src/bin/e_color_class.c163
-rw-r--r--src/bin/e_color_class.h43
-rw-r--r--src/bin/e_includes.h1
5 files changed, 0 insertions, 210 deletions
diff --git a/po/POTFILES.in b/po/POTFILES.in
index 84fc1c4..4c493c5 100644
--- a/po/POTFILES.in
+++ b/po/POTFILES.in
@@ -6,7 +6,6 @@ src/bin/e_bg.c
6src/bin/e_bindings.c 6src/bin/e_bindings.c
7src/bin/e_client.c 7src/bin/e_client.c
8src/bin/e_color.c 8src/bin/e_color.c
9src/bin/e_color_class.c
10src/bin/e_color_dialog.c 9src/bin/e_color_dialog.c
11src/bin/e_comp.c 10src/bin/e_comp.c
12src/bin/e_comp_x.c 11src/bin/e_comp_x.c
diff --git a/src/bin/Makefile.mk b/src/bin/Makefile.mk
index 5a50c0f..279cbc5 100644
--- a/src/bin/Makefile.mk
+++ b/src/bin/Makefile.mk
@@ -52,7 +52,6 @@ src/bin/e_bg.h \
52src/bin/e_bindings.h \ 52src/bin/e_bindings.h \
53src/bin/e_client.h \ 53src/bin/e_client.h \
54src/bin/e_client.x \ 54src/bin/e_client.x \
55src/bin/e_color_class.h \
56src/bin/e_color_dialog.h \ 55src/bin/e_color_dialog.h \
57src/bin/e_color.h \ 56src/bin/e_color.h \
58src/bin/e_comp.h \ 57src/bin/e_comp.h \
@@ -219,7 +218,6 @@ src/bin/e_bg.c \
219src/bin/e_bindings.c \ 218src/bin/e_bindings.c \
220src/bin/e_client.c \ 219src/bin/e_client.c \
221src/bin/e_color.c \ 220src/bin/e_color.c \
222src/bin/e_color_class.c \
223src/bin/e_color_dialog.c \ 221src/bin/e_color_dialog.c \
224src/bin/e_comp.c \ 222src/bin/e_comp.c \
225src/bin/e_comp_canvas.c \ 223src/bin/e_comp_canvas.c \
diff --git a/src/bin/e_color_class.c b/src/bin/e_color_class.c
deleted file mode 100644
index a5af91d..0000000
--- a/src/bin/e_color_class.c
+++ /dev/null
@@ -1,163 +0,0 @@
1#include "e.h"
2
3EINTERN int
4e_color_class_init(void)
5{
6 const Eina_List *l;
7 const E_Color_Class *cc;
8
9 EINA_LIST_FOREACH(e_config->color_classes, l, cc)
10 {
11 if (!cc) continue;
12
13 printf("INIT CC: %s, %d %d %d %d\n", cc->name, cc->r, cc->g, cc->b, cc->a);
14 edje_color_class_set(cc->name,
15 cc->r, cc->g, cc->b, cc->a,
16 cc->r2, cc->g2, cc->b2, cc->a2,
17 cc->r3, cc->g3, cc->b3, cc->a3);
18 }
19 return 1;
20}
21
22EINTERN int
23e_color_class_shutdown(void)
24{
25 return 1;
26}
27
28static Eina_List *
29e_color_class_node_find_stringshared(const char *name)
30{
31 Eina_List *l;
32 E_Color_Class *cc;
33
34 EINA_LIST_FOREACH(e_config->color_classes, l, cc)
35 if (cc && cc->name == name)
36 return l;
37 return NULL;
38}
39
40EAPI E_Color_Class *
41e_color_class_find_stringshared(const char *name)
42{
43 Eina_List *l = e_color_class_node_find_stringshared(name);
44 if (!l) return NULL;
45 return l->data;
46}
47
48EAPI E_Color_Class *
49e_color_class_find(const char *name)
50{
51 E_Color_Class *cc;
52
53 name = eina_stringshare_add(name);
54 cc = e_color_class_find_stringshared(name);
55 eina_stringshare_del(name);
56
57 return cc;
58}
59
60EAPI void
61e_color_class_instance_set(E_Color_Class *cc, int r, int g, int b, int a, int r2, int b2, int g2, int a2, int r3, int g3, int b3, int a3)
62{
63 if (!cc) return;
64
65 if (r != -1) cc->r = E_CLAMP(r, 0, 255);
66 if (g != -1) cc->g = E_CLAMP(g, 0, 255);
67 if (b != -1) cc->b = E_CLAMP(b, 0, 255);
68 if (a != -1) cc->a = E_CLAMP(a, 0, 255);
69 if (r2 != -1) cc->r2 = E_CLAMP(r2, 0, 255);
70 if (g2 != -1) cc->g2 = E_CLAMP(g2, 0, 255);
71 if (b2 != -1) cc->b2 = E_CLAMP(b2, 0, 255);
72 if (a2 != -1) cc->a2 = E_CLAMP(a2, 0, 255);
73 if (r3 != -1) cc->r3 = E_CLAMP(r3, 0, 255);
74 if (g3 != -1) cc->g3 = E_CLAMP(g3, 0, 255);
75 if (b3 != -1) cc->b3 = E_CLAMP(b3, 0, 255);
76 if (a3 != -1) cc->a3 = E_CLAMP(a3, 0, 255);
77
78 edje_color_class_set(cc->name,
79 cc->r, cc->g, cc->b, cc->a,
80 cc->r2, cc->g2, cc->b2, cc->a2,
81 cc->r3, cc->g3, cc->b3, cc->a3);
82 e_config_save_queue();
83}
84
85EAPI E_Color_Class *
86e_color_class_set_stringshared(const char *color_class, int r, int g, int b, int a, int r2, int b2, int g2, int a2, int r3, int g3, int b3, int a3)
87{
88 E_Color_Class *cc = e_color_class_find_stringshared(color_class);
89 if (!cc)
90 {
91 cc = E_NEW(E_Color_Class, 1);
92 if (!cc) return NULL;
93 e_config->color_classes = eina_list_append(e_config->color_classes, cc);
94 cc->name = eina_stringshare_ref(color_class);
95 cc->r = cc->g = cc->b = cc->a = 255;
96 cc->r2 = cc->g2 = cc->b2 = cc->a2 = 255;
97 cc->r3 = cc->g3 = cc->b3 = cc->a3 = 255;
98 }
99
100 e_color_class_instance_set(cc,
101 r, g, b, a,
102 r2, g2, b2, a2,
103 r3, g3, b3, a3);
104 return cc;
105}
106
107EAPI E_Color_Class *
108e_color_class_set(const char *color_class, int r, int g, int b, int a, int r2, int b2, int g2, int a2, int r3, int g3, int b3, int a3)
109{
110 E_Color_Class *cc;
111
112 color_class = eina_stringshare_add(color_class);
113 cc = e_color_class_set_stringshared(color_class,
114 r, g, b, a,
115 r2, g2, b2, a2,
116 r3, g3, b3, a3);
117 eina_stringshare_del(color_class);
118
119 return cc;
120}
121
122static void
123e_color_class_node_del(Eina_List *n)
124{
125 E_Color_Class *cc = n->data;
126 edje_color_class_del(cc->name);
127 eina_stringshare_del(cc->name);
128 E_FREE(cc);
129
130 e_config->color_classes = eina_list_remove_list(e_config->color_classes, n);
131 e_config_save_queue();
132}
133
134EAPI void
135e_color_class_instance_del(E_Color_Class *cc)
136{
137 Eina_List *n = eina_list_data_find_list(e_config->color_classes, cc);
138 if (!n) return;
139 e_color_class_node_del(n);
140}
141
142EAPI void
143e_color_class_del_stringshared(const char *name)
144{
145 Eina_List *n = e_color_class_node_find_stringshared(name);
146 if (!n) return;
147 e_color_class_node_del(n);
148}
149
150EAPI void
151e_color_class_del(const char *name)
152{
153 name = eina_stringshare_add(name);
154 e_color_class_del_stringshared(name);
155 eina_stringshare_del(name);
156}
157
158EAPI Eina_List *
159e_color_class_list(void)
160{
161 return e_config->color_classes;
162}
163
diff --git a/src/bin/e_color_class.h b/src/bin/e_color_class.h
deleted file mode 100644
index 7675409..0000000
--- a/src/bin/e_color_class.h
+++ /dev/null
@@ -1,43 +0,0 @@
1#ifdef E_TYPEDEFS
2
3typedef struct _E_Color_Class E_Color_Class;
4
5#else
6#ifndef E_COLOR_CLASSES_H
7#define E_COLOR_CLASSES_H
8
9struct _E_Color_Class
10{
11 const char *name; /* stringshared name */
12 int r, g, b, a;
13 int r2, g2, b2, a2;
14 int r3, g3, b3, a3;
15};
16
17EINTERN int e_color_class_init(void);
18EINTERN int e_color_class_shutdown(void);
19
20EAPI void e_color_class_instance_set(E_Color_Class *cc,
21 int r, int g, int b, int a,
22 int r2, int b2, int g2, int a2,
23 int r3, int g3, int b3, int a3);
24EAPI E_Color_Class *e_color_class_set_stringshared(const char *color_class,
25 int r, int g, int b, int a,
26 int r2, int b2, int g2, int a2,
27 int r3, int g3, int b3, int a3);
28EAPI E_Color_Class *e_color_class_set(const char *color_class,
29 int r, int g, int b, int a,
30 int r2, int b2, int g2, int a2,
31 int r3, int g3, int b3, int a3);
32EAPI E_Color_Class *e_color_class_find(const char *name);
33EAPI E_Color_Class *e_color_class_find_stringshared(const char *name);
34
35
36EAPI void e_color_class_instance_del(E_Color_Class *cc);
37EAPI void e_color_class_del_stringshared(const char *name);
38EAPI void e_color_class_del(const char *name);
39
40EAPI Eina_List *e_color_class_list(void);
41
42#endif
43#endif
diff --git a/src/bin/e_includes.h b/src/bin/e_includes.h
index f6f104b..359aa73 100644
--- a/src/bin/e_includes.h
+++ b/src/bin/e_includes.h
@@ -85,7 +85,6 @@
85#include "e_dpms.h" 85#include "e_dpms.h"
86#include "e_int_config_modules.h" 86#include "e_int_config_modules.h"
87#include "e_exehist.h" 87#include "e_exehist.h"
88#include "e_color_class.h"
89#include "e_widget_textblock.h" 88#include "e_widget_textblock.h"
90#include "e_gadcon.h" 89#include "e_gadcon.h"
91#include "e_shelf.h" 90#include "e_shelf.h"