From 9833e39485d91f7405781a5a9b3d254e84ec4a77 Mon Sep 17 00:00:00 2001 From: Jaime Thomas Date: Wed, 6 Aug 2008 02:21:20 +0000 Subject: [PATCH] Nice little filelist --- experimental/ecdb/trunk/TODO | 2 ++ .../data/themes/default/groups/window.edc | 20 ++++++++++++++++ experimental/ecdb/trunk/src/ecdb.c | 13 ++++++---- experimental/ecdb/trunk/src/ecdb.h | 1 + experimental/ecdb/trunk/src/ecdb_gui.c | 24 +++++++++++++++++++ experimental/ecdb/trunk/src/ecdb_misc.c | 2 +- 6 files changed, 57 insertions(+), 5 deletions(-) diff --git a/experimental/ecdb/trunk/TODO b/experimental/ecdb/trunk/TODO index e0899772..bf0f5c9b 100644 --- a/experimental/ecdb/trunk/TODO +++ b/experimental/ecdb/trunk/TODO @@ -1,3 +1,5 @@ -> Detect if the media in a drive has changed and update the drive info (dbus?). -> Make gstreamer dependancy optional DONE -> more graceful handling of errors +-> ffmpeg instead of gstreamer +-> finish interface diff --git a/experimental/ecdb/trunk/data/themes/default/groups/window.edc b/experimental/ecdb/trunk/data/themes/default/groups/window.edc index dae4e0db..e07a2a4a 100644 --- a/experimental/ecdb/trunk/data/themes/default/groups/window.edc +++ b/experimental/ecdb/trunk/data/themes/default/groups/window.edc @@ -24,5 +24,25 @@ group { } } } + + part { + name: "filelist"; + type: SWALLOW; + description { + state: "default" 0.0; + min: 245 245; + max: 99999 350; + align: 0.0 0.0; + + rel1 { + to: "background"; + offset: 5 5; + } + + rel2 { + offset: -5 -5; + } + } + } } } diff --git a/experimental/ecdb/trunk/src/ecdb.c b/experimental/ecdb/trunk/src/ecdb.c index ce097ef4..1a2120e7 100644 --- a/experimental/ecdb/trunk/src/ecdb.c +++ b/experimental/ecdb/trunk/src/ecdb.c @@ -13,15 +13,13 @@ main(int argc, char **argv) { int ret = 0; + /* Do I really need all of these? */ if (!ecore_init()) { printf("Cannot initialize Ecore!\n"); - ret = 1; return 1; } - ecore_app_args_set(argc, (const char **)argv); - if (!ecore_string_init()) { printf("Cannot initialize Ecore_String!\n"); @@ -50,6 +48,13 @@ main(int argc, char **argv) goto SHUTDOWN; } + if (!ewl_init(&argc, argv)) + { + printf("Connot initialize Ewl!\n"); + ret = 1; + goto SHUTDOWN; + } + if (!ecdb_image_init()) { printf("Cannot initialize libisofs!\n"); @@ -123,7 +128,7 @@ main(int argc, char **argv) */ - ecore_main_loop_begin(); + ewl_main(); /* End testing */ diff --git a/experimental/ecdb/trunk/src/ecdb.h b/experimental/ecdb/trunk/src/ecdb.h index c1c5d49f..10b5ace6 100644 --- a/experimental/ecdb/trunk/src/ecdb.h +++ b/experimental/ecdb/trunk/src/ecdb.h @@ -10,6 +10,7 @@ #include #include #include +#include #include #include diff --git a/experimental/ecdb/trunk/src/ecdb_gui.c b/experimental/ecdb/trunk/src/ecdb_gui.c index af08e6bd..d28d91d3 100644 --- a/experimental/ecdb/trunk/src/ecdb_gui.c +++ b/experimental/ecdb/trunk/src/ecdb_gui.c @@ -31,6 +31,9 @@ int ecdb_create_main_gui(void) { Evas_Object *gui; + Evas_Object *swallow; + Ewl_Widget *embed, *filelist; + Evas_Coord x, y, w, h; em->main_win_ee = ecore_evas_software_x11_new(0, 0, 0, 0, 255, 255); @@ -61,6 +64,27 @@ ecdb_create_main_gui(void) ecdb_set_main_theme(NULL, "ecdb/window"); + /* Set up the filelist swallow */ + embed = ewl_embed_new(); + ewl_object_fill_policy_set(EWL_OBJECT(embed), EWL_FLAG_FILL_ALL); + swallow = ewl_embed_canvas_set(EWL_EMBED(embed), + ecore_evas_get(em->main_win_ee), + (void *)(long) ecore_evas_software_x11_window_get + (em->main_win_ee)); + ewl_embed_focus_set(EWL_EMBED(embed), TRUE); + ewl_widget_show(embed); + + filelist = ewl_filelist_new(); + ewl_container_child_append(EWL_CONTAINER(embed), filelist); + ewl_filelist_directory_set(EWL_FILELIST(filelist), getenv("HOME")); + ewl_widget_show(filelist); + + edje_object_part_geometry_get(gui, "filelist", &x, &y, &w, &h); + evas_object_move(swallow, x, y); + evas_object_resize(swallow, x, y); + edje_object_part_swallow(gui, "filelist", swallow); + evas_object_show(swallow); + return TRUE; } diff --git a/experimental/ecdb/trunk/src/ecdb_misc.c b/experimental/ecdb/trunk/src/ecdb_misc.c index 47b928d2..2c6027e9 100644 --- a/experimental/ecdb/trunk/src/ecdb_misc.c +++ b/experimental/ecdb/trunk/src/ecdb_misc.c @@ -44,7 +44,7 @@ ecdb_shutdown(void *data, int type, void *event) if (!ecore_file_recursive_rm("/tmp/ecdb")) printf("Removal of temporary directory failed!\n"); - ecore_main_loop_quit(); + ewl_main_quit(); return FALSE; }