From 2a52cece4bf09e15a526a0e7b67569a5e0de6b43 Mon Sep 17 00:00:00 2001 From: marcm Date: Wed, 5 Sep 2001 13:27:53 +0000 Subject: [PATCH] Fixed refcounting issues with interface server implementations-- made server implementations own AtkObject pointers rather than their respective AtkInterrface pointers to fix refcounting. AtkHyperlink is still broken. git-svn-id: http://svn.gnome.org/svn/at-spi/trunk@58 e2bd861d-eb25-0410-b326-f6ed22b6b98c --- ChangeLog | 5 +++++ idl/Accessibility_Text.idl | 2 +- idl/Text.idl | 2 +- libspi/accessible.c | 34 +++++++++++++++++++++------------- libspi/accessible.h | 1 - libspi/action.c | 18 ++++++++++-------- libspi/action.h | 4 ++-- libspi/component.c | 9 +++++---- libspi/editabletext.c | 22 ++++++++++++---------- libspi/editabletext.h | 4 ++-- libspi/hyperlink.c | 20 +++++++++++--------- libspi/hyperlink.h | 4 ++-- libspi/hypertext.c | 16 +++++++++------- libspi/hypertext.h | 4 ++-- libspi/image.c | 14 ++++++++------ libspi/image.h | 4 ++-- libspi/selection.c | 22 ++++++++++++---------- libspi/selection.h | 4 ++-- libspi/table.c | 46 ++++++++++++++++++++++++---------------------- libspi/table.h | 4 ++-- libspi/text.c | 42 ++++++++++++++++++++++-------------------- libspi/text.h | 4 ++-- libspi/value.c | 16 +++++++++------- libspi/value.h | 4 ++-- po/ChangeLog | 4 ++++ 25 files changed, 172 insertions(+), 137 deletions(-) diff --git a/ChangeLog b/ChangeLog index 685d9e6..5469fac 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +<2001-09-05 Marc Mulcahy + implementations-- made server implementations own AtkObject pointers + rather than their respective AtkInterrface pointers to fix + refcounting. AtkHyperlink is still broken. + 2001-09-04 Bill Haneman * at-bridge/bridge.c: diff --git a/idl/Accessibility_Text.idl b/idl/Accessibility_Text.idl index 65c24d7..1fdcae5 100644 --- a/idl/Accessibility_Text.idl +++ b/idl/Accessibility_Text.idl @@ -50,7 +50,7 @@ module Accessibility { /* void getRowColAtOffset (in long offset, out long row, out long column); */ string getAttributes (in long offset, out long startOffset, out long endOffset); - boolean getCharacterExtents (in long offset, out long x, out long y, out long length, out long width, in short coordType); + void getCharacterExtents (in long offset, out long x, out long y, out long length, out long width, in short coordType); long getOffsetAtPoint (in long x, in long y, in short coordType); long getNSelections (); void getSelection (in long selectionNum, out long startOffset, out long endOffset); diff --git a/idl/Text.idl b/idl/Text.idl index 65c24d7..1fdcae5 100644 --- a/idl/Text.idl +++ b/idl/Text.idl @@ -50,7 +50,7 @@ module Accessibility { /* void getRowColAtOffset (in long offset, out long row, out long column); */ string getAttributes (in long offset, out long startOffset, out long endOffset); - boolean getCharacterExtents (in long offset, out long x, out long y, out long length, out long width, in short coordType); + void getCharacterExtents (in long offset, out long x, out long y, out long length, out long width, in short coordType); long getOffsetAtPoint (in long x, in long y, in short coordType); long getNSelections (); void getSelection (in long selectionNum, out long startOffset, out long endOffset); diff --git a/libspi/accessible.c b/libspi/accessible.c index e811ef4..575ead9 100644 --- a/libspi/accessible.c +++ b/libspi/accessible.c @@ -38,6 +38,15 @@ * This pulls the definition for the BonoboObject (Gtk Type) */ #include "accessible.h" +#include "component.h" +#include "editabletext.h" +#include "hyperlink.h" +#include "hypertext.h" +#include "image.h" +#include "selection.h" +#include "table.h" +#include "text.h" +#include "value.h" /* * Our parent Gtk object type @@ -74,7 +83,7 @@ impl_accessibility_accessible_get_name (PortableServer_Servant servant, { CORBA_char * retval; Accessible *accessible = ACCESSIBLE (bonobo_object_from_servant (servant)); - retval = atk_object_get_name (accessible->atko); + retval = (CORBA_char *) atk_object_get_name (accessible->atko); if (retval ) retval = CORBA_string_dup (retval); else @@ -265,64 +274,63 @@ accessible_new (AtkObject *o) if (ATK_IS_ACTION (o)) { bonobo_object_add_interface (bonobo_object (retval), - bonobo_object (action_new (ATK_ACTION(o)))); + BONOBO_OBJECT (action_interface_new (o))); } if (ATK_IS_COMPONENT (o)) { bonobo_object_add_interface (bonobo_object (retval), - bonobo_object (component_interface_new (o))); + BONOBO_OBJECT (component_interface_new (o))); } if (ATK_IS_EDITABLE_TEXT (o)) { bonobo_object_add_interface (bonobo_object (retval), - bonobo_object (editable_text_new (ATK_EDITABLE_TEXT(o)))); + BONOBO_OBJECT(editable_text_interface_new (o))); } else if (ATK_IS_HYPERTEXT (o)) { bonobo_object_add_interface (bonobo_object (retval), - bonobo_object (hypertext_new (o))); + BONOBO_OBJECT (hypertext_interface_new (o))); } else if (ATK_IS_TEXT (o)) { bonobo_object_add_interface (bonobo_object (retval), - bonobo_object (text_new (o))); + BONOBO_OBJECT (text_interface_new (o))); } if (ATK_IS_HYPERLINK (o)) { bonobo_object_add_interface (bonobo_object (retval), - bonobo_object (hyperlink_new(ATK_HYPERLINK(o)))); + BONOBO_OBJECT (hyperlink_interface_new(o))); } if (ATK_IS_IMAGE (o)) { bonobo_object_add_interface (bonobo_object (retval), - bonobo_object (image_new (o))); + BONOBO_OBJECT (image_interface_new (o))); } if (ATK_IS_SELECTION (o)) { bonobo_object_add_interface (bonobo_object (retval), - bonobo_object (selection_new (o))); + BONOBO_OBJECT (selection_interface_new (o))); } if (ATK_IS_TABLE (o)) { bonobo_object_add_interface (bonobo_object (retval), - bonobo_object (table_new (o))); + BONOBO_OBJECT (table_interface_new (o))); } - /* if (ATK_IS_VALUE (o)) + if (ATK_IS_VALUE (o)) { bonobo_object_add_interface (bonobo_object (retval), - bonobo_object (value_interface_new (o))); + BONOBO_OBJECT (value_interface_new (o))); } - */ return retval; } diff --git a/libspi/accessible.h b/libspi/accessible.h index 452ce78..a8876fb 100644 --- a/libspi/accessible.h +++ b/libspi/accessible.h @@ -48,7 +48,6 @@ typedef struct { GType accessible_get_type (void); Accessible *accessible_new (AtkObject *o); -#include "component.h" #ifdef __cplusplus } diff --git a/libspi/action.c b/libspi/action.c index a3e0ddb..13247e1 100644 --- a/libspi/action.c +++ b/libspi/action.c @@ -134,16 +134,18 @@ static void action_finalize (GObject *obj) { Action *action = ACTION (obj); - action->atk_action = NULL; + g_object_unref (action->atko); + action->atko = NULL; parent_class->finalize (obj); } Action * -action_new (AtkAction *action) +action_interface_new (AtkObject *obj) { Action *new_action = ACTION(g_object_new (ACTION_TYPE, NULL)); - new_action->atk_action = action; + new_action->atko = obj; + g_object_ref (obj); return new_action; } @@ -152,7 +154,7 @@ impl__get_nActions(PortableServer_Servant servant, CORBA_Environment * ev) { Action *action = ACTION (bonobo_object_from_servant(servant)); - return (CORBA_long) atk_action_get_n_actions (action->atk_action); + return (CORBA_long) atk_action_get_n_actions (ATK_ACTION(action->atko)); } static CORBA_boolean @@ -160,7 +162,7 @@ impl_doAction (PortableServer_Servant servant, const CORBA_long index, CORBA_Environment * ev) { Action *action = ACTION (bonobo_object_from_servant (servant)); - return (CORBA_boolean) atk_action_do_action (action->atk_action, (gint) index); + return (CORBA_boolean) atk_action_do_action (ATK_ACTION(action->atko), (gint) index); } @@ -170,7 +172,7 @@ impl_getDescription (PortableServer_Servant servant, CORBA_Environment * ev) { Action *action = ACTION (bonobo_object_from_servant(servant)); - return CORBA_string_dup (atk_action_get_description (action->atk_action, (gint) index)); + return CORBA_string_dup (atk_action_get_description (ATK_ACTION(action->atko), (gint) index)); } @@ -180,7 +182,7 @@ impl_getName (PortableServer_Servant servant, CORBA_Environment * ev) { Action *action = ACTION (bonobo_object_from_servant(servant)); - return CORBA_string_dup (atk_action_get_name (action->atk_action, (gint) index)); + return CORBA_string_dup (atk_action_get_name (ATK_ACTION(action->atko), (gint) index)); } static CORBA_string @@ -189,5 +191,5 @@ impl_getKeyBinding (PortableServer_Servant servant, CORBA_Environment * ev) { Action *action = ACTION (bonobo_object_from_servant(servant)); - return CORBA_string_dup (atk_action_get_keybinding (action->atk_action, (gint) index)); + return CORBA_string_dup (atk_action_get_keybinding (ATK_ACTION(action->atko), (gint) index)); } diff --git a/libspi/action.h b/libspi/action.h index a256dcf..50a8d10 100644 --- a/libspi/action.h +++ b/libspi/action.h @@ -40,7 +40,7 @@ typedef struct _ActionClass ActionClass; struct _Action { BonoboObject parent; - AtkAction *atk_action; + AtkObject *atko; }; struct _ActionClass { @@ -52,7 +52,7 @@ GType action_get_type (void); Action * -action_new (AtkAction *action); +action_interface_new (AtkObject *obj); #ifdef __cplusplus } diff --git a/libspi/component.c b/libspi/component.c index c035bed..3c9ff9a 100644 --- a/libspi/component.c +++ b/libspi/component.c @@ -59,7 +59,8 @@ accessibility_component_object_finalize (GObject *object) Component *component = COMPONENT (object); printf("accessible_component_object_finalize called\n"); - component->atko = NULL; + g_object_unref (component->atko); + component->atko = NULL; printf("atko freed, calling parent finalize\n"); component_parent_class->finalize (object); @@ -220,7 +221,7 @@ component_interface_new (AtkObject *o) { Component *retval = COMPONENT (g_object_new (accessibility_component_get_type (), NULL)); - /* don't increment AtkObject refcount, ref is held by containing Accessible instance */ - retval->atko = ATK_OBJECT (o); - return retval; + retval->atko = o; + g_object_ref (o); +return retval; } diff --git a/libspi/editabletext.c b/libspi/editabletext.c index ecc8edd..89a7b85 100644 --- a/libspi/editabletext.c +++ b/libspi/editabletext.c @@ -149,17 +149,19 @@ static void editable_text_finalize (GObject *obj) { EditableText *editable = EDITABLE_TEXT(obj); - editable->atk_editable_text = NULL; + g_object_unref (editable->atko); + editable->atko = NULL; parent_class->finalize (obj); } EditableText * -editable_text_new (AtkEditableText *editable) +editable_text_interface_new (AtkObject *obj) { EditableText *new_editable = EDITABLE_TEXT(g_object_new (EDITABLE_TEXT_TYPE, NULL)); - new_editable->atk_editable_text = editable; - return new_editable; + new_editable->atko = obj; + g_object_ref (obj); +return new_editable; } @@ -182,7 +184,7 @@ impl_setTextContents (PortableServer_Servant _servant, CORBA_Environment * ev) { EditableText *editable = EDITABLE_TEXT(bonobo_object_from_servant (_servant)); - atk_editable_text_set_text_contents (editable->atk_editable_text, + atk_editable_text_set_text_contents (ATK_EDITABLE_TEXT(editable->atko), (gchar *) newContents); } @@ -196,7 +198,7 @@ impl_insertText (PortableServer_Servant _servant, CORBA_Environment * ev) { EditableText *editable = EDITABLE_TEXT (bonobo_object_from_servant(_servant)); - atk_editable_text_insert_text (editable->atk_editable_text, + atk_editable_text_insert_text (ATK_EDITABLE_TEXT(editable->atko), (gchar *) text, (gint) length, (gint *) &position); @@ -209,7 +211,7 @@ impl_copyText (PortableServer_Servant _servant, CORBA_Environment * ev) { EditableText *editable = EDITABLE_TEXT (bonobo_object_from_servant(_servant)); - atk_editable_text_copy_text (editable->atk_editable_text, + atk_editable_text_copy_text (ATK_EDITABLE_TEXT(editable->atko), (gint) startPos, (gint) endPos); } @@ -221,7 +223,7 @@ impl_cutText (PortableServer_Servant _servant, CORBA_Environment * ev) { EditableText *editable = EDITABLE_TEXT (bonobo_object_from_servant(_servant)); - atk_editable_text_cut_text (editable->atk_editable_text, + atk_editable_text_cut_text (ATK_EDITABLE_TEXT(editable->atko), (gint) startPos, (gint) endPos); } @@ -234,7 +236,7 @@ impl_deleteText (PortableServer_Servant _servant, CORBA_Environment * ev) { EditableText *editable = EDITABLE_TEXT (bonobo_object_from_servant(_servant)); - atk_editable_text_delete_text (editable->atk_editable_text, + atk_editable_text_delete_text (ATK_EDITABLE_TEXT(editable->atko), (gint) startPos, (gint) endPos); } @@ -244,6 +246,6 @@ impl_pasteText (PortableServer_Servant _servant, const CORBA_long position, CORBA_Environment * ev) { EditableText *editable = EDITABLE_TEXT (bonobo_object_from_servant(_servant)); - atk_editable_text_paste_text (editable->atk_editable_text, position); + atk_editable_text_paste_text (ATK_EDITABLE_TEXT(editable->atko), position); } diff --git a/libspi/editabletext.h b/libspi/editabletext.h index 61abdfa..5db4c19 100644 --- a/libspi/editabletext.h +++ b/libspi/editabletext.h @@ -40,7 +40,7 @@ typedef struct _EditableTextClass EditableTextClass; struct _EditableText { BonoboObject parent; - AtkEditableText *atk_editable_text; + AtkObject *atko; }; struct _EditableTextClass { @@ -52,7 +52,7 @@ GType editable_text_get_type (void); EditableText * -editable_text_new (AtkEditableText *editable); +editable_text_interface_new ( AtkObject *obj); #ifdef __cplusplus } diff --git a/libspi/hyperlink.c b/libspi/hyperlink.c index 2d55b8b..9b96309 100644 --- a/libspi/hyperlink.c +++ b/libspi/hyperlink.c @@ -135,16 +135,18 @@ static void hyperlink_finalize (GObject *obj) { Hyperlink *hyperlink = HYPERLINK(obj); - hyperlink->atk_hyperlink = NULL; + g_object_unref (hyperlink->atko); + hyperlink->atko = NULL; parent_class->finalize (obj); } Hyperlink * -hyperlink_new (AtkHyperlink *hyperlink) +hyperlink_interface_new (AtkObject *obj) { Hyperlink *new_hyperlink = HYPERLINK(g_object_new (HYPERLINK_TYPE, NULL)); - new_hyperlink->atk_hyperlink = hyperlink; + new_hyperlink->atko = obj; + g_object_ref (obj); return new_hyperlink; } @@ -155,7 +157,7 @@ impl__get_n_anchors (PortableServer_Servant _servant, CORBA_Environment * ev) { Hyperlink *link = HYPERLINK(bonobo_object_from_servant(_servant)); - return (CORBA_short) atk_hyperlink_get_n_anchors (link->atk_hyperlink); + return (CORBA_short) atk_hyperlink_get_n_anchors (ATK_HYPERLINK(link->atko)); } @@ -165,7 +167,7 @@ impl__get_startIndex (PortableServer_Servant _servant, CORBA_Environment * ev) { Hyperlink *link = HYPERLINK(bonobo_object_from_servant(_servant)); - return (CORBA_long) atk_hyperlink_get_start_index (link->atk_hyperlink); + return (CORBA_long) atk_hyperlink_get_start_index (ATK_HYPERLINK(link->atko)); } @@ -175,7 +177,7 @@ impl__get_endIndex (PortableServer_Servant _servant, CORBA_Environment * ev) { Hyperlink *link = HYPERLINK(bonobo_object_from_servant(_servant)); - return (CORBA_long) atk_hyperlink_get_end_index (link->atk_hyperlink); + return (CORBA_long) atk_hyperlink_get_end_index (ATK_HYPERLINK(link->atko)); } @@ -187,7 +189,7 @@ impl_getURI (PortableServer_Servant _servant, Hyperlink *link = HYPERLINK(bonobo_object_from_servant(_servant)); gchar *uri; CORBA_char *rv; - uri = atk_hyperlink_get_uri (link->atk_hyperlink, (gint) i); + uri = atk_hyperlink_get_uri (ATK_HYPERLINK(link->atko), (gint) i); rv = CORBA_string_dup (uri); g_free (uri); return rv; @@ -203,7 +205,7 @@ impl_getObject (PortableServer_Servant _servant, Hyperlink *link = HYPERLINK(bonobo_object_from_servant(_servant)); AtkObject *atk_object; Accessibility_Accessible rv; - atk_object = atk_hyperlink_get_object (link->atk_hyperlink, (gint) i); + atk_object = atk_hyperlink_get_object (ATK_HYPERLINK(link->atko), (gint) i); rv = bonobo_object_corba_objref (BONOBO_OBJECT(accessible_new(atk_object))); return rv; } @@ -215,7 +217,7 @@ impl_isValid (PortableServer_Servant _servant, CORBA_Environment * ev) { Hyperlink *link = HYPERLINK(bonobo_object_from_servant(_servant)); - return (CORBA_boolean) atk_hyperlink_is_valid (link->atk_hyperlink); + return (CORBA_boolean) atk_hyperlink_is_valid (ATK_HYPERLINK(link->atko)); } diff --git a/libspi/hyperlink.h b/libspi/hyperlink.h index e51b577..9eb196c 100644 --- a/libspi/hyperlink.h +++ b/libspi/hyperlink.h @@ -40,7 +40,7 @@ typedef struct _HyperlinkClass HyperlinkClass; struct _Hyperlink { BonoboObject parent; - AtkHyperlink *atk_hyperlink; + AtkObject *atko; }; struct _HyperlinkClass { @@ -52,7 +52,7 @@ GType hyperlink_get_type (void); Hyperlink * -hyperlink_new (AtkHyperlink *hyperlink); +hyperlink_interface_new (AtkObject *obj); #ifdef __cplusplus } diff --git a/libspi/hypertext.c b/libspi/hypertext.c index 82f58a7..e9780d2 100644 --- a/libspi/hypertext.c +++ b/libspi/hypertext.c @@ -144,16 +144,18 @@ static void hypertext_finalize (GObject *obj) { Hypertext *hypertext = HYPERTEXT(obj); - hypertext->atk_hypertext = NULL; + g_object_unref (hypertext->atko); + hypertext->atko = NULL; parent_class->finalize (obj); } Hypertext * -hypertext_new (AtkHypertext *hypertext) +hypertext_interface_new (AtkObject *obj) { Hypertext *new_hypertext = HYPERTEXT(g_object_new (HYPERTEXT_TYPE, NULL)); - new_hypertext->atk_hypertext = hypertext; + new_hypertext->atko = obj; + g_object_ref (obj); return new_hypertext; } @@ -165,7 +167,7 @@ impl_getNLinks (PortableServer_Servant _servant, { Hypertext *hypertext = 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)); } @@ -179,9 +181,9 @@ impl_getLink (PortableServer_Servant _servant, Hypertext *hypertext = HYPERTEXT(bonobo_object_from_servant(_servant)); Accessibility_Hyperlink rv; - link = atk_hypertext_get_link (hypertext->atk_hypertext, + link = atk_hypertext_get_link (ATK_HYPERTEXT(hypertext->atko), (gint) linkIndex); - rv = bonobo_object_corba_objref (BONOBO_OBJECT(hyperlink_new(link))); + rv = bonobo_object_corba_objref (BONOBO_OBJECT(hyperlink_interface_new(ATK_OBJECT(link)))); return rv; } @@ -194,7 +196,7 @@ impl_getLinkIndex (PortableServer_Servant _servant, { Hypertext *hypertext = 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); } diff --git a/libspi/hypertext.h b/libspi/hypertext.h index 7fbe157..f3d5e60 100644 --- a/libspi/hypertext.h +++ b/libspi/hypertext.h @@ -40,7 +40,7 @@ typedef struct _HypertextClass HypertextClass; struct _Hypertext { BonoboObject parent; - AtkHypertext *atk_hypertext; + AtkObject *atko; }; struct _HypertextClass { @@ -52,7 +52,7 @@ GType hypertext_get_type (void); Hypertext * -hypertext_new (AtkHypertext *hypertext); +hypertext_interface_new (AtkObject *obj); #ifdef __cplusplus } diff --git a/libspi/image.c b/libspi/image.c index 6428ff8..a637ad1 100644 --- a/libspi/image.c +++ b/libspi/image.c @@ -127,16 +127,18 @@ static void image_finalize (GObject *obj) { Image *image = IMAGE (obj); - image->atk_image = NULL; + g_object_unref (image->atko); + image->atko = NULL; parent_class->finalize (obj); } Image * -image_new (AtkImage *image) +image_interface_new (AtkObject *obj) { Image *new_image = IMAGE(g_object_new (IMAGE_TYPE, NULL)); - new_image->atk_image = image; + new_image->atko = obj; + g_object_ref (obj); return new_image; } @@ -149,7 +151,7 @@ impl_getImagePosition (PortableServer_Servant _servant, CORBA_Environment * ev) { Image *image = IMAGE (bonobo_object_from_servant(_servant)); - atk_image_get_image_position (image->atk_image, + atk_image_get_image_position (ATK_IMAGE(image->atko), (gint *) x, (gint *) y, (AtkCoordType) coordType); } @@ -162,7 +164,7 @@ impl_getImageSize (PortableServer_Servant _servant, CORBA_Environment * ev) { Image *image = IMAGE (bonobo_object_from_servant(_servant)); - atk_image_get_image_size (image->atk_image, + atk_image_get_image_size (ATK_IMAGE(image->atko), (gint *) width, (gint *) height); } @@ -174,7 +176,7 @@ impl__get_imageDescription (PortableServer_Servant _servant, { Image *image = IMAGE (bonobo_object_from_servant(_servant)); return CORBA_string_dup ( - atk_image_get_image_description (image->atk_image)); + atk_image_get_image_description (ATK_IMAGE(image->atko))); } diff --git a/libspi/image.h b/libspi/image.h index 596359e..0ad0dcc 100644 --- a/libspi/image.h +++ b/libspi/image.h @@ -40,7 +40,7 @@ typedef struct _ImageClass ImageClass; struct _Image { BonoboObject parent; - AtkImage *atk_image; + AtkObject *atko; }; struct _ImageClass { @@ -52,7 +52,7 @@ GType image_get_type (void); Image * -image_new (AtkImage *image); +image_interface_new (AtkObject *obj); #ifdef __cplusplus } diff --git a/libspi/selection.c b/libspi/selection.c index 6f726b2..f80af59 100644 --- a/libspi/selection.c +++ b/libspi/selection.c @@ -144,16 +144,18 @@ static void selection_finalize (GObject *obj) { Selection *selection = SELECTION (obj); - selection->atk_selection = NULL; + g_object_unref (selection->atko); + selection->atko = NULL; parent_class->finalize (obj); } Selection * -selection_new (AtkSelection *selection) +selection_interface_new (AtkObject *obj) { Selection *new_selection = SELECTION(g_object_new (SELECTION_TYPE, NULL)); - new_selection->atk_selection = selection; + new_selection->atko = obj; + g_object_ref (obj); return new_selection; } @@ -165,7 +167,7 @@ impl__get_nSelectedChildren (PortableServer_Servant _servant, { Selection *selection = SELECTION (bonobo_object_from_servant (_servant)); return (CORBA_long) - atk_selection_get_selection_count (selection->atk_selection); + atk_selection_get_selection_count (ATK_SELECTION(selection->atko)); } @@ -180,7 +182,7 @@ impl_getSelectedChild (PortableServer_Servant _servant, AtkObject *atk_object; Accessibility_Accessible rv; - atk_object = atk_selection_ref_selection (selection->atk_selection, (gint) selectedChildIndex); + atk_object = atk_selection_ref_selection (ATK_SELECTION(selection->atko), (gint) selectedChildIndex); rv = bonobo_object_corba_objref (BONOBO_OBJECT(accessible_new(atk_object))); return rv; } @@ -194,7 +196,7 @@ impl_selectChild (PortableServer_Servant _servant, { Selection *selection = SELECTION (bonobo_object_from_servant (_servant)); return (CORBA_boolean) - atk_selection_add_selection (selection->atk_selection, (gint) childIndex); + atk_selection_add_selection (ATK_SELECTION(selection->atko), (gint) childIndex); } @@ -207,7 +209,7 @@ impl_deselectSelectedChild (PortableServer_Servant _servant, { Selection *selection = SELECTION (bonobo_object_from_servant (_servant)); return (CORBA_boolean) - atk_selection_remove_selection (selection->atk_selection, (gint) selectedChildIndex); + atk_selection_remove_selection (ATK_SELECTION(selection->atko), (gint) selectedChildIndex); } @@ -219,7 +221,7 @@ impl_isChildSelected (PortableServer_Servant _servant, { Selection *selection = SELECTION (bonobo_object_from_servant (_servant)); return (CORBA_boolean) - atk_selection_is_child_selected (selection->atk_selection, (gint) childIndex); + atk_selection_is_child_selected (ATK_SELECTION(selection->atko), (gint) childIndex); } @@ -229,7 +231,7 @@ impl_selectAll (PortableServer_Servant _servant, CORBA_Environment * ev) { Selection *selection = SELECTION (bonobo_object_from_servant (_servant)); - atk_selection_select_all_selection (selection->atk_selection); + atk_selection_select_all_selection (ATK_SELECTION(selection->atko)); } @@ -239,6 +241,6 @@ impl_clearSelection (PortableServer_Servant _servant, CORBA_Environment * ev) { Selection *selection = SELECTION (bonobo_object_from_servant (_servant)); - atk_selection_clear_selection (selection->atk_selection); + atk_selection_clear_selection (ATK_SELECTION(selection->atko)); } diff --git a/libspi/selection.h b/libspi/selection.h index 3771983..02c2882 100644 --- a/libspi/selection.h +++ b/libspi/selection.h @@ -40,7 +40,7 @@ typedef struct _SelectionClass SelectionClass; struct _Selection { BonoboObject parent; - AtkSelection *atk_selection; + AtkObject *atko; }; struct _SelectionClass { @@ -52,7 +52,7 @@ GType selection_get_type (void); Selection * -selection_new (AtkSelection *selection); +selection_interface_new (AtkObject *obj); #ifdef __cplusplus } diff --git a/libspi/table.c b/libspi/table.c index 98c704c..886ef60 100644 --- a/libspi/table.c +++ b/libspi/table.c @@ -208,16 +208,18 @@ static void table_finalize (GObject *obj) { Table *table = TABLE (obj); - table->atk_table = NULL; + g_object_unref (table->atko); + table->atko = NULL; parent_class->finalize (obj); } Table * -table_new (AtkTable *table) +table_interface_new (AtkObject *obj) { Table *new_table = TABLE(g_object_new (TABLE_TYPE, NULL)); - new_table->atk_table = table; + new_table->atko = obj; + g_object_ref (obj); return new_table; } @@ -232,7 +234,7 @@ impl__get_caption (PortableServer_Servant _servant, Accessibility_Accessible rv; atk_object = g_object_new (ATK_TYPE_OBJECT, NULL); - atk_object_set_name (atk_object, atk_table_get_caption (table->atk_table)); + atk_object_set_name (atk_object, atk_table_get_caption (ATK_TABLE(table-> atko))); rv = bonobo_object_corba_objref (BONOBO_OBJECT(accessible_new(atk_object))); return rv; } @@ -247,7 +249,7 @@ impl__get_summary (PortableServer_Servant _servant, AtkObject *atk_object; Accessibility_Accessible rv; - atk_object = atk_table_get_summary (table->atk_table); + atk_object = atk_table_get_summary (ATK_TABLE(table->atko)); rv = bonobo_object_corba_objref (BONOBO_OBJECT(accessible_new(atk_object))); return rv; } @@ -260,7 +262,7 @@ impl__get_nRows (PortableServer_Servant _servant, { Table *table = TABLE (bonobo_object_from_servant (_servant)); return (CORBA_long) - atk_table_get_n_rows (table->atk_table); + atk_table_get_n_rows (ATK_TABLE(table->atko) ); } @@ -271,7 +273,7 @@ impl__get_nColumns (PortableServer_Servant _servant, { Table *table = TABLE (bonobo_object_from_servant (_servant)); return (CORBA_long) - atk_table_get_n_columns (table->atk_table); + atk_table_get_n_columns (ATK_TABLE(table->atko)); } @@ -286,7 +288,7 @@ impl_getAccessibleAt (PortableServer_Servant _servant, AtkObject *atk_object; Accessibility_Accessible rv; - atk_object = atk_table_ref_at (table->atk_table, + atk_object = atk_table_ref_at (ATK_TABLE(table->atko), (gint) row, (gint) column); rv = bonobo_object_corba_objref (BONOBO_OBJECT(accessible_new(atk_object))); return rv; @@ -301,7 +303,7 @@ impl_getIndexAt (PortableServer_Servant _servant, { Table *table = TABLE (bonobo_object_from_servant (_servant)); return (CORBA_long) - atk_table_get_index_at (table->atk_table, + atk_table_get_index_at (ATK_TABLE(table->atko), (gint) row, (gint) column); } @@ -314,7 +316,7 @@ impl_getRowAtIndex (PortableServer_Servant _servant, { Table *table = TABLE (bonobo_object_from_servant (_servant)); return (CORBA_long) - atk_table_get_row_at_index (table->atk_table, (gint) index); + atk_table_get_row_at_index (ATK_TABLE(table->atko), (gint) index); } @@ -326,7 +328,7 @@ impl_getColumnAtIndex (PortableServer_Servant _servant, { Table *table = TABLE (bonobo_object_from_servant (_servant)); return (CORBA_long) - atk_table_get_column_at_index (table->atk_table, (gint) index); + atk_table_get_column_at_index (ATK_TABLE(table->atko), (gint) index); } @@ -338,7 +340,7 @@ impl_getRowDescription (PortableServer_Servant _servant, { Table *table = TABLE (bonobo_object_from_servant (_servant)); return CORBA_string_dup ( - atk_table_get_row_description (table->atk_table, (gint) row)); + atk_table_get_row_description (ATK_TABLE(table->atko), (gint) row)); } @@ -350,7 +352,7 @@ impl_getColumnDescription (PortableServer_Servant _servant, { Table *table = TABLE (bonobo_object_from_servant (_servant)); return CORBA_string_dup ( - atk_table_get_column_description (table->atk_table, (gint) column)); + atk_table_get_column_description (ATK_TABLE(table->atko), (gint) column)); } @@ -363,7 +365,7 @@ impl_getRowExtentAt (PortableServer_Servant _servant, { Table *table = TABLE (bonobo_object_from_servant (_servant)); return (CORBA_long) - atk_table_get_row_extent_at (table->atk_table, + atk_table_get_row_extent_at (ATK_TABLE(table->atko), (gint) row, (gint) column); } @@ -377,7 +379,7 @@ impl_getColumnExtentAt (PortableServer_Servant _servant, { Table *table = TABLE (bonobo_object_from_servant (_servant)); return (CORBA_long) - atk_table_get_column_extent_at (table->atk_table, + atk_table_get_column_extent_at (ATK_TABLE(table->atko), (gint) row, (gint) column); } @@ -392,7 +394,7 @@ impl_getRowHeader (PortableServer_Servant _servant, AtkObject *header; Accessibility_Table rv; - header = atk_table_get_row_header (table->atk_table, (gint) row); + header = atk_table_get_row_header (ATK_TABLE(table->atko), (gint) row); rv = bonobo_object_corba_objref (BONOBO_OBJECT(accessible_new(header))); return rv; } @@ -408,7 +410,7 @@ impl_getColumnHeader (PortableServer_Servant _servant, AtkObject *header; Accessibility_Table rv; - header = atk_table_get_column_header (table->atk_table, (gint) column); + header = atk_table_get_column_header (ATK_TABLE(table->atko), (gint) column); rv = bonobo_object_corba_objref (BONOBO_OBJECT(accessible_new(header))); return rv; } @@ -424,7 +426,7 @@ impl_getSelectedRows (PortableServer_Servant _servant, gint length; Accessibility_LongSeq *retval; - length = atk_table_get_selected_rows (table->atk_table, &selectedRows); + length = atk_table_get_selected_rows (ATK_TABLE(table->atko), &selectedRows); g_return_val_if_fail (length, NULL); retval = Accessibility_LongSeq__alloc (); @@ -448,7 +450,7 @@ impl_getSelectedColumns (PortableServer_Servant _servant, gint length; Accessibility_LongSeq *retval; - length = atk_table_get_selected_columns (table->atk_table, &selectedColumns); + length = atk_table_get_selected_columns (ATK_TABLE(table->atko), &selectedColumns); g_return_val_if_fail (length, NULL); @@ -471,7 +473,7 @@ impl_isRowSelected (PortableServer_Servant _servant, { Table *table = TABLE (bonobo_object_from_servant (_servant)); return (CORBA_boolean) - atk_table_is_row_selected (table->atk_table, (gint) row); + atk_table_is_row_selected (ATK_TABLE(table->atko), (gint) row); } @@ -483,7 +485,7 @@ impl_isColumnSelected (PortableServer_Servant _servant, { Table *table = TABLE (bonobo_object_from_servant (_servant)); return (CORBA_boolean) - atk_table_is_column_selected (table->atk_table, (gint) column); + atk_table_is_column_selected (ATK_TABLE(table->atko), (gint) column); } @@ -496,7 +498,7 @@ impl_isSelected (PortableServer_Servant _servant, { Table *table = TABLE (bonobo_object_from_servant (_servant)); return (CORBA_boolean) - atk_table_is_selected (table->atk_table, + atk_table_is_selected (ATK_TABLE(table->atko), (gint) row, (gint) column); } diff --git a/libspi/table.h b/libspi/table.h index da987e5..f245701 100644 --- a/libspi/table.h +++ b/libspi/table.h @@ -40,7 +40,7 @@ typedef struct _TableClass TableClass; struct _Table { BonoboObject parent; - AtkTable *atk_table; + AtkObject *atko; }; struct _TableClass { @@ -52,7 +52,7 @@ GType table_get_type (void); Table * -table_new (AtkTable *table); +table_interface_new (AtkObject *obj); #ifdef __cplusplus } diff --git a/libspi/text.c b/libspi/text.c index 04a7bf5..872f3d0 100644 --- a/libspi/text.c +++ b/libspi/text.c @@ -128,7 +128,7 @@ impl_setSelection (PortableServer_Servant _servant, const CORBA_long startOffset, const CORBA_long endOffset, CORBA_Environment * ev); -static void +static CORBA_boolean impl_setCaretOffset (PortableServer_Servant _servant, const CORBA_long value, CORBA_Environment * ev); @@ -212,16 +212,18 @@ static void text_finalize (GObject *obj) { Text *text = TEXT (obj); - text->atk_text = NULL; + g_object_unref (text->atko); + text->atko = NULL; parent_class->finalize (obj); } Text * -text_new (AtkText *text) +text_interface_new (AtkObject *obj) { Text *new_text = TEXT(g_object_new (TEXT_TYPE, NULL)); - new_text->atk_text = text; + new_text->atko = obj; + g_object_ref (obj); return new_text; } @@ -237,7 +239,7 @@ impl_getText (PortableServer_Servant _servant, gchar *txt; CORBA_char *rv; - txt = atk_text_get_text (text->atk_text, + txt = atk_text_get_text (ATK_TEXT(text->atko), (gint) startOffset, (gint) endOffset); rv = CORBA_string_dup (txt); g_free (txt); @@ -259,7 +261,7 @@ impl_getTextAfterOffset (PortableServer_Servant _servant, gchar *txt; CORBA_char *rv; - txt = atk_text_get_text_after_offset (text->atk_text, + txt = atk_text_get_text_after_offset (ATK_TEXT(text->atko), (gint) offset, (AtkTextBoundary) type, (gint *) startOffset, (gint *) endOffset); rv = CORBA_string_dup (txt); @@ -281,7 +283,7 @@ impl_getTextAtOffset (PortableServer_Servant _servant, gchar *txt; CORBA_char *rv; - txt = atk_text_get_text_at_offset (text->atk_text, + txt = atk_text_get_text_at_offset (ATK_TEXT(text->atko), (gint) offset, (AtkTextBoundary) type, (gint *) startOffset, (gint *) endOffset); rv = CORBA_string_dup (txt); @@ -298,7 +300,7 @@ impl_getCharacterAtOffset (PortableServer_Servant _servant, { Text *text = TEXT (bonobo_object_from_servant (_servant)); return (CORBA_wchar) - atk_text_get_character_at_offset (text->atk_text, (gint) offset); + atk_text_get_character_at_offset (ATK_TEXT(text->atko), (gint) offset); } @@ -315,7 +317,7 @@ impl_getTextBeforeOffset (PortableServer_Servant _servant, gchar *txt; CORBA_char *rv; - txt = atk_text_get_text_before_offset (text->atk_text, + txt = atk_text_get_text_before_offset (ATK_TEXT(text->atko), (gint) offset, (AtkTextBoundary) type, (gint *) startOffset, (gint *) endOffset); rv = CORBA_string_dup (txt); @@ -329,7 +331,7 @@ impl__get_caretOffset (PortableServer_Servant _servant, { Text *text = TEXT (bonobo_object_from_servant (_servant)); return (CORBA_long) - atk_text_get_caret_offset (text->atk_text); + atk_text_get_caret_offset (ATK_TEXT(text->atko)); } @@ -356,7 +358,7 @@ impl_getCharacterExtents (PortableServer_Servant _servant, CORBA_Environment * ev) { Text *text = TEXT (bonobo_object_from_servant (_servant)); - atk_text_get_character_extents (text->atk_text, (gint) offset, + atk_text_get_character_extents (ATK_TEXT(text->atko), (gint) offset, (gint *) x, (gint *) y, (gint *) width, (gint *) height, (AtkCoordType) coordType); } @@ -369,7 +371,7 @@ impl__get_characterCount (PortableServer_Servant _servant, { Text *text = TEXT (bonobo_object_from_servant (_servant)); return (CORBA_long) - atk_text_get_character_count (text->atk_text); + atk_text_get_character_count (ATK_TEXT(text->atko)); } @@ -382,7 +384,7 @@ impl_getOffsetAtPoint (PortableServer_Servant _servant, { Text *text = TEXT (bonobo_object_from_servant (_servant)); return (CORBA_long) - atk_text_get_offset_at_point (text->atk_text, + atk_text_get_offset_at_point (ATK_TEXT(text->atko), (gint) x, (gint) y, (AtkCoordType) coordType); } @@ -394,7 +396,7 @@ impl_getNSelections (PortableServer_Servant _servant, { Text *text = TEXT (bonobo_object_from_servant (_servant)); return (CORBA_long) - atk_text_get_n_selections (text->atk_text); + atk_text_get_n_selections (ATK_TEXT(text->atko)); } @@ -406,7 +408,7 @@ impl_getSelection (PortableServer_Servant _servant, CORBA_Environment * ev) { Text *text = TEXT (bonobo_object_from_servant (_servant)); - atk_text_get_selection (text->atk_text, (gint) selectionNum, + atk_text_get_selection (ATK_TEXT(text->atko), (gint) selectionNum, (gint *) startOffset, (gint *) endOffset); } @@ -420,7 +422,7 @@ impl_addSelection (PortableServer_Servant _servant, { Text *text = TEXT (bonobo_object_from_servant (_servant)); return (CORBA_boolean) - atk_text_add_selection (text->atk_text, + atk_text_add_selection (ATK_TEXT(text->atko), (gint) startOffset, (gint) endOffset); } @@ -433,7 +435,7 @@ impl_removeSelection (PortableServer_Servant _servant, { Text *text = TEXT (bonobo_object_from_servant (_servant)); return (CORBA_boolean) - atk_text_remove_selection (text->atk_text, (gint) selectionNum); + atk_text_remove_selection (ATK_TEXT(text->atko), (gint) selectionNum); } @@ -447,20 +449,20 @@ impl_setSelection (PortableServer_Servant _servant, { Text *text = TEXT (bonobo_object_from_servant (_servant)); return (CORBA_boolean) - atk_text_set_selection (text->atk_text, + atk_text_set_selection (ATK_TEXT(text->atko), (gint) selectionNum, (gint) startOffset, (gint) endOffset); } -static void +static CORBA_boolean impl_setCaretOffset (PortableServer_Servant _servant, const CORBA_long value, CORBA_Environment * ev) { Text *text = TEXT (bonobo_object_from_servant (_servant)); return (CORBA_boolean) - atk_text_set_caret_offset (text->atk_text, (gint) value); + atk_text_set_caret_offset (ATK_TEXT(text->atko), (gint) value); } diff --git a/libspi/text.h b/libspi/text.h index 9d9d0fd..e9594b7 100644 --- a/libspi/text.h +++ b/libspi/text.h @@ -40,7 +40,7 @@ typedef struct _TextClass TextClass; struct _Text { BonoboObject parent; - AtkText *atk_text; + AtkObject *atko; }; struct _TextClass { @@ -52,7 +52,7 @@ GType text_get_type (void); Text * -text_new (AtkText *text); +text_interface_new (AtkObject *obj); #ifdef __cplusplus } diff --git a/libspi/value.c b/libspi/value.c index 5d23c7a..3549658 100644 --- a/libspi/value.c +++ b/libspi/value.c @@ -131,16 +131,18 @@ static void value_finalize (GObject *obj) { Value *value = VALUE (obj); - value->atk_value = NULL; + g_object_unref (value->atko); + value->atko = NULL; parent_class->finalize (obj); } Value * -value_new (AtkValue *value) +value_interface_new (AtkObject *obj) { Value *new_value = VALUE(g_object_new (VALUE_TYPE, NULL)); - new_value->atk_value = value; + new_value->atko = obj; + g_object_ref (obj); return new_value; } @@ -154,7 +156,7 @@ impl__get_minimumValue (PortableServer_Servant _servant, GValue gvalue = {0, }; g_value_init (&gvalue, G_TYPE_FLOAT); - atk_value_get_minimum_value (value->atk_value, &gvalue); + atk_value_get_minimum_value (ATK_VALUE(value->atko), &gvalue); return (CORBA_float) g_value_get_float (&gvalue); } @@ -168,7 +170,7 @@ impl__get_maximumValue (PortableServer_Servant _servant, GValue gvalue = {0, }; g_value_init (&gvalue, G_TYPE_FLOAT); - atk_value_get_maximum_value (value->atk_value, &gvalue); + atk_value_get_maximum_value (ATK_VALUE(value->atko), &gvalue); return (CORBA_float) g_value_get_float (&gvalue); } @@ -182,7 +184,7 @@ impl__get_currentValue (PortableServer_Servant _servant, GValue gvalue = {0, }; g_value_init (&gvalue, G_TYPE_FLOAT); - atk_value_get_current_value (value->atk_value, &gvalue); + atk_value_get_current_value (ATK_VALUE(value->atko), &gvalue); return (CORBA_float) g_value_get_float (&gvalue); } @@ -197,7 +199,7 @@ impl__set_currentValue (PortableServer_Servant _servant, g_value_init (&gvalue, G_TYPE_FLOAT); g_value_set_float (&gvalue, (gfloat) value); - atk_value_set_current_value (val->atk_value, &gvalue); + atk_value_set_current_value (ATK_VALUE(val->atko), &gvalue); } diff --git a/libspi/value.h b/libspi/value.h index 5a4387e..2c3755b 100644 --- a/libspi/value.h +++ b/libspi/value.h @@ -40,7 +40,7 @@ typedef struct _ValueClass ValueClass; struct _Value { BonoboObject parent; - AtkValue *atk_value; + AtkObject *atko; }; struct _ValueClass { @@ -52,7 +52,7 @@ GType value_get_type (void); Value * -value_new (AtkValue *value); +value_interface_new (AtkObject *obj); #ifdef __cplusplus } diff --git a/po/ChangeLog b/po/ChangeLog index 03ca73a..187001a 100644 --- a/po/ChangeLog +++ b/po/ChangeLog @@ -1,3 +1,7 @@ +2001-09-05 gettextize + + * Makefile.in.in: Upgrade to gettext-0.10.38. + 2001-09-04 gettextize * Makefile.in.in: Upgrade to gettext-0.10.39. -- 2.7.4