2009-02-19 04:52:13 +00:00
|
|
|
/* vim: set sw=3 ts=3 sts=3 expandtab: */
|
|
|
|
#include "ecdb.h"
|
|
|
|
|
2009-02-20 04:23:07 +00:00
|
|
|
static Ecore_Evas *win = NULL;
|
|
|
|
|
2009-02-19 04:52:13 +00:00
|
|
|
static void
|
|
|
|
_ecdb_about_destroy(void *data, Evas_Object *obj __UNUSED__,
|
|
|
|
const char *emission __UNUSED__,
|
|
|
|
const char *source __UNUSED__)
|
|
|
|
{
|
|
|
|
ecore_evas_free(data);
|
2009-02-20 04:23:07 +00:00
|
|
|
win = NULL;
|
|
|
|
}
|
|
|
|
|
2009-02-19 04:52:13 +00:00
|
|
|
void
|
|
|
|
ecdb_about_show(void)
|
|
|
|
{
|
2009-02-20 04:23:07 +00:00
|
|
|
Evas_Coord mw, mh, w, x, y;
|
2009-02-19 04:52:13 +00:00
|
|
|
Evas_Object *gui;
|
|
|
|
|
2009-02-20 04:23:07 +00:00
|
|
|
// 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"))
|
2009-02-19 04:52:13 +00:00
|
|
|
win = ecore_evas_software_x11_new(0, 0, 0, 0, 255, 255);
|
|
|
|
|
|
|
|
if (!win)
|
|
|
|
{
|
2009-02-23 01:22:02 +00:00
|
|
|
EINA_ERROR_PWARN("Cannot create the about window!\n");
|
2009-02-19 04:52:13 +00:00
|
|
|
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);
|
2009-02-19 23:36:06 +00:00
|
|
|
ecore_evas_object_associate(win, gui, ECORE_EVAS_OBJECT_ASSOCIATE_DEL);
|
2009-02-19 04:52:13 +00:00
|
|
|
edje_object_size_min_get(gui, &mw, &mh);
|
|
|
|
if (mw <= 0) mw = 350;
|
|
|
|
if (mh <= 0) mh = 350;
|
2009-02-21 03:19:29 +00:00
|
|
|
if (ecore_config_boolean_get("use_scale"))
|
|
|
|
{
|
|
|
|
mw = (int)((float)mw * em->scalef);
|
|
|
|
mh = (int)((float)mh * em->scalef);
|
|
|
|
}
|
2009-02-19 04:52:13 +00:00
|
|
|
ecore_evas_resize(win, mw, mh);
|
2009-03-20 00:45:05 +00:00
|
|
|
evas_object_resize(gui, mw, mh);
|
2009-02-19 04:52:13 +00:00
|
|
|
ecore_evas_size_min_set(win, mw, mh);
|
|
|
|
edje_object_size_max_get(gui, &mw, &mh);
|
2009-03-20 00:45:05 +00:00
|
|
|
if (ecore_config_boolean_get("use_scale"))
|
|
|
|
{
|
|
|
|
mw = (int)((float)mw * em->scalef);
|
|
|
|
mh = (int)((float)mh * em->scalef);
|
|
|
|
}
|
2009-02-19 04:52:13 +00:00
|
|
|
ecore_evas_size_max_set(win, mw, mh);
|
|
|
|
evas_object_move(gui, 0, 0);
|
|
|
|
evas_object_show(gui);
|
|
|
|
ecore_evas_show(win);
|
|
|
|
|
2009-02-20 04:23:07 +00:00
|
|
|
ecore_evas_geometry_get(em->main_win_ee, &x, &y, &w, NULL);
|
|
|
|
ecore_evas_move(win, x + ((w - mw) / 2), y);
|
|
|
|
|
2009-02-19 04:52:13 +00:00
|
|
|
/* Set the proper text */
|
|
|
|
edje_object_part_text_set(gui, "ecdb.about.label", "Close");
|
|
|
|
edje_object_part_text_set(gui, "ecdb.about.text",
|
2009-02-19 23:36:06 +00:00
|
|
|
"<e>Copywrite ©2006-2008, by the ECDB Development Team.<br></e>"
|
2009-02-19 04:52:13 +00:00
|
|
|
"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.<br>"
|
|
|
|
"ECDB is under <hilight>HEAVY DEVELOPMENT</hilight> and is "
|
|
|
|
"not stable. Many features are incomplete or non-existant, and "
|
|
|
|
"will likely have many bugs. You have been <hilight>WARNED!</hilight>"
|
|
|
|
"<br><br>"
|
2009-02-19 23:36:06 +00:00
|
|
|
"<e>Authors:</e><br>"
|
|
|
|
"Jaime Thomas <avi.thomas@gmail.com><br>"
|
|
|
|
"<br>"
|
|
|
|
"<e>Contributors:</e><br>"
|
|
|
|
"Mario Danic <mario@libburnia-project.org><br>");
|
2009-02-19 04:52:13 +00:00
|
|
|
}
|
|
|
|
|