Esempio n. 1
0
JNIEXPORT void JNICALL ATK_NATIVE(_1atk_1focus_1tracker_1notify)
	(JNIEnv *env, jclass that, jint arg0)
{
	ATK_NATIVE_ENTER(env, that, _1atk_1focus_1tracker_1notify_FUNC);
	atk_focus_tracker_notify((AtkObject *)arg0);
	ATK_NATIVE_EXIT(env, that, _1atk_1focus_1tracker_1notify_FUNC);
}
Esempio n. 2
0
static gboolean
gail_notebook_check_focus_tab (gpointer data)
{
  GtkWidget *widget;
  AtkObject *atk_obj;
  gint focus_page_num, old_focus_page_num;
  GailNotebook *gail_notebook;
  GtkNotebook *gtk_notebook;

  atk_obj = ATK_OBJECT (data);
  gail_notebook = GAIL_NOTEBOOK (atk_obj);
  widget = gtk_accessible_get_widget (GTK_ACCESSIBLE (atk_obj));

  gtk_notebook = GTK_NOTEBOOK (widget);

  gail_notebook->idle_focus_id = 0;

  focus_page_num = gtk_notebook_get_current_page (gtk_notebook);
  if (focus_page_num == -1)
    return FALSE;

  old_focus_page_num = gail_notebook->focus_tab_page;
  gail_notebook->focus_tab_page = focus_page_num;
  if (old_focus_page_num != focus_page_num)
    {
      AtkObject *obj;

      obj = atk_object_ref_accessible_child (atk_obj, focus_page_num);
      atk_focus_tracker_notify (obj);
      g_object_unref (obj);
    }

  return FALSE;
}
Esempio n. 3
0
static void
gail_focus_notify (GtkWidget *widget)
{
  AtkObject *atk_obj;
  gboolean transient;

  if (widget != _focus_widget)
    {
      if (_focus_widget)
        {
          void *vp_focus_widget = &_focus_widget;
          g_object_remove_weak_pointer (G_OBJECT (_focus_widget), vp_focus_widget);
        }
      _focus_widget = widget;
      if (_focus_widget)
        {
          void *vp_focus_widget = &_focus_widget;
          g_object_add_weak_pointer (G_OBJECT (_focus_widget), vp_focus_widget);
          /*
           * The UI may not have been updated yet; e.g. in gtkhtml2
           * html_view_layout() is called in a idle handler
           */
          if (_focus_widget == focus_before_menu)
            {
              void *vp_focus_before_menu = &focus_before_menu;
              g_object_remove_weak_pointer (G_OBJECT (focus_before_menu), vp_focus_before_menu);
              focus_before_menu = NULL;
            }
        }
      gail_focus_notify_when_idle (_focus_widget);
    }
  else
    {
      if (_focus_widget)
        atk_obj  = get_accessible_for_widget (_focus_widget, &transient);
      else
        atk_obj = NULL;
      /*
       * Do not report focus on redundant object
       */
      G_GNUC_BEGIN_IGNORE_DEPRECATIONS;
      if (atk_obj &&
	  (atk_object_get_role(atk_obj) != ATK_ROLE_REDUNDANT_OBJECT))
	  atk_focus_tracker_notify (atk_obj);
      G_GNUC_END_IGNORE_DEPRECATIONS;
      if (atk_obj && transient)
        g_object_unref (atk_obj);
      if (subsequent_focus_widget)
        {
          GtkWidget *tmp_widget = subsequent_focus_widget;
          subsequent_focus_widget = NULL;
          gail_focus_notify_when_idle (tmp_widget);
        }
    }
}
Esempio n. 4
0
static void
gtk_html_a11y_grab_focus_cb (GtkWidget *widget)
{
	AtkObject *focus_object, *obj, *clue;

	focus_object = gtk_html_a11y_get_focus_object (widget);
	if (focus_object == NULL)
		return;

	obj = gtk_widget_get_accessible (widget);

	clue = html_utils_get_accessible (GTK_HTML (widget)->engine->clue, obj);
	atk_object_set_parent (clue, obj);

	gtk_html_a11y_focus_object = focus_object;
	atk_focus_tracker_notify (focus_object);
}
Esempio n. 5
0
static void
gtk_html_a11y_initialize (AtkObject *obj,
                          gpointer data)
{
	GtkWidget *widget;
	GtkHTML *html;
	AtkObject *accessible;
	AtkObject *focus_object = NULL;

	/* printf ("gtk_html_a11y_initialize\n"); */

	if (ATK_OBJECT_CLASS (parent_class)->initialize)
		ATK_OBJECT_CLASS (parent_class)->initialize (obj, data);

	g_object_set_data (G_OBJECT (obj), GTK_HTML_ID, data);

	obj->role = ATK_ROLE_PANEL;

	widget = gtk_accessible_get_widget (GTK_ACCESSIBLE (obj));
	accessible = ATK_OBJECT (obj);

	g_signal_connect (widget, "grab_focus",
			G_CALLBACK (gtk_html_a11y_grab_focus_cb),
			NULL);
	g_signal_connect (widget, "cursor_changed",
			G_CALLBACK (gtk_html_a11y_cursor_changed_cb),
			NULL);
	g_signal_connect_after (widget, "object_inserted",
			G_CALLBACK (gtk_html_a11y_insert_object_cb),
			NULL);
	g_signal_connect_after (widget, "object_delete",
			G_CALLBACK (gtk_html_a11y_delete_object_cb),
			NULL);

	html = GTK_HTML (widget);

	if (html->engine != NULL && html->engine->clue != NULL) {
		html_utils_get_accessible (html->engine->clue, accessible);
		focus_object = gtk_html_a11y_get_focus_object (widget);
	}

	if (focus_object && gtk_html_a11y_focus_object != focus_object) {
		gtk_html_a11y_focus_object = focus_object;
		atk_focus_tracker_notify (focus_object);
	}
}
static gboolean
focus_me (GtkWidget *widget)
{
	AtkObject *aobject = atk_implementor_ref_accessible (
		ATK_IMPLEMENTOR (widget));
	
	/* Force a focus event - even if the WM focused
	 * us before our at-bridge's idle handler registered
	 * our interest */
	if (!GTK_WIDGET_HAS_FOCUS (widget))
		gtk_widget_grab_focus (widget);
/*	else: FIXME - gtk_widget_grab_focus should send a notify */
		atk_focus_tracker_notify (aobject);
	
	g_object_unref (G_OBJECT (aobject));

	return FALSE;
}
Esempio n. 7
0
/**
 * Wrapper for atk_focus_tracker_notify().
 */
