From: <enl...@li...> - 2005-09-25 03:28:28
|
Enlightenment CVS committal Author : codewarrior Project : e17 Module : apps/e Dir : e17/apps/e/data/themes/images Added Files: entry.png entry_focus.png Log Message: Added e_entry smart. Not done yet, look at todo in e_entry.c |
From: <enl...@li...> - 2005-09-25 03:28:28
|
Enlightenment CVS committal Author : codewarrior Project : e17 Module : apps/e Dir : e17/apps/e/data/themes Modified Files: default.edc Added Files: default_entry.edc Log Message: Added e_entry smart. Not done yet, look at todo in e_entry.c =================================================================== RCS file: /cvsroot/enlightenment/e17/apps/e/data/themes/default.edc,v retrieving revision 1.44 retrieving revision 1.45 diff -u -3 -r1.44 -r1.45 --- default.edc 22 Sep 2005 05:52:37 -0000 1.44 +++ default.edc 25 Sep 2005 03:28:17 -0000 1.45 @@ -46,5 +46,6 @@ #include "default_pointer.edc" #include "default_about.edc" #include "default_theme_about.edc" +#include "default_entry.edc" } |
From: <enl...@li...> - 2005-09-25 03:28:28
|
Enlightenment CVS committal Author : codewarrior Project : e17 Module : apps/e Dir : e17/apps/e/src/bin Modified Files: Makefile.am e_includes.h Added Files: e_entry.c e_entry.h Log Message: Added e_entry smart. Not done yet, look at todo in e_entry.c =================================================================== RCS file: /cvsroot/enlightenment/e17/apps/e/src/bin/Makefile.am,v retrieving revision 1.47 retrieving revision 1.48 diff -u -3 -r1.47 -r1.48 --- Makefile.am 24 Sep 2005 10:29:31 -0000 1.47 +++ Makefile.am 25 Sep 2005 03:28:18 -0000 1.48 @@ -32,6 +32,7 @@ e_object.h \ e_icon.h \ e_box.h \ +e_entry.h \ e_int_menus.h \ e_module.h \ e_apps.h \ @@ -93,6 +94,7 @@ e_object.c \ e_icon.c \ e_box.c \ +e_entry.c \ e_int_menus.c \ e_module.c \ e_apps.c \ =================================================================== RCS file: /cvsroot/enlightenment/e17/apps/e/src/bin/e_includes.h,v retrieving revision 1.34 retrieving revision 1.35 diff -u -3 -r1.34 -r1.35 --- e_includes.h 24 Sep 2005 10:29:31 -0000 1.34 +++ e_includes.h 25 Sep 2005 03:28:18 -0000 1.35 @@ -17,6 +17,7 @@ #include "e_menu.h" #include "e_icon.h" #include "e_box.h" +#include "e_entry.h" #include "e_init.h" #include "e_int_menus.h" #include "e_module.h" |
From: <enl...@li...> - 2005-09-25 13:13:04
|
Enlightenment CVS committal Author : codewarrior Project : e17 Module : apps/e Dir : e17/apps/e/src/bin Modified Files: e_dialog.c e_entry.c Log Message: Add glint effect to E_Dialog's button and add an "enter" signal for that. =================================================================== RCS file: /cvsroot/enlightenment/e17/apps/e/src/bin/e_dialog.c,v retrieving revision 1.18 retrieving revision 1.19 diff -u -3 -r1.18 -r1.19 --- e_dialog.c 24 Sep 2005 10:29:31 -0000 1.18 +++ e_dialog.c 25 Sep 2005 13:12:57 -0000 1.19 @@ -18,9 +18,11 @@ /* local subsystem functions */ static void _e_dialog_free(E_Dialog *dia); static void _e_dialog_cb_button_clicked(void *data, Evas_Object *obj, const char *emission, const char *source); +static void _e_dialog_button_cb_mouse_in(void *data, Evas *e, Evas_Object *obj, void *event); static void _e_dialog_cb_delete(E_Win *win); static void _e_dialog_cb_key_down(void *data, Evas *e, Evas_Object *obj, void *event); + /* local subsystem globals */ /* externally accessible functions */ @@ -111,6 +113,9 @@ edje_object_signal_callback_add(db->obj, "click", "", _e_dialog_cb_button_clicked, db); edje_object_part_text_set(db->obj, "button_text", db->label); + + evas_object_event_callback_add(db->obj, EVAS_CALLBACK_MOUSE_IN, _e_dialog_button_cb_mouse_in, dia); + if (icon) { db->obj_icon = edje_object_add(e_win_evas_get(dia->win)); @@ -245,6 +250,12 @@ e_object_del(E_OBJECT(db->dialog)); } +static void +_e_dialog_button_cb_mouse_in(void *data, Evas *e, Evas_Object *obj, void *event) +{ + edje_object_signal_emit(obj, "enter", ""); +} + /* TODO: Implement shift-tab and left arrow */ static void _e_dialog_cb_key_down(void *data, Evas *e, Evas_Object *obj, void *event) @@ -262,7 +273,7 @@ E_Dialog_Button *db; db = dia->focused->data; - edje_object_signal_emit(db->obj, "unfocus", ""); + edje_object_signal_emit(db->obj, "unfocus", ""); if (evas_key_modifier_is_set(evas_key_modifier_get(e_win_evas_get(dia->win)), "Shift")) { if (dia->focused->prev) dia->focused = dia->focused->prev; @@ -275,6 +286,8 @@ } db = evas_list_data(dia->focused); edje_object_signal_emit(db->obj, "focus", ""); + edje_object_signal_emit(db->obj, "enter", ""); + } else { @@ -284,6 +297,7 @@ db = dia->focused->data; edje_object_signal_emit(db->obj, "focus", ""); + edje_object_signal_emit(db->obj, "enter", ""); } } else if (((!strcmp(ev->keyname, "Return")) || =================================================================== RCS file: /cvsroot/enlightenment/e17/apps/e/src/bin/e_entry.c,v retrieving revision 1.1 retrieving revision 1.2 diff -u -3 -r1.1 -r1.2 --- e_entry.c 25 Sep 2005 03:28:18 -0000 1.1 +++ e_entry.c 25 Sep 2005 13:12:57 -0000 1.2 @@ -661,7 +661,9 @@ evas_object_smart_data_set(object, editable_text_sd); cursor = (Evas_Textblock_Cursor *)evas_object_textblock2_cursor_get(editable_text_sd->text_object); - evas_textblock2_cursor_node_first(cursor); + evas_textblock2_cursor_node_first(cursor); + + evas_font_path_append (evas, PACKAGE_DATA_DIR"/data/fonts"); } /* Called when the object is deleted */ |
From: <enl...@li...> - 2005-09-25 13:13:08
|
Enlightenment CVS committal Author : codewarrior Project : e17 Module : apps/e Dir : e17/apps/e/data/themes Modified Files: default_dialog.edc Log Message: Add glint effect to E_Dialog's button and add an "enter" signal for that. =================================================================== RCS file: /cvsroot/enlightenment/e17/apps/e/data/themes/default_dialog.edc,v retrieving revision 1.10 retrieving revision 1.11 diff -u -3 -r1.10 -r1.11 --- default_dialog.edc 24 Sep 2005 01:59:26 -0000 1.10 +++ default_dialog.edc 25 Sep 2005 13:12:57 -0000 1.11 @@ -453,6 +453,158 @@ } } } + part { + name: "glint_clip"; + type: RECT; + mouse_events: 0; + description { + state: "default" 0.0; + color: 255 255 255 255; + rel1 { + relative: 0.0 0.0; + offset: 3 3; + } + rel2 { + relative: 1.0 1.0; + offset: -4 -4; + } + } + } + part { + name: "glint1"; + mouse_events: 0; + description { + state: "default" 0.0; + visible: 0; + color: 255 255 255 0; + align: 0.0 0.0; + max: 34 13; + rel1 { + relative: 0.0 0.0; + offset: 2 2; + } + rel2 { + relative: 1.0 1.0; + offset: -3 -3; + } + image { + normal: "e17_titlebar_glint1.png"; + border: 5 0 5 0; + } + fill { + smooth: 0; + } + } + description { + state: "active" 0.0; + inherit: "default" 0.0; + visible: 1; + color: 255 255 255 255; + } + } + part { + name: "glint2"; + mouse_events: 0; + clip_to: "glint_clip"; + description { + state: "default" 0.0; + visible: 0; + color: 255 255 255 0; + align: 1.0 0.5; + max: 0 0; + rel1 { + relative: 0.0 0.0; + offset: 3 3; + } + rel2 { + relative: 0.0 1.0; + offset: 3 -4; + } + image { + normal: "e17_titlebar_glint2.png"; + border: 0 0 5 5; + } + fill { + smooth: 0; + } + } + description { + state: "active" 0.0; + inherit: "default" 0.0; + visible: 1; + color: 255 255 255 255; + max: 169 9999; + min: 169 8; + align: 0.5 0.5; + } + description { + state: "active2" 0.0; + inherit: "default" 0.0; + visible: 1; + color: 255 255 255 128; + max: 169 9999; + min: 169 8; + align: 0.5 0.5; + rel1 { + relative: 1.0 0.0; + offset: -4 3; + } + rel2 { + relative: 1.0 1.0; + offset: -4 -4; + } + } + description { + state: "active3" 0.0; + inherit: "default" 0.0; + visible: 0; + color: 255 255 255 0; + max: 169 9999; + min: 169 8; + align: 0.0 0.5; + rel1 { + relative: 1.0 0.0; + offset: -4 3; + } + rel2 { + relative: 1.0 1.0; + offset: -4 -4; + } + } + } + part { + name: "glint3"; + mouse_events: 0; + description { + state: "default" 0.0; + visible: 0; + color: 255 255 255 0; + align: 1.0 1.0; + max: 34 13; + rel1 { + relative: 0.0 0.0; + offset: 2 2; + } + rel2 { + relative: 1.0 1.0; + offset: -3 -3; + } + image { + normal: "e17_titlebar_glint3.png"; + border: 0 5 0 5; + } + fill { + smooth: 0; + } + } + description { + state: "active" 0.0; + inherit: "default" 0.0; + visible: 1; + color: 255 255 255 255; + } + } + FOCUS_RECT(0.0, 0.0, 1.0, 1.0, 7, 7, -8, -8) } programs { @@ -483,6 +635,57 @@ action: STATE_SET "visible" 0.0; target: "icon_swallow"; } + program { + name: "button_enter"; + signal: "enter"; + source: ""; + script { + run_program(PROGRAM:"go_active"); + } + } + program { + name: "go_active"; + action: STATE_SET "active" 0.0; + target: "glint1"; + target: "glint2"; + transition: LINEAR 0.05; + after: "go_active2"; + after: "go_active2b"; + } + program { + name: "go_active2"; + action: STATE_SET "active2" 0.0; + target: "glint2"; + transition: LINEAR 0.2; + after: "go_active3"; + after: "go_active3b"; + } + program { + name: "go_active2b"; + action: STATE_SET "active" 0.0; + target: "glint3"; + transition: LINEAR 0.2; + } + program { + name: "go_active3"; + action: STATE_SET "active3" 0.0; + target: "glint2"; + transition: LINEAR 0.05; + } + program { + name: "go_active3b"; + action: STATE_SET "default" 0.0; + target: "glint3"; + transition: LINEAR 0.1; + after: "go_active4"; + } + program { + name: "go_active4"; + action: STATE_SET "default" 0.0; + target: "glint1"; + target: "glint2"; + target: "glint3"; + } program { name: "button_focus"; signal: "focus"; |
From: <enl...@li...> - 2005-09-25 21:33:54
|
Enlightenment CVS committal Author : codewarrior Project : e17 Module : apps/e Dir : e17/apps/e/src/bin Modified Files: e_actions.c e_dialog.c e_entry.c Log Message: Add ability to focus a button in an E_Dialog by either its number or a pointer to it. When we click a button we need to send a focus signal to it. =================================================================== RCS file: /cvsroot/enlightenment/e17/apps/e/src/bin/e_actions.c,v retrieving revision 1.30 retrieving revision 1.31 diff -u -3 -r1.30 -r1.31 --- e_actions.c 24 Sep 2005 02:49:55 -0000 1.30 +++ e_actions.c 25 Sep 2005 21:33:48 -0000 1.31 @@ -1131,7 +1131,7 @@ e_dialog_icon_set(dia, "enlightenment/exit", 64); e_dialog_button_add(dia, _("Yes"), NULL, _e_actions_cb_exit_dialog_ok, NULL); e_dialog_button_add(dia, _("No"), NULL, NULL, NULL); - e_dialog_button_focus(dia, 1); + e_dialog_button_focus_num(dia, 1); e_win_centered_set(dia->win, 1); e_dialog_show(dia); } =================================================================== RCS file: /cvsroot/enlightenment/e17/apps/e/src/bin/e_dialog.c,v retrieving revision 1.19 retrieving revision 1.20 diff -u -3 -r1.19 -r1.20 --- e_dialog.c 25 Sep 2005 13:12:57 -0000 1.19 +++ e_dialog.c 25 Sep 2005 21:33:48 -0000 1.20 @@ -19,6 +19,7 @@ static void _e_dialog_free(E_Dialog *dia); static void _e_dialog_cb_button_clicked(void *data, Evas_Object *obj, const char *emission, const char *source); static void _e_dialog_button_cb_mouse_in(void *data, Evas *e, Evas_Object *obj, void *event); +static void _e_dialog_button_cb_mouse_down(void *data, Evas *e, Evas_Object *obj, void *event); static void _e_dialog_cb_delete(E_Win *win); static void _e_dialog_cb_key_down(void *data, Evas *e, Evas_Object *obj, void *event); @@ -115,6 +116,7 @@ edje_object_part_text_set(db->obj, "button_text", db->label); evas_object_event_callback_add(db->obj, EVAS_CALLBACK_MOUSE_IN, _e_dialog_button_cb_mouse_in, dia); + evas_object_event_callback_add(db->obj, EVAS_CALLBACK_MOUSE_DOWN, _e_dialog_button_cb_mouse_down, db); if (icon) { @@ -141,13 +143,17 @@ } int -e_dialog_button_focus(E_Dialog *dia, int button) +e_dialog_button_focus_num(E_Dialog *dia, int button) { E_Dialog_Button *db = NULL; + + if (button < 0) + return 0; db = evas_list_nth(dia->buttons, button); - - if (!db) return 0; + + if (!db) + return 0; if (dia->focused) { @@ -164,6 +170,34 @@ return 1; } +int +e_dialog_button_focus_button(E_Dialog *dia, E_Dialog_Button *button) +{ + E_Dialog_Button *db = NULL; + + if (!button) + return 0; + + db = evas_list_find(dia->buttons, button); + + if (!db) + return 0; + + if (dia->focused) + { + E_Dialog_Button *focused; + + focused = dia->focused->data; + if (focused) + edje_object_signal_emit(focused->obj, "unfocus", ""); + } + + dia->focused = evas_list_find_list(dia->buttons, button); + edje_object_signal_emit(db->obj, "focus", ""); + + return 1; +} + void e_dialog_title_set(E_Dialog *dia, char *title) { @@ -244,8 +278,11 @@ E_Dialog_Button *db; db = data; - if (db->func) - db->func(db->data, db->dialog); + if (db->func) + { + edje_object_signal_emit(db->obj, "focus", ""); + db->func(db->data, db->dialog); + } else e_object_del(E_OBJECT(db->dialog)); } @@ -256,6 +293,18 @@ edje_object_signal_emit(obj, "enter", ""); } +static void +_e_dialog_button_cb_mouse_down(void *data, Evas *e, Evas_Object *obj, void *event) +{ + E_Dialog *dia; + E_Dialog_Button *db; + + db = data; + dia = db->dialog; + + e_dialog_button_focus_button(dia, db); +} + /* TODO: Implement shift-tab and left arrow */ static void _e_dialog_cb_key_down(void *data, Evas *e, Evas_Object *obj, void *event) =================================================================== RCS file: /cvsroot/enlightenment/e17/apps/e/src/bin/e_entry.c,v retrieving revision 1.2 retrieving revision 1.3 diff -u -3 -r1.2 -r1.3 --- e_entry.c 25 Sep 2005 13:12:57 -0000 1.2 +++ e_entry.c 25 Sep 2005 21:33:48 -0000 1.3 @@ -124,8 +124,7 @@ E_Entry_Smart_Data *e_entry_sd; if (!object || !(e_entry_sd = evas_object_smart_data_get(object))) - return; - + return; } static void _e_entry_smart_raise(Evas_Object *object) @@ -133,7 +132,9 @@ E_Entry_Smart_Data *e_entry_sd; if (!object || !(e_entry_sd = evas_object_smart_data_get(object))) - return; + return; + + evas_object_raise(e_entry_sd->edje_object); } static void _e_entry_smart_lower(Evas_Object *object) @@ -141,7 +142,9 @@ E_Entry_Smart_Data *e_entry_sd; if (!object || !(e_entry_sd = evas_object_smart_data_get(object))) - return; + return; + + evas_object_lower(e_entry_sd->edje_object); } static void _e_entry_smart_stack_above(Evas_Object *object, Evas_Object *above) @@ -150,6 +153,8 @@ if (!object || !(e_entry_sd = evas_object_smart_data_get(object))) return; + + evas_object_stack_above(e_entry_sd->edje_object, above); } static void _e_entry_smart_stack_below(Evas_Object *object, Evas_Object *below) @@ -157,7 +162,9 @@ E_Entry_Smart_Data *e_entry_sd; if (!object || !(e_entry_sd = evas_object_smart_data_get(object))) - return; + return; + + evas_object_stack_below(e_entry_sd->edje_object, below); } static void _e_entry_smart_move(Evas_Object *object, Evas_Coord x, Evas_Coord y) @@ -196,6 +203,8 @@ if (!object || !(e_entry_sd = evas_object_smart_data_get(object))) return; + + evas_object_hide (e_entry_sd->edje_object); } /* Called when the user presses a key */ @@ -226,9 +235,6 @@ e_editable_text_insert(obj, key_event->string); } - - - Evas_Object *e_editable_text_add(Evas *evas) { Evas_Object *o; |
From: <enl...@li...> - 2005-10-02 23:35:58
|
Enlightenment CVS committal Author : codewarrior Project : e17 Module : apps/e Dir : e17/apps/e/src/bin Modified Files: e_entry.c e_entry.h Log Message: Fix and expose more of the e_entry api. it works now. =================================================================== RCS file: /cvsroot/enlightenment/e17/apps/e/src/bin/e_entry.c,v retrieving revision 1.4 retrieving revision 1.5 diff -u -3 -r1.4 -r1.5 --- e_entry.c 29 Sep 2005 15:01:04 -0000 1.4 +++ e_entry.c 1 Oct 2005 01:25:07 -0000 1.5 @@ -91,6 +91,117 @@ return evas_object_smart_add(evas, e_entry_smart); } +void +e_entry_text_set (Evas_Object *entry, const char *text) +{ + E_Entry_Smart_Data *e_entry_sd; + + if (!entry || !(e_entry_sd = evas_object_smart_data_get(entry))) + return; + + e_editable_text_text_set (e_entry_sd->entry_object, text); +} + +void +e_entry_text_insert (Evas_Object *entry, const char *text) +{ + E_Entry_Smart_Data *e_entry_sd; + + if (!entry || !(e_entry_sd = evas_object_smart_data_get(entry))) + return; + + e_editable_text_insert (e_entry_sd->entry_object, text); +} + +void +e_entry_delete_char_before(Evas_Object *entry) +{ + E_Entry_Smart_Data *e_entry_sd; + + if (!entry || !(e_entry_sd = evas_object_smart_data_get(entry))) + return; + + e_editable_text_delete_char_before (e_entry_sd->entry_object); +} + +void +e_entry_delete_char_after(Evas_Object *entry) +{ + E_Entry_Smart_Data *e_entry_sd; + + if (!entry || !(e_entry_sd = evas_object_smart_data_get(entry))) + return; + + e_editable_text_delete_char_after (e_entry_sd->entry_object); +} + +void +e_entry_cursor_move_at_start(Evas_Object *entry) +{ + E_Entry_Smart_Data *e_entry_sd; + + if (!entry || !(e_entry_sd = evas_object_smart_data_get(entry))) + return; + + e_editable_text_cursor_move_at_start (e_entry_sd->entry_object); +} + +void +e_entry_cursor_move_at_end(Evas_Object *entry) + { + E_Entry_Smart_Data *e_entry_sd; + + if (!entry || !(e_entry_sd = evas_object_smart_data_get(entry))) + return; + + e_editable_text_cursor_move_at_end (e_entry_sd->entry_object); +} + +void +e_entry_cursor_move_left(Evas_Object *entry) +{ + E_Entry_Smart_Data *e_entry_sd; + + if (!entry || !(e_entry_sd = evas_object_smart_data_get(entry))) + return; + + e_editable_text_cursor_move_left (e_entry_sd->entry_object); +} + +void +e_entry_cursor_move_right(Evas_Object *entry) + { + E_Entry_Smart_Data *e_entry_sd; + + if (!entry || !(e_entry_sd = evas_object_smart_data_get(entry))) + return; + + e_editable_text_cursor_move_right (e_entry_sd->entry_object); +} + +void +e_entry_cursor_show(Evas_Object *entry) +{ + E_Entry_Smart_Data *e_entry_sd; + + if (!entry || !(e_entry_sd = evas_object_smart_data_get(entry))) + return; + + e_editable_text_cursor_show (e_entry_sd->entry_object); +} + +void +e_entry_cursor_hide(Evas_Object *entry) +{ + E_Entry_Smart_Data *e_entry_sd; + + if (!entry || !(e_entry_sd = evas_object_smart_data_get(entry))) + return; + + e_editable_text_cursor_hide (e_entry_sd->entry_object); +} + + static void _e_entry_smart_add(Evas_Object *object) { Evas *evas; @@ -122,7 +233,11 @@ E_Entry_Smart_Data *e_entry_sd; if (!object || !(e_entry_sd = evas_object_smart_data_get(object))) - return; + return; + + evas_object_del (e_entry_sd->entry_object); + evas_object_del (e_entry_sd->edje_object); + E_FREE (e_entry_sd); } static void _e_entry_smart_raise(Evas_Object *object) =================================================================== RCS file: /cvsroot/enlightenment/e17/apps/e/src/bin/e_entry.h,v retrieving revision 1.1 retrieving revision 1.2 diff -u -3 -r1.1 -r1.2 --- e_entry.h 25 Sep 2005 03:28:18 -0000 1.1 +++ e_entry.h 1 Oct 2005 01:25:07 -0000 1.2 @@ -17,3 +17,16 @@ void e_editable_text_cursor_hide(Evas_Object *object); Evas_Object *e_entry_add(Evas *evas); +void e_entry_text_set (Evas_Object *entry, const char *text); +void e_entry_text_insert (Evas_Object *entry, const char *text); +void e_entry_delete_char_before(Evas_Object *object); +void e_entry_delete_char_after(Evas_Object *object); +void e_entry_cursor_move_at_start(Evas_Object *object); +void e_entry_cursor_move_at_end(Evas_Object *object); +void e_entry_cursor_move_left(Evas_Object *object); +void e_entry_cursor_move_right(Evas_Object *object); +void e_entry_cursor_show(Evas_Object *object); +void e_entry_cursor_hide(Evas_Object *object); + + + |
From: <enl...@li...> - 2005-10-04 01:33:03
|
Enlightenment CVS committal Author : codewarrior Project : e17 Module : apps/e Dir : e17/apps/e/src/bin Modified Files: Makefile.am Added Files: e_scrollbar.c e_scrollbar.h Log Message: e_scrollbar smart. needs callbacks. =================================================================== RCS file: /cvsroot/enlightenment/e17/apps/e/src/bin/Makefile.am,v retrieving revision 1.49 retrieving revision 1.50 diff -u -3 -r1.49 -r1.50 --- Makefile.am 25 Sep 2005 04:58:18 -0000 1.49 +++ Makefile.am 4 Oct 2005 01:32:50 -0000 1.50 @@ -78,7 +78,8 @@ e_about.h \ e_theme_about.h \ e_apps_cache.h \ -e_entry.h +e_entry.h \ +e_scrollbar.h enlightenment_src = \ e_user.c \ @@ -140,6 +141,7 @@ e_theme_about.c \ e_apps_cache.c \ e_entry.c \ +e_scrollbar.c \ $(ENLIGHTENMENTHEADERS) enlightenment_SOURCES = \ |
From: <enl...@li...> - 2005-10-04 01:34:06
|
Enlightenment CVS committal Author : codewarrior Project : e17 Module : apps/e Dir : e17/apps/e/data/themes Modified Files: default.edc Added Files: default_scrollbar.edc Log Message: e_scrollbar smart. needs callbacks. =================================================================== RCS file: /cvsroot/enlightenment/e17/apps/e/data/themes/default.edc,v retrieving revision 1.45 retrieving revision 1.46 diff -u -3 -r1.45 -r1.46 --- default.edc 25 Sep 2005 03:28:17 -0000 1.45 +++ default.edc 4 Oct 2005 01:33:59 -0000 1.46 @@ -46,6 +46,7 @@ #include "default_pointer.edc" #include "default_about.edc" #include "default_theme_about.edc" -#include "default_entry.edc" +#include "default_entry.edc" +#include "default_scrollbar.edc" } |
From: <enl...@li...> - 2005-10-04 01:34:07
|
Enlightenment CVS committal Author : codewarrior Project : e17 Module : apps/e Dir : e17/apps/e/data/themes/images Added Files: e17_hscrollbar_trough.png e17_scrollbar_bottom_arrow_down.png e17_scrollbar_bottom_arrow.png e17_scrollbar_left_arrow_down.png e17_scrollbar_left_arrow.png e17_scrollbar_right_arrow_down.png e17_scrollbar_right_arrow.png e17_scrollbar_top_arrow_down.png e17_scrollbar_top_arrow.png e17_vscrollbar_trough.png e17_hhandle_down.png e17_hhandle.png e17_hhandle_thumb.png e17_vhandle_down.png e17_vhandle.png e17_vhandle_thumb.png Log Message: e_scrollbar smart. needs callbacks. |
From: <enl...@li...> - 2005-10-04 10:14:15
|
Enlightenment CVS committal Author : codewarrior Project : e17 Module : apps/e Dir : e17/apps/e Modified Files: TODO Log Message: e_win move / resize flicker problem =================================================================== RCS file: /cvsroot/enlightenment/e17/apps/e/TODO,v retrieving revision 1.272 retrieving revision 1.273 diff -u -3 -r1.272 -r1.273 --- TODO 28 Sep 2005 17:03:12 -0000 1.272 +++ TODO 4 Oct 2005 10:13:59 -0000 1.273 @@ -8,6 +8,8 @@ BUGS / FIXES ------------------------------------------------------------------------------- +* BUG: when moving e_win its resize callbacks get called with alternating + width and height (this is why we have flickering in the conf panel) * BUG: dnd to ibar is broken if u did an icon that isn't IN the ibar yet (from a window border) to either the very start or end of the ibar. * BUG: some bug if u flip desktops fast enough window s vanish (how the hell |
From: <enl...@li...> - 2005-10-04 21:32:25
|
Enlightenment CVS committal Author : codewarrior Project : e17 Module : apps/e Dir : e17/apps/e/src/bin Modified Files: e_entry.c e_entry.h e_scrollbar.c e_scrollbar.h Log Message: * Add function to get text from e_entry * Fix typo in e_scrollbar =================================================================== RCS file: /cvsroot/enlightenment/e17/apps/e/src/bin/e_entry.c,v retrieving revision 1.6 retrieving revision 1.7 diff -u -3 -r1.6 -r1.7 --- e_entry.c 4 Oct 2005 12:15:54 -0000 1.6 +++ e_entry.c 4 Oct 2005 21:32:19 -0000 1.7 @@ -5,13 +5,9 @@ /* * TODO: - * - get text - * - review everything, was sleepy when i wrote this - * - look at theme / how its being set * - implement missing _e_entry_smart_*, very easy * - free / delete properly * - implement focus and interact with theme - * - e style */ typedef struct _E_Editable_Text_Smart_Data E_Editable_Text_Smart_Data; @@ -96,6 +92,19 @@ return evas_object_smart_add(evas, e_editable_text_smart); } +const char* +e_editable_text_text_get(Evas_Object *object) +{ + E_Editable_Text_Smart_Data *editable_text_sd; + Evas_Textblock_Cursor *cursor; + + if ((!object) || !(editable_text_sd = evas_object_smart_data_get(object))) + return; + + cursor = (Evas_Textblock_Cursor *)evas_object_textblock2_cursor_get(editable_text_sd->text_object); + return evas_textblock2_cursor_node_text_get(cursor); +} + /** * @brief Sets the text of the object * @param object an editable text object @@ -109,7 +118,6 @@ if ((!object) || (!text) || !(editable_text_sd = evas_object_smart_data_get(object))) return; - printf("Text set: %s\n", text); evas_object_textblock2_text_markup_set(editable_text_sd->text_object, text); editable_text_sd->cursor_at_the_end = 1; _e_editable_text_size_update(object); @@ -353,6 +361,17 @@ e_editable_text_text_set(e_entry_sd->entry_object, text); } +const char* +e_entry_text_get(Evas_Object *entry) +{ + E_Entry_Smart_Data *e_entry_sd; + + if ((!entry) || !(e_entry_sd = evas_object_smart_data_get(entry))) + return; + + return e_editable_text_text_get(e_entry_sd->entry_object); +} + void e_entry_text_insert(Evas_Object *entry, const char *text) { =================================================================== RCS file: /cvsroot/enlightenment/e17/apps/e/src/bin/e_entry.h,v retrieving revision 1.3 retrieving revision 1.4 diff -u -3 -r1.3 -r1.4 --- e_entry.h 4 Oct 2005 12:15:54 -0000 1.3 +++ e_entry.h 4 Oct 2005 21:32:19 -0000 1.4 @@ -9,6 +9,7 @@ EAPI Evas_Object *e_editable_text_add(Evas *evas); EAPI void e_editable_text_text_set(Evas_Object *object, const char *text); +EAPI const char *e_entry_text_get(Evas_Object *object); EAPI void e_editable_text_insert(Evas_Object *object, const char *text); EAPI void e_editable_text_delete_char_before(Evas_Object *object); @@ -24,6 +25,7 @@ EAPI Evas_Object *e_entry_add(Evas *evas); EAPI void e_entry_text_set (Evas_Object *entry, const char *text); +EAPI const char* e_editable_text_text_get(Evas_Object *object); EAPI void e_entry_text_insert (Evas_Object *entry, const char *text); EAPI void e_entry_delete_char_before(Evas_Object *object); EAPI void e_entry_delete_char_after(Evas_Object *object); =================================================================== RCS file: /cvsroot/enlightenment/e17/apps/e/src/bin/e_scrollbar.c,v retrieving revision 1.2 retrieving revision 1.3 diff -u -3 -r1.2 -r1.3 --- e_scrollbar.c 4 Oct 2005 12:15:54 -0000 1.2 +++ e_scrollbar.c 4 Oct 2005 21:32:19 -0000 1.3 @@ -74,7 +74,7 @@ switch (dir) { - case E_SCROLLBAR_HORISONTAL: + case E_SCROLLBAR_HORIZONTAL: e_theme_edje_object_set(scrollbar_sd->edje_object, "base/theme/widgets/hscrollbar", "widgets/hscrollbar"); @@ -94,7 +94,7 @@ E_Scrollbar_Smart_Data *scrollbar_sd; if ((!object) || !(scrollbar_sd = evas_object_smart_data_get(object))) - return E_SCROLLBAR_HORISONTAL; + return E_SCROLLBAR_HORIZONTAL; return scrollbar_sd->direction; } @@ -122,7 +122,7 @@ "base/theme/widgets/hscrollbar", "widgets/hscrollbar"); - scrollbar_sd->direction = E_SCROLLBAR_HORISONTAL; + scrollbar_sd->direction = E_SCROLLBAR_HORIZONTAL; evas_object_smart_member_add(scrollbar_sd->edje_object, object); =================================================================== RCS file: /cvsroot/enlightenment/e17/apps/e/src/bin/e_scrollbar.h,v retrieving revision 1.2 retrieving revision 1.3 diff -u -3 -r1.2 -r1.3 --- e_scrollbar.h 4 Oct 2005 12:15:54 -0000 1.2 +++ e_scrollbar.h 4 Oct 2005 21:32:19 -0000 1.3 @@ -5,7 +5,7 @@ typedef enum _E_Scrollbar_Direction { - E_SCROLLBAR_HORISONTAL, + E_SCROLLBAR_HORIZONTAL, E_SCROLLBAR_VERTICAL } E_Scrollbar_Direction; |
From: <enl...@li...> - 2005-10-05 00:40:13
|
Enlightenment CVS committal Author : codewarrior Project : e17 Module : apps/e Dir : e17/apps/e/src/bin Modified Files: e_scrollbar.c e_scrollbar.h Log Message: More scrollbar work (callbacks and accessors). there's a problem with getting the values. FIXME included. =================================================================== RCS file: /cvsroot/enlightenment/e17/apps/e/src/bin/e_scrollbar.c,v retrieving revision 1.3 retrieving revision 1.4 diff -u -3 -r1.3 -r1.4 --- e_scrollbar.c 4 Oct 2005 21:32:19 -0000 1.3 +++ e_scrollbar.c 5 Oct 2005 00:40:06 -0000 1.4 @@ -16,11 +16,14 @@ Evas_Object *edje_object; struct { - double min; - double max; + double min; + double max; + double current; } value; - + E_Scrollbar_Direction direction; + + Evas_List *callbacks; }; static void _e_scrollbar_smart_add(Evas_Object *object); @@ -33,7 +36,8 @@ static void _e_scrollbar_smart_resize(Evas_Object *object, Evas_Coord w, Evas_Coord h); static void _e_scrollbar_smart_show(Evas_Object *object); static void _e_scrollbar_smart_hide(Evas_Object *object); - +static void _e_scrollbar_drag_cb (void *data, Evas_Object *object, const char *emission, const char *source); + static Evas_Smart *e_scrollbar_smart = NULL; Evas_Object * @@ -99,6 +103,104 @@ return scrollbar_sd->direction; } +void +e_scrollbar_callback_drag_add (Evas_Object *object, void (*func) (Evas_Object *obj, double value, void *data), void *data) +{ + E_Scrollbar_Smart_Data *scrollbar_sd; + E_Scrollbar_Drag_Handler *handler; + + if ((!object) || !(scrollbar_sd = evas_object_smart_data_get(object))) + return; + + handler = E_NEW(E_Scrollbar_Drag_Handler, 1); + + handler->data = data; + handler->cb.drag = func; + + scrollbar_sd->callbacks = evas_list_append(scrollbar_sd->callbacks, handler); +} + +void +e_scrollbar_value_set (Evas_Object *object, double value) +{ + E_Scrollbar_Smart_Data *scrollbar_sd; + + if ((!object) || !(scrollbar_sd = evas_object_smart_data_get(object))) + return; + + scrollbar_sd->value.current = value; + + if (scrollbar_sd->direction == E_SCROLLBAR_HORIZONTAL) + edje_object_part_drag_value_set (scrollbar_sd->edje_object, "drag", value, 0); + else + edje_object_part_drag_value_set (scrollbar_sd->edje_object, "drag", 0, value); +} + +double +e_scrollbar_value_get (Evas_Object *object) +{ + E_Scrollbar_Smart_Data *scrollbar_sd; + double dx, dy; + + if ((!object) || !(scrollbar_sd = evas_object_smart_data_get(object))) + return; + + /* FIXME: + * we have a problem here. if we printf the dx and dy we get 0 + */ + + edje_object_part_drag_value_get (scrollbar_sd->edje_object, "drag", &dx, &dy); + + if (scrollbar_sd->direction == E_SCROLLBAR_HORIZONTAL) + scrollbar_sd->value.current = dx; + else + scrollbar_sd->value.current = dy; + + return scrollbar_sd->value.current; +} + +void +e_scrollbar_increments_set (Evas_Object *object, double step, double page) +{ + E_Scrollbar_Smart_Data *scrollbar_sd; + + if ((!object) || !(scrollbar_sd = evas_object_smart_data_get(object))) + return; + + if (scrollbar_sd->direction == E_SCROLLBAR_HORIZONTAL) + { + edje_object_part_drag_step_set (scrollbar_sd->edje_object, "drag", step, 0); + edje_object_part_drag_page_set (scrollbar_sd->edje_object, "drag", page, 0); + } else { + edje_object_part_drag_step_set (scrollbar_sd->edje_object, "drag", 0, step); + edje_object_part_drag_page_set (scrollbar_sd->edje_object, "drag", 0, page); + } +} + +void +e_scrollbar_increments_get (Evas_Object *object, double *step, double *page) +{ + E_Scrollbar_Smart_Data *scrollbar_sd; + double stepx; double stepy; + double pagex; double pagey; + + if ((!object) || !(scrollbar_sd = evas_object_smart_data_get(object))) + return; + + edje_object_part_drag_step_get (scrollbar_sd->edje_object, "drag", &stepx, &stepy); + edje_object_part_drag_page_get (scrollbar_sd->edje_object, "drag", &pagex, &pagey); + + if (scrollbar_sd->direction == E_SCROLLBAR_HORIZONTAL) + { + *step = stepx; + *page = pagex; + } else { + *step = stepy; + *page = pagey; + } +} + + /************************** * Private functions **************************/ @@ -116,14 +218,14 @@ if (!scrollbar_sd) return; scrollbar_sd->value.min = 0.0; scrollbar_sd->value.max = 1.0; - + scrollbar_sd->callbacks = NULL; + scrollbar_sd->direction = E_SCROLLBAR_HORIZONTAL; scrollbar_sd->edje_object = edje_object_add(evas); e_theme_edje_object_set(scrollbar_sd->edje_object, "base/theme/widgets/hscrollbar", "widgets/hscrollbar"); - - scrollbar_sd->direction = E_SCROLLBAR_HORIZONTAL; - + edje_object_signal_callback_add(scrollbar_sd->edje_object, "drag", "*", _e_scrollbar_drag_cb, scrollbar_sd); + evas_object_data_set (scrollbar_sd->edje_object, "smart", object); evas_object_smart_member_add(scrollbar_sd->edje_object, object); evas_object_smart_data_set(object, scrollbar_sd); @@ -233,3 +335,27 @@ evas_object_hide(scrollbar_sd->edje_object); } +static void +_e_scrollbar_drag_cb (void *data, Evas_Object *object, const char *emission, const char *source) +{ + E_Scrollbar_Smart_Data *scrollbar_sd; + Evas_Object *smart_object; + Evas_List *l; + + if ((!object) || !(smart_object = evas_object_data_get(object, "smart"))) + return; + + scrollbar_sd = evas_object_smart_data_get(smart_object); + if (!scrollbar_sd) + return; + + scrollbar_sd->value.current = e_scrollbar_value_get (object); + + for (l = scrollbar_sd->callbacks; l; l = l->next) + { + E_Scrollbar_Drag_Handler *handler; + + handler = l->data; + handler->cb.drag (smart_object, scrollbar_sd->value.current, handler->data); + } +} =================================================================== RCS file: /cvsroot/enlightenment/e17/apps/e/src/bin/e_scrollbar.h,v retrieving revision 1.4 retrieving revision 1.5 diff -u -3 -r1.4 -r1.5 --- e_scrollbar.h 4 Oct 2005 22:53:27 -0000 1.4 +++ e_scrollbar.h 5 Oct 2005 00:40:06 -0000 1.5 @@ -3,20 +3,35 @@ */ #ifdef E_TYPEDEFS -typedef enum _E_Scrollbar_Direction -{ - E_SCROLLBAR_HORIZONTAL, - E_SCROLLBAR_VERTICAL -} E_Scrollbar_Direction; +typedef struct _E_Scrollbar_Drag_Handler E_Scrollbar_Drag_Handler; +typedef enum _E_Scrollbar_Direction E_Scrollbar_Direction; #else #ifndef E_SCROLLBAR_H #define E_SCROLLBAR_H +struct _E_Scrollbar_Drag_Handler +{ + void *data; + struct { + void (*drag)(Evas_Object *obj, double value, void *data); + } cb; +}; + +enum _E_Scrollbar_Direction +{ + E_SCROLLBAR_HORIZONTAL, + E_SCROLLBAR_VERTICAL +}; + EAPI Evas_Object *e_scrollbar_add(Evas *evas); -EAPI void e_scrollbar_direction_set(Evas_Object *object, - E_Scrollbar_Direction dir); +EAPI void e_scrollbar_direction_set(Evas_Object *object, E_Scrollbar_Direction dir); EAPI E_Scrollbar_Direction e_scrollbar_direction_get(Evas_Object *object); +EAPI void e_scrollbar_callback_drag_add (Evas_Object *object, void (*func)(Evas_Object *obj, double value, void *data), void *data); +EAPI void e_scrollbar_value_set (Evas_Object *object, double value); +EAPI double e_scrollbar_value_get (Evas_Object *object); +EAPI void e_scrollbar_increments_set (Evas_Object *object, double step, double page); +EAPI void e_scrollbar_increments_get (Evas_Object *object, double *step, double *page); #endif #endif |
From: <enl...@li...> - 2005-10-06 22:35:27
|
Enlightenment CVS committal Author : codewarrior Project : e17 Module : apps/e Dir : e17/apps/e/src/bin Modified Files: e_scrollbar.c e_scrollbar.h Log Message: Some fixes for getting values and setting direction. =================================================================== RCS file: /cvsroot/enlightenment/e17/apps/e/src/bin/e_scrollbar.c,v retrieving revision 1.5 retrieving revision 1.6 diff -u -3 -r1.5 -r1.6 --- e_scrollbar.c 5 Oct 2005 12:31:22 -0000 1.5 +++ e_scrollbar.c 6 Oct 2005 22:35:21 -0000 1.6 @@ -68,48 +68,50 @@ void e_scrollbar_direction_set(Evas_Object *object, E_Scrollbar_Direction dir) { - E_Scrollbar_Smart_Data *scrollbar_sd; + E_Scrollbar_Smart_Data *sd; - if ((!object) || !(scrollbar_sd = evas_object_smart_data_get(object))) + if ((!object) || !(sd = evas_object_smart_data_get(object))) return; - if (scrollbar_sd->direction == dir) + if (sd->direction == dir) return; switch (dir) { case E_SCROLLBAR_HORIZONTAL: - e_theme_edje_object_set(scrollbar_sd->edje_object, - "base/theme/widgets/hscrollbar", - "widgets/hscrollbar"); - break; + e_theme_edje_object_set(sd->edje_object, + "base/theme/widgets/hscrollbar", + "widgets/hscrollbar"); + sd->direction = dir; + break; case E_SCROLLBAR_VERTICAL: - e_theme_edje_object_set(scrollbar_sd->edje_object, - "base/theme/widgets/vscrollbar", - "widgets/vscrollbar"); - break; + e_theme_edje_object_set(sd->edje_object, + "base/theme/widgets/vscrollbar", + "widgets/vscrollbar"); + sd->direction = dir; + break; } } E_Scrollbar_Direction e_scrollbar_direction_get(Evas_Object *object) { - E_Scrollbar_Smart_Data *scrollbar_sd; + E_Scrollbar_Smart_Data *sd; - if ((!object) || !(scrollbar_sd = evas_object_smart_data_get(object))) + if ((!object) || !(sd = evas_object_smart_data_get(object))) return E_SCROLLBAR_HORIZONTAL; - return scrollbar_sd->direction; + return sd->direction; } void e_scrollbar_callback_drag_add(Evas_Object *object, void (*func)(Evas_Object *obj, double value, void *data), void *data) { - E_Scrollbar_Smart_Data *scrollbar_sd; + E_Scrollbar_Smart_Data *sd; E_Scrollbar_Drag_Handler *handler; - if ((!object) || !(scrollbar_sd = evas_object_smart_data_get(object))) + if ((!object) || !(sd = evas_object_smart_data_get(object))) return; handler = E_NEW(E_Scrollbar_Drag_Handler, 1); @@ -117,80 +119,76 @@ handler->data = data; handler->cb.drag = func; - scrollbar_sd->callbacks = evas_list_append(scrollbar_sd->callbacks, handler); + sd->callbacks = evas_list_append(sd->callbacks, handler); } void e_scrollbar_value_set(Evas_Object *object, double value) { - E_Scrollbar_Smart_Data *scrollbar_sd; + E_Scrollbar_Smart_Data *sd; - if ((!object) || !(scrollbar_sd = evas_object_smart_data_get(object))) + if ((!object) || !(sd = evas_object_smart_data_get(object))) return; - scrollbar_sd->value.current = value; + sd->value.current = value; - if (scrollbar_sd->direction == E_SCROLLBAR_HORIZONTAL) - edje_object_part_drag_value_set(scrollbar_sd->edje_object, "drag", value, 0); + if (sd->direction == E_SCROLLBAR_HORIZONTAL) + edje_object_part_drag_value_set(sd->edje_object, "drag", value, 0); else - edje_object_part_drag_value_set(scrollbar_sd->edje_object, "drag", 0, value); + edje_object_part_drag_value_set(sd->edje_object, "drag", 0, value); } double e_scrollbar_value_get(Evas_Object *object) { - E_Scrollbar_Smart_Data *scrollbar_sd; + E_Scrollbar_Smart_Data *sd; double dx, dy; - if ((!object) || !(scrollbar_sd = evas_object_smart_data_get(object))) + if ((!object) || !(sd = evas_object_smart_data_get(object))) return 0.0; - - /* FIXME: - * we have a problem here. if we printf the dx and dy we get 0 - */ - edje_object_part_drag_value_get(scrollbar_sd->edje_object, "drag", &dx, &dy); + edje_object_part_drag_value_get(sd->edje_object, "drag", &dx, &dy); - if (scrollbar_sd->direction == E_SCROLLBAR_HORIZONTAL) - scrollbar_sd->value.current = dx; + if (sd->direction == E_SCROLLBAR_HORIZONTAL) + sd->value.current = dx; else - scrollbar_sd->value.current = dy; + sd->value.current = dy; - return scrollbar_sd->value.current; + return sd->value.current; } void e_scrollbar_increments_set(Evas_Object *object, double step, double page) { - E_Scrollbar_Smart_Data *scrollbar_sd; + E_Scrollbar_Smart_Data *sd; - if ((!object) || !(scrollbar_sd = evas_object_smart_data_get(object))) + if ((!object) || !(sd = evas_object_smart_data_get(object))) return; - if (scrollbar_sd->direction == E_SCROLLBAR_HORIZONTAL) + if (sd->direction == E_SCROLLBAR_HORIZONTAL) { - edje_object_part_drag_step_set(scrollbar_sd->edje_object, "drag", step, 0); - edje_object_part_drag_page_set(scrollbar_sd->edje_object, "drag", page, 0); + edje_object_part_drag_step_set(sd->edje_object, "drag", step, 0); + edje_object_part_drag_page_set(sd->edje_object, "drag", page, 0); } else { - edje_object_part_drag_step_set(scrollbar_sd->edje_object, "drag", 0, step); - edje_object_part_drag_page_set(scrollbar_sd->edje_object, "drag", 0, page); + edje_object_part_drag_step_set(sd->edje_object, "drag", 0, step); + edje_object_part_drag_page_set(sd->edje_object, "drag", 0, page); } } void e_scrollbar_increments_get(Evas_Object *object, double *step, double *page) { - E_Scrollbar_Smart_Data *scrollbar_sd; + E_Scrollbar_Smart_Data *sd; double stepx; double stepy; double pagex; double pagey; - if ((!object) || !(scrollbar_sd = evas_object_smart_data_get(object))) + if ((!object) || !(sd = evas_object_smart_data_get(object))) return; - edje_object_part_drag_step_get(scrollbar_sd->edje_object, "drag", &stepx, &stepy); - edje_object_part_drag_page_get(scrollbar_sd->edje_object, "drag", &pagex, &pagey); + edje_object_part_drag_step_get(sd->edje_object, "drag", &stepx, &stepy); + edje_object_part_drag_page_get(sd->edje_object, "drag", &pagex, &pagey); - if (scrollbar_sd->direction == E_SCROLLBAR_HORIZONTAL) + if (sd->direction == E_SCROLLBAR_HORIZONTAL) { *step = stepx; *page = pagex; @@ -209,153 +207,153 @@ _e_scrollbar_smart_add(Evas_Object *object) { Evas *evas; - E_Scrollbar_Smart_Data *scrollbar_sd; + E_Scrollbar_Smart_Data *sd; if ((!object) || !(evas = evas_object_evas_get(object))) return; - scrollbar_sd = calloc(1, sizeof(E_Scrollbar_Smart_Data)); - if (!scrollbar_sd) return; - scrollbar_sd->value.min = 0.0; - scrollbar_sd->value.max = 1.0; - scrollbar_sd->callbacks = NULL; - scrollbar_sd->direction = E_SCROLLBAR_HORIZONTAL; - scrollbar_sd->edje_object = edje_object_add(evas); - e_theme_edje_object_set(scrollbar_sd->edje_object, + sd = calloc(1, sizeof(E_Scrollbar_Smart_Data)); + if (!sd) return; + sd->value.min = 0.0; + sd->value.max = 1.0; + sd->callbacks = NULL; + sd->direction = E_SCROLLBAR_HORIZONTAL; + sd->edje_object = edje_object_add(evas); + e_theme_edje_object_set(sd->edje_object, "base/theme/widgets/hscrollbar", "widgets/hscrollbar"); - edje_object_signal_callback_add(scrollbar_sd->edje_object, "drag", "*", _e_scrollbar_drag_cb, scrollbar_sd); - evas_object_data_set(scrollbar_sd->edje_object, "smart", object); - evas_object_smart_member_add(scrollbar_sd->edje_object, object); + edje_object_signal_callback_add(sd->edje_object, "drag", "*", _e_scrollbar_drag_cb, sd); + evas_object_data_set(sd->edje_object, "smart", object); + evas_object_smart_member_add(sd->edje_object, object); - evas_object_smart_data_set(object, scrollbar_sd); + evas_object_smart_data_set(object, sd); } static void _e_scrollbar_smart_del(Evas_Object *object) { - E_Scrollbar_Smart_Data *scrollbar_sd; + E_Scrollbar_Smart_Data *sd; - if ((!object) || !(scrollbar_sd = evas_object_smart_data_get(object))) + if ((!object) || !(sd = evas_object_smart_data_get(object))) return; - evas_object_del(scrollbar_sd->edje_object); + evas_object_del(sd->edje_object); - free(scrollbar_sd); + free(sd); } static void _e_scrollbar_smart_raise(Evas_Object *object) { - E_Scrollbar_Smart_Data *scrollbar_sd; + E_Scrollbar_Smart_Data *sd; - if ((!object) || !(scrollbar_sd = evas_object_smart_data_get(object))) + if ((!object) || !(sd = evas_object_smart_data_get(object))) return; - evas_object_raise(scrollbar_sd->edje_object); + evas_object_raise(sd->edje_object); } static void _e_scrollbar_smart_lower(Evas_Object *object) { - E_Scrollbar_Smart_Data *scrollbar_sd; + E_Scrollbar_Smart_Data *sd; - if ((!object) || !(scrollbar_sd = evas_object_smart_data_get(object))) + if ((!object) || !(sd = evas_object_smart_data_get(object))) return; - evas_object_lower(scrollbar_sd->edje_object); + evas_object_lower(sd->edje_object); } static void _e_scrollbar_smart_stack_above(Evas_Object *object, Evas_Object *above) { - E_Scrollbar_Smart_Data *scrollbar_sd; + E_Scrollbar_Smart_Data *sd; - if ((!object) || (!above) || !(scrollbar_sd = evas_object_smart_data_get(object))) + if ((!object) || (!above) || !(sd = evas_object_smart_data_get(object))) return; - evas_object_stack_above(scrollbar_sd->edje_object, above); + evas_object_stack_above(sd->edje_object, above); } /* Called when the object is stacked below another object */ static void _e_scrollbar_smart_stack_below(Evas_Object *object, Evas_Object *below) { - E_Scrollbar_Smart_Data *scrollbar_sd; + E_Scrollbar_Smart_Data *sd; - if ((!object) || (!below) || !(scrollbar_sd = evas_object_smart_data_get(object))) + if ((!object) || (!below) || !(sd = evas_object_smart_data_get(object))) return; - evas_object_stack_below(scrollbar_sd->edje_object, below); + evas_object_stack_below(sd->edje_object, below); } /* Called when the object is moved */ static void _e_scrollbar_smart_move(Evas_Object *object, Evas_Coord x, Evas_Coord y) { - E_Scrollbar_Smart_Data *scrollbar_sd; + E_Scrollbar_Smart_Data *sd; - if ((!object) || !(scrollbar_sd = evas_object_smart_data_get(object))) + if ((!object) || !(sd = evas_object_smart_data_get(object))) return; - evas_object_move(scrollbar_sd->edje_object, x, y); + evas_object_move(sd->edje_object, x, y); } /* Called when the object is resized */ static void _e_scrollbar_smart_resize(Evas_Object *object, Evas_Coord w, Evas_Coord h) { - E_Scrollbar_Smart_Data *scrollbar_sd; + E_Scrollbar_Smart_Data *sd; - if ((!object) || !(scrollbar_sd = evas_object_smart_data_get(object))) + if ((!object) || !(sd = evas_object_smart_data_get(object))) return; - evas_object_resize(scrollbar_sd->edje_object, w, h); + evas_object_resize(sd->edje_object, w, h); } static void _e_scrollbar_smart_show(Evas_Object *object) { - E_Scrollbar_Smart_Data *scrollbar_sd; + E_Scrollbar_Smart_Data *sd; - if ((!object) || !(scrollbar_sd = evas_object_smart_data_get(object))) + if ((!object) || !(sd = evas_object_smart_data_get(object))) return; - evas_object_show(scrollbar_sd->edje_object); + evas_object_show(sd->edje_object); } static void _e_scrollbar_smart_hide(Evas_Object *object) { - E_Scrollbar_Smart_Data *scrollbar_sd; + E_Scrollbar_Smart_Data *sd; - if ((!object) || !(scrollbar_sd = evas_object_smart_data_get(object))) + if ((!object) || !(sd = evas_object_smart_data_get(object))) return; - evas_object_hide(scrollbar_sd->edje_object); + evas_object_hide(sd->edje_object); } static void _e_scrollbar_drag_cb(void *data, Evas_Object *object, const char *emission, const char *source) { - E_Scrollbar_Smart_Data *scrollbar_sd; + E_Scrollbar_Smart_Data *sd; Evas_Object *smart_object; Evas_List *l; if ((!object) || !(smart_object = evas_object_data_get(object, "smart"))) return; - scrollbar_sd = evas_object_smart_data_get(smart_object); - if (!scrollbar_sd) + sd = evas_object_smart_data_get(smart_object); + if (!sd) return; - scrollbar_sd->value.current = e_scrollbar_value_get(object); + sd->value.current = e_scrollbar_value_get(smart_object); - for (l = scrollbar_sd->callbacks; l; l = l->next) + for (l = sd->callbacks; l; l = l->next) { E_Scrollbar_Drag_Handler *handler; handler = l->data; - handler->cb.drag(smart_object, scrollbar_sd->value.current, handler->data); + handler->cb.drag(smart_object, sd->value.current, handler->data); } } =================================================================== RCS file: /cvsroot/enlightenment/e17/apps/e/src/bin/e_scrollbar.h,v retrieving revision 1.5 retrieving revision 1.6 diff -u -3 -r1.5 -r1.6 --- e_scrollbar.h 5 Oct 2005 00:40:06 -0000 1.5 +++ e_scrollbar.h 6 Oct 2005 22:35:21 -0000 1.6 @@ -20,8 +20,8 @@ enum _E_Scrollbar_Direction { - E_SCROLLBAR_HORIZONTAL, - E_SCROLLBAR_VERTICAL + E_SCROLLBAR_HORIZONTAL = 0, + E_SCROLLBAR_VERTICAL = 1 }; EAPI Evas_Object *e_scrollbar_add(Evas *evas); |
From: <enl...@li...> - 2005-10-10 00:55:16
|
Enlightenment CVS committal Author : codewarrior Project : e17 Module : apps/e Dir : e17/apps/e/src/bin Modified Files: Makefile.am e_includes.h e_int_menus.c Added Files: e_fileman.c e_fileman.h e_fileman_smart.c e_fileman_smart.h Log Message: EFM - The E17 file manager and file browser smart object. *** BEFORE YOU USE *** This is alpha software and may cause E17 to crash, lockup, use 99% of your cpu, or even delete your files! I would advise using it in Xnest if you want to test or develop it. *** BEFORE YOU USE *** EFM can: - browse files and directories - generate thumbnails - launch executables - do some xdnd - monitor files and directories - delete and rename files EFM cant: - scroll - associate applications with files - purge its thumbnails (do it manually: ~/.e/e/fileman/thumbnails) - do a lot of things you'd expect it to do because its still in alpha stage Current TODO: - scrolling - we need a redraw function that will just re-arrange and not do the whole thing. for example, when we resize, we should just check the file offset and fill the empty space with icons - is the offset code working properly? i have a feeling we're displayin more icons that the visible space can take and they are being hidden. - emit all sorts of signals on double click, right click, single click... - aspect ratio on thumbnails. - add typebuffer like in evidence. - keyboard shortcuts for directory and file navigation. - multi select - allow for icon movement inside the canvas - add metadata system which allows us to save icon positions and will eventually allow us to have custom icon sizes, custom bgs per dir... - double check dir monitoring. note: when we are in a dir that is constantly changing, we cant keep calling redraw_new as it will kill us. - we need to fix the icon edc to allow us to have icon labels what will wrap on wrap=char - fix bugs =================================================================== RCS file: /cvsroot/enlightenment/e17/apps/e/src/bin/Makefile.am,v retrieving revision 1.53 retrieving revision 1.54 diff -u -3 -r1.53 -r1.54 --- Makefile.am 9 Oct 2005 18:03:41 -0000 1.53 +++ Makefile.am 10 Oct 2005 00:55:07 -0000 1.54 @@ -80,7 +80,9 @@ e_theme_about.h \ e_apps_cache.h \ e_entry.h \ -e_scrollbar.h +e_fileman.h \ +e_scrollbar.h \ +e_fileman_smart.h enlightenment_src = \ e_user.c \ @@ -142,7 +144,9 @@ e_theme_about.c \ e_apps_cache.c \ e_entry.c \ +e_fileman.c \ e_scrollbar.c \ +e_fileman_smart.c \ $(ENLIGHTENMENTHEADERS) enlightenment_SOURCES = \ =================================================================== RCS file: /cvsroot/enlightenment/e17/apps/e/src/bin/e_includes.h,v retrieving revision 1.38 retrieving revision 1.39 diff -u -3 -r1.38 -r1.39 --- e_includes.h 9 Oct 2005 18:03:41 -0000 1.38 +++ e_includes.h 10 Oct 2005 00:55:07 -0000 1.39 @@ -62,3 +62,5 @@ #include "e_theme_about.h" #include "e_apps_cache.h" #include "e_scrollbar.h" +#include "e_fileman.h" +#include "e_fileman_smart.h" =================================================================== RCS file: /cvsroot/enlightenment/e17/apps/e/src/bin/e_int_menus.c,v retrieving revision 1.102 retrieving revision 1.103 diff -u -3 -r1.102 -r1.103 --- e_int_menus.c 9 Oct 2005 18:03:41 -0000 1.102 +++ e_int_menus.c 10 Oct 2005 00:55:07 -0000 1.103 @@ -32,6 +32,7 @@ static void _e_int_menus_apps_del_hook (void *obj); static void _e_int_menus_apps_free_hook (void *obj); static void _e_int_menus_apps_run (void *data, E_Menu *m, E_Menu_Item *mi); +static void _e_int_menus_main_fm(void *data, E_Menu *m, E_Menu_Item *mi); static void _e_int_menus_config_pre_cb (void *data, E_Menu *m); static void _e_int_menus_config_free_hook (void *obj); static void _e_int_menus_config_item_cb (void *data, E_Menu *m, E_Menu_Item *mi); @@ -140,9 +141,14 @@ mi = e_menu_item_new(m); e_menu_item_label_set(mi, _("Run Command")); e_util_menu_item_edje_icon_set(mi, "enlightenment/run"); - e_menu_item_callback_set(mi, _e_int_menus_main_run, NULL); + e_menu_item_callback_set(mi, _e_int_menus_main_run, NULL); } + mi = e_menu_item_new(m); + e_menu_item_label_set(mi, _("File Manager")); + e_util_menu_item_edje_icon_set(mi, "enlightenment/fileman"); + e_menu_item_callback_set(mi, _e_int_menus_main_fm, NULL); + subm = e_int_menus_config_new(); dat->config = subm; mi = e_menu_item_new(m); @@ -378,6 +384,15 @@ } static void +_e_int_menus_main_fm(void *data, E_Menu *m, E_Menu_Item *mi) +{ + E_Fileman *fileman; + + fileman = e_fileman_new (m->zone->container); + e_fileman_show (fileman); +} + +static void _e_int_menus_main_restart(void *data, E_Menu *m, E_Menu_Item *mi) { E_Action *a; |
From: <enl...@li...> - 2005-10-10 00:55:18
|
Enlightenment CVS committal Author : codewarrior Project : e17 Module : apps/e Dir : e17/apps/e/data/themes/images Added Files: e17_button_detail_arrange.png e17_button_detail_arrange_name.png e17_button_detail_arrange_time.png e17_button_detail_copy.png e17_button_detail_cut.png e17_button_detail_delete.png e17_button_detail_open.png e17_button_detail_paste.png e17_button_detail_properties.png e17_button_detail_refresh.png e17_button_detail_rename.png e17_button_detail_view.png e17_button_detail_view_details.png e17_button_detail_view_name.png e17_fileman_bg.png e17_icon_fileman_c.png e17_icon_fileman_file.png e17_icon_fileman_folder.png e17_icon_fileman_h.png e17_icon_fileman_jpg.png e17_icon_fileman_pdf.png e17_icon_fileman_png.png Log Message: EFM - The E17 file manager and file browser smart object. *** BEFORE YOU USE *** This is alpha software and may cause E17 to crash, lockup, use 99% of your cpu, or even delete your files! I would advise using it in Xnest if you want to test or develop it. *** BEFORE YOU USE *** EFM can: - browse files and directories - generate thumbnails - launch executables - do some xdnd - monitor files and directories - delete and rename files EFM cant: - scroll - associate applications with files - purge its thumbnails (do it manually: ~/.e/e/fileman/thumbnails) - do a lot of things you'd expect it to do because its still in alpha stage Current TODO: - scrolling - we need a redraw function that will just re-arrange and not do the whole thing. for example, when we resize, we should just check the file offset and fill the empty space with icons - is the offset code working properly? i have a feeling we're displayin more icons that the visible space can take and they are being hidden. - emit all sorts of signals on double click, right click, single click... - aspect ratio on thumbnails. - add typebuffer like in evidence. - keyboard shortcuts for directory and file navigation. - multi select - allow for icon movement inside the canvas - add metadata system which allows us to save icon positions and will eventually allow us to have custom icon sizes, custom bgs per dir... - double check dir monitoring. note: when we are in a dir that is constantly changing, we cant keep calling redraw_new as it will kill us. - we need to fix the icon edc to allow us to have icon labels what will wrap on wrap=char - fix bugs |
From: <enl...@li...> - 2005-10-10 00:55:57
|
Enlightenment CVS committal Author : codewarrior Project : e17 Module : apps/e Dir : e17/apps/e/data/themes Modified Files: default.edc default_icons.edc Added Files: default_fileman.edc Log Message: EFM - The E17 file manager and file browser smart object. *** BEFORE YOU USE *** This is alpha software and may cause E17 to crash, lockup, use 99% of your cpu, or even delete your files! I would advise using it in Xnest if you want to test or develop it. *** BEFORE YOU USE *** EFM can: - browse files and directories - generate thumbnails - launch executables - do some xdnd - monitor files and directories - delete and rename files EFM cant: - scroll - associate applications with files - purge its thumbnails (do it manually: ~/.e/e/fileman/thumbnails) - do a lot of things you'd expect it to do because its still in alpha stage Current TODO: - scrolling - we need a redraw function that will just re-arrange and not do the whole thing. for example, when we resize, we should just check the file offset and fill the empty space with icons - is the offset code working properly? i have a feeling we're displayin more icons that the visible space can take and they are being hidden. - emit all sorts of signals on double click, right click, single click... - aspect ratio on thumbnails. - add typebuffer like in evidence. - keyboard shortcuts for directory and file navigation. - multi select - allow for icon movement inside the canvas - add metadata system which allows us to save icon positions and will eventually allow us to have custom icon sizes, custom bgs per dir... - double check dir monitoring. note: when we are in a dir that is constantly changing, we cant keep calling redraw_new as it will kill us. - we need to fix the icon edc to allow us to have icon labels what will wrap on wrap=char - fix bugs =================================================================== RCS file: /cvsroot/enlightenment/e17/apps/e/data/themes/default.edc,v retrieving revision 1.46 retrieving revision 1.47 diff -u -3 -r1.46 -r1.47 --- default.edc 4 Oct 2005 01:33:59 -0000 1.46 +++ default.edc 10 Oct 2005 00:55:07 -0000 1.47 @@ -46,7 +46,8 @@ #include "default_pointer.edc" #include "default_about.edc" #include "default_theme_about.edc" -#include "default_entry.edc" +#include "default_entry.edc" +#include "default_fileman.edc" #include "default_scrollbar.edc" } =================================================================== RCS file: /cvsroot/enlightenment/e17/apps/e/data/themes/default_icons.edc,v retrieving revision 1.2 retrieving revision 1.3 diff -u -3 -r1.2 -r1.3 --- default_icons.edc 22 Aug 2005 12:25:23 -0000 1.2 +++ default_icons.edc 10 Oct 2005 00:55:07 -0000 1.3 @@ -411,3 +411,22 @@ } } } + + group { + name: "icons/enlightenment/fileman"; + max: 64 64; + parts { + part { + name: "icon"; + mouse_events: 0; + description { + state: "default" 0.0; + aspect: 1.0 1.0; + max: 64 64; + image { + normal: "e17_icon_fileman_folder.png"; + } + } + } + } + } |
From: <enl...@li...> - 2005-10-10 01:38:53
|
Enlightenment CVS committal Author : codewarrior Project : e17 Module : apps/e Dir : e17/apps/e/src/bin Modified Files: e_fileman_smart.c Log Message: portability++ =================================================================== RCS file: /cvsroot/enlightenment/e17/apps/e/src/bin/e_fileman_smart.c,v retrieving revision 1.1 retrieving revision 1.2 diff -u -3 -r1.1 -r1.2 --- e_fileman_smart.c 10 Oct 2005 00:55:07 -0000 1.1 +++ e_fileman_smart.c 10 Oct 2005 01:38:47 -0000 1.2 @@ -2,8 +2,8 @@ * vim:ts=8:sw=3:sts=8:noexpandtab:cino=>5n-3f0^-2{2 */ #include "e.h" -#include <dirent.h> #include <sys/types.h> +#include <dirent.h> #include <pwd.h> #include <grp.h> @@ -1106,8 +1106,8 @@ dir_entry2 = calloc( 1, sizeof(struct dirent)); dir_entry2->d_ino = dir_entry->d_ino; - dir_entry2->d_off = dir_entry->d_off; - dir_entry2->d_reclen = dir_entry->d_reclen; + // dir_entry2->d_off = dir_entry->d_off; // not portable + // dir_entry2->d_reclen = dir_entry->d_reclen; // note portable dir_entry2->d_type = dir_entry->d_type; snprintf (dir_entry2->d_name, NAME_MAX+1, dir_entry->d_name); |
From: <enl...@li...> - 2005-10-10 10:14:49
|
Enlightenment CVS committal Author : codewarrior Project : e17 Module : apps/e Dir : e17/apps/e/data/themes/images Added Files: e17_icon_fileman_folder_clicked.png Log Message: - Start working on selections. - Add ability to have different icon states when they are clicked or higlighted. |
From: <enl...@li...> - 2005-10-10 10:14:49
|
Enlightenment CVS committal Author : codewarrior Project : e17 Module : apps/e Dir : e17/apps/e/src/bin Modified Files: e_fileman_smart.c Log Message: - Start working on selections. - Add ability to have different icon states when they are clicked or higlighted. =================================================================== RCS file: /cvsroot/enlightenment/e17/apps/e/src/bin/e_fileman_smart.c,v retrieving revision 1.2 retrieving revision 1.3 diff -u -3 -r1.2 -r1.3 --- e_fileman_smart.c 10 Oct 2005 01:38:47 -0000 1.2 +++ e_fileman_smart.c 10 Oct 2005 10:14:49 -0000 1.3 @@ -65,6 +65,11 @@ Evas_Object *bg; Evas_List *objects; } prop; + + struct { + unsigned char clicked : 1; + unsigned char selected : 1; + } state; void *data; }; @@ -148,8 +153,12 @@ struct { int w; int h; - } max; + } max; + struct { + Evas_List *files; + E_Fileman_File *current_file; + } selection; }; static void _e_fm_smart_add(Evas_Object *object); @@ -181,6 +190,8 @@ static Evas_Object *_e_fm_file_icon_get (E_Fileman_File *file); static void _e_fm_file_icon_mouse_down_cb (void *data, Evas *e, Evas_Object *obj, void *event_info); static void _e_fm_file_icon_mouse_up_cb (void *data, Evas *e, Evas_Object *obj, void *event_info); +static void _e_fm_file_icon_mouse_in_cb (void *data, Evas *e, Evas_Object *obj, void *event_info); +static void _e_fm_file_icon_mouse_out_cb (void *data, Evas *e, Evas_Object *obj, void *event_info); static void _e_fm_file_menu_open (void *data, E_Menu *m, E_Menu_Item *mi); static void _e_fm_file_menu_copy (void *data, E_Menu *m, E_Menu_Item *mi); static void _e_fm_file_menu_cut (void *data, E_Menu *m, E_Menu_Item *mi); @@ -487,7 +498,9 @@ evas_object_event_callback_add (file->event, EVAS_CALLBACK_MOUSE_DOWN, _e_fm_file_icon_mouse_down_cb, file); evas_object_event_callback_add (file->event, EVAS_CALLBACK_MOUSE_UP, _e_fm_file_icon_mouse_up_cb, file); - evas_object_repeat_events_set(file->event, FALSE); + evas_object_event_callback_add (file->event, EVAS_CALLBACK_MOUSE_IN, _e_fm_file_icon_mouse_in_cb, file); + evas_object_event_callback_add (file->event, EVAS_CALLBACK_MOUSE_OUT, _e_fm_file_icon_mouse_out_cb, file); + evas_object_repeat_events_set(file->event, TRUE); sd->files = evas_list_append (sd->files, file); @@ -863,13 +876,14 @@ evas_object_event_callback_add (file->event, EVAS_CALLBACK_MOUSE_DOWN, _e_fm_file_icon_mouse_down_cb, file); evas_object_event_callback_add (file->event, EVAS_CALLBACK_MOUSE_UP, _e_fm_file_icon_mouse_up_cb, file); + evas_object_event_callback_add (file->event, EVAS_CALLBACK_MOUSE_IN, _e_fm_file_icon_mouse_in_cb, file); + evas_object_event_callback_add (file->event, EVAS_CALLBACK_MOUSE_OUT, _e_fm_file_icon_mouse_out_cb, file); evas_object_repeat_events_set(file->event, FALSE); sd->files = evas_list_append (sd->files, file); sd->file_offset++; sd->visible_files++; - printf("visible files: %d\n", sd->visible_files); dirs = dirs->next; } } @@ -1010,7 +1024,10 @@ sd->dir = calloc (/*strlen(dir) + 1*/PATH_MAX, sizeof (char)); snprintf (sd->dir, PATH_MAX/*strlen(dir) + 1*/, "%s", dir); - + + if(sd->selection.current_file) + sd->selection.current_file = NULL; + _e_fm_redraw_new (sd); } @@ -1052,7 +1069,9 @@ sd->files = NULL; sd->drag.file = NULL; - //sd = NULL; + + if(sd->selection.current_file) + sd->selection.current_file = NULL; } static void @@ -1868,17 +1887,30 @@ _e_fm_mouse_down_cb (void *data, Evas *e, Evas_Object *obj, void *event_info) { E_Fileman_Smart_Data *sd; - Evas_Event_Mouse_Down *ev; + Evas_Event_Mouse_Down *ev; + E_Menu *mn; + E_Menu_Item *mi; + int x, y, w, h; + ev = (Evas_Event_Mouse_Down *)event_info; sd = data; - if (ev->button == 3) + switch(ev->button) { - E_Menu *mn; - E_Menu_Item *mi; - int x, y, w, h; + case 1: + /* todo: multiple selections */ + if(sd->selection.current_file) + { + edje_object_signal_emit(sd->selection.current_file->icon, "unclicked", ""); + edje_object_signal_emit(sd->selection.current_file->icon_img, "unclicked", ""); + sd->selection.current_file->state.clicked = 0; + } + + break; + + case 3: if (!sd->win) return; mn = e_menu_new (); @@ -1968,6 +2000,7 @@ ev->output.x + x, ev->output.y + y, 1, 1, E_MENU_POP_DIRECTION_DOWN,ev->timestamp); _e_fileman_fake_mouse_up_all_later (sd->win->evas); + break; } } @@ -2043,7 +2076,23 @@ file->sd->drag.y = -1; file->sd->drag.x = -1; file->sd->drag.file = file; - printf("drag file: %s\n", file->dir_entry->d_name); + printf("drag file: %s\n", file->dir_entry->d_name); + + if(!file->state.clicked) + { + /* todo multiple selection with control or shift */ + if(file->sd->selection.current_file) + { + edje_object_signal_emit(file->sd->selection.current_file->icon, "unclicked", ""); + edje_object_signal_emit(file->sd->selection.current_file->icon_img, "unclicked", ""); + file->sd->selection.current_file->state.clicked = 0; + } + + edje_object_signal_emit(file->icon, "clicked", ""); + edje_object_signal_emit(file->icon_img, "clicked", ""); + file->sd->selection.current_file = file; + file->state.clicked = 1; + } } } @@ -2128,6 +2177,32 @@ } static void +_e_fm_file_icon_mouse_in_cb (void *data, Evas *e, Evas_Object *obj, void *event_info) +{ + E_Fileman_File *file; + Evas_Event_Mouse_Move *ev; + + ev = (Evas_Event_Mouse_Move *)event_info; + file = data; + + edje_object_signal_emit(file->icon, "hilight", ""); + edje_object_signal_emit(file->icon_img, "hilight", ""); +} + +static void +_e_fm_file_icon_mouse_out_cb (void *data, Evas *e, Evas_Object *obj, void *event_info) +{ + E_Fileman_File *file; + Evas_Event_Mouse_Move *ev; + + ev = (Evas_Event_Mouse_Move *)event_info; + file = data; + + edje_object_signal_emit(file->icon, "default", ""); + edje_object_signal_emit(file->icon_img, "default", ""); +} + +static void _e_fm_menu_arrange_cb (void *data, E_Menu *m, E_Menu_Item *mi) { E_Fileman_Smart_Data *sd; |
From: <enl...@li...> - 2005-10-10 10:14:49
|
Enlightenment CVS committal Author : codewarrior Project : e17 Module : apps/e Dir : e17/apps/e/data/themes Modified Files: default_fileman.edc Log Message: - Start working on selections. - Add ability to have different icon states when they are clicked or higlighted. =================================================================== RCS file: /cvsroot/enlightenment/e17/apps/e/data/themes/default_fileman.edc,v retrieving revision 1.1 retrieving revision 1.2 diff -u -3 -r1.1 -r1.2 --- default_fileman.edc 10 Oct 2005 00:55:07 -0000 1.1 +++ default_fileman.edc 10 Oct 2005 10:14:49 -0000 1.2 @@ -41,11 +41,56 @@ } \ } \ } \ + +#define FILEMAN_ICON_CLICKABLE(TYPE) \ +group { \ + name: "fileman/icons/"TYPE; \ + max: 64 64; \ + parts { \ + part { \ + name: "icon"; \ + mouse_events: 0; \ + description { \ + state: "default" 0.0; \ + aspect: 1.0 1.0; \ + max: 64 64; \ + image { \ + normal: "e17_icon_fileman_"TYPE".png"; \ + } \ + } \ + description { \ + state: "clicked" 0.0; \ + aspect: 1.0 1.0; \ + max: 64 64; \ + image { \ + normal: "e17_icon_fileman_"TYPE"_clicked.png"; \ + } \ + } \ + } \ + } \ + programs { \ + program { \ + name: "clicked"; \ + signal: "clicked"; \ + source: ""; \ + action: STATE_SET "clicked" 0.0; \ + target: "icon"; \ + } \ + program { \ + name: "unclicked"; \ + signal: "unclicked"; \ + source: ""; \ + action: STATE_SET "default" 0.0; \ + target: "icon"; \ + } \ + } \ +} \ images { image: "e17_fileman_bg.png" COMP; image: "e17_icon_fileman_folder.png" COMP; + image: "e17_icon_fileman_folder_clicked.png" COMP; image: "e17_icon_fileman_file.png" COMP; image: "e17_icon_fileman_pdf.png" COMP; image: "e17_icon_fileman_c.png" COMP; @@ -219,10 +264,6 @@ name: "icon_swallow"; type: SWALLOW; mouse_events: 1; - dragable { - x: 1 1 0; - y: 1 1 0; - } description { min: 48 48; max: 128 128; @@ -238,7 +279,6 @@ color: 0 0 0 255; } } - part { name: "icon_title"; type: TEXT; @@ -307,10 +347,10 @@ program { name: "button_click"; signal: "mouse,down,1"; - source: "icon_event"; + source: ""; action: SIGNAL_EMIT "clicked" ""; - } - } + } + } } @@ -482,7 +522,7 @@ } -FILEMAN_ICON("folder"); +FILEMAN_ICON_CLICKABLE("folder"); FILEMAN_ICON("file"); FILEMAN_ICON("pdf"); FILEMAN_ICON("c"); |
From: <enl...@li...> - 2005-10-10 15:17:36
|
Enlightenment CVS committal Author : codewarrior Project : e17 Module : apps/e Dir : e17/apps/e/src/bin Modified Files: e_fileman_smart.c Log Message: Added rubber band for multiselect. It draws, but doesnt select yet. =================================================================== RCS file: /cvsroot/enlightenment/e17/apps/e/src/bin/e_fileman_smart.c,v retrieving revision 1.4 retrieving revision 1.5 diff -u -3 -r1.4 -r1.5 --- e_fileman_smart.c 10 Oct 2005 12:22:29 -0000 1.4 +++ e_fileman_smart.c 10 Oct 2005 15:17:29 -0000 1.5 @@ -160,6 +160,13 @@ struct { Evas_List *files; E_Fileman_File *current_file; + + struct { + unsigned char enabled : 1; + Evas_Coord x, y; + Evas_Object *obj; + } band; + } selection; }; @@ -221,7 +228,9 @@ static Evas_List *_e_fm_dir_files_get (char *dirname, E_Fileman_File_Type type); static char *_e_fm_dir_pop(const char *path); static void _e_fm_mouse_down_cb (void *data, Evas *e, Evas_Object *obj, void *event_info); -static int _e_fm_mouse_move_cb (void *data, int type, void *event); +static void _e_fm_mouse_up_cb (void *data, Evas *e, Evas_Object *obj, void *event_info); +static void _e_fm_mouse_move_cb (void *data, Evas *e, Evas_Object *obj, void *event_info); +static int _e_fm_win_mouse_move_cb (void *data, int type, void *event); static int _e_fm_grabbed_mouse_up_cb (void *data, int type, void *event); static void _e_fm_menu_arrange_cb (void *data, E_Menu *m, E_Menu_Item *mi); static void _e_fm_menu_refresh_cb (void *data, E_Menu *m, E_Menu_Item *mi); @@ -536,6 +545,10 @@ evas_object_event_callback_add (sd->bg, EVAS_CALLBACK_MOUSE_DOWN, _e_fm_mouse_down_cb, sd); + evas_object_event_callback_add (sd->bg, EVAS_CALLBACK_MOUSE_UP, + _e_fm_mouse_up_cb, sd); + evas_object_event_callback_add (sd->bg, EVAS_CALLBACK_MOUSE_MOVE, + _e_fm_mouse_move_cb, sd); evas_object_smart_member_add(sd->bg, object); sd->clip = evas_object_rectangle_add(evas); @@ -548,8 +561,8 @@ sd->icon_info.w = 48; sd->icon_info.h = 48; - sd->icon_info.x_space = 10; - sd->icon_info.y_space = 10; + sd->icon_info.x_space = 15; + sd->icon_info.y_space = 15; homedir = e_user_homedir_get(); thumb_path = E_NEW(char, PATH_MAX); @@ -570,6 +583,11 @@ sd->event_handlers = NULL; + sd->selection.band.obj = edje_object_add(sd->evas); + e_theme_edje_object_set(sd->selection.band.obj, + "base/theme/fileman/rubberband", + "fileman/rubberband"); + sd->event_handlers = evas_list_append (sd->event_handlers, ecore_event_handler_add(ECORE_X_EVENT_XDND_ENTER, _e_fm_drop_enter_cb, @@ -596,7 +614,7 @@ sd)); sd->event_handlers = evas_list_append (sd->event_handlers, ecore_event_handler_add(ECORE_X_EVENT_MOUSE_MOVE, - _e_fm_mouse_move_cb, + _e_fm_win_mouse_move_cb, sd)); evas_object_smart_data_set(object, sd); @@ -626,8 +644,10 @@ evas_list_free(sd->event_handlers); sd->event_handlers = NULL; - - evas_object_del (sd->bg); + + + evas_object_del(sd->selection.band.obj); + evas_object_del(sd->bg); free (sd->dir); free(sd); @@ -787,9 +807,9 @@ sd->files_raw = _e_fm_dir_files_get (sd->dir, E_FILEMAN_FILETYPE_NORMAL); dirs = sd->files_raw; - if (sd->monitor) - ecore_file_monitor_del (sd->monitor); - sd->monitor = ecore_file_monitor_add (sd->dir, _e_fm_dir_monitor_cb, sd); + //if (sd->monitor) + // ecore_file_monitor_del (sd->monitor); + //sd->monitor = ecore_file_monitor_add (sd->dir, _e_fm_dir_monitor_cb, sd); dir_entry = calloc (1, sizeof (struct dirent)); dir_entry->d_type = 4; @@ -1119,8 +1139,8 @@ evas_list_free (sd->files); // this is segfaulting E - if (sd->monitor) - ecore_file_monitor_del (sd->monitor); + //if (sd->monitor) + // ecore_file_monitor_del (sd->monitor); sd->monitor = NULL; sd->files = NULL; @@ -1937,10 +1957,95 @@ } static void +_e_fm_mouse_up_cb (void *data, Evas *e, Evas_Object *obj, void *event_info) +{ + E_Fileman_Smart_Data *sd; + Evas_Event_Mouse_Up *ev; + + sd = data; + ev = event_info; + + if(sd->selection.band.enabled) + { + if(!sd->selection.band.obj) + return; + + sd->selection.band.enabled = 0; + evas_object_resize(sd->selection.band.obj, 1, 1); + evas_object_hide(sd->selection.band.obj); + } +} + +static void +_e_fm_mouse_move_cb (void *data, Evas *e, Evas_Object *obj, void *event_info) +{ + E_Fileman_Smart_Data *sd; + Evas_Event_Mouse_Move *ev; + + ev = event_info; + sd = data; + + if(sd->selection.band.enabled) + { + Evas_Coord x, y, w, h; + + printf("enabled!!\n"); + + if(!sd->selection.band.obj) + return; + + evas_object_geometry_get(sd->selection.band.obj, &x, &y, &w, &h); + + if(ev->cur.canvas.x > sd->selection.band.x && + ev->cur.canvas.y < sd->selection.band.y) + { + /* growing towards top right */ + evas_object_move(sd->selection.band.obj, + sd->selection.band.x, + ev->cur.canvas.y); + evas_object_resize(sd->selection.band.obj, + ev->cur.canvas.x - sd->selection.band.x, + sd->selection.band.y - ev->cur.canvas.y); + } + else if(ev->cur.canvas.x > sd->selection.band.x && + ev->cur.canvas.y > sd->selection.band.y) + { + /* growing towards bottom right */ + w = ev->cur.canvas.x - sd->selection.band.x; + h = ev->cur.canvas.y - sd->selection.band.y; + + evas_object_resize(sd->selection.band.obj, w, h); + } + else if(ev->cur.canvas.x < sd->selection.band.x && + ev->cur.canvas.y < sd->selection.band.y) + { + /* growing towards top left */ + evas_object_move(sd->selection.band.obj, + ev->cur.canvas.x, + ev->cur.canvas.y); + evas_object_resize(sd->selection.band.obj, + sd->selection.band.x - ev->cur.canvas.x, + sd->selection.band.y - ev->cur.canvas.y); + } + else if(ev->cur.canvas.x < sd->selection.band.x && + ev->cur.canvas.y > sd->selection.band.y) + { + /* growing towards button left */ + evas_object_move(sd->selection.band.obj, + ev->cur.canvas.x, + sd->selection.band.y); + evas_object_resize(sd->selection.band.obj, + sd->selection.band.x - ev->cur.canvas.x, + ev->cur.canvas.y - sd->selection.band.y); + } + } +} + +static void _e_fm_mouse_down_cb (void *data, Evas *e, Evas_Object *obj, void *event_info) { E_Fileman_Smart_Data *sd; - Evas_Event_Mouse_Down *ev; + Evas_Event_Mouse_Down *ev; E_Menu *mn; E_Menu_Item *mi; int x, y, w, h; @@ -1949,10 +2054,25 @@ ev = (Evas_Event_Mouse_Down *)event_info; sd = data; + printf("mouse down!!\n"); + switch(ev->button) { case 1: - _e_fm_selections_clear(sd); + if(evas_key_modifier_is_set(evas_key_modifier_get(sd->evas), "Control")) + { + + } + else + { + _e_fm_selections_clear(sd); + sd->selection.band.enabled = 1; + evas_object_move(sd->selection.band.obj, ev->canvas.x, ev->canvas.y); + evas_object_resize(sd->selection.band.obj, 1, 1); + evas_object_show(sd->selection.band.obj); + sd->selection.band.x = ev->canvas.x; + sd->selection.band.y = ev->canvas.y; + } break; case 3: @@ -2124,11 +2244,7 @@ printf("drag file: %s\n", file->dir_entry->d_name); if(!file->state.clicked) - { - //Evas_Modifier_Mask mask; - - //mask = evas_key_modifier_mask_get(file->sd->evas, "Control"); - + { if(evas_key_modifier_is_set(evas_key_modifier_get(file->sd->evas), "Control")) file->sd->selection.files = evas_list_append(file->sd->selection.files, file); @@ -2139,10 +2255,6 @@ } else { - //Evas_Modifier_Mask mask; - - //mask = evas_key_modifier_mask_get(file->sd->evas, "Control"); - if(evas_key_modifier_is_set(evas_key_modifier_get(file->sd->evas), "Control")) _e_fm_selections_del(file); else @@ -2237,9 +2349,9 @@ _e_fm_file_icon_mouse_in_cb (void *data, Evas *e, Evas_Object *obj, void *event_info) { E_Fileman_File *file; - Evas_Event_Mouse_Move *ev; + Evas_Event_Mouse_In *ev; - ev = (Evas_Event_Mouse_Move *)event_info; + ev = (Evas_Event_Mouse_In *)event_info; file = data; edje_object_signal_emit(file->icon, "hilight", ""); @@ -2250,9 +2362,9 @@ _e_fm_file_icon_mouse_out_cb (void *data, Evas *e, Evas_Object *obj, void *event_info) { E_Fileman_File *file; - Evas_Event_Mouse_Move *ev; + Evas_Event_Mouse_Out *ev; - ev = (Evas_Event_Mouse_Move *)event_info; + ev = (Evas_Event_Mouse_Out *)event_info; file = data; edje_object_signal_emit(file->icon, "default", ""); @@ -2293,7 +2405,7 @@ // TODO: add images for icons with image thumb and not edje part static int -_e_fm_mouse_move_cb (void *data, int type, void *event) +_e_fm_win_mouse_move_cb (void *data, int type, void *event) { E_Fileman_Smart_Data *sd; E_Fileman_File *file; @@ -2372,9 +2484,9 @@ sd->drag.start = 0; } } - } - - return 1; + } + + return 1; } static int |
From: <enl...@li...> - 2005-10-10 15:18:01
|
Enlightenment CVS committal Author : codewarrior Project : e17 Module : apps/e Dir : e17/apps/e/data/themes Modified Files: default_fileman.edc Log Message: Added rubber band for multiselect. It draws, but doesnt select yet. =================================================================== RCS file: /cvsroot/enlightenment/e17/apps/e/data/themes/default_fileman.edc,v retrieving revision 1.3 retrieving revision 1.4 diff -u -3 -r1.3 -r1.4 --- default_fileman.edc 10 Oct 2005 12:22:29 -0000 1.3 +++ default_fileman.edc 10 Oct 2005 15:17:27 -0000 1.4 @@ -113,6 +113,7 @@ image: "e17_button_detail_view_details.png" COMP; image: "e17_button_detail_view_name.png" COMP; image: "e17_button_detail_view.png" COMP; + image: "e17_fileman_rubberband.png" COMP; image: "e17_menu_bg_border.png" COMP; image: "e17_button2.png" COMP; @@ -171,7 +172,8 @@ offset: 0 0; } image { - normal: "e17_fileman_bg.png"; + //normal: "e17_fileman_bg.png"; + normal: "e17_brushed.png"; } fill { smooth: 0; @@ -522,6 +524,32 @@ } } +group { + name: "fileman/rubberband"; + parts { + part { + name: "base"; + mouse_events: 0; + description { + state: "default" 0.0; + rel1 { + relative: 0.0 0.0; + offset: 1 1; + } + rel2 { + relative: 1.0 1.0; + offset: -1 -1; + } + image { + normal: "e17_fileman_rubberband.png"; + border: 2 2 2 2; + } + color: 255 255 255 128; + } + } + } +} + FILEMAN_ICON_CLICKABLE("folder"); FILEMAN_ICON_CLICKABLE("file"); |
From: <enl...@li...> - 2005-10-10 15:17:37
|
Enlightenment CVS committal Author : codewarrior Project : e17 Module : apps/e Dir : e17/apps/e/data/themes/images Added Files: e17_fileman_rubberband.png Log Message: Added rubber band for multiselect. It draws, but doesnt select yet. |
From: <enl...@li...> - 2005-10-10 16:08:29
|
Enlightenment CVS committal Author : codewarrior Project : e17 Module : apps/e Dir : e17/apps/e/src/bin Modified Files: e_fileman_smart.c Log Message: Disable monitor and dont copy files on dnd (no more e17 restart crash and file zeroing) =================================================================== RCS file: /cvsroot/enlightenment/e17/apps/e/src/bin/e_fileman_smart.c,v retrieving revision 1.5 retrieving revision 1.6 diff -u -3 -r1.5 -r1.6 --- e_fileman_smart.c 10 Oct 2005 15:17:29 -0000 1.5 +++ e_fileman_smart.c 10 Oct 2005 16:08:30 -0000 1.6 @@ -190,6 +190,7 @@ static void _e_fm_selections_clear(E_Fileman_Smart_Data *sd); static void _e_fm_selections_add(E_Fileman_File *file); static void _e_fm_selections_del(E_Fileman_File *file); +static void _e_fm_selections_add_rect(E_Fileman_Smart_Data *sd, Evas_Coord x, Evas_Coord y, Evas_Coord w, Evas_Coord h); static void _e_fm_files_free (E_Fileman_Smart_Data *sd); static char *_e_fm_file_stripext(char *path); static Evas_Bool _e_fm_file_can_preview (E_Fileman_File *file); @@ -1072,6 +1073,26 @@ file->sd->selection.files = evas_list_append(file->sd->selection.files, file); } +static void +_e_fm_selections_add_rect(E_Fileman_Smart_Data *sd, Evas_Coord x, Evas_Coord y, Evas_Coord w, Evas_Coord h) +{ + /* + Evas_List *l; + + for (l = sd->selection.files; l; l = l->next) + { + E_Fileman_File *file; + Evas_Coord x, y, w, h; + + file = l->data; + if(!file) continue; + + evas_object_geometry_get(file->icon, &x, &y, &w, &h); + + } + */ +} + static void _e_fm_selections_del(E_Fileman_File *file) { @@ -1988,6 +2009,7 @@ if(sd->selection.band.enabled) { Evas_Coord x, y, w, h; + Evas_List *objects; printf("enabled!!\n"); @@ -2037,7 +2059,10 @@ evas_object_resize(sd->selection.band.obj, sd->selection.band.x - ev->cur.canvas.x, ev->cur.canvas.y - sd->selection.band.y); - } + } + + evas_object_geometry_get(sd->selection.band.obj, &x, &y, &w, &h); + _e_fm_selections_add_rect(sd, x, y, w, h); } } @@ -2560,7 +2585,9 @@ snprintf (new_file, PATH_MAX, "%s/%s", sd->dir, ecore_file_get_file (files->files[i])); - ecore_file_cp (strstr (files->files[i],"/"), new_file); + // look into this. + //ecore_file_cp (strstr (files->files[i],"/"), new_file); + printf("we should copy the file now."); } ecore_x_dnd_send_finished(); |