More work on config_inwin

This commit is contained in:
Jaime Thomas 2009-01-10 03:16:38 +00:00
parent 35a1d463ab
commit 1f2af2bdd5
5 changed files with 299 additions and 10 deletions

View File

@ -18,4 +18,5 @@ collections {
#include "groups/label.edc"
#include "groups/burn_data.edc"
#include "groups/capacity.edc"
#include "groups/config_inwin.edc"
}

View File

@ -10,4 +10,5 @@ EXTRA_DIST= burn_data.edc \
label.edc \
welcome_page.edc \
capacity.edc \
window.edc
window.edc \
config_inwin.edc

View File

@ -0,0 +1,139 @@
/* vim: set sw=3 ts=3 sts=3 expandtab: */
group {
name: "ecdb/config_inwin/background";
parts {
part {
name: "base";
type: RECT;
description {
state: "default" 0.0;
color: 0 0 0 0;
min: 20 20;
rel1 {
relative: 0.0 0.0;
offset: 0 0;
}
rel2 {
relative: 1.0 1.0;
offset: -1 -1;
}
}
description {
state: "active" 0.0;
inherit: "default" 0.0;
color: 0 0 0 90;
}
}
}
programs {
program {
name: "set_active";
signal: "ecdb,config_inwin,back,show";
source: "ecdb";
action: STATE_SET "active" 0.0;
target: "base";
transition: DECELERATE 0.2;
}
program {
name: "set_default";
signal: "ecdb,config_inwin,back,hide";
source: "ecdb";
action: STATE_SET "default" 0.0;
target: "base";
transition: DECELERATE 0.2;
}
}
}
group {
name: "ecdb/config_inwin/popup";
max: 400 300;
parts {
part {
name: "back";
type: IMAGE;
description {
state: "default" 0.0;
color: 255 255 255 0;
rel1 {
relative: 0.0 0.0;
offset: 0 0;
}
rel2 {
relative: 1.0 1.0;
offset: -1 -1;
}
image {
normal: "background.png";
}
}
description {
inherit: "default" 0.0;
state: "active" 0.0;
color: 255 255 255 255;
}
}
part {
name: "ecdb.table";
type: TABLE;
clip_to: "back";
description {
state: "default" 0.0;
color: 255 255 255 0;
rel1 {
relative: 0.0 0.0;
offset: 0 0;
}
rel2 {
relative: 1.0 1.0;
offset: -1 -1;
}
table {
homogenous: TABLE;
padding: 2 2;
align: 0.5 0.5;
}
}
}
}
programs {
program {
name: "expand";
signal: "ecdb,config_inwin,popup,show";
source: "ecdb";
action: STATE_SET "active" 0.0;
target: "ecdb.table";
target: "active";
transition: DECELERATE 0.2;
}
program {
name: "collapse";
signal: "ecdb,config_inwin,popup,hide";
source: "ecdb";
action: STATE_SET "active" 0.0;
target: "ecdb.table";
target: "active";
transition: DECELERATE 0.2;
}
}
}

View File

