/* vim: set sw=3 ts=3 sts=3 expandtab: */
#include "ecdb.h"
static Ecore_Evas *win = NULL;
static void
_ecdb_about_destroy(void *data, Evas_Object *obj __UNUSED__,
const char *emission __UNUSED__,
const char *source __UNUSED__)
{
ecore_evas_free(data);
win = NULL;
}
void
ecdb_about_show(void)
{
Evas_Coord mw, mh, w, x, y;
Evas_Object *gui;
// Only show 1 about window
if (win) return;
if (!strcmp(em->engine, "opengl_x11"))
win = ecore_evas_gl_x11_new(0, 0, 0, 0, 255, 255);
else if (!strcmp(em->engine, "xrender_x11"))
win = ecore_evas_xrender_x11_new(0, 0, 0, 0, 255, 255);
else if (!strcmp(em->engine, "software_x11"))
win = ecore_evas_software_x11_new(0, 0, 0, 0, 255, 255);
if (!win)
{
EINA_ERROR_PWARN("Cannot create the about window!\n");
return;
}
ecore_evas_title_set(win, "ECDB About");
ecore_evas_name_class_set(win, "ECDB", "ECDB");
ecore_evas_avoid_damage_set(win, 1);
gui = edje_object_add(ecore_evas_get(win));
edje_object_file_set(gui, em->theme_path, "ecdb/about");
edje_object_signal_callback_add(gui, "ecdb/close", "ecdb",
_ecdb_about_destroy, win);
ecore_evas_object_associate(win, gui, ECORE_EVAS_OBJECT_ASSOCIATE_DEL);
edje_object_size_min_get(gui, &mw, &mh);
if (mw <= 0) mw = 350;
if (mh <= 0) mh = 350;
if (ecore_config_boolean_get("use_scale"))
{
mw = (int)((float)mw * em->scalef);
mh = (int)((float)mh * em->scalef);
}
ecore_evas_resize(win, mw, mh);
evas_object_resize(gui, mw, mh);
ecore_evas_size_min_set(win, mw, mh);
edje_object_size_max_get(gui, &mw, &mh);
if (ecore_config_boolean_get("use_scale"))
{
mw = (int)((float)mw * em->scalef);
mh = (int)((float)mh * em->scalef);
}
ecore_evas_size_max_set(win, mw, mh);
evas_object_move(gui, 0, 0);
evas_object_show(gui);
ecore_evas_show(win);
ecore_evas_geometry_get(em->main_win_ee, &x, &y, &w, NULL);
ecore_evas_move(win, x + ((w - mw) / 2), y);
/* Set the proper text */
edje_object_part_text_set(gui, "ecdb.about.label", "Close");
edje_object_part_text_set(gui, "ecdb.about.text",
"Copywrite ©2006-2008, by the ECDB Development Team.
"
"This software is provided as-is with no explicit or implied "
"warranty. This software is governed by licensing conditions, "
"so please see the COPYING and COPYRIGHT license files installed "
"on your system.
"
"ECDB is under HEAVY DEVELOPMENT and is "
"not stable. Many features are incomplete or non-existant, and "
"will likely have many bugs. You have been WARNED!"
"
"
"Authors:
"
"Jaime Thomas <avi.thomas@gmail.com>
"
"
"
"Contributors:
"
"Mario Danic <mario@libburnia-project.org>
");
}