X-Git-Url: http://review.tizen.org/git/?a=blobdiff_plain;f=libspi%2Fhypertext.c;h=42bc9001c2ccbef996f40b52344dc14cf70eb59d;hb=e215f4330239bfe0d9bf87dfe968ced9eca79089;hp=82f58a7f9e5b6029d3532efafc828b3d81ce689f;hpb=e07aeb10fff4c7802393f5cbe8460d1097cbec18;p=platform%2Fcore%2Fuifw%2Fat-spi2-atk.git diff --git a/libspi/hypertext.c b/libspi/hypertext.c index 82f58a7..42bc900 100644 --- a/libspi/hypertext.c +++ b/libspi/hypertext.c @@ -20,35 +20,21 @@ * Boston, MA 02111-1307, USA. */ -/* - * component.c : bonobo wrapper for accessible component implementation - * - */ -#include -#include +/* hypertext.c : implements the HyperText interface */ +#include #include +#include +#include -/* - * This pulls the CORBA definitions for the "Accessibility::Accessible" server - */ -#include - -/* - * This pulls the definition of the hypertext bonobo object - */ -#include "hypertext.h" - -/* - * Static function declarations - */ +/* Static function declarations */ static void -hypertext_class_init (HypertextClass *klass); +spi_hypertext_class_init (SpiHypertextClass *klass); static void -hypertext_init (Hypertext *hypertext); +spi_hypertext_init (SpiHypertext *hypertext); static void -hypertext_finalize (GObject *obj); +spi_hypertext_finalize (GObject *obj); static CORBA_short impl__get_n_anchors (PortableServer_Servant _servant, CORBA_Environment * ev); @@ -84,21 +70,21 @@ impl_getLinkIndex (PortableServer_Servant _servant, static GObjectClass *parent_class; GType -hypertext_get_type (void) +spi_hypertext_get_type (void) { static GType type = 0; if (!type) { static const GTypeInfo tinfo = { - sizeof (HypertextClass), + sizeof (SpiHypertextClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, - (GClassInitFunc) hypertext_class_init, + (GClassInitFunc) spi_hypertext_class_init, (GClassFinalizeFunc) NULL, NULL, /* class data */ - sizeof (Hypertext), + sizeof (SpiHypertext), 0, /* n preallocs */ - (GInstanceInitFunc) hypertext_init, + (GInstanceInitFunc) spi_hypertext_init, NULL /* value table */ }; @@ -111,22 +97,22 @@ hypertext_get_type (void) BONOBO_OBJECT_TYPE, POA_Accessibility_Hypertext__init, NULL, - G_STRUCT_OFFSET (HypertextClass, epv), + G_STRUCT_OFFSET (SpiHypertextClass, epv), &tinfo, - "AccessibleHypertext"); + "SpiAccessibleHypertext"); } return type; } static void -hypertext_class_init (HypertextClass *klass) +spi_hypertext_class_init (SpiHypertextClass *klass) { GObjectClass * object_class = (GObjectClass *) klass; POA_Accessibility_Hypertext__epv *epv = &klass->epv; parent_class = g_type_class_peek_parent (klass); - object_class->finalize = hypertext_finalize; + object_class->finalize = spi_hypertext_finalize; /* Initialize epv table */ @@ -136,24 +122,26 @@ hypertext_class_init (HypertextClass *klass) } static void -hypertext_init (Hypertext *hypertext) +spi_hypertext_init (SpiHypertext *hypertext) { } static void -hypertext_finalize (GObject *obj) +spi_hypertext_finalize (GObject *obj) { - Hypertext *hypertext = HYPERTEXT(obj); - hypertext->atk_hypertext = NULL; + SpiHypertext *hypertext = SPI_HYPERTEXT(obj); + g_object_unref (hypertext->atko); + hypertext->atko = NULL; parent_class->finalize (obj); } -Hypertext * -hypertext_new (AtkHypertext *hypertext) +SpiHypertext * +spi_hypertext_interface_new (AtkObject *obj) { - Hypertext *new_hypertext = - HYPERTEXT(g_object_new (HYPERTEXT_TYPE, NULL)); - new_hypertext->atk_hypertext = hypertext; + SpiHypertext *new_hypertext = + SPI_HYPERTEXT(g_object_new (SPI_HYPERTEXT_TYPE, NULL)); + new_hypertext->atko = obj; + g_object_ref (obj); return new_hypertext; } @@ -163,25 +151,30 @@ static CORBA_long impl_getNLinks (PortableServer_Servant _servant, CORBA_Environment * ev) { - Hypertext *hypertext = HYPERTEXT(bonobo_object_from_servant(_servant)); + SpiHypertext *hypertext = SPI_HYPERTEXT(bonobo_object_from_servant(_servant)); return (CORBA_long) - atk_hypertext_get_n_links (hypertext->atk_hypertext); + atk_hypertext_get_n_links (ATK_HYPERTEXT(hypertext->atko)); } static Accessibility_Hyperlink -impl_getLink (PortableServer_Servant _servant, - const CORBA_long linkIndex, - CORBA_Environment * ev) +impl_getLink (PortableServer_Servant servant, + const CORBA_long linkIndex, + CORBA_Environment *ev) { AtkHyperlink *link; - Hypertext *hypertext = HYPERTEXT(bonobo_object_from_servant(_servant)); + SpiHypertext *hypertext; Accessibility_Hyperlink rv; - link = atk_hypertext_get_link (hypertext->atk_hypertext, - (gint) linkIndex); - rv = bonobo_object_corba_objref (BONOBO_OBJECT(hyperlink_new(link))); + hypertext = SPI_HYPERTEXT (bonobo_object_from_servant (servant)); + + link = atk_hypertext_get_link ( + ATK_HYPERTEXT (hypertext->atko), linkIndex); + + rv = bonobo_object_corba_objref (BONOBO_OBJECT ( + spi_hyperlink_new (ATK_OBJECT (link)))); + return rv; } @@ -192,9 +185,9 @@ impl_getLinkIndex (PortableServer_Servant _servant, const CORBA_long characterIndex, CORBA_Environment * ev) { - Hypertext *hypertext = HYPERTEXT(bonobo_object_from_servant(_servant)); + SpiHypertext *hypertext = SPI_HYPERTEXT(bonobo_object_from_servant(_servant)); return (CORBA_long) - atk_hypertext_get_link_index (hypertext->atk_hypertext, + atk_hypertext_get_link_index (ATK_HYPERTEXT(hypertext->atko), (gint) characterIndex); }