elm_code: Tidy up some unused code and fix up some focus management

This commit is contained in:
Andy Williams 2015-02-10 23:02:45 +00:00
parent 4b85f85391
commit 288f408d88
3 changed files with 29 additions and 20 deletions

View File

@ -489,12 +489,6 @@ _elm_code_widget_event_veto_cb(void *data, Evas_Object *obj EINA_UNUSED,
widget = (Elm_Code_Widget *)data;
pd = eo_data_scope_get(widget, ELM_CODE_WIDGET_CLASS);
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;
@ -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)
{
printf("scroll to %d, %d\n", x, y);
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)
{
return EINA_FALSE;
}
EOLIAN static void

View File

@ -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;

View File

@ -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);
EO_DEFINE_CLASS(elm_code_widget_class_get, &_elm_code_widget_class_desc, ELM_BOX_CLASS, ELM_INTERFACE_ATSPI_TEXT_INTERFACE, NULL);