Ejemplo n.º 1
0
static void
atk_hyperlink_real_get_property (GObject    *object,
                                 guint      prop_id,
                                 GValue     *value,
                                 GParamSpec *pspec)
{
  AtkHyperlink* link;

  link = ATK_HYPERLINK (object);

  switch (prop_id)
    {
    case PROP_SELECTED_LINK:
      g_value_set_boolean (value, atk_hyperlink_is_selected_link (link));
      break;
    case PROP_NUMBER_ANCHORS:
      g_value_set_int (value,  atk_hyperlink_get_n_anchors (link));
      break;
    case PROP_END_INDEX:
      g_value_set_int (value, atk_hyperlink_get_end_index (link));
      break;
    case PROP_START_INDEX:
      g_value_set_int (value, atk_hyperlink_get_start_index (link));
      break;
    default:
      break;
    }
}
Ejemplo n.º 2
0
static CORBA_long
impl__get_endIndex (PortableServer_Servant servant,
		    CORBA_Environment     *ev)
{
  AtkHyperlink *link = get_hyperlink_from_servant (servant);

  g_return_val_if_fail (link != NULL, -1);

  return atk_hyperlink_get_end_index (link);
}
Ejemplo n.º 3
0
static gint
ev_page_accessible_get_link_index (AtkHypertext *hypertext,
				   gint          offset)
{
	guint i;
	gint n_links = ev_page_accessible_get_n_links (hypertext);

	for (i = 0; i < n_links; i++) {
		AtkHyperlink *hyperlink;
		gint          start_index, end_index;

		hyperlink = ev_page_accessible_get_link (hypertext, i);
		start_index = atk_hyperlink_get_start_index (hyperlink);
		end_index = atk_hyperlink_get_end_index (hyperlink);

		if (start_index <= offset && end_index >= offset)
			return i;
	}

	return -1;
}