Re: [g-a-devel]Re: atkgobjectaccessible bug ...



> Hi Padraig,
> 
> On Thu, 2002-04-04 at 14:30, Padraig O'Briain wrote:
> > My expectation is that the first time this function is called 
> > quark_accessible_object will have the value 0. By the time the call to 
> > g_object_set_data() is reached I would expect that quark_accessible_object 
would 
> > be non-zero as atk_gobject_accessible_class_init() would have been called.
> 
> 	Right - except the problem is that in the case where we return eg. a
> NoOpAccessible [ not derived from AtkGObjectAccessible ] we run into
> problems :-)

The following patch would probably fix this problem.

cvs server: Diffing .
Index: atkgobjectaccessible.c
===================================================================
RCS file: /cvs/gnome/atk/atk/atkgobjectaccessible.c,v
retrieving revision 1.3
diff -u -p -r1.3 atkgobjectaccessible.c
--- atkgobjectaccessible.c	12 Mar 2002 15:06:52 -0000	1.3
+++ atkgobjectaccessible.c	12 Apr 2002 11:30:47 -0000
@@ -85,6 +85,13 @@ atk_gobject_accessible_for_object (GObje
                                           G_OBJECT_TYPE (obj));
       accessible = atk_object_factory_create_accessible (factory,
                                                          obj);
+      if (!quark_accessible_object)
+        {
+          /*
+           * The AtkObject which was created was not a AtkGObjectAccessible
+           */
+          quark_accessible_object = g_quark_from_static_string 
("accessible-object");
+        }
       g_object_set_qdata (obj, quark_accessible_object, accessible);
     }
   return accessible;
@@ -144,6 +151,7 @@ atk_gobject_accessible_class_init (AtkGO
 
   class->initialize = atk_real_gobject_accessible_initialize;
 
-  quark_accessible_object = g_quark_from_static_string ("accessible-object");
+  if (!quark_accessible_object)
+    quark_accessible_object = g_quark_from_static_string ("accessible-object");
   quark_object = g_quark_from_static_string ("object-for-accessible");
 }




> 
> > It seems to me that the accessible object which has been created does
> > not derive from AtkGObjectAccessible. Is this what you intend should
> > happen?
> 
> 	Yes. I'd like a single point to associate GObjects with AtkObjects and
> VV. and I'd like it to be this - that is if it will work.
> 

We defined a function atk_implementor_ref_accessible() in atk/atkobject.h but we 
currently only have an implementation for GtkWidget. This function ought to 
return a reference to the AtkObject. It requires that the AtkImplementor 
interface be defined for the object whose AtkObject we want. Do you need 
AtkImplementor implemented on some objects?

We do not have an interface defined for the GObject for which the AtkObject was 
created.

Padraig



> 	Thanks,
> 
> 		Michael.
> 
> -- 
>  mmeeks gnu org  <><, Pseudo Engineer, itinerant idiot
> 
> _______________________________________________
> Gnome-accessibility-devel mailing list
> Gnome-accessibility-devel gnome org
> http://mail.gnome.org/mailman/listinfo/gnome-accessibility-devel




[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]