• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

C++ ATK_IS_OBJECT函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了C++中ATK_IS_OBJECT函数的典型用法代码示例。如果您正苦于以下问题:C++ ATK_IS_OBJECT函数的具体用法?C++ ATK_IS_OBJECT怎么用?C++ ATK_IS_OBJECT使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。



在下文中一共展示了ATK_IS_OBJECT函数的16个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。

示例1: _do_test

void
_do_test(AtkObject *obj)
{
   const char *type_name = g_type_name(G_TYPE_FROM_INSTANCE(obj));

   g_assert(ATK_IS_OBJECT(obj));
   g_assert_cmpstr(type_name, ==, "EailFlipselector");

   g_assert(atk_object_get_n_accessible_children(obj) == ITEMS_COUNT);

   /*
    * AtkSelection tests
    */
   g_assert(ATK_IS_SELECTION(obj));

   /* atk_selection_add_selection test */
   g_assert(atk_selection_add_selection(ATK_SELECTION(obj), ITEM_SEL_EINA));
   g_assert(atk_selection_is_child_selected(ATK_SELECTION(obj), ITEM_SEL_EINA));

   /* atk_selection_clear_selection test */
   g_assert(atk_selection_clear_selection(ATK_SELECTION(obj)) == FALSE);

   /* eail_flipselector_ref_selection test */
   g_assert(atk_selection_is_child_selected(ATK_SELECTION(obj), ITEM_SEL_EINA));

   /* atk_selection_get_selection_count test */
   g_assert(atk_selection_get_selection_count(ATK_SELECTION(obj)) == MAX_SELECTIONS);

   /* atk_selection_is_child_selected test */
   g_assert(atk_selection_is_child_selected(ATK_SELECTION(obj), ITEM_SEL_EINA));

   /* atk_selection_remove_selection test */
   g_assert(atk_selection_remove_selection(ATK_SELECTION(obj), ITEM_SEL_EINA));
   g_assert(atk_selection_is_child_selected(ATK_SELECTION(obj), ITEM_SEL_ELM));

   /* atk_selection_select_all_selection test */
   g_assert(atk_selection_select_all_selection(ATK_SELECTION(obj)) == FALSE);

   /*
    * AtkAction tests
    */
   g_assert(ATK_IS_ACTION(obj));

   /* atk_action_get_n_actions test */
   g_assert(atk_action_get_n_actions(ATK_ACTION(obj)) == ACTIONS_COUNT);

   /* test existing actions */
   g_assert(atk_selection_add_selection(ATK_SELECTION(obj), ITEM_SEL_EINA));
   eailu_test_action_activate(ATK_ACTION(obj), "next");
   g_assert(atk_selection_is_child_selected(ATK_SELECTION(obj), ITEM_SEL_EDJE));

   eailu_test_action_activate(ATK_ACTION(obj), "prev");
   g_assert(atk_selection_is_child_selected(ATK_SELECTION(obj), ITEM_SEL_EINA));

   /* test for non-existing action */
   g_assert((eailu_get_action_number(ATK_ACTION(obj), "typo")) == -1);

   /* test set/get action description */
   eailu_test_action_description_all(ATK_ACTION(obj));
}
开发者ID:radoslawjablonski,项目名称:eail,代码行数:60,代码来源:eail_flipselector_test.c


示例2: JSStringCreateWithCharacters

JSRetainPtr<JSStringRef> AccessibilityUIElement::allAttributes()
{
    if (!ATK_IS_OBJECT(m_element.get()))
        return JSStringCreateWithCharacters(0, 0);

    return JSStringCreateWithUTF8CString(attributesOfElement(this).utf8().data());
}
开发者ID:ZeusbaseWeb,项目名称:webkit,代码行数:7,代码来源:AccessibilityUIElementAtk.cpp


示例3: intValue

double AccessibilityUIElement::intValue() const
{
    if (!ATK_IS_OBJECT(m_element.get()))
        return 0;

    if (ATK_IS_VALUE(m_element.get())) {
        GValue value = G_VALUE_INIT;
        atk_value_get_current_value(ATK_VALUE(m_element.get()), &value);
        if (!G_VALUE_HOLDS_FLOAT(&value))
            return 0;
        return g_value_get_float(&value);
    }

    // Consider headings as an special case when returning the "int value" of
    // an AccessibilityUIElement, so we can reuse some tests to check the level
    // both for HTML headings and objects with the aria-level attribute.
    if (atk_object_get_role(ATK_OBJECT(m_element.get())) == ATK_ROLE_HEADING) {
        String headingLevel = getAttributeSetValueForId(ATK_OBJECT(m_element.get()), ObjectAttributeType, "level");
        bool ok;
        double headingLevelValue = headingLevel.toDouble(&ok);
        if (ok)
            return headingLevelValue;
    }

    return 0;
}
开发者ID:ZeusbaseWeb,项目名称:webkit,代码行数:26,代码来源:AccessibilityUIElementAtk.cpp


