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

C++ GTK_ACCESSIBLE函数代码示例

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

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



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

示例1: gail_label_get_text

static gchar*
gail_label_get_text (AtkText *text,
                     gint    start_pos,
                     gint    end_pos)
{
  GtkWidget *widget;
  GtkLabel  *label;

  const gchar *label_text;

  widget = GTK_ACCESSIBLE (text)->widget;
  if (widget == NULL)
    /* State is defunct */
    return NULL;

  label = GTK_LABEL (widget);

  label_text = gtk_label_get_text (label);
 
  if (label_text == NULL)
    return NULL;
  else
  {
    if (GAIL_LABEL (text)->textutil == NULL) 
      gail_label_init_text_util (GAIL_LABEL (text), widget);
    return gail_text_util_get_substring (GAIL_LABEL(text)->textutil, 
                                         start_pos, end_pos);
  }
}
开发者ID:coapp-packages,项目名称:gtk,代码行数:29,代码来源:gaillabel.c


示例2: gail_expander_get_n_children

static gint
gail_expander_get_n_children (AtkObject* obj)
{
  GtkWidget *widget;
  GList *children;
  gint count = 0;

  g_return_val_if_fail (GAIL_IS_CONTAINER (obj), count);

  widget = GTK_ACCESSIBLE (obj)->widget;
  if (widget == NULL)
    return 0;

  children = gtk_container_get_children (GTK_CONTAINER(widget));
  count = g_list_length (children);
  g_list_free (children);

  /* See if there is a label - if there is, reduce our count by 1
   * since we don't want the label included with the children.
   */
  if (gtk_expander_get_label_widget (GTK_EXPANDER (widget)))
    count -= 1;

  return count; 
}
开发者ID:Aridna,项目名称:gtk2,代码行数:25,代码来源:gailexpander.c


示例3: gail_expander_get_text

static gchar*
gail_expander_get_text (AtkText *text,
                        gint    start_pos,
                        gint    end_pos)
{
  GtkWidget *widget;
  GailExpander *expander;
  const gchar *label_text;

  widget = GTK_ACCESSIBLE (text)->widget;
  if (widget == NULL)
    /* State is defunct */
    return NULL;

  expander = GAIL_EXPANDER (text);
  if (!expander->textutil) 
    gail_expander_init_textutil (expander, GTK_EXPANDER (widget));

  label_text = gail_expander_get_full_text (GTK_EXPANDER (widget));

  if (label_text == NULL)
    return NULL;
  else
    return gail_text_util_get_substring (expander->textutil, 
                                         start_pos, end_pos);
}
开发者ID:Aridna,项目名称:gtk2,代码行数:26,代码来源:gailexpander.c


示例4: panel_menu_button_accessible_get_n_children

static int
panel_menu_button_accessible_get_n_children (AtkObject *obj)
{
	g_return_val_if_fail (PANEL_IS_MENU_BUTTON_ACCESSIBLE (obj), 0);

	return GTK_ACCESSIBLE (obj)->widget ? 1 : 0;
}
开发者ID:guadalinex-archive,项目名称:guadalinex-v4,代码行数:7,代码来源:panel-menu-button.c


示例5: gail_window_get_size

static void
gail_window_get_size (AtkComponent *component,
                      gint         *width,
                      gint         *height)
{
  GtkWidget *widget = GTK_ACCESSIBLE (component)->widget; 
  GdkRectangle rect;

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

  gail_return_if_fail (GTK_IS_WINDOW (widget));

  if (!gtk_widget_is_toplevel (widget))
    {
      AtkComponentIface *parent_iface;

      parent_iface = (AtkComponentIface *) g_type_interface_peek_parent (ATK_COMPONENT_GET_IFACE (component));
      parent_iface->get_size (component, width, height);
      return;
    }
  gdk_window_get_frame_extents (widget->window, &rect);

  *width = rect.width;
  *height = rect.height;
}
开发者ID:Aridna,项目名称:gtk2,代码行数:29,代码来源:gailwindow.c


