void _register_cb(void *data, Evas_Object *win, void *event_info) { Evas_Object *eo = (Evas_Object *)data; AtkObject *obj, *obj_item; obj = eail_factory_get_accessible(eo); atk_object_set_description(obj, DESCRITPION); atk_object_set_name (obj, NAME); obj_item = atk_object_ref_accessible_child(obj,0); atk_object_set_description(obj_item, DESCRITPION_ITEM); atk_object_set_name (obj_item, NAME_ITEM); }
static GtkWidget *getCloseButton(TaskTitle* title) { //Create the button GtkWidget *button = g_object_new ( GTK_TYPE_EVENT_BOX, "visible-window", FALSE, "above-child", TRUE, NULL ); //Add accessibility AtkObject *atk = gtk_widget_get_accessible (button); atk_object_set_name (atk, _("Close")); atk_object_set_description (atk, _("Close current window.")); atk_object_set_role (atk, ATK_ROLE_PUSH_BUTTON); //Connect the signals g_signal_connect (button, "button-release-event", G_CALLBACK (on_close_clicked), title); g_signal_connect (button, "enter-notify-event", G_CALLBACK (on_enter_notify), title); g_signal_connect (button, "leave-notify-event", G_CALLBACK (on_leave_notify), title); g_signal_connect (button, "draw", G_CALLBACK (on_button_draw), title); return button; }
void _register_cb(void *data, Evas_Object *win, void *event_info) { Evas_Object *eo = (Evas_Object *)data; AtkObject *obj; obj = eail_factory_get_accessible(eo); atk_object_set_description(obj, DESCRITPION); atk_object_set_name (obj, NAME); }
static gboolean app_state_changed_idle (gpointer user_data) { GsFeatureTile *tile = GS_FEATURE_TILE (user_data); AtkObject *accessible; g_autofree gchar *name = NULL; accessible = gtk_widget_get_accessible (GTK_WIDGET (tile)); switch (gs_app_get_state (tile->app)) { case AS_APP_STATE_INSTALLED: case AS_APP_STATE_INSTALLING: case AS_APP_STATE_REMOVING: case AS_APP_STATE_UPDATABLE: case AS_APP_STATE_UPDATABLE_LIVE: name = g_strdup_printf ("%s (%s)", gs_app_get_name (tile->app), _("Installed")); break; case AS_APP_STATE_AVAILABLE: default: name = g_strdup (gs_app_get_name (tile->app)); break; } if (GTK_IS_ACCESSIBLE (accessible)) { atk_object_set_name (accessible, name); atk_object_set_description (accessible, gs_app_get_summary (tile->app)); } g_object_unref (tile); return G_SOURCE_REMOVE; }
static void _check_values (AtkObject *obj) { static gint calls = 0; AtkRole role; g_print ("Start of _check_values\n"); _set_values(obj); _add_handler (obj); if (++calls < 2) { /* * Just do this on this on the first 2 objects visited */ atk_object_set_name (obj, "test123"); atk_object_set_description (obj, "test123"); } role = atk_object_get_role (obj); if (role == ATK_ROLE_FRAME || role == ATK_ROLE_DIALOG) { /* * Add handlers to all children. */ _traverse_children (obj); } g_print ("End of _check_values\n"); }
static void update_tile (HardDriveStatusTile * tile) { HardDriveStatusTilePrivate *priv = HARD_DRIVE_STATUS_TILE_GET_PRIVATE (tile); AtkObject *accessible; gchar *markup = NULL; gchar *available; gchar *capacity; compute_usage (tile); available = size_bytes_to_string (priv->available_bytes); capacity = size_bytes_to_string (priv->capacity_bytes); markup = g_strdup_printf (_("Home: %s Free / %s"), available, capacity); gtk_label_set_text (GTK_LABEL (NAMEPLATE_TILE (tile)->subheader), markup); accessible = gtk_widget_get_accessible (GTK_WIDGET (tile)); if (markup) atk_object_set_description (accessible, markup); g_free (available); g_free (capacity); g_free (markup); }
static gboolean accessx_status_applet_fill(MatePanelApplet* applet) { AccessxStatusApplet* sapplet; AtkObject* atk_object; GtkActionGroup* action_group; gchar* ui_path; gboolean was_realized = FALSE; sapplet = create_applet(applet); if (!gtk_widget_get_realized(sapplet->box)) { g_signal_connect_after(G_OBJECT(sapplet->box), "realize", G_CALLBACK(accessx_status_applet_realize), sapplet); } else { accessx_status_applet_initialize(sapplet); was_realized = TRUE; } g_object_connect(sapplet->applet, "signal::destroy", accessx_status_applet_destroy, sapplet, "signal::change_orient", accessx_status_applet_reorient, sapplet, "signal::change_size", accessx_status_applet_resize, sapplet, NULL); g_signal_connect(sapplet->applet, "button_press_event", G_CALLBACK(button_press_cb), sapplet); g_signal_connect(sapplet->applet, "key_press_event", G_CALLBACK(key_press_cb), sapplet); action_group = gtk_action_group_new("Accessx Applet Actions"); gtk_action_group_set_translation_domain(action_group, GETTEXT_PACKAGE); gtk_action_group_add_actions(action_group, accessx_status_applet_menu_actions, G_N_ELEMENTS(accessx_status_applet_menu_actions), sapplet); ui_path = g_build_filename(ACCESSX_MENU_UI_DIR, "accessx-status-applet-menu.xml", NULL); mate_panel_applet_setup_menu_from_file(sapplet->applet, ui_path, action_group); g_free(ui_path); if (mate_panel_applet_get_locked_down(sapplet->applet)) { GtkAction* action = gtk_action_group_get_action(action_group, "Dialog"); gtk_action_set_visible(action, FALSE); } g_object_unref(action_group); gtk_widget_set_tooltip_text(GTK_WIDGET(sapplet->applet), _("Keyboard Accessibility Status")); atk_object = gtk_widget_get_accessible(GTK_WIDGET(sapplet->applet)); atk_object_set_name(atk_object, _("AccessX Status")); atk_object_set_description(atk_object, _("Displays current state of keyboard accessibility features")); gtk_widget_show_all(GTK_WIDGET(sapplet->applet)); if (was_realized) { accessx_status_applet_reset(sapplet); } mate_panel_applet_set_background_widget (sapplet->applet, GTK_WIDGET (sapplet->applet)); return TRUE; }
static void mcus_led_accessible_initialize (AtkObject *accessible, gpointer widget) { atk_object_set_name (accessible, _("Single LED widget")); atk_object_set_description (accessible, _("Provides visual Boolean output")); a11y_parent_class->initialize (accessible, widget); }
static void _gtk_switch_accessible_initialize (AtkObject *accessible, gpointer widget) { ATK_OBJECT_CLASS (_gtk_switch_accessible_parent_class)->initialize (accessible, widget); atk_object_set_role (accessible, ATK_ROLE_TOGGLE_BUTTON); atk_object_set_name (accessible, C_("light switch widget", "Switch")); atk_object_set_description (accessible, _("Switches between on and off states")); }
void eel_accessibility_set_description (gpointer object, const char *description) { AtkObject *atk_object = eel_accessibility_for_object (object); if (atk_object) { atk_object_set_description (atk_object, description); } }
static void gtk_spinner_accessible_initialize (AtkObject *accessible, gpointer widget) { ATK_OBJECT_CLASS (_gtk_spinner_accessible_parent_class)->initialize (accessible, widget); atk_object_set_name (accessible, C_("throbbing progress animation widget", "Spinner")); atk_object_set_description (accessible, _("Provides visual indication of progress")); atk_object_set_role (accessible, ATK_ROLE_ANIMATION); }
/* * CORBA Accessibility::Accessible::set_description method implementation */ static void impl_accessibility_accessible_set_description (PortableServer_Servant servant, const CORBA_char *descr, CORBA_Environment *ev) { AtkObject *object = get_atkobject_from_servant (servant); g_return_if_fail (object != NULL); atk_object_set_description (object, descr); }
static void ygtk_step_update_layout (YGtkSteps *steps, gint step) { if (step < 0) return; gboolean bold = steps->current_step == step; GList *children = gtk_container_get_children (GTK_CONTAINER (steps)); GtkWidget *label = (GtkWidget *) g_list_nth_data (children, step); if (g_object_get_data (G_OBJECT (label), "is-header")) return; if (bold) { PangoAttrList *attrbs = pango_attr_list_new(); pango_attr_list_insert (attrbs, pango_attr_weight_new (PANGO_WEIGHT_BOLD)); gtk_label_set_attributes (GTK_LABEL (label), attrbs); pango_attr_list_unref (attrbs); atk_object_set_description (gtk_widget_get_accessible (label), _("Current step")); } else { gtk_label_set_attributes (GTK_LABEL (label), NULL); atk_object_set_description (gtk_widget_get_accessible (label), ""); } g_list_free (children); }
static void set_atk_name_description (GtkWidget *widget, const gchar *name, const gchar *description) { AtkObject *aobj = gtk_widget_get_accessible (widget); /* Check if gail is loaded */ if (GTK_IS_ACCESSIBLE (aobj) == FALSE) return; atk_object_set_name (aobj, name); atk_object_set_description (aobj, description); }
static void _do_test(AtkObject *obj) { g_assert(ATK_IS_OBJECT(obj)); g_assert(atk_object_get_role(obj) == ATK_ROLE_ANIMATION); atk_object_set_description(obj, "test"); g_assert_cmpstr(atk_object_get_description(obj), ==, "test"); atk_object_set_name(obj, "test name"); g_assert_cmpstr(atk_object_get_name(obj), ==, "test name"); eailu_test_code_called = 1; }
static void set_atk_name_description (GtkWidget *widget, const char *name, const char *description) { AtkObject *aobj; aobj = gtk_widget_get_accessible (widget); if (!GTK_IS_ACCESSIBLE (aobj)) return; atk_object_set_name (aobj, name); atk_object_set_description (aobj, description); }
static void wnck_selector_init (WnckSelector *selector) { AtkObject *atk_obj; atk_obj = gtk_widget_get_accessible (GTK_WIDGET (selector)); atk_object_set_name (atk_obj, _("Window Selector")); atk_object_set_description (atk_obj, _("Tool to switch between windows")); selector->priv = WNCK_SELECTOR_GET_PRIVATE (selector); selector->priv->size = -1; gtk_widget_add_events (GTK_WIDGET (selector), GDK_SCROLL_MASK); }
static AtkObject* fm_compact_view_get_accessible (GtkWidget *widget) { AtkObject *object; /* query the atk object for the icon view class */ object = (*GTK_WIDGET_CLASS (fm_compact_view_parent_class)->get_accessible) (widget); /* set custom Atk properties for the icon view */ if (G_LIKELY (object != NULL)) { atk_object_set_description (object, _("Compact directory listing")); atk_object_set_name (object, _("Compact view")); atk_object_set_role (object, ATK_ROLE_DIRECTORY_PANE); } return object; }
/** * gedit_utils_set_atk_name_description: * @widget: The Gtk widget for which name/description to be set * @name: Atk name string * @description: Atk description string * * This function sets up name and description * for a specified gtk widget. */ void gedit_utils_set_atk_name_description (GtkWidget *widget, const gchar *name, const gchar *description) { AtkObject *aobj; aobj = gtk_widget_get_accessible (widget); if (!(GTK_IS_ACCESSIBLE (aobj))) return; if (name) atk_object_set_name (aobj, name); if (description) atk_object_set_description (aobj, description); }
static void _do_test(AtkObject *obj) { int child_count = 0; g_assert(ATK_IS_OBJECT(obj)); atk_object_set_description(obj, "test"); g_assert_cmpstr(atk_object_get_description(obj), ==, "test"); g_object_ref(obj); child_count = atk_object_get_n_accessible_children(obj); g_assert(child_count == 0); g_assert(atk_object_get_role(obj) == ATK_ROLE_PAGE_TAB_LIST); g_object_unref(obj); eailu_test_code_called = 1; }
static void accessx_status_applet_layout_box(AccessxStatusApplet* sapplet, GtkWidget* box, GtkWidget* stickyfoo) { AtkObject* atko; accessx_status_applet_reparent_widget(sapplet->shift_indicator, GTK_CONTAINER(stickyfoo)); accessx_status_applet_reparent_widget(sapplet->ctrl_indicator, GTK_CONTAINER(stickyfoo)); accessx_status_applet_reparent_widget(sapplet->alt_indicator, GTK_CONTAINER(stickyfoo)); accessx_status_applet_reparent_widget(sapplet->meta_indicator, GTK_CONTAINER(stickyfoo)); accessx_status_applet_reparent_widget(sapplet->hyper_indicator, GTK_CONTAINER(stickyfoo)); accessx_status_applet_reparent_widget(sapplet->super_indicator, GTK_CONTAINER(stickyfoo)); accessx_status_applet_reparent_widget(sapplet->alt_graph_indicator, GTK_CONTAINER(stickyfoo)); accessx_status_applet_reparent_widget(sapplet->idlefoo, GTK_CONTAINER(box)); accessx_status_applet_reparent_widget(sapplet->mousefoo, GTK_CONTAINER(box)); accessx_status_applet_reparent_widget(stickyfoo, GTK_CONTAINER(box)); accessx_status_applet_reparent_widget(sapplet->slowfoo, GTK_CONTAINER(box)); accessx_status_applet_reparent_widget(sapplet->bouncefoo, GTK_CONTAINER(box)); if (sapplet->stickyfoo) { gtk_widget_destroy(sapplet->stickyfoo); } if (sapplet->box) { gtk_container_remove(GTK_CONTAINER(sapplet->applet), sapplet->box); } gtk_container_add(GTK_CONTAINER(sapplet->applet), box); sapplet->stickyfoo = stickyfoo; sapplet->box = box; atko = gtk_widget_get_accessible(sapplet->box); atk_object_set_name(atko, _("AccessX Status")); atk_object_set_description(atko, _("Shows keyboard status when accessibility features are used.")); gtk_widget_show(sapplet->box); gtk_widget_show(GTK_WIDGET(sapplet->applet)); if (gtk_widget_get_realized(sapplet->box) && sapplet->initialized) { accessx_status_applet_update(sapplet, ACCESSX_STATUS_ALL, NULL); } }
/* sets accessible name and description */ void set_access_namedesc(GtkWidget* widget, const gchar* name, const gchar* desc) { AtkObject* obj = gtk_widget_get_accessible(widget); if (!GTK_IS_ACCESSIBLE(obj)) { return; } if (desc) { atk_object_set_description(obj, desc); } if (name) { atk_object_set_name(obj, name); } }
static gboolean app_state_changed_idle (gpointer user_data) { GsPopularTile *tile = GS_POPULAR_TILE (user_data); AtkObject *accessible; GtkWidget *label; gboolean installed; g_autofree gchar *name = NULL; accessible = gtk_widget_get_accessible (GTK_WIDGET (tile)); label = gtk_bin_get_child (GTK_BIN (tile->eventbox)); switch (gs_app_get_state (tile->app)) { case AS_APP_STATE_INSTALLED: case AS_APP_STATE_INSTALLING: case AS_APP_STATE_REMOVING: case AS_APP_STATE_UPDATABLE: case AS_APP_STATE_UPDATABLE_LIVE: installed = TRUE; name = g_strdup_printf ("%s (%s)", gs_app_get_name (tile->app), _("Installed")); /* TRANSLATORS: this is the small blue label on the tile * that tells the user the application is installed */ gtk_label_set_label (GTK_LABEL (label), _("Installed")); break; case AS_APP_STATE_AVAILABLE: default: installed = FALSE; name = g_strdup (gs_app_get_name (tile->app)); break; } gtk_widget_set_visible (tile->eventbox, installed); if (GTK_IS_ACCESSIBLE (accessible)) { atk_object_set_name (accessible, name); atk_object_set_description (accessible, gs_app_get_summary (tile->app)); } g_object_unref (tile); return G_SOURCE_REMOVE; }
static void _do_test(AtkObject *obj) { int child_count = 0; atk_object_set_description(obj, "test"); g_assert_cmpstr(atk_object_get_description(obj), ==, "test"); atk_object_set_name(obj, "test name"); g_assert_cmpstr(atk_object_get_name(obj), ==, "test name"); child_count = atk_object_get_n_accessible_children(obj); g_assert(child_count == 0); eailu_test_atk_focus(obj, TRUE); _printf("DONE. All WEB tests passed successfully \n"); eailu_test_code_called = 1; }
static void matewnck_selector_init (MatewnckSelector *selector) { AtkObject *atk_obj; atk_obj = gtk_widget_get_accessible (GTK_WIDGET (selector)); atk_object_set_name (atk_obj, _("Window Selector")); atk_object_set_description (atk_obj, _("Tool to switch between windows")); selector->priv = MATEWNCK_SELECTOR_GET_PRIVATE (selector); selector->priv->image = NULL; selector->priv->icon_window = NULL; selector->priv->menu = NULL; selector->priv->no_windows_item = NULL; selector->priv->window_hash = NULL; selector->priv->size = -1; }
void panel_a11y_set_atk_name_desc (GtkWidget *widget, const char *name, const char *desc) { AtkObject *aobj; g_return_if_fail (GTK_IS_WIDGET (widget)); if (!panel_a11y_get_is_a11y_enabled (widget)) return; aobj = gtk_widget_get_accessible (widget); if (name) atk_object_set_name (aobj, name); if (desc) atk_object_set_description (aobj, desc); }
const gchar * getDescriptionCB(AtkObject *aAtkObj) { nsAccessibleWrap *accWrap = GetAccessibleWrap(aAtkObj); if (!accWrap) { return nsnull; } /* nsIAccessible is responsible for the non-NULL description */ nsAutoString uniDesc; nsresult rv = accWrap->GetDescription(uniDesc); NS_ENSURE_SUCCESS(rv, nsnull); NS_ConvertUTF8toUTF16 objDesc(aAtkObj->description); if (!uniDesc.Equals(objDesc)) { atk_object_set_description(aAtkObj, NS_ConvertUTF16toUTF8(uniDesc).get()); } return aAtkObj->description; }
static void task_item_setup_atk (TaskItem *item) { TaskItemPrivate *priv; GtkWidget *widget; AtkObject *atk; WnckWindow *window; g_return_if_fail (TASK_IS_ITEM (item)); widget = GTK_WIDGET (item); priv = item->priv; window = priv->window; g_return_if_fail (WNCK_IS_WINDOW (window)); atk = gtk_widget_get_accessible (widget); atk_object_set_name (atk, _("Window Task Button")); atk_object_set_description (atk, wnck_window_get_name (window)); atk_object_set_role (atk, ATK_ROLE_PUSH_BUTTON); }
static void set_ally_name_desc (GtkWidget *widget, FishApplet *fish) { const char *name_format = _("%s the Fish"); const char *desc_format = _("%s the Fish, a contemporary oracle"); AtkObject *obj; char *desc, *name; obj = gtk_widget_get_accessible (widget); /* Return immediately if GAIL is not loaded */ if (!GTK_IS_ACCESSIBLE (obj)) return; name = g_strdup_printf (name_format, fish->name); atk_object_set_name (obj, name); g_free (name); desc = g_strdup_printf (desc_format, fish->name); atk_object_set_description (obj, desc); g_free (desc); }
static void _do_test(AtkObject *obj) { AtkStateSet *state_set = atk_object_ref_state_set(obj); const char *name; g_assert(ATK_IS_OBJECT(obj)); g_assert(atk_object_get_role(obj) == ATK_ROLE_RADIO_BUTTON); atk_object_set_description(obj, "test"); g_assert_cmpstr(atk_object_get_description(obj), ==, "test"); name = atk_object_get_name(obj); if (!strcmp(name, RADIO1)) { state_set = atk_object_ref_state_set(obj); g_assert(!atk_state_set_contains_state(state_set, ATK_STATE_CHECKED)); g_object_unref(state_set); ++name_test_passed; atk_object_set_name(obj, TEST_NAME); g_assert_cmpstr(atk_object_get_name(obj), ==, TEST_NAME); }