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

    AtkHyperlink* hyperlink = atk_hyperlink_impl_get_hyperlink(ATK_HYPERLINK_IMPL(m_element.get()));
    GOwnPtr<char> hyperlinkURI(atk_hyperlink_get_uri(hyperlink, 0));

    // Build the result string, stripping the absolute URL paths if present.
    char* localURI = g_strstr_len(hyperlinkURI.get(), -1, "LayoutTests");
    String axURL = String::format("AXURL: %s", localURI ? localURI : hyperlinkURI.get());
    return JSStringCreateWithUTF8CString(axURL.utf8().data());
}
Beispiel #2
0
static CORBA_string
impl_getURI (PortableServer_Servant servant,
	     const CORBA_long i, CORBA_Environment *ev)
{
  gchar *uri;
  CORBA_char *rv;
  AtkHyperlink *link = get_hyperlink_from_servant (servant);

  g_return_val_if_fail (link != NULL, CORBA_string_dup (""));

  uri = atk_hyperlink_get_uri (link, i);
  if (uri)
    {
      rv = CORBA_string_dup (uri);
      g_free (uri);
    }
  else
    rv = CORBA_string_dup ("");

  return rv;
} 
static VALUE
rbatk_hl_get_uri(VALUE self, VALUE i)
{
    return CSTR2RVAL(atk_hyperlink_get_uri(_SELF(self), NUM2INT(i)));
}