summaryrefslogtreecommitdiff
path: root/src/bin
diff options
context:
space:
mode:
authorCarsten Haitzler <raster@rasterman.com>2012-06-30 11:16:14 +0000
committerCarsten Haitzler <raster@rasterman.com>2012-06-30 11:16:14 +0000
commitfb1c18ada9ab2f373adfe0222ee8204ca40d9fad (patch)
tree2185dfcf09b5f3c0246e1669801496b1ecf6a04e /src/bin
parentbecb0201aa28104e922f83e0b2b78f737561c455 (diff)
oops forgot to add.
SVN revision: 73081
Diffstat (limited to 'src/bin')
-rw-r--r--src/bin/about.c121
-rw-r--r--src/bin/about.h1
2 files changed, 122 insertions, 0 deletions
diff --git a/src/bin/about.c b/src/bin/about.c
new file mode 100644
index 0000000..0e4f229
--- /dev/null
+++ b/src/bin/about.c
@@ -0,0 +1,121 @@
1#include "private.h"
2
3#include <Elementary.h>
4#include "about.h"
5
6static Evas_Object *ab_layout = NULL, *ab_over;
7static Eina_Bool ab_out = EINA_FALSE;
8static Ecore_Timer *ab_del_timer = NULL;
9static Evas_Object *saved_win = NULL;
10static Evas_Object *saved_bg = NULL;
11
12static Eina_Bool
13_cb_ab_del_delay(void *data __UNUSED__)
14{
15 evas_object_del(ab_layout);
16 ab_layout = NULL;
17 ab_del_timer = NULL;
18 elm_cache_all_flush();
19 return EINA_FALSE;
20}
21
22static void
23_cb_mouse_down(void *data, Evas *e __UNUSED__, Evas_Object *obj __UNUSED__, void *ev __UNUSED__)
24{
25 about_toggle(saved_win, saved_bg, data);
26}
27
28void
29about_toggle(Evas_Object *win, Evas_Object *bg, Evas_Object *term)
30{
31 Evas_Object *o;
32
33 saved_win = win;
34 saved_bg = bg;
35 if (!ab_layout)
36 {
37 char buf[PATH_MAX];
38
39 ab_layout = o = elm_layout_add(win);
40 snprintf(buf, sizeof(buf), "%s/themes/default.edj",
41 elm_app_data_dir_get());
42 elm_layout_file_set(o, buf, "terminology/about");
43 elm_object_part_text_set
44 (o, "terminology.text",
45 "<b>Terminology</b><br>"
46 "Why should terminals be boring?<br>"
47 "<br>"
48 "This terminal was written for Enlightenment, to use EFL "
49 "and otherwise push the boundaries of what a modern terminal"
50 "emulator should be. We hope you enjoy it.<br"
51 "<br>"
52 "Copyright © 2012 by:<br>"
53 "Carsten Haitzler<br>"
54 // add more authors here
55 "<br>"
56 "<br>"
57 "Distrubted under the 2-clause BSD license detailed below:<br>"
58 "<br>"
59 "All rights reserved.<br>"
60 "<br>"
61 "Redistribution and use in source and binary forms, with or "
62 "without modification, are permitted provided that the "
63 "following conditions are met:<br>"
64 "<br>"
65 "1. Redistributions of source code must retain the above "
66 "copyright notice, this list of conditions and the following "
67 "disclaimer.<br>"
68 "2. Redistributions in binary form must reproduce the above "
69 "copyright notice, this list of conditions and the following "
70 "disclaimer in the documentation and/or other materials "
71 "provided with the distribution.<br>"
72 "<br>"
73 "<b>THIS SOFTWARE IS PROVIDED \"AS IS\" AND ANY EXPRESS OR "
74 "IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED "
75 "WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR "
76 "PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER "
77 "OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, "
78 "INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES "
79 "(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE "
80 "GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS "
81 "INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, "
82 "WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING "
83 "NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF "
84 "THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH "
85 "DAMAGE.</b>"
86 );
87 evas_object_show(o);
88 edje_object_part_swallow(bg, "terminology.about", ab_layout);
89 }
90 if (!ab_out)
91 {
92 ab_over = o = evas_object_rectangle_add(evas_object_evas_get(win));
93 evas_object_size_hint_weight_set(o, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
94 evas_object_size_hint_align_set(o, EVAS_HINT_FILL, EVAS_HINT_FILL);
95 evas_object_color_set(o, 0, 0, 0, 0);
96 elm_win_resize_object_add(win, o);
97 evas_object_show(o);
98 evas_object_event_callback_add(o, EVAS_CALLBACK_MOUSE_DOWN,
99 _cb_mouse_down, term);
100
101 edje_object_signal_emit(bg, "about,show", "terminology");
102 ab_out = EINA_TRUE;
103 elm_object_focus_set(ab_layout, EINA_TRUE);
104 if (ab_del_timer)
105 {
106 ecore_timer_del(ab_del_timer);
107 ab_del_timer = NULL;
108 }
109 }
110 else
111 {
112 evas_object_del(ab_over);
113 ab_over = NULL;
114 edje_object_signal_emit(bg, "about,hide", "terminology");
115 ab_out = EINA_FALSE;
116 elm_object_focus_set(ab_layout, EINA_FALSE);
117 elm_object_focus_set(term, EINA_TRUE);
118 if (ab_del_timer) ecore_timer_del(ab_del_timer);
119 ab_del_timer = ecore_timer_add(10.0, _cb_ab_del_delay, NULL);
120 }
121}
diff --git a/src/bin/about.h b/src/bin/about.h
new file mode 100644
index 0000000..d414c08
--- /dev/null
+++ b/src/bin/about.h
@@ -0,0 +1 @@
void about_toggle(Evas_Object *win, Evas_Object *bg, Evas_Object *term);