示例6: gtk_menu_shell_accessible_is_child_selected

static gboolean
gtk_menu_shell_accessible_is_child_selected (AtkSelection *selection,
                                             gint          i)
{
  GtkMenuShell *shell;
  GList *kids;
  gint j;
  GtkWidget *widget;
  GtkWidget *item;

  widget =  gtk_accessible_get_widget (GTK_ACCESSIBLE (selection));
  if (widget == NULL)
    return FALSE;

  shell = GTK_MENU_SHELL (widget);
  item = gtk_menu_shell_get_selected_item (shell);
  if (item == NULL)
    return FALSE;

  kids = gtk_container_get_children (GTK_CONTAINER (shell));
  j = g_list_index (kids, item);
  g_list_free (kids);

  return j==i;
}
开发者ID:ceibal-tatu,项目名称:gtk-3.0,代码行数:25,代码来源:gtkmenushellaccessible.c


示例7: gail_label_get_offset_at_point

static gint 
gail_label_get_offset_at_point (AtkText      *text,
                                gint         x,
                                gint         y,
			        AtkCoordType coords)
{ 
  GtkWidget *widget;
  GtkLabel *label;
  gint index, x_layout, y_layout;

  widget = GTK_ACCESSIBLE (text)->widget;
  if (widget == NULL)
    /* State is defunct */
    return -1;
  label = GTK_LABEL (widget);
  
  gtk_label_get_layout_offsets (label, &x_layout, &y_layout);
  
  index = gail_misc_get_index_at_point_in_layout (widget, 
                                              gtk_label_get_layout (label), 
                                              x_layout, y_layout, x, y, coords);
  if (index == -1)
    {
      if (coords == ATK_XY_WINDOW || coords == ATK_XY_SCREEN)
        return g_utf8_strlen (label->text, -1);

      return index;  
    }
  else
    return g_utf8_pointer_to_offset (label->text, label->text + index);  
}
开发者ID:coapp-packages,项目名称:gtk,代码行数:31,代码来源:gaillabel.c


示例8: gail_pixmap_get_image_size

static void  
gail_pixmap_get_image_size (AtkImage       *obj,
                            gint           *width,
                            gint           *height)
{
  GtkWidget *widget;
  GtkPixmap *pixmap;
 
  *width = -1;
  *height = -1;

  g_return_if_fail (GAIL_IS_PIXMAP (obj));

  widget = GTK_ACCESSIBLE (obj)->widget;
  if (widget == 0)
    /* State is defunct */
    return;

  g_return_if_fail (GTK_IS_PIXMAP (widget));

  pixmap = GTK_PIXMAP (widget);

  if (pixmap->pixmap)
    gdk_drawable_get_size (pixmap->pixmap, width, height);
}
开发者ID:Aridna,项目名称:gtk2,代码行数:25,代码来源:gailpixmap.c


示例9: gail_label_set_selection

static gboolean
gail_label_set_selection (AtkText *text,
			  gint	  selection_num,
                          gint    start_pos,
                          gint    end_pos)
{
  GtkWidget *widget;
  GtkLabel  *label;
  gint start, end;

  widget = GTK_ACCESSIBLE (text)->widget;
  if (widget == NULL)
    /* State is defunct */
    return FALSE;

  if (selection_num != 0)
     return FALSE;

  label = GTK_LABEL (widget);

  if (!gtk_label_get_selectable (label))
     return FALSE;

  if (gtk_label_get_selection_bounds (label, &start, &end))
    {
      gtk_label_select_region (label, start_pos, end_pos);
      return TRUE;
    }
  else
    return FALSE;
}
开发者ID:coapp-packages,项目名称:gtk,代码行数:31,代码来源:gaillabel.c


示例10: gail_label_get_selection

