ajwillia-ms pushed a commit to branch master.

http://git.enlightenment.org/tools/edi.git/commit/?id=288f408d88635095b37e0af167ec83bdbafbd1e3

commit 288f408d88635095b37e0af167ec83bdbafbd1e3
Author: Andy Williams <a...@andywilliams.me>
Date:   Tue Feb 10 23:02:45 2015 +0000

    elm_code: Tidy up some unused code and fix up some focus management
---
 elm_code/lib/elm_code_widget.c    | 33 +++++++++++++++++++--------------
 elm_code/lib/elm_code_widget.eo   |  6 +++---
 elm_code/lib/elm_code_widget.eo.c | 10 +++++++---
 3 files changed, 29 insertions(+), 20 deletions(-)

diff --git a/elm_code/lib/elm_code_widget.c b/elm_code/lib/elm_code_widget.c
index 609d62c..00ca5fe 100644
--- a/elm_code/lib/elm_code_widget.c
+++ b/elm_code/lib/elm_code_widget.c
@@ -492,12 +492,6 @@ _elm_code_widget_event_veto_cb(void *data, Evas_Object 
*obj EINA_UNUSED,
    if (!pd->editable)
      return EINA_FALSE;
 
-   widget = (Elm_Code_Widget *)data;
-   pd = eo_data_scope_get(widget, ELM_CODE_WIDGET_CLASS);
-
-   if (!pd->editable)
-     return EINA_FALSE;
-
    vetoed = EINA_TRUE;
    if (type == EVAS_CALLBACK_KEY_DOWN)
      {
@@ -511,9 +505,15 @@ _elm_code_widget_event_veto_cb(void *data, Evas_Object 
*obj EINA_UNUSED,
 EOLIAN static Eina_Bool
 _elm_code_widget_elm_widget_on_focus(Eo *obj, Elm_Code_Widget_Data *pd)
 {
-   Eina_Bool int_ret = EINA_FALSE;
+   Eina_Bool int_ret;
+
+   if (!pd->editable)
+     return EINA_FALSE;
+
    eo_do_super(obj, ELM_CODE_WIDGET_CLASS, int_ret = 
elm_obj_widget_on_focus());
-   if (!int_ret) return EINA_TRUE;
+
+   if (!int_ret)
+     return EINA_TRUE;
 
    pd->focussed = elm_widget_focus_get(obj);
 
@@ -521,13 +521,18 @@ _elm_code_widget_elm_widget_on_focus(Eo *obj, 
Elm_Code_Widget_Data *pd)
    return EINA_TRUE;
 }
 
-EOLIAN static void
-_elm_code_widget_elm_interface_scrollable_content_pos_set(Eo *obj EINA_UNUSED,
-                                                           
Elm_Code_Widget_Data *pd EINA_UNUSED,
-                                                           Evas_Coord x, 
Evas_Coord y,
-                                                           Eina_Bool sig 
EINA_UNUSED)
+EOLIAN static Eina_Bool
+_elm_code_widget_elm_widget_focus_next_manager_is(Elm_Widget *obj EINA_UNUSED,
+                                                  Elm_Code_Widget_Data *pd 
EINA_UNUSED)
+{
+   return EINA_FALSE;
+}
+
+EOLIAN static Eina_Bool
+_elm_code_widget_elm_widget_focus_direction_manager_is(Elm_Widget *obj 
EINA_UNUSED,
+                                                       Elm_Code_Widget_Data 
*pd EINA_UNUSED)
 {
-   printf("scroll to %d, %d\n", x, y);
+   return EINA_FALSE;
 }
 
 EOLIAN static void
diff --git a/elm_code/lib/elm_code_widget.eo b/elm_code/lib/elm_code_widget.eo
index 2d92386..1b29f39 100644
--- a/elm_code/lib/elm_code_widget.eo
+++ b/elm_code/lib/elm_code_widget.eo
@@ -1,5 +1,4 @@
-class Elm_Code_Widget (Elm_Box, Elm_Interface_Scrollable,
-                       Elm_Interface_Atspi_Text)
+class Elm_Code_Widget (Elm_Box, Elm_Interface_Atspi_Text)
 {
    eo_prefix: elm_code_widget;
    properties {
@@ -112,7 +111,8 @@ class Elm_Code_Widget (Elm_Box, Elm_Interface_Scrollable,
       Eo.Base.constructor;
       Evas.Object_Smart.add;
       Elm_Widget.on_focus;
-      Elm_Interface_Scrollable.content_pos_set;
+      Elm_Widget.focus_next_manager_is;
+      Elm_Widget.focus_direction_manager_is;
    }
    events {
       line,clicked;
diff --git a/elm_code/lib/elm_code_widget.eo.c 
b/elm_code/lib/elm_code_widget.eo.c
index 0affce2..7364d59 100644
--- a/elm_code/lib/elm_code_widget.eo.c
+++ b/elm_code/lib/elm_code_widget.eo.c
@@ -50,14 +50,18 @@ void _elm_code_widget_evas_object_smart_add(Eo *obj, 
Elm_Code_Widget_Data *pd);
 Eina_Bool _elm_code_widget_elm_widget_on_focus(Eo *obj, Elm_Code_Widget_Data 
*pd);
 
 
-void _elm_code_widget_elm_interface_scrollable_content_pos_set(Eo *obj, 
Elm_Code_Widget_Data *pd, Evas_Coord x, Evas_Coord y, Eina_Bool sig);
+Eina_Bool _elm_code_widget_elm_widget_focus_next_manager_is(Eo *obj, 
Elm_Code_Widget_Data *pd);
+
+
+Eina_Bool _elm_code_widget_elm_widget_focus_direction_manager_is(Eo *obj, 
Elm_Code_Widget_Data *pd);
 
 
 static Eo_Op_Description _elm_code_widget_op_desc[] = {
      EO_OP_FUNC_OVERRIDE(eo_constructor, _elm_code_widget_eo_base_constructor),
      EO_OP_FUNC_OVERRIDE(evas_obj_smart_add, 
_elm_code_widget_evas_object_smart_add),
      EO_OP_FUNC_OVERRIDE(elm_obj_widget_on_focus, 
_elm_code_widget_elm_widget_on_focus),
-     EO_OP_FUNC_OVERRIDE(elm_interface_scrollable_content_pos_set, 
_elm_code_widget_elm_interface_scrollable_content_pos_set),
+     EO_OP_FUNC_OVERRIDE(elm_obj_widget_focus_next_manager_is, 
_elm_code_widget_elm_widget_focus_next_manager_is),
+     EO_OP_FUNC_OVERRIDE(elm_obj_widget_focus_direction_manager_is, 
_elm_code_widget_elm_widget_focus_direction_manager_is),
      EO_OP_FUNC(elm_code_widget_code_set, _elm_code_widget_code_set, "Set the 
underlying code object that this widget renders"),
      EO_OP_FUNC(elm_code_widget_code_get, _elm_code_widget_code_get, "Get the 
underlying code object we are rendering"),
      EO_OP_FUNC(elm_code_widget_font_size_set, _elm_code_widget_font_size_set, 
"Set the font size that this widget uses, the font will always be a system 
monospaced font"),
@@ -87,4 +91,4 @@ static const Eo_Class_Description _elm_code_widget_class_desc 
= {
      NULL
 };
 
-EO_DEFINE_CLASS(elm_code_widget_class_get, &_elm_code_widget_class_desc, 
ELM_BOX_CLASS, ELM_INTERFACE_SCROLLABLE_MIXIN, 
ELM_INTERFACE_ATSPI_TEXT_INTERFACE, NULL);
\ No newline at end of file
+EO_DEFINE_CLASS(elm_code_widget_class_get, &_elm_code_widget_class_desc, 
ELM_BOX_CLASS, ELM_INTERFACE_ATSPI_TEXT_INTERFACE, NULL);
\ No newline at end of file

-- 


Reply via email to