Compiles now, but still crashy.

This commit is contained in:
Jaime Thomas 2009-02-05 04:11:22 +00:00
parent 2d5000f5a9
commit 881360db79
20 changed files with 568 additions and 564 deletions

View File

@ -19,6 +19,7 @@ TODO
-> instead of always swallowing widgets, allow theme to specify on a widget-by-widget basis if it wants to emit signals from internal parts (so, for example, the settings could be triggered by a small + in the corner, and expand from there) -> instead of always swallowing widgets, allow theme to specify on a widget-by-widget basis if it wants to emit signals from internal parts (so, for example, the settings could be triggered by a small + in the corner, and expand from there)
->able to allow entire gui to be handled by theme... so we only interact with signals (no widgets at all) ->able to allow entire gui to be handled by theme... so we only interact with signals (no widgets at all)
->get rid of evas_object_name_find/name_set ->get rid of evas_object_name_find/name_set
-> make theme and code use a custom signal, rather than mouse,clicked,1
DONE DONE
////////////////////////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////////////////////////

View File

@ -215,6 +215,12 @@ group {
offset: -5 -10; offset: -5 -10;
} }
} }
description {
state: "hidden" 0.0;
inherit: "default" 0.0;
visible: 0;
}
} }
part { part {
@ -385,6 +391,14 @@ group {
after: "burn_data_page,visible2"; after: "burn_data_page,visible2";
} }
program {
name: "burn_data_page,visible1,filelist";
signal: "ecdb,burn_data_page,visible";
source: "ecdb";
action: STATE_SET "default" 0.0;
target: "ecdb/burn_data/filelist";
}
program { program {
name: "burn_data_page,visible2"; name: "burn_data_page,visible2";
action: STATE_SET "default" 0.0; action: STATE_SET "default" 0.0;
@ -421,6 +435,13 @@ group {
program { program {
name: "hide,finished"; name: "hide,finished";
action: SIGNAL_EMIT "hide,finished" "burn_data_page"; action: SIGNAL_EMIT "hide,finished" "burn_data_page";
after: "hide,finished,filelist";
}
program {
name: "hide,finished,filelist";
action: STATE_SET "hidden" 0.0;
target: "ecdb/burn_data/filelist";
} }
} }
} }

View File

