Пример #1
0
NS_IMETHODIMP nsAccessibleWrap::GetNativeInterface(void **aOutAccessible)
{
    *aOutAccessible = nsnull;

    if (!mAtkObject) {
        if (!mWeakShell || !nsAccUtils::IsEmbeddedObject(this)) {
            // We don't create ATK objects for node which has been shutdown, or
            // nsIAccessible plain text leaves
            return NS_ERROR_FAILURE;
        }

        GType type = GetMaiAtkType(CreateMaiInterfaces());
        NS_ENSURE_TRUE(type, NS_ERROR_FAILURE);
        mAtkObject =
            reinterpret_cast<AtkObject *>
            (g_object_new(type, NULL));
        NS_ENSURE_TRUE(mAtkObject, NS_ERROR_OUT_OF_MEMORY);

        atk_object_initialize(mAtkObject, this);
        mAtkObject->role = ATK_ROLE_INVALID;
        mAtkObject->layer = ATK_LAYER_INVALID;
    }

    *aOutAccessible = mAtkObject;
    return NS_OK;
}
Пример #2
0
JNIEXPORT void JNICALL ATK_NATIVE(_1atk_1object_1initialize)
	(JNIEnv *env, jclass that, jint arg0, jint arg1)
{
	ATK_NATIVE_ENTER(env, that, _1atk_1object_1initialize_FUNC);
	atk_object_initialize((AtkObject *)arg0, (gpointer)arg1);
	ATK_NATIVE_EXIT(env, that, _1atk_1object_1initialize_FUNC);
}
Пример #3
0
/**
 * @brief Implementation AtkObject->ref_child callback
 *
 * ATK doc says:\n
 * Gets a reference to the specified accessible child of the object. The
 * accessible children are 0-based so the first accessible child is at index 0,
 * the second at index 1 and so on.
 *
 * @returns an AtkObject representing the specified accessible child of the
 * accessible.
 */
static AtkObject *
eail_naviframe_ref_child(AtkObject *obj, gint i)
{
   Eina_List *list;
   EailNaviframe *naviframe;
   EailWidget *widget;
   Evas_Object *e_object;

   g_return_val_if_fail(EAIL_IS_NAVIFRAME(obj), NULL);

   naviframe = EAIL_NAVIFRAME(obj);
   widget = EAIL_WIDGET(naviframe);

   e_object = eail_widget_get_widget(widget);

   list = elm_naviframe_items_get(e_object);
   int list_count = eina_list_count(list);
   if (i >= list_count)
     {
        eina_list_free(list);
        return NULL;
     }

   AtkObject *child = eail_naviframe_page_new(obj, i);
   atk_object_initialize(child, eina_list_nth(list, i));
   g_object_ref(child);
   naviframe->cached_pages = eina_list_append(naviframe->cached_pages, child);

   eina_list_free(list);

   return child;
}
Пример #4
0
/**
 * @brief Helper func for creating dayselector child content
 *
 * @param day_check_widget check widget that represents a day in dayselector
 * widget
 *
 * @returns an AtkObject representation of given day in dayselector. Unref
 * it when it is no longer needed.
 */
static AtkObject *
_eail_create_dayselector_child(Evas_Object *day_check_widget)
{
   AtkObject *child = NULL;
   child = g_object_new(EAIL_TYPE_CHECK, NULL);
   atk_object_initialize(child, day_check_widget);
   g_object_ref(child);

   return child;
}
Пример #5
0
static AtkObject *
gtk_switch_accessible_factory_create_accessible (GObject *obj)
{
  AtkObject *accessible;

  accessible = g_object_new (_gtk_switch_accessible_get_type (), NULL);
  atk_object_initialize (accessible, obj);

  return accessible;
}
Пример #6
0
JawImpl*
jaw_impl_get_instance (JNIEnv *jniEnv, jobject ac)
{
  JawImpl *jaw_impl;
  jniEnv = jaw_util_get_jni_env();

  if (jniEnv == NULL)
    return NULL;

  g_mutex_lock(&objectTableMutex);
  if (objectTable == NULL)
    objectTable = g_hash_table_new (NULL, NULL);
  g_mutex_unlock(&objectTableMutex);

  jaw_impl = object_table_lookup(jniEnv, ac);

  if (jaw_impl == NULL)
  {
    jobject global_ac = (*jniEnv)->NewGlobalRef(jniEnv, ac);
    if (global_ac != NULL)
    {
      guint tflag = jaw_util_get_tflag_from_jobj(jniEnv, global_ac);
      jaw_impl = (JawImpl*)g_object_new(JAW_TYPE_IMPL(tflag), NULL);
      if (jaw_impl != NULL)
      {
        JawObject *jaw_obj = JAW_OBJECT(jaw_impl);

        if (jaw_obj != NULL)
        {
          jaw_obj->acc_context = global_ac;
          jaw_obj->storedData = g_hash_table_new(g_str_hash, g_str_equal);
          aggregate_interface(jniEnv, jaw_obj, tflag);
          atk_object_initialize(ATK_OBJECT(jaw_impl), NULL);
          object_table_insert(jniEnv, global_ac, jaw_impl);
        } else
        {
          if (jaw_debug)
            g_warning("jaw_impl_get_instance: jaw_obj == NULL");
          return NULL;
        }
      } else
      {
        if (jaw_debug)
          g_warning("jaw_impl_get_instance: jaw_impl == NULL");
      }
    } else
    {
      if (jaw_debug)
        g_warning("jaw_impl_get_instance: global_ac == NULL");
      return NULL;
    }
  }
  return jaw_impl;
}
static AtkObject *
panel_menu_button_accessible_new (GObject *obj)
{
	AtkObject *accessible;

	g_return_val_if_fail (PANEL_IS_MENU_BUTTON (obj), NULL);

	accessible = g_object_new (panel_menu_button_accessible_get_type (), NULL);
	atk_object_initialize (accessible, obj);

	return accessible;
}
Пример #8
0
AtkObject*
gail_object_new (GObject *obj)
{
  gpointer object;
  AtkObject *atk_object;

  g_return_val_if_fail (GTK_IS_OBJECT (obj), NULL);
  object = g_object_new (GAIL_TYPE_OBJECT, NULL);
  atk_object = ATK_OBJECT (object);
  atk_object_initialize (atk_object, obj);
  return atk_object;
}
Пример #9
0
static AtkObject *
goo_canvas_accessible_new (GObject *object)
{
  AtkObject *accessible;

  g_return_val_if_fail (GOO_IS_CANVAS (object), NULL);

  accessible = g_object_new (goo_canvas_accessible_get_type (), NULL);
  atk_object_initialize (accessible, object);

  return accessible;
}
Пример #10
0
/* Accessibility stuff */
static AtkObject *
mcus_led_accessible_new (GObject *object)
{
	AtkObject *accessible;

	g_return_val_if_fail (GTK_IS_WIDGET (object), NULL);

	accessible = g_object_new (mcus_led_accessible_get_type (), NULL);
	atk_object_initialize (accessible, object);

	return accessible;
}
Пример #11
0
static AtkObject*
jaw_util_get_root (void)
{
  static JawToplevel *root = NULL;

  if (!root) {
    root = g_object_new(JAW_TYPE_TOPLEVEL, NULL);
    atk_object_initialize(ATK_OBJECT(root), NULL);
  }

  return ATK_OBJECT(root);
}
Пример #12
0
static AtkObject *
mate_druid_accessible_new (GObject *obj)
{
	AtkObject *accessible;

	g_return_val_if_fail (MATE_IS_DRUID (obj), NULL);

	accessible = g_object_new (mate_druid_accessible_get_type (), NULL); 
	atk_object_initialize (accessible, obj);

	return accessible;
}
AtkObject*
nux_text_entry_accessible_new(nux::Object* object)
{
  AtkObject* accessible = NULL;

  g_return_val_if_fail(dynamic_cast<nux::TextEntry*>(object), NULL);

  accessible = ATK_OBJECT(g_object_new(NUX_TYPE_TEXT_ENTRY_ACCESSIBLE, NULL));

  atk_object_initialize(accessible, object);

  return accessible;
}
Пример #14
0
AtkObject*
nux_area_accessible_new(nux::Object* object)
{
  AtkObject* accessible = NULL;

  g_return_val_if_fail(dynamic_cast<nux::Area*>(object), NULL);

  accessible = ATK_OBJECT(g_object_new(NUX_TYPE_AREA_ACCESSIBLE, NULL));

  atk_object_initialize(accessible, object);

  return accessible;
}
Пример #15
0
AtkObject*
gail_html_box_block_new (GObject *obj)
{
  GObject *object;
  AtkObject *atk_object;

  g_return_val_if_fail (HTML_IS_BOX_BLOCK (obj), NULL);
  object = g_object_new (GAIL_TYPE_HTML_BOX_BLOCK, NULL);
  atk_object = ATK_OBJECT (object);
  atk_object_initialize (atk_object, obj);
  atk_object->role = ATK_ROLE_PANEL;
  return atk_object;
}
Пример #16
0
AtkObject*
gail_canvas_group_new (GObject *obj)
{
  gpointer object;
  AtkObject *atk_object;

  g_return_val_if_fail (MATE_IS_CANVAS_GROUP (obj), NULL);
  object = g_object_new (GAIL_TYPE_CANVAS_GROUP, NULL);
  atk_object = ATK_OBJECT (object);
  atk_object_initialize (atk_object, obj);
  atk_object->role = ATK_ROLE_PANEL;
  return atk_object;
}
Пример #17
0
AtkObject*
gail_canvas_widget_new (GObject *obj)
{
  gpointer object;
  AtkObject *atk_object;

  g_return_val_if_fail (GNOME_IS_CANVAS_WIDGET (obj), NULL);
  object = g_object_new (GAIL_TYPE_CANVAS_WIDGET, NULL);
  atk_object = ATK_OBJECT (object);
  atk_object_initialize (atk_object, obj);
  atk_object->role = ATK_ROLE_PANEL;
  return atk_object;
}
Пример #18
0
AtkObject *
gail_canvas_item_new (GObject *obj)
{
  gpointer object;
  AtkObject *atk_object;

  g_return_val_if_fail (GNOME_IS_CANVAS_ITEM (obj), NULL);
  object = g_object_new (GAIL_TYPE_CANVAS_ITEM, NULL);
  atk_object = ATK_OBJECT (object);
  atk_object_initialize (atk_object, obj);
  atk_object->role = ATK_ROLE_UNKNOWN;
  return atk_object;
}
Пример #19
0
static AtkObject *
get_root (void)
{
  static AtkObject *root = NULL;

  if (!root)
    {
      root = g_object_new (GTK_TYPE_TOPLEVEL_ACCESSIBLE, NULL);
      atk_object_initialize (root, NULL);
    }

  return root;
}
Пример #20
0
static AtkObject *ev_view_accessible_new(GObject * obj)
{
	AtkObject *accessible;

	g_return_val_if_fail(EV_IS_VIEW (obj), NULL);

	accessible = g_object_new (ev_view_accessible_get_type (), NULL);
	atk_object_initialize (accessible, obj);

	atk_object_set_name (ATK_OBJECT (accessible), _("Document View"));
	atk_object_set_role (ATK_OBJECT (accessible), ATK_ROLE_DOCUMENT_FRAME);

	return accessible;
}
Пример #21
0
AtkObject* 
gail_container_new (GtkWidget *widget)
{
  GObject *object;
  AtkObject *accessible;

  g_return_val_if_fail (GTK_IS_CONTAINER (widget), NULL);

  object = g_object_new (GAIL_TYPE_CONTAINER, NULL);

  accessible = ATK_OBJECT (object);
  atk_object_initialize (accessible, widget);

  return accessible;
}
Пример #22
0
AtkObject* 
gail_label_new (GtkWidget *widget)
{
  GObject *object;
  AtkObject *accessible;

  g_return_val_if_fail (GTK_IS_LABEL (widget), NULL);

  object = g_object_new (GAIL_TYPE_LABEL, NULL);

  accessible = ATK_OBJECT (object);
  atk_object_initialize (accessible, widget);

  return accessible;
}
Пример #23
0
/**
 * @brief Refreshes history of realized pages
 *
 * @param self an EailNaviframe object
 * @param list list of realized pages
 */
