void _do_test(AtkObject *obj) { const char *type_name = g_type_name(G_TYPE_FROM_INSTANCE(obj)); g_assert(ATK_IS_OBJECT(obj)); g_assert_cmpstr(type_name, ==, "EailFlipselector"); g_assert(atk_object_get_n_accessible_children(obj) == ITEMS_COUNT); /* * AtkSelection tests */ g_assert(ATK_IS_SELECTION(obj)); /* atk_selection_add_selection test */ g_assert(atk_selection_add_selection(ATK_SELECTION(obj), ITEM_SEL_EINA)); g_assert(atk_selection_is_child_selected(ATK_SELECTION(obj), ITEM_SEL_EINA)); /* atk_selection_clear_selection test */ g_assert(atk_selection_clear_selection(ATK_SELECTION(obj)) == FALSE); /* eail_flipselector_ref_selection test */ g_assert(atk_selection_is_child_selected(ATK_SELECTION(obj), ITEM_SEL_EINA)); /* atk_selection_get_selection_count test */ g_assert(atk_selection_get_selection_count(ATK_SELECTION(obj)) == MAX_SELECTIONS); /* atk_selection_is_child_selected test */ g_assert(atk_selection_is_child_selected(ATK_SELECTION(obj), ITEM_SEL_EINA)); /* atk_selection_remove_selection test */ g_assert(atk_selection_remove_selection(ATK_SELECTION(obj), ITEM_SEL_EINA)); g_assert(atk_selection_is_child_selected(ATK_SELECTION(obj), ITEM_SEL_ELM)); /* atk_selection_select_all_selection test */ g_assert(atk_selection_select_all_selection(ATK_SELECTION(obj)) == FALSE); /* * AtkAction tests */ g_assert(ATK_IS_ACTION(obj)); /* atk_action_get_n_actions test */ g_assert(atk_action_get_n_actions(ATK_ACTION(obj)) == ACTIONS_COUNT); /* test existing actions */ g_assert(atk_selection_add_selection(ATK_SELECTION(obj), ITEM_SEL_EINA)); eailu_test_action_activate(ATK_ACTION(obj), "next"); g_assert(atk_selection_is_child_selected(ATK_SELECTION(obj), ITEM_SEL_EDJE)); eailu_test_action_activate(ATK_ACTION(obj), "prev"); g_assert(atk_selection_is_child_selected(ATK_SELECTION(obj), ITEM_SEL_EINA)); /* test for non-existing action */ g_assert((eailu_get_action_number(ATK_ACTION(obj), "typo")) == -1); /* test set/get action description */ eailu_test_action_description_all(ATK_ACTION(obj)); }
static void _test_selection (AtkObject *obj) { gint count; gint n_children; AtkObject *list; count = atk_selection_get_selection_count (ATK_SELECTION (obj)); g_return_if_fail (count == 0); list = atk_object_ref_accessible_child (obj, 0); n_children = atk_object_get_n_accessible_children (list); g_object_unref (G_OBJECT (list)); atk_selection_add_selection (ATK_SELECTION (obj), n_children - 1); count = atk_selection_get_selection_count (ATK_SELECTION (obj)); g_return_if_fail (count == 1); g_return_if_fail (atk_selection_is_child_selected (ATK_SELECTION (obj), n_children - 1)); atk_selection_add_selection (ATK_SELECTION (obj), 0); count = atk_selection_get_selection_count (ATK_SELECTION (obj)); g_return_if_fail (count == 1); g_return_if_fail (atk_selection_is_child_selected (ATK_SELECTION (obj), 0)); atk_selection_clear_selection (ATK_SELECTION (obj)); count = atk_selection_get_selection_count (ATK_SELECTION (obj)); g_return_if_fail (count == 0); }
static gboolean gal_a11y_e_cell_grab_focus (AtkComponent *component) { GalA11yECell *a11y; gint index; GtkWidget *toplevel; GalA11yETableItem *a11yTableItem; a11y = GAL_A11Y_E_CELL (component); /* for e_cell_vbox's children, we just grab the e_cell_vbox */ if (GAL_A11Y_IS_E_CELL_VBOX (a11y->parent)) { return atk_component_grab_focus (ATK_COMPONENT (a11y->parent)); } a11yTableItem = GAL_A11Y_E_TABLE_ITEM (a11y->parent); index = atk_object_get_index_in_parent (ATK_OBJECT (a11y)); atk_selection_clear_selection (ATK_SELECTION (a11yTableItem)); atk_selection_add_selection (ATK_SELECTION (a11yTableItem), index); gtk_widget_grab_focus ( GTK_WIDGET (GNOME_CANVAS_ITEM (a11y->item)->canvas)); toplevel = gtk_widget_get_toplevel ( GTK_WIDGET (GNOME_CANVAS_ITEM (a11y->item)->canvas)); if (toplevel && gtk_widget_is_toplevel (toplevel)) gtk_window_present (GTK_WINDOW (toplevel)); return TRUE; }
JNIEXPORT jboolean JNICALL Java_org_gnome_atk_AtkSelection_atk_1selection_1clear_1selection ( JNIEnv* env, jclass cls, jlong _self ) { gboolean result; jboolean _result; AtkSelection* self; // convert parameter self self = (AtkSelection*) _self; // call function result = atk_selection_clear_selection(self); // cleanup parameter self // translate return value to JNI type _result = (jboolean) result; // and finally return _result; }
static gboolean gtk_combo_box_accessible_remove_selection (AtkSelection *selection, gint i) { if (atk_selection_is_child_selected (selection, i)) atk_selection_clear_selection (selection); return TRUE; }
static void _test_index_child_for_object(AtkObject *obj, int index) { g_assert(0 == atk_selection_get_selection_count(ATK_SELECTION(obj))); g_assert(atk_selection_add_selection(ATK_SELECTION(obj), index)); g_assert(atk_selection_is_child_selected(ATK_SELECTION(obj), index)); g_assert(1 == atk_selection_get_selection_count(ATK_SELECTION(obj))); g_assert(atk_selection_clear_selection(ATK_SELECTION(obj))); g_assert(0 == atk_selection_get_selection_count(ATK_SELECTION(obj))); }