示例4: childrenCount

int AccessibilityUIElement::childrenCount()
{
    if (!ATK_IS_OBJECT(m_element.get()))
        return 0;

    return atk_object_get_n_accessible_children(ATK_OBJECT(m_element.get()));
}
开发者ID:ZeusbaseWeb,项目名称:webkit,代码行数:7,代码来源:AccessibilityUIElementAtk.cpp


示例5: impl_GetChildren

static DBusMessage *
impl_GetChildren (DBusConnection * bus,
                  DBusMessage * message, void *user_data)
{
  AtkObject *object = (AtkObject *) user_data;
  gint i;
  gint count;
  DBusMessage *reply;
  DBusMessageIter iter, iter_array;

  g_return_val_if_fail (ATK_IS_OBJECT (user_data),
                        droute_not_yet_handled_error (message));
  count = atk_object_get_n_accessible_children (object);
  reply = dbus_message_new_method_return (message);
  if (!reply)
    goto oom;
  dbus_message_iter_init_append (reply, &iter);
  if (!dbus_message_iter_open_container
      (&iter, DBUS_TYPE_ARRAY, "(so)", &iter_array))
    goto oom;
  for (i = 0; i < count; i++)
    {
      AtkObject *child = atk_object_ref_accessible_child (object, i);
      spi_object_append_reference (&iter_array, child); 
      if (child)
        g_object_unref (child);
    }
  if (!dbus_message_iter_close_container (&iter, &iter_array))
    goto oom;
  return reply;
oom:
  // TODO: handle out-of-memory
  return reply;
}
开发者ID:GNOME,项目名称:at-spi2-atk,代码行数:34,代码来源:accessible-adaptor.c


示例6: impl_GetState

static DBusMessage *
impl_GetState (DBusConnection * bus, DBusMessage * message, void *user_data)
{
  AtkObject *object = (AtkObject *) user_data;

  DBusMessage *reply = NULL;
  DBusMessageIter iter, iter_array;

  dbus_uint32_t states[2];

  guint count;

  g_return_val_if_fail (ATK_IS_OBJECT (user_data),
                        droute_not_yet_handled_error (message));

  reply = dbus_message_new_method_return (message);
  dbus_message_iter_init_append (reply, &iter);

  spi_atk_state_to_dbus_array (object, states);
  dbus_message_iter_open_container (&iter, DBUS_TYPE_ARRAY, "u", &iter_array);
  for (count = 0; count < 2; count++)
    {
      dbus_message_iter_append_basic (&iter_array, DBUS_TYPE_UINT32,
                                      &states[count]);
    }
  dbus_message_iter_close_container (&iter, &iter_array);
  return reply;
}
开发者ID:GNOME,项目名称:at-spi2-atk,代码行数:28,代码来源:accessible-adaptor.c


示例7:

PassRefPtr<AccessibilityUIElement> AccessibilityUIElement::parentElement()
{
    if (!ATK_IS_OBJECT(m_element.get()))
        return nullptr;

    AtkObject* parent = atk_object_get_parent(ATK_OBJECT(m_element.get()));
    return parent ? AccessibilityUIElement::create(parent) : nullptr;
}
开发者ID:ZeusbaseWeb,项目名称:webkit,代码行数:8,代码来源:AccessibilityUIElementAtk.cpp


示例8: JSStringCreateWithCharacters

JSStringRef AccessibilityUIElement::allAttributes()
{
    if (!m_element)
        return JSStringCreateWithCharacters(0, 0);

    ASSERT(ATK_IS_OBJECT(m_element));
    return JSStringCreateWithUTF8CString(attributeSetToString(atk_object_get_attributes(ATK_OBJECT(m_element))));
}
开发者ID:dankurka,项目名称:webkit_titanium,代码行数:8,代码来源:AccessibilityUIElementGtk.cpp


示例9: checkElementState