static void
_refresh_cached_pages(EailNaviframe *self, const Eina_List *list)
{
   int list_count = eina_list_count(list);

   eina_list_free(self->cached_pages);

   for (int i = 0; i < list_count; i++)
     {
        AtkObject *child = eail_naviframe_page_new(ATK_OBJECT(self), i);
        atk_object_initialize(child, eina_list_nth(list, i));
        g_object_ref(child);
        self->cached_pages = eina_list_append(self->cached_pages, child);
     }
}
Пример #24
0
/**
 * cally_actor_new:
 * @actor: a #ClutterActor
 *
 * Creates a new #CallyActor for the given @actor
 *
 * Return value: the newly created #AtkObject
 *
 * Since: 1.4
 */
AtkObject *
cally_actor_new (ClutterActor *actor)
{
  gpointer   object;
  AtkObject *atk_object;

  g_return_val_if_fail (CLUTTER_IS_ACTOR (actor), NULL);

  object = g_object_new (CALLY_TYPE_ACTOR, NULL);

  atk_object = ATK_OBJECT (object);
  atk_object_initialize (atk_object, actor);

  return atk_object;
}
Пример #25
0
AtkObject* 
gail_check_sub_menu_item_new (GtkWidget *widget)
{
  GObject *object;
  AtkObject *accessible;

  g_return_val_if_fail (GTK_IS_CHECK_MENU_ITEM (widget), NULL);

  object = g_object_new (GAIL_TYPE_CHECK_SUB_MENU_ITEM, NULL);

  accessible = ATK_OBJECT (object);
  atk_object_initialize (accessible, widget);

  return accessible;
}
Пример #26
0
AtkObject* 
gail_arrow_new (GtkWidget *widget)
{
  GObject *object;
  AtkObject *accessible;

  g_return_val_if_fail (GTK_IS_ARROW (widget), NULL);

  object = g_object_new (GAIL_TYPE_ARROW, NULL);

  accessible = ATK_OBJECT (object);
  atk_object_initialize (accessible, widget);
  accessible->role = ATK_ROLE_ICON;

  return accessible;
}
AtkObject* 
gucharmap_chartable_accessible_new (GucharmapChartable *chartable)
{
  GObject *object;
  AtkObject *accessible;

  object = g_object_new (gucharmap_chartable_accessible_get_type (), NULL);
  accessible = ATK_OBJECT (object);

  /* atk is f****d up... */
  atk_object_initialize (accessible, GTK_WIDGET (chartable));
  accessible->role = ATK_ROLE_TABLE;
  atk_object_set_name (accessible, _("Character Table"));

  return accessible;
}
Пример #28
0
/**
 * eel_accessibility_set_atk_object_return:
 * @object: a GObject
 * @atk_object: it's AtkObject
 * 
 * used to register and return a new accessible object for something
 * 
 * Return value: @atk_object.
 **/
