Mac IME support (implementation of NSTextInputClient protocol for wxNSView)

127 views
Skip to first unread message

Artur Sochirca

unread,
Mar 29, 2017, 6:50:17 AM3/29/17
to wx-...@googlegroups.com
Dear community,

We've locally added some functionality and would like to find out
whether a contribution is meaningful.

Controls based on native ones have IME functionality already supported.
But custom controls that have their peers based on wxNSView need to
provide their own implementation.
Currently methods of NSTextInputClient protocol are only stubs in
wxNSView (besides insertText() and doCommandBySelector()).

In our case, IME is used to draw text on a wxGLCanvas.
To support IME, we added a new event type to wxWidgets (on mac only). We
use it to forward the calls of the protocol to the peer window of
wxWidgetCocoaImpl.
In our custom window we execute the required actions and respond to data
requests based on the specifics of our text drawing.

Does this comply with wxWidgets design? Is an evetual contribution
useful for general purpose?

Kind regards,
Artur

Igor Korot

unread,
Mar 29, 2017, 12:03:56 PM3/29/17
to wx-dev
Hi, Arthur,
Do you know if this is already supported by Winodws/*nix?

But in any case you can submit you work as a patch to trac.wxwidgets.org
or as a PR on the GitHub.

I also presume that this functionality is available in an older OSX versions?
Minimal supported OSX for wx is 10.7.

Thank you.

>
> Kind regards,
> Artur
>
> --
> To unsubscribe, send email to wx-dev+un...@googlegroups.com
> or visit http://groups.google.com/group/wx-dev
>

Vadim Zeitlin

unread,
Mar 29, 2017, 3:51:49 PM3/29/17
to wx-...@googlegroups.com
On Wed, 29 Mar 2017 13:03:51 +0300 Artur Sochirca wrote:

AS> In our case, IME is used to draw text on a wxGLCanvas.
AS> To support IME, we added a new event type to wxWidgets (on mac only). We
AS> use it to forward the calls of the protocol to the peer window of
AS> wxWidgetCocoaImpl.
AS> In our custom window we execute the required actions and respond to data
AS> requests based on the specifics of our text drawing.
AS>
AS> Does this comply with wxWidgets design? Is an evetual contribution
AS> useful for general purpose?

Hello,

It would be definitely very useful to have better support for IME, under
macOS as well under the other platforms. It is also not a problem to start
with having the implementation for this new event for Mac only, however it
would be very useful to check that the proposed API makes sense for the
other platforms as well (again, without necessarily implementing it for
them right now). I also wonder how is this going to work with the native
controls.

To summarize, your contribution would be very welcome, but I think we need
to discuss it in more details in order to find what is the best way of
doing it. Please let us know how do you do it now and whether you've
already checked if it can be done in this way under the other platforms.

Thanks in advance!
VZ
Reply all
Reply to author
Forward
0 new messages