void disconnectAccessibilityCallbacks() { // Only disconnect if logging is off and there is no notification handler. if (loggingAccessibilityEvents || !notificationHandlers.isEmpty()) return; // AtkObject signals. if (stateChangeListenerId) { atk_remove_global_event_listener(stateChangeListenerId); stateChangeListenerId = 0; } if (focusEventListenerId) { atk_remove_global_event_listener(focusEventListenerId); focusEventListenerId = 0; } if (activeDescendantChangedListenerId) { atk_remove_global_event_listener(activeDescendantChangedListenerId); activeDescendantChangedListenerId = 0; } if (childrenChangedListenerId) { atk_remove_global_event_listener(childrenChangedListenerId); childrenChangedListenerId = 0; } if (propertyChangedListenerId) { atk_remove_global_event_listener(propertyChangedListenerId); propertyChangedListenerId = 0; } if (visibleDataChangedListenerId) { atk_remove_global_event_listener(visibleDataChangedListenerId); visibleDataChangedListenerId = 0; } }
void disconnectAccessibilityCallbacks() { // AtkObject signals. if (stateChangeListenerId) { atk_remove_global_event_listener(stateChangeListenerId); stateChangeListenerId = 0; } if (focusEventListenerId) { atk_remove_global_event_listener(focusEventListenerId); focusEventListenerId = 0; } if (activeDescendantChangedListenerId) { atk_remove_global_event_listener(activeDescendantChangedListenerId); activeDescendantChangedListenerId = 0; } if (childrenChangedListenerId) { atk_remove_global_event_listener(childrenChangedListenerId); childrenChangedListenerId = 0; } if (propertyChangedListenerId) { atk_remove_global_event_listener(propertyChangedListenerId); propertyChangedListenerId = 0; } if (visibleDataChangedListenerId) { atk_remove_global_event_listener(visibleDataChangedListenerId); visibleDataChangedListenerId = 0; } }
bool AccessibilityNotificationHandler::disconnectAccessibilityCallbacks() { // Only disconnect if there is no notification handler. if (!notificationHandlers.isEmpty() || globalNotificationHandler) return false; // AtkObject signals. for (int i = 0; i < listenerIds.size(); i++) { ASSERT(listenerIds[i]); atk_remove_global_event_listener(listenerIds[i]); } listenerIds.clear(); return true; }
static gboolean _button_press_event_watcher (GSignalInvocationHint *ihint, guint n_param_values, const GValue *param_values, gpointer data) { GObject *object; gchar * button_name = (gchar *) data; object = g_value_get_object (param_values + 0); if (ATK_IS_IMPLEMENTOR(object)) { AtkObject * atk_obj = atk_implementor_ref_accessible(ATK_IMPLEMENTOR(object)); g_print("Button <%s> pressed %d times!\n", button_name, (g_press_count + 1)); g_print("Displaying children of Button pressed!\n"); display_children(atk_obj, 0, 0); if (g_press_count >= 5) { g_print("Removing global event listener on buttons\n"); atk_remove_global_event_listener(g_signal_listener); g_signal_listener = 0; g_press_count = 0; g_register_listener = FALSE; } else { g_press_count++; } } return TRUE; }
bool AccessibilityNotificationHandler::disconnectAccessibilityCallbacks() { // Only disconnect if there is no notification handler. if (!notificationHandlers.isEmpty() || globalNotificationHandler) return false; // AtkObject signals. if (stateChangeListenerId) { atk_remove_global_event_listener(stateChangeListenerId); stateChangeListenerId = 0; } if (focusEventListenerId) { atk_remove_global_event_listener(focusEventListenerId); focusEventListenerId = 0; } if (activeDescendantChangedListenerId) { atk_remove_global_event_listener(activeDescendantChangedListenerId); activeDescendantChangedListenerId = 0; } if (childrenChangedListenerId) { atk_remove_global_event_listener(childrenChangedListenerId); childrenChangedListenerId = 0; } if (propertyChangedListenerId) { atk_remove_global_event_listener(propertyChangedListenerId); propertyChangedListenerId = 0; } if (visibleDataChangedListenerId) { atk_remove_global_event_listener(visibleDataChangedListenerId); visibleDataChangedListenerId = 0; } if (loadCompleteListenerId) { atk_remove_global_event_listener(loadCompleteListenerId); loadCompleteListenerId = 0; } return true; }