AtkObject *
eel_accessibility_set_atk_object_return (gpointer   object,
					 AtkObject *atk_object)
{
	atk_object_initialize (atk_object, object);

	if (!ATK_IS_GOBJECT_ACCESSIBLE (atk_object)) {
		g_object_set_qdata_full
			(object, get_quark_accessible (), atk_object,
			 (GDestroyNotify)eel_accessibility_destroy);
		g_object_set_qdata
			(G_OBJECT (atk_object), get_quark_gobject (), object);
	}

	return atk_object;
}
Пример #29
0
NS_IMETHODIMP nsAccessibleWrap::GetNativeInterface(void **aOutAccessible)
{
    *aOutAccessible = nsnull;

    if (!mMaiAtkObject) {
        CreateMaiInterfaces();
        GType type = GetMaiAtkType(mInterfaceCount, mInterfaces);
        NS_ENSURE_TRUE(type, NS_ERROR_FAILURE);
        mMaiAtkObject =
            NS_REINTERPRET_CAST(AtkObject *,
                                g_object_new(type, NULL));
        NS_ENSURE_TRUE(mMaiAtkObject, NS_ERROR_OUT_OF_MEMORY);

        atk_object_initialize(mMaiAtkObject, this);
        mMaiAtkObject->role = ATK_ROLE_INVALID;
        mMaiAtkObject->layer = ATK_LAYER_INVALID;
    }
Пример #30
0
/**
 * @brief Implementation AtkObject->ref_child callback
 *
 * ATK doc says:\n
 * Gets a reference to the specified accessible child of the object. The
 * accessible children are 0-based so the first accessible child is at index 0,
 * the second at index 1 and so on.
 *
 * @param obj an AtkObject
 * @param i index of a child
 *
 * @returns an AtkObject representing the specified accessible child of the
 * accessible.
 */
static AtkObject *
eail_index_ref_child(AtkObject *obj, gint i)
{
   const Eina_List *items;
   AtkObject *child = NULL;

   items = eail_index_get_index_items(obj);
   if (eina_list_count(items) > i)
     {
        child = eail_item_new(obj, ATK_ROLE_LIST_ITEM);
        atk_object_initialize(child, eina_list_nth(items, i));

        g_object_ref(child);
     }

   return child;
}