summaryrefslogtreecommitdiff
path: root/src
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 /src
parent7c485d5c1f9b2303e44580b5714062f2ac6da42f (diff)
theme about box! all themes can add their own now! :)
SVN revision: 16839
Diffstat (limited to 'src')
-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
6 files changed, 150 insertions, 4 deletions
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