Work on a config dialog.

This commit is contained in:
Jaime Thomas
2009-02-20 04:23:07 +00:00
parent 43e68e0c3d
commit f7a5dfa6cd
9 changed files with 478 additions and 58 deletions

View File

@ -1,6 +1,8 @@
/* 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__,
@ -9,28 +11,29 @@ _ecdb_about_destroy(void *data, Evas_Object *obj __UNUSED__,
ecore_evas_free(data);
}
static void
_ecdb_about_free(void *data __UNUSED__, Evas *e __UNUSED__,
Evas_Object *obj __UNUSED__,
void *ev_info __UNUSED__)
{
win = NULL;
}
void
ecdb_about_show(void)
{
Evas_Coord mw, mh;
Ecore_Evas *win = NULL;
Evas_Coord mw, mh, w, x, y;
Evas_Object *gui;
const char *engine;
engine = getenv("ECDB_ENGINE");
if (engine)
{
if (!strcmp(engine, "gl"))
win = ecore_evas_gl_x11_new(0, 0, 0, 0, 255, 255);
else if (!strcmp(engine, "xr"))
win = ecore_evas_xrender_x11_new(0, 0, 0, 0, 255, 255);
else if (!strcmp(engine, "x11"))
win = ecore_evas_software_x11_new(0, 0, 0, 0, 255, 255);
}
else
{
// 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)
{
@ -46,6 +49,8 @@ ecdb_about_show(void)
edje_object_file_set(gui, em->theme_path, "ecdb/about");
edje_object_signal_callback_add(gui, "ecdb/close", "ecdb",
_ecdb_about_destroy, win);
evas_object_event_callback_add(gui, EVAS_CALLBACK_FREE, _ecdb_about_free,
NULL);
ecore_evas_object_associate(win, gui, ECORE_EVAS_OBJECT_ASSOCIATE_DEL);
edje_object_size_min_get(gui, &mw, &mh);
if (mw <= 0) mw = 350;
@ -60,6 +65,9 @@ ecdb_about_show(void)
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",