VNC Server

Dean_Swan at Mitel.COM Dean_Swan at Mitel.COM
Mon Apr 3 18:16:52 UTC 2000



>3.  Where can I hook in to make this work with MVC as well?

     InputSensor for all the mouse and keyboard stuff, and BitBlt>>copyBits for
Display updates.  You may be able to get away with just modifying
InputSensor>>mousePoint, InputSensor>>keyboard, and InputSensor>>keyboardPeek,
but you'll probably also need to intercept InputSensor>>primMouseButtons, since
this is where all the keyboard modifiers and mouse buttons get polled from the
host OS.

     What I've done in the past to intercept Display updates is to rename
'BitBlt>>copyBits' to 'BitBlt>>basicCopyBits', then substitute my own
implementation of 'BitBlt>>copyBits', which ultimately calls
'BitBlt>>basicCopyBits'.  In this case I imagine you'd want to do something
like:

     copyBits

          (destForm == Display)
               ifTrue:
                    [
                         "Do VNC Server Screen Refresh Logic"
                    ].

          self basicCopyBits.


You do have to be careful when doing something like this, and I recommend that
you manually adjust any changesets you distribute so that the changes to BitBlt
are last in the file, or you may end up with a broken image when you try to file
it in.

When you break 'BitBlt>>copyBits', it gets rather difficult to tell what's going
on, so I'd suggest writing lots of debug messages to a file, and always save
your image BEFORE saving your new 'BitBlt>>copyBits', because if there are any
problems in your new 'copyBits' method, you can pretty much count on having to
kill the VM and start over (i.e. re-launch Squeak).

     I used this technique to implement cursor display in Smalltalk, for
platforms where no hardware cursor display is available (i.e. WinCE, EPOC).
That code works ok now, but I still have a few bugs to track down in it related
to hiding the software cursor when crossing window boundaries, and when the
cursor shape is changed, but I'd be happy to send you a copy if you want to look
at it for reference.

     This may be pretty messy re-wiring of very low-level stuff, but if you do
it right, then it will work for *BOTH* Morphic and MVC, without any need for a
"Morphic-only" implementation.


                                   -Dean Swan
                                   dean_swan at mitel.com













More information about the Squeak-dev mailing list