Erase Page kindof does stuff now.

This commit is contained in:
Jaime Thomas 2008-09-25 17:39:40 +00:00
parent b3457b7afb
commit 5efd41d5f8
3 changed files with 151 additions and 12 deletions

View File

@ -11,6 +11,22 @@ group {
state: "default" 0.0; state: "default" 0.0;
color: 0 0 0 0; color: 0 0 0 0;
rel1 {
relative: 0.0 0.0;
offset: -10 -10;
}
rel2 {
relative: 0.0 0.0;
offset: 1 1;
}
}
description {
state: "visible" 0.0;
visible: 1;
color: 0 0 0 0;
rel1 { rel1 {
relative: 0.0 0.0; relative: 0.0 0.0;
offset: 0 0; offset: 0 0;
@ -23,18 +39,52 @@ group {
} }
description { description {
state: "visible" 0.0; state: "hide" 0.0;
inherit: "default" 0.0; color: 0 0 0 0;
color: 255 0 0 120;
rel1 {
relative: 1.0 1.0;
offset: 1 1;
}
rel2 {
relative: 1.0 1.0;
offset: 10 10;
}
}
}
part {
name: "action_area";
type: SWALLOW;
description {
state: "default" 0.0;
rel1 {
to: "bg";
}
rel2 {
to: "bg";
}
} }
} }
} }
programs { programs {
program { program {
name: "erase_page,visible"; name: "erase_page,visible1";
signal: "ecdb,erase_page,visible"; signal: "ecdb,erase_page,visible";
source: "ecdb"; source: "ecdb";
action: STATE_SET "default" 0.0;
target: "bg";
after: "erase_page,visible2";
}
program {
name: "erase_page,visible2";
action: STATE_SET "visible" 0.0; action: STATE_SET "visible" 0.0;
target: "bg"; target: "bg";
transition: DECELERATE 0.5; transition: DECELERATE 0.5;
@ -44,9 +94,15 @@ group {
name: "erase_page,hide"; name: "erase_page,hide";
signal: "ecdb,erase_page,hide"; signal: "ecdb,erase_page,hide";
source: "ecdb"; source: "ecdb";
action: STATE_SET "default" 0.0; action: STATE_SET "hide" 0.0;
target: "bg"; target: "bg";
transition: LINEAR 0.5; transition: DECELERATE 0.5;
after: "hide,finished";
}
program {
name: "hide,finished";
action: SIGNAL_EMIT "hide,finished" "erase_page";
} }
} }
} }

View File

