<div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr">Hi Tom,<br></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Mon, Dec 23, 2019 at 11:56 AM Tom Beckmann <<a href="mailto:tomjonabc@gmail.com">tomjonabc@gmail.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-style:solid;border-left-color:rgb(204,204,204);padding-left:1ex"> <div dir="ltr"><div>Dear Elliot, dear all,</div><div><br></div><div>do you have some insights or docs pages on how the HostWindowPlugin fits into the big picture at the moment? 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.<br></div></div></blockquote><div><br></div><div>The HostWindowPlugin is an internal plugin in the Squeak and Pharo VMs (at theist the opensmalltalk Pharo VMs).  So one can  rely on it being present.</div><div><br></div><div>The HostWIndowPlugin is not the same as a host window facility where Morphic windows can be launched in native windows.  Instead the HostWindowPlugin gives access to the host window in which the main Squeak desktop runs.  For example, Terf uses it at login to resize the window into a login dialog sized window.</div><div><br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-style:solid;border-left-color:rgb(204,204,204);padding-left:1ex"><div dir="ltr"><div></div><div><br></div><div>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? </div></div></blockquote><br>No.  The plumbing for the various display plugins on Unix is via a struct that includes functions such as ioSetCursorPositionXY.  See SqDisplay.h.  So the issue is independent of needing a primitive number.  I like to use primitive numbers for core Smalltalk and VM facilities and think that using HostWindowPliugin is entirely appropriate for primCursorLocPut: functionality.</div><div class="gmail_quote"><br></div><div class="gmail_quote"><br><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-style:solid;border-left-color:rgb(204,204,204);padding-left:1ex"><div dir="ltr"><div>Is this the desirable way? Or is the purpose of the HostWindowPlugin to supersede the platform's own window code?</div></div></blockquote><br>As I understand it, the HostWindowPlugin's role is in providing additional control beyond e.g. the beDisplay primitive.</div><div class="gmail_quote"><br><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-style:solid;border-left-color:rgb(204,204,204);padding-left:1ex"><div dir="ltr"><div><br></div><div>Thank you for the insights!</div><div>Tom<br></div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Mon, Dec 23, 2019 at 8:28 PM Eliot Miranda <<a href="mailto:eliot.miranda@gmail.com" target="_blank">eliot.miranda@gmail.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-style:solid;border-left-color:rgb(204,204,204);padding-left:1ex"> <div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr">Hi Tom, Hi Tim, Hi Ron,<br></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Sun, Dec 22, 2019 at 10:34 PM Tom Beckmann <<a href="mailto:tomjonabc@gmail.com" target="_blank">tomjonabc@gmail.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-style:solid;border-left-color:rgb(204,204,204);padding-left:1ex"> <div dir="ltr">Hey everyone,<br><br>I was looking for a way to set the OS cursor position from Squeak and found primitive 91 (see screenshots), which used to do exactly that (also according to the blue book). Now it instead returns whether a pixel depth is supported by the display.<br></div></blockquote><div><br></div><div>As Tim says we must remove, or at least reimplement primCursorLockPut: to say it is moo longer implemented ASAP.</div><div> </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-style:solid;border-left-color:rgb(204,204,204);padding-left:1ex"><div dir="ltr">Has an alternative for setting the cursor position been implemented? If not, what would be the correct way of re-adding that functionality? Taking over another primitive number? I read that some people resorted to using custom FFI, but I feel like it could be worth the effort to properly reintegrate the functionality.<br></div></blockquote><div><br></div><div>Indeed, but not in the default VM. Qwaq/Teleplace/3D ICC extended the HostWindowPlugin:</div><div><br></div><div><div>primitiveSetCursorPositionX:Y:</div><div>#if TerfVM</div><div>EXPORT(sqInt)</div><div>primitiveSetCursorPosition(void)</div><div>{</div><div>   ...</div><div>    result = ioSetCursorPositionXY(x, y);</div></div><div><br></div><div>and implementationsfor ioSetCursorPositionXY exist in the Term VM source for some platforms.</div><div><br></div><div>iOS :-( platforms//iOS/plugins/HostWindowPlugin/sqMacHostWindow.m</div><div><br></div><div><div>sqInt ioSetCursorPositionXY(long x, long y) {   return -1; }</div></div><div><br></div><div>Unix :-) platforms//unix/vm-display-X11/sqUnixX11.c</div><div><br></div><div><div>static long</div><div>display_ioSetCursorPositionXY(long x, long y)</div><div>{</div><div>        if (!XWarpPointer(stDisplay, None, DefaultRootWindow(stDisplay),</div><div>                                          0, 0, 0, 0, x, y))</div><div>                return -1;</div><div>        XFlush(stDisplay);</div><div>        return 0;</div><div>}</div></div><div><br></div><div>Windows :-) (but only in the Term VM sources in platforms/win32/plugins/HostWindowPlugin/sqWin32HostWindowPlugin.c).  This needs to be ported).</div><div><br></div><div><div>#if TerfVM</div><div>sqInt ioSetCursorPositionXY(sqInt x, sqInt y) { return SetCursorPos(x,y) ? 0  : -1; }</div><div><br></div><div><br></div><div>I'm pretty sure Ron has no issues with the Perf VM code getting integrated.  And I think all those #if TermVM qualifiers can (and should) be discarded.</div><div><br></div><div>So what we really need are</div><div><br></div><div>a) an implementation for iOS Cocoa, and</div><div>b) someone to put the energy into integrating the code, given that Vincent Blondeau extended HostWin dowPlugin with support for setting the window icon.  SO the Term and opensmalltalk code has diverged a little.</div><br></div><div><br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-style:solid;border-left-color:rgb(204,204,204);padding-left:1ex"><div dir="ltr"><br>Usecases: for example in Photoshop you often have number inputs on the far right side of your monitor. These support clicking and dragging for changing the value. However, the cursor will almost immediately hit the right edge of the screen. To prevent this, the cursor position will keep being reset to the center of the slider element while the user is dragging.<br>Further, games often use mouse input as a relative number, rather than absolute, by forcing the cursor to the center of screen after each frame and only taking the movement between each frame. This is most commonly seen in games with first person perspective.<br></div></blockquote><div><br></div><div>You don't have to justify.  primCursorLocPut: is essential GUi functionality.</div><div> </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-style:solid;border-left-color:rgb(204,204,204);padding-left:1ex"><div dir="ltr"><br>Thank you for any pointers!<br><br>Best,<br>Tom<br></div>
</blockquote></div><div><br></div><div dir="ltr"><div dir="ltr"><div><span style="font-size:small;border-collapse:separate"><div>_,,,^..^,,,_<br></div><div>best, Eliot</div></span></div></div></div></div></div></div></div></div></div></div></div></div>
</blockquote></div>
</blockquote></div><br clear="all"><div><br></div>-- <br><div dir="ltr" class="gmail_signature"><div dir="ltr"><div><span style="font-size:small;border-collapse:separate"><div>_,,,^..^,,,_<br></div><div>best, Eliot</div></span></div></div></div></div></div></div>