diff --git a/experimental/ecdb/trunk/data/themes/default/default.edc b/experimental/ecdb/trunk/data/themes/default/default.edc index 8a47d4ee..26e4f432 100644 --- a/experimental/ecdb/trunk/data/themes/default/default.edc +++ b/experimental/ecdb/trunk/data/themes/default/default.edc @@ -17,4 +17,5 @@ collections { #include "groups/combo.edc" #include "groups/label.edc" #include "groups/burn_data.edc" + #include "groups/capacity.edc" } diff --git a/experimental/ecdb/trunk/data/themes/default/groups/Makefile.am b/experimental/ecdb/trunk/data/themes/default/groups/Makefile.am index 9120d5dd..ba64f616 100644 --- a/experimental/ecdb/trunk/data/themes/default/groups/Makefile.am +++ b/experimental/ecdb/trunk/data/themes/default/groups/Makefile.am @@ -9,4 +9,5 @@ EXTRA_DIST= burn_data.edc \ icons.edc \ label.edc \ welcome_page.edc \ + capacity.edc \ window.edc diff --git a/experimental/ecdb/trunk/data/themes/default/groups/burn_data.edc b/experimental/ecdb/trunk/data/themes/default/groups/burn_data.edc index 6223d24a..29637965 100644 --- a/experimental/ecdb/trunk/data/themes/default/groups/burn_data.edc +++ b/experimental/ecdb/trunk/data/themes/default/groups/burn_data.edc @@ -142,6 +142,28 @@ group { } } + part { + name: "ecdb/burn_data/vol_name"; + type: SWALLOW; + repeat_events: 1; + + description { + state: "default" 0.0; + + rel1 { + to: "ecdb/burn_data/speed"; + relative: 0.0 1.0; + offset: 0 5; + } + + rel2 { + to: "ecdb/burn_data/speed"; + relative: 1.0 1.0; + offset: 0 30; + } + } + } + /* Missing a description later */ part { name: "ecdb/burn_data/filelist"; @@ -160,7 +182,30 @@ group { rel2 { to: "bg"; relative: 0.5 1.0; - offset: -1 -10; + offset: -1 -26; + } + } + } + + part { + name: "ecdb/burn_data/capacity"; + type: SWALLOW; + repeat_events: 0; + + description { + state: "default" 0.0; + max: 99999 20; + + rel1 { + to: "bg"; + relative: 0.0 1.0; + offset: 10 -23; + } + + rel2 { + to: "bg"; + relative: 1.0 1.0; + offset: -11 -1; } } } diff --git a/experimental/ecdb/trunk/data/themes/default/groups/capacity.edc b/experimental/ecdb/trunk/data/themes/default/groups/capacity.edc new file mode 100644 index 00000000..a940e2c1 --- /dev/null +++ b/experimental/ecdb/trunk/data/themes/default/groups/capacity.edc @@ -0,0 +1,195 @@ +/* vim: set sw=3 ts=3 sts=3 expandtab: */ +group { + name: "ecdb/capacity"; + max: 999999 20; + + script { + public message(Msg_Type:type, id, ...) { + if ((type == MSG_FLOAT) && (id == 1)) { + new Float:freq; + freq = getfarg(2); + set_drag(PART:"draggie", freq, 0.0); + } + } + } + + parts { + part { + name: "confine"; + mouse_events: 0; + type: RECT; + + description { + state: "default" 0.0; + min: 0 17; + fixed: 1 1; + + rel1 { + relative: 0.0 0.0; + offset: 2 1; + } + + rel2 { + relative: 1.0 1.0; + offset: -2 -3; + } + } + } + + part { + name: "bg"; + type: IMAGE; + + description { + state: "default" 0.0; + fixed: 1 1; + + rel1 { + relative: 0.0 0.0; + offset: 0 0; + } + + rel2 { + relative: 1.0 1.0; + offset: -1 -1; + } + + image { + normal: "progress_trough.png"; + border: 3 3 3 4; + } + + fill { + smooth: 0; + } + } + } + + part { + name: "progress_left"; + type: IMAGE; + clip_to: "confine"; + + description { + state: "default" 0.0; + fixed: 1 1; + min: 2 17; + max: 2 17; + + rel1 { + to: "confine"; + relative: 0.0 0.0; + offset: 0 0; + } + + rel2 { + to: "confine"; + relative: 0.0 1.0; + offset: -1 -1; + } + + image { + normal: "progress_bar_left.png"; + } + + fill { + smooth: 0; + } + } + } + + part { + name: "draggie"; + type: RECT; + clip_to: "confine"; + + dragable { + confine: "confine"; + x: 1 1 0; + y: 0 0 0; + } + + description { + state: "default" 0.0; + min: 1 21; + fixed: 1 1; + color: 0 0 0 0; + + rel1 { + relative: 0.0 0.0; + } + + rel2 { + relative: 0.0 1.0; + } + } + } + + part { + name: "fill"; + type: IMAGE; + mouse_events: 0; + clip_to: "confine"; + + description { + state: "default" 0.0; + fixed: 1 1; + + rel1 { + relative: 1.0 0.0; + offset: 0 0; + to: "progress_left"; + } + + rel2 { + relative: 0.0 1.0; + offset: -1 -1; + to: "draggie"; + } + + image { + normal: "progress_bar_fill_0.png"; + } + + fill { + smooth: 1; + size { + relative: 0.0 0.0; + offset: 28 17; + } + } + } + } + + part { + name: "progress_right"; + type: IMAGE; + + description { + state: "default" 0.0; + fixed: 1 1; + min: 2 17; + max: 2 17; + + rel1 { + to: "fill"; + relative: 1.0 0.0; + } + + rel2 { + to: "fill"; + relative: 1.0 1.0; + } + + image { + normal: "progress_bar_right.png"; + } + + fill { + smooth: 0; + } + } + } + } +} + diff --git a/experimental/ecdb/trunk/data/themes/default/groups/window.edc b/experimental/ecdb/trunk/data/themes/default/groups/window.edc index edec1dfe..9609ca88 100644 --- a/experimental/ecdb/trunk/data/themes/default/groups/window.edc +++ b/experimental/ecdb/trunk/data/themes/default/groups/window.edc @@ -1,7 +1,7 @@ /* vim: set sw=3 ts=3 sts=3 expandtab: */ group { name: "ecdb/window"; - min: 640 360; + min: 640 390; parts { part { @@ -10,7 +10,7 @@ group { description { state: "default" 0.0; - min: 640 360; + min: 640 390; max: 999999 999999; rel1 { @@ -62,7 +62,7 @@ group { rel2 { relative: 1.0 1.0; - offset: 0 -175; + offset: 0 -230; } } } diff --git a/experimental/ecdb/trunk/data/themes/default/images/images.edc b/experimental/ecdb/trunk/data/themes/default/images/images.edc index 11f23283..6d7d6587 100644 --- a/experimental/ecdb/trunk/data/themes/default/images/images.edc +++ b/experimental/ecdb/trunk/data/themes/default/images/images.edc @@ -25,4 +25,8 @@ images { image: "combobox_button_clicked.png" COMP; image: "combobox_button_disabled.png" COMP; image: "combo_arrow.png" COMP; + image: "progress_bar_fill_0.png" COMP; + image: "progress_bar_left.png" COMP; + image: "progress_bar_right.png" COMP; + image: "progress_trough.png" COMP; } diff --git a/experimental/ecdb/trunk/data/themes/default/images/progress_bar_fill_0.png b/experimental/ecdb/trunk/data/themes/default/images/progress_bar_fill_0.png new file mode 100644 index 00000000..28e3a5b0 Binary files /dev/null and b/experimental/ecdb/trunk/data/themes/default/images/progress_bar_fill_0.png differ diff --git a/experimental/ecdb/trunk/data/themes/default/images/progress_bar_left.png b/experimental/ecdb/trunk/data/themes/default/images/progress_bar_left.png new file mode 100644 index 00000000..6182a5dc Binary files /dev/null and b/experimental/ecdb/trunk/data/themes/default/images/progress_bar_left.png differ diff --git a/experimental/ecdb/trunk/data/themes/default/images/progress_bar_right.png b/experimental/ecdb/trunk/data/themes/default/images/progress_bar_right.png new file mode 100644 index 00000000..b97c5f59 Binary files /dev/null and b/experimental/ecdb/trunk/data/themes/default/images/progress_bar_right.png differ diff --git a/experimental/ecdb/trunk/data/themes/default/images/progress_trough.png b/experimental/ecdb/trunk/data/themes/default/images/progress_trough.png new file mode 100644 index 00000000..bd5afbeb Binary files /dev/null and b/experimental/ecdb/trunk/data/themes/default/images/progress_trough.png differ diff --git a/experimental/ecdb/trunk/src/ecdb.c b/experimental/ecdb/trunk/src/ecdb.c index 20f75518..2c6fe244 100644 --- a/experimental/ecdb/trunk/src/ecdb.c +++ b/experimental/ecdb/trunk/src/ecdb.c @@ -5,6 +5,7 @@ int ECDB_DRIVE_ACTION_FINISHED = 0; int ECDB_DRIVE_ACTION_BEGUN = 0; int ECDB_DRIVE_ACTION_UPDATE = 0; +int ECDB_FILELIST_SIZE_CHANGED = 0; Ecdb_Main *em; int ecdb_setup(); @@ -176,6 +177,7 @@ ecdb_setup(void) ECDB_DRIVE_ACTION_FINISHED = ecore_event_type_new(); ECDB_DRIVE_ACTION_BEGUN = ecore_event_type_new(); ECDB_DRIVE_ACTION_UPDATE = ecore_event_type_new(); + ECDB_FILELIST_SIZE_CHANGED = ecore_event_type_new(); ecore_event_handler_add(ECORE_EVENT_SIGNAL_EXIT, ecdb_shutdown, NULL); ecore_event_handler_add(ECORE_X_EVENT_XDND_POSITION, ecdb_dnd_position, em); diff --git a/experimental/ecdb/trunk/src/ecdb.h b/experimental/ecdb/trunk/src/ecdb.h index f96bceb1..6db63d9e 100644 --- a/experimental/ecdb/trunk/src/ecdb.h +++ b/experimental/ecdb/trunk/src/ecdb.h @@ -47,6 +47,7 @@ extern Ecdb_Main *em; extern int ECDB_DRIVE_ACTION_FINISHED; extern int ECDB_DRIVE_ACTION_BEGUN; extern int ECDB_DRIVE_ACTION_UPDATE; +extern int ECDB_FILELIST_SIZE_CHANGED; #include "ecdb_common.h" #include "ecdb_drives.h" diff --git a/experimental/ecdb/trunk/src/ecdb_burn_data_gui.c b/experimental/ecdb/trunk/src/ecdb_burn_data_gui.c index 363e8ba4..d0c1dc9f 100644 --- a/experimental/ecdb/trunk/src/ecdb_burn_data_gui.c +++ b/experimental/ecdb/trunk/src/ecdb_burn_data_gui.c @@ -4,6 +4,19 @@ 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 int _update_capacity(void *data, int type, void *ev_data); + +static int +_update_capacity(void *data, int type, void *ev_data) +{ + Ecdb_Source *src; + Evas_Object *o; + + o = data; + src = evas_object_data_get(o, "source"); + + return ECORE_CALLBACK_RENEW; +} static void _button_cb_return(void *data, Evas_Object *obj, void *event_info) @@ -245,6 +258,17 @@ ecdb_burn_data_page_show(void) b = edje_object_part_swallow_get(swallow, "ecdb/burn_data/filelist"); ecdb_widget_focus_callback_add(b, "ecdb/burn_data/filelist"); + + b = ecdb_entry_add(swallow, "ecdb/burn_data/vol_name"); + ecdb_entry_text_set(b, "Volume Name"); + evas_object_show(b); + + // FIXME Turn this into a normal widget + b = ecdb_widget_add(swallow, "ecdb/burn_data/capacity"); + edje_object_file_set(b, em->theme_path, "ecdb/capacity"); + evas_object_data_set(b, "source", src); + ecore_event_handler_add(ECDB_FILELIST_SIZE_CHANGED, _update_capacity, b); + evas_object_show(b); } else if (edje_object_part_swallow_get(gui, "action_area") != swallow) diff --git a/experimental/ecdb/trunk/src/ecdb_common.h b/experimental/ecdb/trunk/src/ecdb_common.h index 1b316e70..612695f3 100644 --- a/experimental/ecdb/trunk/src/ecdb_common.h +++ b/experimental/ecdb/trunk/src/ecdb_common.h @@ -92,6 +92,7 @@ struct _Ecdb_Source const char *dst; unsigned char dir:1; unsigned int num_children; + long long size; //Sizeof itself and children Ecdb_Source **children; Ecdb_Source *parent; IsoNode *node; diff --git a/experimental/ecdb/trunk/src/ecdb_filelist_custom.c b/experimental/ecdb/trunk/src/ecdb_filelist_custom.c index 86321d74..5904dab7 100644 --- a/experimental/ecdb/trunk/src/ecdb_filelist_custom.c +++ b/experimental/ecdb/trunk/src/ecdb_filelist_custom.c @@ -77,6 +77,10 @@ ecdb_custom_filelist_dnd_dropped_cb(Ewl_Widget *w, void *ev, (EWL_MVC(EWL_FILELIST(w)->controller)), 0, EWL_SORT_DIRECTION_ASCENDING); ewl_mvc_dirty_set(EWL_MVC(EWL_FILELIST(w)->controller), TRUE); + + // Send out this event so that we can get notified on size changes + // and update the capacity measure + ecore_event_add(ECDB_FILELIST_SIZE_CHANGED, NULL, NULL, NULL); } void @@ -308,6 +312,7 @@ ecdb_custom_filelist_cb_key_down(Ewl_Widget *w, void *ev, void *data) ecdb_source_child_remove(parent, child); ecdb_source_destroy(child); ecdb_custom_filelist_directory_set(fl, parent); + ecore_event_add(ECDB_FILELIST_SIZE_CHANGED, NULL, NULL, NULL); break; } } diff --git a/experimental/ecdb/trunk/src/ecdb_image.c b/experimental/ecdb/trunk/src/ecdb_image.c index cef37357..d53c12ea 100644 --- a/experimental/ecdb/trunk/src/ecdb_image.c +++ b/experimental/ecdb/trunk/src/ecdb_image.c @@ -28,6 +28,7 @@ ecdb_source_init(Ecdb_Source *src) { src->dir = FALSE; src->num_children = 0; + src->size = 0; src->children = calloc(1, sizeof(Ecdb_Source)); if (!src->children) { @@ -65,6 +66,7 @@ ecdb_source_data_set(Ecdb_Source *src, const char *dst) } src->dst = eina_stringshare_add(dst); + src->size = ecore_file_size(dst); /* Add the files recursively here */ if (ecore_file_is_dir(src->dst)) @@ -109,6 +111,7 @@ ecdb_source_child_append(Ecdb_Source *src, Ecdb_Source *child) (src->num_children + 1)); src->children[src->num_children - 1] = child; src->children[src->num_children] = NULL; + src->size += child->size; child->parent = src; } @@ -146,6 +149,7 @@ ecdb_source_child_remove(Ecdb_Source *src, Ecdb_Source *child) FREE(src->children); src->children = temp; src->num_children--; + src->size -= child->size; child->parent = NULL; } diff --git a/experimental/ecdb/trunk/src/ecdb_widgets.h b/experimental/ecdb/trunk/src/ecdb_widgets.h index 88a425c0..b28daf01 100644 --- a/experimental/ecdb/trunk/src/ecdb_widgets.h +++ b/experimental/ecdb/trunk/src/ecdb_widgets.h @@ -3,6 +3,7 @@ #define ECDB_WIDGETS_H void ecdb_widget_focus_callback_add(Evas_Object *o, const char *name); +Evas_Object *ecdb_widget_add(Evas_Object *parent, const char *name); Evas_Object *ecdb_button_add(Evas_Object *parent, const char *name); void ecdb_button_label_set(Evas_Object *b, const char *label);