static gchar*
gail_label_get_selection (AtkText *text,
			  gint    selection_num,
                          gint    *start_pos,
                          gint    *end_pos)
{
  GtkWidget *widget;
  GtkLabel  *label;

  widget = GTK_ACCESSIBLE (text)->widget;
  if (widget == NULL)
    /* State is defunct */
    return NULL;

  label = GTK_LABEL (widget);

 /* Only let the user get the selection if one is set, and if the
  * selection_num is 0.
  */
  if (!gtk_label_get_selectable( label) || selection_num != 0)
     return NULL;

  if (gtk_label_get_selection_bounds (label, start_pos, end_pos))
    {
      const gchar* label_text = gtk_label_get_text (label);
    
      if (label_text == NULL)
        return 0;
      else
        return gail_text_util_get_substring (GAIL_LABEL (text)->textutil, 
                                             *start_pos, *end_pos);
    }
  else 
    return NULL;
}
开发者ID:coapp-packages,项目名称:gtk,代码行数:35,代码来源:gaillabel.c


示例11: gail_label_get_text_after_offset

static gchar*
gail_label_get_text_after_offset (AtkText         *text,
				  gint            offset,
				  AtkTextBoundary boundary_type,
				  gint            *start_offset,
				  gint            *end_offset)
{
  GtkWidget *widget;
  GtkLabel *label;

  widget = GTK_ACCESSIBLE (text)->widget;
  
  if (widget == NULL)
  {
    /* State is defunct */
    return NULL;
  }
  
  /* Get label */
  label = GTK_LABEL (widget);

  return gail_text_util_get_text (GAIL_LABEL (text)->textutil,
                           gtk_label_get_layout (label), GAIL_AFTER_OFFSET, 
                           boundary_type, offset, start_offset, end_offset);
}
开发者ID:coapp-packages,项目名称:gtk,代码行数:25,代码来源:gaillabel.c


示例12: ev_view_accessible_action_do_action

static gboolean
ev_view_accessible_action_do_action (AtkAction *action,
				     gint      i)
{
	EvViewAccessiblePriv* priv = EV_VIEW_ACCESSIBLE_GET_PRIVATE (action);

	if (gtk_accessible_get_widget (GTK_ACCESSIBLE (action)) == NULL)
		return FALSE;

	if (priv->action_idle_handler)
		return FALSE;

	switch (i) {
	case ACTION_SCROLL_UP:
		priv->idle_scroll = GTK_SCROLL_PAGE_BACKWARD;
		break;
	case ACTION_SCROLL_DOWN:
		priv->idle_scroll = GTK_SCROLL_PAGE_FORWARD;
		break;
	default:
		return FALSE;
	}
	priv->action_idle_handler = g_idle_add (ev_view_accessible_idle_do_action,
	                                        action);
	return TRUE;
}
开发者ID:RavetcoFX,项目名称:gnome-apps,代码行数:26,代码来源:ev-view-accessible.c


示例13: gtk_menu_shell_accessible_add_selection

static gboolean
gtk_menu_shell_accessible_add_selection (AtkSelection *selection,
                                         gint          i)
{
  GList *kids;
  GtkWidget *item;
  guint length;
  GtkWidget *widget;

  widget =  gtk_accessible_get_widget (GTK_ACCESSIBLE (selection));
  if (widget == NULL)
    return FALSE;

  kids = gtk_container_get_children (GTK_CONTAINER (widget));
  length = g_list_length (kids);
  if (i < 0 || i > length)
    {
      g_list_free (kids);
      return FALSE;
    }

  item = g_list_nth_data (kids, i);
  g_list_free (kids);
  g_return_val_if_fail (GTK_IS_MENU_ITEM (item), FALSE);
  gtk_menu_shell_select_item (GTK_MENU_SHELL (widget), item);
  return TRUE;
}
开发者ID:ceibal-tatu,项目名称:gtk-3.0,代码行数:27,代码来源:gtkmenushellaccessible.c


示例14: gtk_check_menu_item_accessible_ref_state_set

