From: marcm Date: Tue, 18 Dec 2001 13:38:45 +0000 (+0000) Subject: 2001-12-18 Marc Mulcahy X-Git-Tag: AT_SPI2_CORE_0_1_3~998 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=42bec7927aea61be20b65fbfa155a74e3e8b4e3e;p=platform%2Fupstream%2Fat-spi2-core.git 2001-12-18 Marc Mulcahy * at-spi/libspi/accessible.c at-spi/libspi/action.c at-spi/libspi/application.c at-spi/libspi/base.c at-spi/libspi/base.h at-spi/libspi/component.c at-spi/libspi/editabletext.c at-spi/libspi/hyperlink.c at-spi/libspi/hypertext.c at-spi/libspi/image.c at-spi/libspi/selection.c at-spi/libspi/table.c at-spi/libspi/text.c at-spi/libspi/value.c at-spi/registryd/desktop.c: Changed SpiBase to contain a GObject pointer rather than an AtkObject git-svn-id: http://svn.gnome.org/svn/at-spi/trunk@190 e2bd861d-eb25-0410-b326-f6ed22b6b98c --- diff --git a/ChangeLog b/ChangeLog index 527aff5..87061eb 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,13 @@ +2001-12-18 Marc Mulcahy + + * at-spi/libspi/accessible.c at-spi/libspi/action.c +at-spi/libspi/application.c at-spi/libspi/base.c at-spi/libspi/base.h +at-spi/libspi/component.c at-spi/libspi/editabletext.c +at-spi/libspi/hyperlink.c at-spi/libspi/hypertext.c +at-spi/libspi/image.c at-spi/libspi/selection.c at-spi/libspi/table.c +at-spi/libspi/text.c at-spi/libspi/value.c at-spi/registryd/desktop.c: +Changed SpiBase to contain a GObject pointer rather than an AtkObject + 2001-12-17 Bill Haneman * idl/Accessibility_Registry.idl: diff --git a/libspi/accessible.c b/libspi/accessible.c index ef8a66f..76eae96 100644 --- a/libspi/accessible.c +++ b/libspi/accessible.c @@ -147,12 +147,9 @@ get_accessible_from_servant (PortableServer_Servant servant) { SpiBase *object = SPI_BASE (bonobo_object_from_servant (servant)); - if (!object) - { - return NULL; - } - - return object->atko; + g_return_val_if_fail (object, NULL); + g_return_val_if_fail (ATK_IS_OBJECT(object->gobj), NULL); + return ATK_OBJECT(object->gobj); } /* @@ -436,7 +433,7 @@ get_public_refs (void) static void de_register_public_ref (SpiBase *object) { - g_hash_table_remove (get_public_refs (), object->atko); + g_hash_table_remove (get_public_refs (), object->gobj); } SpiAccessible * @@ -457,7 +454,7 @@ spi_accessible_new (AtkObject *o) retval = g_object_new (SPI_ACCESSIBLE_TYPE, NULL); - spi_base_construct (SPI_BASE (retval), o); + spi_base_construct (SPI_BASE (retval), G_OBJECT(o)); g_hash_table_insert (get_public_refs (), o, retval); g_signal_connect (G_OBJECT (retval), "destroy", diff --git a/libspi/action.c b/libspi/action.c index 48fdb5e..d0352c5 100644 --- a/libspi/action.c +++ b/libspi/action.c @@ -83,7 +83,7 @@ spi_action_interface_new (AtkObject *obj) { SpiAction *new_action = g_object_new (SPI_ACTION_TYPE, NULL); - spi_base_construct (SPI_BASE (new_action), obj); + spi_base_construct (SPI_BASE (new_action), G_OBJECT(obj)); return new_action; } @@ -92,7 +92,9 @@ static AtkAction * get_action_from_servant (PortableServer_Servant servant) { SpiBase *object = SPI_BASE (bonobo_object_from_servant (servant)); - return ATK_ACTION (object->atko); + g_return_val_if_fail (object != NULL, NULL); + g_return_val_if_fail (ATK_IS_OBJECT(object->gobj), NULL); + return ATK_ACTION (object->gobj); } static CORBA_long diff --git a/libspi/application.c b/libspi/application.c index 40e09c7..103adc0 100644 --- a/libspi/application.c +++ b/libspi/application.c @@ -364,7 +364,7 @@ spi_application_new (AtkObject *app_root) { SpiApplication *retval = g_object_new (SPI_APPLICATION_TYPE, NULL); - spi_base_construct (SPI_BASE (retval), app_root); + spi_base_construct (SPI_BASE (retval), G_OBJECT(app_root)); return retval; } diff --git a/libspi/base.c b/libspi/base.c index 46abe00..7c602d6 100644 --- a/libspi/base.c +++ b/libspi/base.c @@ -40,11 +40,11 @@ spi_base_object_dispose (GObject *gobject) { SpiBase *object = SPI_BASE (gobject); - if (object->atko) + if (object->gobj) { - g_assert (ATK_IS_OBJECT (object->atko)); - g_object_unref (G_OBJECT (object->atko)); - object->atko = NULL; + g_assert (G_IS_OBJECT (object->gobj)); + g_object_unref (object->gobj); + object->gobj = NULL; } spi_base_parent_class->dispose (gobject); @@ -68,21 +68,19 @@ spi_base_init (SpiBase *object) BONOBO_TYPE_FUNC (SpiBase, PARENT_TYPE, spi_base); void -spi_base_construct (SpiBase *object, AtkObject *aobject) +spi_base_construct (SpiBase *object, GObject *gobject) { - object->atko = g_object_ref (G_OBJECT (aobject)); + object->gobj = g_object_ref (gobject); } void spi_base_construct_default (SpiBase *object) { - object->atko = g_object_new (ATK_TYPE_OBJECT, NULL); + object->gobj = g_object_new (G_TYPE_OBJECT, NULL); } -AtkObject * -spi_base_get_atkobject (SpiBase *object) +GObject * +spi_base_get_gobject (SpiBase *object) { - g_return_val_if_fail (ATK_IS_OBJECT (object), NULL); - - return object->atko; + return object->gobj; } diff --git a/libspi/base.h b/libspi/base.h index 2f1c206..d96bf71 100644 --- a/libspi/base.h +++ b/libspi/base.h @@ -35,7 +35,7 @@ G_BEGIN_DECLS typedef struct { BonoboObject parent; - AtkObject *atko; + GObject *gobj; } SpiBase; typedef struct { @@ -44,9 +44,9 @@ typedef struct { GType spi_base_get_type (void); void spi_base_construct (SpiBase *base, - AtkObject *aobject); + GObject *gobject); void spi_base_construct_default (SpiBase *base); -AtkObject *spi_base_get_atkbase (SpiBase *base); +GObject *spi_base_get_gobject (SpiBase *base); G_END_DECLS diff --git a/libspi/component.c b/libspi/component.c index 39acc8f..645dea0 100644 --- a/libspi/component.c +++ b/libspi/component.c @@ -38,7 +38,8 @@ get_component_from_servant (PortableServer_Servant servant) { SpiBase *object = SPI_BASE (bonobo_object_from_servant (servant)); g_return_val_if_fail (object != NULL, NULL); - return ATK_COMPONENT (object->atko); + g_return_val_if_fail (ATK_IS_OBJECT(object->gobj), NULL); + return ATK_COMPONENT (object->gobj); } /* @@ -216,7 +217,7 @@ spi_component_interface_new (AtkObject *o) { SpiComponent *retval = g_object_new (SPI_COMPONENT_TYPE, NULL); - spi_base_construct (SPI_BASE (retval), o); + spi_base_construct (SPI_BASE (retval), G_OBJECT(o)); return retval; } diff --git a/libspi/editabletext.c b/libspi/editabletext.c index 7a14352..ea5c326 100644 --- a/libspi/editabletext.c +++ b/libspi/editabletext.c @@ -110,12 +110,9 @@ get_editable_text_from_servant (PortableServer_Servant servant) { SpiBase *object = SPI_BASE (bonobo_object_from_servant (servant)); - if (!object) - { - return NULL; - } - - return ATK_EDITABLE_TEXT (object->atko); + g_return_val_if_fail (object, NULL); + g_return_val_if_fail (ATK_IS_OBJECT(object->gobj), NULL); + return ATK_EDITABLE_TEXT (object->gobj); } diff --git a/libspi/hyperlink.c b/libspi/hyperlink.c index 36b538d..d11ca0e 100644 --- a/libspi/hyperlink.c +++ b/libspi/hyperlink.c @@ -88,7 +88,7 @@ spi_hyperlink_new (AtkObject *object) SpiHyperlink *new_hyperlink = g_object_new ( SPI_HYPERLINK_TYPE, NULL); - spi_base_construct (SPI_BASE (new_hyperlink), object); + spi_base_construct (SPI_BASE (new_hyperlink), G_OBJECT(object)); return new_hyperlink; } @@ -99,12 +99,9 @@ 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); + g_return_val_if_fail (object != NULL, NULL); + g_return_val_if_fail (ATK_IS_OBJECT(object->gobj), NULL); + return ATK_HYPERLINK (object->gobj); } diff --git a/libspi/hypertext.c b/libspi/hypertext.c index 3aac466..4ec1085 100644 --- a/libspi/hypertext.c +++ b/libspi/hypertext.c @@ -44,12 +44,9 @@ get_hypertext_from_servant (PortableServer_Servant servant) { SpiBase *object = SPI_BASE (bonobo_object_from_servant (servant)); - if (!object) - { - return NULL; - } - - return ATK_HYPERTEXT (object->atko); + g_return_val_if_fail (object, NULL); + g_return_val_if_fail (ATK_IS_OBJECT(object->gobj), NULL); + return ATK_HYPERTEXT (object->gobj); } diff --git a/libspi/image.c b/libspi/image.c index 889722a..8a30cb7 100644 --- a/libspi/image.c +++ b/libspi/image.c @@ -32,7 +32,7 @@ spi_image_interface_new (AtkObject *obj) { SpiImage *new_image = g_object_new (SPI_IMAGE_TYPE, NULL); - spi_base_construct (SPI_BASE (new_image), obj); + spi_base_construct (SPI_BASE (new_image), G_OBJECT(obj)); return new_image; } @@ -42,12 +42,9 @@ get_image_from_servant (PortableServer_Servant servant) { SpiBase *object = SPI_BASE (bonobo_object_from_servant (servant)); - if (!object) - { - return NULL; - } - - return ATK_IMAGE (object->atko); + g_return_val_if_fail (object, NULL); + g_return_val_if_fail (ATK_IS_OBJECT(object->gobj), NULL); + return ATK_IMAGE (object->gobj); } static void diff --git a/libspi/selection.c b/libspi/selection.c index 538a8c2..5932af0 100644 --- a/libspi/selection.c +++ b/libspi/selection.c @@ -33,7 +33,7 @@ spi_selection_interface_new (AtkObject *obj) { SpiSelection *new_selection = g_object_new (SPI_SELECTION_TYPE, NULL); - spi_base_construct (SPI_BASE (new_selection), obj); + spi_base_construct (SPI_BASE (new_selection), G_OBJECT(obj)); return new_selection; } @@ -44,12 +44,9 @@ get_selection_from_servant (PortableServer_Servant servant) { SpiBase *object = SPI_BASE (bonobo_object_from_servant (servant)); - if (!object) - { - return NULL; - } - - return ATK_SELECTION (object->atko); + g_return_val_if_fail (object, NULL); + g_return_val_if_fail (ATK_IS_OBJECT(object->gobj), NULL); + return ATK_SELECTION (object->gobj); } diff --git a/libspi/table.c b/libspi/table.c index 111c872..f01cab0 100644 --- a/libspi/table.c +++ b/libspi/table.c @@ -35,7 +35,7 @@ spi_table_interface_new (AtkObject *obj) { SpiTable *new_table = g_object_new (SPI_TABLE_TYPE, NULL); - spi_base_construct (SPI_BASE (new_table), obj); + spi_base_construct (SPI_BASE (new_table), G_OBJECT(obj)); return new_table; } @@ -46,12 +46,9 @@ get_table_from_servant (PortableServer_Servant servant) { SpiBase *object = SPI_BASE (bonobo_object_from_servant (servant)); - if (!object) - { - return NULL; - } - - return ATK_TABLE (object->atko); + g_return_val_if_fail (object, NULL); + g_return_val_if_fail (ATK_IS_OBJECT(object->gobj), NULL); + return ATK_TABLE (object->gobj); } diff --git a/libspi/text.c b/libspi/text.c index bc74e26..b322239 100644 --- a/libspi/text.c +++ b/libspi/text.c @@ -36,12 +36,9 @@ get_text_from_servant (PortableServer_Servant servant) { SpiBase *object = SPI_BASE (bonobo_object_from_servant (servant)); - if (!object) - { - return NULL; - } - - return ATK_TEXT (object->atko); + g_return_val_if_fail (object, NULL); + g_return_val_if_fail (ATK_IS_OBJECT(object->gobj), NULL); + return ATK_TEXT (object->gobj); } static CORBA_string @@ -406,9 +403,10 @@ BONOBO_TYPE_FUNC_FULL (SpiText, void spi_text_construct (SpiText *text, AtkObject *obj) { - spi_base_construct (SPI_BASE (text), obj); + spi_base_construct (SPI_BASE (text), G_OBJECT(obj)); } + SpiText * spi_text_interface_new (AtkObject *obj) { diff --git a/libspi/value.c b/libspi/value.c index e576486..204e6b1 100644 --- a/libspi/value.c +++ b/libspi/value.c @@ -83,7 +83,7 @@ spi_value_interface_new (AtkObject *obj) { SpiValue *new_value = g_object_new (SPI_VALUE_TYPE, NULL); - spi_base_construct (SPI_BASE (new_value), obj); + spi_base_construct (SPI_BASE (new_value), G_OBJECT(obj)); return new_value; } @@ -94,12 +94,9 @@ get_value_from_servant (PortableServer_Servant servant) { SpiBase *object = SPI_BASE (bonobo_object_from_servant (servant)); - if (!object) - { - return NULL; - } - - return ATK_VALUE (object->atko); + g_return_val_if_fail (object, NULL); + g_return_val_if_fail (ATK_IS_OBJECT(object->gobj), NULL); + return ATK_VALUE (object->gobj); } static double diff --git a/registryd/desktop.c b/registryd/desktop.c index 35063b4..305f7d7 100644 --- a/registryd/desktop.c +++ b/registryd/desktop.c @@ -45,7 +45,7 @@ spi_desktop_init (SpiDesktop *desktop) desktop->applications = NULL; - atk_object_set_name (SPI_BASE (desktop)->atko, "main"); + atk_object_set_name (ATK_OBJECT(SPI_BASE (desktop)->gobj), "main"); } static void