2 * AT-SPI - Assistive Technology Service Provider Interface
3 * (Gnome Accessibility Project; http://developer.gnome.org/projects/gap)
5 * Copyright 2001 Sun Microsystems Inc.
7 * This library is free software; you can redistribute it and/or
8 * modify it under the terms of the GNU Library General Public
9 * License as published by the Free Software Foundation; either
10 * version 2 of the License, or (at your option) any later version.
12 * This library is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15 * Library General Public License for more details.
17 * You should have received a copy of the GNU Library General Public
18 * License along with this library; if not, write to the
19 * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
20 * Boston, MA 02111-1307, USA.
23 /* hypertext.c : implements the HyperText interface */
27 #include <libspi/hyperlink.h>
28 #include <libspi/hypertext.h>
30 /* Static function declarations */
32 static GObjectClass *parent_class;
35 spi_hypertext_finalize (GObject *obj)
37 parent_class->finalize (obj);
41 spi_hypertext_interface_new (AtkObject *obj)
43 SpiHypertext *new_hypertext = g_object_new (SPI_HYPERTEXT_TYPE, NULL);
44 (SPI_TEXT (new_hypertext))->atko = obj;
52 impl_getNLinks (PortableServer_Servant _servant,
53 CORBA_Environment * ev)
55 SpiHypertext *hypertext = SPI_HYPERTEXT (bonobo_object_from_servant(_servant));
57 atk_hypertext_get_n_links (ATK_HYPERTEXT ((SPI_TEXT (hypertext))->atko));
62 static Accessibility_Hyperlink
63 impl_getLink (PortableServer_Servant servant,
64 const CORBA_long linkIndex,
65 CORBA_Environment *ev)
68 SpiHypertext *hypertext;
69 Accessibility_Hyperlink rv;
71 hypertext = SPI_HYPERTEXT (bonobo_object_from_servant (servant));
73 link = atk_hypertext_get_link (
74 ATK_HYPERTEXT ((SPI_TEXT (hypertext))->atko), linkIndex);
76 rv = bonobo_object_corba_objref (BONOBO_OBJECT (
77 spi_hyperlink_new (ATK_OBJECT (link))));
85 impl_getLinkIndex (PortableServer_Servant _servant,
86 const CORBA_long characterIndex,
87 CORBA_Environment * ev)
89 SpiHypertext *hypertext = SPI_HYPERTEXT(bonobo_object_from_servant(_servant));
91 atk_hypertext_get_link_index (ATK_HYPERTEXT ((SPI_TEXT (hypertext))->atko),
92 (gint) characterIndex);
96 spi_hypertext_class_init (SpiHypertextClass *klass)
98 GObjectClass * object_class = (GObjectClass *) klass;
99 POA_Accessibility_Hypertext__epv *epv = &klass->epv;
100 parent_class = g_type_class_peek_parent (klass);
102 object_class->finalize = spi_hypertext_finalize;
104 /* Initialize epv table */
106 epv->getNLinks = impl_getNLinks;
107 epv->getLink = impl_getLink;
108 epv->getLinkIndex = impl_getLinkIndex;
112 spi_hypertext_init (SpiHypertext *hypertext)
116 BONOBO_TYPE_FUNC_FULL (SpiHypertext,
117 Accessibility_Hypertext,