X-Git-Url: http://review.tizen.org/git/?a=blobdiff_plain;f=libspi%2Fdesktop.c;h=241fbc1360508ab3f33950cb74228e3715b10156;hb=e215f4330239bfe0d9bf87dfe968ced9eca79089;hp=82acb4410e83800aea9d6df781fc6af20fe0a112;hpb=408978dd34f3338e49b6ace5f60b7606579ce7a9;p=platform%2Fcore%2Fuifw%2Fat-spi2-atk.git diff --git a/libspi/desktop.c b/libspi/desktop.c index 82acb44..241fbc1 100644 --- a/libspi/desktop.c +++ b/libspi/desktop.c @@ -20,34 +20,17 @@ * Boston, MA 02111-1307, USA. */ -/* - * desktop.c: implements SpiDesktop.idl - * - */ - -/* #include */ -#include +/* desktop.c: implements SpiDesktop.idl */ +#include #include +#include +#include -/* - * This pulls the CORBA definitions for the "Accessibility::SpiAccessible" server - */ -#include - -/* - * This pulls the definition for the BonoboObject (Gtk Type) - */ -#include "desktop.h" - -/* - * Our parent Gtk object type - */ +/* Our parent Gtk object type */ #define PARENT_TYPE SPI_ACCESSIBLE_TYPE -/* - * A pointer to our parent object class - */ +/* A pointer to our parent object class */ static SpiAccessibleClass *parent_class; static void @@ -59,7 +42,7 @@ spi_desktop_init (SpiDesktop *desktop) } static CORBA_long -impl_spi_desktop_get_child_count (PortableServer_Servant servant, +impl_desktop_get_child_count (PortableServer_Servant servant, CORBA_Environment * ev) { SpiDesktop *desktop = SPI_DESKTOP (bonobo_object_from_servant (servant)); @@ -73,8 +56,8 @@ impl_spi_desktop_get_child_count (PortableServer_Servant servant, } } -static Accessibility_SpiAccessible -impl_spi_desktop_get_child_at_index (PortableServer_Servant servant, +static Accessibility_Accessible +impl_desktop_get_child_at_index (PortableServer_Servant servant, const CORBA_long index, CORBA_Environment * ev) { @@ -94,61 +77,30 @@ impl_spi_desktop_get_child_at_index (PortableServer_Servant servant, fprintf (stderr, "no %ldth child\n", (long) index); retval = CORBA_OBJECT_NIL; } - return (Accessibility_SpiAccessible) retval; + return (Accessibility_Accessible) retval; } static void spi_desktop_class_init (SpiDesktopClass *klass) { SpiAccessibleClass * spi_accessible_class = (SpiAccessibleClass *) klass; - POA_Accessibility_SpiAccessible__epv *epv = &spi_accessible_class->epv; + POA_Accessibility_Accessible__epv *epv = &spi_accessible_class->epv; parent_class = g_type_class_ref (SPI_ACCESSIBLE_TYPE); - epv->_get_childCount = impl_spi_desktop_get_child_count; - epv->getChildAtIndex = impl_spi_desktop_get_child_at_index; + epv->_get_childCount = impl_desktop_get_child_count; + epv->getChildAtIndex = impl_desktop_get_child_at_index; } -GType -spi_desktop_get_type (void) -{ - static GType type = 0; - - if (!type) { - static const GTypeInfo tinfo = { - sizeof (SpiDesktopClass), - (GBaseInitFunc) NULL, - (GBaseFinalizeFunc) NULL, - (GClassInitFunc) spi_desktop_class_init, - (GClassFinalizeFunc) NULL, - NULL, /* class data */ - sizeof (SpiDesktop), - 0, /* n preallocs */ - (GInstanceInitFunc) spi_desktop_init, - NULL /* value table */ - }; - /* - * Here we use bonobo_type_unique instead of - * gtk_type_unique, this auto-generates a load of - * CORBA structures for us. All derived types must - * use bonobo_type_unique. - */ - type = bonobo_type_unique ( - PARENT_TYPE, - POA_Accessibility_SpiDesktop__init, - NULL, - G_STRUCT_OFFSET (SpiDesktopClass, epv), - &tinfo, - "SpiDesktop"); - } - - return type; -} +BONOBO_TYPE_FUNC_FULL (SpiDesktop, + Accessibility_Desktop, + PARENT_TYPE, + spi_desktop); SpiDesktop * spi_desktop_new (void) { - SpiDesktop *retval = - SPI_DESKTOP (g_object_new (spi_desktop_get_type (), NULL)); + SpiDesktop *retval = SPI_DESKTOP (g_object_new (SPI_DESKTOP_TYPE, NULL)); + return retval; }