Completely forgot to ever build these. Burn data page is underway, dnd doesn't seem to work.

This commit is contained in:
Jaime Thomas 2008-12-22 01:12:16 +00:00
parent 20db4031f1
commit 919407aa74
8 changed files with 676 additions and 42 deletions

View File

@ -0,0 +1,348 @@
/* vim: set sw=3 ts=3 sts=3 expandtab: */
group {
name: "ecdb/burn_data_page";
min: 640 170;
parts {
part {
name: "bg";
type: RECT;
description {
state: "default" 0.0;
color: 0 0 0 0;
rel1 {
relative: 0.0 0.0;
offset: 0 0;
}
rel2 {
relative: 1.0 1.0;
offset: -1 -1;
}
}
description {
state: "before_show" 0.0;
color: 0 0 0 0;
rel1 {
relative: 0.0 0.0;
offset: -33 0;
}
rel2 {
relative: 0.0 0.0;
offset: -1 0;
}
}
description {
state: "hide" 0.0;
color: 0 0 0 0;
rel1 {
relative: 1.0 1.0;
offset: -1 -1;
}
rel2 {
relative: 1.0 1.0;
offset: 33 33;
}
}
}
part {
name: "ecdb/burn_data/return";
type: SWALLOW;
repeat_events: 1;
description {
state: "default" 0.0;
rel1 {
to: "bg";
relative: 0.5 0.0;
offset: 10 5;
}
rel2 {
to: "bg";
relative: 1.0 0.0;
offset: -11 50;
}
}
}
part {
name: "ecdb/burn_data/begin";
type: SWALLOW;
repeat_events: 1;
description {
state: "default" 0.0;
rel1 {
to: "ecdb/burn_data/return";
relative: 0.0 1.0;
offset: 0 5;
}
rel2 {
to: "ecdb/burn_data/return";
relative: 1.0 1.0;
offset: 0 50;
}
}
}
part {
name: "ecdb/burn_data/drive";
type: SWALLOW;
repeat_events: 1;
description {
state: "default" 0.0;
rel1 {
to: "ecdb/burn_data/begin";
relative: 0.0 1.0;
offset: 0 5;
}
rel2 {
to: "ecdb/burn_data/begin";
relative: 1.0 1.0;
offset: 0 30;
}
}
}
part {
name: "ecdb/burn_data/speed";
type: SWALLOW;
repeat_events: 1;
description {
state: "default" 0.0;
rel1 {
to: "ecdb/burn_data/drive";
relative: 0.0 1.0;
offset: 0 5;
}
rel2 {
to: "ecdb/burn_data/drive";
relative: 1.0 1.0;
offset: 0 30;
}
}
}
/* Missing a description later */
part {
name: "ecdb/burn_data/filelist";
type: SWALLOW;
repeat_events: 1;
description {
state: "default" 0.0;
rel1 {
to: "bg";
relative: 0.0 0.0;
offset: 10 5;
}
rel2 {
to: "bg";
relative: 0.5 1.0;
offset: -1 -10;
}
}
}
/* Needed later
part {
name: "progress_outline";
type: IMAGE;
mouse_events: 0;
description {
state: "default" 0.0;
rel1 {
to: "bg";
relative: 0.0 0.0;
offset: 10 5;
}
rel2 {
to: "bg";
relative: 0.5 1.0;
offset: -1 -10;
}
image {
normal: "frame_outline.png";
border: 9 9 9 9;
}
}
}
part {
name: "progress_text";
type: TEXT;
effect: SOFT_SHADOW;
description {
state: "default" 0.0;
fixed: 1 1;
color: 200 200 200 255;
color3: 20 20 20 255;
rel1 {
to: "progress_outline";
relative: 0.0 0.7;
offset: 5 5;
}
rel2 {
to: "progress_outline";
relative: 1.0 1.0;
offset: -6 -6;
}
text {
text: "Begin Burn";
font: "ecdb/default";
min: 1 1;
size: 24;
align: 0.5 0.5;
}
}
description {
state: "fade" 0.0;
inherit: "default" 0.0;
color: 255 255 255 0;
}
}
part {
name: "progress_percent";
type: TEXT;
effect: SOFT_SHADOW;
description {
state: "default" 0.0;
fixed: 1 1;
color: 200 200 200 255;
color3: 20 20 20 255;
rel1 {
to: "progress_outline";
relative: 0.0 0.0;
offset: 5 5;
}
rel2 {
to: "progress_outline";
relative: 1.0 0.7;
offset: -6 -6;
}
text {
text: "0%";
font: "ecdb/default";
min: 1 1;
size: 72;
align: 0.5 0.5;
}
}
}
*/
part {
name: "disabled_hack";
type: RECT;
mouse_events: 1;
description {
state: "default" 0.0;
visible: 0;
rel1 {
to: "bg";
relative: 0.5 0.0;
offset: 0 0;
}
rel2 {
to: "bg";
relative: 1.0 1.0;
offset: -1 -1;
}
}
description {
state: "visible" 0.0;
inherit: "default" 0.0;
color: 255 255 255 0;
visible: 1;
}
}
}
programs {
program {
name: "burn_data_page,visible1";
signal: "ecdb,burn_data_page,visible";
source: "ecdb";
action: STATE_SET "before_show" 0.0;
target: "bg";
after: "burn_data_page,visible2";
}
program {
name: "burn_data_page,visible2";
action: STATE_SET "default" 0.0;
target: "bg";
transition: DECELERATE 0.5;
}
program {
name: "burn_data_page,hide";
signal: "ecdb,burn_data_page,hide";
source: "ecdb";
action: STATE_SET "hide" 0.0;
target: "bg";
transition: DECELERATE 0.5;
after: "hide,finished";
}
program {
name: "burn_data_page,controls_disable";
signal: "ecdb,burn_data,start";
source: "ecdb";
action: STATE_SET "visible" 0.0;
target: "disabled_hack";
}
program {
name: "burn_data_page,controls_enable";
signal: "ecdb,burn_data,done";
source: "ecdb";
action: STATE_SET "default" 0.0;
target: "disabled_hack";
}
program {
name: "hide,finished";
action: SIGNAL_EMIT "hide,finished" "burn_data_page";
}
}
}