static AtkStateSet *
gtk_check_menu_item_accessible_ref_state_set (AtkObject *accessible)
{
  AtkStateSet *state_set;
  GtkCheckMenuItem *check_menu_item;
  GtkWidget *widget;

  widget = gtk_accessible_get_widget (GTK_ACCESSIBLE (accessible));
  if (widget == NULL)
    return NULL;

  state_set = ATK_OBJECT_CLASS (gtk_check_menu_item_accessible_parent_class)->ref_state_set (accessible);

  check_menu_item = GTK_CHECK_MENU_ITEM (widget);

  if (gtk_check_menu_item_get_active (check_menu_item))
    atk_state_set_add_state (state_set, ATK_STATE_CHECKED);

  if (gtk_check_menu_item_get_inconsistent (check_menu_item))
    {
      atk_state_set_remove_state (state_set, ATK_STATE_ENABLED);
      atk_state_set_add_state (state_set, ATK_STATE_INDETERMINATE);
    }

  return state_set;
}
开发者ID:3v1n0,项目名称:gtk,代码行数:26,代码来源:gtkcheckmenuitemaccessible.c


示例15: gtk_menu_shell_accessible_ref_selection

static AtkObject *
gtk_menu_shell_accessible_ref_selection (AtkSelection *selection,
                                         gint          i)
{
  GtkMenuShell *shell;
  AtkObject *obj;
  GtkWidget *widget;
  GtkWidget *item;

  widget =  gtk_accessible_get_widget (GTK_ACCESSIBLE (selection));
  if (widget == NULL)
    return NULL;

  if (i != 0)
    return NULL;

  shell = GTK_MENU_SHELL (widget);

  item = gtk_menu_shell_get_selected_item (shell);
  if (item != NULL)
    {
      obj = gtk_widget_get_accessible (item);
      g_object_ref (obj);
      return obj;
    }
  return NULL;
}
开发者ID:ceibal-tatu,项目名称:gtk-3.0,代码行数:27,代码来源:gtkmenushellaccessible.c


示例16: gail_window_ref_state_set

static AtkStateSet*
gail_window_ref_state_set (AtkObject *accessible)
{
  AtkStateSet *state_set;
  GtkWidget *widget;
  GtkWindow *window;
  GdkWindowState state;

  state_set = ATK_OBJECT_CLASS (gail_window_parent_class)->ref_state_set (accessible);
  widget = GTK_ACCESSIBLE (accessible)->widget;
 
  if (widget == NULL)
    return state_set;

  window = GTK_WINDOW (widget);

  if (window->has_focus)
    atk_state_set_add_state (state_set, ATK_STATE_ACTIVE);

  if (widget->window)
    {
      state = gdk_window_get_state (widget->window);
      if (state & GDK_WINDOW_STATE_ICONIFIED)
        atk_state_set_add_state (state_set, ATK_STATE_ICONIFIED);
    } 
  if (gtk_window_get_modal (window))
    atk_state_set_add_state (state_set, ATK_STATE_MODAL);

  if (gtk_window_get_resizable (window))
    atk_state_set_add_state (state_set, ATK_STATE_RESIZABLE);
 
  return state_set;
}
开发者ID:Aridna,项目名称:gtk2,代码行数:33,代码来源:gailwindow.c


示例17: ev_view_accessible_get_text

static gchar*
ev_view_accessible_get_text (AtkText *text,
			     gint    start_pos,
			     gint    end_pos)
{
	GtkWidget *widget;
	GtkTextIter start, end;
	GtkTextBuffer *buffer;
	gchar *retval;

	widget = gtk_accessible_get_widget (GTK_ACCESSIBLE (text));
	if (widget == NULL)
		/* State is defunct */
		return NULL;

	buffer = ev_view_accessible_get_text_buffer (EV_VIEW_ACCESSIBLE (text), EV_VIEW (widget));
	if (!buffer)
		return NULL;

	gtk_text_buffer_get_iter_at_offset (buffer, &start, start_pos);
	gtk_text_buffer_get_iter_at_offset (buffer, &end, end_pos);
	retval = gtk_text_buffer_get_text (buffer, &start, &end, FALSE);

	return retval;
}
开发者ID:RavetcoFX,项目名称:gnome-apps,代码行数:25,代码来源:ev-view-accessible.c


