Exemplo n.º 1
0
static void
_on_focus_in(void *data, Evas_Object *obj, void *event_info)
{
   AtkObject *aobj = atk_get_root();
   g_assert(aobj);

   eailu_traverse_children_for_role_call_cb(aobj, ATK_ROLE_DIALOG, _do_test);

   _on_done(NULL, obj, NULL);
}
Exemplo n.º 2
0
static void on_focus_in(void *data, Evas_Object *obj, void *event_info)
{
   AtkObject *aobj = atk_get_root();
   if (aobj)
     _traverse_children(aobj);
   else
     printf("error: ATK returns null\n");

   elm_exit();
}
Exemplo n.º 3
0
static void
_on_focus_in(void *data, Evas_Object *obj, void *event_info)
{
   AtkObject *aobj = atk_get_root();
   g_assert(aobj);

   eailu_traverse_children_for_type_call_cb(aobj, "EailPhoto", _do_test_photo);

   _on_done(NULL, obj, NULL);
}
Exemplo n.º 4
0
static void
_on_focus_in(void *data, Evas_Object *obj, void *event_info)
{
   AtkObject *aobj = atk_get_root();
   g_assert(aobj);

   eailu_traverse_children_for_type_call_cb
                                    (aobj, EAIL_TYPE_FOR_WINDOW, _test_window);

   g_assert(eail_test_code_called);
   elm_exit();
}
Exemplo n.º 5
0
static void
_on_focus_in(void *data, Evas_Object *obj, void *event_info)
{
   AtkObject *aobj = atk_get_root();
   g_assert(aobj);

   eailu_traverse_children_for_type_call_cb
                                 (aobj, "EailEntry", _test_focus_on_entry);

   g_assert(eail_test_code_called);
   elm_exit();
}
Exemplo n.º 6
0
static void
_on_focus_in(void *data, Evas_Object *obj, void *event_info)
{
   AtkObject *aobj = atk_get_root();
   g_assert(aobj);

   eailu_traverse_children_for_type_call_cb
                              (aobj, "EailSlideshow", _test_slideshow_object);

   g_assert(eail_test_code_called);
   _on_done(NULL, obj, NULL);
}
Exemplo n.º 7
0
void e_minicard_view_a11y_init (void)
{
	EA_SET_FACTORY (e_minicard_view_get_type (), ea_minicard_view);

	if (atk_get_root ()) {
		g_signal_add_emission_hook (
			g_signal_lookup ("event",
			e_minicard_get_type ()),
			0, ea_addressbook_focus_watcher,
			NULL, (GDestroyNotify) NULL);
	}
}
Exemplo n.º 8
0
static void
_on_focus_in(void *data, Evas_Object *object, void *event_info)
{
   AtkObject *aobj = atk_get_root();
   g_assert(ATK_IS_OBJECT(aobj));

   eailu_traverse_children_for_type_call_cb
      (aobj, "EailLayout", _test_layout_object);

   g_assert(2 >= eail_test_code_called);
   _on_done(NULL, object, NULL);
}
Exemplo n.º 9
0
static void
_on_focus_in(void *data, Evas_Object *obj, void *event_info)
{

   AtkObject *aobj = atk_get_root();
   g_assert(aobj);

   eailu_traverse_children_for_type_call_cb
                    (aobj, EAIL_TYPE_FOR_INDEX, _test_index_object);

   _on_done(NULL, obj, NULL);
}
Exemplo n.º 10
0
static AtkObject*
jaw_impl_get_parent (AtkObject *atk_obj)
{
  if (jaw_toplevel_get_child_index(JAW_TOPLEVEL(atk_get_root()), atk_obj) != -1)
  {
    return ATK_OBJECT(atk_get_root());
  }

  JawObject *jaw_obj = JAW_OBJECT(atk_obj);
  jobject ac = jaw_obj->acc_context;
  JNIEnv *jniEnv = jaw_util_get_jni_env();

  jclass classAccessibleContext = (*jniEnv)->FindClass(jniEnv,
                                                       "javax/accessibility/AccessibleContext" );
  jmethodID jmid = (*jniEnv)->GetMethodID(jniEnv,
                                          classAccessibleContext,
                                          "getAccessibleParent",
                                          "()Ljavax/accessibility/Accessible;");
  jobject jparent = (*jniEnv)->CallObjectMethod( jniEnv, ac, jmid );
  if (jparent != NULL )
  {
    jclass classAccessible = (*jniEnv)->FindClass(jniEnv,
                                                  "javax/accessibility/Accessible" );
    jmid = (*jniEnv)->GetMethodID(jniEnv,
                                  classAccessible,
                                  "getAccessibleContext",
                                  "()Ljavax/accessibility/AccessibleContext;");
    jobject parent_ac = (*jniEnv)->CallObjectMethod( jniEnv, jparent, jmid );

    AtkObject *obj = (AtkObject*) object_table_lookup( jniEnv, parent_ac );
    if (obj != NULL ) {
       return obj;
    }
  }

  return ATK_OBJECT(atk_get_root());
}
Exemplo n.º 11
0
static void
do_window_event_initialization (void)
{
  AtkObject *root;

  g_type_class_ref (GTK_TYPE_WINDOW_ACCESSIBLE);
  g_signal_add_emission_hook (g_signal_lookup ("window-state-event", GTK_TYPE_WIDGET),
                              0, state_event_watcher, NULL, (GDestroyNotify) NULL);
  g_signal_add_emission_hook (g_signal_lookup ("configure-event", GTK_TYPE_WIDGET),
                              0, configure_event_watcher, NULL, (GDestroyNotify) NULL);

  root = atk_get_root ();
  g_signal_connect (root, "children-changed::add", (GCallback) window_added, NULL);
  g_signal_connect (root, "children-changed::remove", (GCallback) window_removed, NULL);
}
Exemplo n.º 12
0
static gboolean
configure_event_watcher (GSignalInvocationHint *hint,
                         guint                  n_param_values,
                         const GValue          *param_values,
                         gpointer               data)
{
  GtkAllocation allocation;
  GObject *object;
  GtkWidget *widget;
  AtkObject *atk_obj;
  AtkObject *parent;
  GdkEvent *event;
  gchar *signal_name;

  object = g_value_get_object (param_values + 0);
  if (!GTK_IS_WINDOW (object))
    return FALSE;

  event = g_value_get_boxed (param_values + 1);
  if (event->type != GDK_CONFIGURE)
    return FALSE;
  widget = GTK_WIDGET (object);
  gtk_widget_get_allocation (widget, &allocation);
  if (allocation.x == ((GdkEventConfigure *)event)->x &&
      allocation.y == ((GdkEventConfigure *)event)->y &&
      allocation.width == ((GdkEventConfigure *)event)->width &&
      allocation.height == ((GdkEventConfigure *)event)->height)
    return TRUE;

  if (allocation.width != ((GdkEventConfigure *)event)->width ||
      allocation.height != ((GdkEventConfigure *)event)->height)
    signal_name = "resize";
  else
    signal_name = "move";

  atk_obj = gtk_widget_get_accessible (widget);
  if (GTK_IS_WINDOW_ACCESSIBLE (atk_obj))
    {
      parent = atk_object_get_parent (atk_obj);
      if (parent == atk_get_root ())
        g_signal_emit_by_name (atk_obj, signal_name);

      return TRUE;
    }

  return FALSE;
}
Exemplo n.º 13
0
static gboolean
spi_application_toolkit_event_listener (GSignalInvocationHint *signal_hint,
					guint                  n_param_values,
					const GValue          *param_values,
					gpointer               data)
{
  Accessibility_Event e;
  AtkObject      *aobject;
  SpiAccessible *source;
  GSignalQuery   signal_query;
  char          *event_name;

  g_return_val_if_fail (the_app != NULL, FALSE);

  g_signal_query (signal_hint->signal_id, &signal_query);

  /* TODO: move GTK reference out of app.c into bridge */
  event_name = g_strdup_printf ("Gtk:%s:%s",
				g_type_name (signal_query.itype), 
				signal_query.signal_name);

#ifdef SPI_DEBUG  
  fprintf (stderr, "Received signal %s\n", event_name);
#endif
  
  aobject = get_atk_object_ref (g_value_get_object (param_values + 0));

  source = spi_accessible_new (aobject);
  e.type = CORBA_string_dup (event_name);
  e.source = CORBA_OBJECT_NIL;
  e.detail1 = 0;
  e.detail2 = 0;
  spi_init_any_nil (&e.any_data, 
		    spi_accessible_new_return (atk_get_root (), FALSE, NULL),
		    Accessibility_ROLE_UNKNOWN,
		    "");
  notify_listeners (the_app->toolkit_listeners, source, &e);

  bonobo_object_unref (BONOBO_OBJECT (source));
  g_object_unref (G_OBJECT (aobject));

  g_free (event_name);

  return TRUE;
}
Exemplo n.º 14
0
static void
_check_toplevel (AtkObject *obj)
{
  AtkObject *root_obj;
  const gchar *name_string, *version_string;
  gint max_depth;

  g_print ("Start of _check_toplevel\n");
  root_obj = atk_get_root();

  if (!already_accessed_atk_object(root_obj))
    {
      g_signal_connect_closure (root_obj, "children_changed::add",
		g_cclosure_new (G_CALLBACK (_notify_toplevel_child_added),
		NULL, NULL),
		FALSE);

      g_signal_connect_closure (root_obj, "children_changed::remove",
		g_cclosure_new (G_CALLBACK (_notify_toplevel_child_removed),
		NULL, NULL),
		FALSE);
    }

  name_string = atk_get_toolkit_name();
  version_string = atk_get_toolkit_version();
  g_print ("Toolkit name <%s> version <%s>\n", name_string,
    version_string);

  if (g_getenv("TEST_ACCESSIBLE_DEPTH") != NULL)
    max_depth = string_to_int(g_getenv("TEST_ACCESSIBLE_DEPTH"));
  else
    max_depth = 2;

  display_children_to_depth(root_obj, max_depth, 0, 0);
  g_print ("End of _check_toplevel\n");

  if (!g_register_listener)
    {
      g_print("Adding global event listener on buttons\n");
      g_register_listener = TRUE;
      g_signal_listener = atk_add_global_event_listener(_button_press_event_watcher,
        "Gtk:GtkButton:pressed");
    }
}
Exemplo n.º 15
0
static gboolean
state_event_watcher (GSignalInvocationHint *hint,
                     guint                  n_param_values,
                     const GValue          *param_values,
                     gpointer               data)
{
  GObject *object;
  GtkWidget *widget;
  AtkObject *atk_obj;
  AtkObject *parent;
  GdkEventWindowState *event;
  gchar *signal_name;

  object = g_value_get_object (param_values + 0);
  if (!GTK_IS_WINDOW (object))
    return FALSE;

  event = g_value_get_boxed (param_values + 1);
  if (event->type == GDK_WINDOW_STATE)
    return FALSE;
  widget = GTK_WIDGET (object);

  if (event->new_window_state & GDK_WINDOW_STATE_MAXIMIZED)
    signal_name = "maximize";
  else if (event->new_window_state & GDK_WINDOW_STATE_ICONIFIED)
    signal_name = "minimize";
  else if (event->new_window_state == 0)
    signal_name = "restore";
  else
    return TRUE;

  atk_obj = gtk_widget_get_accessible (widget);
  if (GTK_IS_WINDOW_ACCESSIBLE (atk_obj))
    {
      parent = atk_object_get_parent (atk_obj);
      if (parent == atk_get_root ())
        g_signal_emit_by_name (atk_obj, signal_name);

      return TRUE;
    }

  return FALSE;
}
Exemplo n.º 16
0
void
gnome_calendar_a11y_init (void)
{
	/* we only add focus watcher when accessibility is enabled
	 */
	if (atk_get_root ()) {
		EA_SET_FACTORY (gnome_calendar_get_type(), ea_gnome_calendar);

		/* force loading some types */
		e_text_type = g_type_class_ref (E_TYPE_TEXT);
		pixbuf_type = g_type_class_ref (GNOME_TYPE_CANVAS_PIXBUF);
		e_day_view_type = g_type_class_ref (e_day_view_get_type ());
		e_week_view_type = g_type_class_ref (e_week_view_get_type ());
		e_day_view_main_item_type = g_type_class_ref (e_day_view_main_item_get_type ());
		e_week_view_main_item_type = g_type_class_ref (e_week_view_main_item_get_type ());

		g_signal_add_emission_hook (g_signal_lookup ("event", E_TYPE_TEXT),
					    0, ea_calendar_focus_watcher,
					    NULL, (GDestroyNotify) NULL);
		g_signal_add_emission_hook (g_signal_lookup ("event", GNOME_TYPE_CANVAS_PIXBUF),
                                            0, ea_calendar_focus_watcher,
                                            NULL, (GDestroyNotify) NULL);
		g_signal_add_emission_hook (g_signal_lookup ("event-after",
							     e_day_view_get_type()),
					    0, ea_calendar_focus_watcher,
					    NULL, (GDestroyNotify) NULL);
		g_signal_add_emission_hook (g_signal_lookup ("event",
							     e_day_view_main_item_get_type()),
					    0, ea_calendar_focus_watcher,
					    NULL, (GDestroyNotify) NULL);
		g_signal_add_emission_hook (g_signal_lookup ("event-after",
							     e_week_view_get_type()),
					    0, ea_calendar_focus_watcher,
					    NULL, (GDestroyNotify) NULL);
		g_signal_add_emission_hook (g_signal_lookup ("event",
							     e_week_view_main_item_get_type()),
					    0, ea_calendar_focus_watcher,
					    NULL, (GDestroyNotify) NULL);

	}
}
Exemplo n.º 17
0
static gint
gail_window_get_index_in_parent (AtkObject *accessible)
{
  GtkWidget* widget = GTK_ACCESSIBLE (accessible)->widget; 
  AtkObject* atk_obj = atk_get_root ();
  gint index = -1;

  if (widget == NULL)
    /*
     * State is defunct
     */
    return -1;

  gail_return_val_if_fail (GTK_IS_WIDGET (widget), -1);

  index = ATK_OBJECT_CLASS (gail_window_parent_class)->get_index_in_parent (accessible);
  if (index != -1)
    return index;

  if (GTK_IS_WINDOW (widget))
    {
      GtkWindow *window = GTK_WINDOW (widget);
      if (GAIL_IS_TOPLEVEL (atk_obj))
        {
	  GailToplevel* toplevel = GAIL_TOPLEVEL (atk_obj);
	  index = g_list_index (toplevel->window_list, window);
	}
      else
        {
	  int i, sibling_count = atk_object_get_n_accessible_children (atk_obj);
	  for (i = 0; i < sibling_count && index == -1; ++i)
	    {
	      AtkObject *child = atk_object_ref_accessible_child (atk_obj, i);
	      if (accessible == child) index = i;
	      g_object_unref (G_OBJECT (child));
	    }
	}
    }
  return index;
}
Exemplo n.º 18
0
static DBusMessage *
impl_GetApplication (DBusConnection * bus,
                     DBusMessage * message, void *user_data)
{
  return spi_object_return_reference (message, atk_get_root ());
}
Exemplo n.º 19
0
static gboolean
window_close_handler (gpointer p)
{
  CallbackPara *para = (CallbackPara*)p;
  jobject global_ac = para->global_ac;
  gboolean is_toplevel = para->is_toplevel;

  JNIEnv *jniEnv = jaw_util_get_jni_env();
  if (jniEnv == NULL)
  {
    if (jaw_debug)
      g_warning("window_close_handler: env == NULL");
    free_callback_para(para);
    return G_SOURCE_REMOVE;
  }

  if (global_ac == NULL)
  {
    if (jaw_debug)
      g_warning("window_close_handler: global_ac == NULL");
    free_callback_para(para);
    return G_SOURCE_REMOVE;
  }
  JawImpl *jaw_impl = jaw_impl_find_instance(jniEnv, global_ac);
  if (jaw_impl == NULL)
  {
    if (jaw_debug)
      g_warning("window_close_handler: jaw_impl == NULL");
    free_callback_para(para);
    return G_SOURCE_REMOVE;
  }

  AtkObject* atk_obj = ATK_OBJECT(jaw_impl);

  if (!g_strcmp0(atk_role_get_name(atk_object_get_role(atk_obj)), "redundant object"))
  {
    free_callback_para(para);
    return G_SOURCE_REMOVE;
  }

  if (atk_object_get_role(atk_obj) == ATK_ROLE_TOOL_TIP)
  {
    free_callback_para(para);
    return G_SOURCE_REMOVE;
  }

  if (is_toplevel) {
    gint n = jaw_toplevel_remove_window(JAW_TOPLEVEL(atk_get_root()), atk_obj);

    g_object_notify(G_OBJECT(atk_get_root()), "accessible-name");

    g_signal_emit_by_name(ATK_OBJECT(atk_get_root()),
                          "children-changed::remove",
                          n,
                          atk_obj,
                          NULL);

    g_signal_emit_by_name(atk_obj, "destroy", 0);
  }

  free_callback_para(para);

  return G_SOURCE_REMOVE;
}
Exemplo n.º 20
0
static VALUE
rbatk_get_root(VALUE self)
{
    return GOBJ2RVAL(atk_get_root());
}
Exemplo n.º 21
0
static Accessibility_Accessible 
impl_accessibility_accessible_get_application (PortableServer_Servant servant,
					       CORBA_Environment     *ev)
{
    return spi_accessible_new_return (atk_get_root (), FALSE, ev);
}