projects
/
platform
/
core
/
uifw
/
at-spi2-atk.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Fixed use of setenv () which broke Solaris build.
[platform/core/uifw/at-spi2-atk.git]
/
libspi
/
hyperlink.c
diff --git
a/libspi/hyperlink.c
b/libspi/hyperlink.c
index
eb31975
..
36b538d
100644
(file)
--- a/
libspi/hyperlink.c
+++ b/
libspi/hyperlink.c
@@
-33,8
+33,6
@@
static void
spi_hyperlink_class_init (SpiHyperlinkClass *klass);
static void
spi_hyperlink_init (SpiHyperlink *hyperlink);
spi_hyperlink_class_init (SpiHyperlinkClass *klass);
static void
spi_hyperlink_init (SpiHyperlink *hyperlink);
-static void
-spi_hyperlink_finalize (GObject *obj);
static CORBA_string
impl_getURI (PortableServer_Servant _servant,
const CORBA_long i, CORBA_Environment * ev);
static CORBA_string
impl_getURI (PortableServer_Servant _servant,
const CORBA_long i, CORBA_Environment * ev);
@@
-55,22
+53,17
@@
static CORBA_boolean
impl_isValid (PortableServer_Servant _servant,
CORBA_Environment * ev);
impl_isValid (PortableServer_Servant _servant,
CORBA_Environment * ev);
-static GObjectClass *parent_class;
-
BONOBO_TYPE_FUNC_FULL (SpiHyperlink,
Accessibility_Hyperlink,
BONOBO_TYPE_FUNC_FULL (SpiHyperlink,
Accessibility_Hyperlink,
-
BONOBO_TYPE_OBJECT
,
+
SPI_TYPE_BASE
,
spi_hyperlink);
spi_hyperlink);
+
static void
spi_hyperlink_class_init (SpiHyperlinkClass *klass)
{
static void
spi_hyperlink_class_init (SpiHyperlinkClass *klass)
{
- GObjectClass * object_class = (GObjectClass *) klass;
POA_Accessibility_Hyperlink__epv *epv = &klass->epv;
POA_Accessibility_Hyperlink__epv *epv = &klass->epv;
- parent_class = g_type_class_peek_parent (klass);
-
- object_class->finalize = spi_hyperlink_finalize;
/* Initialize epv table */
/* Initialize epv table */
@@
-82,101
+75,122
@@
spi_hyperlink_class_init (SpiHyperlinkClass *klass)
epv->isValid = impl_isValid;
}
epv->isValid = impl_isValid;
}
+
static void
spi_hyperlink_init (SpiHyperlink *hyperlink)
{
}
static void
spi_hyperlink_init (SpiHyperlink *hyperlink)
{
}
-static void
-spi_hyperlink_finalize (GObject *obj)
-{
- SpiHyperlink *hyperlink = SPI_HYPERLINK(obj);
- g_object_unref (hyperlink->hyperlink);
- hyperlink->hyperlink = NULL;
- parent_class->finalize (obj);
-}
SpiHyperlink *
SpiHyperlink *
-spi_hyperlink_new (Atk
Hyperlink *hyperlink
)
+spi_hyperlink_new (Atk
Object *object
)
{
SpiHyperlink *new_hyperlink = g_object_new (
SPI_HYPERLINK_TYPE, NULL);
{
SpiHyperlink *new_hyperlink = g_object_new (
SPI_HYPERLINK_TYPE, NULL);
- g_object_ref (hyperlink);
- new_hyperlink->hyperlink = hyperlink;
+
+ spi_base_construct (SPI_BASE (new_hyperlink), object);
+
return new_hyperlink;
}
return new_hyperlink;
}
+static AtkHyperlink *
+get_hyperlink_from_servant (PortableServer_Servant servant)
+{
+ SpiBase *object = SPI_BASE (bonobo_object_from_servant (servant));
+
+ if (!object)
+ {
+ return NULL;
+ }
+
+ return ATK_HYPERLINK (object->atko);
+}
+
static CORBA_short
static CORBA_short
-impl__get_n_anchors (PortableServer_Servant
_
servant,
- CORBA_Environment
*
ev)
+impl__get_n_anchors (PortableServer_Servant servant,
+ CORBA_Environment
*
ev)
{
{
-
SpiHyperlink *link = SPI_HYPERLINK(bonobo_object_from_servant(_servant)
);
- return (CORBA_short) atk_hyperlink_get_n_anchors (ATK_HYPERLINK(link->hyperlink));
-}
+
AtkHyperlink *link = get_hyperlink_from_servant (servant
);
+
+ g_return_val_if_fail (link != NULL, 0);
+ return (CORBA_short) atk_hyperlink_get_n_anchors (link);
+}
static CORBA_long
static CORBA_long
-impl__get_startIndex (PortableServer_Servant
_
servant,
- CORBA_Environment
*
ev)
+impl__get_startIndex (PortableServer_Servant servant,
+ CORBA_Environment
*
ev)
{
{
- SpiHyperlink *link = SPI_HYPERLINK(bonobo_object_from_servant(_servant));
- return (CORBA_long) atk_hyperlink_get_start_index (ATK_HYPERLINK(link->hyperlink));
-}
+ AtkHyperlink *link = get_hyperlink_from_servant (servant);
+ g_return_val_if_fail (link != NULL, -1);
+
+ return (CORBA_long) atk_hyperlink_get_start_index (link);
+}
static CORBA_long
static CORBA_long
-impl__get_endIndex (PortableServer_Servant
_
servant,
- CORBA_Environment
*
ev)
+impl__get_endIndex (PortableServer_Servant servant,
+ CORBA_Environment
*
ev)
{
{
-
SpiHyperlink *link = SPI_HYPERLINK(bonobo_object_from_servant(_servant)
);
- return (CORBA_long) atk_hyperlink_get_end_index (ATK_HYPERLINK(link->hyperlink));
-}
+
AtkHyperlink *link = get_hyperlink_from_servant (servant
);
+
+ g_return_val_if_fail (link != NULL, -1);
+ return (CORBA_long) atk_hyperlink_get_end_index (link);
+}
static CORBA_string
static CORBA_string
-impl_getURI (PortableServer_Servant
_
servant,
-
const CORBA_long i, CORBA_Environment *
ev)
+impl_getURI (PortableServer_Servant servant,
+
const CORBA_long i, CORBA_Environment *
ev)
{
{
- SpiHyperlink *link = SPI_HYPERLINK(bonobo_object_from_servant(_servant));
gchar *uri;
CORBA_char *rv;
gchar *uri;
CORBA_char *rv;
- uri = atk_hyperlink_get_uri (ATK_HYPERLINK(link->hyperlink), (gint) i);
+ AtkHyperlink *link = get_hyperlink_from_servant (servant);
+
+ g_return_val_if_fail (link != NULL, CORBA_string_dup (""));
+
+ uri = atk_hyperlink_get_uri (link, (gint) i);
if (uri)
{
rv = CORBA_string_dup (uri);
g_free (uri);
if (uri)
{
rv = CORBA_string_dup (uri);
g_free (uri);
-
}
+ }
else
rv = CORBA_string_dup ("");
else
rv = CORBA_string_dup ("");
+
return rv;
}
return rv;
}
-
static Accessibility_Accessible
static Accessibility_Accessible
-impl_getObject (PortableServer_Servant
_
servant,
- const CORBA_long i,
- CORBA_Environment
*
ev)
+impl_getObject (PortableServer_Servant servant,
+ const CORBA_long
i,
+ CORBA_Environment
*
ev)
{
{
- SpiHyperlink *link = SPI_HYPERLINK(bonobo_object_from_servant(_servant));
- AtkObject *atk_object;
- Accessibility_Accessible rv;
- atk_object = atk_hyperlink_get_object (ATK_HYPERLINK(link->hyperlink), (gint) i);
- rv = bonobo_object_corba_objref (BONOBO_OBJECT(spi_accessible_new(atk_object)));
- return rv;
-}
+ AtkObject *atk_object;
+ AtkHyperlink *link = get_hyperlink_from_servant (servant);
+
+ g_return_val_if_fail (link != NULL, CORBA_OBJECT_NIL);
+ atk_object = atk_hyperlink_get_object (link, (gint) i);
+
+ return spi_accessible_new_return (atk_object, FALSE, ev);
+}
static CORBA_boolean
static CORBA_boolean
-impl_isValid (PortableServer_Servant
_
servant,
- CORBA_Environment
*
ev)
+impl_isValid (PortableServer_Servant servant,
+ CORBA_Environment
*
ev)
{
{
- SpiHyperlink *link = SPI_HYPERLINK(bonobo_object_from_servant(_servant));
- return (CORBA_boolean) atk_hyperlink_is_valid (ATK_HYPERLINK(link->hyperlink));
+ AtkHyperlink *link = get_hyperlink_from_servant (servant);
+
+ g_return_val_if_fail (link != NULL, TRUE);
+
+ return (CORBA_boolean) atk_hyperlink_is_valid (link);
}
}
+