示例18: ev_view_accessible_get_character_at_offset

static gunichar
ev_view_accessible_get_character_at_offset (AtkText *text,
					    gint    offset)
{
	GtkWidget *widget;
	GtkTextIter start, end;
	GtkTextBuffer *buffer;
	gchar *string;
	gunichar unichar;

	widget = gtk_accessible_get_widget (GTK_ACCESSIBLE (text));
	if (widget == NULL)
		/* State is defunct */
		return '\0';

	buffer = ev_view_accessible_get_text_buffer (EV_VIEW_ACCESSIBLE (text), EV_VIEW (widget));
	if (!buffer)
		return '\0';

	if (offset >= gtk_text_buffer_get_char_count (buffer))
		return '\0';

	gtk_text_buffer_get_iter_at_offset (buffer, &start, offset);
	end = start;
	gtk_text_iter_forward_char (&end);
	string = gtk_text_buffer_get_slice (buffer, &start, &end, FALSE);
	unichar = g_utf8_get_char (string);
	g_free(string);

	return unichar;
}
开发者ID:RavetcoFX,项目名称:gnome-apps,代码行数:31,代码来源:ev-view-accessible.c


示例19: ev_view_accessible_get_text_after_offset

static gchar*
ev_view_accessible_get_text_after_offset (AtkText	    *text,
					  gint		    offset,
					  AtkTextBoundary   boundary_type,
					  gint		    *start_offset,
					  gint		    *end_offset)
{
	GtkWidget *widget;
	gpointer layout = NULL;
	GailTextUtil *gail_text = NULL;
	gchar *retval = NULL;
	GtkTextBuffer *buffer;

	widget = gtk_accessible_get_widget (GTK_ACCESSIBLE (text));
	if (widget == NULL)
		/* State is defunct */
		return NULL;

	buffer = ev_view_accessible_get_text_buffer (EV_VIEW_ACCESSIBLE (text), EV_VIEW (widget));
	if (!buffer)
		return NULL;

	gail_text = gail_text_util_new ();
	gail_text_util_buffer_setup (gail_text, buffer);
	retval = gail_text_util_get_text (gail_text, layout,
	                                  GAIL_AFTER_OFFSET, boundary_type,
	                                  offset, start_offset, end_offset);
	g_object_unref (gail_text);

	return retval;
}
开发者ID:RavetcoFX,项目名称:gnome-apps,代码行数:31,代码来源:ev-view-accessible.c


示例20: gail_expander_get_name

static G_CONST_RETURN gchar*
gail_expander_get_name (AtkObject *obj)
{
  G_CONST_RETURN gchar *name;
  g_return_val_if_fail (GAIL_IS_EXPANDER (obj), NULL);

  name = ATK_OBJECT_CLASS (gail_expander_parent_class)->get_name (obj);
  if (name != NULL)
    return name;
  else
    {
      /*
       * Get the text on the label
       */
      GtkWidget *widget;

      widget = GTK_ACCESSIBLE (obj)->widget;
      if (widget == NULL)
        /*
         * State is defunct
         */
        return NULL;

      g_return_val_if_fail (GTK_IS_EXPANDER (widget), NULL);

      return gail_expander_get_full_text (GTK_EXPANDER (widget));
    }
}
开发者ID:Aridna,项目名称:gtk2,代码行数:28,代码来源:gailexpander.c



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


鲜花

握手

雷人

路过

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

请发表评论

全部评论

专题导读
上一篇:
C++ GTK_ACTION函数代码示例发布时间:2022-05-30
下一篇:
C++ GTK_ABOUT_DIALOG函数代码示例发布时间: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