> I'll post the patch in the coming days anyway, once I polished it a
> little, and implemented the few missing bits; but at least the second
> point might alter the implementation significantly.
Here is an initial patch that give initial working support for at least
the most naive part of accessibility.
It obviously needs a lot of testing, especially from people familiar
with various ATs, which can better assess whether it works as they expect.
I don't expect this to be the final version, but it's usable and I'd
fancy testing, comments and alike.
Known issues:
* When the document associated with a view changes, Orca doesn't react.
It is especially problematic in SciTE which has one single view for all
documents. However, the same happens with GtkTextView, so I'm not sure
what to think.
I do emit contents change notifications, so supposedly ATs could pick it
up, but that would need to be investigated.
* It currently reports positions as Scintilla reports them (i.e. in
bytes), while ATK expects character count. I don't yet have assessed
the impact, but it's likely it should be fixed. It however might be
slightly problematic when having to locate the Nth character in the
buffer. Is there a cached way to query that, that don't mean reading
the whole buffer from the start?
* Similarly, it currently no encoding conversion is applied, although
ATK expects UTF-8. This will mean converting everywhere, and probably
will require fixing the point above about returning character counts
rather than bytes, because then every length and positions would really
need to match whether they are input or output ones.
Details on the implementation:
* The implementation is currently very C-ish (I even started it as pure
C). It's a GObject class, and it doesn't wrap a C++ class. I might
change that especially if you'd like me to. As the implementation
currently is, it might not be too useful regarding the complexity, as I
wouldn't have nothing to inherit from, and the bulk of the code is
implementing GObject interfaces which means a lot of C function pointers.
I'm however open to any design suggestions.
* Support for GTK 3.2 to 3.6 requires a fairly ugly hack. It's
documented, and there doesn't seem to be any other way to do it. It's
unrelated to Scintilla, but to GTK 3.2 having changed things and not
introduced new ones until 3.8. The only way not to require any hack
would be to re-implement the whole ATK interfaces inheritance currently
gives us, but I'd really rather not do that.
Apart that, GTK 2 and 3 is fully supported. GTK2 minimum version might
currently be 2.22, I'm not totally sure and didn't investigate too much yet.
* Most access to the data is currently made through
scintilla_send_message(). It might or might not be interesting to port
to something else. I must admit I'm not too familiar with those
internal parts, so I might be missing something obvious, suggestions
welcome.
Using at least sci->WndProc() might be interesting if the code should
become generic though.
* Implementation for detecting readonly state and associated document
changes is suboptimal, as there is no notifications for those (that I
know of, and at least not for associated document). Currently the value
is cached and checked in UPDATEUI.
* Similarly for selection and caret, because ATK wants to differentiate
caret moves from selection changes, but that can be done in
SC_UPDATE_SELECTION and is more specific to this, so probably not worth
considering a specific notification.
Regards,
Colomban