View File

@ -14,6 +14,8 @@ ecdb_SOURCES = \
ecdb_widgets.c ecdb_widgets.h \
ecdb_erase_gui.c ecdb_erase_gui.h \
ecdb_burn_image_gui.c ecdb_burn_image_gui.h \
ecdb_burn_data_gui.c ecdb_burn_data_gui.h \
ecdb_filelist_custom.c ecdb_filelist_custom.h \
ecdb_common.h
ecdb_CFLAGS = @ECDB_CFLAGS@

View File

@ -57,6 +57,8 @@ extern int ECDB_DRIVE_ACTION_UPDATE;
#include "ecdb_widgets.h"
#include "ecdb_erase_gui.h"
#include "ecdb_burn_image_gui.h"
#include "ecdb_burn_data_gui.h"
#include "ecdb_filelist_custom.h"
#endif

View File

@ -0,0 +1,269 @@
/* vim: set sw=3 ts=3 sts=3 expandtab: */
#include "ecdb.h"
static void _button_cb_return(void *data, Evas_Object *obj, void *event_info);
static void _button_cb_begin(void *data, Evas_Object *obj, void *event_info);
static void _combo_cb_clicked(void *data, Evas_Object *obj, void *event_info);
static void
_button_cb_return(void *data, Evas_Object *obj, void *event_info)
{
Evas_Object *swallow, *gui;
char *signal;
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");
signal = evas_object_data_get(swallow, "hide_signal");
edje_object_signal_emit(swallow, signal, "ecdb");
ecdb_welcome_page_show();
/* Hide the filelist to be nice */
edje_object_signal_emit(gui, "ecdb,filelist,hide", "ecdb");
}
static void
_button_cb_begin(void *data, Evas_Object *obj, void *event_info)
{
/*
Evas_Object *swallow, *gui, *o;
Ecdb_Burn_Project *proj;
Ecdb_Source *iso_file;
char *file, buf[1024];
Ecdb_Burn_Result burn_result;
int drive, speed;
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");
o = evas_object_name_find(ecore_evas_get(em->main_win_ee),
"ecdb/burn_data/file");
file = ecdb_entry_text_get(o);
// Make sure that file actually exists
if (!ecore_file_exists(file))
{
edje_object_part_text_set(swallow, "progress_text", "File doesn't "
"exists!");
FREE(file);
return;
}
proj = ecdb_burn_project_new();
ecdb_project_type_set(ECDB_PROJECT(proj), ECDB_IMAGE_PROJECT);
iso_file = ecdb_source_new();
ecdb_source_data_set(iso_file, file);
FREE(file);
ecdb_source_child_append(proj->files, iso_file);
o = evas_object_name_find(evas_object_evas_get(obj),
"ecdb/burn_data/drive");
drive = ecdb_combo_selected_get(o);
if (drive < 0)
{
printf("Choose a drive!\n");
ecdb_burn_project_destroy(proj);
edje_object_part_text_set(swallow, "progress_text", "Choose a Drive!");
return;
}
o = evas_object_name_find(evas_object_evas_get(obj),
"ecdb/burn_data/speed");
speed = ecdb_speed_convert(eina_list_nth(em->drives, drive),
ecdb_combo_selected_get(o));
if (speed < 0)
proj->speed = 0;
else
proj->speed = speed;
snprintf(buf, sizeof(buf), "Commencing...");
edje_object_part_text_set(swallow, "progress_text", buf);
if (!ecdb_aquire_drive(ECDB_PROJECT(proj), drive))
{
printf("Couldn't grab drive!\n");
ecdb_burn_project_destroy(proj);
edje_object_part_text_set(swallow, "progress_text",
"Couldn't grab the drive!");
return;
}
burn_result = ecdb_burn_project(proj);
switch (burn_result)
{
case ECDB_ERROR_NONE:
edje_object_signal_emit(gui, "ecdb,filelist,hide", "ecdb");
edje_object_signal_emit(swallow, "ecdb,burn_data,start", "ecdb");
const char *ids[] = {"ecdb/burn_data/return", "ecdb/burn_data/begin",
"ecdb/burn_data/file", "ecdb/burn_data/drive",
"ecdb/burn_data/speed"};
ecdb_gui_controls_disable(ids, 5);
return;
case ECDB_ERROR_IMAGE_CREATE:
snprintf(buf, sizeof(buf), "Invalid file!");
break;
case ECDB_ERROR_SOURCE_ATTACH:
snprintf(buf, sizeof(buf), "Couldn't attach source data!");
break;
case ECDB_ERROR_WRITE_MODE:
snprintf(buf, sizeof(buf), "No suitable burn mode!");
break;
default:
snprintf(buf, sizeof(buf), "Unknown error :-(");
}
edje_object_part_text_set(swallow, "progress_text", buf);
Ecdb_Project *p = ECDB_PROJECT(proj);
burn_drive_release(p->drive->tangible[0].drive, 1);
burn_drive_info_free(p->drive->tangible);
ecdb_burn_project_destroy(proj);
*/
}
static void
_combo_cb_clicked(void *data, Evas_Object *obj, void *event_info)
{
Evas_Object *c1, *c2, *b;
Ecdb_Drive_Info *drive;
int sel, i, num_speeds;
char buf[1024];
c2 = data;
c1 = evas_object_name_find(evas_object_evas_get(obj),
"ecdb/burn_data/drive");
sel = ecdb_combo_selected_get(c1);
if (sel < 0)
return;
drive = eina_list_nth(em->drives, sel);
num_speeds = drive->write_speeds[0];
ecdb_combo_data_set(c2, drive);
for (i = 1; i < num_speeds; i++)
{
if ((drive->write_speeds[i]) <= 0)
continue;
b = ecdb_button_add(c2, NULL);
snprintf(buf, sizeof(buf), "%d", drive->write_speeds[i]);
ecdb_button_label_set(b, buf);
ecdb_combo_append(c2, b);
evas_object_show(b);
}
}
void
ecdb_burn_data_page_show(void)
{
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),
"burn_data_page");
if (!swallow)
{
Evas_Object *b, *c1, *c2;
Eina_List *l;
Ecdb_Drive_Info *drive;
Evas_Coord x, y, w, h;
Ewl_Widget *embed, *filelist;
Ecdb_Source *src;
swallow = edje_object_add(ecore_evas_get(em->main_win_ee));
edje_object_file_set(swallow, em->theme_path, "ecdb/burn_data_page");
evas_object_name_set(swallow, "burn_data_page");
evas_object_data_set(swallow, "hide_signal", "ecdb,burn_data_page,hide");
edje_object_part_geometry_get(gui, "active_area", &x, &y, &w, &h);
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",
ecdb_page_hide_finished, NULL);
evas_object_show(swallow);
b = ecdb_button_add(swallow, "ecdb/burn_data/return");
ecdb_button_label_set(b, "Return to Main Page");
evas_object_smart_callback_add(b, "clicked", _button_cb_return, NULL);
evas_object_show(b);
ecdb_button_icon_set(b, "ecdb/burn_data/return");
b = ecdb_button_add(swallow, "ecdb/burn_data/begin");
ecdb_button_label_set(b, "Start Burn");
evas_object_smart_callback_add(b, "clicked", _button_cb_begin, NULL);
evas_object_show(b);
ecdb_button_icon_set(b, "ecdb/burn_data/begin");
c1 = ecdb_combo_add(swallow, "ecdb/burn_data/drive");
ecdb_combo_header_set(c1, "Drive");
ecdb_combo_header_create_set(c1, ecdb_gui_combo_header_from_drive);
evas_object_show(c1);
c2 = ecdb_combo_add(swallow, "ecdb/burn_data/speed");
ecdb_combo_header_create_set(c2, ecdb_gui_combo_header_from_speeds);
ecdb_combo_header_set(c2, "Max Speed");
evas_object_show(c2);
EINA_LIST_FOREACH(em->drives, l, drive)
{
b = ecdb_button_add(c1, NULL);
ecdb_button_label_set(b, drive->product);
evas_object_smart_callback_add(b, "clicked", _combo_cb_clicked, c2);
ecdb_combo_append(c1, b);
evas_object_show(b);
}
embed = ewl_embed_new();
ewl_object_fill_policy_set(EWL_OBJECT(embed), EWL_FLAG_FILL_ALL);
b = ewl_embed_canvas_set(EWL_EMBED(embed), evas_object_evas_get(c2),
(void *)(long)ecore_evas_software_x11_window_get(em->main_win_ee));
ewl_embed_focus_set(EWL_EMBED(embed), TRUE);
ewl_widget_show(embed);
filelist = ecdb_custom_filelist_new();
ewl_widget_name_set(EWL_WIDGET(filelist), "ecdb/burn_data/filelist");
ewl_container_child_append(EWL_CONTAINER(embed), filelist);
ewl_widget_show(filelist);
src = ecdb_source_new();
ewl_widget_data_set(filelist, "source", src);
edje_object_part_geometry_get(swallow, "ecdb/burn_data/filelist", &x, &y,
&w, &h);
evas_object_name_set(b, "ecdb/burn_data/filelist_swallow");
evas_object_move(b, x, y);
evas_object_resize(b, w, h);
edje_object_part_swallow(swallow, "ecdb/burn_data/filelist", b);
}
else if (edje_object_part_swallow_get(gui, "action_area") != swallow)
{
edje_object_part_swallow(gui, "action_area", swallow);
evas_object_show(swallow);
}
edje_object_signal_emit(gui, "ecdb,burn_data_page,visible", "ecdb");
edje_object_signal_emit(swallow, "ecdb,burn_data_page,visible", "ecdb");
}
void
ecdb_burn_data_cleanup(void)
{
/*
Evas_Object *swallow;
const char *ids[] = {"ecdb/burn_data/return", "ecdb/burn_data/begin",
"ecdb/burn_data/file", "ecdb/burn_data/drive"
"ecdb/burn_data/speed"};
swallow = evas_object_name_find(ecore_evas_get(em->main_win_ee),
"burn_data_page");
edje_object_part_text_set(swallow, "progress_text", "Burn Complete!");
ecdb_gui_controls_enable(ids, 3);
edje_object_signal_emit(swallow, "ecdb,burn_data,done", "ecdb");
*/
}

