forked from enlightenment/efl
atspi: implement selection interface for elm_list
This commit is contained in:
parent
84a774f24e
commit
377a7d220e
|
@ -4,6 +4,7 @@
|
|||
|
||||
#define ELM_INTERFACE_ATSPI_ACCESSIBLE_PROTECTED
|
||||
#define ELM_INTERFACE_ATSPI_WIDGET_ACTION_PROTECTED
|
||||
#define ELM_INTERFACE_ATSPI_SELECTION_PROTECTED
|
||||
#define ELM_WIDGET_ITEM_PROTECTED
|
||||
|
||||
#include <Elementary.h>
|
||||
|
@ -3230,5 +3231,94 @@ _elm_list_elm_interface_atspi_accessible_children_get(Eo *eo_item EINA_UNUSED, E
|
|||
return eina_list_clone(pd->items);
|
||||
}
|
||||
|
||||
EOLIAN int
|
||||
_elm_list_elm_interface_atspi_selection_selected_children_count_get(Eo *objm EINA_UNUSED, Elm_List_Data *pd)
|
||||
{
|
||||
return eina_list_count(pd->selected);
|
||||
}
|
||||
|
||||
EOLIAN Eo*
|
||||
_elm_list_elm_interface_atspi_selection_selected_child_get(Eo *obj EINA_UNUSED, Elm_List_Data *pd, int child_idx)
|
||||
{
|
||||
return eina_list_nth(pd->selected, child_idx);
|
||||
}
|
||||
|
||||
EOLIAN Eina_Bool
|
||||
_elm_list_elm_interface_atspi_selection_child_select(Eo *obj EINA_UNUSED, Elm_List_Data *pd, int child_index)
|
||||
{
|
||||
if (pd->select_mode != ELM_OBJECT_SELECT_MODE_NONE)
|
||||
{
|
||||
Eo *item = eina_list_nth(pd->items, child_index);
|
||||
if (item)
|
||||
elm_list_item_selected_set(item, EINA_TRUE);
|
||||
return EINA_TRUE;
|
||||
}
|
||||
return EINA_FALSE;
|
||||
}
|
||||
|
||||
EOLIAN Eina_Bool
|
||||
_elm_list_elm_interface_atspi_selection_selected_child_deselect(Eo *obj EINA_UNUSED, Elm_List_Data *pd, int child_index)
|
||||
{
|
||||
Eo *item = eina_list_nth(pd->selected, child_index);
|
||||
if (item)
|
||||
{
|
||||
elm_list_item_selected_set(item, EINA_FALSE);
|
||||
return EINA_TRUE;
|
||||
}
|
||||
return EINA_FALSE;
|
||||
}
|
||||
|
||||
EOLIAN Eina_Bool
|
||||
_elm_list_elm_interface_atspi_selection_is_child_selected(Eo *obj EINA_UNUSED, Elm_List_Data *pd, int child_index)
|
||||
{
|
||||
Eo *item = eina_list_nth(pd->items, child_index);
|
||||
if (item)
|
||||
return elm_list_item_selected_get(item);
|
||||
|
||||
return EINA_FALSE;
|
||||
}
|
||||
|
||||
EOLIAN Eina_Bool
|
||||
_elm_list_elm_interface_atspi_selection_all_children_select(Eo *obj EINA_UNUSED, Elm_List_Data *pd)
|
||||
{
|
||||
Eo *it;
|
||||
Eina_List *l;
|
||||
|
||||
if (pd->select_mode == ELM_OBJECT_SELECT_MODE_NONE)
|
||||
return EINA_FALSE;
|
||||
|
||||
EINA_LIST_FOREACH(pd->items, l, it)
|
||||
elm_list_item_selected_set(it, EINA_TRUE);
|
||||
|
||||
return EINA_TRUE;
|
||||
}
|
||||
|
||||
EOLIAN Eina_Bool
|
||||
_elm_list_elm_interface_atspi_selection_clear(Eo *obj EINA_UNUSED, Elm_List_Data *pd)
|
||||
{
|
||||
Eo *it;
|
||||
Eina_List *l;
|
||||
|
||||
if (pd->select_mode == ELM_OBJECT_SELECT_MODE_NONE)
|
||||
return EINA_FALSE;
|
||||
|
||||
EINA_LIST_FOREACH(pd->items, l, it)
|
||||
elm_list_item_selected_set(it, EINA_FALSE);
|
||||
|
||||
return EINA_TRUE;
|
||||
}
|
||||
|
||||
EOLIAN Eina_Bool
|
||||
_elm_list_elm_interface_atspi_selection_child_deselect(Eo *obj EINA_UNUSED, Elm_List_Data *pd, int child_index)
|
||||
{
|
||||
Eo *item = eina_list_nth(pd->items, child_index);
|
||||
if (item)
|
||||
{
|
||||
elm_list_item_selected_set(item, EINA_FALSE);
|
||||
return EINA_TRUE;
|
||||
}
|
||||
return EINA_FALSE;
|
||||
}
|
||||
|
||||
#include "elm_list.eo.c"
|
||||
#include "elm_list_item.eo.c"
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
class Elm_List (Elm_Layout, Elm_Interface_Scrollable,
|
||||
Elm_Interface_Atspi_Widget_Action)
|
||||
Elm_Interface_Atspi_Widget_Action, Elm_Interface_Atspi_Selection)
|
||||
{
|
||||
eo_prefix: elm_obj_list;
|
||||
properties {
|
||||
|
@ -610,6 +610,14 @@ class Elm_List (Elm_Layout, Elm_Interface_Scrollable,
|
|||
Elm_Interface_Scrollable.policy.set;
|
||||
Elm_Interface_Atspi_Widget_Action.elm_actions.get;
|
||||
Elm_Interface_Atspi_Accessible.children.get;
|
||||
Elm_Interface_Atspi_Selection.selected_children_count.get;
|
||||
Elm_Interface_Atspi_Selection.selected_child.get;
|
||||
Elm_Interface_Atspi_Selection.selected_child_deselect;
|
||||
Elm_Interface_Atspi_Selection.child_select;
|
||||
Elm_Interface_Atspi_Selection.child_deselect;
|
||||
Elm_Interface_Atspi_Selection.is_child_selected;
|
||||
Elm_Interface_Atspi_Selection.all_children_select;
|
||||
Elm_Interface_Atspi_Selection.clear;
|
||||
}
|
||||
events {
|
||||
activated;
|
||||
|
|
Loading…
Reference in New Issue