[Vm-dev] Primtive 91/primCursorLocPut:

tim Rowledge tim at rowledge.org
Mon Dec 23 22:44:23 UTC 2019



> On 2019-12-23, at 11:56 AM, Tom Beckmann <tomjonabc at gmail.com> wrote:
> 
> Dear Elliot, dear all,
> 
> do you have some insights or docs pages on how the HostWindowPlugin fits into the big picture at the moment? 

Right now the HostWindowPlugin is almost unused. It was written ... crikey, 15 years ago, as part of the sophie text/media-editor project with the intention of finally quieting the constant whines about how Squeak had to do host windows & menus etc or it would immediately fail and die away. 

Guess how many people actually did anything once we had the ability to open many host windows and draw in them? Think of a very round number....

Having said that, some of the functionality is integrated into the core of the vm; the main (only!) window is at least in some platforms part of the host window list. The prims for finding and setting window sizes, positions and decoration stuff is used I think. Setting the window label can be done with it.

It needs better integration into the vm generally. It is my claim that no window should be created until (and unless!) something is displayed, which would make headless scripting/server operation considerably simpler. It's how I always had it working on the RISC OS vm. At one point in the deep past there were some issues that apparently made that not practical for Windows but I think even microsoft have managed to move past that now.


> Trying DisplayHostWindow>>#examplePaint in Squeak trunk primtiveError's for me at the moment and I don't know what it should do exactly either. I always assumed it was meant to spawn additional windows, but never actually saw that in action.

It is supposed to work and indeed did at some point. So far as I can see both linux & mac have the HostWindowPlugin loaded, each has the right class logged as active but both fail to create a new window. Taking a quick look at the vm code I think both ought to be working. Evidently I'm wrong...

> 
> Only knowing the unix platform opensmalltalk code a little, my gut feeling would have led me to place primCursorLocPut: implementations in there, in one of the display plugins. To my understanding this would mean that we would have to occupy a new numbered VM primitive, as it used to be. Is that correct? Is this the desirable way? Or is the purpose of the HostWindowPlugin to supersede the platform's own window code?

Hmm, sort of not.
A prim to set cursor position could go anywhere in the vm. I'd say the host window plugin would be sensible because yes, it really ought to be where all the host window stuff goes. Even if one put it in the core vm it need not use a primitive number; we can have named prims there too.

As an aside, I'd really like the keyboard input code to move to the HostWindow plugin too. But then there is a huge stack of cleanups I think need doing...

It needs to be able to fail because (IIRC) some windowing systems don't allow it. Personally I'd be very careful about using it; anything that yanks my 'attention point' away from where I've put it is usually unwelcome.


tim
--
tim Rowledge; tim at rowledge.org; http://www.rowledge.org/tim
Never do card tricks for the group you play poker with.




More information about the Vm-dev mailing list