View File

@ -0,0 +1,8 @@
/* vim: set sw=3 ts=3 sts=3 expandtab: */
#ifndef ECDB_BURN_DATA_GUI_H
#define ECDB_BURN_DATA_GUI_H
void ecdb_burn_data_page_show(void);
void ecdb_burn_data_cleanup(void);
#endif

View File

@ -108,7 +108,6 @@ ecdb_erase_page_show(void)
edje_object_signal_callback_add(swallow, "hide,finished", "erase_page",
ecdb_page_hide_finished, NULL);
evas_object_show(swallow);
b = ecdb_button_add(swallow, "ecdb/erase/return");
ecdb_button_label_set(b, "Return to Main Page");

View File

@ -1,11 +1,12 @@
/* vim: set sw=3 ts=3 sts=3 expandtab: */
#include "ecdb.h"
static void free_file(Ewl_Filelist_File *file);
static void free_file(void *data);
static void ecdb_custom_filelist_cb_clicked(Ewl_Widget *w, void *ev,
void *data);
static Ewl_Widget *ecdb_custom_filelist_view_widget_fetch(void *data,
unsigned int row, unsigned int column);
unsigned int row, unsigned int column,
void *private_data);
static void *ecdb_custom_filelist_model_data_fetch(void *data, unsigned int row,
unsigned int column);
@ -109,7 +110,12 @@ ecdb_custom_filelist_directory_new(Ecdb_Source *parent)
struct stat st;
int nf = 0, nd = 0, i = 0;
Eina_List *files = NULL, *dirs = NULL;
Ecore_List *files, *dirs;
files = ecore_list_new();
dirs = ecore_list_new();
ecore_list_free_cb_set(files, free_file);
ecore_list_free_cb_set(dirs, free_file);
if (!parent)
{
@ -133,12 +139,12 @@ ecdb_custom_filelist_directory_new(Ecdb_Source *parent)
if (src->dir)
{
dirs = eina_list_append(dirs, file);
ecore_list_append(dirs, file);
nd++;
}
else
{
files = eina_list_append(files, file);
ecore_list_append(files, file);
nf++;
}
@ -157,63 +163,62 @@ ecdb_custom_filelist_directory_new(Ecdb_Source *parent)
}
static void
ecdb_files_list_free(Eina_List *list)
free_file(void *data)
{
Eina_List *l;
Ewl_Filelist_File *file;
EINA_LIST_FOREACH(list, l, file)
{
eina_stringshare_del(file->name);
FREE(file);
}
list = eina_list_free(list);
file = data;
eina_stringshare_del(file->name);
FREE(file);
}
static void
ecdb_custom_filelist_model_filter(Ewl_Filelist_Directory *dir)
{
Ewl_Filelist_File *file;
Eina_List *l;
int nd, nf;
dir->files = eina_list_free(dir->files);
dir->dirs = eina_list_free(dir->dirs);
if (!dir->files || !dir->dirs)
return;
ecore_list_clear(dir->files);
ecore_list_clear(dir->dirs);
nd = nf = 0;
if (!dir->show_dot)
{
dir->rfiles = eina_list_nth_list(dir->rfiles, 0);
EINA_LIST_FOREACH(dir->rfiles, l, file)
ecore_list_first_goto(dir->rfiles);
while ((file = ecore_list_next(dir->rfiles)))
{
if (ecore_file_file_get(file->name)[0] != '.')
{
dir->files = eina_list_append(dir->files, file);
ecore_list_append(dir->files, file);
nf++;
}
}
dir->rdirs = eina_list_nth_list(dir->files, 0);
EINA_LIST_FOREACH(dir->rdirs, l, file)
ecore_list_first_goto(dir->rdirs);
while ((file = ecore_list_next(dir->rdirs)))
{
if (ecore_file_file_get(file->name)[0] != '.')
{
dir->dirs = eina_list_append(dir->dirs, file);
ecore_list_append(dir->dirs, file);
nd++;
}
}
}
else
{
dir->rfiles = eina_list_nth_list(dir->rfiles, 0);
EINA_LIST_FOREACH(dir->rfiles, l, file)
ecore_list_first_goto(dir->rfiles);
while ((file = ecore_list_next(dir->rfiles)))
{
dir->files = eina_list_append(dir->files, file);
ecore_list_append(dir->files, file);
nf++;
}
dir->rdirs = eina_list_nth_list(dir->rdirs, 0);
EINA_LIST_FOREACH(dir->rdirs, l, file)
ecore_list_first_goto(dir->rdirs);
while ((file = ecore_list_next(dir->rdirs)))
{
dir->dirs = eina_list_append(dir->dirs, file);
ecore_list_append(dir->dirs, file);
nd++;
}
}
@ -228,10 +233,10 @@ ecdb_custom_filelist_model_data_unref(void *data)
Ewl_Filelist_Directory *dir;
dir = data;
ecdb_files_list_free(dir->files);
ecdb_files_list_free(dir->dirs);
ecdb_files_list_free(dir->rfiles);
ecdb_files_list_free(dir->rdirs);
ecore_list_destroy(dir->files);
ecore_list_destroy(dir->dirs);
ecore_list_destroy(dir->rfiles);
ecore_list_destroy(dir->rdirs);
FREE(dir);
return TRUE;
}
@ -250,12 +255,12 @@ ecdb_custom_filelist_model_data_fetch(void *data, unsigned int row,
/* Check if in dirs or files list */
if (row < fld->num_dirs)
{
file = eina_list_nth(fld->dirs, row);
file = ecore_list_index_goto(fld->dirs, row);
}
else
{
i = (row - fld->num_dirs);
file = eina_list_nth(fld->files, i);
i = row - fld->num_dirs;
file = ecore_list_index_goto(fld->files, i);
}
if (column == 1) ret = ewl_filelist_size_get(file->size);
@ -341,12 +346,12 @@ ecdb_custom_filelist_selected_file_get(Ewl_Filelist *fl)
data = EWL_SELECTION(idx)->data;
if (idx->row < data->num_dirs)
{
file = eina_list_nth(data->dirs, idx->row);
file = ecore_list_index_goto(data->dirs, idx->row);
}
else
{
i = (idx->row - data->num_dirs);
file = eina_list_nth(data->files, i);
file = ecore_list_index_goto(data->files, i);
}
FREE(idx);
@ -355,7 +360,7 @@ ecdb_custom_filelist_selected_file_get(Ewl_Filelist *fl)
static Ewl_Widget *
ecdb_custom_filelist_view_widget_fetch(void *data, unsigned int row __UNUSED__,
unsigned int column)
unsigned int column, void *private_data)
{
Ewl_Widget *ret;
const char *img = NULL, *stock, *filename;

View File

@ -347,12 +347,13 @@ ecdb_cb_welcome_page_buttons_clicked(void *data, Evas_Object *o,
swallow = evas_object_name_find(ecore_evas_get(em->main_win_ee),
"main_filelist");
/* Actually get this to do some stuff, instead of just for show like
* now
*/
if (!strcmp(source, "ecdb/burn_data"))
{
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");
ecdb_burn_data_page_show();
}
else if (!strcmp(source, "ecdb/erase"))
{