I have been having a problem using the Accessibility::Text::getBoundedRanges() function via both cspi and pyatspi. This is at-spi version 1.22.1 on GNOME 2.22.3 (ubuntu hardy)
In order to test using pyatspi, I modified accerciser with some code (added to node.py): try: i = acc.queryText() except NotImplementedError: pass else: if isinstance(i, pyatspi.Accessibility.Text): print "yes! it's Text!" # CORBA COMM_FAILURE #br = i.getBoundedRanges(self.extents.x, # self.extents.y, # self.extents.width, # self.extents.height, # 0, # pyatspi.Accessibility.TEXT_CLIP_NONE, # pyatspi.Accessibility.TEXT_CLIP_NONE) #print "got Bounded Ranges!" #for r in br: # print "text in a Range: %s" % r.content # works x, y, width, height = i.getRangeExtents(0, i.characterCount, 0) print "x %d y %d width %d height %d" % (x, y, width, height) The commented portion of code marked # CORBA COMM_FAILURE will always throw an exception and print the error "CORBA.COMM_FAILURE". In addition it immediately crashes the application to which the text node belongs. I've tried substituting hard-coded values for x,y,width,height as well as changing TEXT_CLIP_NONE to TEXT_CLIP_BOTH but encounter the same error. Note that other functions like getRangeExtents() work fine. Similarly in C, using cspi, I have tried to use getBoundedRanges: AccessibleTextRange **atr; printf("trying to get AccessibleTextRange hardcoded x y w h\n"); fflush(stdout); atr = AccessibleText_getBoundedRanges(at, 0, 0, 100, 100, 1, SPI_TEXT_CLIP_BOTH, SPI_TEXT_CLIP_BOTH); printf("stored AccessibleTextRange\n"); fflush(stdout); but it immediately crashes before the second printf. It is evidently a problem with getBoundedRanges. Could someone tell me, is this a known problem with certain (all?) versions at-spi, or am I forgetting to do something before I call this function? I noticed that the at-spi source package has an example (screen-review-test.c) that seems to have an alternative implementation of getBoundedRanges() but that is slower. I am trying to figure out how to use it now, but is it worth it? I don't want to use some alternative implementations that are impractically slow. Thanks for your help, Andrew Shu
_______________________________________________ gnome-accessibility-list mailing list gnome-accessibility-list@gnome.org http://mail.gnome.org/mailman/listinfo/gnome-accessibility-list