static bool checkElementState(PlatformUIElement element, AtkStateType stateType)
{
    if (!ATK_IS_OBJECT(element))
         return false;

    GRefPtr<AtkStateSet> stateSet = adoptGRef(atk_object_ref_state_set(ATK_OBJECT(element)));
    return atk_state_set_contains_state(stateSet.get(), stateType);
}
开发者ID:dankurka,项目名称:webkit_titanium,代码行数:8,代码来源:AccessibilityUIElementGtk.cpp


示例10: hasPopup

bool AccessibilityUIElement::hasPopup() const
{
    if (!ATK_IS_OBJECT(m_element.get()))
        return false;

    String hasPopupValue = getAttributeSetValueForId(ATK_OBJECT(m_element.get()), ObjectAttributeType, "haspopup");
    return equalIgnoringCase(hasPopupValue, "true");
}
开发者ID:ZeusbaseWeb,项目名称:webkit,代码行数:8,代码来源:AccessibilityUIElementAtk.cpp


示例11: get_atkobject_from_servant

static AtkObject *
get_atkobject_from_servant (PortableServer_Servant servant)
{
  SpiBase *object = SPI_BASE (bonobo_object_from_servant (servant));

  g_return_val_if_fail (object, NULL);
  g_return_val_if_fail (ATK_IS_OBJECT(object->gobj), NULL);
  return ATK_OBJECT(object->gobj);
}
开发者ID:GNOME,项目名称:at-spi,代码行数:9,代码来源:accessible.c


示例12: impl_get_Locale

static dbus_bool_t
impl_get_Locale (DBusMessageIter * iter, void *user_data)
{
  AtkObject *object = (AtkObject *) user_data;

  g_return_val_if_fail (ATK_IS_OBJECT (user_data), FALSE);

  return droute_return_v_string (iter, atk_object_get_object_locale (object));
}
开发者ID:GNOME,项目名称:at-spi2-atk,代码行数:9,代码来源:accessible-adaptor.c


示例13: getChildrenWithRange

void AccessibilityUIElement::getChildrenWithRange(Vector<RefPtr<AccessibilityUIElement> >& children, unsigned location, unsigned length)
{
    if (!ATK_IS_OBJECT(m_element.get()))
        return;
    unsigned end = location + length;
    for (unsigned i = location; i < end; i++) {
        GRefPtr<AtkObject> child = adoptGRef(atk_object_ref_accessible_child(ATK_OBJECT(m_element.get()), i));
        children.append(AccessibilityUIElement::create(child.get()));
    }
}
开发者ID:ZeusbaseWeb,项目名称:webkit,代码行数:10,代码来源:AccessibilityUIElementAtk.cpp


示例14: isFocusable

bool AccessibilityUIElement::isFocusable() const
{
    if (!ATK_IS_OBJECT(m_element))
        return false;

    GRefPtr<AtkStateSet> stateSet = adoptGRef(atk_object_ref_state_set(ATK_OBJECT(m_element)));
    gboolean isFocusable = atk_state_set_contains_state(stateSet.get(), ATK_STATE_FOCUSABLE);

    return isFocusable;
}
开发者ID:dankurka,项目名称:webkit_titanium,代码行数:10,代码来源:AccessibilityUIElementGtk.cpp


示例15: isChecked

bool AccessibilityUIElement::isChecked() const
{
    if (!ATK_IS_OBJECT(m_element))
        return false;

    GRefPtr<AtkStateSet> stateSet = adoptGRef(atk_object_ref_state_set(ATK_OBJECT(m_element)));
    gboolean isChecked = atk_state_set_contains_state(stateSet.get(), ATK_STATE_CHECKED);

    return isChecked;
}
开发者ID:fatman2021,项目名称:webkitgtk,代码行数:10,代码来源:AccessibilityUIElementAtk.cpp


示例16: getChildren

void AccessibilityUIElement::getChildren(Vector<RefPtr<AccessibilityUIElement> >& children)
{
    if (!ATK_IS_OBJECT(m_element.get()))
        return;

    int count = childrenCount();
    for (int i = 0; i < count; i++) {
        GRefPtr<AtkObject> child = adoptGRef(atk_object_ref_accessible_child(ATK_OBJECT(m_element.get()), i));
        children.append(AccessibilityUIElement::create(child.get()));
    }
}
开发者ID:ZeusbaseWeb,项目名称:webkit,代码行数:11,代码来源:AccessibilityUIElementAtk.cpp



注:本文中的ATK_IS_OBJECT函数示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C++ ATK_IS_TABLE函数代码示例发布时间:2022-05-30
下一篇:
C++ ATH5K_DBG_UNLIMIT函数代码示例发布时间:2022-05-30
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap