Missing routines for 3.0 Unix VM: what's the status?

Ned Konz ned at bike-nomad.com
Wed Feb 7 22:55:47 UTC 2001


On Wednesday 07 February 2001 14:18, Stefan Matthias Aust wrote:

> My list of undefined symbols was much smaller (don't ask me why) and I
> added the missing functions as stub methods so that their primitives will
> fail.  That means, no sound volume control, no drag and drop and no event
> handling yet.
>
> I didn't start with the sourceforge sources but more current sources from
> Ian's web page Bert Freudenberg recommended to me.

I was working with the sources from Ian's directory, as well (in the jitter 
subdirectory); mine are (I think) 2.8pre5. The sources I'm using are from:

http://www-sor.inria.fr/~piumarta/squeak/Jitter-3.1/ppc-linux-gnu/Squeak-2.8pre5.tar.gz

Did you generate all the sources from the 3.0 (updated) image? After starting 
from a clean directory and defining DISABLE_SECURITY, I'm left with:

dir_GetMacFileTypeAndCreator
dropInit
dropRequestFileHandle
dropRequestFileName
dropShutdown
ioCanRenameImage
ioCanWriteImage
ioDisableImageWrite
ioDisablePowerManager
ioGetNextEvent
ioGetSecureUserDirectory
ioGetUntrustedUserDirectory
ioScreenDepth
ioSetInputSemaphore
snd_SetVolume
snd_Volume
sqFileFlush
sqImageFileStartLocation

> I'm now at home and the sources are at my work but tomorrow I'll hopefully
> have something I can provide to others.
>
> I don't care about sound or drag and drop at the moment, but I'd love to
> have event support on Unix - if I only would know what this means exactly
> for the code.  From looking at the mac sources inside a 3.0 image I
> couldn't really figure out what to do.  It seemed to me that even on the
> mac, the event support wasn't finished yet.

The Windows sources may make more sense (see sqWin32Window.c):  there is 
a circular buffer of sqInputEvent's called eventBuffer[], and if it's empty, 
ioGetNextEvent kicks the Windows event loop hoping to get new events. If 
there aren't any after that, it does nothing, or it returns the next one.

int ioSetInputSemaphore(int semaIndex) {
	inputSemaphoreIndex = semaIndex;
	return 1;
}

int ioGetNextEvent(sqInputEvent *evt) {
	if (eventBufferGet == eventBufferPut) {
		ioProcessEvents();
	}
	if (eventBufferGet == eventBufferPut) 
		return 1;

	*evt = eventBuffer[eventBufferGet];
	eventBufferGet = (eventBufferGet+1) % MAX_EVENT_BUFFER;
	return 1;
}

Then in the window procedure (the callback from Windows), the 
inputSemaphoreIndex is checked to determine whether or not to be event-driven:

      case WM_MOUSEMOVE: 
		if(inputSemaphoreIndex) {
			recordMouseEvent(lastMessage);
			break;
		}
		/* state based stuff */
		mousePosition.x = LOWORD(lParam);
		mousePosition.y = HIWORD(lParam);
		break;

Here recordMouseEvent() translates the Windows message into a sqInputEvent 
and puts it into the circular buffer. Similar things happen for mouse 
up/down, key up/down, and character messages.

This should be pretty easy to add to the Unix sources.

-- 
Ned Konz
currently: Stanwood, WA
email:     ned at bike-nomad.com
homepage:  http://bike-nomad.com





More information about the Squeak-dev mailing list