@ -207,6 +207,7 @@ group {
part { part {
name: "ecdb.label"; name: "ecdb.label";
type: TEXT; type: TEXT;
effect: NONE;
mouse_events: 1; mouse_events: 1;
scale: 1; scale: 1;
@ -217,16 +218,19 @@ group {
rel1 { rel1 {
to: "base"; to: "base";
relative: 0.0 0.0;
offset: 8 0;
} }
rel2 { rel2 {
to: "base"; to: "base";
relative: 1.0 1.0;
offset: -8 -1;
} }
text { text {
text: ""; text: "";
font: "ecdb/default"; font: "ecdb/default";
min: 1 1;
size: 11; size: 11;
align: 0.5 0.5; align: 0.5 0.5;
} }
@ -244,6 +248,7 @@ group {
rel2 { rel2 {
relative: 1.0 1.0; relative: 1.0 1.0;
offset: -8 -1;
} }
text { text {

View File

@ -178,7 +178,6 @@ group {
text { text {
text: ""; text: "";
font: "ecdb/default"; font: "ecdb/default";
min: 1 1;
size: 11; size: 11;
align: 0.0 0.5; align: 0.0 0.5;
} }

View File

@ -74,9 +74,9 @@ group {
description { description {
state: "default" 0.0; state: "default" 0.0;
align: 0.0 0.5;
text { text {
style: "entry_default"; style: "entry_default";
min: 1 1;
} }
rel1 { rel1 {

View File

@ -26,7 +26,6 @@ group {
text { text {
text: ""; text: "";
font: "ecdb/default"; font: "ecdb/default";
min: 1 1;
size: 11; size: 11;
align: 0.0 0.5; align: 0.0 0.5;
} }

View File

@ -29,6 +29,18 @@
//#define PATH_MAX 4095 //#define PATH_MAX 4095
#include <pthread.h> #include <pthread.h>
typedef struct _Ecdb_Page Ecdb_Page;
struct _Ecdb_Page
{
Evas_Object *gui;
Evas_Object *welcome;
Evas_Object *filelist;
Evas_Object *data;
Evas_Object *audio;
Evas_Object *erase;
Evas_Object *image;
};
/* ECDB Global Variables */ /* ECDB Global Variables */
typedef struct _Ecdb_Main Ecdb_Main; typedef struct _Ecdb_Main Ecdb_Main;
struct _Ecdb_Main struct _Ecdb_Main
@ -36,10 +48,17 @@ struct _Ecdb_Main
char theme_path[PATH_MAX]; char theme_path[PATH_MAX];
Ecore_Evas *main_win_ee; Ecore_Evas *main_win_ee;
Eina_List *drives; Eina_List *drives;
/* Drag and drop stuff here */
Eina_List *evas_dnd_candidates; Eina_List *evas_dnd_candidates;
Eina_List *ewl_dnd_candidates; Eina_List *ewl_dnd_candidates;
Evas_Object *evas_drop_object; Evas_Object *evas_drop_object;
Ewl_Widget *ewl_drop_object; Ewl_Widget *ewl_drop_object;
/* Change this to a list at some point, but for now save some time
* and leave it singular
*/
Ecdb_Page *page;
double scalef; double scalef;
}; };

View File

@ -13,10 +13,10 @@ ecdb_audio_project_start(Ecdb_Audio_Project *proj)
* Depending on the number of files, this can be pretty system intensive, so * Depending on the number of files, this can be pretty system intensive, so
* is there a way to reduce/control this ? * is there a way to reduce/control this ?
*/ */
for (i = 0; proj->tracks->children[i]; i++) for (i = 0; ECDB_BURN(proj)->files->children[i]; i++)
{ {
snprintf(cmd, PATH_MAX, "ecdb_transcode_helper %s", snprintf(cmd, PATH_MAX, "ecdb_transcode_helper %s",
proj->tracks->children[i]->dst); ECDB_BURN(proj)->files->children[i]->dst);
ecore_exe_pipe_run(cmd, ECORE_EXE_PIPE_READ | ecore_exe_pipe_run(cmd, ECORE_EXE_PIPE_READ |
ECORE_EXE_PIPE_READ_LINE_BUFFERED, NULL); ECORE_EXE_PIPE_READ_LINE_BUFFERED, NULL);
} }

View File

@ -33,21 +33,36 @@ static void _multi_config(void *data, Evas_Object *obj, void *event_info);
static void _sim_config(void *data, Evas_Object *obj, void *event_info); static void _sim_config(void *data, Evas_Object *obj, void *event_info);
static void _underrun_config(void *data, Evas_Object *obj, void *event_info); static void _underrun_config(void *data, Evas_Object *obj, void *event_info);
static void _proj_config(void *data, Evas_Object *obj, void *event_info); static void _proj_config(void *data, Evas_Object *obj, void *event_info);
static void _page_hide_finished(void *data, Evas_Object *o,
const char *emission,
const char *source);
static void
_page_hide_finished(void *data, Evas_Object *o,
const char *emission __UNUSED__,
const char *source __UNUSED__)
{
Evas_Object *gui;
gui = data;
edje_object_part_unswallow(gui, o);
evas_object_hide(o);
}
static int static int
_update_capacity(void *data, int type, void *ev_data) _update_capacity(void *data, int type, void *ev_data)
{ {
Ecdb_Page *page;
Ecdb_Source *src; Ecdb_Source *src;
Ecdb_Burn_Project *proj; Ecdb_Data_Project *proj;
Ecdb_Project *base_proj; Ecdb_Project *base_proj;
float val; float val;
proj = data; page = data;
if (!proj)
return ECORE_CALLBACK_RENEW;
proj = evas_object_data_get(page->data, "proj");
base_proj = ECDB_PROJECT(proj); base_proj = ECDB_PROJECT(proj);
src = evas_object_data_get(proj->capacity, "source"); src = evas_object_data_get(proj->capacity, "src");
if ((base_proj->drive) && (base_proj->drive->capacity > 0)) if ((base_proj->drive) && (base_proj->drive->capacity > 0))
{ {
printf("drive capacity: %lld, src->size: %lld\n", printf("drive capacity: %lld, src->size: %lld\n",
@ -63,7 +78,7 @@ _update_capacity(void *data, int type, void *ev_data)
{ {
printf("OVER SIZE LIMIT!\n"); printf("OVER SIZE LIMIT!\n");
edje_object_signal_emit(proj->capacity, "ecdb,capacity,exceeded", "ecdb"); edje_object_signal_emit(proj->capacity, "ecdb,capacity,exceeded", "ecdb");
edje_object_signal_emit(proj->parent, "ecdb,capacity, exceeded", "ecdb"); edje_object_signal_emit(page->data, "ecdb,capacity, exceeded", "ecdb");
} }
ecdb_capacity_float_set(proj->capacity, val); ecdb_capacity_float_set(proj->capacity, val);
@ -75,77 +90,70 @@ _button_cb_return(void *data, Evas_Object *obj,
const char *emission __UNUSED__, const char *emission __UNUSED__,
const char *source __UNUSED__) const char *source __UNUSED__)
{ {
Evas_Object *gui; Ecdb_Page *page;
char *signal;
gui = data; page = data;
edje_object_signal_emit(page->data, "ecdb,burn_data_page,hide", "ecdb");
signal = evas_object_data_get(obj, "hide_signal"); ecdb_welcome_page_show(page);
edje_object_signal_emit(obj, signal, "ecdb");
ecdb_welcome_page_show();
/* Hide the filelist to be nice */ /* Hide the filelist to be nice */
edje_object_signal_emit(gui, "ecdb,filelist,hide", "ecdb"); edje_object_signal_emit(page->gui, "ecdb,filelist,hide", "ecdb");
} }
static void static void
_button_cb_begin(void *data, Evas_Object *obj, _button_cb_begin(void *data, Evas_Object *obj __UNUSED__,
const char *emission __UNUSED__, const char *emission __UNUSED__,
const char *source __UNUSED__) const char *source __UNUSED__)
{ {
Evas_Object *gui; Ecdb_Data_Project *proj;
Ecdb_Burn_Project *proj; Ecdb_Page *page;
Ewl_Widget *filelist;
char buf[1024]; char buf[1024];
Ecdb_Burn_Result burn_result; Ecdb_Burn_Result burn_result;
int drive, speed; int drive, speed, idx;
proj = data; page = data;
if (!proj) proj = evas_object_data_get(page->data, "proj");
return;
gui = evas_object_name_find(ecore_evas_get(em->main_win_ee), "gui"); drive = ecdb_combo_selected_get(ECDB_PROJECT(proj)->drive_combo);
filelist = ewl_widget_name_find("ecdb/burn_data/filelist"); if (drive < 0)
if (!ECDB_PROJECT(proj)->drive)
{ {
printf("Choose a drive!\n"); printf("Choose a drive!\n");
edje_object_part_text_set(proj->parent, "progress_text", edje_object_part_text_set(page->data, "progress_text", "Choose a Drive!");
"Choose a Drive!");
return; return;
} }
drive = ecdb_combo_selected_get(proj->drive_combo);
speed = ecdb_speed_convert(eina_list_nth(em->drives, drive), speed = ecdb_speed_convert(eina_list_nth(em->drives, drive),
ecdb_combo_selected_get(proj->speed_combo)); ecdb_combo_selected_get(ECDB_BURN(proj)->speed_combo));
if (speed < 0) if (speed < 0)
proj->speed = 0; ECDB_BURN(proj)->speed = 0;
else else
proj->speed = speed; ECDB_BURN(proj)->speed = speed;
proj->files = ewl_widget_data_get(filelist, "source"); ECDB_BURN(proj)->files = ewl_widget_data_get(proj->filelist, "source");
while (proj->files->parent) while (ECDB_BURN(proj)->files->parent)
proj->files = proj->files->parent; ECDB_BURN(proj)->files = ECDB_BURN(proj)->files->parent;
snprintf(buf, sizeof(buf), "Commencing..."); snprintf(buf, sizeof(buf), "Commencing...");
edje_object_part_text_set(obj, "progress_text", buf); edje_object_part_text_set(page->data, "progress_text", buf);
if (!ecdb_aquire_drive(ECDB_PROJECT(proj), drive)) if (!ecdb_aquire_drive(ECDB_PROJECT(proj), drive))
{ {
printf("Couldn't grab drive!\n"); printf("Couldn't grab drive!\n");
edje_object_part_text_set(obj, "progress_text", edje_object_part_text_set(page->data, "progress_text",
"Couldn't grab the drive!"); "Couldn't grab the drive!");
return; return;
} }
burn_result = ecdb_burn_project(proj); burn_result = ecdb_burn_project(ECDB_BURN(proj));
switch (burn_result) switch (burn_result)
{ {
case ECDB_ERROR_NONE: case ECDB_ERROR_NONE:
edje_object_signal_emit(gui, "ecdb,filelist,hide", "ecdb"); edje_object_signal_emit(page->gui, "ecdb,filelist,hide", "ecdb");
edje_object_signal_emit(obj, "ecdb,burn_data,start", "ecdb"); edje_object_signal_emit(page->data, "ecdb,burn_data,start", "ecdb");
const char *ids[] = {"ecdb/burn_data/return", "ecdb/burn_data/begin", Evas_Object *objs[] = {proj->capacity, proj->settings,
"ecdb/burn_data/file", "ecdb/burn_data/drive", proj->filelist_swallow, ECDB_BURN(proj)->speed_combo,
"ecdb/burn_data/speed"}; ECDB_PROJECT(proj)->ret, ECDB_PROJECT(proj)->begin,
ecdb_gui_controls_disable(ids, 5); NULL};
for (idx = 0; objs[idx] != NULL; idx++)
edje_object_signal_emit(objs[idx], "ecdb,disable", "ecdb");
return; return;
case ECDB_ERROR_IMAGE_CREATE: case ECDB_ERROR_IMAGE_CREATE:
@ -164,11 +172,9 @@ _button_cb_begin(void *data, Evas_Object *obj,
snprintf(buf, sizeof(buf), "Unknown error :-("); snprintf(buf, sizeof(buf), "Unknown error :-(");
} }
edje_object_part_text_set(obj, "progress_text", buf); edje_object_part_text_set(page->data, "progress_text", buf);
burn_drive_release(ECDB_PROJECT(proj)->drive->tangible[0].drive, 1); burn_drive_release(ECDB_PROJECT(proj)->drive->tangible[0].drive, 1);
burn_drive_info_free(ECDB_PROJECT(proj)->drive->tangible); burn_drive_info_free(ECDB_PROJECT(proj)->drive->tangible);
ecdb_burn_project_destroy(proj);
evas_object_data_set(obj, "proj", NULL);
} }
static void static void
@ -177,15 +183,17 @@ _combo_cb_clicked(void *data, Evas_Object *obj, void *event_info)
Evas_Object *b; Evas_Object *b;
Ecdb_Burn_Project *proj; Ecdb_Burn_Project *proj;
Ecdb_Project *base_proj; Ecdb_Project *base_proj;
Ecdb_Page *page;
int sel, i, num_speeds, speed; int sel, i, num_speeds, speed;
char buf[1024]; char buf[1024];
proj = data; page = data;
if (!proj) if (!page)
return; return;
proj = evas_object_data_get(page->data, "proj");
base_proj = ECDB_PROJECT(proj); base_proj = ECDB_PROJECT(proj);
sel = ecdb_combo_selected_get(proj->drive_combo); sel = ecdb_combo_selected_get(base_proj->drive_combo);
if (sel < 0) if (sel < 0)
return; return;
@ -228,7 +236,7 @@ static void
_joliet_clicked(void *data, Evas_Object *obj, void *event_info) _joliet_clicked(void *data, Evas_Object *obj, void *event_info)
{ {
int state; int state;
Ecdb_Burn_Project *proj; Ecdb_Data_Project *proj;
proj = data; proj = data;
state = ecdb_check_checked_get(obj); state = ecdb_check_checked_get(obj);
@ -238,7 +246,7 @@ _joliet_clicked(void *data, Evas_Object *obj, void *event_info)
static void static void
_joliet_config(void *data, Evas_Object *obj, void *event_info) _joliet_config(void *data, Evas_Object *obj, void *event_info)
{ {
Ecdb_Burn_Project *proj; Ecdb_Data_Project *proj;
proj = data; proj = data;
ecdb_check_checked_set(obj, proj->use_joliet); ecdb_check_checked_set(obj, proj->use_joliet);
@ -248,7 +256,7 @@ static void
_rockridge_clicked(void *data, Evas_Object *obj, void *event_info) _rockridge_clicked(void *data, Evas_Object *obj, void *event_info)
{ {
int state; int state;
Ecdb_Burn_Project *proj; Ecdb_Data_Project *proj;
proj = data; proj = data;
state = ecdb_check_checked_get(obj); state = ecdb_check_checked_get(obj);
@ -258,7 +266,7 @@ _rockridge_clicked(void *data, Evas_Object *obj, void *event_info)
static void static void
_rockridge_config(void *data, Evas_Object *obj, void *event_info) _rockridge_config(void *data, Evas_Object *obj, void *event_info)
{ {
Ecdb_Burn_Project *proj; Ecdb_Data_Project *proj;
proj = data; proj = data;
ecdb_check_checked_set(obj, proj->use_rockridge); ecdb_check_checked_set(obj, proj->use_rockridge);
@ -268,7 +276,7 @@ static void
_symlinks_clicked(void *data, Evas_Object *obj, void *event_info) _symlinks_clicked(void *data, Evas_Object *obj, void *event_info)
{ {
int state; int state;
Ecdb_Burn_Project *proj; Ecdb_Data_Project *proj;
proj = data; proj = data;
state = ecdb_check_checked_get(obj); state = ecdb_check_checked_get(obj);
@ -278,7 +286,7 @@ _symlinks_clicked(void *data, Evas_Object *obj, void *event_info)
static void static void
_symlinks_config(void *data, Evas_Object *obj, void *event_info) _symlinks_config(void *data, Evas_Object *obj, void *event_info)
{ {
Ecdb_Burn_Project *proj; Ecdb_Data_Project *proj;
proj = data; proj = data;
ecdb_check_checked_set(obj, proj->follow_symlinks); ecdb_check_checked_set(obj, proj->follow_symlinks);
@ -288,7 +296,7 @@ static void
_hidden_clicked(void *data, Evas_Object *obj, void *event_info) _hidden_clicked(void *data, Evas_Object *obj, void *event_info)
{ {
int state; int state;
Ecdb_Burn_Project *proj; Ecdb_Data_Project *proj;
proj = data; proj = data;
state = ecdb_check_checked_get(obj); state = ecdb_check_checked_get(obj);
@ -298,7 +306,7 @@ _hidden_clicked(void *data, Evas_Object *obj, void *event_info)
static void static void
_hidden_config(void *data, Evas_Object *obj, void *event_info) _hidden_config(void *data, Evas_Object *obj, void *event_info)
{ {
Ecdb_Burn_Project *proj; Ecdb_Data_Project *proj;
proj = data; proj = data;
ecdb_check_checked_set(obj, proj->ignore_hidden); ecdb_check_checked_set(obj, proj->ignore_hidden);
@ -374,7 +382,7 @@ static void
_proj_name(void *data, Evas *e, Evas_Object *obj, void *event_info) _proj_name(void *data, Evas *e, Evas_Object *obj, void *event_info)
{ {
const char *name; const char *name;
Ecdb_Burn_Project *proj; Ecdb_Data_Project *proj;
proj = data; proj = data;
name = ecdb_entry_text_get(obj); name = ecdb_entry_text_get(obj);
@ -387,7 +395,7 @@ _proj_name(void *data, Evas *e, Evas_Object *obj, void *event_info)
static void static void
_proj_config(void *data, Evas_Object *obj, void *event_info) _proj_config(void *data, Evas_Object *obj, void *event_info)
{ {
Ecdb_Burn_Project *proj; Ecdb_Data_Project *proj;
proj = data; proj = data;
@ -423,111 +431,103 @@ _settings_clicked(void *data, Evas_Object *obj __UNUSED__,
} }
void void
ecdb_burn_data_page_show(void) ecdb_burn_data_page_show(Ecdb_Page *page)
{ {
Evas_Object *swallow, *gui; if (!page->data)
Ecdb_Burn_Project *proj;
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),
"burn_data_page");
if (!swallow)
{ {
Evas_Object *b, *t; Evas_Object *b, *t;
Eina_List *l; Eina_List *l;
Ecdb_Drive_Info *drive; Ecdb_Drive_Info *drive;
Evas_Coord x, y, w, h; Evas_Coord x, y, w, h;
Ewl_Widget *embed, *filelist; Ewl_Widget *embed;
Ecdb_Source *src; Ecdb_Source *src;
Ecdb_Data_Project *proj;
Ecdb_Burn_Project *bup;
Ecdb_Project *bp;
proj = ecdb_burn_project_new(); page->data = edje_object_add(ecore_evas_get(em->main_win_ee));
edje_object_file_set(page->data, em->theme_path, "ecdb/burn_data_page");
swallow = edje_object_add(ecore_evas_get(em->main_win_ee)); edje_object_part_geometry_get(page->gui, "active_area", &x, &y, &w, &h);
edje_object_file_set(swallow, em->theme_path, "ecdb/burn_data_page"); evas_object_move(page->data, x, y);
evas_object_name_set(swallow, "burn_data_page"); evas_object_resize(page->data, w, h);
evas_object_data_set(swallow, "hide_signal", "ecdb,burn_data_page,hide"); edje_object_part_swallow(page->gui, "action_area", page->data);
edje_object_part_geometry_get(gui, "active_area", &x, &y, &w, &h); edje_object_signal_callback_add(page->data, "hide,finished",
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, "hide,finished",
"burn_data_page", "burn_data_page",
ecdb_page_hide_finished, NULL); _page_hide_finished, page->gui);
evas_object_data_set(swallow, "proj", proj); evas_object_show(page->data);
evas_object_show(swallow);
proj->parent = swallow; proj = ecdb_data_project_new();
bp = ECDB_PROJECT(proj);
bup = ECDB_BURN(proj);
evas_object_data_set(page->data, "proj", proj);
b = ecdb_button_add(swallow, "ecdb/burn_data/return"); bp->ret = ecdb_button_add(page->data, "ecdb/burn_data/return");
ecdb_button_label_set(b, "Return to Main Page"); ecdb_button_label_set(bp->ret, "Return to Main Page");
edje_object_signal_callback_add(swallow, "mouse,clicked,1", edje_object_signal_callback_add(page->data, "mouse,clicked,1",
"ecdb/burn_data/return", _button_cb_return, gui); "ecdb/burn_data/return", _button_cb_return, page);
evas_object_show(b); evas_object_show(bp->ret);
ecdb_button_icon_set(b, "ecdb/burn_data/return"); ecdb_button_icon_set(bp->ret, "ecdb/burn_data/return");
b = ecdb_button_add(swallow, "ecdb/burn_data/begin"); bp->begin = ecdb_button_add(page->data, "ecdb/burn_data/begin");
ecdb_button_label_set(b, "Start Burn"); ecdb_button_label_set(bp->begin, "Start Burn");
edje_object_signal_callback_add(swallow, "mouse,clicked,1", edje_object_signal_callback_add(page->data, "mouse,clicked,1",
"ecdb/burn_data/begin", _button_cb_begin, proj); "ecdb/burn_data/begin", _button_cb_begin, page);
evas_object_show(b); evas_object_show(bp->begin);
ecdb_button_icon_set(b, "ecdb/burn_data/begin"); ecdb_button_icon_set(bp->begin, "ecdb/burn_data/begin");
proj->drive_combo = ecdb_combo_add(swallow, "ecdb/burn_data/drive"); bp->drive_combo = ecdb_combo_add(page->data, "ecdb/burn_data/drive");
ecdb_combo_header_set(proj->drive_combo, "Drive"); ecdb_combo_header_set(bp->drive_combo, "Drive");
ecdb_combo_header_create_set(proj->drive_combo, ecdb_combo_header_create_set(bp->drive_combo,
ecdb_gui_combo_header_from_drive); ecdb_gui_combo_header_from_drive);
evas_object_show(proj->drive_combo); evas_object_show(bp->drive_combo);
proj->speed_combo = ecdb_combo_add(swallow, "ecdb/burn_data/speed"); bup->speed_combo = ecdb_combo_add(page->data, "ecdb/burn_data/speed");
ecdb_combo_header_create_set(proj->speed_combo, ecdb_combo_header_create_set(bup->speed_combo,
ecdb_gui_combo_header_from_speeds); ecdb_gui_combo_header_from_speeds);
ecdb_combo_header_set(proj->speed_combo, "Max Speed"); ecdb_combo_header_set(bup->speed_combo, "Max Speed");
evas_object_show(proj->speed_combo); evas_object_show(bup->speed_combo);
EINA_LIST_FOREACH(em->drives, l, drive) EINA_LIST_FOREACH(em->drives, l, drive)
{ {
b = ecdb_combo_item_add(proj->drive_combo, NULL); b = ecdb_combo_item_add(bp->drive_combo, NULL);
ecdb_combo_item_label_set(b, drive->product); ecdb_combo_item_label_set(b, drive->product);
evas_object_smart_callback_add(b, "clicked", _combo_cb_clicked, proj); evas_object_smart_callback_add(b, "clicked", _combo_cb_clicked, proj);
ecdb_combo_append(proj->drive_combo, b); ecdb_combo_append(bp->drive_combo, b);
evas_object_show(b); evas_object_show(b);
} }
embed = ewl_embed_new(); embed = ewl_embed_new();
ewl_object_fill_policy_set(EWL_OBJECT(embed), EWL_FLAG_FILL_ALL); ewl_object_fill_policy_set(EWL_OBJECT(embed), EWL_FLAG_FILL_ALL);
b = ewl_embed_canvas_set(EWL_EMBED(embed), proj->filelist_swallow = ewl_embed_canvas_set(EWL_EMBED(embed),
evas_object_evas_get(proj->drive_combo), evas_object_evas_get(bp->drive_combo),
(void *)(long)ecore_evas_software_x11_window_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_embed_focus_set(EWL_EMBED(embed), TRUE);
ewl_widget_show(embed); ewl_widget_show(embed);
filelist = ecdb_custom_filelist_new(); proj->filelist = ecdb_custom_filelist_new();
ewl_widget_name_set(EWL_WIDGET(filelist), "ecdb/burn_data/filelist"); ewl_container_child_append(EWL_CONTAINER(embed), proj->filelist);
ewl_container_child_append(EWL_CONTAINER(embed), filelist); ewl_widget_show(proj->filelist);
ewl_widget_show(filelist);
src = ecdb_source_new(); src = ecdb_source_new();
ewl_widget_data_set(filelist, "source", src); ewl_widget_data_set(proj->filelist, "source", src);
edje_object_part_geometry_get(swallow, "ecdb/burn_data/filelist", &x, &y, edje_object_part_geometry_get(page->data, "ecdb/burn_data/filelist",
&w, &h); &x, &y, &w, &h);
evas_object_name_set(b, "ecdb/burn_data/filelist_swallow"); evas_object_move(proj->filelist_swallow, x, y);
evas_object_move(b, x, y); evas_object_resize(proj->filelist_swallow, w, h);
evas_object_resize(b, w, h); edje_object_part_swallow(page->data, "ecdb/burn_data/filelist",
edje_object_part_swallow(swallow, "ecdb/burn_data/filelist", b); proj->filelist_swallow);
ecdb_widget_focus_callback_add(proj->filelist_swallow,
"ecdb/burn_data/filelist");
evas_object_show(proj->filelist_swallow);
b = edje_object_part_swallow_get(swallow, "ecdb/burn_data/filelist"); proj->capacity = ecdb_capacity_add(page->data, "ecdb/burn_data/capacity");
ecdb_widget_focus_callback_add(b, "ecdb/burn_data/filelist"); evas_object_data_set(proj->capacity, "src", src);
// FIXME Turn this into a normal widget
proj->capacity = ecdb_capacity_add(swallow, "ecdb/burn_data/capacity");
evas_object_data_set(proj->capacity, "source", src);
ecore_event_handler_add(ECDB_FILELIST_SIZE_CHANGED, _update_capacity, ecore_event_handler_add(ECDB_FILELIST_SIZE_CHANGED, _update_capacity,
proj); page);
evas_object_show(proj->capacity); evas_object_show(proj->capacity);
t = ecdb_config_inwin_add(swallow, NULL); t = ecdb_config_inwin_add(page->data, NULL);
b = ecdb_check_add(t, NULL); b = ecdb_check_add(t, NULL);
ecdb_check_label_set(b, "Use Joliet"); ecdb_check_label_set(b, "Use Joliet");
@ -563,24 +563,24 @@ ecdb_burn_data_page_show(void)
b = ecdb_check_add(t, NULL); b = ecdb_check_add(t, NULL);
ecdb_check_label_set(b, "Multi-session"); ecdb_check_label_set(b, "Multi-session");
evas_object_smart_callback_add(b, "clicked", _multi_clicked, proj); evas_object_smart_callback_add(b, "clicked", _multi_clicked, bup);
evas_object_smart_callback_add(b, "proj_config", _multi_config, proj); evas_object_smart_callback_add(b, "proj_config", _multi_config, bup);
ecdb_config_inwin_child_add(t, b, 1, 0, 1, 1); ecdb_config_inwin_child_add(t, b, 1, 0, 1, 1);
evas_object_name_set(b, "ecdb/burn_data/multi"); evas_object_name_set(b, "ecdb/burn_data/multi");
evas_object_show(b); evas_object_show(b);
b = ecdb_check_add(t, NULL); b = ecdb_check_add(t, NULL);
ecdb_check_label_set(b, "Simulate"); ecdb_check_label_set(b, "Simulate");
evas_object_smart_callback_add(b, "clicked", _sim_clicked, proj); evas_object_smart_callback_add(b, "clicked", _sim_clicked, bup);
evas_object_smart_callback_add(b, "proj_config", _sim_config, proj); evas_object_smart_callback_add(b, "proj_config", _sim_config, bup);
ecdb_config_inwin_child_add(t, b, 1, 1, 1, 1); ecdb_config_inwin_child_add(t, b, 1, 1, 1, 1);
evas_object_name_set(b, "ecdb/burn_data/sim"); evas_object_name_set(b, "ecdb/burn_data/sim");
evas_object_show(b); evas_object_show(b);
b = ecdb_check_add(t, NULL); b = ecdb_check_add(t, NULL);
ecdb_check_label_set(b, "Use Underrun Proof"); ecdb_check_label_set(b, "Use Underrun Proof");
evas_object_smart_callback_add(b, "clicked", _underrun_clicked, proj); evas_object_smart_callback_add(b, "clicked", _underrun_clicked, bup);
evas_object_smart_callback_add(b, "proj_config", _underrun_config, proj); evas_object_smart_callback_add(b, "proj_config", _underrun_config, bup);
ecdb_config_inwin_child_add(t, b, 1, 2, 1, 1); ecdb_config_inwin_child_add(t, b, 1, 2, 1, 1);
evas_object_name_set(b, "ecdb/burn_data/underrun"); evas_object_name_set(b, "ecdb/burn_data/underrun");
evas_object_show(b); evas_object_show(b);
@ -602,32 +602,27 @@ ecdb_burn_data_page_show(void)
evas_object_show(b); evas_object_show(b);
// At the end so t is a valid pointer // At the end so t is a valid pointer
b = ecdb_button_add(swallow, "ecdb/burn_data/settings"); b = ecdb_button_add(page->data, "ecdb/burn_data/settings");
ecdb_button_label_set(b, "Settings"); ecdb_button_label_set(b, "Settings");
edje_object_signal_callback_add(swallow, "mouse,clicked,1", edje_object_signal_callback_add(page->data, "mouse,clicked,1",
"ecdb/burn_data/settings", _settings_clicked, t); "ecdb/burn_data/settings", _settings_clicked, t);
evas_object_show(b); evas_object_show(b);
} }
else if (edje_object_part_swallow_get(gui, "action_area") != swallow) else if (edje_object_part_swallow_get(page->gui, "action_area") !=
page->data)
{ {
edje_object_part_swallow(gui, "action_area", swallow); edje_object_part_swallow(page->gui, "action_area", page->data);
evas_object_show(swallow); evas_object_show(page->data);
} }
proj = evas_object_data_get(swallow, "proj"); edje_object_signal_emit(page->gui, "ecdb,burn_data_page,visible", "ecdb");
if (!proj) edje_object_signal_emit(page->data, "ecdb,burn_data_page,visible", "ecdb");
{
proj = ecdb_burn_project_new();
evas_object_data_set(swallow, "proj", proj);
}
edje_object_signal_emit(gui, "ecdb,burn_data_page,visible", "ecdb");
edje_object_signal_emit(swallow, "ecdb,burn_data_page,visible", "ecdb");
} }
void void
ecdb_burn_data_cleanup(Ecdb_Burn_Project *proj) ecdb_burn_data_cleanup(Ecdb_Burn_Project *proj)
{ {
/*
Ewl_Widget *filelist; Ewl_Widget *filelist;
Ecdb_Source *src; Ecdb_Source *src;
int i; int i;
@ -657,5 +652,6 @@ ecdb_burn_data_cleanup(Ecdb_Burn_Project *proj)
} }
evas_object_data_set(proj->parent, "proj", NULL); evas_object_data_set(proj->parent, "proj", NULL);
*/
} }

View File

@ -2,7 +2,7 @@
#ifndef ECDB_BURN_DATA_GUI_H #ifndef ECDB_BURN_DATA_GUI_H
#define ECDB_BURN_DATA_GUI_H #define ECDB_BURN_DATA_GUI_H
void ecdb_burn_data_page_show(void); void ecdb_burn_data_page_show(Ecdb_Page *page);
void ecdb_burn_data_cleanup(Ecdb_Burn_Project *proj); void ecdb_burn_data_cleanup(Ecdb_Burn_Project *proj);
#endif #endif

View File

@ -10,102 +10,105 @@ static void _button_cb_begin(void *data, Evas_Object *obj,
static void _combo_cb_clicked(void *data, Evas_Object *obj, static void _combo_cb_clicked(void *data, Evas_Object *obj,
const char *emission, const char *emission,
const char *source); const char *source);
static void _page_hide_finished(void *data, Evas_Object *o,
const char *emission,
const char *source);
static void
_page_hide_finished(void *data, Evas_Object *o, const char *emission __UNUSED__,
const char *source __UNUSED__)
{
Evas_Object *gui;
gui = data;
edje_object_part_unswallow(gui, o);
evas_object_hide(o);
}
static void static void
_button_cb_return(void *data, Evas_Object *obj, _button_cb_return(void *data, Evas_Object *obj,
const char *emission __UNUSED__, const char *emission __UNUSED__,
const char *source __UNUSED__) const char *source __UNUSED__)
{ {
Evas_Object *gui; Ecdb_Page *page;
char *signal;
gui = data; page = data;
edje_object_part_text_set(page->image, "progress_text", "Begin Burn");
edje_object_part_text_set(obj, "progress_text", "Begin Burn"); edje_object_part_text_set(page->image, "progress_percent", "0%");
edje_object_part_text_set(obj, "progress_percent", "0%"); edje_object_signal_emit(page->image, "ecdb,burn_image_page,hide", "ecdb");
signal = evas_object_data_get(obj, "hide_signal"); ecdb_welcome_page_show(page);
edje_object_signal_emit(obj, signal, "ecdb");
ecdb_welcome_page_show();
/* Hide the filelist to be nice */ /* Hide the filelist to be nice */
edje_object_signal_emit(gui, "ecdb,filelist,hide", "ecdb"); edje_object_signal_emit(page->gui, "ecdb,filelist,hide", "ecdb");
} }
static void static void
_button_cb_begin(void *data, Evas_Object *obj, _button_cb_begin(void *data, Evas_Object *obj __UNUSED__,
const char *emission __UNUSED__, const char *emission __UNUSED__,
const char *source __UNUSED__) const char *source __UNUSED__)
{ {
Evas_Object *gui, *o; Ecdb_Image_Project *proj;
Ecdb_Burn_Project *proj; Ecdb_Page *page;
Ecdb_Source *iso_file; Ecdb_Source *iso_file;
char *file, buf[1024]; char *file, buf[1024];
Ecdb_Burn_Result burn_result; Ecdb_Burn_Result burn_result;
int drive, speed; int drive, speed, idx;
gui = data; page = data;
o = evas_object_name_find(ecore_evas_get(em->main_win_ee), proj = evas_object_data_get(page->image, "proj");
"ecdb/burn_image/file"); file = ecdb_entry_text_get(proj->entry);
file = ecdb_entry_text_get(o);
// Make sure that file actually exists // Make sure that file actually exists
if (!ecore_file_exists(file)) if (!ecore_file_exists(file))
{ {
edje_object_part_text_set(obj, "progress_text", "File doesn't " edje_object_part_text_set(page->image, "progress_text", "File doesn't "
"exists!"); "exists!");
FREE(file); FREE(file);
return; return;
} }
proj = ecdb_burn_project_new();
ecdb_project_type_set(ECDB_PROJECT(proj), ECDB_IMAGE_PROJECT);
iso_file = ecdb_source_new(); iso_file = ecdb_source_new();
proj->files = ecdb_source_new();
ecdb_source_data_set(iso_file, file); ecdb_source_data_set(iso_file, file);
FREE(file); FREE(file);
ecdb_source_child_append(proj->files, iso_file); ecdb_source_child_append(ECDB_BURN(proj)->files, iso_file);
o = evas_object_name_find(evas_object_evas_get(obj), drive = ecdb_combo_selected_get(ECDB_PROJECT(proj)->drive_combo);
"ecdb/burn_image/drive");
drive = ecdb_combo_selected_get(o);
if (drive < 0) if (drive < 0)
{ {
printf("Choose a drive!\n"); printf("Choose a drive!\n");
ecdb_burn_project_destroy(proj); edje_object_part_text_set(page->image, "progress_text",
edje_object_part_text_set(obj, "progress_text", "Choose a Drive!"); "Choose a Drive!");
return; return;
} }
o = evas_object_name_find(evas_object_evas_get(obj),
"ecdb/burn_image/speed");
speed = ecdb_speed_convert(eina_list_nth(em->drives, drive), speed = ecdb_speed_convert(eina_list_nth(em->drives, drive),
ecdb_combo_selected_get(o)); ecdb_combo_selected_get(ECDB_BURN(proj)->speed_combo));
if (speed < 0) if (speed < 0)
proj->speed = 0; ECDB_BURN(proj)->speed = 0;
else else
proj->speed = speed; ECDB_BURN(proj)->speed = speed;
snprintf(buf, sizeof(buf), "Commencing..."); snprintf(buf, sizeof(buf), "Commencing...");
edje_object_part_text_set(obj, "progress_text", buf); edje_object_part_text_set(page->image, "progress_text", buf);
if (!ecdb_aquire_drive(ECDB_PROJECT(proj), drive)) if (!ecdb_aquire_drive(ECDB_PROJECT(proj), drive))
{ {
printf("Couldn't grab drive!\n"); printf("Couldn't grab drive!\n");
ecdb_burn_project_destroy(proj); edje_object_part_text_set(page->image, "progress_text",
edje_object_part_text_set(obj, "progress_text",
"Couldn't grab the drive!"); "Couldn't grab the drive!");
return; return;
} }
burn_result = ecdb_burn_project(proj); burn_result = ecdb_burn_project(ECDB_BURN(proj));
switch (burn_result) switch (burn_result)
{ {
case ECDB_ERROR_NONE: case ECDB_ERROR_NONE:
edje_object_signal_emit(gui, "ecdb,filelist,hide", "ecdb"); edje_object_signal_emit(page->gui, "ecdb,filelist,hide", "ecdb");
edje_object_signal_emit(obj, "ecdb,burn_image,start", "ecdb"); edje_object_signal_emit(page->image, "ecdb,burn_image,start", "ecdb");
const char *ids[] = {"ecdb/burn_image/file", "ecdb/burn_image/drive", Evas_Object *objs[] = {proj->entry, ECDB_PROJECT(proj)->ret,
"ecdb/burn_image/speed", "ecdb/burn_image/begin", ECDB_PROJECT(proj)->begin, ECDB_PROJECT(proj)->drive_combo,
"ecdb/burn_image/return"}; ECDB_BURN(proj)->speed_combo, NULL};
ecdb_gui_controls_disable(ids, 5); for (idx = 0; objs[idx] != NULL; idx++)
edje_object_signal_emit(objs[idx], "ecdb,disable", "ecdb");
return; return;
case ECDB_ERROR_IMAGE_CREATE: case ECDB_ERROR_IMAGE_CREATE:
@ -124,11 +127,9 @@ _button_cb_begin(void *data, Evas_Object *obj,
snprintf(buf, sizeof(buf), "Unknown error :-("); snprintf(buf, sizeof(buf), "Unknown error :-(");
} }
edje_object_part_text_set(obj, "progress_text", buf); edje_object_part_text_set(page->image, "progress_text", buf);
Ecdb_Project *p = ECDB_PROJECT(proj); burn_drive_release(ECDB_PROJECT(proj)->drive->tangible[0].drive, 1);
burn_drive_release(p->drive->tangible[0].drive, 1); burn_drive_info_free(ECDB_PROJECT(proj)->drive->tangible);
burn_drive_info_free(p->drive->tangible);
ecdb_burn_project_destroy(proj);
} }
static void static void
@ -136,27 +137,26 @@ _combo_cb_clicked(void *data, Evas_Object *obj __UNUSED__,
const char *emission __UNUSED__, const char *emission __UNUSED__,
const char *source __UNUSED__) const char *source __UNUSED__)
{ {
Evas_Object *c1, *c2, *b; Evas_Object *b;
Ecdb_Burn_Project *bp;
Ecdb_Drive_Info *drive; Ecdb_Drive_Info *drive;
int sel, i, num_speeds, speed; int sel, i, num_speeds, speed;
char buf[1024]; char buf[1024];
c2 = data; bp = data;
c1 = evas_object_name_find(evas_object_evas_get(obj), sel = ecdb_combo_selected_get(ECDB_PROJECT(bp)->drive_combo);
"ecdb/burn_image/drive");
sel = ecdb_combo_selected_get(c1);
if (sel < 0) if (sel < 0)
return; return;
drive = eina_list_nth(em->drives, sel); drive = eina_list_nth(em->drives, sel);
num_speeds = drive->write_speeds[0]; num_speeds = drive->write_speeds[0];
ecdb_combo_data_set(c2, drive); ecdb_combo_data_set(bp->speed_combo, drive);
for (i = 1; i < num_speeds; i++) for (i = 1; i < num_speeds; i++)
{ {
if ((drive->write_speeds[i]) <= 0) if ((drive->write_speeds[i]) <= 0)
continue; continue;
b = ecdb_combo_item_add(c2, NULL); b = ecdb_combo_item_add(bp->speed_combo, NULL);
if ((drive->profile_name) && (drive->profile_name[0] != '\0')) if ((drive->profile_name) && (drive->profile_name[0] != '\0'))
{ {
@ -174,94 +174,99 @@ _combo_cb_clicked(void *data, Evas_Object *obj __UNUSED__,
snprintf(buf, sizeof(buf), "%dX (%dkb/s)", speed, drive->write_speeds[i]); snprintf(buf, sizeof(buf), "%dX (%dkb/s)", speed, drive->write_speeds[i]);
ecdb_combo_item_label_set(b, buf); ecdb_combo_item_label_set(b, buf);
ecdb_combo_append(c2, b); ecdb_combo_append(bp->speed_combo, b);
evas_object_show(b); evas_object_show(b);
} }
} }
void void
ecdb_burn_image_page_show(void) ecdb_burn_image_page_show(Ecdb_Page *page)
{ {
Evas_Object *swallow, *gui; if (!page->image)
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),
"burn_image_page");
if (!swallow)
{ {
Evas_Object *b, *c1, *c2; Evas_Object *b;
Eina_List *l; Eina_List *l;
Ecdb_Drive_Info *drive; Ecdb_Drive_Info *drive;
Evas_Coord x, y, w, h; Evas_Coord x, y, w, h;
Ecdb_Image_Project *proj;
Ecdb_Project *bp;
Ecdb_Burn_Project *bup;
swallow = edje_object_add(ecore_evas_get(em->main_win_ee)); /* Create the swallow */
edje_object_file_set(swallow, em->theme_path, "ecdb/burn_image_page"); page->image = edje_object_add(ecore_evas_get(em->main_win_ee));
evas_object_name_set(swallow, "burn_image_page"); edje_object_file_set(page->image, em->theme_path, "ecdb/burn_image_page");
evas_object_data_set(swallow, "hide_signal", "ecdb,burn_image_page,hide"); edje_object_part_geometry_get(page->gui, "active_area", &x, &y, &w, &h);
edje_object_part_geometry_get(gui, "active_area", &x, &y, &w, &h); evas_object_move(page->gui, x, y);
evas_object_move(swallow, x, y); evas_object_resize(page->image, w, h);
evas_object_resize(swallow, w, h); edje_object_part_swallow(page->gui, "action_area", page->image);
edje_object_part_swallow(gui, "action_area", swallow); edje_object_signal_callback_add(page->image, "hide,finished",
evas_object_show(swallow);
edje_object_signal_callback_add(swallow, "hide,finished",
"burn_image_page", "burn_image_page",
ecdb_page_hide_finished, NULL); _page_hide_finished, page->gui);
evas_object_show(swallow); evas_object_show(page->image);
b = ecdb_button_add(swallow, "ecdb/burn_image/return"); /* Make the project */
ecdb_button_label_set(b, "Return to Main Page"); proj = ecdb_image_project_new();
edje_object_signal_callback_add(swallow, "mouse,clicked,1", bp = ECDB_PROJECT(proj);
"ecdb/burn_image/return", _button_cb_return, gui); bup = ECDB_BURN(proj);
evas_object_show(b); evas_object_data_set(page->image, "proj", proj);
ecdb_button_icon_set(b, "ecdb/burn_image/return");
b = ecdb_button_add(swallow, "ecdb/burn_image/begin"); /* Make the interface all nice and proper */
ecdb_button_label_set(b, "Start Burn"); bp->ret = ecdb_button_add(page->image, "ecdb/burn_image/return");
edje_object_signal_callback_add(swallow, "mouse,clicked,1", ecdb_button_label_set(bp->ret, "Return to Main Page");
"ecdb/burn_image/begin", _button_cb_begin, gui); edje_object_signal_callback_add(page->image, "mouse,clicked,1",
evas_object_show(b); "ecdb/burn_image/return", _button_cb_return, page);
ecdb_button_icon_set(b, "ecdb/burn_image/begin"); evas_object_show(bp->ret);
ecdb_button_icon_set(bp->ret, "ecdb/burn_image/return");
b = ecdb_entry_add(swallow, "ecdb/burn_image/file"); bp->begin = ecdb_button_add(page->image, "ecdb/burn_image/begin");
ecdb_entry_text_set(b, "Burn File"); ecdb_button_label_set(bp->begin, "Start Burn");
evas_object_show(b); edje_object_signal_callback_add(page->image, "mouse,clicked,1",
"ecdb/burn_image/begin", _button_cb_begin, page);
evas_object_show(bp->begin);
ecdb_button_icon_set(bp->begin, "ecdb/burn_image/begin");
c1 = ecdb_combo_add(swallow, "ecdb/burn_image/drive"); proj->entry = ecdb_entry_add(page->image, "ecdb/burn_image/file");
ecdb_combo_header_set(c1, "Drive"); ecdb_entry_text_set(proj->entry, "Burn File");
ecdb_combo_header_create_set(c1, ecdb_gui_combo_header_from_drive); evas_object_show(proj->entry);
evas_object_show(c1);
c2 = ecdb_combo_add(swallow, "ecdb/burn_image/speed"); bp->drive_combo = ecdb_combo_add(page->image, "ecdb/burn_image/drive");
ecdb_combo_header_create_set(c2, ecdb_gui_combo_header_from_speeds); ecdb_combo_header_set(bp->drive_combo, "Drive");
ecdb_combo_header_set(c2, "Max Speed"); ecdb_combo_header_create_set(bp->drive_combo,
evas_object_show(c2); ecdb_gui_combo_header_from_drive);
evas_object_show(bp->drive_combo);
bup->speed_combo = ecdb_combo_add(page->image, "ecdb/burn_image/speed");
ecdb_combo_header_create_set(bup->speed_combo,
ecdb_gui_combo_header_from_speeds);
ecdb_combo_header_set(bup->speed_combo, "Max Speed");
evas_object_show(bup->speed_combo);
EINA_LIST_FOREACH(em->drives, l, drive) EINA_LIST_FOREACH(em->drives, l, drive)
{ {
b = ecdb_combo_item_add(c1, NULL); b = ecdb_combo_item_add(bp->drive_combo, NULL);
ecdb_combo_item_label_set(b, drive->product); ecdb_combo_item_label_set(b, drive->product);
edje_object_signal_callback_add(b, "mouse,clicked,1", "*", edje_object_signal_callback_add(b, "mouse,clicked,1", "*",
_combo_cb_clicked, c2); _combo_cb_clicked, proj);
ecdb_combo_append(c1, b); ecdb_combo_append(bp->drive_combo, b);
evas_object_show(b); evas_object_show(b);
} }
} }
else if (edje_object_part_swallow_get(gui, "action_area") != swallow) else if (edje_object_part_swallow_get(page->gui, "action_area") !=
page->image)
{ {
edje_object_part_swallow(gui, "action_area", swallow); edje_object_part_swallow(page->gui, "action_area", page->image);
evas_object_show(swallow); evas_object_show(page->image);
} }
edje_object_signal_emit(gui, "ecdb,burn_image_page,visible", "ecdb"); edje_object_signal_emit(page->gui, "ecdb,burn_image_page,visible", "ecdb");
edje_object_signal_emit(swallow, "ecdb,burn_image_page,visible", "ecdb"); edje_object_signal_emit(page->image, "ecdb,burn_image_page,visible", "ecdb");
} }
void void
ecdb_burn_image_cleanup(void) ecdb_burn_image_cleanup(void)
{ {
/*
Evas_Object *swallow; Evas_Object *swallow;
const char *ids[] = {"ecdb/burn_image/return", "ecdb/burn_image/begin", const char *ids[] = {"ecdb/burn_image/return", "ecdb/burn_image/begin",
"ecdb/burn_image/file", "ecdb/burn_image/drive" "ecdb/burn_image/file", "ecdb/burn_image/drive"
@ -271,5 +276,6 @@ ecdb_burn_image_cleanup(void)
edje_object_part_text_set(swallow, "progress_text", "Burn Complete!"); edje_object_part_text_set(swallow, "progress_text", "Burn Complete!");
ecdb_gui_controls_enable(ids, 5); ecdb_gui_controls_enable(ids, 5);
edje_object_signal_emit(swallow, "ecdb,burn_image,done", "ecdb"); edje_object_signal_emit(swallow, "ecdb,burn_image,done", "ecdb");
*/
} }

View File

@ -2,7 +2,7 @@
#ifndef ECDB_BURN_IMAGE_GUI_H #ifndef ECDB_BURN_IMAGE_GUI_H
#define ECDB_BURN_IMAGE_GUI_H #define ECDB_BURN_IMAGE_GUI_H
void ecdb_burn_image_page_show(void); void ecdb_burn_image_page_show(Ecdb_Page *page);
void ecdb_burn_image_cleanup(void); void ecdb_burn_image_cleanup(void);
#endif #endif

View File

@ -89,9 +89,12 @@ struct _Ecdb_Project_Info
/* Every project has these */ /* Every project has these */
Evas_Object *ret; Evas_Object *ret;
Evas_Object *begin; Evas_Object *begin;
Evas_Object *drive; Evas_Object *drive_combo;
}; };
/* Typecast a pointer to an Ecdb_Project */
#define ECDB_PROJECT(proj) ((Ecdb_Project *) proj)
/* Typecast a pointer to an Ecdb_Source */ /* Typecast a pointer to an Ecdb_Source */
#define ECDB_SOURCE(src) ((Ecdb_Source *) src) #define ECDB_SOURCE(src) ((Ecdb_Source *) src)
@ -107,9 +110,6 @@ struct _Ecdb_Source
IsoNode *node; IsoNode *node;
}; };
/* Typecast a pointer to an Ecdb_Project */
#define ECDB_PROJECT(proj) ((Ecdb_Project *) proj)
typedef struct _Ecdb_Burn_Project Ecdb_Burn_Project; typedef struct _Ecdb_Burn_Project Ecdb_Burn_Project;
struct _Ecdb_Burn_Project struct _Ecdb_Burn_Project
{ {
@ -143,7 +143,7 @@ struct _Ecdb_Image_Project
Ecdb_Burn_Project proj; Ecdb_Burn_Project proj;
Evas_Object *entry; Evas_Object *entry;
} };
/* Typecast a pointer to an Ecdb_Image_Project */ /* Typecast a pointer to an Ecdb_Image_Project */
#define ECDB_IMAGE(proj) ((Ecdb_Image_Project *) proj) #define ECDB_IMAGE(proj) ((Ecdb_Image_Project *) proj)
@ -178,7 +178,10 @@ struct _Ecdb_Data_Project
char *copywrite_id; char *copywrite_id;
char *abstract_id; char *abstract_id;
char *biblio_id; char *biblio_id;
} };
/* Typecast a pointer to an Ecdb_Image_Project */
#define ECDB_DATA(proj) ((Ecdb_Data_Project *) proj)
typedef struct _Ecdb_Audio_Project Ecdb_Audio_Project; typedef struct _Ecdb_Audio_Project Ecdb_Audio_Project;
struct _Ecdb_Audio_Project struct _Ecdb_Audio_Project

View File

@ -5,22 +5,34 @@ static void _button_cb_return(void *data, Evas_Object *o, const char *emission,
const char *source); const char *source);
static void _button_cb_begin(void *data, Evas_Object *o, const char *emission, static void _button_cb_begin(void *data, Evas_Object *o, const char *emission,
const char *source); const char *source);
static void _page_hide_finished(void *data, Evas_Object *o,
const char *emission,
const char *source);
static void
_page_hide_finished(void *data, Evas_Object *o,
const char *emission __UNUSED__,
const char *source __UNUSED__)
{
Evas_Object *gui;
gui = data;
edje_object_part_unswallow(gui, o);
evas_object_hide(o);
}
static void static void
_button_cb_return(void *data, Evas_Object *o __UNUSED__, _button_cb_return(void *data, Evas_Object *o __UNUSED__,
const char *emission __UNUSED__, const char *emission __UNUSED__,
const char *source __UNUSED__) const char *source __UNUSED__)
{ {
Evas_Object *swallow; Ecdb_Page *page;
char *signal; page = data;
swallow = data;
edje_object_part_text_set(swallow, "progress_text", "Begin Erase"); edje_object_part_text_set(page->erase, "progress_text", "Begin Erase");
edje_object_part_text_set(swallow, "progress_percent", "0%"); edje_object_part_text_set(page->erase, "progress_percent", "0%");
signal = evas_object_data_get(swallow, "hide_signal"); edje_object_signal_emit(page->erase, "ecdb,erase_page,hide", "ecdb");
edje_object_signal_emit(swallow, signal, "ecdb"); ecdb_welcome_page_show(page);
ecdb_welcome_page_show();
} }
static void static void
@ -28,135 +40,129 @@ _button_cb_begin(void *data, Evas_Object *o __UNUSED__,
const char *emission __UNUSED__, const char *emission __UNUSED__,
const char *source __UNUSED__) const char *source __UNUSED__)
{ {
Evas_Object *swallow, *obj;
Ecdb_Erase_Project *proj; Ecdb_Erase_Project *proj;
Ecdb_Page *page;
char buf[1024]; char buf[1024];
int drive; int idx;
swallow = data; page = data;
proj = evas_object_data_get(page->erase, "proj");
proj = ecdb_erase_project_new();
snprintf(buf, sizeof(buf), "Commencing..."); snprintf(buf, sizeof(buf), "Commencing...");
edje_object_part_text_set(swallow, "progress_text", buf); edje_object_part_text_set(page->erase, "progress_text", buf);
obj = evas_object_name_find(evas_object_evas_get(swallow), idx = ecdb_combo_selected_get(ECDB_PROJECT(proj)->drive_combo);
"ecdb/erase/drive"); if (idx < 0)
drive = ecdb_combo_selected_get(obj);
if (drive < 0)
{ {
printf("Choose a drive!\n"); printf("Choose a drive!\n");
ecdb_erase_project_destroy(proj); edje_object_part_text_set(page->erase, "progress_text",
edje_object_part_text_set(swallow, "progress_text", "Choose a Drive!"); "Choose a Drive!");
return; return;
} }
if (!ecdb_aquire_drive(ECDB_PROJECT(proj), drive)) if (!ecdb_aquire_drive(ECDB_PROJECT(proj), idx))
{ {
printf("Couldn't grab drive!\n"); printf("Couldn't grab drive!\n");
ecdb_erase_project_destroy(proj); edje_object_part_text_set(page->erase, "progress_text",
edje_object_part_text_set(swallow, "progress_text",
"Couldn't grab the drive!"); "Couldn't grab the drive!");
return; return;
} }
obj = evas_object_name_find(evas_object_evas_get(swallow), proj->quick = ecdb_check_checked_get(proj->speed);
"ecdb/erase/speed");
proj->quick = ecdb_check_checked_get(obj);
if (!ecdb_erase_disc(proj)) if (!ecdb_erase_disc(proj))
{ {
Ecdb_Project *p = ECDB_PROJECT(proj);
printf("Disc not erasable!\n"); printf("Disc not erasable!\n");
snprintf(buf, sizeof(buf), "Disc not erasable!"); snprintf(buf, sizeof(buf), "Disc not erasable!");
edje_object_part_text_set(swallow, "progress_text", buf); edje_object_part_text_set(page->erase, "progress_text", buf);
burn_drive_release(p->drive->tangible[0].drive, 0); burn_drive_release(ECDB_PROJECT(proj)->drive->tangible[0].drive, 0);
burn_drive_info_free(p->drive->tangible); burn_drive_info_free(ECDB_PROJECT(proj)->drive->tangible);
ecdb_erase_project_destroy(proj);
return; return;
} }
edje_object_signal_emit(swallow, "ecdb,erase,start", "ecdb"); edje_object_signal_emit(page->erase, "ecdb,erase,start", "ecdb");
const char *ids[] = {"ecdb/erase/return", "ecdb/erase/begin", Evas_Object *objs[] = {proj->speed, ECDB_PROJECT(proj)->ret,
"ecdb/erase/speed", "ecdb/erase/drive"}; ECDB_PROJECT(proj)->begin,
ecdb_gui_controls_disable(ids, 4); ECDB_PROJECT(proj)->drive_combo, NULL};
for (idx = 0; objs[idx] != NULL; idx++)
edje_object_signal_emit(objs[idx], "ecdb,disable", "ecdb");
} }
void void
ecdb_erase_page_show(void) ecdb_erase_page_show(Ecdb_Page *page)
{ {
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),
"erase_page");
/* Hide the filelist as it isn't needed to erase a disc */ /* Hide the filelist as it isn't needed to erase a disc */
edje_object_signal_emit(gui, "ecdb,filelist,hide", "ecdb"); edje_object_signal_emit(page->gui, "ecdb,filelist,hide", "ecdb");
if (!swallow) if (!page->erase)
{ {
Evas_Object *b, *d; Evas_Object *d;
Evas_Coord x, y, w, h; Evas_Coord x, y, w, h;
Eina_List *l; Eina_List *l;
Ecdb_Drive_Info *drive; Ecdb_Drive_Info *drive;
Ecdb_Erase_Project *proj;
Ecdb_Project *bp;
swallow = edje_object_add(ecore_evas_get(em->main_win_ee)); page->erase = edje_object_add(ecore_evas_get(em->main_win_ee));
edje_object_file_set(swallow, em->theme_path, "ecdb/erase_page"); edje_object_file_set(page->erase, em->theme_path, "ecdb/erase_page");
evas_object_name_set(swallow, "erase_page"); edje_object_part_geometry_get(page->gui, "active_area", &x, &y, &w, &h);
evas_object_data_set(swallow, "hide_signal", "ecdb,erase_page,hide"); evas_object_move(page->erase, x, y);
edje_object_part_geometry_get(gui, "active_area", &x, &y, &w, &h); evas_object_resize(page->erase, w, h);
evas_object_move(swallow, x, y); edje_object_part_swallow(page->gui, "action_area", page->erase);
evas_object_resize(swallow, w, h); evas_object_show(page->erase);
edje_object_part_swallow(gui, "action_area", swallow);
evas_object_show(swallow);
edje_object_signal_callback_add(swallow, "hide,finished", "erase_page", proj = ecdb_erase_project_new();
ecdb_page_hide_finished, NULL); bp = ECDB_PROJECT(proj);
evas_object_data_set(page->erase, "proj", proj);
b = ecdb_button_add(swallow, "ecdb/erase/return"); edje_object_signal_callback_add(page->erase, "hide,finished",
ecdb_button_label_set(b, "Return to Main Page"); "erase_page", _page_hide_finished, page->gui);
edje_object_signal_callback_add(swallow, "mouse,clicked,1",
"ecdb/erase/return", _button_cb_return, swallow);
evas_object_show(b);
ecdb_button_icon_set(b, "ecdb/erase/return");
b = ecdb_button_add(swallow, "ecdb/erase/begin"); bp->ret = ecdb_button_add(page->erase, "ecdb/erase/return");
ecdb_button_label_set(b, "Start Erase"); ecdb_button_label_set(bp->ret, "Return to Main Page");
edje_object_signal_callback_add(swallow, "mouse,clicked,1", edje_object_signal_callback_add(page->erase, "mouse,clicked,1",
"ecdb/erase/begin", _button_cb_begin, swallow); "ecdb/erase/return", _button_cb_return, page);
evas_object_show(b); evas_object_show(bp->ret);
ecdb_button_icon_set(b, "ecdb/erase/begin"); ecdb_button_icon_set(bp->ret, "ecdb/erase/return");
b = ecdb_check_add(swallow, "ecdb/erase/speed"); bp->begin = ecdb_button_add(page->erase, "ecdb/erase/begin");
ecdb_check_label_set(b, "Quick Erase"); ecdb_button_label_set(bp->begin, "Start Erase");
evas_object_show(b); edje_object_signal_callback_add(page->erase, "mouse,clicked,1",
"ecdb/erase/begin", _button_cb_begin, page);
evas_object_show(bp->begin);
ecdb_button_icon_set(bp->begin, "ecdb/erase/begin");
b = ecdb_combo_add(swallow, "ecdb/erase/drive"); proj->speed = ecdb_check_add(page->erase, "ecdb/erase/speed");
ecdb_combo_header_set(b, "Drive"); ecdb_check_label_set(proj->speed, "Quick Erase");
ecdb_combo_header_create_set(b, ecdb_gui_combo_header_from_drive); evas_object_show(proj->speed);
bp->drive_combo = ecdb_combo_add(page->erase, "ecdb/erase/drive");
ecdb_combo_header_set(bp->drive_combo, "Drive");
ecdb_combo_header_create_set(bp->drive_combo,
ecdb_gui_combo_header_from_drive);
EINA_LIST_FOREACH(em->drives, l, drive) EINA_LIST_FOREACH(em->drives, l, drive)
{ {
d = ecdb_combo_item_add(b, NULL); d = ecdb_combo_item_add(bp->drive_combo, NULL);
ecdb_combo_item_label_set(d, drive->product); ecdb_combo_item_label_set(d, drive->product);
ecdb_combo_append(b, d); ecdb_combo_append(bp->drive_combo, d);
evas_object_show(d); evas_object_show(d);
} }
} }
else if (edje_object_part_swallow_get(gui, "action_area") != swallow) else if (edje_object_part_swallow_get(page->gui, "action_area") !=
page->erase)
{ {
edje_object_part_swallow(gui, "action_area", swallow); edje_object_part_swallow(page->gui, "action_area", page->erase);
evas_object_show(swallow); evas_object_show(page->erase);
} }
edje_object_signal_emit(gui, "ecdb,erase_page,visible", "ecdb"); edje_object_signal_emit(page->gui, "ecdb,erase_page,visible", "ecdb");
edje_object_signal_emit(swallow, "ecdb,erase_page,visible", "ecdb"); edje_object_signal_emit(page->erase, "ecdb,erase_page,visible", "ecdb");
} }
void void
ecdb_erase_cleanup(void) ecdb_erase_cleanup(void)
{ {
/* XXX
Evas_Object *swallow; Evas_Object *swallow;
const char *ids[] = {"ecdb/erase/return", "ecdb/erase/begin", const char *ids[] = {"ecdb/erase/return", "ecdb/erase/begin",
"ecdb/erase/speed", "ecdb/erase/drive"}; "ecdb/erase/speed", "ecdb/erase/drive"};
@ -170,5 +176,6 @@ ecdb_erase_cleanup(void)
swallow = evas_object_name_find(ecore_evas_get(em->main_win_ee), swallow = evas_object_name_find(ecore_evas_get(em->main_win_ee),
"ecdb/erase/drive"); "ecdb/erase/drive");
ecdb_check_checked_set(swallow, 0); ecdb_check_checked_set(swallow, 0);
*/
} }

View File

@ -2,7 +2,7 @@
#ifndef ECDB_ERASE_GUI_H #ifndef ECDB_ERASE_GUI_H
#define ECDB_ERASE_GUI_H #define ECDB_ERASE_GUI_H
void ecdb_erase_page_show(void); void ecdb_erase_page_show(Ecdb_Page *page);
void ecdb_erase_cleanup(void); void ecdb_erase_cleanup(void);
#endif #endif

View File

@ -1,44 +1,43 @@
/* vim: set sw=3 ts=3 sts=3 expandtab: */ /* vim: set sw=3 ts=3 sts=3 expandtab: */
#include "ecdb.h" #include "ecdb.h"
static void ecdb_handle_typebuf(Evas_Object *gui); static void ecdb_handle_typebuf(Evas_Object *gui, Ewl_Widget *fl);
static void ecdb_cb_welcome_page_buttons_clicked(void *data, Evas_Object *o, 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_filelist_show(void); static void ecdb_filelist_show(Ecdb_Page *page);
static void ecdb_page_hide(const char *pname); static void ecdb_filelist_focus_handle(int action, Evas_Object *fl,
static void ecdb_filelist_focus_handle(int action, Evas_Object *fl); Evas_Object *gui);
static void ecdb_welcome_page_hide_finished(void *data, Evas_Object *o,
const char *emission,
const char *source);
/* XXX These need to be fixed when Ecdb_Page become the swallow,
* whereas it is the actual gui as well
*/
static void static void
ecdb_cb_enter(Ecore_Evas *ee) ecdb_cb_enter(Ecore_Evas *ee)
{ {
Evas_Object *gui; edje_object_signal_emit(em->page->gui, "ecdb,window,enter", "ecdb");
gui = evas_object_name_find(ecore_evas_get(ee), "gui");
edje_object_signal_emit(gui, "ecdb,window,enter", "ecdb");
} }
static void static void
ecdb_cb_leave(Ecore_Evas *ee) ecdb_cb_leave(Ecore_Evas *ee)
{ {
Evas_Object *gui; edje_object_signal_emit(em->page->gui, "ecdb,window,exit", "ecdb");
gui = evas_object_name_find(ecore_evas_get(ee), "gui");
edje_object_signal_emit(gui, "ecdb,window,exit", "ecdb");
} }
static void static void
ecdb_cb_resize(Ecore_Evas *ee) ecdb_cb_resize(Ecore_Evas *ee)
{ {
int w, h; int w, h;
Evas_Object *gui;
ecore_evas_geometry_get(ee, NULL, NULL, &w, &h); ecore_evas_geometry_get(ee, NULL, NULL, &w, &h);
gui = evas_object_name_find(ecore_evas_get(ee), "gui"); evas_object_resize(em->page->gui, w, h);
evas_object_resize(gui, w, h);
} }
static void ecdb_filelist_focus_handle(int action, Evas_Object *fl) static void ecdb_filelist_focus_handle(int action, Evas_Object *fl,
Evas_Object *gui)
{ {
static Evas_Object *old_focus; static Evas_Object *old_focus;
Evas_Object *gui;
if (action == IN) if (action == IN)
{ {
@ -52,7 +51,6 @@ static void ecdb_filelist_focus_handle(int action, Evas_Object *fl)
evas_object_focus_set(old_focus, 1); evas_object_focus_set(old_focus, 1);
old_focus = NULL; old_focus = NULL;
gui = evas_object_name_find(ecore_evas_get(em->main_win_ee), "gui");
edje_object_signal_emit(gui, "ecdb,filelist_overlay,deactivate", "ecdb"); edje_object_signal_emit(gui, "ecdb,filelist_overlay,deactivate", "ecdb");
edje_object_part_text_set(gui, "filelist_overlay_text", NULL); edje_object_part_text_set(gui, "filelist_overlay_text", NULL);
} }
@ -60,27 +58,32 @@ static void ecdb_filelist_focus_handle(int action, Evas_Object *fl)
static void static void
_cb_filelist_mouse_in(void *data, Evas *e __UNUSED__, Evas_Object *eo, _cb_filelist_mouse_in(void *data, Evas *e __UNUSED__, Evas_Object *eo,
void *ev_data __UNUSED__) void *ev_data)
{ {
ecdb_filelist_focus_handle(IN, eo); Ecdb_Page *page;
page = data;
ecdb_filelist_focus_handle(IN, eo, page->gui);
} }
static void static void
_cb_filelist_mouse_out(void *data, Evas *e __UNUSED__, Evas_Object *eo, _cb_filelist_mouse_out(void *data, Evas *e __UNUSED__, Evas_Object *eo,
void *ev_data __UNUSED__) void *ev_data)
{ {
ecdb_filelist_focus_handle(OUT, eo); Ecdb_Page *page;
page = data;
ecdb_filelist_focus_handle(OUT, eo, page->gui);
} }
static void static void
_cb_filelist_mouse_down(void *data, Evas *e __UNUSED__, Evas_Object *eo, _cb_filelist_mouse_down(void *data, Evas *e __UNUSED__, Evas_Object *eo,
void *ev_data __UNUSED__) void *ev_data __UNUSED__)
{ {
Evas_Object *gui = data; Ecdb_Page *page = data;
evas_object_focus_set(eo, TRUE); evas_object_focus_set(eo, TRUE);
edje_object_signal_emit(gui, "ecdb,filelist_overlay,deactivate", "ecdb"); edje_object_signal_emit(page->gui, "ecdb,filelist_overlay,deactivate",
edje_object_part_text_set(gui, "filelist_overlay_text", NULL); "ecdb");
edje_object_part_text_set(page->gui, "filelist_overlay_text", NULL);
} }
@ -89,17 +92,19 @@ _cb_filelist_key_down(void *data, Evas *e __UNUSED__,
Evas_Object *eo __UNUSED__, void *ev_data) Evas_Object *eo __UNUSED__, void *ev_data)
{ {
Evas_Event_Key_Down *ek = ev_data; Evas_Event_Key_Down *ek = ev_data;
Evas_Object *gui = data; Ecdb_Page *page = data;
if (!strcmp(ek->key, "Escape")) if (!strcmp(ek->key, "Escape"))
{ {
edje_object_signal_emit(gui, "ecdb,filelist_overlay,deactivate", "ecdb"); edje_object_signal_emit(page->gui, "ecdb,filelist_overlay,deactivate",
edje_object_part_text_set(gui, "filelist_overlay_text", NULL); "ecdb");
edje_object_part_text_set(page->gui, "filelist_overlay_text", NULL);
} }
else if (!strcmp(ek->key, "Return")) else if (!strcmp(ek->key, "Return"))
{ {
ecdb_handle_typebuf(gui); ecdb_handle_typebuf(page->gui, evas_object_data_get(page->filelist,
"filelist"));
} }
else if (!strcmp(ek->key, "BackSpace")) else if (!strcmp(ek->key, "BackSpace"))
@ -108,7 +113,7 @@ _cb_filelist_key_down(void *data, Evas *e __UNUSED__,
const char *t; const char *t;
char *text; char *text;
t = edje_object_part_text_get(gui, "filelist_overlay_text"); t = edje_object_part_text_get(page->gui, "filelist_overlay_text");
text = (t) ? (strdup(t)) : NULL; text = (t) ? (strdup(t)) : NULL;
if ((!text) || (!*text)) return; if ((!text) || (!*text)) return;
@ -119,10 +124,10 @@ _cb_filelist_key_down(void *data, Evas *e __UNUSED__,
if (len == 1) if (len == 1)
{ {
edje_object_signal_emit(gui, "ecdb,filelist_overlay,deactivate", edje_object_signal_emit(page->gui, "ecdb,filelist_overlay,deactivate",
"ecdb"); "ecdb");
} }
edje_object_part_text_set(gui, "filelist_overlay_text", text); edje_object_part_text_set(page->gui, "filelist_overlay_text", text);
FREE(text); FREE(text);
} }
@ -132,7 +137,7 @@ _cb_filelist_key_down(void *data, Evas *e __UNUSED__,
const char *t, *append; const char *t, *append;
char *text; char *text;
t = edje_object_part_text_get(gui, "filelist_overlay_text"); t = edje_object_part_text_get(page->gui, "filelist_overlay_text");
text = (t) ? (strdup(t)) : NULL; text = (t) ? (strdup(t)) : NULL;
@ -170,9 +175,10 @@ _cb_filelist_key_down(void *data, Evas *e __UNUSED__,
*/ */
if (strlen(text) == 1) if (strlen(text) == 1)
{ {
edje_object_signal_emit(gui, "ecdb,filelist_overlay,activate", "ecdb"); edje_object_signal_emit(page->gui, "ecdb,filelist_overlay,activate",
"ecdb");
} }
edje_object_part_text_set(gui, "filelist_overlay_text", text); edje_object_part_text_set(page->gui, "filelist_overlay_text", text);
FREE(text); FREE(text);
} }
} }
@ -180,7 +186,6 @@ _cb_filelist_key_down(void *data, Evas *e __UNUSED__,
int int
ecdb_create_main_gui(void) ecdb_create_main_gui(void)
{ {
Evas_Object *gui;
Evas_Coord mw, mh; Evas_Coord mw, mh;
const char *scale, *engine; const char *scale, *engine;
@ -229,21 +234,21 @@ ecdb_create_main_gui(void)
em->scalef = (scale) ? atof(scale) : 1.0; em->scalef = (scale) ? atof(scale) : 1.0;
edje_scale_set(em->scalef); edje_scale_set(em->scalef);
gui = edje_object_add(ecore_evas_get(em->main_win_ee)); em->page = calloc(1, sizeof(Ecdb_Page));
edje_object_file_set(gui, em->theme_path, "ecdb/window"); em->page->gui = edje_object_add(ecore_evas_get(em->main_win_ee));
edje_object_size_min_get(gui, &mw, &mh); edje_object_file_set(em->page->gui, em->theme_path, "ecdb/window");
edje_object_size_min_get(em->page->gui, &mw, &mh);
if (mw <= 0) mw = 400; if (mw <= 0) mw = 400;
if (mh <= 0) mh = 300; if (mh <= 0) mh = 300;
mw = (int)((float)mw * em->scalef); mw = (int)((float)mw * em->scalef);
mh = (int)((float)mh * em->scalef); mh = (int)((float)mh * em->scalef);
evas_object_resize(gui, mw, mh); evas_object_resize(em->page->gui, mw, mh);
ecore_evas_resize(em->main_win_ee, mw, mh); ecore_evas_resize(em->main_win_ee, mw, mh);
ecore_evas_size_min_set(em->main_win_ee, mw, mh); ecore_evas_size_min_set(em->main_win_ee, mw, mh);
evas_object_name_set(gui, "gui"); evas_object_move(em->page->gui, 0, 0);
evas_object_move(gui, 0, 0); evas_object_show(em->page->gui);
evas_object_show(gui);
ecdb_welcome_page_show(); ecdb_welcome_page_show(em->page);
return TRUE; return TRUE;
} }
@ -261,9 +266,8 @@ ecdb_set_main_theme(const char *theme_name)
} }
void void
ecdb_handle_typebuf(Evas_Object *gui) ecdb_handle_typebuf(Evas_Object *gui, Ewl_Widget *fl)
{ {
Ewl_Widget *fl;
Ewl_Filelist_Filter *filter; Ewl_Filelist_Filter *filter;
const char *ext; const char *ext;
@ -272,8 +276,6 @@ ecdb_handle_typebuf(Evas_Object *gui)
return; return;
} }
fl = ewl_widget_name_find("main_filelist");
/* Check for a 'cd' first */ /* Check for a 'cd' first */
if (!ecdb_match_keyword(ext, "cd", 2)) if (!ecdb_match_keyword(ext, "cd", 2))
{ {
@ -358,72 +360,56 @@ ecdb_handle_typebuf(Evas_Object *gui)
static void static void
ecdb_cb_welcome_page_buttons_clicked(void *data, Evas_Object *o, ecdb_cb_welcome_page_buttons_clicked(void *data, Evas_Object *o,
const char *emission, const char *source) const char *emission __UNUSED__,
const char *source)
{ {
Evas_Object *swallow, *gui; Ecdb_Page *page = data;
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")) if (!strcmp(source, "ecdb/burn_data"))
{ {
swallow = evas_object_name_find(ecore_evas_get(em->main_win_ee), edje_object_signal_emit(o, "ecdb,welcome_page,hide", "ecdb");
"welcome_page"); ecdb_burn_data_page_show(page);
edje_object_signal_emit(swallow, "ecdb,welcome_page,hide", "ecdb"); ecdb_filelist_show(page);
ecdb_burn_data_page_show();
ecdb_filelist_show();
} }
else if (!strcmp(source, "ecdb/erase")) else if (!strcmp(source, "ecdb/erase"))
{ {
swallow = evas_object_name_find(ecore_evas_get(em->main_win_ee), edje_object_signal_emit(o, "ecdb,welcome_page,hide", "ecdb");
"welcome_page"); ecdb_erase_page_show(page);
edje_object_signal_emit(swallow, "ecdb,welcome_page,hide", "ecdb");
ecdb_erase_page_show();
} }
else if (!strcmp(source, "ecdb/burn_image")) else if (!strcmp(source, "ecdb/burn_image"))
{ {
ecdb_filelist_show(); ecdb_filelist_show(page);
swallow = evas_object_name_find(ecore_evas_get(em->main_win_ee), edje_object_signal_emit(o, "ecdb,welcome_page,hide", "ecdb");
"welcome_page"); ecdb_burn_image_page_show(page);
edje_object_signal_emit(swallow, "ecdb,welcome_page,hide", "ecdb");
ecdb_burn_image_page_show();
} }
else if (swallow) else if (o)
{ {
edje_object_signal_emit(gui, "ecdb,filelist,hide", "ecdb"); edje_object_signal_emit(page->gui, "ecdb,filelist,hide", "ecdb");
} }
printf("Action: %s\n", source); printf("Action: %s\n", source);
} }
void void
ecdb_welcome_page_show(void) ecdb_welcome_page_show(Ecdb_Page *page)
{ {
Evas_Object *gui, *swallow; if (!page->welcome)
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),
"welcome_page");
if (!swallow)
{ {
Evas_Object *b; Evas_Object *b;
Evas_Coord x, y, w, h; Evas_Coord x, y, w, h;
swallow = edje_object_add(ecore_evas_get(em->main_win_ee)); page->welcome = edje_object_add(ecore_evas_get(em->main_win_ee));
evas_object_name_set(swallow, "welcome_page"); edje_object_file_set(page->welcome, em->theme_path, "ecdb/welcome_page");
edje_object_file_set(swallow, em->theme_path, "ecdb/welcome_page"); edje_object_part_geometry_get(page->gui, "active_area", &x, &y, &w, &h);
edje_object_part_geometry_get(gui, "active_area", &x, &y, &w, &h); evas_object_move(page->welcome, x, y);
evas_object_move(swallow, x, y); evas_object_resize(page->welcome, w, h);
evas_object_resize(swallow, w, h); edje_object_part_swallow(page->gui, "action_area", page->welcome);
edje_object_part_swallow(gui, "action_area", swallow); edje_object_signal_callback_add(page->welcome, "mouse,clicked,1",
edje_object_signal_callback_add(swallow, "mouse,clicked,1", "ecdb/*", "ecdb/*", ecdb_cb_welcome_page_buttons_clicked, page);
ecdb_cb_welcome_page_buttons_clicked, NULL); edje_object_signal_callback_add(page->welcome, "hide,finished",
edje_object_signal_callback_add(swallow, "hide,finished", "welcome_page", "welcome_page", ecdb_welcome_page_hide_finished,
ecdb_page_hide_finished, NULL); page->gui);
evas_object_show(swallow); evas_object_show(page->welcome);
int i; int i;
char *labels[] = {"Burn Data CD", "Burn Audio CD", "Burn Image", char *labels[] = {"Burn Data CD", "Burn Audio CD", "Burn Image",
@ -432,133 +418,89 @@ ecdb_welcome_page_show(void)
"ecdb/erase"}; "ecdb/erase"};
for (i = 0; i < 4; i++) for (i = 0; i < 4; i++)
{ {
b = ecdb_button_add(swallow, ids[i]); b = ecdb_button_add(page->welcome, ids[i]);
ecdb_button_label_set(b, labels[i]); ecdb_button_label_set(b, labels[i]);
evas_object_show(b); evas_object_show(b);
ecdb_button_icon_set(b, ids[i]); ecdb_button_icon_set(b, ids[i]);
} }
} }
else if (edje_object_part_swallow_get(gui, "action_area") != swallow) else if (edje_object_part_swallow_get(page->gui, "action_area") !=
page->welcome)
{ {
/* All that is needed here? */ /* All that is needed here? */
edje_object_part_swallow(gui, "action_area", swallow); edje_object_part_swallow(page->gui, "action_area", page->welcome);
evas_object_show(swallow); evas_object_show(page->welcome);
} }
edje_object_signal_emit(gui, "ecdb,welcome_page,show", "ecdb"); edje_object_signal_emit(page->gui, "ecdb,welcome_page,show", "ecdb");
edje_object_signal_emit(swallow, "ecdb,welcome_page,show", "ecdb"); edje_object_signal_emit(page->welcome, "ecdb,welcome_page,show", "ecdb");
} }
static void static void
ecdb_filelist_show(void) ecdb_filelist_show(Ecdb_Page *page)
{ {
Evas_Object *gui, *swallow; if (!page->filelist)
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 (!swallow)
{ {
Evas_Coord x, y, w, h; Evas_Coord x, y, w, h;
Ewl_Widget *embed, *filelist; Ewl_Widget *embed, *filelist;
embed = ewl_embed_new(); embed = ewl_embed_new();
ewl_object_fill_policy_set(EWL_OBJECT(embed), EWL_FLAG_FILL_ALL); ewl_object_fill_policy_set(EWL_OBJECT(embed), EWL_FLAG_FILL_ALL);
swallow = ewl_embed_canvas_set(EWL_EMBED(embed), page->filelist = ewl_embed_canvas_set(EWL_EMBED(embed),
ecore_evas_get(em->main_win_ee), ecore_evas_get(em->main_win_ee),
(void *)(long)ecore_evas_software_x11_window_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_embed_focus_set(EWL_EMBED(embed), TRUE);
ewl_widget_show(embed); ewl_widget_show(embed);
filelist = ewl_filelist_new(); filelist = ewl_filelist_new();
ewl_widget_name_set(EWL_WIDGET(filelist), "main_filelist");
ewl_container_child_append(EWL_CONTAINER(embed), filelist); ewl_container_child_append(EWL_CONTAINER(embed), filelist);
ewl_filelist_directory_set(EWL_FILELIST(filelist), getenv("HOME")); ewl_filelist_directory_set(EWL_FILELIST(filelist), getenv("HOME"));
ewl_widget_show(filelist); ewl_widget_show(filelist);
edje_object_part_geometry_get(gui, "filelist", &x, &y, &w, &h); edje_object_part_geometry_get(page->gui, "filelist", &x, &y, &w, &h);
evas_object_name_set(swallow, "main_filelist"); evas_object_move(page->filelist, x, y);
evas_object_move(swallow, x, y); evas_object_resize(page->filelist, w, h);
evas_object_resize(swallow, w, h); edje_object_part_swallow(page->gui, "filelist", page->filelist);
edje_object_part_swallow(gui, "filelist", swallow); evas_object_event_callback_add(page->filelist, EVAS_CALLBACK_MOUSE_DOWN,
evas_object_event_callback_add(swallow, EVAS_CALLBACK_MOUSE_DOWN, _cb_filelist_mouse_down, page);
_cb_filelist_mouse_down, gui); evas_object_event_callback_add(page->filelist, EVAS_CALLBACK_KEY_DOWN,
evas_object_event_callback_add(swallow, EVAS_CALLBACK_KEY_DOWN, _cb_filelist_key_down, page);
_cb_filelist_key_down, gui); evas_object_event_callback_add(page->filelist, EVAS_CALLBACK_MOUSE_IN,
evas_object_event_callback_add(swallow, EVAS_CALLBACK_MOUSE_IN, _cb_filelist_mouse_in, page);
_cb_filelist_mouse_in, gui); evas_object_event_callback_add(page->filelist, EVAS_CALLBACK_MOUSE_OUT,
evas_object_event_callback_add(swallow, EVAS_CALLBACK_MOUSE_OUT, _cb_filelist_mouse_out, page);
_cb_filelist_mouse_out, gui); evas_object_data_set(page->filelist, "filelist", filelist);
evas_object_show(swallow); evas_object_show(page->filelist);
} }
/* Assume here that it is the active projects job to hide itself and /* Assume here that it is the active projects job to hide itself and
* call this show function * call this show function
*/ */
else if (edje_object_part_swallow_get(gui, "filelist") != swallow) else if (edje_object_part_swallow_get(page->gui, "filelist") !=
page->filelist)
{ {
/* Is this all that is neccessary? */ /* Is this all that is neccessary? */
edje_object_part_swallow(gui, "filelist", swallow); edje_object_part_swallow(page->gui, "filelist", page->filelist);
evas_object_show(swallow); evas_object_show(page->filelist);
} }
edje_object_signal_emit(gui, "ecdb,filelist,visible", "ecdb"); edje_object_signal_emit(page->gui, "ecdb,filelist,visible", "ecdb");
edje_object_signal_emit(swallow, "ecdb,filelist,visible", "ecdb"); edje_object_signal_emit(page->filelist, "ecdb,filelist,visible", "ecdb");
} }
/* This should be triggered by the theme, once it is done with its
* nice fancy animations
*/
static void
ecdb_page_hide(const char *pname)
{
Evas_Object *swallow, *gui;
swallow = evas_object_name_find(ecore_evas_get(em->main_win_ee), pname);
gui = evas_object_name_find(ecore_evas_get(em->main_win_ee), "gui");
if (gui)
{
edje_object_part_unswallow(gui, swallow);
evas_object_hide(swallow);
}
}
/* Hurrah! Fancyness */ /* Hurrah! Fancyness */
void static void
ecdb_page_hide_finished(void *data, Evas_Object *o, const char *emission, ecdb_welcome_page_hide_finished(void *data, Evas_Object *o,
const char *source) const char *emission __UNUSED__,
const char *source __UNUSED__)
{ {
ecdb_page_hide(source); Evas_Object *gui;
}
void gui = data;
ecdb_gui_controls_disable(const char **ids, int n) edje_object_part_unswallow(gui, o);
{ evas_object_hide(o);
Evas_Object *obj;
int i;
for (i = 0; i < n; i++)
{
obj = evas_object_name_find(ecore_evas_get(em->main_win_ee), ids[i]);
edje_object_signal_emit(obj, "ecdb,disable", "ecdb");
}
}
void
ecdb_gui_controls_enable(const char **ids, int n)
{
Evas_Object *obj;
int i;
for (i = 0; i < n; i++)
{
obj = evas_object_name_find(ecore_evas_get(em->main_win_ee), ids[i]);
edje_object_signal_emit(obj, "ecdb,enable", "ecdb");
}
} }
void void

View File

@ -4,12 +4,7 @@
int ecdb_create_main_gui(void); int ecdb_create_main_gui(void);
void ecdb_set_main_theme(const char *theme_name); void ecdb_set_main_theme(const char *theme_name);
void ecdb_welcome_page_show(void); void ecdb_welcome_page_show(Ecdb_Page *page);
void ecdb_page_hide_finished(void *data, Evas_Object *o,
const char *emission,
const char *source);
void ecdb_gui_controls_disable(const char ** ids, int n);
void ecdb_gui_controls_enable(const char **ids, int n);
void ecdb_gui_combo_header_from_drive(Evas_Object *c, const char *name, void ecdb_gui_combo_header_from_drive(Evas_Object *c, const char *name,
void *data, Evas_Object *obj, void *data, Evas_Object *obj,
int sel); int sel);

View File

@ -219,31 +219,32 @@ ecdb_source_add_children_rec(Ecdb_Source *parent, IsoImage *image)
/* proj->files should only have children */ /* proj->files should only have children */
BurnSource * BurnSource *
ecdb_image_project(Ecdb_Burn_Project *proj) ecdb_image_project(Ecdb_Burn_Project *bp)
{ {
IsoImage *image; IsoImage *image;
Ecdb_Source *c; Ecdb_Source *c;
IsoWriteOpts *opts; IsoWriteOpts *opts;
BurnSource *data_src, *fifo_src; BurnSource *data_src, *fifo_src;
Ecdb_Data_Project *proj;
if ((!proj->files) || (!proj->files->num_children)) if ((!bp->files) || (!bp->files->num_children))
{ {
return NULL; return NULL;
} }
/* To handle already-suplied image files */ /* To handle already-suplied image files */
if ((proj->files->num_children == 1) && (ECDB_PROJECT(proj)->type == if ((bp->files->num_children == 1) && (ECDB_PROJECT(bp)->type ==
ECDB_IMAGE_PROJECT)) ECDB_IMAGE_PROJECT))
{ {
efreet_mime_init(); efreet_mime_init();
c = proj->files->children[0]; c = bp->files->children[0];
if ((!ecore_file_is_dir(c->dst)) && if ((!ecore_file_is_dir(c->dst)) &&
(!strcmp(efreet_mime_type_get(c->dst), "application/x-cd-image"))) (!strcmp(efreet_mime_type_get(c->dst), "application/x-cd-image")))
{ {
data_src = burn_file_source_new(c->dst, NULL); data_src = burn_file_source_new(c->dst, NULL);
goto FIFO_CREATE; goto FIFO_CREATE;
} }
else if (ECDB_PROJECT(proj)->type == ECDB_IMAGE_PROJECT) else if (ECDB_PROJECT(bp)->type == ECDB_IMAGE_PROJECT)
{ {
printf("Supplied file is not an image!\n"); printf("Supplied file is not an image!\n");
efreet_mime_shutdown(); efreet_mime_shutdown();
@ -251,6 +252,16 @@ ecdb_image_project(Ecdb_Burn_Project *proj)
} }
efreet_mime_shutdown(); efreet_mime_shutdown();
} }
if (ECDB_PROJECT(bp)->type != ECDB_DATA_PROJECT)
{
proj = ECDB_DATA(bp);
}
else
{
printf("Incorrect project type!\n");
return NULL;
}
/* Otherwise we have a bunch of files */ /* Otherwise we have a bunch of files */
if (!iso_image_new(proj->volume_id, &image)) if (!iso_image_new(proj->volume_id, &image))
@ -301,15 +312,15 @@ ecdb_image_project(Ecdb_Burn_Project *proj)
iso_write_opts_set_joliet(opts, proj->use_joliet); iso_write_opts_set_joliet(opts, proj->use_joliet);
iso_write_opts_set_rockridge(opts, proj->use_rockridge); iso_write_opts_set_rockridge(opts, proj->use_rockridge);
iso_write_opts_set_iso1999(opts, proj->iso1990); iso_write_opts_set_iso1999(opts, proj->iso1990);
iso_write_opts_set_appendable(opts, proj->multi); iso_write_opts_set_appendable(opts, bp->multi);
iso_tree_set_follow_symlinks(image, proj->follow_symlinks); iso_tree_set_follow_symlinks(image, proj->follow_symlinks);
iso_tree_set_ignore_hidden(image, proj->ignore_hidden); iso_tree_set_ignore_hidden(image, proj->ignore_hidden);
iso_tree_set_ignore_special(image, proj->ignore_special); iso_tree_set_ignore_special(image, proj->ignore_special);
/* actually fill image with some files now */ /* actually fill image with some files now */
proj->files->node = ISO_NODE(iso_image_get_root(image)); bp->files->node = ISO_NODE(iso_image_get_root(image));
ecdb_source_add_children_rec(proj->files, image); ecdb_source_add_children_rec(bp->files, image);
/* Make the burn source here */ /* Make the burn source here */
iso_image_create_burn_source(image, opts, &data_src); iso_image_create_burn_source(image, opts, &data_src);
@ -318,8 +329,8 @@ ecdb_image_project(Ecdb_Burn_Project *proj)
/* And, convert to fifo */ /* And, convert to fifo */
FIFO_CREATE: FIFO_CREATE:
fifo_src = burn_fifo_source_new(data_src, proj->fifo_chunksize, fifo_src = burn_fifo_source_new(data_src, bp->fifo_chunksize,
proj->fifo_chunks, 0); bp->fifo_chunks, 0);
burn_source_free(data_src); burn_source_free(data_src);
return fifo_src; return fifo_src;
} }

View File

@ -39,9 +39,9 @@ ecdb_project_destroy(Ecdb_Project *proj)
FREE(proj->drive); FREE(proj->drive);
if (proj->ev_handler) ecore_event_handler_del(proj->ev_handler); if (proj->ev_handler) ecore_event_handler_del(proj->ev_handler);
if (proj->pipe) ecore_pipe_del(proj->pipe); if (proj->pipe) ecore_pipe_del(proj->pipe);
if (proj->ret) evas_object_destroy(proj->ret); if (proj->ret) evas_object_del(proj->ret);
if (proj->begin) evas_object_destroy(proj->begin); if (proj->begin) evas_object_del(proj->begin);
if (proj->begin) evas_object_destroy(proj->drive); if (proj->drive_combo) evas_object_del(proj->drive_combo);
printf("Destroying base project\n"); printf("Destroying base project\n");
} }
@ -80,6 +80,7 @@ ecdb_burn_project_init(Ecdb_Burn_Project *proj)
proj->fifo_chunksize = 2048; proj->fifo_chunksize = 2048;
proj->fifo_chunks = 2048; proj->fifo_chunks = 2048;
proj->underrun_proof = TRUE; proj->underrun_proof = TRUE;
proj->files = ecdb_source_new();
proj->opc = TRUE; proj->opc = TRUE;
proj->multi = TRUE; proj->multi = TRUE;
@ -90,7 +91,7 @@ void
ecdb_burn_project_destroy(Ecdb_Burn_Project *proj) ecdb_burn_project_destroy(Ecdb_Burn_Project *proj)
{ {
if (proj->files) ecdb_source_destroy(proj->files); if (proj->files) ecdb_source_destroy(proj->files);
if (proj->speed_combo) evas_object_destroy(proj->speed_combo); if (proj->speed_combo) evas_object_del(proj->speed_combo);
ecdb_project_destroy(ECDB_PROJECT(proj)); ecdb_project_destroy(ECDB_PROJECT(proj));
printf("Destroying burn project\n"); printf("Destroying burn project\n");
} }
@ -134,7 +135,7 @@ ecdb_erase_project_init(Ecdb_Erase_Project *proj)
void void
ecdb_erase_project_destroy(Ecdb_Erase_Project *proj) ecdb_erase_project_destroy(Ecdb_Erase_Project *proj)
{ {
if (proj->speed) evas_object_destroy(proj->speed); if (proj->speed) evas_object_del(proj->speed);
ecdb_project_destroy(ECDB_PROJECT(proj)); ecdb_project_destroy(ECDB_PROJECT(proj));
FREE(proj); FREE(proj);
} }
@ -174,7 +175,7 @@ ecdb_audio_project_init(Ecdb_Audio_Project *proj)
void void
ecdb_audio_project_destroy(Ecdb_Audio_Project *proj) ecdb_audio_project_destroy(Ecdb_Audio_Project *proj)
{ {
ecdb_burn_project_destroy(ECDB_PROJECT(proj)); ecdb_burn_project_destroy(ECDB_BURN(proj));
FREE(proj); FREE(proj);
} }
@ -216,18 +217,18 @@ ecdb_data_project_init(Ecdb_Data_Project *proj)
void void
ecdb_data_project_destroy(Ecdb_Data_Project *proj) ecdb_data_project_destroy(Ecdb_Data_Project *proj)
{ {
if (proj->capacity) evas_object_destroy(proj->capacity); if (proj->capacity) evas_object_del(proj->capacity);
if (proj->settings) evas_object_destroy(proj->settings); if (proj->settings) evas_object_del(proj->settings);
if (proj->filelist_swallow) evas_object_destroy(proj->filelist_swallow); if (proj->filelist_swallow) evas_object_del(proj->filelist_swallow);
if (proj->filelist) ewl_widget_destroy(filelist); if (proj->filelist) ewl_widget_destroy(proj->filelist);
FREE(volume_id); FREE(proj->volume_id);
FREE(publisher_id); FREE(proj->publisher_id);
FREE(data_preparer_id); FREE(proj->data_preparer_id);
FREE(system_id); FREE(proj->system_id);
FREE(application_id); FREE(proj->application_id);
FREE(copywrite_id); FREE(proj->copywrite_id);
FREE(abstract_id); FREE(proj->abstract_id);
FREE(biblio_id); FREE(proj->biblio_id);
ecdb_burn_project_destroy(ECDB_BURN(proj)); ecdb_burn_project_destroy(ECDB_BURN(proj));
FREE(proj); FREE(proj);
} }
@ -265,7 +266,7 @@ ecdb_image_project_init(Ecdb_Image_Project *proj)
void void
ecdb_image_project_destroy(Ecdb_Image_Project *proj) ecdb_image_project_destroy(Ecdb_Image_Project *proj)
{ {
if (proj->entry) evas_object_destroy(proj->entry); if (proj->entry) evas_object_del(proj->entry);
ecdb_burn_project_destroy(ECDB_BURN(proj)); ecdb_burn_project_destroy(ECDB_BURN(proj));
FREE(proj); FREE(proj);
} }

View File

@ -57,7 +57,6 @@ ecdb_widget_add(Evas_Object *parent, const char *name)
if (name) if (name)
{ {
evas_object_name_set(o, name);
edje_object_part_geometry_get(parent, name, &x, &y, &w, &h); edje_object_part_geometry_get(parent, name, &x, &y, &w, &h);
evas_object_move(o, x, y); evas_object_move(o, x, y);
evas_object_resize(o, w, h); evas_object_resize(o, w, h);