And more moving the buttons into the theme.

This commit is contained in:
Jaime Thomas 2009-01-25 06:11:02 +00:00
parent 87bd540568
commit ef1494f2e8
10 changed files with 75 additions and 287 deletions

View File

@ -13,7 +13,6 @@ TODO
-> more flexible typebuf
-> more configuration options (speed and drive choice done)
-> fix combo theme
-> move callbacks to buttons instead of swallow (done except for welcome page)
-> figure out what to do about dnd, should it be consolidated into one system, how to handle internel, etc.
-> don't load the sources all at one time (lots of memory consumed -- for my entire development tree containing 154256 files, ecdb uses 46mb)
-> integrate exchange

View File

@ -11,7 +11,6 @@ collections {
#include "groups/window.edc"
#include "groups/welcome_page.edc"
#include "groups/button.edc"
#include "groups/icons.edc"
#include "groups/erase_disc.edc"
#include "groups/check.edc"
#include "groups/burn_image.edc"

View File

@ -6,7 +6,6 @@ EXTRA_DIST= burn_data.edc \
combo.edc \
entry.edc \
erase_disc.edc \
icons.edc \
label.edc \
welcome_page.edc \
capacity.edc \

View File

@ -1,7 +1,6 @@
/* vim: set sw=3 ts=3 sts=3 expandtab: */
group {
name: "ecdb/burn_data_page";
min: 640 170;
parts {
part {
@ -275,9 +274,10 @@ group {
visible: 0;
rel1 {
to: "bg";
relative: 1.0 0.0;
offset: -200 0;
to_x: "ecdb/burn_data/return";
to_y: "bg";
relative: 0.0 0.0;
offset: 0 0;
}
rel2 {

View File

@ -1,7 +1,6 @@
/* vim: set sw=3 ts=3 sts=3 expandtab: */
group {
name: "ecdb/burn_image_page";
min: 640 170;
script {
public message(Msg_Type:type, id, ...) {
@ -274,9 +273,10 @@ group {
visible: 0;
rel1 {
to: "bg";
relative: 1.0 0.0;
offset: -200 0;
to_x: "ecdb/burn_image/return";
to_y: "bg";
relative: 0.0 0.0;
offset: 0 0;
}
rel2 {

View File

@ -1,7 +1,6 @@
/* vim: set sw=3 ts=3 sts=3 expandtab: */
group {
name: "ecdb/erase_page";
min: 640 170;
script {
public message(Msg_Type:type, id, ...) {
@ -215,8 +214,9 @@ group {
visible: 0;
rel1 {
to: "bg";
relative: 0.5 0.0;
to_x: "ecdb/erase/return";
to_y: "bg";
relative: 0.0 0.0;
offset: 0 0;
}

View File

@ -1,132 +0,0 @@
/* vim: set sw=3 ts=3 sts=3 expandtab: */
group {
name: "ecdb/burn_data";
min: 32 32;
parts {
part {
name: "image";
type: IMAGE;
scale: 1;
description {
state: "default" 0.0;
min: 32 32;
max: 32 32;
rel1 {
relative: 0.0 0.0;
offset: 0 0;
}
rel2 {
relative: 1.0 1.0;
offset: -1 -1;
}
image {
normal: "drive_optical.png";
}
}
}
}
}
group {
name: "ecdb/burn_audio";
min: 32 32;
parts {
part {
name: "image";
type: IMAGE;
scale: 1;
description {
state: "default" 0.0;
min: 32 32;
max: 32 32;
rel1 {
relative: 0.0 0.0;
offset: 0 0;
}
rel2 {
relative: 1.0 1.0;
offset: -1 -1;
}
image {
normal: "audio.png";
}
}
}
}
}
group {
name: "ecdb/erase";
min: 32 32;
parts {
part {
name: "image";
type: IMAGE;
scale: 1;
description {
state: "default" 0.0;
min: 32 32;
max: 32 32;
rel1 {
relative: 0.0 0.0;
offset: 0 0;
}
rel2 {
relative: 1.0 1.0;
offset: -1 -1;
}
image {
normal: "clear.png";
}
}
}
}
}
group {
name: "ecdb/burn_image";
min: 32 32;
parts {
part {
name: "image";
type: IMAGE;
scale: 1;
description {
state: "default" 0.0;
min: 32 32;
max: 32 32;
rel1 {
relative: 0.0 0.0;
offset: 0 0;
}
rel2 {
relative: 1.0 1.0;
offset: -1 -1;
}
image {
normal: "iso.png";
}
}
}
}
}

View File

@ -55,100 +55,20 @@ group {
}
}
part {
name: "ecdb/burn_data";
type: SWALLOW;
repeat_events: 1;
scale: 1;
BUTTON_ICON("ecdb/burn_data", "ecdb/burn_data/text", "drive_optical.png", 100, 26, 99999, 99999, "bg", "bg", 0, 0, "bg", "bg", 0.5, 0.5, 5, 5, -6, -6, 0, 0)
description {
state: "default" 0.0;
BUTTON_ICON("ecdb/burn_audio", "ecdb/burn_audio/text", "audio.png", 100, 26, 99999, 99999, "bg", "bg", 0.5, 0, "bg", "bg", 1, 0.5, 5, 5, -6, -6, 0, 0)
rel1 {
to: "bg";
relative: 0.0 0.0;
offset: 10 10;
}
BUTTON_ICON("ecdb/burn_image", "ecdb/burn_image/text", "iso.png", 100, 26, 99999, 99999, "bg", "bg", 0, 0.5, "bg", "bg", 0.5, 1, 5, 5, -6, -6, 0, 0)
rel2 {
to: "bg";
relative: 0.5 0.5;
offset: -11 -11;
}
}
}
part {
name: "ecdb/burn_audio";
type: SWALLOW;
repeat_events: 1;
scale: 1;
description {
state: "default" 0.0;
rel1 {
to: "bg";
relative: 0.5 0.0;
offset: 10 10;
}
rel2 {
to: "bg";
relative: 1.0 0.5;
offset: -11 -11;
}
}
}
part {
name: "ecdb/burn_image";
type: SWALLOW;
repeat_events: 1;
scale: 1;
description {
state: "default" 0.0;
rel1 {
to: "bg";
relative: 0.0 0.5;
offset: 10 10;
}
rel2 {
to: "bg";
relative: 0.5 1.0;
offset: -11 -11;
}
}
}
part {
name: "ecdb/erase";
type: SWALLOW;
repeat_events: 1;
scale: 1;
description {
state: "default" 0.0;
rel1 {
to: "bg";
relative: 0.5 0.5;
offset: 10 10;
}
rel2 {
to: "bg";
relative: 1.0 1.0;
offset: -11 -11;
}
}
}
BUTTON_ICON("ecdb/erase", "ecdb/erase/text", "clear.png", 100, 26, 99999, 99999, "bg", "bg", 0.5, 0.5, "bg", "bg", 1, 1, 5, 5, -6, -6, 0, 0)
}
programs {
BUTTON_PROGS("ecdb/burn_data")
BUTTON_PROGS("ecdb/burn_audio")
BUTTON_PROGS("ecdb/burn_image")
BUTTON_PROGS("ecdb/erase")
program {
name: "welcome_page,hide";
signal: "ecdb,welcome_page,hide";

View File

@ -184,13 +184,14 @@
state: "default" 0.0; \
align: 0.0 0.5; \
color: 60 60 60 255; \
fixed: 1 1; \
rel1 { \
to: partname"ecdb.swallow.icon"; \
offset: 40 0; \
to: partname"icon"; \
relative: 1.0 0.0; \
offset: 5 0; \
} \
rel2 { \
to: partname"ecdb.swallow.icon"; \
to: partname"icon"; \
relative: 1.0 1.0; \
} \
text { \
text: ""; \

View File

@ -1,8 +1,15 @@
/* vim: set sw=3 ts=3 sts=3 expandtab: */
#include "ecdb.h"
#include <fnmatch.h>
static void ecdb_handle_typebuf(Evas_Object *gui);
static void ecdb_cb_welcome_page_buttons_clicked(void *data, Evas_Object *o,
static void _button_cb_burn_data(void *data, Evas_Object *o,
const char *emission, const char *source);
static void _button_cb_burn_audio(void *data, Evas_Object *o,
const char *emission, const char *source);
static void _button_cb_burn_image(void *data, Evas_Object *o,
const char *emission, const char *source);
static void _button_cb_erase(void *data, Evas_Object *o,
const char *emission, const char *source);
static void ecdb_filelist_show(void);
static void ecdb_page_hide(const char *pname);
@ -354,45 +361,41 @@ ecdb_handle_typebuf(Evas_Object *gui)
edje_object_part_text_set(gui, "filelist_overlay_text", NULL);
}
static void
ecdb_cb_welcome_page_buttons_clicked(void *data, Evas_Object *o,
const char *emission, const char *source)
_button_cb_burn_data(void *data __UNUSED__, Evas_Object *o,
const char *emission __UNUSED__,
const char *source __UNUSED__)
{
Evas_Object *swallow, *gui;
gui = evas_object_name_find(ecore_evas_get(em->main_win_ee), "gui");
swallow = evas_object_name_find(ecore_evas_get(em->main_win_ee),
"main_filelist");
if (!strcmp(source, "ecdb/burn_data"))
{
swallow = evas_object_name_find(ecore_evas_get(em->main_win_ee),
"welcome_page");
edje_object_signal_emit(swallow, "ecdb,welcome_page,hide", "ecdb");
edje_object_signal_emit(o, "ecdb,welcome_page,hide", "ecdb");
ecdb_burn_data_page_show();
ecdb_filelist_show();
}
else if (!strcmp(source, "ecdb/erase"))
static void
_button_cb_erase(void *data __UNUSED__, Evas_Object *o,
const char *emission __UNUSED__,
const char *source __UNUSED__)
{
swallow = evas_object_name_find(ecore_evas_get(em->main_win_ee),
"welcome_page");
edje_object_signal_emit(swallow, "ecdb,welcome_page,hide", "ecdb");
edje_object_signal_emit(o, "ecdb,welcome_page,hide", "ecdb");
ecdb_erase_page_show();
}
else if (!strcmp(source, "ecdb/burn_image"))
static void
_button_cb_burn_image(void *data __UNUSED__, Evas_Object *o,
const char *emission __UNUSED__,
const char *source __UNUSED__)
{
ecdb_filelist_show();
swallow = evas_object_name_find(ecore_evas_get(em->main_win_ee),
"welcome_page");
edje_object_signal_emit(swallow, "ecdb,welcome_page,hide", "ecdb");
edje_object_signal_emit(o, "ecdb,welcome_page,hide", "ecdb");
ecdb_burn_image_page_show();
}
else if (swallow)
{
edje_object_signal_emit(gui, "ecdb,filelist,hide", "ecdb");
ecdb_filelist_show();
}
static void
_button_cb_burn_audio(void *data __UNUSED__, Evas_Object *o,
const char *emission __UNUSED__,
const char *source)
{
printf("Action: %s\n", source);
}
@ -408,7 +411,6 @@ ecdb_welcome_page_show(void)
if (!swallow)
{
Evas_Object *b;
Evas_Coord x, y, w, h;
swallow = edje_object_add(ecore_evas_get(em->main_win_ee));
@ -418,24 +420,24 @@ ecdb_welcome_page_show(void)
evas_object_move(swallow, x, y);
evas_object_resize(swallow, w, h);
edje_object_part_swallow(gui, "action_area", swallow);
edje_object_signal_callback_add(swallow, "mouse,clicked,1", "ecdb/*",
ecdb_cb_welcome_page_buttons_clicked, NULL);
edje_object_signal_callback_add(swallow, "hide,finished", "welcome_page",
ecdb_page_hide_finished, NULL);
evas_object_show(swallow);
int i;
char *labels[] = {"Burn Data CD", "Burn Audio CD", "Burn Image",
"Erase Re-writable Disc"};
char *ids[] = {"ecdb/burn_data", "ecdb/burn_audio", "ecdb/burn_image",
"ecdb/erase"};
for (i = 0; i < 4; i++)
{
b = ecdb_button_add(swallow, ids[i]);
ecdb_button_label_set(b, labels[i]);
evas_object_show(b);
ecdb_button_icon_set(b, ids[i]);
}
edje_object_part_text_set(swallow, "ecdb/burn_data/text", "Burn Data CD");
edje_object_signal_callback_add(swallow, "ecdb/burn_data,clicked", "*",
_button_cb_burn_data, NULL);
edje_object_part_text_set(swallow, "ecdb/burn_audio/text",
"Burn Audio CD");
edje_object_signal_callback_add(swallow, "ecdb/burn_audio,clicked", "*",
_button_cb_burn_audio, NULL);
edje_object_part_text_set(swallow, "ecdb/burn_image/text", "Burn Image");
edje_object_signal_callback_add(swallow, "ecdb/burn_image,clicked", "*",
_button_cb_burn_image, NULL);
edje_object_part_text_set(swallow, "ecdb/erase/text",
"Erase Re-writable Disc");
edje_object_signal_callback_add(swallow, "ecdb/erase,clicked", "*",
_button_cb_erase, NULL);
}
else if (edje_object_part_swallow_get(gui, "action_area") != swallow)