@ -1067,36 +1067,182 @@ ecdb_label_text_set(Evas_Object *l, const char *text)
}
/************************* Config Inwin **************************************/
typedef struct _Config_Inwin_Data Config_Inwin_Data;
struct _Config_Inwin_Data
{
Evas_Object *parent;
Evas_Object *back;
Evas_Object *popup;
unsigned int visible;
const char *name;
void *data;
void (*create_header)(Evas_Object *, const char *name, void *data,
Evas_Object *, int);
};
static void
_config_inwin_resize(void *data, Evas *e, Evas_Object *obj, void *event_info)
{
Config_Inwin_Data *iwd;
int w, h;
iwd = evas_object_data_get(data, "iwd");
if (!iwd)
{
printf("_config_inwin_resize: NULL data\n");
return;
}
ecore_evas_geometry_get(em->main_win_ee, NULL, NULL, &w, &h);
evas_object_resize(iwd->popup, w, h);
evas_object_move(iwd->popup, 0, 0);
evas_object_resize(iwd->back, w, h);
evas_object_move(iwd->back, 0, 0);
}
static void
_config_inwin_hide(void *data, Evas *e, Evas_Object *obj, void *event_info)
{
Config_Inwin_Data *iwd;
iwd = evas_object_data_get(data, "iwd");
if (!iwd)
{
printf("_config_inwin_hide: NULL data\n");
return;
}
ecore_evas_hide(iwd->popup);
ecore_evas_hide(iwd->back);
}
static void
_config_inwin_del(void *data, Evas *e, Evas_Object *obj, void *event_info)
{
Config_Inwin_Data *iwd;
iwd = evas_object_data_get(data, "iwd");
if (!iwd)
{
printf("_config_inwin_del: NULL data\n");
return;
}
}
Evas_Object *
ecdb_config_inwin_add(Evas_Object *parent, const char *name)
{
Evas_Object *iw;
Config_Inwin_Data *iwd;
iw = ecdb_widget_add(parent, name);
iwd = calloc(1, sizeof(Config_Inwin_Data));
if (!iwd)
{
printf("ecdb_combo_add: NULL data!\n");
return NULL;
}
iwd->popup = ecdb_widget_add(parent, NULL);
if (!iw)
{
printf("ecdb_config_inwin_add: NULL return!\n");
return NULL;
}
edje_object_file_set(iw, em->theme_path, "ecdb/config_inwin");
edje_object_file_set(iwd->popup, em->theme_path, "ecdb/config_inwin/popup");
evas_object_pass_events_set(iwd->popup, 1);
evas_object_show(iwd->popup);
/*
evas_object_event_callback_add(parent, EVAS_CALLBACK_RESIZE, _combo_resize,
iw);
evas_object_event_callback_add(parent, EVAS_CALLBACK_HIDE, _combo_hide, iw);
evas_object_event_callback_add(c, EVAS_CALLBACK_DEL, _combo_del, iw);
*/
evas_object_event_callback_add(parent, EVAS_CALLBACK_RESIZE,
_config_inwin_resize,
iwd->popup);
evas_object_event_callback_add(parent, EVAS_CALLBACK_HIDE,
_config_inwin_hide,
iwd->popup);
evas_object_event_callback_add(iwd->popup, EVAS_CALLBACK_DEL,
_config_inwin_del,
iwd->popup);
iwd->back = edje_object_add(evas_object_evas_get(parent));
edje_object_file_set(iwd->back, em->theme_path,
"ecdb/config_inwin/background");
evas_object_pass_events_set(iwd->back, 1);
evas_object_show(iwd->back);
iwd->popup = edje_object_add(evas_object_evas_get(parent));
iwd->name = eina_stringshare_add(name);
evas_object_data_set(iw, "iwd", iwd);
iwd->visible = 0;
return iw;
}
void
ecdb_config_inwin_show(Evas_Object *inwin)
{
Config_Inwin_Data *iwd;
if (!inwin)
{
printf("ecdb_config_inwin_show: NULL object!\n");
return;
}
iwd = evas_object_data_get(inwin, "iwd");
if (!iwd)
{
printf("ecdb_config_inwin_show: NULL data!\n");
return;
}
evas_object_pass_events_set(iwd->back, 0);
evas_object_layer_set(iwd->back, evas_object_layer_get(inwin) + 1);
edje_object_signal_emit(iwd->back, "ecdb,config_inwin,back,show", "ecdb");
evas_object_pass_events_set(iwd->popup, 0);
evas_object_layer_set(iwd->popup, evas_object_layer_get(inwin->back) + 1);
evas_object_signal_emit(iwd->popup, "ecdb,config_inwin,popup,show",
"ecdb");
iwd->visible = 1;
}
void
ecdb_config_inwin_hide(Evas_Object *inwin)
{
Config_Inwin_Data *iwd;
if (!inwin)
{
printf("ecdb_config_inwin_hide: NULL object!\n");
return;
}
iwd = evas_object_data_get(inwin, "iwd");
if (!iwd)
{
printf("ecdb_config_inwin_hide: NULL data!\n");
return;
}
evas_object_pass_events_set(iwd->back, 1);
edje_object_signal_emit(iwd->back, "ecdb,config_inwin,back,hide", "ecdb");
evas_object_pass_events_set(iwd->popup, 1);
edje_object_signal_emit(iwd->popup, "ecdb,config_inwin,popup,hide",
"ecdb");
iwd->visible = 0;
}
void
ecdb_config_inwin_child_add(Evas_Object *inwin, Evas_Object *child,
int sc, int ec, int sr, int er)
{
if (!inwin)
{
printf("ecdb_config_inwin_child_add: NULL parent!\n");
printf("ecdb_config_inwin_child_add: NULL object!\n");
return;
}
if (!child)

View File

@ -50,6 +50,8 @@ Evas_Object *ecdb_label_add(Evas_Object *parent, const char *name);
void ecdb_label_text_set(Evas_Object *l, const char *text);
Evas_Object *ecdb_config_inwin_add(Evas_Object *parent, const char *name);
void ecdb_config_inwin_show(Evas_Object *inwin);
void ecbd_config_inwin_hide(Evas_Object *inwin);
void ecdb_config_inwin_child_add(Evas_Object *inwin, Evas_Object *child,
int sc, int ec,
int sr, int er);