@ -36,6 +36,21 @@ group {
offset: 33 33; offset: 33 33;
} }
} }
description {
state: "before_show" 0.0;
color: 0 0 0 0;
rel1 {
relative: 0.0 0.0;
offset: -33 -33;
}
rel2 {
relative: 0.0 0.0;
offset: -1 -1;
}
}
} }
part { part {
@ -144,9 +159,16 @@ group {
} }
program { program {
name: "welcome_page,show"; name: "welcome_page,show1";
signal: "ecdb,welcome_page,show"; signal: "ecdb,welcome_page,show";
source: "ecdb"; source: "ecdb";
after: "welcome_page,show2";
action: STATE_SET "before_show" 0.0;
target: "bg";
}
program {
name: "welcome_page,show2";
action: STATE_SET "default" 0.0; action: STATE_SET "default" 0.0;
transition: DECELERATE 0.5; transition: DECELERATE 0.5;
target: "bg"; target: "bg";

View File

@ -7,6 +7,7 @@ static void ecdb_cb_welcome_page_buttons_clicked(void *data, Evas_Object *o,
const char *emission, const char *source); const char *emission, const char *source);
static void ecdb_cb_page_hide_finished(void *data, Evas_Object *o, static void ecdb_cb_page_hide_finished(void *data, Evas_Object *o,
const char *emission, const char *source); const char *emission, const char *source);
static void ecdb_cb_return_main(Ewl_Widget *w, void *ev_data, void *data);
static void ecdb_filelist_show(void); static void ecdb_filelist_show(void);
static void ecdb_welcome_page_show(void); static void ecdb_welcome_page_show(void);
static void ecdb_erase_page_show(void); static void ecdb_erase_page_show(void);
@ -495,21 +496,68 @@ ecdb_erase_page_show(void)
if (!swallow) if (!swallow)
{ {
Ewl_Widget *embed, *box, *b, *c;
Evas_Object *ewl_swallow;
Evas_Coord x, y, w, h; Evas_Coord x, y, w, h;
swallow = edje_object_add(ecore_evas_get(em->main_win_ee)); swallow = edje_object_add(ecore_evas_get(em->main_win_ee));
evas_object_name_set(swallow, "erase_page");
edje_object_file_set(swallow, em->theme_path, edje_object_file_set(swallow, em->theme_path,
"ecdb/erase_page"); "ecdb/erase_page");
edje_object_signal_callback_add(swallow, "hide,finished", evas_object_name_set(swallow, "erase_page");
"erase_page", ecdb_cb_page_hide_finished, evas_object_data_set(swallow, "hide_signal",
NULL); "ecdb,erase_page,hide");
edje_object_part_geometry_get(gui, "action_area", edje_object_part_geometry_get(gui, "active_area",
&x, &y, &w, &h); &x, &y, &w, &h);
evas_object_move(swallow, x, y); evas_object_move(swallow, x, y);
evas_object_resize(swallow, w, h); evas_object_resize(swallow, w, h);
edje_object_part_swallow(gui, "action_area", swallow); edje_object_part_swallow(gui, "action_area", swallow);
evas_object_show(swallow); evas_object_show(swallow);
embed = ewl_embed_new();
ewl_object_fill_policy_set(EWL_OBJECT(embed),
EWL_FLAG_FILL_ALL);
ewl_swallow = ewl_embed_canvas_set(EWL_EMBED(embed),
ecore_evas_get(em->main_win_ee),
(void *)(long)ecore_evas_software_x11_window_get
(em->main_win_ee));
ewl_embed_focus_set(EWL_EMBED(embed), TRUE);
ewl_widget_show(embed);
box = ewl_vbox_new();
ewl_container_child_append(EWL_CONTAINER(embed), box);
ewl_object_fill_policy_set(EWL_OBJECT(box),
EWL_FLAG_FILL_SHRINKABLE);
ewl_widget_show(box);
b = ewl_button_new();
ewl_button_label_set(EWL_BUTTON(b), "Return");
ewl_container_child_append(EWL_CONTAINER(box), b);
ewl_callback_append(b, EWL_CALLBACK_CLICKED,
ecdb_cb_return_main, swallow);
ewl_widget_show(b);
b = ewl_button_new();
ewl_button_label_set(EWL_BUTTON(b), "Erase");
ewl_container_child_append(EWL_CONTAINER(box), b);
ewl_widget_show(b);
c = ewl_checkbutton_new();
ewl_button_label_set(EWL_BUTTON(c), "Quick Erase?");
ewl_container_child_append(EWL_CONTAINER(box), c);
ewl_widget_show(c);
evas_object_name_set(ewl_swallow, "ewl_erase_page");
edje_object_part_geometry_get(swallow, "active_area",
&x, &y, &w, &h);
evas_object_move(ewl_swallow, x, y);
evas_object_resize(ewl_swallow, w, h);
edje_object_part_swallow(swallow, "action_area", ewl_swallow);
edje_object_signal_callback_add(swallow, "hide,finished",
"erase_page", ecdb_cb_page_hide_finished,
NULL);
evas_object_show(ewl_swallow);
} }
else if (edje_object_part_swallow_get(gui, "action_area") != swallow) else if (edje_object_part_swallow_get(gui, "action_area") != swallow)
@ -529,3 +577,16 @@ ecdb_cb_page_hide_finished(void *data, Evas_Object *o, const char *emission,
{ {
ecdb_page_hide(source); ecdb_page_hide(source);
} }
static void
ecdb_cb_return_main(Ewl_Widget *w, void *ev_data, void *data)
{
Evas_Object *swallow = data;
char *signal;
signal = evas_object_data_get(swallow, "hide_signal");
edje_object_signal_emit(swallow, signal, "ecdb");
ecdb_welcome_page_show();
}