summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCarsten Haitzler <raster@rasterman.com>2005-09-22 05:52:37 +0000
committerCarsten Haitzler <raster@rasterman.com>2005-09-22 05:52:37 +0000
commit0dc60ba522b1ae0cf3655f6cba9e2c3bd29209c8 (patch)
tree6ba8b10e0311ef2dd3566423a7fcc10c4f357a69
parent7c485d5c1f9b2303e44580b5714062f2ac6da42f (diff)
theme about box! all themes can add their own now! :)
SVN revision: 16839
-rw-r--r--data/themes/Makefile.am3
-rw-r--r--data/themes/default.edc1
-rw-r--r--data/themes/default_theme_about.edc511
-rw-r--r--src/bin/Makefile.am4
-rw-r--r--src/bin/e_about.c6
-rw-r--r--src/bin/e_includes.h1
-rw-r--r--src/bin/e_int_menus.c15
-rw-r--r--src/bin/e_theme_about.c101
-rw-r--r--src/bin/e_theme_about.h27
9 files changed, 664 insertions, 5 deletions
diff --git a/data/themes/Makefile.am b/data/themes/Makefile.am
index 8d8258d..a9892cb 100644
--- a/data/themes/Makefile.am
+++ b/data/themes/Makefile.am
@@ -36,7 +36,8 @@ default_icons.edc \
36default_pointer.edc \ 36default_pointer.edc \
37default_randr.edc \ 37default_randr.edc \
38default_configure.edc \ 38default_configure.edc \
39default_about.edc 39default_about.edc \
40default_theme_about.edc
40 41
41default.edj: Makefile $(EXTRA_DIST) 42default.edj: Makefile $(EXTRA_DIST)
42 $(EDJE_CC) $(EDJE_FLAGS) \ 43 $(EDJE_CC) $(EDJE_FLAGS) \
diff --git a/data/themes/default.edc b/data/themes/default.edc
index 480a159..894edd1 100644
--- a/data/themes/default.edc
+++ b/data/themes/default.edc
@@ -45,5 +45,6 @@ collections {
45#include "default_randr.edc" 45#include "default_randr.edc"
46#include "default_pointer.edc" 46#include "default_pointer.edc"
47#include "default_about.edc" 47#include "default_about.edc"
48#include "default_theme_about.edc"
48} 49}
49 50
diff --git a/data/themes/default_theme_about.edc b/data/themes/default_theme_about.edc
new file mode 100644
index 0000000..ee925d6
--- /dev/null
+++ b/data/themes/default_theme_about.edc
@@ -0,0 +1,511 @@
1images {
2 image: "e17_menu_bg_border.png" COMP;
3 image: "e17_button2.png" COMP;
4 image: "e17_button.png" COMP;
5 image: "e17_dialog_watermark.png" COMP;
6 image: "e17_about_bg_v.png" COMP;
7 image: "e17_about_over_v.png" COMP;
8 image: "e17_logo.png" COMP;
9 image: "e17_about_sky0.png" LOSSY 70;
10 image: "e17_about_sky1.png" LOSSY 70;
11 image: "e17_about_sky2.png" LOSSY 70;
12 image: "e17_about_sky3.png" LOSSY 70;
13 image: "e17_about_sky4.png" LOSSY 70;
14 image: "e17_about_sky5.png" LOSSY 70;
15 image: "e17_about_sky_overlay.png" COMP;
16}
17
18styles
19{
20 style {
21 name: "theme_about_style";
22 base: "font=Edje-Vera style=glow color=#fff glow2_color=#fe87 glow_color=#fa14 font_size=12 align=center wrap=word";
23
24 tag: "br" "\n";
25 tag: "hilight" "+ font=Edje-Vera-Bold";
26 tag: "invisible" "+ font=Edje-Vera font_size=7 style=none color=#0002";
27 }
28}
29
30group {
31 name: "theme/about";
32 min: 400 160;
33 max: 400 160;
34 parts {
35/*
36 part {
37 name: "base";
38 mouse_events: 0;
39 type: RECT;
40 description {
41 state: "default" 0.0;
42 rel1 {
43 relative: 0.0 0.0;
44 offset: 1 1;
45 }
46 rel2 {
47 relative: 1.0 1.0;
48 offset: -2 -2;
49 }
50 color: 221 221 221 255;
51 }
52 }
53 */
54 part {
55 name: "sky";
56 mouse_events: 0;
57 description {
58 state: "default" 0.0;
59 min: 400 160;
60 max: 400 160;
61 align: 0.5 1.0;
62 fixed: 1 1;
63 rel1 {
64 relative: 0.0 1.0;
65 offset: 7 -1;
66 }
67 rel2 {
68 relative: 1.0 1.0;
69 offset: -8 -1;
70 }
71 image {
72 normal: "e17_about_sky0.png";
73 }
74 }
75 }
76 part {
77 name: "sky1";
78 mouse_events: 0;
79 description {
80 state: "default" 0.0;
81 rel1 {
82 to: "sky";
83 }
84 rel2 {
85 to: "sky";
86 }
87 image {
88 normal: "e17_about_sky1.png";
89 }
90 fill {
91 smooth: 0;
92 size {
93 relative: 1.1075 1.0;
94 }
95 }
96 }
97 description {
98 state: "drift" 0.0;
99 inherit: "default" 0.0;
100 fill {
101 origin {
102 relative: -1.1075 0.0;
103 }
104 }
105 }
106 }
107 part {
108 name: "sky4";
109 mouse_events: 0;
110 description {
111 state: "default" 0.0;
112 rel1 {
113 to: "sky";
114 }
115 rel2 {
116 to: "sky";
117 }
118 image {
119 normal: "e17_about_sky4.png";
120 }
121 fill {
122 smooth: 0;
123 size {
124 relative: 1.12 1.0;
125 }
126 }
127 }
128 description {
129 state: "drift" 0.0;
130 inherit: "default" 0.0;
131 fill {
132 origin {
133 relative: -1.12 0.0;
134 }
135 }
136 }
137 }
138 part {
139 name: "about";
140 type: TEXTBLOCK;
141 mouse_events: 0;
142 description {
143 state: "default" 0.0;
144// max: 200 1000;
145// min: 200 0;
146 rel1 {
147 to_x: "logo";
148 relative: 1.0 0.0;
149 offset: 6 6;
150 }
151 rel2 {
152 to_x: "button";
153 relative: 0.0 1.0;
154 offset: -7 -7;
155 }
156 text {
157 style: "theme_about_style";
158 min: 0 1;
159 text:
160"This is the DEFAULT theme for Enlightenment, "
161"also known as the <hilight>BLING BLING</hilight> theme. "
162"It is intended to be conservative and still show "
163"off some aspects of Enlightenment such as "
164"the ability to animate transitions and do "
165"different layouts for objects. Please Enjoy!<br>"
166"<br>"
167"<invisible>Aardvarks!!!</invisible>";
168 }
169 }
170 }
171 part {
172 name: "sky2";
173 mouse_events: 0;
174 description {
175 state: "default" 0.0;
176 rel1 {
177 to: "sky";
178 }
179 rel2 {
180 to: "sky";
181 }
182 image {
183 normal: "e17_about_sky2.png";
184 }
185 fill {
186 smooth: 0;
187 size {
188 relative: 1.1765 1.0;
189 }
190 }
191 }
192 description {
193 state: "drift" 0.0;
194 inherit: "default" 0.0;
195 fill {
196 origin {
197 relative: -1.1765 0.0;
198 }
199 }
200 }
201 }
202 part {
203 name: "logo";
204 type: IMAGE;
205 mouse_events: 0;
206 description {
207 state: "default" 0.0;
208 min: 63 63;
209 max: 63 63;
210 align: 0.0 1.0;
211 fixed: 1 1;
212 rel1 {
213 relative: 0.0 1.0;
214 offset: 6 -6;
215 }
216 rel2 {
217 relative: 0.0 1.0;
218 offset: 6 -6;
219 }
220 image {
221 normal: "e17_logo.png";
222 }
223 }
224 }
225 part {
226 name: "sky3";
227 mouse_events: 0;
228 description {
229 state: "default" 0.0;
230 rel1 {
231 to: "sky";
232 }
233 rel2 {
234 to: "sky";
235 }
236 image {
237 normal: "e17_about_sky3.png";
238 }
239 fill {
240 smooth: 0;
241 size {
242 relative: 2.1325 1.0;
243 }
244 }
245 }
246 description {
247 state: "drift" 0.0;
248 inherit: "default" 0.0;
249 fill {
250 origin {
251 relative: -2.1325 0.0;
252 }
253 }
254 }
255 }
256 part {
257 name: "sky5";
258 mouse_events: 0;
259 description {
260 state: "default" 0.0;
261 rel1 {
262 to: "sky";
263 }
264 rel2 {
265 to: "sky";
266 }
267 image {
268 normal: "e17_about_sky5.png";
269 }
270 }
271 }
272/*
273 part {
274 name: "sky_over";
275 mouse_events: 0;
276 description {
277 state: "default" 0.0;
278 rel1 {
279 to: "sky";
280 }
281 rel2 {
282 to: "sky";
283 }
284 image {
285 normal: "e17_about_sky_overlay.png";
286 }
287 }
288 }
289 part {
290 name: "about_bg";
291 mouse_events: 0;
292 description {
293 state: "default" 0.0;
294 rel1 {
295 to: "about";
296 offset: -7 -7;
297 }
298 rel2 {
299 to: "about";
300 offset: 6 6;
301 }
302 image {
303 normal: "e17_about_bg_v.png";
304 border: 7 7 7 7;
305 }
306 }
307 }
308 part {
309 name: "base2";
310 mouse_events: 0;
311 description {
312 state: "default" 0.0;
313 min: 200 138;
314 max: 200 138;
315 align: 1.0 1.0;
316 fixed: 1 1;
317 rel1 {
318 relative: 1.0 1.0;
319 offset: -1 -1;
320 }
321 rel2 {
322 relative: 1.0 1.0;
323 offset: -1 -1;
324 }
325 image {
326 normal: "e17_dialog_watermark.png";
327 }
328 }
329 }
330 part {
331 name: "base3";
332 mouse_events: 0;
333 description {
334 state: "default" 0.0;
335 image {
336 normal: "e17_menu_bg_border.png";
337 border: 1 1 1 1;
338 middle: 0;
339 }
340 fill {
341 smooth: 0;
342 }
343 }
344 }
345*/
346/*
347 part {
348 name: "about_over";
349 mouse_events: 0;
350 description {
351 state: "default" 0.0;
352 rel1 {
353 to: "about_bg";
354 }
355 rel2 {
356 to: "about_bg";
357 }
358 image {
359 normal: "e17_about_over_v.png";
360 border: 13 13 13 13;
361 }
362 }
363 }
364 */
365 part {
366 name: "button";
367 type: IMAGE;
368 mouse_events: 1;
369 description {
370 state: "default" 0.0;
371 min: 64 32;
372 align: 1.0 1.0;
373 fixed: 1 1;
374 rel1 {
375 relative: 1.0 1.0;
376 offset: -7 -7;
377 }
378 rel2 {
379 relative: 1.0 1.0;
380 offset: -7 -7;
381 }
382 image {
383 normal: "e17_button.png";
384 border: 8 8 8 8;
385 }
386 }
387 description {
388 state: "clicked" 0.0;
389 inherit: "default" 0.0;
390 image {
391 normal: "e17_button2.png";
392 }
393 }
394 }
395 part {
396 name: "button_text";
397 type: TEXT;
398 effect: SHADOW;
399 mouse_events: 0;
400 description {
401 state: "default" 0.0;
402 rel1 {
403 relative: 0.0 0.0;
404 offset: 6 6;
405 to: "button";
406 }
407 rel2 {
408 relative: 1.0 1.0;
409 offset: -7 -7;
410 to: "button";
411 }
412 color: 0 0 0 255;
413 color3: 255 255 255 128;
414 text {
415 text: "OK";
416 font: "Edje-Vera";
417 size: 10;
418 min: 1 1;
419 align: 0.5 0.5;
420 }
421 }
422 }
423 }
424 programs {
425 program {
426 name: "button_click";
427 signal: "mouse,down,1";
428 source: "button";
429 action: STATE_SET "clicked" 0.0;
430 target: "button";
431 }
432 program {
433 name: "button_unclick";
434 signal: "mouse,up,1";
435 source: "button";
436 action: STATE_SET "default" 0.0;
437 target: "button";
438 }
439 program {
440 name: "button_unclick2";
441 signal: "mouse,clicked,1";
442 source: "button";
443 action: SIGNAL_EMIT "close" "";
444 }
445
446 program {
447 name: "anim_sky1a";
448 signal: "show";
449 source: "";
450 action: STATE_SET "drift" 0.0;
451 transition: LINEAR 20.0;
452 target: "sky1";
453 after: "anim_sky1b";
454 }
455 program {
456 name: "anim_sky1b";
457 action: STATE_SET "default" 0.0;
458 target: "sky1";
459 after: "anim_sky1a";
460 }
461
462 program {
463 name: "anim_sky4a";
464 signal: "show";
465 source: "";
466 action: STATE_SET "drift" 0.0;
467 transition: LINEAR 15.0;
468 target: "sky4";
469 after: "anim_sky4b";
470 }
471 program {
472 name: "anim_sky4b";
473 action: STATE_SET "default" 0.0;
474 target: "sky4";
475 after: "anim_sky4a";
476 }
477
478 program {
479 name: "anim_sky2a";
480 signal: "show";
481 source: "";
482 action: STATE_SET "drift" 0.0;
483 transition: LINEAR 15.0;
484 target: "sky2";
485 after: "anim_sky2b";
486 }
487 program {
488 name: "anim_sky2b";
489 action: STATE_SET "default" 0.0;
490 target: "sky2";
491 after: "anim_sky2a";
492 }
493
494 program {
495 name: "anim_sky3a";
496 signal: "show";
497 source: "";
498 action: STATE_SET "drift" 0.0;
499 transition: LINEAR 15.0;
500 target: "sky3";
501 after: "anim_sky3b";
502 }
503 program {
504 name: "anim_sky3b";
505 action: STATE_SET "default" 0.0;
506 target: "sky3";
507 after: "anim_sky3a";
508 }
509
510 }
511}
diff --git a/src/bin/Makefile.am b/src/bin/Makefile.am
index cd43d00..a0a0293 100644
--- a/src/bin/Makefile.am
+++ b/src/bin/Makefile.am
@@ -71,7 +71,8 @@ e_win.h \
71e_pan.h \ 71e_pan.h \
72e_dialog.h \ 72e_dialog.h \
73e_configure.h \ 73e_configure.h \
74e_about.h 74e_about.h \
75e_theme_about.h
75 76
76enlightenment_SOURCES = \ 77enlightenment_SOURCES = \
77e_main.c \ 78e_main.c \
@@ -131,6 +132,7 @@ e_pan.c \
131e_dialog.c \ 132e_dialog.c \
132e_configure.c \ 133e_configure.c \
133e_about.c \ 134e_about.c \
135e_theme_about.c \
134$(ENLIGHTENMENTHEADERS) 136$(ENLIGHTENMENTHEADERS)
135 137
136enlightenment_LDFLAGS = -export-dynamic @e_libs@ @x_libs@ @dlopen_libs@ @cf_libs@ 138enlightenment_LDFLAGS = -export-dynamic @e_libs@ @x_libs@ @dlopen_libs@ @cf_libs@
diff --git a/src/bin/e_about.c b/src/bin/e_about.c
index 5fccbf4..f758b49 100644
--- a/src/bin/e_about.c
+++ b/src/bin/e_about.c
@@ -6,7 +6,7 @@
6/* local subsystem functions */ 6/* local subsystem functions */
7static void _e_about_free(E_About *about); 7static void _e_about_free(E_About *about);
8static void _e_about_cb_delete(E_Win *win); 8static void _e_about_cb_delete(E_Win *win);
9static void _e_dialog_cb_close(void *data, Evas_Object *obj, const char *emission, const char *source); 9static void _e_about_cb_close(void *data, Evas_Object *obj, const char *emission, const char *source);
10 10
11/* local subsystem globals */ 11/* local subsystem globals */
12 12
@@ -68,7 +68,7 @@ e_about_new(E_Container *con)
68 ) 68 )
69 ); 69 );
70 edje_object_signal_callback_add(about->bg_object, "close", "", 70 edje_object_signal_callback_add(about->bg_object, "close", "",
71 _e_dialog_cb_close, about); 71 _e_about_cb_close, about);
72 { 72 {
73 FILE *f; 73 FILE *f;
74 char buf[4096], buf2[4096], *tbuf; 74 char buf[4096], buf2[4096], *tbuf;
@@ -166,7 +166,7 @@ _e_about_cb_delete(E_Win *win)
166} 166}
167 167
168static void 168static void
169_e_dialog_cb_close(void *data, Evas_Object *obj, const char *emission, const char *source) 169_e_about_cb_close(void *data, Evas_Object *obj, const char *emission, const char *source)
170{ 170{
171 E_About *about; 171 E_About *about;
172 172
diff --git a/src/bin/e_includes.h b/src/bin/e_includes.h
index e565e3b..3dd72c0 100644
--- a/src/bin/e_includes.h
+++ b/src/bin/e_includes.h
@@ -58,3 +58,4 @@
58#include "e_dialog.h" 58#include "e_dialog.h"
59#include "e_configure.h" 59#include "e_configure.h"
60#include "e_about.h" 60#include "e_about.h"
61#include "e_theme_about.h"
diff --git a/src/bin/e_int_menus.c b/src/bin/e_int_menus.c
index d99f244..ee1b94b 100644
--- a/src/bin/e_int_menus.c
+++ b/src/bin/e_int_menus.c
@@ -24,6 +24,7 @@ static void _e_int_menus_quit (void);
24static void _e_int_menus_quit_cb (void *data); 24static void _e_int_menus_quit_cb (void *data);
25static void _e_int_menus_main_del_hook (void *obj); 25static void _e_int_menus_main_del_hook (void *obj);
26static void _e_int_menus_main_about (void *data, E_Menu *m, E_Menu_Item *mi); 26static void _e_int_menus_main_about (void *data, E_Menu *m, E_Menu_Item *mi);
27static void _e_int_menus_main_theme_about (void *data, E_Menu *m, E_Menu_Item *mi);
27static void _e_int_menus_main_run (void *data, E_Menu *m, E_Menu_Item*mi); 28static void _e_int_menus_main_run (void *data, E_Menu *m, E_Menu_Item*mi);
28static void _e_int_menus_main_restart (void *data, E_Menu *m, E_Menu_Item *mi); 29static void _e_int_menus_main_restart (void *data, E_Menu *m, E_Menu_Item *mi);
29static void _e_int_menus_main_exit (void *data, E_Menu *m, E_Menu_Item *mi); 30static void _e_int_menus_main_exit (void *data, E_Menu *m, E_Menu_Item *mi);
@@ -134,6 +135,11 @@ e_int_menus_main_new(void)
134 e_util_menu_item_edje_icon_set(mi, "enlightenment/e"); 135 e_util_menu_item_edje_icon_set(mi, "enlightenment/e");
135 e_menu_item_callback_set(mi, _e_int_menus_main_about, NULL); 136 e_menu_item_callback_set(mi, _e_int_menus_main_about, NULL);
136 137
138 mi = e_menu_item_new(m);
139 e_menu_item_label_set(mi, _("About This Theme"));
140 e_util_menu_item_edje_icon_set(mi, "enlightenment/theme");
141 e_menu_item_callback_set(mi, _e_int_menus_main_theme_about, NULL);
142
137 if (ecore_file_app_installed("exige")) 143 if (ecore_file_app_installed("exige"))
138 { 144 {
139 mi = e_menu_item_new(m); 145 mi = e_menu_item_new(m);
@@ -359,6 +365,15 @@ _e_int_menus_main_about(void *data, E_Menu *m, E_Menu_Item *mi)
359} 365}
360 366
361static void 367static void
368_e_int_menus_main_theme_about(void *data, E_Menu *m, E_Menu_Item *mi)
369{
370 E_Theme_About *about;
371
372 about = e_theme_about_new(e_container_current_get(e_manager_current_get()));
373 if (about) e_theme_about_show(about);
374}
375
376static void
362_e_int_menus_main_run(void *data, E_Menu *m, E_Menu_Item *mi) 377_e_int_menus_main_run(void *data, E_Menu *m, E_Menu_Item *mi)
363{ 378{
364 Ecore_Exe *exe; 379 Ecore_Exe *exe;
diff --git a/src/bin/e_theme_about.c b/src/bin/e_theme_about.c
new file mode 100644
index 0000000..f1523a5
--- /dev/null
+++ b/src/bin/e_theme_about.c
@@ -0,0 +1,101 @@
1/*
2 * vim:ts=8:sw=3:sts=8:noexpandtab:cino=>5n-3f0^-2{2
3 */
4#include "e.h"
5
6/* local subsystem functions */
7static void _e_theme_about_free(E_Theme_About *about);
8static void _e_theme_about_cb_delete(E_Win *win);
9static void _e_theme_about_cb_close(void *data, Evas_Object *obj, const char *emission, const char *source);
10
11/* local subsystem globals */
12
13/* externally accessible functions */
14
15E_Theme_About *
16e_theme_about_new(E_Container *con)
17{
18 E_Theme_About *about;
19 E_Manager *man;
20 Evas_Object *o;
21
22 if (!con)
23 {
24 man = e_manager_current_get();
25 if (!man) return NULL;
26 con = e_container_current_get(man);
27 if (!con) con = e_container_number_get(man, 0);
28 if (!con) return NULL;
29 }
30 about = E_OBJECT_ALLOC(E_Theme_About, E_THEME_ABOUT_TYPE, _e_theme_about_free);
31 if (!about) return NULL;
32 about->win = e_win_new(con);
33 if (!about->win)
34 {
35 free(about);
36 return NULL;
37 }
38 e_win_delete_callback_set(about->win, _e_theme_about_cb_delete);
39 about->win->data = about;
40 e_win_name_class_set(about->win, "E", "_theme_about");
41 e_win_title_set(about->win, _("About This Theme"));
42
43 o = edje_object_add(e_win_evas_get(about->win));
44 about->bg_object = o;
45 e_theme_edje_object_set(o, "base",
46 "theme/about");
47 evas_object_move(o, 0, 0);
48 evas_object_show(o);
49
50 edje_object_signal_callback_add(about->bg_object, "close", "",
51 _e_theme_about_cb_close, about);
52 e_win_centered_set(about->win, 1);
53 return about;
54}
55
56void
57e_theme_about_show(E_Theme_About *about)
58{
59 Evas_Coord w, h, mw, mh;
60
61 edje_object_size_min_get(about->bg_object, &mw, &mh);
62 evas_object_resize(about->bg_object, mw, mh);
63 e_win_resize(about->win, mw, mh);
64 e_win_size_min_set(about->win, mw, mh);
65
66 edje_object_size_max_get(about->bg_object, &w, &h);
67 if ((w > 0) && (h > 0))
68 {
69 if (w < mw) w = mw;
70 if (h < mh) h = mh;
71 e_win_size_max_set(about->win, mw, mh);
72 }
73 e_win_show(about->win);
74}
75
76/* local subsystem functions */
77static void
78_e_theme_about_free(E_Theme_About *about)
79{
80 if (about->bg_object) evas_object_del(about->bg_object);
81 e_object_del(E_OBJECT(about->win));
82 free(about);
83}
84
85static void
86_e_theme_about_cb_delete(E_Win *win)
87{
88 E_Theme_About *about;
89
90 about = win->data;
91 e_object_del(E_OBJECT(about));
92}
93
94static void
95_e_theme_about_cb_close(void *data, Evas_Object *obj, const char *emission, const char *source)
96{
97 E_Theme_About *about;
98
99 about = data;
100 e_object_del(E_OBJECT(about));
101}
diff --git a/src/bin/e_theme_about.h b/src/bin/e_theme_about.h
new file mode 100644
index 0000000..cc595c7
--- /dev/null
+++ b/src/bin/e_theme_about.h
@@ -0,0 +1,27 @@
1/*
2 * vim:ts=8:sw=3:sts=8:noexpandtab:cino=>5n-3f0^-2{2
3 */
4#ifdef E_TYPEDEFS
5
6typedef struct _E_Theme_About E_Theme_About;
7
8#else
9#ifndef E_THEME_ABOUT_H
10#define E_THEME_ABOUT_H
11
12#define E_THEME_ABOUT_TYPE 0xE0b01015
13
14struct _E_Theme_About
15{
16 E_Object e_obj_inherit;
17
18 E_Win *win;
19 Evas_Object *bg_object;
20 void *data;
21};
22
23EAPI E_Theme_About *e_theme_about_new (E_Container *con);
24EAPI void e_theme_about_show (E_Theme_About *about);
25
26#endif
27#endif