From f762b0286cab88a3895df9c84a6e6990ffdbcbd0 Mon Sep 17 00:00:00 2001 From: billh Date: Tue, 31 Jul 2001 13:18:12 +0000 Subject: [PATCH] Removed references to bonobo_x_object, which is now redundant with bonobo_object. Made 'secondary' interfaces inherit from Bonobo::Unknown (as 'primary' interfaces already did). removed redundant stream IDL from StreamableContent.idl. Also we now null-out the 'atko' member of the accessible instance on finalize. git-svn-id: http://svn.gnome.org/svn/at-spi/trunk@13 e2bd861d-eb25-0410-b326-f6ed22b6b98c --- ChangeLog | 24 ++++++++++++++-- idl/Accessibility_Action.idl | 2 +- idl/Accessibility_Component.idl | 2 +- idl/Accessibility_Hyperlink.idl | 2 +- idl/Accessibility_Hypertext.idl | 2 +- idl/Accessibility_Image.idl | 2 +- idl/Accessibility_Selection.idl | 2 +- idl/Accessibility_StreamableContent.idl | 13 +++------ idl/Action.idl | 2 +- idl/Component.idl | 2 +- idl/Hyperlink.idl | 2 +- idl/Hypertext.idl | 2 +- idl/Image.idl | 2 +- idl/Selection.idl | 2 +- idl/StreamableContent.idl | 13 +++------ libspi/accessible.c | 50 ++++++++++++++++++++++++++++----- libspi/accessible.h | 6 ++-- libspi/application.c | 7 ++--- libspi/desktop.c | 6 ++-- libspi/registry.c | 2 +- registryd/desktop.c | 6 ++-- registryd/registry.c | 2 +- 22 files changed, 99 insertions(+), 54 deletions(-) diff --git a/ChangeLog b/ChangeLog index d118824..3b0f68c 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,7 +1,27 @@ +2001-07-31 Bill Haneman + + * libspi/accessible.c + * libspi/desktop.c + * libspi/registry.c : changed to use bonobo_object instead of bonobo_x_object + (since the two are now equivalent in libbonobo) + * idl/Action.idl + * idl/Component.idl + * idl/Hyperlink.idl + * idl/Image.idl + * idl/Selection.idl + * idl/Table.idl + * idl/Text.idl + * idl/Value.idl : changed these 'secondary' interfaces to inherit from + Bonobo::Unknown as does Accessibility::Accessible. + * idl/StreamableContent.idl : as above, and replaced internal InputStream + interface with Bonobo::Stream, since it was redundant with it. + (The Stream returned by a StreamableContext object is expected to + implement only a subset of Bonobo::Stream) + 2001-07-28 Anders Carlsson - * libspi/accessible.c (accessible_object_finalize): Change - g_free to g_object_unref since the AtkObject is a GObject. + * libspi/accessible.c (accessible_object_finalize): Change + g_free to g_object_unref since the AtkObject is a GObject. 2001-07-30 Bill Haneman diff --git a/idl/Accessibility_Action.idl b/idl/Accessibility_Action.idl index 585438b..ea869f5 100644 --- a/idl/Accessibility_Action.idl +++ b/idl/Accessibility_Action.idl @@ -22,7 +22,7 @@ module Accessibility { - interface Action { + interface Action : Bonobo::Unknown { /** * getNActions: diff --git a/idl/Accessibility_Component.idl b/idl/Accessibility_Component.idl index aa690d1..856407e 100644 --- a/idl/Accessibility_Component.idl +++ b/idl/Accessibility_Component.idl @@ -24,7 +24,7 @@ module Accessibility { - interface Component { + interface Component : Bonobo::Unknown { boolean contains (in long x, in long y); Accessible getAccessibleAtPoint (in long x, in long y); diff --git a/idl/Accessibility_Hyperlink.idl b/idl/Accessibility_Hyperlink.idl index 50db8ab..845d415 100644 --- a/idl/Accessibility_Hyperlink.idl +++ b/idl/Accessibility_Hyperlink.idl @@ -24,7 +24,7 @@ module Accessibility { - interface Hyperlink { + interface Hyperlink : Bonobo::Unknown { Accessible getAnchor (in long i); Accessible getObject (in long i); long getStartIndex (); diff --git a/idl/Accessibility_Hypertext.idl b/idl/Accessibility_Hypertext.idl index 47b68b2..05952ba 100644 --- a/idl/Accessibility_Hypertext.idl +++ b/idl/Accessibility_Hypertext.idl @@ -24,7 +24,7 @@ module Accessibility { - interface Hypertext { + interface Hypertext : Text { long getNLinks (); Hyperlink getLink (in long linkIndex); long getLinkIndex (in long characterIndex); diff --git a/idl/Accessibility_Image.idl b/idl/Accessibility_Image.idl index a186e6a..4e04bbf 100644 --- a/idl/Accessibility_Image.idl +++ b/idl/Accessibility_Image.idl @@ -22,7 +22,7 @@ module Accessibility { - interface Image { + interface Image : Bonobo::Unknown { string getImageDescription (); long getImageHeight (); long getImageWidth (); diff --git a/idl/Accessibility_Selection.idl b/idl/Accessibility_Selection.idl index 006b12c..e1da97a 100644 --- a/idl/Accessibility_Selection.idl +++ b/idl/Accessibility_Selection.idl @@ -24,7 +24,7 @@ module Accessibility { - interface Selection { + interface Selection : Bonobo::Unknown { long getNSelectedChildren (); Accessible getSelectedChild (in long selectedChildIndex); boolean selectChild (in long childIndex); diff --git a/idl/Accessibility_StreamableContent.idl b/idl/Accessibility_StreamableContent.idl index a9c9d36..13f3805 100644 --- a/idl/Accessibility_StreamableContent.idl +++ b/idl/Accessibility_StreamableContent.idl @@ -20,6 +20,8 @@ * Boston, MA 02111-1307, USA. */ +#include + module Accessibility { typedef sequence StringSeq; @@ -32,16 +34,9 @@ module Accessibility { SEEK_CURRENT }; - interface InputStream { - void open (); - long read (inout OctetSeq buffer, in long howmany); - boolean seek (in long offset, in SeekType type); - boolean rewind (); - void close (); - }; - interface StreamableContent { StringSeq getContentTypes (); - InputStream getContent (in string contentType); + Bonobo::Stream getContent (in string contentType); + /* methods used from Bonobo::Stream : seek, read. Others unsupported. */ }; }; diff --git a/idl/Action.idl b/idl/Action.idl index 585438b..ea869f5 100644 --- a/idl/Action.idl +++ b/idl/Action.idl @@ -22,7 +22,7 @@ module Accessibility { - interface Action { + interface Action : Bonobo::Unknown { /** * getNActions: diff --git a/idl/Component.idl b/idl/Component.idl index aa690d1..856407e 100644 --- a/idl/Component.idl +++ b/idl/Component.idl @@ -24,7 +24,7 @@ module Accessibility { - interface Component { + interface Component : Bonobo::Unknown { boolean contains (in long x, in long y); Accessible getAccessibleAtPoint (in long x, in long y); diff --git a/idl/Hyperlink.idl b/idl/Hyperlink.idl index 50db8ab..845d415 100644 --- a/idl/Hyperlink.idl +++ b/idl/Hyperlink.idl @@ -24,7 +24,7 @@ module Accessibility { - interface Hyperlink { + interface Hyperlink : Bonobo::Unknown { Accessible getAnchor (in long i); Accessible getObject (in long i); long getStartIndex (); diff --git a/idl/Hypertext.idl b/idl/Hypertext.idl index 47b68b2..05952ba 100644 --- a/idl/Hypertext.idl +++ b/idl/Hypertext.idl @@ -24,7 +24,7 @@ module Accessibility { - interface Hypertext { + interface Hypertext : Text { long getNLinks (); Hyperlink getLink (in long linkIndex); long getLinkIndex (in long characterIndex); diff --git a/idl/Image.idl b/idl/Image.idl index a186e6a..4e04bbf 100644 --- a/idl/Image.idl +++ b/idl/Image.idl @@ -22,7 +22,7 @@ module Accessibility { - interface Image { + interface Image : Bonobo::Unknown { string getImageDescription (); long getImageHeight (); long getImageWidth (); diff --git a/idl/Selection.idl b/idl/Selection.idl index 006b12c..e1da97a 100644 --- a/idl/Selection.idl +++ b/idl/Selection.idl @@ -24,7 +24,7 @@ module Accessibility { - interface Selection { + interface Selection : Bonobo::Unknown { long getNSelectedChildren (); Accessible getSelectedChild (in long selectedChildIndex); boolean selectChild (in long childIndex); diff --git a/idl/StreamableContent.idl b/idl/StreamableContent.idl index a9c9d36..13f3805 100644 --- a/idl/StreamableContent.idl +++ b/idl/StreamableContent.idl @@ -20,6 +20,8 @@ * Boston, MA 02111-1307, USA. */ +#include + module Accessibility { typedef sequence StringSeq; @@ -32,16 +34,9 @@ module Accessibility { SEEK_CURRENT }; - interface InputStream { - void open (); - long read (inout OctetSeq buffer, in long howmany); - boolean seek (in long offset, in SeekType type); - boolean rewind (); - void close (); - }; - interface StreamableContent { StringSeq getContentTypes (); - InputStream getContent (in string contentType); + Bonobo::Stream getContent (in string contentType); + /* methods used from Bonobo::Stream : seek, read. Others unsupported. */ }; }; diff --git a/libspi/accessible.c b/libspi/accessible.c index 4828d51..276c2c3 100644 --- a/libspi/accessible.c +++ b/libspi/accessible.c @@ -42,7 +42,7 @@ /* * Our parent Gtk object type */ -#define PARENT_TYPE BONOBO_X_OBJECT_TYPE +#define PARENT_TYPE BONOBO_OBJECT_TYPE /* * A pointer to our parent object class @@ -59,6 +59,7 @@ accessible_object_finalize (GObject *object) printf("accessible_object_finalize called\n"); g_object_unref (accessible->atko); + accessible->atko = NULL; printf("atko freed, calling parent finalize\n"); accessible_parent_class->finalize (object); @@ -91,18 +92,54 @@ impl_accessibility_accessible_set_name (PortableServer_Servant servant, printf ("Accessible set_name called: %s\n", name); } +/* + * CORBA Accessibility::Accessible::get_description method implementation + */ +static CORBA_char * +impl_accessibility_accessible_get_description (PortableServer_Servant servant, + CORBA_Environment *ev) +{ + CORBA_char * retval; + Accessible *accessible = ACCESSIBLE (bonobo_object_from_servant (servant)); + retval = CORBA_string_dup (atk_object_get_description (accessible->atko)); + fprintf (stderr, "Accessible get_description called: %s\n", retval); + return retval; +} + +/* + * CORBA Accessibility::Accessible::set_description method implementation + */ +static void +impl_accessibility_accessible_set_description (PortableServer_Servant servant, + const CORBA_char *name, + CORBA_Environment *ev) +{ + Accessible *accessible = ACCESSIBLE (bonobo_object_from_servant (servant)); + atk_object_set_description (accessible->atko, name); + printf ("Accessible set_description called: %s\n", name); +} + static void accessible_class_init (AccessibleClass *klass) { GObjectClass * object_class = (GObjectClass *) klass; POA_Accessibility_Accessible__epv *epv = &klass->epv; - accessible_parent_class = g_type_class_ref (BONOBO_X_OBJECT_TYPE); - /*accessible_parent_class = g_type_class_peek_parent (klass);*/ + accessible_parent_class = g_type_class_peek_parent (klass); object_class->finalize = accessible_object_finalize; epv->_get_name = impl_accessibility_accessible_get_name; epv->_set_name = impl_accessibility_accessible_set_name; + epv->_get_description = impl_accessibility_accessible_get_description; + epv->_set_description = impl_accessibility_accessible_set_description; + + /* epv->_get_parent = impl_accessibility_accessible_get_parent; */ + /* epv->_get_childCount = impl_accessibility_accessible_get_child_count; */ + /* epv->getChildAtIndex = impl_accessibility_accessible_get_child_at_index; */ + /* epv->getIndexInParent = impl_accessibility_accessible_get_index_in_parent; */ + /* epv->getRelationSet = impl_accessibility_accessible_get_relation_set; */ + /* epv->getState = impl_accessibility_accessible_get_state; */ + /* epv->getRole = impl_accessibility_accessible_get_role; */ } static void @@ -129,12 +166,11 @@ accessible_get_type (void) NULL /* value table */ }; /* - * Here we use bonobo_x_type_unique instead of - * gtk_type_unique, this auto-generates a load of + * Bonobo_type_unique auto-generates a load of * CORBA structures for us. All derived types must - * use bonobo_x_type_unique. + * use bonobo_type_unique. */ - type = bonobo_x_type_unique ( + type = bonobo_type_unique ( PARENT_TYPE, POA_Accessibility_Accessible__init, NULL, diff --git a/libspi/accessible.h b/libspi/accessible.h index 70742d8..406d026 100644 --- a/libspi/accessible.h +++ b/libspi/accessible.h @@ -25,7 +25,7 @@ extern "C" { #endif /* __cplusplus */ -#include +#include #include #include @@ -36,12 +36,12 @@ extern "C" { #define IS_ACCESSIBLE_CLASS(k) (G_TYPE_CHECK_CLASS_TYPE ((k), ACCESSIBLE_TYPE)) typedef struct { - BonoboXObject parent; + BonoboObject parent; AtkObject *atko; } Accessible; typedef struct { - BonoboXObjectClass parent_class; + BonoboObjectClass parent_class; POA_Accessibility_Accessible__epv epv; } AccessibleClass; diff --git a/libspi/application.c b/libspi/application.c index 2a2f4a2..8e16e12 100644 --- a/libspi/application.c +++ b/libspi/application.c @@ -74,12 +74,11 @@ application_get_type (void) NULL /* value table */ }; /* - * Here we use bonobo_x_type_unique instead of - * gtk_type_unique, this auto-generates a load of + * Bonobo_type_unique auto-generates a load of * CORBA structures for us. All derived types must - * use bonobo_x_type_unique. + * use bonobo_type_unique. */ - type = bonobo_x_type_unique ( + type = bonobo_type_unique ( PARENT_TYPE, POA_Accessibility_Application__init, NULL, diff --git a/libspi/desktop.c b/libspi/desktop.c index a67ca65..b21fdfe 100644 --- a/libspi/desktop.c +++ b/libspi/desktop.c @@ -127,12 +127,12 @@ desktop_get_type (void) NULL /* value table */ }; /* - * Here we use bonobo_x_type_unique instead of + * 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_x_type_unique. + * use bonobo_type_unique. */ - type = bonobo_x_type_unique ( + type = bonobo_type_unique ( PARENT_TYPE, POA_Accessibility_Desktop__init, NULL, diff --git a/libspi/registry.c b/libspi/registry.c index 506843d..4e767ad 100644 --- a/libspi/registry.c +++ b/libspi/registry.c @@ -309,7 +309,7 @@ registry_get_type (void) * CORBA structures for us. All derived types must * use bonobo_x_type_unique. */ - type = bonobo_x_type_unique ( + type = bonobo_type_unique ( PARENT_TYPE, POA_Accessibility_Registry__init, NULL, diff --git a/registryd/desktop.c b/registryd/desktop.c index a67ca65..b21fdfe 100644 --- a/registryd/desktop.c +++ b/registryd/desktop.c @@ -127,12 +127,12 @@ desktop_get_type (void) NULL /* value table */ }; /* - * Here we use bonobo_x_type_unique instead of + * 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_x_type_unique. + * use bonobo_type_unique. */ - type = bonobo_x_type_unique ( + type = bonobo_type_unique ( PARENT_TYPE, POA_Accessibility_Desktop__init, NULL, diff --git a/registryd/registry.c b/registryd/registry.c index 506843d..4e767ad 100644 --- a/registryd/registry.c +++ b/registryd/registry.c @@ -309,7 +309,7 @@ registry_get_type (void) * CORBA structures for us. All derived types must * use bonobo_x_type_unique. */ - type = bonobo_x_type_unique ( + type = bonobo_type_unique ( PARENT_TYPE, POA_Accessibility_Registry__init, NULL, -- 2.7.4