summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorCarsten Haitzler <raster@rasterman.com>2001-08-02 00:13:52 +0000
committerCarsten Haitzler <raster@rasterman.com>2001-08-02 00:13:52 +0000
commite8e462159f6d7c92ce3c0c6ba2093093e398256f (patch)
treeedfbcc79f22f239635767d2ae60592ebdb150994 /src
parentfc25a6f20de03e06b320e08e169e6b313a6c70c0 (diff)
pass make distcheck :)
SVN revision: 5027
Diffstat (limited to 'src')
-rw-r--r--src/Makefile.am4
-rw-r--r--src/text.c152
-rw-r--r--src/text.h5
3 files changed, 140 insertions, 21 deletions
diff --git a/src/Makefile.am b/src/Makefile.am
index be9bd6bd8..24e94dd9a 100644
--- a/src/Makefile.am
+++ b/src/Makefile.am
@@ -11,12 +11,12 @@ enlightenment_SOURCES = \
11 background.h background.c \ 11 background.h background.c \
12 border.h border.c \ 12 border.h border.c \
13 config.h config.c \ 13 config.h config.c \
14 destops.h desktops.c \ 14 desktops.h desktops.c \
15 entry.h entry.c \ 15 entry.h entry.c \
16 exec.h exec.c \ 16 exec.h exec.c \
17 fs.h fs.c \ 17 fs.h fs.c \
18 icccm.h icccm.c \ 18 icccm.h icccm.c \
19 icons.h icons.c \ 19 icons.c \
20 ipc.h ipc.c \ 20 ipc.h ipc.c \
21 keys.h keys.c \ 21 keys.h keys.c \
22 main.c \ 22 main.c \
diff --git a/src/text.c b/src/text.c
index dd3e1604b..b8f636367 100644
--- a/src/text.c
+++ b/src/text.c
@@ -15,10 +15,21 @@ e_text_new(Evas evas, char *text, char *class)
15 t->evas = evas; 15 t->evas = evas;
16 t->obj = evas_add_text(t->evas, "borzoib", 8, t->text); 16 t->obj = evas_add_text(t->evas, "borzoib", 8, t->text);
17 evas_set_color(t->evas, t->obj, 0, 0, 0, 255); 17 evas_set_color(t->evas, t->obj, 0, 0, 0, 255);
18 t->color.r = 0;
19 t->color.g = 0;
20 t->color.b = 0;
21 t->color.a = 255;
22 t->w = evas_get_text_width(t->evas, t->obj);
23 t->h = evas_get_text_height(t->evas, t->obj);
24 t->min.w = t->w;
25 t->min.h = t->h;
26 t->max.w = t->w;
27 t->max.h = t->h;
18 return t; 28 return t;
19} 29}
20 30
21void e_text_free(E_Text *t) 31void
32e_text_free(E_Text *t)
22{ 33{
23 IF_FREE(t->state); 34 IF_FREE(t->state);
24 IF_FREE(t->class); 35 IF_FREE(t->class);
@@ -31,19 +42,126 @@ void e_text_free(E_Text *t)
31 FREE(t); 42 FREE(t);
32} 43}
33 44
34void e_text_set_text(E_Text *t){} 45void
35void e_text_set_layer(E_Text *t, int l){} 46e_text_set_text(E_Text *t, char *text)
36void e_text_set_clip(E_Text *t, Evas_Object clip){} 47{
37void e_text_unset_clip(E_Text *t){} 48 if (!text) text = "";
38void e_text_raise(E_Text *t){} 49 if (!strcmp(t->text, text)) return;
39void e_text_lower(E_Text *t){} 50 IF_FREE(t->text);
40void e_text_show(E_Text *t){} 51 t->text = strdup(text);
41void e_text_hide(E_Text *t){} 52 evas_set_text(t->evas, t->obj, t->text);
42void e_text_set_color(E_Text *t, int r, int g, int b, int a){} 53}
43void e_text_move(E_Text *t, double x, double y){} 54
44void e_text_resize(E_Text *t, double w, double h){} 55void
45void e_text_get_geometry(E_Text *t, double *x, double *y, double *w, double *h){} 56e_text_set_layer(E_Text *t, int l)
46void e_text_get_min_size(E_Text *t, double *w, double *h){} 57{
47void e_text_get_max_size(E_Text *t, double *w, double *h){} 58 if (t->layer == l) return;
48void e_text_set_state(E_Text *t, char *state){} 59 t->layer = l;
49 60 evas_set_layer(t->evas, t->obj, t->layer);
61}
62
63void
64e_text_set_clip(E_Text *t, Evas_Object clip)
65{
66 evas_set_clip(t->evas, t->obj, clip);
67}
68
69void
70e_text_unset_clip(E_Text *t)
71{
72 evas_unset_clip(t->evas, t->obj);
73}
74
75void
76e_text_raise(E_Text *t)
77{
78 evas_raise(t->evas, t->obj);
79}
80
81void
82e_text_lower(E_Text *t)
83{
84 evas_lower(t->evas, t->obj);
85}
86
87void
88e_text_show(E_Text *t)
89{
90 if (t->visible) return;
91 t->visible = 1;
92 evas_show(t->evas, t->obj);
93}
94
95void
96e_text_hide(E_Text *t)
97{
98 if (!t->visible) return;
99 t->visible = 0;
100 evas_hide(t->evas, t->obj);
101}
102
103void
104e_text_set_color(E_Text *t, int r, int g, int b, int a)
105{
106 if ((r == t->color.r) &&
107 (g == t->color.g) &&
108 (b == t->color.b) &&
109 (a == t->color.a)) return;
110 t->color.r = r;
111 t->color.g = g;
112 t->color.b = b;
113 t->color.a = a;
114 evas_set_color(t->evas, t->obj, t->color.r, t->color.g, t->color.b, t->color.a);
115}
116
117void
118e_text_move(E_Text *t, double x, double y)
119{
120 if ((t->x == x) && (t->y == y)) return;
121 t->x = x;
122 t->y = y;
123 evas_move(t->evas, t->obj, t->x, t->y);
124}
125
126void
127e_text_resize(E_Text *t, double w, double h)
128{
129}
130
131void
132e_text_get_geometry(E_Text *t, double *x, double *y, double *w, double *h)
133{
134 if (x) *x = t->x;
135 if (y) *y = t->y;
136 if (w) *w = t->w;
137 if (h) *h = t->h;
138}
139
140void
141e_text_get_min_size(E_Text *t, double *w, double *h)
142{
143 if (w) *w = t->min.w;
144 if (h) *h = t->min.h;
145}
146
147void
148e_text_get_max_size(E_Text *t, double *w, double *h)
149{
150 if (w) *w = t->max.w;
151 if (h) *h = t->max.h;
152}
153
154void
155e_text_set_state(E_Text *t, char *state)
156{
157}
158
159void
160e_text_set_class(E_Text *t, char *class)
161{
162}
163
164void
165e_text_update_class(E_Text *t)
166{
167}
diff --git a/src/text.h b/src/text.h
index 6dd1913c1..3806e73bf 100644
--- a/src/text.h
+++ b/src/text.h
@@ -27,7 +27,7 @@ struct _E_Text
27 27
28E_Text *e_text_new(Evas evas, char *text, char *class); 28E_Text *e_text_new(Evas evas, char *text, char *class);
29void e_text_free(E_Text *t); 29void e_text_free(E_Text *t);
30void e_text_set_text(E_Text *t); 30void e_text_set_text(E_Text *t, char *text);
31void e_text_set_layer(E_Text *t, int l); 31void e_text_set_layer(E_Text *t, int l);
32void e_text_set_clip(E_Text *t, Evas_Object clip); 32void e_text_set_clip(E_Text *t, Evas_Object clip);
33void e_text_unset_clip(E_Text *t); 33void e_text_unset_clip(E_Text *t);
@@ -42,5 +42,6 @@ void e_text_get_geometry(E_Text *t, double *x, double *y, double *w, double *
42void e_text_get_min_size(E_Text *t, double *w, double *h); 42void e_text_get_min_size(E_Text *t, double *w, double *h);
43void e_text_get_max_size(E_Text *t, double *w, double *h); 43void e_text_get_max_size(E_Text *t, double *w, double *h);
44void e_text_set_state(E_Text *t, char *state); 44void e_text_set_state(E_Text *t, char *state);
45 45void e_text_set_class(E_Text *t, char *class);
46void e_text_update_class(E_Text *t);
46#endif 47#endif