2012-06-30 04:16:14 -07:00
|
|
|
#include "private.h"
|
|
|
|
|
|
|
|
#include <Elementary.h>
|
2018-01-02 14:44:44 -08:00
|
|
|
#include <assert.h>
|
2012-06-30 04:16:14 -07:00
|
|
|
#include "about.h"
|
2013-01-30 15:09:47 -08:00
|
|
|
#include "config.h"
|
|
|
|
#include "termio.h"
|
2012-06-30 04:16:14 -07:00
|
|
|
|
2018-01-02 14:44:44 -08:00
|
|
|
|
2018-01-09 14:21:48 -08:00
|
|
|
typedef struct _about_ctx {
|
2018-01-02 14:44:44 -08:00
|
|
|
Evas_Object *layout;
|
|
|
|
Evas_Object *over;
|
|
|
|
Evas_Object *win;
|
2018-01-15 13:45:32 -08:00
|
|
|
Evas_Object *base;
|
2018-01-02 14:44:44 -08:00
|
|
|
Evas_Object *term;
|
|
|
|
void (*donecb) (void *data);
|
|
|
|
void *donedata;
|
2018-01-09 14:21:48 -08:00
|
|
|
} About_Ctx;
|
2018-01-02 14:44:44 -08:00
|
|
|
|
2012-06-30 04:16:14 -07:00
|
|
|
|
|
|
|
static Eina_Bool
|
2018-01-02 14:44:44 -08:00
|
|
|
_cb_del_delay(void *data)
|
2012-06-30 04:16:14 -07:00
|
|
|
{
|
2018-01-02 14:44:44 -08:00
|
|
|
Evas_Object *layout = data;
|
|
|
|
evas_object_del(layout);
|
2012-06-30 04:16:14 -07:00
|
|
|
elm_cache_all_flush();
|
|
|
|
return EINA_FALSE;
|
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
2016-10-05 13:00:22 -07:00
|
|
|
_cb_mouse_down(void *data,
|
|
|
|
Evas *_e EINA_UNUSED,
|
|
|
|
Evas_Object *_obj EINA_UNUSED,
|
|
|
|
void *_ev EINA_UNUSED)
|
2012-06-30 04:16:14 -07:00
|
|
|
{
|
2018-01-09 14:21:48 -08:00
|
|
|
About_Ctx *ctx = data;
|
2018-01-02 14:44:44 -08:00
|
|
|
|
|
|
|
if (ctx->over)
|
|
|
|
{
|
|
|
|
evas_object_del(ctx->over);
|
|
|
|
}
|
|
|
|
elm_object_focus_set(ctx->layout, EINA_FALSE);
|
2018-01-15 13:45:32 -08:00
|
|
|
edje_object_signal_emit(ctx->base, "about,hide", "terminology");
|
2018-01-02 14:44:44 -08:00
|
|
|
|
|
|
|
ecore_timer_add(10.0, _cb_del_delay, ctx->layout);
|
|
|
|
ctx->layout = NULL;
|
|
|
|
|
|
|
|
if (ctx->donecb)
|
|
|
|
ctx->donecb(ctx->donedata);
|
|
|
|
|
|
|
|
free(ctx);
|
2012-06-30 04:16:14 -07:00
|
|
|
}
|
|
|
|
|
|
|
|
void
|
2018-01-15 13:45:32 -08:00
|
|
|
about_show(Evas_Object *win, Evas_Object *base, Evas_Object *term,
|
2013-04-14 20:43:13 -07:00
|
|
|
void (*donecb) (void *data), void *donedata)
|
2012-06-30 04:16:14 -07:00
|
|
|
{
|
|
|
|
Evas_Object *o;
|
2018-01-09 14:21:48 -08:00
|
|
|
About_Ctx *ctx;
|
2018-01-02 14:44:44 -08:00
|
|
|
Config *config = termio_config_get(term);
|
|
|
|
char buf[PATH_MAX];
|
|
|
|
const char *txt;
|
2012-06-30 04:16:14 -07:00
|
|
|
|
2018-01-02 14:44:44 -08:00
|
|
|
ctx = malloc(sizeof(*ctx));
|
|
|
|
assert(ctx);
|
|
|
|
|
|
|
|
ctx->win = win;
|
2018-01-15 13:45:32 -08:00
|
|
|
ctx->base = base;
|
2018-01-02 14:44:44 -08:00
|
|
|
ctx->term = term;
|
|
|
|
ctx->donecb = donecb;
|
|
|
|
ctx->donedata = donedata;
|
|
|
|
|
|
|
|
ctx->layout = o = elm_layout_add(win);
|
|
|
|
if (elm_layout_file_set(o, config_theme_path_get(config),
|
|
|
|
"terminology/about") == 0)
|
2012-06-30 04:16:14 -07:00
|
|
|
{
|
2018-01-02 14:44:44 -08:00
|
|
|
snprintf(buf, sizeof(buf), "%s/themes/default.edj",
|
|
|
|
elm_app_data_dir_get());
|
|
|
|
elm_layout_file_set(o, buf, "terminology/about");
|
2012-06-30 04:16:14 -07:00
|
|
|
}
|
2018-01-02 14:44:44 -08:00
|
|
|
|
|
|
|
txt = eina_stringshare_printf(_(
|
|
|
|
"<b>Terminology %s</b><br>"
|
|
|
|
"Why should terminals be boring?<br>"
|
|
|
|
"<br>"
|
|
|
|
"This terminal was written for Enlightenment, to use EFL "
|
|
|
|
"and otherwise push the boundaries of what a modern terminal "
|
|
|
|
"emulator should be. We hope you enjoy it.<br>"
|
|
|
|
"<br>"
|
|
|
|
"Copyright © 2012-%d by:<br>"
|
|
|
|
"<br>"
|
|
|
|
"%s" // AUTHORS
|
|
|
|
"<br>"
|
|
|
|
"<br>"
|
|
|
|
"Distributed under the 2-clause BSD license detailed below:<br>"
|
|
|
|
"<br>"
|
|
|
|
"%s" // LICENSE
|
|
|
|
),
|
2018-02-11 02:56:13 -08:00
|
|
|
PACKAGE_VERSION, 2018,
|
2018-01-02 14:44:44 -08:00
|
|
|
"Boris Faure<br>"
|
|
|
|
"Carsten Haitzler<br>"
|
|
|
|
"Gustavo Sverzut Barbieri<br>"
|
|
|
|
"Cedric BAIL<br>"
|
|
|
|
"Sebastian Dransfeld<br>"
|
|
|
|
"Wonguk Jeong<br>"
|
|
|
|
"Christopher Michael<br>"
|
|
|
|
"Daniel Juyung Seo<br>"
|
|
|
|
"Panagiotis Galatsanos<br>"
|
|
|
|
"Mike Blumenkrantz<br>"
|
|
|
|
"Aleksandar Popadić<br>"
|
|
|
|
"Massimo Maiurana<br>"
|
|
|
|
"Stefan Schmidt<br>"
|
|
|
|
"Davide Andreoli<br>"
|
|
|
|
"Gustavo Lima Chaves<br>"
|
|
|
|
"Jean-Philippe ANDRÉ<br>"
|
|
|
|
"Tom Hacohen<br>"
|
|
|
|
"Alex-P. Natsios<br>"
|
|
|
|
"Lee Gwang-O<br>"
|
|
|
|
"Jean Guyomarc'h<br>"
|
|
|
|
"Jihoon Kim<br>"
|
|
|
|
"Kai Huuhko<br>"
|
|
|
|
"Mike McCormack<br>"
|
|
|
|
"Iván Briano<br>"
|
|
|
|
"Jerome Pinot<br>"
|
|
|
|
"José Roberto de Souza<br>"
|
|
|
|
"Leandro Pereira<br>"
|
|
|
|
"Leif Middelschulte<br>"
|
|
|
|
"Markus Törnqvist<br>"
|
|
|
|
"Thibaut Broggi<br>"
|
|
|
|
"Lucas De Marchi<br>"
|
|
|
|
"Marcel Hollerbach<br>"
|
|
|
|
"Anisse Astier<br>"
|
|
|
|
"Daniel Zaoui<br>"
|
|
|
|
"Doug Newgard<br>"
|
|
|
|
"Flavio Vinicius Alvares Ceolin<br>"
|
|
|
|
"Samuel F. Baggen<br>"
|
|
|
|
"Amitesh Singh<br>"
|
|
|
|
"Anthony F McInerney<br>"
|
|
|
|
"Aurélien Larcher<br>"
|
|
|
|
"Bruno Dilly<br>"
|
|
|
|
"Conrad Meyer<br>"
|
|
|
|
"Daniel Kolesa<br>"
|
|
|
|
"Eduardo Lima<br>"
|
|
|
|
"Flavio Ceolin<br>"
|
|
|
|
"Jason L. Cook<br>"
|
|
|
|
"Jérémy Anger<br>"
|
|
|
|
"Michael BOUCHAUD<br>"
|
|
|
|
"Michael Jennings<br>"
|
|
|
|
"Nicholas Hughart<br>"
|
|
|
|
"Rafael Antognolli<br>"
|
|
|
|
"Rui Seabra<br>"
|
|
|
|
"Sanjeev BA<br>"
|
|
|
|
"Theodor van Nahl<br>"
|
|
|
|
"Vincent Torri<br>"
|
|
|
|
"tantSinnister<br>",
|
|
|
|
"All rights reserved.<br>"
|
|
|
|
"<br>"
|
|
|
|
"Redistribution and use in source and binary forms, with or "
|
|
|
|
"without modification, are permitted provided that the "
|
|
|
|
"following conditions are met:<br>"
|
|
|
|
"<br>"
|
|
|
|
"1. Redistributions of source code must retain the above "
|
|
|
|
"copyright notice, this list of conditions and the following "
|
|
|
|
"disclaimer.<br>"
|
|
|
|
"2. Redistributions in binary form must reproduce the above "
|
|
|
|
"copyright notice, this list of conditions and the following "
|
|
|
|
"disclaimer in the documentation and/or other materials "
|
|
|
|
"provided with the distribution.<br>"
|
|
|
|
"<br>"
|
|
|
|
"<b>THIS SOFTWARE IS PROVIDED \"AS IS\" AND ANY EXPRESS OR "
|
|
|
|
"IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED "
|
|
|
|
"WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR "
|
|
|
|
"PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER "
|
|
|
|
"OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, "
|
|
|
|
"INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES "
|
|
|
|
"(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE "
|
|
|
|
"GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS "
|
|
|
|
"INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, "
|
|
|
|
"WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING "
|
|
|
|
"NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF "
|
|
|
|
"THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH "
|
|
|
|
"DAMAGE.</b>");
|
|
|
|
elm_object_part_text_set(o, "terminology.text", txt);
|
|
|
|
eina_stringshare_del(txt);
|
|
|
|
evas_object_show(o);
|
2018-01-15 13:45:32 -08:00
|
|
|
edje_object_part_swallow(base, "terminology.about", ctx->layout);
|
2018-01-02 14:44:44 -08:00
|
|
|
|
|
|
|
ctx->over = o = evas_object_rectangle_add(evas_object_evas_get(win));
|
|
|
|
evas_object_color_set(o, 0, 0, 0, 0);
|
2018-01-15 13:45:32 -08:00
|
|
|
edje_object_part_swallow(base, "terminology.dismiss", o);
|
2018-01-02 14:44:44 -08:00
|
|
|
evas_object_show(o);
|
|
|
|
evas_object_event_callback_add(o, EVAS_CALLBACK_MOUSE_DOWN,
|
|
|
|
_cb_mouse_down, ctx);
|
|
|
|
|
2018-01-15 13:45:32 -08:00
|
|
|
edje_object_signal_emit(base, "about,show", "terminology");
|
2018-01-02 14:44:44 -08:00
|
|
|
elm_object_signal_emit(ctx->layout, "begin" ,"terminology");
|
|
|
|
elm_object_focus_set(ctx->layout, EINA_TRUE);
|
2012-06-30 04:16:14 -07:00
|
|
|
}
|