static gchar *
gtk_text_cell_accessible_get_text_before_offset (AtkText         *atk_text,
                                                 gint             offset,
                                                 AtkTextBoundary  boundary_type,
                                                 gint            *start_offset,
                                                 gint            *end_offset)
{
  PangoLayout *layout;
  gchar *text;

  layout = create_pango_layout (GTK_TEXT_CELL_ACCESSIBLE (atk_text));
  text = _gtk_pango_get_text_before (layout, boundary_type, offset, start_offset, end_offset);
  g_object_unref (layout);

  return text;
}
示例#2
0
static gchar *
gtk_label_accessible_get_text_before_offset (AtkText         *text,
                                             gint             offset,
                                             AtkTextBoundary  boundary_type,
                                             gint            *start_offset,
                                             gint            *end_offset)
{
  GtkWidget *widget;

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

  return _gtk_pango_get_text_before (gtk_label_get_layout (GTK_LABEL (widget)),
                                     boundary_type, offset,
                                     start_offset, end_offset);
}
示例#3
0
static gchar *
gtk_icon_view_item_accessible_get_text_before_offset (AtkText         *atk_text,
                                                      gint             offset,
                                                      AtkTextBoundary  boundary_type,
                                                      gint            *start_offset,
                                                      gint            *end_offset)
{
  GtkIconViewItemAccessible *item;
  PangoLayout *layout;
  gchar *text;

  item = GTK_ICON_VIEW_ITEM_ACCESSIBLE (atk_text);
  if (atk_state_set_contains_state (item->state_set, ATK_STATE_DEFUNCT))
    return NULL;

  layout = create_pango_layout (item);
  text = _gtk_pango_get_text_before (layout, boundary_type, offset, start_offset, end_offset);
  g_object_unref (layout);

  return text;
}