static PyObject*
_atkutil_focus_tracker_notify (PyObject *self, PyObject *args)
{
    PyObject *obj;
    
    debug ("_atkutil_focus_tracker_notify\n");

    if (!PyArg_ParseTuple (args, "O:focus_tracker_notify\n", &obj))
        return NULL;

    if (!PyObject_TypeCheck (obj, &PyAtkObject_Type))
    {
        PyErr_SetString (PyExc_TypeError, "parameter must be an AtkObject");
        return NULL;
    }
    atk_focus_tracker_notify (ATKOBJECT (obj));
    Py_RETURN_NONE;
}
Esempio n. 8
0
static void
gtk_html_a11y_delete_object_cb (GtkWidget *widget,
                                gint pos,
                                gint len)
{
	AtkObject * a11y;

	a11y = gtk_html_a11y_get_focus_object (widget);
	g_return_if_fail (a11y != NULL);

	if (gtk_html_a11y_focus_object != a11y) {
		gtk_html_a11y_focus_object = a11y;
		atk_focus_tracker_notify (a11y);
	}

	if (G_IS_HTML_A11Y_TEXT (a11y)) {
		g_signal_emit_by_name (a11y, "text_changed::delete", pos, len);
	}
}
Esempio n. 9
0
static void
eti_a11y_reset_focus_object (GalA11yETableItem *a11y,
                             ETableItem *item,
                             gboolean notify)
{
	ESelectionModel * esm;
	gint cursor_row, cursor_col, view_row, view_col;
	AtkObject *cell, *old_cell;

	esm = item->selection;
	g_return_if_fail (esm);

	cursor_row = e_selection_model_cursor_row (esm);
	cursor_col = e_selection_model_cursor_col (esm);

	view_row = model_to_view_row (item, cursor_row);
	view_col = model_to_view_col (item, cursor_col);

	if (view_row == -1)
		view_row = 0;
	if (view_col == -1)
		view_col = 0;

	old_cell = (AtkObject *)g_object_get_data (G_OBJECT (a11y), "gail-focus-object");
	if (old_cell && GAL_A11Y_IS_E_CELL (old_cell))
		gal_a11y_e_cell_remove_state (
			GAL_A11Y_E_CELL (old_cell), ATK_STATE_FOCUSED, FALSE);
	if (old_cell)
		g_object_unref (old_cell);

	cell = eti_ref_at (ATK_TABLE (a11y), view_row, view_col);

	if (cell != NULL) {
		g_object_set_data (G_OBJECT (a11y), "gail-focus-object", cell);
		gal_a11y_e_cell_add_state (
			GAL_A11Y_E_CELL (cell), ATK_STATE_FOCUSED, FALSE);
	} else
		g_object_set_data (G_OBJECT (a11y), "gail-focus-object", NULL);

	if (notify && cell)
		atk_focus_tracker_notify (cell);
}
Esempio n. 10
0
static gboolean
nux_area_accessible_real_check_pending_notification(NuxAreaAccessible* self)
{
  nux::Object* nux_object = NULL;

  g_return_val_if_fail(NUX_IS_AREA_ACCESSIBLE(self), FALSE);

  if (self->priv->pending_notification == FALSE)
    return FALSE;

  nux_object = nux_object_accessible_get_object(NUX_OBJECT_ACCESSIBLE(self));
  if (nux_object == NULL) /* defunct */
    return FALSE;

  g_signal_emit_by_name(self, "focus_event", self->priv->focused);
  atk_focus_tracker_notify(ATK_OBJECT(self));
  self->priv->pending_notification = FALSE;

  return TRUE;
}
Esempio n. 11
0
static void
gtk_html_a11y_cursor_changed_cb (GtkWidget *widget)
{
	AtkObject *focus_object;

	focus_object = gtk_html_a11y_get_focus_object (widget);
	g_return_if_fail (focus_object != NULL);

	if (gtk_html_a11y_focus_object != focus_object) {
		gtk_html_a11y_focus_object = focus_object;
		atk_focus_tracker_notify (focus_object);
	} else {
		if (G_IS_HTML_A11Y_TEXT (focus_object)) {
			gint offset;

			offset = (GTK_HTML (widget))->engine->cursor->offset;
			g_signal_emit_by_name (focus_object, "text_caret_moved",offset);
		}
	}
}
Esempio n. 12
0
static void
gtk_html_a11y_insert_object_cb (GtkWidget *widget,
                                gint pos,
                                gint len)
{
	AtkObject * a11y;

	HTMLCursor *cursor = GTK_HTML (widget)->engine->cursor;

	a11y = gtk_html_a11y_get_focus_object (widget);
	g_return_if_fail (a11y != NULL);

	if (gtk_html_a11y_focus_object != a11y) {
		gtk_html_a11y_focus_object = a11y;
		atk_focus_tracker_notify (a11y);
	}

	if (G_IS_HTML_A11Y_TEXT (a11y)) {
		g_signal_emit_by_name (a11y, "text_changed::insert", cursor->offset - len, len);

	}
}
Esempio n. 13
0
static void
check_focus(NuxAreaAccessible* self)
{
  gboolean focus_in = FALSE;
  nux::Area* area = NULL;
  nux::Object* nux_object = NULL;

  g_return_if_fail(NUX_IS_AREA_ACCESSIBLE(self));

  nux_object = nux_object_accessible_get_object(NUX_OBJECT_ACCESSIBLE(self));
  if (nux_object == NULL) /* defunct */
    return;

  area = dynamic_cast<nux::Area*>(nux_object);

  if (nux::GetWindowCompositor().GetKeyFocusArea() == area)
    focus_in = TRUE;

  if (self->priv->focused != focus_in)
  {
    self->priv->focused = focus_in;
    gboolean is_parent_window_active = nux_area_accessible_parent_window_active(self);

    /* we don't emit focus_in=TRUE events until the top level window
       is active */
    if ((focus_in) && (!is_parent_window_active))
    {
      self->priv->pending_notification = TRUE;
    }
    else
    {
      g_signal_emit_by_name(self, "focus_event", focus_in);
      atk_focus_tracker_notify(ATK_OBJECT(self));
      self->priv->pending_notification = FALSE;
    }
  }
}
Esempio n. 14
0
static void
ea_day_view_main_item_time_change_cb (EDayView *day_view,
                                      gpointer data)
{
	EaDayViewMainItem *ea_main_item;
	AtkObject *item_cell = NULL;

	g_return_if_fail (E_IS_DAY_VIEW (day_view));
	g_return_if_fail (data);
	g_return_if_fail (EA_IS_DAY_VIEW_MAIN_ITEM (data));

	ea_main_item = EA_DAY_VIEW_MAIN_ITEM (data);

#ifdef ACC_DEBUG
	printf ("EvoAcc: ea_day_view_main_item time changed cb\n");
#endif
	/* only deal with the first selected child, for now */
	item_cell = atk_selection_ref_selection (
		ATK_SELECTION (ea_main_item), 0);
	if (item_cell) {
		AtkStateSet *state_set;
		state_set = atk_object_ref_state_set (item_cell);
		atk_state_set_add_state (state_set, ATK_STATE_FOCUSED);
		g_object_unref (state_set);

		g_signal_emit_by_name (
			ea_main_item,
			"active-descendant-changed",
			item_cell);
		g_signal_emit_by_name (data, "selection_changed");

		atk_focus_tracker_notify (item_cell);
		g_object_unref (item_cell);
	}

}
Esempio n. 15
0
nsresult
nsAccessibleWrap::FirePlatformEvent(nsIAccessibleEvent *aEvent)
{
    nsCOMPtr<nsIAccessible> accessible;
    aEvent->GetAccessible(getter_AddRefs(accessible));
    NS_ENSURE_TRUE(accessible, NS_ERROR_FAILURE);

    PRUint32 type = 0;
    nsresult rv = aEvent->GetEventType(&type);
    NS_ENSURE_SUCCESS(rv, rv);

    AtkObject *atkObj = nsAccessibleWrap::GetAtkObject(accessible);

    // We don't create ATK objects for nsIAccessible plain text leaves,
    // just return NS_OK in such case
    if (!atkObj) {
        NS_ASSERTION(type == nsIAccessibleEvent::EVENT_ASYNCH_SHOW ||
                     type == nsIAccessibleEvent::EVENT_ASYNCH_HIDE ||
                     type == nsIAccessibleEvent::EVENT_DOM_CREATE ||
                     type == nsIAccessibleEvent::EVENT_DOM_DESTROY,
                     "Event other than SHOW and HIDE fired for plain text leaves");
        return NS_OK;
    }

    nsAccessibleWrap *accWrap = GetAccessibleWrap(atkObj);
    if (!accWrap) {
        return NS_OK; // Node is shut down
    }

    switch (type) {
    case nsIAccessibleEvent::EVENT_STATE_CHANGE:
        return FireAtkStateChangeEvent(aEvent, atkObj);

    case nsIAccessibleEvent::EVENT_TEXT_REMOVED:
    case nsIAccessibleEvent::EVENT_TEXT_INSERTED:
        return FireAtkTextChangedEvent(aEvent, atkObj);

    case nsIAccessibleEvent::EVENT_FOCUS:
    {
        MAI_LOG_DEBUG(("\n\nReceived: EVENT_FOCUS\n"));
        nsRefPtr<nsRootAccessible> rootAccWrap = accWrap->GetRootAccessible();
        if (rootAccWrap && rootAccWrap->mActivated) {
            atk_focus_tracker_notify(atkObj);
            // Fire state change event for focus
            nsCOMPtr<nsIAccessibleStateChangeEvent> stateChangeEvent =
                new nsAccStateChangeEvent(accessible,
                                          nsIAccessibleStates::STATE_FOCUSED,
                                          PR_FALSE, PR_TRUE);
            return FireAtkStateChangeEvent(stateChangeEvent, atkObj);
        }
    }
    break;

    case nsIAccessibleEvent::EVENT_VALUE_CHANGE:
    {
        MAI_LOG_DEBUG(("\n\nReceived: EVENT_VALUE_CHANGE\n"));
        nsCOMPtr<nsIAccessibleValue> value(do_QueryInterface(accessible));
        if (value) {    // Make sure this is a numeric value
            // Don't fire for MSAA string value changes (e.g. text editing)
            // ATK values are always numeric
            g_object_notify( (GObject*)atkObj, "accessible-value" );
        }
    }
    break;

    case nsIAccessibleEvent::EVENT_SELECTION_CHANGED:
        MAI_LOG_DEBUG(("\n\nReceived: EVENT_SELECTION_CHANGED\n"));
        g_signal_emit_by_name(atkObj, "selection_changed");
        break;

    case nsIAccessibleEvent::EVENT_TEXT_SELECTION_CHANGED:
        MAI_LOG_DEBUG(("\n\nReceived: EVENT_TEXT_SELECTION_CHANGED\n"));
        g_signal_emit_by_name(atkObj, "text_selection_changed");
        break;

    case nsIAccessibleEvent::EVENT_TEXT_CARET_MOVED:
    {
        MAI_LOG_DEBUG(("\n\nReceived: EVENT_TEXT_CARET_MOVED\n"));

        nsCOMPtr<nsIAccessibleCaretMoveEvent> caretMoveEvent(do_QueryInterface(aEvent));
        NS_ASSERTION(caretMoveEvent, "Event needs event data");
        if (!caretMoveEvent)
            break;

        PRInt32 caretOffset = -1;
        caretMoveEvent->GetCaretOffset(&caretOffset);

        MAI_LOG_DEBUG(("\n\nCaret postion: %d", caretOffset));
        g_signal_emit_by_name(atkObj,
                              "text_caret_moved",
                              // Curent caret position
                              caretOffset);
    }
    break;

    case nsIAccessibleEvent::EVENT_TEXT_ATTRIBUTE_CHANGED:
        MAI_LOG_DEBUG(("\n\nReceived: EVENT_TEXT_ATTRIBUTE_CHANGED\n"));

        g_signal_emit_by_name(atkObj,
                              "text-attributes-changed");
        break;

    case nsIAccessibleEvent::EVENT_TABLE_MODEL_CHANGED:
        MAI_LOG_DEBUG(("\n\nReceived: EVENT_TABLE_MODEL_CHANGED\n"));
        g_signal_emit_by_name(atkObj, "model_changed");
        break;

    case nsIAccessibleEvent::EVENT_TABLE_ROW_INSERT:
    {
        MAI_LOG_DEBUG(("\n\nReceived: EVENT_TABLE_ROW_INSERT\n"));
        nsCOMPtr<nsIAccessibleTableChangeEvent> tableEvent = do_QueryInterface(aEvent);
        NS_ENSURE_TRUE(tableEvent, NS_ERROR_FAILURE);

        PRInt32 rowIndex, numRows;
        tableEvent->GetRowOrColIndex(&rowIndex);
        tableEvent->GetNumRowsOrCols(&numRows);

        g_signal_emit_by_name(atkObj,
                              "row_inserted",
                              // After which the rows are inserted
                              rowIndex,
                              // The number of the inserted
                              numRows);
    }
    break;

    case nsIAccessibleEvent::EVENT_TABLE_ROW_DELETE:
    {
        MAI_LOG_DEBUG(("\n\nReceived: EVENT_TABLE_ROW_DELETE\n"));
        nsCOMPtr<nsIAccessibleTableChangeEvent> tableEvent = do_QueryInterface(aEvent);
        NS_ENSURE_TRUE(tableEvent, NS_ERROR_FAILURE);

        PRInt32 rowIndex, numRows;
        tableEvent->GetRowOrColIndex(&rowIndex);
        tableEvent->GetNumRowsOrCols(&numRows);

        g_signal_emit_by_name(atkObj,
                              "row_deleted",
                              // After which the rows are deleted
                              rowIndex,
                              // The number of the deleted
                              numRows);
    }
    break;

    case nsIAccessibleEvent::EVENT_TABLE_ROW_REORDER:
    {
        MAI_LOG_DEBUG(("\n\nReceived: EVENT_TABLE_ROW_REORDER\n"));
        g_signal_emit_by_name(atkObj, "row_reordered");
        break;
    }

    case nsIAccessibleEvent::EVENT_TABLE_COLUMN_INSERT:
    {
        MAI_LOG_DEBUG(("\n\nReceived: EVENT_TABLE_COLUMN_INSERT\n"));
        nsCOMPtr<nsIAccessibleTableChangeEvent> tableEvent = do_QueryInterface(aEvent);
        NS_ENSURE_TRUE(tableEvent, NS_ERROR_FAILURE);

        PRInt32 colIndex, numCols;
        tableEvent->GetRowOrColIndex(&colIndex);
        tableEvent->GetNumRowsOrCols(&numCols);

        g_signal_emit_by_name(atkObj,
                              "column_inserted",
                              // After which the columns are inserted
                              colIndex,
                              // The number of the inserted
                              numCols);
    }
    break;

    case nsIAccessibleEvent::EVENT_TABLE_COLUMN_DELETE:
    {
        MAI_LOG_DEBUG(("\n\nReceived: EVENT_TABLE_COLUMN_DELETE\n"));
        nsCOMPtr<nsIAccessibleTableChangeEvent> tableEvent = do_QueryInterface(aEvent);
        NS_ENSURE_TRUE(tableEvent, NS_ERROR_FAILURE);

        PRInt32 colIndex, numCols;
        tableEvent->GetRowOrColIndex(&colIndex);
        tableEvent->GetNumRowsOrCols(&numCols);

        g_signal_emit_by_name(atkObj,
                              "column_deleted",
                              // After which the columns are deleted
                              colIndex,
                              // The number of the deleted
                              numCols);
    }
    break;

    case nsIAccessibleEvent::EVENT_TABLE_COLUMN_REORDER:
        MAI_LOG_DEBUG(("\n\nReceived: EVENT_TABLE_COLUMN_REORDER\n"));
        g_signal_emit_by_name(atkObj, "column_reordered");
        break;

    case nsIAccessibleEvent::EVENT_SECTION_CHANGED:
        MAI_LOG_DEBUG(("\n\nReceived: EVENT_SECTION_CHANGED\n"));
        g_signal_emit_by_name(atkObj, "visible_data_changed");
        break;

    case nsIAccessibleEvent::EVENT_DOM_CREATE:
    case nsIAccessibleEvent::EVENT_ASYNCH_SHOW:
        return FireAtkShowHideEvent(aEvent, atkObj, PR_TRUE);

    case nsIAccessibleEvent::EVENT_DOM_DESTROY:
    case nsIAccessibleEvent::EVENT_ASYNCH_HIDE:
        return FireAtkShowHideEvent(aEvent, atkObj, PR_FALSE);

    /*
     * Because dealing with menu is very different between nsIAccessible
     * and ATK, and the menu activity is important, specially transfer the
     * following two event.
     * Need more verification by AT test.
     */
    case nsIAccessibleEvent::EVENT_MENU_START:
        MAI_LOG_DEBUG(("\n\nReceived: EVENT_MENU_START\n"));
        break;

    case nsIAccessibleEvent::EVENT_MENU_END:
        MAI_LOG_DEBUG(("\n\nReceived: EVENT_MENU_END\n"));
        break;

    case nsIAccessibleEvent::EVENT_WINDOW_ACTIVATE:
    {
        MAI_LOG_DEBUG(("\n\nReceived: EVENT_WINDOW_ACTIVATED\n"));
        nsRootAccessible *rootAcc =
            static_cast<nsRootAccessible *>(accessible.get());
        rootAcc->mActivated = PR_TRUE;
        guint id = g_signal_lookup ("activate", MAI_TYPE_ATK_OBJECT);
        g_signal_emit(atkObj, id, 0);

        // Always fire a current focus event after activation.
        rootAcc->FireCurrentFocusEvent();
    }
    break;

    case nsIAccessibleEvent::EVENT_WINDOW_DEACTIVATE:
    {
        MAI_LOG_DEBUG(("\n\nReceived: EVENT_WINDOW_DEACTIVATED\n"));
        nsRootAccessible *rootAcc =
            static_cast<nsRootAccessible *>(accessible.get());
        rootAcc->mActivated = PR_FALSE;
        guint id = g_signal_lookup ("deactivate", MAI_TYPE_ATK_OBJECT);
        g_signal_emit(atkObj, id, 0);
    }
    break;

    case nsIAccessibleEvent::EVENT_DOCUMENT_LOAD_COMPLETE:
    {
        MAI_LOG_DEBUG(("\n\nReceived: EVENT_DOCUMENT_LOAD_COMPLETE\n"));
        g_signal_emit_by_name (atkObj, "load_complete");
    }
    break;

    case nsIAccessibleEvent::EVENT_DOCUMENT_RELOAD:
    {
        MAI_LOG_DEBUG(("\n\nReceived: EVENT_DOCUMENT_RELOAD\n"));
        g_signal_emit_by_name (atkObj, "reload");
    }
    break;

    case nsIAccessibleEvent::EVENT_DOCUMENT_LOAD_STOPPED:
    {
        MAI_LOG_DEBUG(("\n\nReceived: EVENT_DOCUMENT_LOAD_STOPPED\n"));
        g_signal_emit_by_name (atkObj, "load_stopped");
    }
    break;

    case nsIAccessibleEvent::EVENT_MENUPOPUP_START:
        MAI_LOG_DEBUG(("\n\nReceived: EVENT_MENUPOPUP_START\n"));
        atk_focus_tracker_notify(atkObj); // fire extra focus event
        atk_object_notify_state_change(atkObj, ATK_STATE_VISIBLE, PR_TRUE);
        atk_object_notify_state_change(atkObj, ATK_STATE_SHOWING, PR_TRUE);
        break;

    case nsIAccessibleEvent::EVENT_MENUPOPUP_END:
        MAI_LOG_DEBUG(("\n\nReceived: EVENT_MENUPOPUP_END\n"));
        atk_object_notify_state_change(atkObj, ATK_STATE_VISIBLE, PR_FALSE);
        atk_object_notify_state_change(atkObj, ATK_STATE_SHOWING, PR_FALSE);
        break;
    }

    return NS_OK;
}
Esempio n. 16
0
static VALUE
rbatk_focus_tracker_notify(VALUE self, VALUE obj)
{
    atk_focus_tracker_notify(ATK_OBJECT(RVAL2GOBJ(obj)));
    return self;
}
Esempio n. 17
0
static gboolean
ea_calendar_focus_watcher (GSignalInvocationHint *ihint,
                           guint n_param_values,
                           const GValue *param_values,
                           gpointer data)
{
	GObject *object;
	GdkEvent *event;
        AtkObject *ea_event = NULL;

	object = g_value_get_object (param_values + 0);
	event = g_value_get_boxed (param_values + 1);

	if ((E_IS_TEXT (object)) || (GNOME_IS_CANVAS_PIXBUF (object))) {
		/* "event" signal on canvas item
		 */
		GnomeCanvasItem *canvas_item;

		canvas_item = GNOME_CANVAS_ITEM (object);
		if (event->type == GDK_FOCUS_CHANGE) {
			if (event->focus_change.in) {
				ea_event =
					ea_calendar_helpers_get_accessible_for (canvas_item);
				if (!ea_event)
					/* not canvas item we want */
					return TRUE;

			}
			atk_focus_tracker_notify (ea_event);
		}
	}
	else if (E_IS_DAY_VIEW (object)) {
		EDayView *day_view = E_DAY_VIEW (object);
		if (event->type == GDK_FOCUS_CHANGE) {
			if (event->focus_change.in) {
				/* give main item chance to emit focus */
				gnome_canvas_item_grab_focus (day_view->main_canvas_item);
			}
		}
	}
	else if (E_IS_DAY_VIEW_MAIN_ITEM (object)) {
		if (event->type == GDK_FOCUS_CHANGE) {
			if (event->focus_change.in) {
				/* we should emit focus on main item */
				ea_event = atk_gobject_accessible_for_object (object);
			}
			else
				/* focus out */
				ea_event = NULL;
#ifdef ACC_DEBUG
			printf ("EvoAcc: focus notify on day main item %p\n", (void *)object);
#endif
			atk_focus_tracker_notify (ea_event);
		}
	} else if (E_IS_WEEK_VIEW (object)) {
		EWeekView *week_view = E_WEEK_VIEW (object);
		if (event->type == GDK_FOCUS_CHANGE) {
			if (event->focus_change.in) {
				/* give main item chance to emit focus */
				gnome_canvas_item_grab_focus (week_view->main_canvas_item);
			}
		}
	}
	else if (E_IS_WEEK_VIEW_MAIN_ITEM (object)) {
		if (event->type == GDK_FOCUS_CHANGE) {
			if (event->focus_change.in) {
				/* we should emit focus on main item */
				ea_event = atk_gobject_accessible_for_object (object);
			}
			else
				/* focus out */
				ea_event = NULL;
#ifdef ACC_DEBUG
			printf ("EvoAcc: focus notify on week main item %p\n", (void *)object);
#endif
			atk_focus_tracker_notify (ea_event);
		}
	}
	return TRUE;
}