summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMarcel Hollerbach <marcel-hollerbach@t-online.de>2017-09-19 10:16:20 +0200
committerMarcel Hollerbach <marcel-hollerbach@t-online.de>2017-10-03 12:01:19 +0200
commit6c0414676cc1e971d758272b23762b5d6f42ce0d (patch)
tree6a0b88b08301f5b208c37adbc8de9cd26bc3389f
parent22096ea33597bf6ec49ce1cf76278c5aa4336bea (diff)
elm_widget_event break fix!
-rw-r--r--src/widgets/file/elm_file_display.c12
-rw-r--r--src/widgets/file/elm_file_selector.c24
-rw-r--r--src/widgets/file/elm_file_view.eo4
3 files changed, 24 insertions, 16 deletions
diff --git a/src/widgets/file/elm_file_display.c b/src/widgets/file/elm_file_display.c
index 4ac4a35..a4d7bdf 100644
--- a/src/widgets/file/elm_file_display.c
+++ b/src/widgets/file/elm_file_display.c
@@ -1,4 +1,5 @@
1#define INEEDWIDGET 1#define INEEDWIDGET
2#define ELM_WIDGET_PROTECTED
2#include "../elementary_ext_priv.h" 3#include "../elementary_ext_priv.h"
3 4
4#define PRIV_DATA(o) Elm_File_Display_Data *pd = efl_data_scope_get(o, ELM_FILE_DISPLAY_CLASS); 5#define PRIV_DATA(o) Elm_File_Display_Data *pd = efl_data_scope_get(o, ELM_FILE_DISPLAY_CLASS);
@@ -187,17 +188,18 @@ _elm_file_display_hide_bookmarks_get(Eo *obj EINA_UNUSED, Elm_File_Display_Data
187 return pd->hide_bookmarks; 188 return pd->hide_bookmarks;
188} 189}
189 190
191
190EOLIAN static Eina_Bool 192EOLIAN static Eina_Bool
191_elm_file_display_elm_widget_widget_event(Eo *obj EINA_UNUSED, Elm_File_Display_Data *pd, Efl_Canvas_Object *source EINA_UNUSED, Evas_Callback_Type type, void *event_info) 193_elm_file_display_elm_widget_widget_event(Eo *obj, Elm_File_Display_Data *pd, const Efl_Event *eo_event, Efl_Canvas_Object *source EINA_UNUSED)
192{ 194{
193 Evas_Event_Key_Down *ev; 195 Efl_Input_Key *ev;
194 196
195 if (type != EVAS_CALLBACK_KEY_DOWN) 197 if (eo_event->desc != EFL_EVENT_KEY_DOWN)
196 return EINA_FALSE; 198 return EINA_FALSE;
197 199
198 ev = event_info; 200 ev = eo_event->info;
199 201
200 if (!strcmp(ev->key, "F2")) 202 if (!strcmp(efl_input_key_get(ev), "F2"))
201 { 203 {
202 elm_file_detail_rename(pd->detail); 204 elm_file_detail_rename(pd->detail);
203 return EINA_TRUE; 205 return EINA_TRUE;
diff --git a/src/widgets/file/elm_file_selector.c b/src/widgets/file/elm_file_selector.c
index 7439e86..8e6a826 100644
--- a/src/widgets/file/elm_file_selector.c
+++ b/src/widgets/file/elm_file_selector.c
@@ -1,4 +1,5 @@
1#define INEEDWIDGET 1#define INEEDWIDGET
2#define ELM_WIDGET_PROTECTED
2#include "../elementary_ext_priv.h" 3#include "../elementary_ext_priv.h"
3#include <regex.h> 4#include <regex.h>
4 5
@@ -656,31 +657,34 @@ _search_update(Eo *obj, Elm_File_Selector_Data *pd)
656 * Key down Event stuff 657 * Key down Event stuff
657 *====================================== 658 *======================================
658 */ 659 */
660
659EOLIAN static Eina_Bool 661EOLIAN static Eina_Bool
660_elm_file_selector_elm_widget_widget_event(Eo *obj, Elm_File_Selector_Data *pd, Evas_Object *source EINA_UNUSED, Evas_Callback_Type type, void *event_info) 662_elm_file_selector_elm_widget_widget_event(Eo *obj, Elm_File_Selector_Data *pd, const Efl_Event *eo_event, Efl_Canvas_Object *source EINA_UNUSED)
661{ 663{
662 Evas_Event_Key_Down *ev; 664 Efl_Input_Key *ev;
663 665
664 if (type != EVAS_CALLBACK_KEY_DOWN) 666 if (eo_event->desc != EFL_EVENT_KEY_DOWN)
665 return EINA_FALSE; 667 return EINA_FALSE;
666 ev = event_info; 668 ev = eo_event->info;
669
667 // XXX: add some code for more "general" shortcuts 670 // XXX: add some code for more "general" shortcuts
668 if (evas_key_modifier_is_set(ev->modifiers, "Control") && (!strcmp(ev->key, "H") || !strcmp(ev->key, "h"))) 671 if (efl_input_modifier_enabled_get(ev, EFL_INPUT_MODIFIER_CONTROL, NULL) && (!strcmp(efl_input_key_get(ev), "H") || !strcmp(efl_input_key_get(ev), "h")))
669 { 672 {
670 Eina_Bool b; 673 Eina_Bool b;
671 b = elm_file_selector_show_hidden_file_get(obj); 674 b = elm_file_selector_show_hidden_file_get(obj);
672 elm_file_selector_show_hidden_file_set(obj, !b); 675 elm_file_selector_show_hidden_file_set(obj, !b);
673 } 676 }
674 if (ev->string && strlen(ev->string) == 1 && 677 const char *string = efl_input_key_string_get(ev);
675 (isprint(ev->string[0]) || ev->string[0] == '.') 678 if (string && strlen(string) == 1 &&
679 (isprint(string[0]) || string[0] == '.')
676 ) 680 )
677 { 681 {
678 if (!pd->search.buffer) 682 if (!pd->search.buffer)
679 pd->search.buffer = eina_strbuf_new(); 683 pd->search.buffer = eina_strbuf_new();
680 eina_strbuf_append_char(pd->search.buffer, ev->string[0]); 684 eina_strbuf_append_char(pd->search.buffer, string[0]);
681 _search_update(obj, pd); 685 _search_update(obj, pd);
682 } 686 }
683 else if (!strcmp(ev->key, "BackSpace")) 687 else if (!strcmp(efl_input_key_get(ev), "BackSpace"))
684 { 688 {
685 int oldlength; 689 int oldlength;
686 char *oldstr; 690 char *oldstr;
@@ -708,7 +712,7 @@ _elm_file_selector_elm_widget_widget_event(Eo *obj, Elm_File_Selector_Data *pd,
708 free(oldstr); 712 free(oldstr);
709 _search_update(obj, pd); 713 _search_update(obj, pd);
710 } 714 }
711 else if (!strcmp(ev->key, "Escape")) 715 else if (!strcmp(efl_input_key_get(ev), "Escape"))
712 { 716 {
713 eina_strbuf_free(pd->search.buffer); 717 eina_strbuf_free(pd->search.buffer);
714 pd->search.buffer = NULL; 718 pd->search.buffer = NULL;
diff --git a/src/widgets/file/elm_file_view.eo b/src/widgets/file/elm_file_view.eo
index 166db13..b672c71 100644
--- a/src/widgets/file/elm_file_view.eo
+++ b/src/widgets/file/elm_file_view.eo
@@ -1,3 +1,5 @@
1struct @extern Eina.Rectangle;
2
1interface Elm.File.View { 3interface Elm.File.View {
2 [[ Interface to abstract communication between the elm.file.selector and the displaying view]] 4 [[ Interface to abstract communication between the elm.file.selector and the displaying view]]
3 methods { 5 methods {
@@ -58,4 +60,4 @@ interface Elm.File.View {
58 working,start; [[The view has started listing work]] 60 working,start; [[The view has started listing work]]
59 working,done; [[The view has stopped listing work]] 61 working,done; [[The view has stopped listing work]]
60 } 62 }
61} \ No newline at end of file 63}