[squeak-dev] International text input on X11

David T. Lewis lewis at mail.msen.com
Sat May 14 05:16:31 UTC 2016


On Fri, May 13, 2016 at 09:04:08PM -0700, Yoshiki Ohshima wrote:
> Thanks!  I don't have the environment right now, but I'll follow this.
> But adding ImmX11Plugin (back again) seems to be right thing to do.
> If I'm not mistaken, this does not actually involve the VMMaker?

I think that is right. I just tried generating source for ImmX11Plugin
from my VMMaker. It seems to compile without problems (but probably it
would have unresolved references). The generated ImmX11Plugin.c calls the
function declared as extern int setCompositionWindowPosition(int, int).

So I think that what may be needed is to create a new source file
platforms/unix/plugins/ImmX11Plugin/sqUnixImmX11Plugin.c
and this source file would call the function in the VM display module.

I see now that I do not know enough about the ImmX11Plugin, so I
am not sure if I fully understand what needs to be done.

But it works for HostWindowPlugin, so I think that we can make it
work for ImmX11Plugin in a similar way.

Dave

> 
> On Fri, May 13, 2016 at 8:05 PM, David T. Lewis <lewis at mail.msen.com> wrote:
> > On Fri, May 13, 2016 at 07:31:07PM -0700, Yoshiki Ohshima wrote:
> >> On Fri, May 13, 2016 at 5:22 PM, Eliot Miranda <eliot.miranda at gmail.com> wrote:
> >> >
> >> >
> >> > On Fri, May 13, 2016 at 4:48 PM, Yoshiki Ohshima <Yoshiki.Ohshima at acm.org>
> >> > wrote:
> >> >>
> >> >> Iit appears that most bits and pieces are there.  For example,
> >> >> sqUnixX11.c does have two functions setCompositionFocus() and
> >> >> setCompositionWIndowPosition(), which used to be in a separated
> >> >> loadable VM plugin but now sitting in there without any caller (if I'm
> >> >> not mistaken).  And the NuSqueak image has calls to
> >> >> Hand>>compositionWindowManager, and miraculously, returns an instance
> >> >> of ImmX11.
> >> >>
> >> >> In ImmX11, setCompositionWindowPositionX:y: has a primitive call into
> >> >> ImmX11Plugin; but it appears that all I have to do is to change it to
> >> >> call the above-mentioned function in sqUnixX11.c.
> >> >>
> >> >> To make it right, I'd propose to add two more functions to the display
> >> >> module interface.  I see the implementation of those for X11 is there,
> >> >> and I remember writing something for Windows; but it can be an empty
> >> >> function.
> >> >>
> >> >> So, if there is no opposition to add these to the display interface,
> >> >> I'd write a patch for it.  But one thing I don't know much about is
> >> >> the HostWindowPlugin.  If people think it makes sense to have them
> >> >> there for some reason, we can make that work, too.
> >> >
> >> >
> >> > This is in struct SqDisplay in platforms/unix/vm/SqDisplay.h?  Go for it :-)
> >>
> >> Yes, SqDisplay.h is what would be changed.
> >>
> >>  What I wrote above has some confusion, and I am indeed confused by this:
> >>
> >> - the display vm plugin mechanism has primitives that are numbered as
> >> well as primitives that are in plugins like HostWindowPlugin.  Is it
> >> possible to make then setCompositionFocus() and
> >> setCompositionWindowPosition() to be non-numbered yet make them be
> >> looked up from a plugin?  Wasn't there a way to say to load a
> >> primitive from the core VM itself?
> >
> > Yes they can be non-numbered, and it is better for them to be named
> > primitives. And yes, a named primitive in the VM can be called directly,
> > but here is is better if you let them be named primitives in either
> > ImmX11Plugin or HostWindowPlugin.
> >
> > To summarize with an example, #primitiveHostWindowPosition is called as a
> > named primitive:
> >
> >    HostWindowProxy>>primitiveWindowPosition: id
> >         "Find the topleft corner of the window"
> >         <primitive: 'primitiveHostWindowPosition' module: 'HostWindowPlugin'>
> >         ^self windowProxyError: 'get position'
> >
> > The primitive calls ioPositionOfWindow(windowIndex() in the unix support
> > code, declared in platforms/Cross/plugins/HostWindowPlugin.h, implemented in
> > platforms/unix/plugins/sqHostWindowPlugin.c.
> >
> > The plugin implementation calls a function in whatever VM module has been
> > loaded for the display:
> >         dpy->hostWindowGetSize(windowIndex)
> >
> > For unix/X11, the display module is implemented in sqUnixX11.c, and the
> > function in that loaded module is display_hostWindowGetSize().
> >
> > You can follow exactly the same pattern for the two new methods that
> > you are adding. Your new primitives can be named primitives in either
> > ImmX11Plugin or HostWindowPlugin.
> >
> > I do not know which plugin would be better to use, but either one will work.
> >
> > Dave
> >
> >
> >>
> >> In any case, what to be edited seems to be minimal on the image side
> >> and isolated in the ImmX11 class; so it looks like it is close.
> >>
> >> --
> >> -- Yoshiki
> >
> 
> 
> 
> -- 
> -- Yoshiki


More information about the Squeak-dev mailing list