Switch to standard indentation of closing braces

This commit is contained in:
Stephen Heumann 2015-09-23 20:56:33 -05:00
parent ab3210adb0
commit ebf5297779
11 changed files with 296 additions and 296 deletions

View File

@ -38,11 +38,11 @@ void DoServerCutText (void) {
if (! DoWaitingReadTCP (3)) { /* Read & ignore padding */ if (! DoWaitingReadTCP (3)) { /* Read & ignore padding */
DoClose(vncWindow); DoClose(vncWindow);
return; return;
} }
if (! DoWaitingReadTCP (4)) { if (! DoWaitingReadTCP (4)) {
DoClose(vncWindow); DoClose(vncWindow);
return; return;
} }
HLock(readBufferHndl); HLock(readBufferHndl);
textLen = SwapBytes4((unsigned long) **readBufferHndl); textLen = SwapBytes4((unsigned long) **readBufferHndl);
HUnlock(readBufferHndl); HUnlock(readBufferHndl);
@ -50,7 +50,7 @@ void DoServerCutText (void) {
if (! DoWaitingReadTCP(textLen)) { if (! DoWaitingReadTCP(textLen)) {
DoClose(vncWindow); DoClose(vncWindow);
return; return;
}; };
if (allowClipboardTransfers) { if (allowClipboardTransfers) {
ZeroScrap(); ZeroScrap();
HLock(readBufferHndl); HLock(readBufferHndl);
@ -64,8 +64,8 @@ void DoServerCutText (void) {
PutScrap(textLen, textScrap, (Pointer) *readBufferHndl); PutScrap(textLen, textScrap, (Pointer) *readBufferHndl);
/* Potential errors (e.g. out of memory) ignored */ /* Potential errors (e.g. out of memory) ignored */
HUnlock(readBufferHndl); HUnlock(readBufferHndl);
}
} }
}
void DoSendClipboard (void) { void DoSendClipboard (void) {
static struct clientCutText { static struct clientCutText {
@ -73,7 +73,7 @@ void DoSendClipboard (void) {
unsigned char padding1; unsigned char padding1;
unsigned int padding2; unsigned int padding2;
unsigned long length; unsigned long length;
} clientCutTextStruct = { 6 /* Message type 6 */ }; } clientCutTextStruct = { 6 /* Message type 6 */ };
Handle scrapHandle; Handle scrapHandle;
unsigned long i; unsigned long i;
@ -112,6 +112,6 @@ void DoSendClipboard (void) {
end: end:
DisposeHandle(scrapHandle); DisposeHandle(scrapHandle);
}
} }
}

View File

@ -60,7 +60,7 @@ void DoCopyRect (void) {
SendFBUpdateRequest(FALSE, rectX, rectY, rectWidth, rectHeight); SendFBUpdateRequest(FALSE, rectX, rectY, rectWidth, rectHeight);
displayInProgress = FALSE; displayInProgress = FALSE;
return; return;
} }
/* We can use the window pointer as a LocInfo pointer because it starts /* We can use the window pointer as a LocInfo pointer because it starts
* with a grafPort structure, which in turn starts with a LocInfo structure. * with a grafPort structure, which in turn starts with a LocInfo structure.
@ -71,5 +71,5 @@ void DoCopyRect (void) {
displayInProgress = FALSE; displayInProgress = FALSE;
NextRect(); /* Prepare for next rect */ NextRect(); /* Prepare for next rect */
} }

View File

@ -46,7 +46,7 @@ void DoDesktopSize (void) {
if ((fbWidth > 16384) || (fbHeight > 16384)) { if ((fbWidth > 16384) || (fbHeight > 16384)) {
AlertWindow(awResource, NULL, screenTooBigError); AlertWindow(awResource, NULL, screenTooBigError);
DoClose(vncWindow); DoClose(vncWindow);
} }
oldWinHeight = winHeight; oldWinHeight = winHeight;
oldWinWidth = winWidth; oldWinWidth = winWidth;
@ -67,11 +67,11 @@ void DoDesktopSize (void) {
if (contentOriginPtr->h + winWidth > fbWidth) { if (contentOriginPtr->h + winWidth > fbWidth) {
newX = fbWidth - winWidth; newX = fbWidth - winWidth;
changeOrigin = TRUE; changeOrigin = TRUE;
} }
if (contentOriginPtr->v + winHeight > fbHeight) { if (contentOriginPtr->v + winHeight > fbHeight) {
newY = fbHeight - winHeight; newY = fbHeight - winHeight;
changeOrigin = TRUE; changeOrigin = TRUE;
} }
SetContentOrigin2(1, newX, newY, vncWindow); SetContentOrigin2(1, newX, newY, vncWindow);
SetDataSize(fbWidth, fbHeight, vncWindow); SetDataSize(fbWidth, fbHeight, vncWindow);
@ -80,5 +80,5 @@ void DoDesktopSize (void) {
displayInProgress = FALSE; displayInProgress = FALSE;
NextRect(); /* Prepare for next rect */ NextRect(); /* Prepare for next rect */
} }

View File

@ -56,16 +56,16 @@ void HexNextTile (void) {
displayInProgress = FALSE; displayInProgress = FALSE;
NextRect(); NextRect();
return; return;
} }
hexXTileNum = 0; hexXTileNum = 0;
} }
hexTileWidth = (hexXTileNum == hexXTiles - 1) ? hexTileWidth = (hexXTileNum == hexXTiles - 1) ?
rectWidth - 16 * (hexXTiles - 1) : 16; rectWidth - 16 * (hexXTiles - 1) : 16;
hexTileHeight = (hexYTileNum == hexYTiles - 1) ? hexTileHeight = (hexYTileNum == hexYTiles - 1) ?
rectHeight - 16 * (hexYTiles - 1) : 16; rectHeight - 16 * (hexYTiles - 1) : 16;
} }
void HexRawDraw (Point *contentOriginPtr, int rectWidth, int rectHeight) { void HexRawDraw (Point *contentOriginPtr, int rectWidth, int rectHeight) {
unsigned int i, j; /* Loop indices */ unsigned int i, j; /* Loop indices */
@ -106,8 +106,8 @@ void HexRawDraw (Point *contentOriginPtr, int rectWidth, int rectHeight) {
(unsigned long) j*rectWidth + i) (unsigned long) j*rectWidth + i)
] & 0x03; ] & 0x03;
n++; n++;
} /* switch */ } /* switch */
} /* if */ } /* if */
else { /* 320 mode */ else { /* 320 mode */
switch(i & 0x01) { switch(i & 0x01) {
case 0x00: /* pixels 0, 2, 4, ... */ case 0x00: /* pixels 0, 2, 4, ... */
@ -120,16 +120,16 @@ void HexRawDraw (Point *contentOriginPtr, int rectWidth, int rectHeight) {
(unsigned long) j*rectWidth + i) (unsigned long) j*rectWidth + i)
] & 0x0F; ] & 0x0F;
n++; n++;
} /* switch */ } /* switch */
} /* else */ } /* else */
} /* i loop */ } /* i loop */
/* When not ending a line on a byte boundary, the index isn't updated, /* When not ending a line on a byte boundary, the index isn't updated,
* so we do it here. * so we do it here.
*/ */
if (extraByteAdvance) if (extraByteAdvance)
n++; n++;
} /* j loop */ } /* j loop */
srcLocInfo.ptrToPixImage = (void *) pixels; srcLocInfo.ptrToPixImage = (void *) pixels;
srcLocInfo.boundsRect.v2 = rectHeight; srcLocInfo.boundsRect.v2 = rectHeight;
@ -146,16 +146,16 @@ void HexRawDraw (Point *contentOriginPtr, int rectWidth, int rectHeight) {
srcLocInfo.width = rectWidth/4 + 1; break; srcLocInfo.width = rectWidth/4 + 1; break;
case 0x03: srcLocInfo.boundsRect.h2 = rectWidth+1; case 0x03: srcLocInfo.boundsRect.h2 = rectWidth+1;
srcLocInfo.width = rectWidth/4 + 1; srcLocInfo.width = rectWidth/4 + 1;
}
} }
}
else { /* hRez == 320 */ else { /* hRez == 320 */
switch (rectWidth & 0x01) { switch (rectWidth & 0x01) {
case 0x00: srcLocInfo.boundsRect.h2 = rectWidth; case 0x00: srcLocInfo.boundsRect.h2 = rectWidth;
srcLocInfo.width = rectWidth/2; break; srcLocInfo.width = rectWidth/2; break;
case 0x01: srcLocInfo.boundsRect.h2 = rectWidth+1; case 0x01: srcLocInfo.boundsRect.h2 = rectWidth+1;
srcLocInfo.width = rectWidth/2 + 1; srcLocInfo.width = rectWidth/2 + 1;
} }
} }
srcRect.v2 = hexTileHeight; srcRect.v2 = hexTileHeight;
srcRect.h2 = hexTileWidth; srcRect.h2 = hexTileWidth;
@ -173,7 +173,7 @@ void HexRawDraw (Point *contentOriginPtr, int rectWidth, int rectHeight) {
status = hexWaitingForSubencoding; \ status = hexWaitingForSubencoding; \
bytesNeeded = 1; \ bytesNeeded = 1; \
return; \ return; \
} while (0) } while (0)
#define HexDispatch_DrawRect(color, X, Y, width, height) do { \ #define HexDispatch_DrawRect(color, X, Y, width, height) do { \
SetSolidPenPat((color)); \ SetSolidPenPat((color)); \
@ -182,7 +182,7 @@ void HexRawDraw (Point *contentOriginPtr, int rectWidth, int rectHeight) {
drawingRect.h2 = rectX + hexXTileNum * 16 + (X) + (width) - contentOriginPtr->h; \ drawingRect.h2 = rectX + hexXTileNum * 16 + (X) + (width) - contentOriginPtr->h; \
drawingRect.v2 = rectY + hexYTileNum * 16 + (Y) + (height) - contentOriginPtr->v; \ drawingRect.v2 = rectY + hexYTileNum * 16 + (Y) + (height) - contentOriginPtr->v; \
PaintRect(&drawingRect); \ PaintRect(&drawingRect); \
} while (0) } while (0)
#define HexDispatch_DrawBackground() \ #define HexDispatch_DrawBackground() \
HexDispatch_DrawRect(hexBackground, 0, 0, hexTileWidth, hexTileHeight) HexDispatch_DrawRect(hexBackground, 0, 0, hexTileWidth, hexTileHeight)
@ -216,7 +216,7 @@ void HexDispatch (void) {
if (subencoding & Raw) { if (subencoding & Raw) {
bytesNeeded = hexTileWidth * hexTileHeight; bytesNeeded = hexTileWidth * hexTileHeight;
status = hexWaitingForRawData; status = hexWaitingForRawData;
} }
else { else {
bytesNeeded = 0; bytesNeeded = 0;
if (subencoding & BackgroundSpecified) if (subencoding & BackgroundSpecified)
@ -229,9 +229,9 @@ void HexDispatch (void) {
/* No more data - just draw background */ /* No more data - just draw background */
HexDispatch_DrawBackground(); HexDispatch_DrawBackground();
HexDispatch_NextTile(); HexDispatch_NextTile();
}
status = hexWaitingForMoreInfo;
} }
status = hexWaitingForMoreInfo;
}
break; break;
case hexWaitingForRawData: case hexWaitingForRawData:
@ -242,43 +242,43 @@ void HexDispatch (void) {
case hexWaitingForMoreInfo: case hexWaitingForMoreInfo:
if (subencoding & BackgroundSpecified) { if (subencoding & BackgroundSpecified) {
hexBackground = pixTransTbl[*(dataPtr++)]; hexBackground = pixTransTbl[*(dataPtr++)];
} }
if (subencoding & ForegroundSpecified) { if (subencoding & ForegroundSpecified) {
hexForeground = pixTransTbl[*(dataPtr++)]; hexForeground = pixTransTbl[*(dataPtr++)];
} }
if (subencoding & AnySubrects) { if (subencoding & AnySubrects) {
numSubrects = *dataPtr; numSubrects = *dataPtr;
if (numSubrects) { if (numSubrects) {
status = hexWaitingForSubrect; status = hexWaitingForSubrect;
bytesNeeded = numSubrects * ((subencoding & SubrectsColoured) ? 3 : 2); bytesNeeded = numSubrects * ((subencoding & SubrectsColoured) ? 3 : 2);
break; break;
} }
else else
HexDispatch_NextTile(); HexDispatch_NextTile();
} }
else { /* no subrects */ else { /* no subrects */
HexDispatch_DrawBackground(); HexDispatch_DrawBackground();
HexDispatch_NextTile(); HexDispatch_NextTile();
} }
case hexWaitingForSubrect: { case hexWaitingForSubrect: {
HexDispatch_DrawBackground(); HexDispatch_DrawBackground();
while (numSubrects-- > 0) { while (numSubrects-- > 0) {
if (subencoding & SubrectsColoured) { if (subencoding & SubrectsColoured) {
hexForeground = pixTransTbl[*(dataPtr++)]; hexForeground = pixTransTbl[*(dataPtr++)];
} }
srX = *dataPtr >> 4; srX = *dataPtr >> 4;
srY = *(dataPtr++) & 0x0F; srY = *(dataPtr++) & 0x0F;
srWidth = (*dataPtr >> 4) + 1; srWidth = (*dataPtr >> 4) + 1;
srHeight = (*(dataPtr++) & 0x0F) + 1; srHeight = (*(dataPtr++) & 0x0F) + 1;
HexDispatch_DrawRect(hexForeground, srX, srY, srWidth, srHeight); HexDispatch_DrawRect(hexForeground, srX, srY, srWidth, srHeight);
}
HexDispatch_NextTile();
} }
HexDispatch_NextTile();
} }
HUnlock(readBufferHndl);
} }
HUnlock(readBufferHndl);
} }
}
/* Called when we initially get a Hextile rect; set up to process it */ /* Called when we initially get a Hextile rect; set up to process it */
void DoHextileRect (void) { void DoHextileRect (void) {
@ -298,4 +298,4 @@ void DoHextileRect (void) {
/* Set up for Hextile drawing */ /* Set up for Hextile drawing */
srcRect.v1 = 0; srcRect.v1 = 0;
srcRect.h1 = 0; srcRect.h1 = 0;
} }

View File

@ -38,10 +38,10 @@ void SendKeyEvent (BOOLEAN keyDownFlag, unsigned long key)
unsigned char keyDownFlag; unsigned char keyDownFlag;
unsigned int padding; unsigned int padding;
unsigned long key; unsigned long key;
} keyEvent = { 4 /* Message Type 4 */, } keyEvent = { 4 /* Message Type 4 */,
0, 0,
0 /* Zero the padding */ 0 /* Zero the padding */
}; };
keyEvent.keyDownFlag = !!keyDownFlag; keyEvent.keyDownFlag = !!keyDownFlag;
keyEvent.key = SwapBytes4(key); keyEvent.key = SwapBytes4(key);
@ -83,8 +83,8 @@ void ProcessKeyEvent (void)
case 0x77: key = 0xFF57; break; /* End */ case 0x77: key = 0xFF57; break; /* End */
case 0x74: key = 0xFF55; break; /* Page Up */ case 0x74: key = 0xFF55; break; /* Page Up */
case 0x79: key = 0xFF56; break; /* Page Down */ case 0x79: key = 0xFF56; break; /* Page Down */
}
} }
}
if (key == 0x7f) if (key == 0x7f)
key = 0xFF08; /* Delete -> BackSpace */ key = 0xFF08; /* Delete -> BackSpace */
@ -98,7 +98,7 @@ void ProcessKeyEvent (void)
key += 0x40; /* Undo effect of control on upper-case char. */ key += 0x40; /* Undo effect of control on upper-case char. */
else else
key += 0x60; /* Undo effect of control */ key += 0x60; /* Undo effect of control */
} }
else switch (key) { else switch (key) {
case 0x1B: key = 0xFF1B; break; /* Escape */ case 0x1B: key = 0xFF1B; break; /* Escape */
case 0x09: key = 0xFF09; break; /* Tab */ case 0x09: key = 0xFF09; break; /* Tab */
@ -108,8 +108,8 @@ void ProcessKeyEvent (void)
case 0x15: key = 0xFF53; break; /* Right arrow */ case 0x15: key = 0xFF53; break; /* Right arrow */
case 0x0A: key = 0xFF54; break; /* Down arrow */ case 0x0A: key = 0xFF54; break; /* Down arrow */
case 0x18: key = 0xFF0B; break; /* Clear / NumLock -> Clear */ case 0x18: key = 0xFF0B; break; /* Clear / NumLock -> Clear */
}
} }
}
/* Test if we seem to have a valid character and return if we don't. /* Test if we seem to have a valid character and return if we don't.
This should never return, unless there are bugs in this routine or This should never return, unless there are bugs in this routine or

View File

@ -39,7 +39,7 @@ void DoPointerEvent (void) {
unsigned char buttonMask; unsigned char buttonMask;
unsigned int xPos; unsigned int xPos;
unsigned int yPos; unsigned int yPos;
} pointerEventStruct = { 5 /* message type */ }; } pointerEventStruct = { 5 /* message type */ };
Point mouseCoords; Point mouseCoords;
unsigned long contentOrigin; unsigned long contentOrigin;
@ -65,7 +65,7 @@ void DoPointerEvent (void) {
if (cursor && GetCursorAdr() == cursor) if (cursor && GetCursorAdr() == cursor)
InitCursor(); InitCursor();
return; return;
} }
GlobalToLocal(&mouseCoords); GlobalToLocal(&mouseCoords);
@ -85,17 +85,17 @@ void DoPointerEvent (void) {
if (myEvent.modifiers & optionKey) { if (myEvent.modifiers & optionKey) {
pointerEventStruct.buttonMask = 0x02; pointerEventStruct.buttonMask = 0x02;
key1 = 0xFFE9; key1 = 0xFFE9;
} }
if (myEvent.modifiers & appleKey) { if (myEvent.modifiers & appleKey) {
pointerEventStruct.buttonMask |= 0x04; pointerEventStruct.buttonMask |= 0x04;
key2 = 0xFFE7; key2 = 0xFFE7;
}
} }
}
/* If no modifiers, just send a normal left click. */ /* If no modifiers, just send a normal left click. */
if (pointerEventStruct.buttonMask == 0x00) if (pointerEventStruct.buttonMask == 0x00)
pointerEventStruct.buttonMask = 0x01; pointerEventStruct.buttonMask = 0x01;
} }
if ((myEvent.modifiers & btn1State) == 0x00) /* If 2nd (right) */ if ((myEvent.modifiers & btn1State) == 0x00) /* If 2nd (right) */
pointerEventStruct.buttonMask |= 0x04; /* button is pressed */ pointerEventStruct.buttonMask |= 0x04; /* button is pressed */
@ -217,7 +217,7 @@ void DoCursor (void) {
((bitmaskByte & 0x01) << 27) + ((bitmaskByte & 0x01) << 26) + ((bitmaskByte & 0x01) << 27) + ((bitmaskByte & 0x01) << 26) +
((bitmaskByte & 0x01) << 25) + ((bitmaskByte & 0x01) << 24); ((bitmaskByte & 0x01) << 25) + ((bitmaskByte & 0x01) << 24);
*((unsigned long *)maskLine + j) = outBytes320; *((unsigned long *)maskLine + j) = outBytes320;
} }
*((unsigned int *)maskLine + lineWords - 1) = 0; *((unsigned int *)maskLine + lineWords - 1) = 0;
for (n = 0; n < rectWidth/2; n++) { for (n = 0; n < rectWidth/2; n++) {
@ -225,17 +225,17 @@ void DoCursor (void) {
*(imageLine + n) += coltab320[*(dataPtr++)] & 0x0F; *(imageLine + n) += coltab320[*(dataPtr++)] & 0x0F;
*(imageLine + n) ^= 0xFF; /* Reverse color */ *(imageLine + n) ^= 0xFF; /* Reverse color */
*(imageLine + n) &= *(maskLine + n); *(imageLine + n) &= *(maskLine + n);
} }
if (rectWidth % 2) { if (rectWidth % 2) {
*(imageLine + n) = coltab320[*(dataPtr++)] & 0xF0; *(imageLine + n) = coltab320[*(dataPtr++)] & 0xF0;
*(imageLine + n) ^= 0xFF; /* Reverse color */ *(imageLine + n) ^= 0xFF; /* Reverse color */
*(imageLine + n) &= *(maskLine + n); *(imageLine + n) &= *(maskLine + n);
n++; n++;
} }
*(imageLine + n) = 0; *(imageLine + n) = 0;
*((unsigned int *)imageLine + lineWords - 1) = 0; *((unsigned int *)imageLine + lineWords - 1) = 0;
}
} }
}
else { /* hRez == 640 */ else { /* hRez == 640 */
for (line = 0; line < rectHeight; line++) { /* for each line ... */ for (line = 0; line < rectHeight; line++) { /* for each line ... */
maskLine = cursorMask + line * lineWords * 2; maskLine = cursorMask + line * lineWords * 2;
@ -250,7 +250,7 @@ void DoCursor (void) {
((bitmaskByte & 0x0C) << 11) + ((bitmaskByte & 0x06) << 10) + ((bitmaskByte & 0x0C) << 11) + ((bitmaskByte & 0x06) << 10) +
((bitmaskByte & 0x03) << 9) + ((bitmaskByte & 0x01) << 8); ((bitmaskByte & 0x03) << 9) + ((bitmaskByte & 0x01) << 8);
*((unsigned int *)maskLine + j) = outBytes640; *((unsigned int *)maskLine + j) = outBytes640;
} }
*((unsigned int *)maskLine + lineWords - 1) = 0; *((unsigned int *)maskLine + lineWords - 1) = 0;
for (n = 0; n < lineWords * 2 - 4; n++) { for (n = 0; n < lineWords * 2 - 4; n++) {
@ -260,7 +260,7 @@ void DoCursor (void) {
*(imageLine + n) += coltab640[*(dataPtr++)] & 0x03; *(imageLine + n) += coltab640[*(dataPtr++)] & 0x03;
*(imageLine + n) ^= 0xFF; /* Reverse color */ *(imageLine + n) ^= 0xFF; /* Reverse color */
*(imageLine + n) &= *(maskLine + n); *(imageLine + n) &= *(maskLine + n);
} }
*(imageLine + n) = 0; *(imageLine + n) = 0;
j = cursorPixels + rectWidth * (line + 1) - dataPtr; j = cursorPixels + rectWidth * (line + 1) - dataPtr;
if (j-- > 0) { if (j-- > 0) {
@ -271,15 +271,15 @@ void DoCursor (void) {
*(imageLine + n) += coltab640[*(dataPtr++)] & 0x0C; *(imageLine + n) += coltab640[*(dataPtr++)] & 0x0C;
if (j-- > 0) { if (j-- > 0) {
*(imageLine + n) += coltab640[*(dataPtr++)] & 0x03; *(imageLine + n) += coltab640[*(dataPtr++)] & 0x03;
}
} }
} }
} }
}
*(imageLine + n) ^= 0xFF; /* Reverse color */ *(imageLine + n) ^= 0xFF; /* Reverse color */
*(imageLine + n) &= *(maskLine + n); *(imageLine + n) &= *(maskLine + n);
*(unsigned int *)(imageLine + n + 1) = 0; *(unsigned int *)(imageLine + n + 1) = 0;
}
} }
}
HUnlock(readBufferHndl); HUnlock(readBufferHndl);
@ -302,20 +302,20 @@ void DoCursor (void) {
fprintf(foo, "%02X", *(cursorImage + j)); fprintf(foo, "%02X", *(cursorImage + j));
if ((j+1) % (lineWords * 2) == 0) if ((j+1) % (lineWords * 2) == 0)
fprintf(foo, "\n"); fprintf(foo, "\n");
} }
for (k = cursorImage + j; k < cursorImage + j + 4; k = k + 1) for (k = cursorImage + j; k < cursorImage + j + 4; k = k + 1)
fprintf(foo, "%02X ", *k); fprintf(foo, "%02X ", *k);
//for (j = 0; j < bitmaskLineBytes*rectHeight; j++) { //for (j = 0; j < bitmaskLineBytes*rectHeight; j++) {
// fprintf(foo, "%02X", *(bitmask + j)); // fprintf(foo, "%02X", *(bitmask + j));
// if ((j+1) % bitmaskLineBytes == 0) // if ((j+1) % bitmaskLineBytes == 0)
// fprintf(foo, "\n"); // fprintf(foo, "\n");
// } //}
fprintf(foo, "\n"); fprintf(foo, "\n");
fclose(foo); fclose(foo);
} }
/***************/ /***************/
#endif #endif
displayInProgress = FALSE; displayInProgress = FALSE;
NextRect(); /* Prepare for next rect */ NextRect(); /* Prepare for next rect */
} }

66
raw.cc
View File

@ -83,7 +83,7 @@ void RawDraw (void) {
if (!RectInRgn(&drawingRect, GetVisHandle())) { if (!RectInRgn(&drawingRect, GetVisHandle())) {
StopRawDrawing(); StopRawDrawing();
return; return;
} }
else if (rectY + drawingLine < contentOriginPtr->v) { else if (rectY + drawingLine < contentOriginPtr->v) {
destPtr += (unsigned long)lineBytes * destPtr += (unsigned long)lineBytes *
(contentOriginPtr->v - rectY - drawingLine); (contentOriginPtr->v - rectY - drawingLine);
@ -92,13 +92,13 @@ void RawDraw (void) {
if (drawingLine >= rectHeight) { /* Sanity check */ if (drawingLine >= rectHeight) { /* Sanity check */
StopRawDrawing(); StopRawDrawing();
return; return;
}
} }
}
else if (rectY + rectHeight - 1 > contentOriginPtr->v + winHeight) else if (rectY + rectHeight - 1 > contentOriginPtr->v + winHeight)
rectHeight = contentOriginPtr->v + winHeight - rectY + 1; rectHeight = contentOriginPtr->v + winHeight - rectY + 1;
checkBounds = FALSE; checkBounds = FALSE;
} }
lineDataPtr = dataPtr + (unsigned long) drawingLine * rectWidth; lineDataPtr = dataPtr + (unsigned long) drawingLine * rectWidth;
@ -132,12 +132,12 @@ void RawDraw (void) {
*(destPtr++) = bigcoltab640a[*(unsigned int*)(void*)lineDataPtr] *(destPtr++) = bigcoltab640a[*(unsigned int*)(void*)lineDataPtr]
+ bigcoltab640b[*(unsigned int*)(void*)(lineDataPtr+2)]; + bigcoltab640b[*(unsigned int*)(void*)(lineDataPtr+2)];
lineDataPtr += 4; lineDataPtr += 4;
} }
while (destPtr < finalDestPtr) { while (destPtr < finalDestPtr) {
*(destPtr++) = bigcoltab640a[*(unsigned int*)(void*)lineDataPtr] *(destPtr++) = bigcoltab640a[*(unsigned int*)(void*)lineDataPtr]
+ bigcoltab640b[*(unsigned int*)(void*)(lineDataPtr+2)]; + bigcoltab640b[*(unsigned int*)(void*)(lineDataPtr+2)];
lineDataPtr += 4; lineDataPtr += 4;
} }
/* Final byte to produce */ /* Final byte to produce */
*destPtr = pixTransTbl[*(lineDataPtr++)] & 0xC0; *destPtr = pixTransTbl[*(lineDataPtr++)] & 0xC0;
for (i = lineDataPtr - initialLineDataPtr; i < rectWidth; i++) for (i = lineDataPtr - initialLineDataPtr; i < rectWidth; i++)
@ -150,9 +150,9 @@ void RawDraw (void) {
break; break;
case 0x03: /* pixels 3, 7, 11, ... */ case 0x03: /* pixels 3, 7, 11, ... */
*destPtr += pixTransTbl[*(lineDataPtr++)] & 0x03; *destPtr += pixTransTbl[*(lineDataPtr++)] & 0x03;
} }
destPtr++; destPtr++;
} }
else { /* 320 mode */ else { /* 320 mode */
while (destPtr + 7 < finalDestPtr) { /* Unrolled loop */ while (destPtr + 7 < finalDestPtr) { /* Unrolled loop */
*(destPtr++) = bigcoltab320[*(unsigned int*)(void*)lineDataPtr]; *(destPtr++) = bigcoltab320[*(unsigned int*)(void*)lineDataPtr];
@ -171,18 +171,18 @@ void RawDraw (void) {
lineDataPtr += 2; lineDataPtr += 2;
*(destPtr++) = bigcoltab320[*(unsigned int*)(void*)lineDataPtr]; *(destPtr++) = bigcoltab320[*(unsigned int*)(void*)lineDataPtr];
lineDataPtr += 2; lineDataPtr += 2;
} }
while (destPtr < finalDestPtr) { while (destPtr < finalDestPtr) {
*(destPtr++) = bigcoltab320[*(unsigned int*)(void*)lineDataPtr]; *(destPtr++) = bigcoltab320[*(unsigned int*)(void*)lineDataPtr];
lineDataPtr += 2; lineDataPtr += 2;
} }
/* Final byte to produce */ /* Final byte to produce */
*destPtr = pixTransTbl[*(lineDataPtr++)] & 0xF0; *destPtr = pixTransTbl[*(lineDataPtr++)] & 0xF0;
if (extraByteAdvance) if (extraByteAdvance)
destPtr++; /* Not ending on byte boundary - update index */ destPtr++; /* Not ending on byte boundary - update index */
else else
*(destPtr++) += pixTransTbl[*(lineDataPtr++)] & 0x0F; *(destPtr++) += pixTransTbl[*(lineDataPtr++)] & 0x0F;
} }
drawingLine++; drawingLine++;
@ -192,7 +192,7 @@ void RawDraw (void) {
PPToPort(&srcLocInfo, &srcRect, rectX - contentOriginPtr->h, PPToPort(&srcLocInfo, &srcRect, rectX - contentOriginPtr->h,
rectY + srcRect.v1 - contentOriginPtr->v, modeCopy); rectY + srcRect.v1 - contentOriginPtr->v, modeCopy);
srcRect.v1 = drawingLine; srcRect.v1 = drawingLine;
} }
/* Check whether we're done with this rectangle */ /* Check whether we're done with this rectangle */
if (drawingLine >= rectHeight) { if (drawingLine >= rectHeight) {
@ -202,10 +202,10 @@ void RawDraw (void) {
contentOrigin = GetContentOrigin(vncWindow); contentOrigin = GetContentOrigin(vncWindow);
PPToPort(&srcLocInfo, &srcRect, rectX - contentOriginPtr->h, PPToPort(&srcLocInfo, &srcRect, rectX - contentOriginPtr->h,
rectY + srcRect.v1 - contentOriginPtr->v, modeCopy); rectY + srcRect.v1 - contentOriginPtr->v, modeCopy);
} }
StopRawDrawing(); StopRawDrawing();
return; return;
} }
/* Check if there are actually any events that need to be processed. /* Check if there are actually any events that need to be processed.
* If not, save time by not going through the whole event loop, but * If not, save time by not going through the whole event loop, but
@ -218,7 +218,7 @@ void RawDraw (void) {
SystemTask(); /* Let periodic Desk Accesories do their things */ SystemTask(); /* Let periodic Desk Accesories do their things */
TCPIPPoll(); /* Let Marinetti keep processing data */ TCPIPPoll(); /* Let Marinetti keep processing data */
} while (1); } while (1);
} }
#pragma optimize -1 #pragma optimize -1
@ -235,19 +235,19 @@ void RawDrawLine (void) {
lineBytes = rectWidth/4 + 1; lineBytes = rectWidth/4 + 1;
else /* Width is a multiple of 4 */ else /* Width is a multiple of 4 */
lineBytes = rectWidth/4; lineBytes = rectWidth/4;
} }
else { /* 320 mode */ else { /* 320 mode */
if (rectWidth & 0x01) /* Width not an exact multiple of 2 */ if (rectWidth & 0x01) /* Width not an exact multiple of 2 */
lineBytes = rectWidth/2 + 1; lineBytes = rectWidth/2 + 1;
else /* Width is a multiple of 2 */ else /* Width is a multiple of 2 */
lineBytes = rectWidth/2; lineBytes = rectWidth/2;
} }
destPtr = calloc(lineBytes, 1); destPtr = calloc(lineBytes, 1);
if (!destPtr) { /* Couldn't allocate memory */ if (!destPtr) { /* Couldn't allocate memory */
DoClose(vncWindow); DoClose(vncWindow);
return; return;
} }
srcLocInfo.ptrToPixImage = destPtr; srcLocInfo.ptrToPixImage = destPtr;
srcLocInfo.width = lineBytes; srcLocInfo.width = lineBytes;
@ -261,14 +261,14 @@ void RawDrawLine (void) {
case 0x01: srcLocInfo.boundsRect.h2 = rectWidth+3; break; case 0x01: srcLocInfo.boundsRect.h2 = rectWidth+3; break;
case 0x02: srcLocInfo.boundsRect.h2 = rectWidth+2; break; case 0x02: srcLocInfo.boundsRect.h2 = rectWidth+2; break;
case 0x03: srcLocInfo.boundsRect.h2 = rectWidth+1; case 0x03: srcLocInfo.boundsRect.h2 = rectWidth+1;
}
} }
}
else { else {
switch (rectWidth & 0x01) { switch (rectWidth & 0x01) {
case 0x00: srcLocInfo.boundsRect.h2 = rectWidth; break; case 0x00: srcLocInfo.boundsRect.h2 = rectWidth; break;
case 0x01: srcLocInfo.boundsRect.h2 = rectWidth+1; case 0x01: srcLocInfo.boundsRect.h2 = rectWidth+1;
} }
} }
/* Don't include padding in the area we will actually copy over */ /* Don't include padding in the area we will actually copy over */
srcRect.h2 = rectWidth; srcRect.h2 = rectWidth;
@ -293,16 +293,16 @@ void RawDrawLine (void) {
break; break;
case 0x03: /* pixels 3, 7, 11, ... */ case 0x03: /* pixels 3, 7, 11, ... */
*(destPtr++) += pixTransTbl[dataPtr[i++]] & 0x03; *(destPtr++) += pixTransTbl[dataPtr[i++]] & 0x03;
}
} }
}
else /* 320 mode */ else /* 320 mode */
for (i = 0; i < rectWidth; /* i is incremented in loop */) { for (i = 0; i < rectWidth; /* i is incremented in loop */) {
if ((i & 0x01) == 0) /* pixels 0, 2, 4, ... */ if ((i & 0x01) == 0) /* pixels 0, 2, 4, ... */
*destPtr = pixTransTbl[dataPtr[i++]] & 0xF0; *destPtr = pixTransTbl[dataPtr[i++]] & 0xF0;
else { /* pixels 1, 3, 5, ... */ else { /* pixels 1, 3, 5, ... */
*(destPtr++) += pixTransTbl[dataPtr[i++]] & 0x0F; *(destPtr++) += pixTransTbl[dataPtr[i++]] & 0x0F;
}
} }
}
HUnlock(readBufferHndl); HUnlock(readBufferHndl);
contentOrigin = GetContentOrigin(vncWindow); contentOrigin = GetContentOrigin(vncWindow);
@ -314,7 +314,7 @@ void RawDrawLine (void) {
rectHeight--; /* One less line left to draw */ rectHeight--; /* One less line left to draw */
rectY++; /* Rest of rect starts one line below this */ rectY++; /* Rest of rect starts one line below this */
} }
/* Process rectangle data in raw encoding and write it to screen. /* Process rectangle data in raw encoding and write it to screen.
*/ */
@ -332,7 +332,7 @@ void DoRawRect (void) {
if (useHextile && rectHeight > 1 && DoReadTCP ((unsigned long) rectWidth)) if (useHextile && rectHeight > 1 && DoReadTCP ((unsigned long) rectWidth))
RawDrawLine(); /* Some data ready - draw first line */ RawDrawLine(); /* Some data ready - draw first line */
return; /* Not ready yet; wait */ return; /* Not ready yet; wait */
} }
/* Here if data is ready to be processed */ /* Here if data is ready to be processed */
@ -340,29 +340,29 @@ void DoRawRect (void) {
if (rectWidth & 0x03) { /* Width not an exact multiple of 4 */ if (rectWidth & 0x03) { /* Width not an exact multiple of 4 */
lineBytes = rectWidth/4 + 1; lineBytes = rectWidth/4 + 1;
extraByteAdvance = TRUE; extraByteAdvance = TRUE;
} }
else { /* Width is a multiple of 4 */ else { /* Width is a multiple of 4 */
lineBytes = rectWidth/4; lineBytes = rectWidth/4;
extraByteAdvance = FALSE; extraByteAdvance = FALSE;
}
} }
}
else { /* 320 mode */ else { /* 320 mode */
if (rectWidth & 0x01) { /* Width not an exact multiple of 2 */ if (rectWidth & 0x01) { /* Width not an exact multiple of 2 */
lineBytes = rectWidth/2 + 1; lineBytes = rectWidth/2 + 1;
extraByteAdvance = TRUE; extraByteAdvance = TRUE;
} }
else { /* Width is a multiple of 2 */ else { /* Width is a multiple of 2 */
lineBytes = rectWidth/2; lineBytes = rectWidth/2;
extraByteAdvance = FALSE; extraByteAdvance = FALSE;
}
} }
}
bufferLength = lineBytes * rectHeight; bufferLength = lineBytes * rectHeight;
destPtr = calloc(bufferLength, 1); destPtr = calloc(bufferLength, 1);
if (!destPtr) { /* Couldn't allocate memory */ if (!destPtr) { /* Couldn't allocate memory */
DoClose(vncWindow); DoClose(vncWindow);
return; return;
} }
srcLocInfo.ptrToPixImage = destPtr; srcLocInfo.ptrToPixImage = destPtr;
srcLocInfo.width = lineBytes; srcLocInfo.width = lineBytes;
@ -376,14 +376,14 @@ void DoRawRect (void) {
case 0x01: srcLocInfo.boundsRect.h2 = rectWidth+3; break; case 0x01: srcLocInfo.boundsRect.h2 = rectWidth+3; break;
case 0x02: srcLocInfo.boundsRect.h2 = rectWidth+2; break; case 0x02: srcLocInfo.boundsRect.h2 = rectWidth+2; break;
case 0x03: srcLocInfo.boundsRect.h2 = rectWidth+1; case 0x03: srcLocInfo.boundsRect.h2 = rectWidth+1;
}
} }
}
else { else {
switch (rectWidth & 0x01) { switch (rectWidth & 0x01) {
case 0x00: srcLocInfo.boundsRect.h2 = rectWidth; break; case 0x00: srcLocInfo.boundsRect.h2 = rectWidth; break;
case 0x01: srcLocInfo.boundsRect.h2 = rectWidth+1; case 0x01: srcLocInfo.boundsRect.h2 = rectWidth+1;
} }
} }
/* Don't include padding in the area we will actually copy over */ /* Don't include padding in the area we will actually copy over */
srcRect.h2 = rectWidth; srcRect.h2 = rectWidth;
@ -393,4 +393,4 @@ void DoRawRect (void) {
drawingLine = 0; /* Drawing first line of rect */ drawingLine = 0; /* Drawing first line of rect */
checkBounds = TRUE; /* Flag to check bounds when drawing 1st line */ checkBounds = TRUE; /* Flag to check bounds when drawing 1st line */
HLock(readBufferHndl); /* Lock handle just once for efficiency */ HLock(readBufferHndl); /* Lock handle just once for efficiency */
} }

View File

@ -79,7 +79,7 @@ void VNCRedraw (void) {
(**updateRgnHndl).rgnBBox.v2 - (**updateRgnHndl).rgnBBox.v1); (**updateRgnHndl).rgnBBox.v2 - (**updateRgnHndl).rgnBBox.v1);
checkBounds = TRUE; checkBounds = TRUE;
} }
#pragma databank 0 #pragma databank 0
/* Change Super Hi-Res display to the specified resolution (640 or 320). /* Change Super Hi-Res display to the specified resolution (640 or 320).
@ -107,7 +107,7 @@ void ChangeResolution(int rez) {
if ( ( (masterSCB & 0x80) && (rez == 640)) || if ( ( (masterSCB & 0x80) && (rez == 640)) ||
(!(masterSCB & 0x80) && (rez == 320)) ) { (!(masterSCB & 0x80) && (rez == 320)) ) {
return; /* Already in right mode, so don't change things */ return; /* Already in right mode, so don't change things */
} }
/* Perform the basic procedure described in IIgs TN #4 */ /* Perform the basic procedure described in IIgs TN #4 */
CloseAllNDAs(); CloseAllNDAs();
@ -136,14 +136,14 @@ void ChangeResolution(int rez) {
MoveControl(25, 87, GetCtlHandleFromID(newConnWindow, txtGray)); MoveControl(25, 87, GetCtlHandleFromID(newConnWindow, txtGray));
MoveControl(134, 91, GetCtlHandleFromID(newConnWindow, txtTransfers)); MoveControl(134, 91, GetCtlHandleFromID(newConnWindow, txtTransfers));
MoveWindow(2, 42, newConnWindow); MoveWindow(2, 42, newConnWindow);
} }
else { else {
MoveControl(35, 64, GetCtlHandleFromID(newConnWindow, txtColor)); MoveControl(35, 64, GetCtlHandleFromID(newConnWindow, txtColor));
MoveControl(35, 87, GetCtlHandleFromID(newConnWindow, txtGray)); MoveControl(35, 87, GetCtlHandleFromID(newConnWindow, txtGray));
MoveControl(144, 91, GetCtlHandleFromID(newConnWindow, txtTransfers)); MoveControl(144, 91, GetCtlHandleFromID(newConnWindow, txtTransfers));
MoveWindow(162, 42, newConnWindow); MoveWindow(162, 42, newConnWindow);
}
} }
}
/* Display the VNC session window, first changing to the appropriate /* Display the VNC session window, first changing to the appropriate
* resolution (as specified by the user) if necessary. * resolution (as specified by the user) if necessary.
@ -162,11 +162,11 @@ void InitVNCWindow(void) {
if (fbWidth < winWidth) { if (fbWidth < winWidth) {
winWidth = fbWidth; winWidth = fbWidth;
resize = TRUE; resize = TRUE;
} }
if (fbHeight < winHeight) { if (fbHeight < winHeight) {
winHeight = fbHeight; winHeight = fbHeight;
resize = TRUE; resize = TRUE;
} }
if (resize) if (resize)
SizeWindow(winWidth, winHeight, vncWindow); SizeWindow(winWidth, winHeight, vncWindow);
@ -182,7 +182,7 @@ void InitVNCWindow(void) {
#undef wrNum320 #undef wrNum320
#undef wrNum640 #undef wrNum640
} }
/* Send a request to the VNC server to update the information for a portion of /* Send a request to the VNC server to update the information for a portion of
* the frame buffer. * the frame buffer.
@ -197,7 +197,7 @@ void SendFBUpdateRequest (BOOLEAN incremental, unsigned int x, unsigned int y,
unsigned int y; unsigned int y;
unsigned int width; unsigned int width;
unsigned int height; unsigned int height;
} fbUpdateRequest = {3 /* Message type 3 */}; } fbUpdateRequest = {3 /* Message type 3 */};
fbUpdateRequest.incremental = !!incremental; fbUpdateRequest.incremental = !!incremental;
fbUpdateRequest.x = SwapBytes2(x); fbUpdateRequest.x = SwapBytes2(x);
@ -208,7 +208,7 @@ void SendFBUpdateRequest (BOOLEAN incremental, unsigned int x, unsigned int y,
TCPIPWriteTCP(hostIpid, &fbUpdateRequest.messageType, TCPIPWriteTCP(hostIpid, &fbUpdateRequest.messageType,
sizeof(fbUpdateRequest), TRUE, FALSE); sizeof(fbUpdateRequest), TRUE, FALSE);
/* No error checking here -- Can't respond to one usefully. */ /* No error checking here -- Can't respond to one usefully. */
} }
/* Start responding to a FramebufferUpdate from the server /* Start responding to a FramebufferUpdate from the server
@ -220,7 +220,7 @@ void DoFBUpdate (void) {
DoClose(vncWindow); DoClose(vncWindow);
//printf("Closing in DoFBUpdate\n"); //printf("Closing in DoFBUpdate\n");
return; return;
} }
HLock(readBufferHndl); HLock(readBufferHndl);
dataPtr = (unsigned int *) (((char *) (*readBufferHndl)) + 1); dataPtr = (unsigned int *) (((char *) (*readBufferHndl)) + 1);
numRects = SwapBytes2(dataPtr[0]); /* Get data */ numRects = SwapBytes2(dataPtr[0]); /* Get data */
@ -230,7 +230,7 @@ void DoFBUpdate (void) {
rectHeight = SwapBytes2(dataPtr[4]); rectHeight = SwapBytes2(dataPtr[4]);
rectEncoding = SwapBytes4(*(unsigned long *)(dataPtr + 5)); rectEncoding = SwapBytes4(*(unsigned long *)(dataPtr + 5));
HUnlock(readBufferHndl); HUnlock(readBufferHndl);
} }
/* The server should never send a color map, since we don't use a mapped /* The server should never send a color map, since we don't use a mapped
* representation for pixel values. If a malfunctioning server tries to * representation for pixel values. If a malfunctioning server tries to
@ -249,8 +249,8 @@ void DoSetColourMapEntries (void) {
HUnlock(readBufferHndl); HUnlock(readBufferHndl);
for (; numColors > 0; numColors--) { for (; numColors > 0; numColors--) {
DoWaitingReadTCP(6); DoWaitingReadTCP(6);
}
} }
}
/* Here when we're done processing one rectangle and ready to start the next. /* Here when we're done processing one rectangle and ready to start the next.
@ -266,7 +266,7 @@ void NextRect (void) {
//printf("Closing in NextRect\n"); //printf("Closing in NextRect\n");
DoClose(vncWindow); DoClose(vncWindow);
return; return;
} }
HLock(readBufferHndl); HLock(readBufferHndl);
dataPtr = (unsigned int *) ((char *) (*readBufferHndl)); dataPtr = (unsigned int *) ((char *) (*readBufferHndl));
rectX = SwapBytes2(dataPtr[0]); rectX = SwapBytes2(dataPtr[0]);
@ -276,7 +276,7 @@ void NextRect (void) {
rectEncoding = SwapBytes4(*(unsigned long *)(dataPtr + 4)); rectEncoding = SwapBytes4(*(unsigned long *)(dataPtr + 4));
HUnlock(readBufferHndl); HUnlock(readBufferHndl);
//printf("New Rect: X = %u, Y = %u, Width = %u, Height = %u\n", rectX, rectY, rectWidth, rectHeight); //printf("New Rect: X = %u, Y = %u, Width = %u, Height = %u\n", rectX, rectY, rectWidth, rectHeight);
} }
else { /* No more rectangles from last update */ else { /* No more rectangles from last update */
unsigned long contentOrigin; unsigned long contentOrigin;
Point * contentOriginPtr = (void *) &contentOrigin; Point * contentOriginPtr = (void *) &contentOrigin;
@ -284,8 +284,8 @@ void NextRect (void) {
contentOrigin = GetContentOrigin(vncWindow); contentOrigin = GetContentOrigin(vncWindow);
SendFBUpdateRequest(TRUE, contentOriginPtr->h, contentOriginPtr->v, SendFBUpdateRequest(TRUE, contentOriginPtr->h, contentOriginPtr->v,
winWidth, winHeight); winWidth, winHeight);
} }
} }
void ConnectedEventLoop (void) { void ConnectedEventLoop (void) {
unsigned char messageType; unsigned char messageType;
@ -307,8 +307,8 @@ void ConnectedEventLoop (void) {
return; return;
default: DoClose(vncWindow); default: DoClose(vncWindow);
return; return;
}
} }
}
else if (numRects) { else if (numRects) {
switch (rectEncoding) { switch (rectEncoding) {
case encodingHextile: case encodingHextile:
@ -331,8 +331,8 @@ void ConnectedEventLoop (void) {
//printf("Closing due to bad rectangle encoding %lu\n", rectEncoding); //printf("Closing due to bad rectangle encoding %lu\n", rectEncoding);
//printf("rectX = %u, rectY = %u, rectWidth = %u, rectHeight = %u\n", rectX, rectY, rectWidth, rectHeight); //printf("rectX = %u, rectY = %u, rectWidth = %u, rectHeight = %u\n", rectX, rectY, rectWidth, rectHeight);
return; return;
}
} }
}
else if (DoReadTCP(1)) { /* Read message type byte */ else if (DoReadTCP(1)) { /* Read message type byte */
HLock(readBufferHndl); HLock(readBufferHndl);
messageType = ((unsigned char) **readBufferHndl); messageType = ((unsigned char) **readBufferHndl);
@ -351,8 +351,8 @@ void ConnectedEventLoop (void) {
FALSE); FALSE);
DoClose(vncWindow); DoClose(vncWindow);
return; return;
}
} }
} }
}

View File

@ -80,7 +80,7 @@ void DoConnect (void) {
MakeBigColorTables(65536); MakeBigColorTables(65536);
colorTablesComplete = TRUE; colorTablesComplete = TRUE;
CloseConnectStatusWindow(); CloseConnectStatusWindow();
} }
/* Get server & password */ /* Get server & password */
@ -92,13 +92,13 @@ void DoConnect (void) {
SysBeep(); SysBeep();
AlertWindow(awResource, NULL, noTCPIPConnectionError); AlertWindow(awResource, NULL, noTCPIPConnectionError);
return; return;
} }
if (GetIpid() == FALSE) { if (GetIpid() == FALSE) {
SysBeep(); SysBeep();
AlertWindow(awResource, NULL, badGetIpidError); AlertWindow(awResource, NULL, badGetIpidError);
return; return;
} }
if (DoVNCHandshaking() == FALSE) { if (DoVNCHandshaking() == FALSE) {
SetHandleSize(1,readBufferHndl); SetHandleSize(1,readBufferHndl);
@ -110,7 +110,7 @@ void DoConnect (void) {
else else
alerted = FALSE; alerted = FALSE;
return; return;
} }
if (FinishVNCHandshaking() == FALSE) { if (FinishVNCHandshaking() == FALSE) {
SetHandleSize(1,readBufferHndl); SetHandleSize(1,readBufferHndl);
CloseConnectStatusWindow(); CloseConnectStatusWindow();
@ -118,7 +118,7 @@ void DoConnect (void) {
AlertWindow(awResource, NULL, badOptionNegotiationError); AlertWindow(awResource, NULL, badOptionNegotiationError);
SysBeep(); SysBeep();
return; return;
} }
InitVNCWindow(); InitVNCWindow();
@ -131,7 +131,7 @@ void DoConnect (void) {
myEvent.wmTaskMask = 0x001D79FE; /* don't let TaskMaster process keys */ myEvent.wmTaskMask = 0x001D79FE; /* don't let TaskMaster process keys */
InitMenus(noKB); InitMenus(noKB);
vncConnected = TRUE; vncConnected = TRUE;
} }
/******************************************************************* /*******************************************************************
* DisplayConnectStatus - Display modal dialog with status information * DisplayConnectStatus - Display modal dialog with status information
@ -149,7 +149,7 @@ void DisplayConnectStatus(char *statusString, BOOLEAN cancelMessage) {
if (connectStatusWindowPtr == NULL) { if (connectStatusWindowPtr == NULL) {
connectStatusWindowPtr = NewWindow2(NULL, NULL, NULL, NULL, connectStatusWindowPtr = NewWindow2(NULL, NULL, NULL, NULL,
0x02, wrNum, rWindParam1); 0x02, wrNum, rWindParam1);
} }
if (connectStatusWindowPtr != NULL) { /* Only draw if window was */ if (connectStatusWindowPtr != NULL) { /* Only draw if window was */
if (GetMasterSCB() & 0x0080) /* If in 640 mode... */ if (GetMasterSCB() & 0x0080) /* If in 640 mode... */
@ -165,13 +165,13 @@ void DisplayConnectStatus(char *statusString, BOOLEAN cancelMessage) {
if (cancelMessage) { if (cancelMessage) {
MoveTo(bigRect.h1, 24); MoveTo(bigRect.h1, 24);
DrawStringWidth(0x0002, cancelStr, bigRect.h2 - bigRect.h1); DrawStringWidth(0x0002, cancelStr, bigRect.h2 - bigRect.h1);
}
SetPort(oldPort);
} }
SetPort(oldPort);
}
#undef wrNum #undef wrNum
#undef cancelStr #undef cancelStr
} }
/*********************************************************************** /***********************************************************************
* DisplayConnectStatusFromTool - Can be passed to Marinetti * DisplayConnectStatusFromTool - Can be passed to Marinetti
@ -180,7 +180,7 @@ void DisplayConnectStatus(char *statusString, BOOLEAN cancelMessage) {
#pragma toolparms 1 /* Use tool-style stack model */ #pragma toolparms 1 /* Use tool-style stack model */
void DisplayConnectStatusFromTool (char *statusString) { void DisplayConnectStatusFromTool (char *statusString) {
DisplayConnectStatus(statusString, TRUE); DisplayConnectStatus(statusString, TRUE);
} }
#pragma toolparms 0 /* Use ORCA stack model */ #pragma toolparms 0 /* Use ORCA stack model */
#pragma databank 0 /* Must restore data bank register on exit */ #pragma databank 0 /* Must restore data bank register on exit */
@ -191,8 +191,8 @@ void CloseConnectStatusWindow (void) {
if (connectStatusWindowPtr != NULL) { if (connectStatusWindowPtr != NULL) {
CloseWindow(connectStatusWindowPtr); CloseWindow(connectStatusWindowPtr);
connectStatusWindowPtr = NULL; connectStatusWindowPtr = NULL;
}
} }
}
/*********************************************************************** /***********************************************************************
* ConnectTCPIP - Try to establish a TCP/IP connection through Marinetti * ConnectTCPIP - Try to establish a TCP/IP connection through Marinetti
@ -208,7 +208,7 @@ BOOLEAN ConnectTCPIP (void)
connected = TRUE; connected = TRUE;
CloseConnectStatusWindow(); CloseConnectStatusWindow();
InitCursor(); InitCursor();
} }
else /* Already connected */ else /* Already connected */
return TRUE; return TRUE;
@ -242,7 +242,7 @@ BOOLEAN GetIpid (void)
if (vncServer[i] == ':') { if (vncServer[i] == ':') {
vncServer[0] = i - 1; vncServer[0] = i - 1;
vncServer[i] = 0; vncServer[i] = 0;
} }
/* If it's an IP address, then put it in the record */ /* If it's an IP address, then put it in the record */
if (TCPIPValidateIPString(vncServer)) if (TCPIPValidateIPString(vncServer))
@ -259,14 +259,14 @@ BOOLEAN GetIpid (void)
if (TickCount() >= initialTime + 15*60) if (TickCount() >= initialTime + 15*60)
break; break;
TCPIPPoll(); /* Call TCPIPPoll() so that */ TCPIPPoll(); /* Call TCPIPPoll() so that */
} /* Marinetti can process data */ } /* Marinetti can process data */
CloseConnectStatusWindow(); CloseConnectStatusWindow();
InitCursor(); InitCursor();
if (dnrInfo.DNRstatus == DNR_OK) if (dnrInfo.DNRstatus == DNR_OK)
hostInfo.cvtIPAddress == dnrInfo.DNRIPaddress; hostInfo.cvtIPAddress == dnrInfo.DNRIPaddress;
else else
return FALSE; return FALSE;
} }
hostIpid = TCPIPLogin(userid(), hostInfo.cvtIPAddress, (int) hostPort, hostIpid = TCPIPLogin(userid(), hostInfo.cvtIPAddress, (int) hostPort,
0x0010 /* minimize latency */, 0x0010 /* minimize latency */,
@ -281,7 +281,7 @@ BOOLEAN GetIpid (void)
return FALSE; return FALSE;
#undef baseDisplayNum #undef baseDisplayNum
} }
/* Read data, waiting for up to 15 seconds for the data to be ready */ /* Read data, waiting for up to 15 seconds for the data to be ready */
@ -292,10 +292,10 @@ BOOLEAN DoWaitingReadTCP(unsigned long dataLength) {
stopTime = TickCount() + 15 * 60; stopTime = TickCount() + 15 * 60;
do { do {
result = DoReadTCP(dataLength); result = DoReadTCP(dataLength);
} while (result == FALSE && TickCount() < stopTime); } while (result == FALSE && TickCount() < stopTime);
return result; return result;
} }
/* Fix things when TCPIPReadTCP returns less data than it's supposed to */ /* Fix things when TCPIPReadTCP returns less data than it's supposed to */
@ -322,10 +322,10 @@ BOOLEAN ReadFixup (unsigned long requested, unsigned long returned) {
returned += theRRBuff.rrBuffCount; returned += theRRBuff.rrBuffCount;
} while (returned < requested); } while (returned < requested);
return TRUE; return TRUE;
} }
/********************************************************************** /**********************************************************************
* DoReadTCP() - Issue TCPIPReadTCP() call w/ appropriate parameters * DoReadTCP() - Issue TCPIPReadTCP() call w/ appropriate parameters
@ -355,7 +355,7 @@ BOOLEAN DoReadTCP (unsigned long dataLength) {
return ReadFixup(dataLength, theRRBuff.rrBuffCount); return ReadFixup(dataLength, theRRBuff.rrBuffCount);
return TRUE; return TRUE;
} }
/********************************************************************** /**********************************************************************
@ -386,20 +386,20 @@ BOOLEAN DoVNCHandshaking (void) {
AlertWindow(awResource, NULL, badRFBVersionAlert); AlertWindow(awResource, NULL, badRFBVersionAlert);
alerted = TRUE; alerted = TRUE;
return FALSE; return FALSE;
} }
HUnlock(readBufferHndl); HUnlock(readBufferHndl);
strcpy(versionString, RFBVERSIONSTR); strcpy(versionString, RFBVERSIONSTR);
if (TCPIPWriteTCP(hostIpid, versionString, 12, TRUE, FALSE)) { if (TCPIPWriteTCP(hostIpid, versionString, 12, TRUE, FALSE)) {
return FALSE; return FALSE;
} }
if (toolerror()) { if (toolerror()) {
return FALSE; return FALSE;
} }
if (! DoWaitingReadTCP(4)) { /* Read authentication type */ if (! DoWaitingReadTCP(4)) { /* Read authentication type */
return FALSE; return FALSE;
} }
HLock(readBufferHndl); HLock(readBufferHndl);
switch ((unsigned long) (**readBufferHndl)) { switch ((unsigned long) (**readBufferHndl)) {
case vncConnectionFailed: HUnlock(readBufferHndl); case vncConnectionFailed: HUnlock(readBufferHndl);
@ -427,7 +427,7 @@ BOOLEAN DoVNCHandshaking (void) {
connectionFailedAlert); connectionFailedAlert);
alerted = TRUE; alerted = TRUE;
HUnlock(readBufferHndl); HUnlock(readBufferHndl);
} }
return FALSE; return FALSE;
case vncNoAuthentication: break; case vncNoAuthentication: break;
case vncVNCAuthentication: if (DoDES()) case vncVNCAuthentication: if (DoDES())
@ -439,14 +439,14 @@ BOOLEAN DoVNCHandshaking (void) {
badAuthTypeAlert); badAuthTypeAlert);
alerted = TRUE; alerted = TRUE;
return FALSE; return FALSE;
} }
HUnlock(readBufferHndl); HUnlock(readBufferHndl);
return TRUE; return TRUE;
#undef connectionFailedAlert #undef connectionFailedAlert
#undef badRFBVersionAlert #undef badRFBVersionAlert
#undef badAuthTypeAlert #undef badAuthTypeAlert
} }
/********************************************************************** /**********************************************************************
* DoDES() - Try to do DES (aka VNC) authentication * DoDES() - Try to do DES (aka VNC) authentication
@ -472,7 +472,7 @@ BOOLEAN DoDES (void) {
x ^= (x >> 2) & 0x04; /* 4 -> 2 */ \ x ^= (x >> 2) & 0x04; /* 4 -> 2 */ \
x &= 0xef; /* Clear 4 */ \ x &= 0xef; /* Clear 4 */ \
x ^= (x >> 3) & 0x10; /* 7 -> 4 */ \ x ^= (x >> 3) & 0x10; /* 7 -> 4 */ \
} while (0) } while (0)
#define statusOK SwapBytes4(0) #define statusOK SwapBytes4(0)
#define statusFailed SwapBytes4(1) #define statusFailed SwapBytes4(1)
#define statusTooMany SwapBytes4(2) #define statusTooMany SwapBytes4(2)
@ -492,17 +492,17 @@ BOOLEAN DoDES (void) {
AlertWindow(awResource, NULL, noCryptoError); AlertWindow(awResource, NULL, noCryptoError);
alerted = TRUE; alerted = TRUE;
return FALSE; return FALSE;
} }
dpSpace = NewHandle(0x0100, userid(), dpSpace = NewHandle(0x0100, userid(),
attrLocked|attrFixed|attrNoCross|attrBank, 0x00000000); attrLocked|attrFixed|attrNoCross|attrBank, 0x00000000);
CryptoStartUp((Word) *dpSpace); CryptoStartUp((Word) *dpSpace);
} }
if (! (DoWaitingReadTCP(16))) { if (! (DoWaitingReadTCP(16))) {
success = FALSE; success = FALSE;
goto UnloadCrypto; goto UnloadCrypto;
} }
/* Pad password with nulls, as per VNC precedent */ /* Pad password with nulls, as per VNC precedent */
for (i=vncPassword[0]+1; i<=8; i++) for (i=vncPassword[0]+1; i<=8; i++)
@ -539,35 +539,35 @@ BOOLEAN DoDES (void) {
{ {
success = FALSE; success = FALSE;
goto UnloadCrypto; goto UnloadCrypto;
} }
if (toolerror()) { if (toolerror()) {
success = FALSE; success = FALSE;
goto UnloadCrypto; goto UnloadCrypto;
} }
if (! (DoWaitingReadTCP(4))) { if (! (DoWaitingReadTCP(4))) {
success = FALSE; success = FALSE;
goto UnloadCrypto; goto UnloadCrypto;
} }
HLock(readBufferHndl); HLock(readBufferHndl);
if ((**readBufferHndl) == statusOK) { if ((**readBufferHndl) == statusOK) {
success = TRUE; success = TRUE;
goto UnloadCrypto; goto UnloadCrypto;
} }
else if ((**readBufferHndl) == statusFailed) { else if ((**readBufferHndl) == statusFailed) {
InitCursor(); InitCursor();
AlertWindow(awResource, NULL, authFailedError); AlertWindow(awResource, NULL, authFailedError);
alerted = TRUE; alerted = TRUE;
success = FALSE; success = FALSE;
goto UnloadCrypto; goto UnloadCrypto;
} }
else if ((**readBufferHndl) == statusTooMany) { else if ((**readBufferHndl) == statusTooMany) {
InitCursor(); InitCursor();
AlertWindow(awResource, NULL, authTooManyError); AlertWindow(awResource, NULL, authTooManyError);
alerted = TRUE; alerted = TRUE;
success = FALSE; success = FALSE;
goto UnloadCrypto; goto UnloadCrypto;
} }
/* else */ /* else */
success = FALSE; success = FALSE;
@ -579,14 +579,14 @@ BOOLEAN DoDES (void) {
CryptoShutDown(); /* Shut down Crypto tool set */ CryptoShutDown(); /* Shut down Crypto tool set */
DisposeHandle(dpSpace); DisposeHandle(dpSpace);
UnloadOneTool(129); UnloadOneTool(129);
} }
return success; return success;
#undef statusOK #undef statusOK
#undef statusFailed #undef statusFailed
#undef statusTooMany #undef statusTooMany
#undef SwitchBits #undef SwitchBits
} }
/********************************************************************** /**********************************************************************
* FinishVNCHandshaking() - Complete VNC protocol initialization * FinishVNCHandshaking() - Complete VNC protocol initialization
@ -612,7 +612,7 @@ BOOLEAN FinishVNCHandshaking (void) {
unsigned char blueShift; unsigned char blueShift;
unsigned char padding3; unsigned char padding3;
unsigned int padding4; unsigned int padding4;
} pixelFormat = { } pixelFormat = {
0 /* message type - SetPixelFormat */, 0 /* message type - SetPixelFormat */,
0,0 /* padding */, 0,0 /* padding */,
8 /* bpp */, 8 /* bpp */,
@ -626,7 +626,7 @@ BOOLEAN FinishVNCHandshaking (void) {
3 /* green-shift */, 3 /* green-shift */,
6 /* blue-shift */, 6 /* blue-shift */,
0,0 /* padding */ 0,0 /* padding */
}; };
struct Encodings { struct Encodings {
unsigned char messageType; unsigned char messageType;
@ -636,7 +636,7 @@ BOOLEAN FinishVNCHandshaking (void) {
unsigned long secondEncoding; unsigned long secondEncoding;
unsigned long thirdEncoding; unsigned long thirdEncoding;
unsigned long fourthEncoding; unsigned long fourthEncoding;
} encodings = { } encodings = {
2, /* Message Type - SetEncodings */ 2, /* Message Type - SetEncodings */
0, /* padding */ 0, /* padding */
0, /* number of encodings - set below */ 0, /* number of encodings - set below */
@ -647,7 +647,7 @@ BOOLEAN FinishVNCHandshaking (void) {
/* Per the spec, raw encoding is supported even though /* Per the spec, raw encoding is supported even though
* it is not listed here explicitly. * it is not listed here explicitly.
*/ */
}; };
DisplayConnectStatus("\pNegotiating protocol options...", FALSE); DisplayConnectStatus("\pNegotiating protocol options...", FALSE);
@ -673,7 +673,7 @@ BOOLEAN FinishVNCHandshaking (void) {
if ((fbWidth > 16384) || (fbHeight > 16384)) { if ((fbWidth > 16384) || (fbHeight > 16384)) {
AlertWindow(awResource, NULL, screenTooBigError); AlertWindow(awResource, NULL, screenTooBigError);
return FALSE; return FALSE;
} }
/* Ignore server's pixel format and display name */ /* Ignore server's pixel format and display name */
if (! DoWaitingReadTCP(16)) if (! DoWaitingReadTCP(16))
@ -709,7 +709,7 @@ BOOLEAN FinishVNCHandshaking (void) {
return TRUE; return TRUE;
#undef screenTooBigError #undef screenTooBigError
} }
/********************************************************************** /**********************************************************************
@ -722,7 +722,7 @@ void CloseTCPConnection (void) {
do { do {
TCPIPPoll(); TCPIPPoll();
TCPIPLogout(hostIpid); TCPIPLogout(hostIpid);
} while (toolerror() == terrSOCKETOPEN); } while (toolerror() == terrSOCKETOPEN);
CloseConnectStatusWindow(); CloseConnectStatusWindow();
InitCursor(); InitCursor();
} }

View File

@ -97,7 +97,7 @@ char vncPassword[10];
void DrawContents (void) { void DrawContents (void) {
PenNormal(); /* use a "normal" pen */ PenNormal(); /* use a "normal" pen */
DrawControls(GetPort()); /* draw controls in window */ DrawControls(GetPort()); /* draw controls in window */
} }
#pragma databank 0 #pragma databank 0
@ -111,7 +111,7 @@ void DoAbout (void) {
AlertWindow(awCString+awResource, NULL, alertID); AlertWindow(awCString+awResource, NULL, alertID);
#undef alertID #undef alertID
} }
/*************************************************************** /***************************************************************
* DoNewConnection - Show the New Connection window * DoNewConnection - Show the New Connection window
@ -124,7 +124,7 @@ void DoNewConnection (void) {
MakeThisCtlTarget(GetCtlHandleFromID(newConnWindow, linServer)); MakeThisCtlTarget(GetCtlHandleFromID(newConnWindow, linServer));
ShowWindow(newConnWindow); ShowWindow(newConnWindow);
SelectWindow(newConnWindow); SelectWindow(newConnWindow);
} }
/*************************************************************** /***************************************************************
* DoClose - Close the frontmost window/connection * DoClose - Close the frontmost window/connection
@ -135,7 +135,7 @@ void DoNewConnection (void) {
void DoClose (GrafPortPtr wPtr) { void DoClose (GrafPortPtr wPtr) {
if (wPtr == newConnWindow) { if (wPtr == newConnWindow) {
HideWindow(wPtr); HideWindow(wPtr);
} }
else if (wPtr && vncConnected) { /* Close VNC session window */ else if (wPtr && vncConnected) { /* Close VNC session window */
CloseWindow(wPtr); CloseWindow(wPtr);
CloseTCPConnection(); CloseTCPConnection();
@ -146,9 +146,9 @@ void DoClose (GrafPortPtr wPtr) {
if (cursor) { if (cursor) {
InitCursor(); InitCursor();
free(cursor); free(cursor);
} }
}; };
} }
/*************************************************************** /***************************************************************
* DoLEEdit - Handle edit menu items for LineEdit controls * DoLEEdit - Handle edit menu items for LineEdit controls
@ -170,22 +170,22 @@ void DoLEEdit (int editAction) {
switch (editAction) { switch (editAction) {
case editCut: if (id == linServer) { case editCut: if (id == linServer) {
LECut((LERecHndl) GetCtlTitle(ctl)); LECut((LERecHndl) GetCtlTitle(ctl));
}; };
LEToScrap(); LEToScrap();
break; break;
case editCopy: if (id == linServer) { case editCopy: if (id == linServer) {
LECopy((LERecHndl) GetCtlTitle(ctl)); LECopy((LERecHndl) GetCtlTitle(ctl));
}; };
LEToScrap(); LEToScrap();
break; break;
case editPaste: LEPaste((LERecHndl) GetCtlTitle(ctl)); case editPaste: LEPaste((LERecHndl) GetCtlTitle(ctl));
break; break;
case editClear: LEDelete((LERecHndl) GetCtlTitle(ctl)); case editClear: LEDelete((LERecHndl) GetCtlTitle(ctl));
break; break;
};
}; };
};
SetPort(port); SetPort(port);
} }
/*************************************************************** /***************************************************************
* HandleMenu - Initialize the menu bar. * HandleMenu - Initialize the menu bar.
@ -209,9 +209,9 @@ void HandleMenu (void) {
case editClear: DoLEEdit(editClear); break; case editClear: DoLEEdit(editClear); break;
case editShowClipboard: ShowClipboard(0x8000, 0); break; case editShowClipboard: ShowClipboard(0x8000, 0); break;
case editSendClipboard: DoSendClipboard(); break; case editSendClipboard: DoSendClipboard(); break;
}
HiliteMenu(FALSE, menuNum); /* unhighlight the menu */
} }
HiliteMenu(FALSE, menuNum); /* unhighlight the menu */
}
/*************************************************************** /***************************************************************
* HandleControl - Handle a control press in the New Conn. window * HandleControl - Handle a control press in the New Conn. window
@ -240,8 +240,8 @@ void HandleControl (void) {
newConnWindow, chkClipboard); break; newConnWindow, chkClipboard); break;
case radRaw: useHextile = FALSE; break; case radRaw: useHextile = FALSE; break;
case radHextile: useHextile = TRUE; break; case radHextile: useHextile = TRUE; break;
}; };
} }
/*************************************************************** /***************************************************************
* InitMenus - Initialize the menu bar. * InitMenus - Initialize the menu bar.
@ -267,7 +267,7 @@ void InitMenus (int offset) {
menuOffset = offset; /* So we can tell which menu is active */ menuOffset = offset; /* So we can tell which menu is active */
#undef menuID #undef menuID
} }
/*************************************************************** /***************************************************************
* CheckMenus - Check the menus to see if they should be dimmed * CheckMenus - Check the menus to see if they should be dimmed
@ -293,7 +293,7 @@ void CheckMenus (void) {
EnableMItem(editCopy); EnableMItem(editCopy);
EnableMItem(editPaste); EnableMItem(editPaste);
EnableMItem(editClear); EnableMItem(editClear);
} }
else if (activeWindow == newConnWindow) { /* New Connection window */ else if (activeWindow == newConnWindow) { /* New Connection window */
EnableMItem(fileClose); EnableMItem(fileClose);
DisableMItem(editUndo); DisableMItem(editUndo);
@ -301,15 +301,15 @@ void CheckMenus (void) {
EnableMItem(editCopy); EnableMItem(editCopy);
EnableMItem(editPaste); EnableMItem(editPaste);
EnableMItem(editClear); EnableMItem(editClear);
} }
else if (activeWindow == vncWindow) { else if (activeWindow == vncWindow) {
DisableMItem(editUndo); DisableMItem(editUndo);
DisableMItem(editCopy); DisableMItem(editCopy);
DisableMItem(editCut); DisableMItem(editCut);
DisableMItem(editPaste); DisableMItem(editPaste);
DisableMItem(editClear); DisableMItem(editClear);
}
} }
}
else { /* no editable window on top */ else { /* no editable window on top */
DisableMItem(fileClose); DisableMItem(fileClose);
DisableMItem(editUndo); DisableMItem(editUndo);
@ -317,7 +317,7 @@ void CheckMenus (void) {
DisableMItem(editCopy); DisableMItem(editCopy);
DisableMItem(editPaste); DisableMItem(editPaste);
DisableMItem(editClear); DisableMItem(editClear);
}; };
if (vncConnected) { /* VNC connection present */ if (vncConnected) { /* VNC connection present */
DisableMItem(fileNewConnection); DisableMItem(fileNewConnection);
@ -326,11 +326,11 @@ void CheckMenus (void) {
DisableMItem(editSendClipboard); DisableMItem(editSendClipboard);
else else
EnableMItem(editSendClipboard); EnableMItem(editSendClipboard);
} }
else { else {
DisableMItem(editSendClipboard); DisableMItem(editSendClipboard);
}
} }
}
/* InitScreen - Set up color tables and SCBs to appropriate values /* InitScreen - Set up color tables and SCBs to appropriate values
*/ */
@ -338,13 +338,13 @@ void InitScreen (void) {
static ColorTable gray640Colors = { static ColorTable gray640Colors = {
0x0000, 0x0555, 0x0AAA, 0x0FFF, 0x0000, 0x0555, 0x0AAA, 0x0FFF, 0x0000, 0x0555, 0x0AAA, 0x0FFF, 0x0000, 0x0555, 0x0AAA, 0x0FFF,
0x0000, 0x0555, 0x0AAA, 0x0FFF, 0x0000, 0x0555, 0x0AAA, 0x0FFF 0x0000, 0x0555, 0x0AAA, 0x0FFF, 0x0000, 0x0555, 0x0AAA, 0x0FFF
}; };
/* Apple menu uses color tables 1 through 6 */ /* Apple menu uses color tables 1 through 6 */
SetColorTable(7, &gray640Colors); SetColorTable(7, &gray640Colors);
SetAllSCBs(0x87); /* 640 mode with gray640Colors */ SetAllSCBs(0x87); /* 640 mode with gray640Colors */
InitPalette(); /* Restore Apple Menu colors */ InitPalette(); /* Restore Apple Menu colors */
} }
void Quit (void) { void Quit (void) {
/* Done with event loop - now quitting */ /* Done with event loop - now quitting */
@ -367,7 +367,7 @@ void Quit (void) {
/* is not "permanent," i.e. started when the system boots up. */ /* is not "permanent," i.e. started when the system boots up. */
if (TCPIPGetConnectStatus() && (!TCPIPGetBootConnectFlag())) if (TCPIPGetConnectStatus() && (!TCPIPGetBootConnectFlag()))
if (AlertWindow(awResource+awButtonLayout, NULL, disconnectTCPIPAlert)) if (AlertWindow(awResource+awButtonLayout, NULL, disconnectTCPIPAlert))
{ {
WaitCursor(); WaitCursor();
/* Must use force flag below because Marinetti will still count /* Must use force flag below because Marinetti will still count
* our ipid as logged in (proventing non-forced disconnect) * our ipid as logged in (proventing non-forced disconnect)
@ -375,7 +375,7 @@ void Quit (void) {
TCPIPDisconnect(TRUE, &DisplayConnectStatus); TCPIPDisconnect(TRUE, &DisplayConnectStatus);
if (connectStatusWindowPtr != NULL) if (connectStatusWindowPtr != NULL)
CloseWindow(connectStatusWindowPtr); CloseWindow(connectStatusWindowPtr);
} }
UnloadScrap(); /* Save scrap to disk */ UnloadScrap(); /* Save scrap to disk */
@ -383,7 +383,7 @@ void Quit (void) {
UnloadOneTool(54); UnloadOneTool(54);
ShutDownTools(1, startStopParm); /* shut down the tools */ ShutDownTools(1, startStopParm); /* shut down the tools */
exit(0); exit(0);
} }
/*************************************************************** /***************************************************************
* Main - Initial startup function * Main - Initial startup function
@ -399,7 +399,7 @@ int main (void) {
if (toolerror() != 0) { if (toolerror() != 0) {
GrafOff(); GrafOff();
SysFailMgr(toolerror(), "\pCould not start tools: "); SysFailMgr(toolerror(), "\pCould not start tools: ");
} }
readBufferHndl = NewHandle(1, userid(), 0, NULL); readBufferHndl = NewHandle(1, userid(), 0, NULL);
@ -409,7 +409,7 @@ int main (void) {
InitCursor(); /* Activate pointer cursor */ InitCursor(); /* Activate pointer cursor */
AlertWindow(awResource, NULL, noMarinettiError); AlertWindow(awResource, NULL, noMarinettiError);
Quit(); /* Can't proceed, so just quit */ Quit(); /* Can't proceed, so just quit */
} }
else /* Marinetti loaded successfully */ else /* Marinetti loaded successfully */
TCPIPStartUp(); /* ... so activate it now */ TCPIPStartUp(); /* ... so activate it now */
@ -418,14 +418,14 @@ int main (void) {
InitCursor(); InitCursor();
AlertWindow(awResource, NULL, outOfMemoryError); AlertWindow(awResource, NULL, outOfMemoryError);
Quit(); Quit();
} }
if (!AllocateBigColorTables()) { if (!AllocateBigColorTables()) {
SysBeep(); SysBeep();
InitCursor(); InitCursor();
AlertWindow(awResource, NULL, outOfMemoryError); AlertWindow(awResource, NULL, outOfMemoryError);
Quit(); Quit();
} }
InitScreen(); /* Set up color tables */ InitScreen(); /* Set up color tables */
@ -464,13 +464,13 @@ int main (void) {
break; break;
case keyDownEvt: case keyDownEvt:
case autoKeyEvt: ProcessKeyEvent(); case autoKeyEvt: ProcessKeyEvent();
} }
if (vncConnected) if (vncConnected)
ConnectedEventLoop(); ConnectedEventLoop();
else if (colorTablesComplete == FALSE) else if (colorTablesComplete == FALSE)
if (MakeBigColorTables(256)) if (MakeBigColorTables(256))
colorTablesComplete = TRUE; colorTablesComplete = TRUE;
} }
Quit(); Quit();
} }

View File

@ -94,8 +94,8 @@ resource rToolStartup(1) {
27, $0303, /* Font Manager */ 27, $0303, /* Font Manager */
28, $0303, /* List Manager */ 28, $0303, /* List Manager */
/* 34, $0103 /* TextEdit Tool Set */ /* 34, $0103 /* TextEdit Tool Set */
} }
}; };
/*- Menu Bar ---------------------------------------------------*/ /*- Menu Bar ---------------------------------------------------*/
@ -104,8 +104,8 @@ resource rMenuBar (1) { /* the menu bar */
appleMenu, /* resource numbers for the menus */ appleMenu, /* resource numbers for the menus */
fileMenu, fileMenu,
editMenu editMenu
};
}; };
};
resource rMenu (appleMenu) { /* the Apple menu */ resource rMenu (appleMenu) { /* the Apple menu */
appleMenu, /* menu ID */ appleMenu, /* menu ID */
@ -114,7 +114,7 @@ resource rMenu (appleMenu) { /* the Apple menu */
+ fAllowCache, + fAllowCache,
appleMenu, /* menu title resource ID */ appleMenu, /* menu title resource ID */
{appleAbout}; /* menu item resource IDs */ {appleAbout}; /* menu item resource IDs */
}; };
resource rMenu (fileMenu) { /* the File menu */ resource rMenu (fileMenu) { /* the File menu */
fileMenu, /* menu ID */ fileMenu, /* menu ID */
@ -126,8 +126,8 @@ resource rMenu (fileMenu) { /* the File menu */
fileNewConnection, fileNewConnection,
fileClose, fileClose,
fileQuit fileQuit
};
}; };
};
resource rMenu (editMenu) { /* the Edit menu */ resource rMenu (editMenu) { /* the Edit menu */
editMenu, /* menu ID */ editMenu, /* menu ID */
@ -143,8 +143,8 @@ resource rMenu (editMenu) { /* the Edit menu */
editClear, editClear,
editShowClipboard, editShowClipboard,
editSendClipBoard editSendClipBoard
};
}; };
};
resource rMenuItem (editUndo) { /* Undo menu item */ resource rMenuItem (editUndo) { /* Undo menu item */
editUndo, /* menu item ID */ editUndo, /* menu item ID */
@ -153,7 +153,7 @@ resource rMenuItem (editUndo) { /* Undo menu item */
refIsResource*itemTitleRefShift /* flags */ refIsResource*itemTitleRefShift /* flags */
+ fDivider, + fDivider,
editUndo /* menu item title resource ID */ editUndo /* menu item title resource ID */
}; };
resource rMenuItem (editCut) { /* Cut menu item */ resource rMenuItem (editCut) { /* Cut menu item */
editCut, /* menu item ID */ editCut, /* menu item ID */
@ -161,7 +161,7 @@ resource rMenuItem (editCut) { /* Cut menu item */
0, /* check character */ 0, /* check character */
refIsResource*itemTitleRefShift, /* flags */ refIsResource*itemTitleRefShift, /* flags */
editCut /* menu item title resource ID */ editCut /* menu item title resource ID */
}; };
resource rMenuItem (editCopy) { /* Copy menu item */ resource rMenuItem (editCopy) { /* Copy menu item */
editCopy, /* menu item ID */ editCopy, /* menu item ID */
@ -169,7 +169,7 @@ resource rMenuItem (editCopy) { /* Copy menu item */
0, /* check character */ 0, /* check character */
refIsResource*itemTitleRefShift, /* flags */ refIsResource*itemTitleRefShift, /* flags */
editCopy /* menu item title resource ID */ editCopy /* menu item title resource ID */
}; };
resource rMenuItem (editPaste) { /* Paste menu item */ resource rMenuItem (editPaste) { /* Paste menu item */
editPaste, /* menu item ID */ editPaste, /* menu item ID */
@ -177,7 +177,7 @@ resource rMenuItem (editPaste) { /* Paste menu item */
0, /* check character */ 0, /* check character */
refIsResource*itemTitleRefShift, /* flags */ refIsResource*itemTitleRefShift, /* flags */
editPaste /* menu item title resource ID */ editPaste /* menu item title resource ID */
}; };
resource rMenuItem (editClear) { /* Clear menu item */ resource rMenuItem (editClear) { /* Clear menu item */
editClear, /* menu item ID */ editClear, /* menu item ID */
@ -186,7 +186,7 @@ resource rMenuItem (editClear) { /* Clear menu item */
refIsResource*itemTitleRefShift /* flags */ refIsResource*itemTitleRefShift /* flags */
+ fDivider, + fDivider,
editClear /* menu item title resource ID */ editClear /* menu item title resource ID */
}; };
resource rMenuItem (editShowClipboard) { resource rMenuItem (editShowClipboard) {
editShowClipboard, editShowClipboard,
@ -194,7 +194,7 @@ resource rMenuItem (editShowClipboard) {
0, 0,
refIsResource*itemTitleRefShift, refIsResource*itemTitleRefShift,
editShowClipboard editShowClipboard
}; };
resource rMenuItem (editSendClipboard) { resource rMenuItem (editSendClipboard) {
editSendClipboard, editSendClipboard,
@ -202,7 +202,7 @@ resource rMenuItem (editSendClipboard) {
0, 0,
refIsResource*itemTitleRefShift, refIsResource*itemTitleRefShift,
editSendClipboard editSendClipboard
}; };
resource rMenuItem (fileNewConnection) { /* New menu item */ resource rMenuItem (fileNewConnection) { /* New menu item */
fileNewConnection, /* menu item ID */ fileNewConnection, /* menu item ID */
@ -210,7 +210,7 @@ resource rMenuItem (fileNewConnection) { /* New menu item */
0, /* check character */ 0, /* check character */
refIsResource*itemTitleRefShift, /* flags */ refIsResource*itemTitleRefShift, /* flags */
fileNewConnection /* menu item title resource ID */ fileNewConnection /* menu item title resource ID */
}; };
resource rMenuItem (fileClose) { /* Close menu item */ resource rMenuItem (fileClose) { /* Close menu item */
fileClose, /* menu item ID */ fileClose, /* menu item ID */
@ -219,7 +219,7 @@ resource rMenuItem (fileClose) { /* Close menu item */
refIsResource*itemTitleRefShift /* flags */ refIsResource*itemTitleRefShift /* flags */
+ fDivider, + fDivider,
fileClose /* menu item title resource ID */ fileClose /* menu item title resource ID */
}; };
resource rMenuItem (fileQuit) { /* Quit menu item */ resource rMenuItem (fileQuit) { /* Quit menu item */
fileQuit, /* menu item ID */ fileQuit, /* menu item ID */
@ -227,7 +227,7 @@ resource rMenuItem (fileQuit) { /* Quit menu item */
0, /* check character */ 0, /* check character */
refIsResource*itemTitleRefShift, /* flags */ refIsResource*itemTitleRefShift, /* flags */
fileQuit /* menu item title resource ID */ fileQuit /* menu item title resource ID */
}; };
resource rMenuItem (appleAbout) { /* About menu item */ resource rMenuItem (appleAbout) { /* About menu item */
appleAbout, /* menu item ID */ appleAbout, /* menu item ID */
@ -236,7 +236,7 @@ resource rMenuItem (appleAbout) { /* About menu item */
refIsResource*itemTitleRefShift /* flags */ refIsResource*itemTitleRefShift /* flags */
+ fDivider, + fDivider,
appleAbout /* menu item title resource ID */ appleAbout /* menu item title resource ID */
}; };
/* the various strings */ /* the various strings */
resource rPString (appleMenu, noCrossBank) {"@"}; resource rPString (appleMenu, noCrossBank) {"@"};
@ -264,8 +264,8 @@ resource rMenuBar (1+noKB) { /* the menu bar */
appleMenu, /* resource numbers for the menus */ appleMenu, /* resource numbers for the menus */
fileMenu+noKB, fileMenu+noKB,
editMenu+noKB editMenu+noKB
};
}; };
};
resource rMenu (fileMenu+noKB) { /* the File menu */ resource rMenu (fileMenu+noKB) { /* the File menu */
fileMenu, /* menu ID */ fileMenu, /* menu ID */
@ -277,8 +277,8 @@ resource rMenu (fileMenu+noKB) { /* the File menu */
fileNewConnection+noKB, fileNewConnection+noKB,
fileClose+noKB, fileClose+noKB,
fileQuit+noKB fileQuit+noKB
};
}; };
};
resource rMenu (editMenu+noKB) { /* the Edit menu */ resource rMenu (editMenu+noKB) { /* the Edit menu */
editMenu, /* menu ID */ editMenu, /* menu ID */
@ -294,8 +294,8 @@ resource rMenu (editMenu+noKB) { /* the Edit menu */
editClear, editClear,
editShowClipboard, editShowClipboard,
editSendClipBoard editSendClipBoard
};
}; };
};
resource rMenuItem (editUndo+noKB) { /* Undo menu item */ resource rMenuItem (editUndo+noKB) { /* Undo menu item */
editUndo, /* menu item ID */ editUndo, /* menu item ID */
@ -304,7 +304,7 @@ resource rMenuItem (editUndo+noKB) { /* Undo menu item */
refIsResource*itemTitleRefShift /* flags */ refIsResource*itemTitleRefShift /* flags */
+ fDivider, + fDivider,
editUndo /* menu item title resource ID */ editUndo /* menu item title resource ID */
}; };
resource rMenuItem (editCut+noKB) { /* Cut menu item */ resource rMenuItem (editCut+noKB) { /* Cut menu item */
editCut, /* menu item ID */ editCut, /* menu item ID */
@ -312,7 +312,7 @@ resource rMenuItem (editCut+noKB) { /* Cut menu item */
0, /* check character */ 0, /* check character */
refIsResource*itemTitleRefShift, /* flags */ refIsResource*itemTitleRefShift, /* flags */
editCut /* menu item title resource ID */ editCut /* menu item title resource ID */
}; };
resource rMenuItem (editCopy+noKB) { /* Copy menu item */ resource rMenuItem (editCopy+noKB) { /* Copy menu item */
editCopy, /* menu item ID */ editCopy, /* menu item ID */
@ -320,7 +320,7 @@ resource rMenuItem (editCopy+noKB) { /* Copy menu item */
0, /* check character */ 0, /* check character */
refIsResource*itemTitleRefShift, /* flags */ refIsResource*itemTitleRefShift, /* flags */
editCopy /* menu item title resource ID */ editCopy /* menu item title resource ID */
}; };
resource rMenuItem (editPaste+noKB) { /* Paste menu item */ resource rMenuItem (editPaste+noKB) { /* Paste menu item */
editPaste, /* menu item ID */ editPaste, /* menu item ID */
@ -328,7 +328,7 @@ resource rMenuItem (editPaste+noKB) { /* Paste menu item */
0, /* check character */ 0, /* check character */
refIsResource*itemTitleRefShift, /* flags */ refIsResource*itemTitleRefShift, /* flags */
editPaste /* menu item title resource ID */ editPaste /* menu item title resource ID */
}; };
resource rMenuItem (fileNewConnection+noKB) { /* New menu item */ resource rMenuItem (fileNewConnection+noKB) { /* New menu item */
fileNewConnection, /* menu item ID */ fileNewConnection, /* menu item ID */
@ -336,7 +336,7 @@ resource rMenuItem (fileNewConnection+noKB) { /* New menu item */
0, /* check character */ 0, /* check character */
refIsResource*itemTitleRefShift, /* flags */ refIsResource*itemTitleRefShift, /* flags */
fileNewConnection /* menu item title resource ID */ fileNewConnection /* menu item title resource ID */
}; };
resource rMenuItem (fileClose+noKB) { /* Close menu item */ resource rMenuItem (fileClose+noKB) { /* Close menu item */
fileClose, /* menu item ID */ fileClose, /* menu item ID */
@ -345,7 +345,7 @@ resource rMenuItem (fileClose+noKB) { /* Close menu item */
refIsResource*itemTitleRefShift /* flags */ refIsResource*itemTitleRefShift /* flags */
+ fDivider, + fDivider,
fileClose /* menu item title resource ID */ fileClose /* menu item title resource ID */
}; };
resource rMenuItem (fileQuit+noKB) { /* Quit menu item */ resource rMenuItem (fileQuit+noKB) { /* Quit menu item */
fileQuit, /* menu item ID */ fileQuit, /* menu item ID */
@ -353,7 +353,7 @@ resource rMenuItem (fileQuit+noKB) { /* Quit menu item */
0, /* check character */ 0, /* check character */
refIsResource*itemTitleRefShift, /* flags */ refIsResource*itemTitleRefShift, /* flags */
fileQuit /* menu item title resource ID */ fileQuit /* menu item title resource ID */
}; };
/*- About Box --------------------------------------------------*/ /*- About Box --------------------------------------------------*/
@ -365,7 +365,7 @@ resource rAlertString (1) {
"This program contains material from the ORCA/C Run-Time Libraries, " "This program contains material from the ORCA/C Run-Time Libraries, "
"Copyright 1987-1996 by Byte Works Inc. Used with permission.\n" "Copyright 1987-1996 by Byte Works Inc. Used with permission.\n"
":^#0\$00"; ":^#0\$00";
}; };
/*- Resources used by Finder, etc. -----------------------------*/ /*- Resources used by Finder, etc. -----------------------------*/
@ -373,12 +373,12 @@ resource rVersion (1) {
{ {
1,0,0, /* Version number */ 1,0,0, /* Version number */
beta, 1, /* Release version */ beta, 1, /* Release version */
}, },
verUS, /* Region code */ verUS, /* Region code */
"VNCview GS", /* Title */ "VNCview GS", /* Title */
"Copyright \$A9 2002\$D12004\n" "Copyright \$A9 2002\$D12004\n"
"by Stephen Heumann" "by Stephen Heumann"
}; };
resource rBundle (1, preload, nospecialmemory) { resource rBundle (1, preload, nospecialmemory) {
1, /* Icon ID */ 1, /* Icon ID */
@ -389,7 +389,7 @@ resource rBundle (1, preload, nospecialmemory) {
{0}, {0},
{1}, {1},
{2} {2}
}, },
$00000005, $00000005,
matchFileType {{$B3}}, matchFileType {{$B3}},
empty {}, empty {},
@ -403,8 +403,8 @@ resource rBundle (1, preload, nospecialmemory) {
empty {}, empty {},
empty {}, empty {},
empty {} empty {}
} }
}; };
resource rIcon (1, preload, nospecialmemory) { resource rIcon (1, preload, nospecialmemory) {
$8000, $8000,
@ -486,93 +486,93 @@ resource rAlertString (noMarinettiError) {
"Could not load the Marinetti TCP/IP stack. Please ensure that " "Could not load the Marinetti TCP/IP stack. Please ensure that "
"you have Marinetti 2.0 or later installed on this computer." "you have Marinetti 2.0 or later installed on this computer."
":^#5\$00"; ":^#5\$00";
}; };
resource rAlertString (noCryptoError) { resource rAlertString (noCryptoError) {
"42:" "42:"
"Could not load the Crypto tool set. Please install the crypto " "Could not load the Crypto tool set. Please install the crypto "
"tool set version 1.0 or later to use passwords in VNCview GS." "tool set version 1.0 or later to use passwords in VNCview GS."
":^#6\$00"; ":^#6\$00";
}; };
resource rAlertString (outOfMemoryError) { resource rAlertString (outOfMemoryError) {
"42:" "42:"
"Could not allocate sufficient memory. Please reduce memory " "Could not allocate sufficient memory. Please reduce memory "
"usage and run VNCview GS again." "usage and run VNCview GS again."
":^#5\$00"; ":^#5\$00";
}; };
resource rAlertString (disconnectTCPIPAlert) { resource rAlertString (disconnectTCPIPAlert) {
"20:" "20:"
"Do you want to disconnect your TCP/IP connection?" "Do you want to disconnect your TCP/IP connection?"
":^#3:#2\$00"; ":^#3:#2\$00";
}; };
resource rAlertString (authFailedError) { resource rAlertString (authFailedError) {
"52:" "52:"
"Authentication failed. Please re-type your password and try again." "Authentication failed. Please re-type your password and try again."
":^#6\$00"; ":^#6\$00";
}; };
resource rAlertString (authTooManyError) { resource rAlertString (authTooManyError) {
"72:" "72:"
"Authentication has failed too many times. Please check that you are " "Authentication has failed too many times. Please check that you are "
"using the correct password and wait a while before connecting again." "using the correct password and wait a while before connecting again."
":^#6\$00"; ":^#6\$00";
}; };
resource rAlertString (connectionFailedAlert) { resource rAlertString (connectionFailedAlert) {
"92;" "92;"
"Connection failed:\n" "Connection failed:\n"
"*0" "*0"
";^#6\$00"; ";^#6\$00";
}; };
resource rAlertString (badRFBVersionAlert) { resource rAlertString (badRFBVersionAlert) {
"42:" "42:"
"The server reported an RFB protocal version incompatible with VNCview " "The server reported an RFB protocal version incompatible with VNCview "
"GS or is not an RFB server." "GS or is not an RFB server."
":^#6\$00"; ":^#6\$00";
}; };
resource rAlertString (badAuthTypeAlert) { resource rAlertString (badAuthTypeAlert) {
"42:" "42:"
"The connection failed because the server requested an authentication " "The connection failed because the server requested an authentication "
"type not recognized by VNCview GS." "type not recognized by VNCview GS."
":^#6\$00"; ":^#6\$00";
}; };
resource rAlertString (noTCPIPConnectionError) { resource rAlertString (noTCPIPConnectionError) {
"32:" "32:"
"A TCP/IP connection could not be established." "A TCP/IP connection could not be established."
":^#6\$00"; ":^#6\$00";
}; };
resource rAlertString (badGetIpidError) { resource rAlertString (badGetIpidError) {
"42:" "42:"
"There was an error while resolving the hostname you provided or " "There was an error while resolving the hostname you provided or "
"preparing to connect to it." "preparing to connect to it."
":^#6\$00"; ":^#6\$00";
}; };
resource rAlertString (badOptionNegotiationError) { resource rAlertString (badOptionNegotiationError) {
"32:" "32:"
"There was an error while negotiating protocol options." "There was an error while negotiating protocol options."
":^#6\$00"; ":^#6\$00";
}; };
resource rAlertString (badHandshakingError) { resource rAlertString (badHandshakingError) {
"32:" "32:"
"There was an error while establishing a VNC connection with the server." "There was an error while establishing a VNC connection with the server."
":^#6\$00"; ":^#6\$00";
}; };
resource rAlertString (screenTooBigError) { resource rAlertString (screenTooBigError) {
"72:" "72:"
"The server's framebuffer resolution is too big for VNCview GS. " "The server's framebuffer resolution is too big for VNCview GS. "
"VNCview GS does not support resolutions greater than 16,384 by 16,384." "VNCview GS does not support resolutions greater than 16,384 by 16,384."
":^#6\$00"; ":^#6\$00";
}; };
#if 0 #if 0
resource rAlertString (badReadTCPError) { resource rAlertString (badReadTCPError) {
@ -580,14 +580,14 @@ resource rAlertString (badReadTCPError) {
"The TCP/IP stack did not return the amount of data expected. This " "The TCP/IP stack did not return the amount of data expected. This "
"may be indicative of a bug in Marinetti or in the VNC server software." "may be indicative of a bug in Marinetti or in the VNC server software."
":^#6\$00"; ":^#6\$00";
}; };
#endif #endif
resource rAlertString (10000) { resource rAlertString (10000) {
"72:" "72:"
"*0" "*0"
":^#6\$00"; ":^#6\$00";
}; };
/*- New VNC Connection window resources ----------------------------------*/ /*- New VNC Connection window resources ----------------------------------*/
@ -608,7 +608,7 @@ resource rWindParam1 (NCWindow+winNewConnection) {
infront, /* wPlane */ infront, /* wPlane */
NCWindow+winNewConnection, /* wStorage */ NCWindow+winNewConnection, /* wStorage */
$0009 /* wInVerb */ $0009 /* wInVerb */
}; };
resource rControlList (NCWindow+winNewConnection) {{ resource rControlList (NCWindow+winNewConnection) {{
NCWindow+btnConnect, NCWindow+btnConnect,
@ -632,7 +632,7 @@ resource rControlList (NCWindow+winNewConnection) {{
NCWindow+txtPreferredEncoding, NCWindow+txtPreferredEncoding,
NCWindow+radRaw, NCWindow+radRaw,
NCWindow+radHextile, NCWindow+radHextile,
}}; }};
resource rControlTemplate (NCWindow+btnConnect) { resource rControlTemplate (NCWindow+btnConnect) {
btnConnect, /* Control ID */ btnConnect, /* Control ID */
@ -644,8 +644,8 @@ resource rControlTemplate (NCWindow+btnConnect) {
NCWindow+btnConnect, /* Title Ref */ NCWindow+btnConnect, /* Title Ref */
nil, /* color table ref */ nil, /* color table ref */
{"\$0D","\$0D",0,0} /* key equivalents (esc) */ {"\$0D","\$0D",0,0} /* key equivalents (esc) */
}}; }};
}; };
resource rPString (NCWindow+btnConnect) {"Connect"}; resource rPString (NCWindow+btnConnect) {"Connect"};
resource rControlTemplate (NCWindow+btnCancel) { resource rControlTemplate (NCWindow+btnCancel) {
@ -658,8 +658,8 @@ resource rControlTemplate (NCWindow+btnCancel) {
NCWindow+btnCancel, /* Title Ref */ NCWindow+btnCancel, /* Title Ref */
nil, /* color table ref */ nil, /* color table ref */
{"\$1B","\$1B",0,0} /* key equivalents (esc) */ {"\$1B","\$1B",0,0} /* key equivalents (esc) */
}}; }};
}; };
resource rPString (NCWindow+btnCancel) {"Cancel"}; resource rPString (NCWindow+btnCancel) {"Cancel"};
resource rControlTemplate (NCWindow+linServer) { resource rControlTemplate (NCWindow+linServer) {
@ -671,8 +671,8 @@ resource rControlTemplate (NCWindow+linServer) {
0, 0,
255, /* Max Size */ 255, /* Max Size */
0 /* text ref */ 0 /* text ref */
}}; }};
}; };
resource rControlTemplate (NCWindow+txtServer) { resource rControlTemplate (NCWindow+txtServer) {
txtServer, txtServer,
@ -682,8 +682,8 @@ resource rControlTemplate (NCWindow+txtServer) {
$1002, $1002,
0, 0,
NCWindow+txtServer /* Title ref */ NCWindow+txtServer /* Title ref */
}}; }};
}; };
resource rTextForLETextBox2 (NCWindow+txtServer) {"VNC Server:"}; resource rTextForLETextBox2 (NCWindow+txtServer) {"VNC Server:"};
resource rControlTemplate (NCWindow+txtServerInfo) { resource rControlTemplate (NCWindow+txtServerInfo) {
@ -694,12 +694,12 @@ resource rControlTemplate (NCWindow+txtServerInfo) {
$1002, $1002,
0, 0,
NCWindow+txtServerInfo /* Title ref */ NCWindow+txtServerInfo /* Title ref */
}}; }};
}; };
resource rTextForLETextBox2 (NCWindow+txtServerInfo) { resource rTextForLETextBox2 (NCWindow+txtServerInfo) {
"\$01J\$01\$00Use \$01S\$03\$00host:display\$01S\$00\$00 " "\$01J\$01\$00Use \$01S\$03\$00host:display\$01S\$00\$00 "
"(or \$01S\$03\$00host\$01S\$00\$00 for display 0)." "(or \$01S\$03\$00host\$01S\$00\$00 for display 0)."
}; };
resource rControlTemplate (NCWindow+txtPassword) { resource rControlTemplate (NCWindow+txtPassword) {
txtPassword, txtPassword,
@ -709,8 +709,8 @@ resource rControlTemplate (NCWindow+txtPassword) {
$1002, $1002,
0, 0,
NCWindow+txtPassword /* Title ref */ NCWindow+txtPassword /* Title ref */
}}; }};
}; };
resource rTextForLETextBox2 (NCWindow+txtPassword) {"Password:"}; resource rTextForLETextBox2 (NCWindow+txtPassword) {"Password:"};
resource rControlTemplate (NCWindow+linPassword) { resource rControlTemplate (NCWindow+linPassword) {
@ -723,8 +723,8 @@ resource rControlTemplate (NCWindow+linPassword) {
8, /* Max Size */ 8, /* Max Size */
0, /* text ref */ 0, /* text ref */
$D7 /* password character */ $D7 /* password character */
}}; }};
}; };
resource rControlTemplate (NCWindow+txtDisplay) { resource rControlTemplate (NCWindow+txtDisplay) {
txtDisplay, txtDisplay,
@ -734,8 +734,8 @@ resource rControlTemplate (NCWindow+txtDisplay) {
$1002, $1002,
0, 0,
NCWindow+txtDisplay /* Title ref */ NCWindow+txtDisplay /* Title ref */
}}; }};
}; };
resource rTextForLETextBox2 (NCWindow+txtDisplay) {" Display "}; resource rTextForLETextBox2 (NCWindow+txtDisplay) {" Display "};
resource rControlTemplate (NCWindow+rectDisplay) { resource rControlTemplate (NCWindow+rectDisplay) {
@ -745,8 +745,8 @@ resource rControlTemplate (NCWindow+rectDisplay) {
$FF01, $FF01,
$1000, $1000,
0 0
}}; }};
}; };
resource rControlTemplate (NCWindow+rad320) { resource rControlTemplate (NCWindow+rad320) {
rad320, rad320,
@ -757,8 +757,8 @@ resource rControlTemplate (NCWindow+rad320) {
0, 0,
NCWindow+rad320, /* Title ref */ NCWindow+rad320, /* Title ref */
1 /* initial value */ 1 /* initial value */
}}; }};
}; };
resource rPString (NCWindow+rad320) {"320 x 200"}; resource rPString (NCWindow+rad320) {"320 x 200"};
resource rControlTemplate (NCWindow+txtColor) { resource rControlTemplate (NCWindow+txtColor) {
@ -769,8 +769,8 @@ resource rControlTemplate (NCWindow+txtColor) {
$1002, $1002,
0, 0,
NCWindow+txtColor /* Title ref */ NCWindow+txtColor /* Title ref */
}}; }};
}; };
resource rTextForLETextBox2 (NCWindow+txtColor) {"Color"}; resource rTextForLETextBox2 (NCWindow+txtColor) {"Color"};
resource rControlTemplate (NCWindow+rad640) { resource rControlTemplate (NCWindow+rad640) {
@ -782,8 +782,8 @@ resource rControlTemplate (NCWindow+rad640) {
0, 0,
NCWindow+rad640, /* Title ref */ NCWindow+rad640, /* Title ref */
0 /* initial value */ 0 /* initial value */
}}; }};
}; };
resource rPString (NCWindow+rad640) {"640 x 200"}; resource rPString (NCWindow+rad640) {"640 x 200"};
resource rControlTemplate (NCWindow+txtGray) { resource rControlTemplate (NCWindow+txtGray) {
@ -794,8 +794,8 @@ resource rControlTemplate (NCWindow+txtGray) {
$1002, $1002,
0, 0,
NCWindow+txtGray /* Title ref */ NCWindow+txtGray /* Title ref */
}}; }};
}; };
resource rTextForLETextBox2 (NCWindow+txtGray) {"Grayscale"}; resource rTextForLETextBox2 (NCWindow+txtGray) {"Grayscale"};
resource rControlTemplate (NCWindow+chkShared) { resource rControlTemplate (NCWindow+chkShared) {
@ -807,8 +807,8 @@ resource rControlTemplate (NCWindow+chkShared) {
0, 0,
NCWindow+chkShared, /* Title ref */ NCWindow+chkShared, /* Title ref */
1 /* initial value */ 1 /* initial value */
}}; }};
}; };
resource rPString (NCWindow+chkShared) {"Request Shared Session"}; resource rPString (NCWindow+chkShared) {"Request Shared Session"};
resource rControlTemplate (NCWindow+chkClipboard) { resource rControlTemplate (NCWindow+chkClipboard) {
@ -820,8 +820,8 @@ resource rControlTemplate (NCWindow+chkClipboard) {
0, 0,
NCWindow+chkClipboard, /* Title ref */ NCWindow+chkClipboard, /* Title ref */
1 /* initial value */ 1 /* initial value */
}}; }};
}; };
resource rPString (NCWindow+chkClipboard) {"Allow Clipboard"}; resource rPString (NCWindow+chkClipboard) {"Allow Clipboard"};
resource rControlTemplate (NCWindow+txtTransfers) { resource rControlTemplate (NCWindow+txtTransfers) {
@ -832,8 +832,8 @@ resource rControlTemplate (NCWindow+txtTransfers) {
$1002, $1002,
0, 0,
NCWindow+txtTransfers /* Title ref */ NCWindow+txtTransfers /* Title ref */
}}; }};
}; };
resource rTextForLETextBox2 (NCWindow+txtTransfers) {"Transfers from Server"}; resource rTextForLETextBox2 (NCWindow+txtTransfers) {"Transfers from Server"};
resource rControlTemplate (NCWindow+chkEmul3Btn) { resource rControlTemplate (NCWindow+chkEmul3Btn) {
@ -845,8 +845,8 @@ resource rControlTemplate (NCWindow+chkEmul3Btn) {
0, 0,
NCWindow+chkEmul3Btn, /* Title ref */ NCWindow+chkEmul3Btn, /* Title ref */
1 /* initial value */ 1 /* initial value */
}}; }};
}; };
resource rPString (NCWindow+chkEmul3Btn) {"Emulate 3-Button Mouse"}; resource rPString (NCWindow+chkEmul3Btn) {"Emulate 3-Button Mouse"};
resource rControlTemplate (NCWindow+chkViewOnly) { resource rControlTemplate (NCWindow+chkViewOnly) {
@ -858,8 +858,8 @@ resource rControlTemplate (NCWindow+chkViewOnly) {
0, 0,
NCWindow+chkViewOnly, /* Title ref */ NCWindow+chkViewOnly, /* Title ref */
0 /* initial value */ 0 /* initial value */
}}; }};
}; };
resource rPString (NCWindow+chkViewOnly) {"View Only Mode"}; resource rPString (NCWindow+chkViewOnly) {"View Only Mode"};
resource rControlTemplate (NCWindow+txtPreferredEncoding) { resource rControlTemplate (NCWindow+txtPreferredEncoding) {
@ -870,8 +870,8 @@ resource rControlTemplate (NCWindow+txtPreferredEncoding) {
$1002, $1002,
0, 0,
NCWindow+txtPreferredEncoding /* Title ref */ NCWindow+txtPreferredEncoding /* Title ref */
}}; }};
}; };
resource rTextForLETextBox2 (NCWindow+txtPreferredEncoding) {"Preferred Encoding:"}; resource rTextForLETextBox2 (NCWindow+txtPreferredEncoding) {"Preferred Encoding:"};
resource rControlTemplate (NCWindow+radRaw) { resource rControlTemplate (NCWindow+radRaw) {
@ -883,8 +883,8 @@ resource rControlTemplate (NCWindow+radRaw) {
0, 0,
NCWindow+radRaw, /* Title ref */ NCWindow+radRaw, /* Title ref */
1 /* initial value */ 1 /* initial value */
}}; }};
}; };
resource rPString (NCWindow+radRaw) {"Raw"}; resource rPString (NCWindow+radRaw) {"Raw"};
resource rControlTemplate (NCWindow+radHextile) { resource rControlTemplate (NCWindow+radHextile) {
@ -896,8 +896,8 @@ resource rControlTemplate (NCWindow+radHextile) {
0, 0,
NCWindow+radHextile, /* Title ref */ NCWindow+radHextile, /* Title ref */
0 /* initial value */ 0 /* initial value */
}}; }};
}; };
resource rPString (NCWindow+radHextile) {"Hextile"}; resource rPString (NCWindow+radHextile) {"Hextile"};
@ -920,7 +920,7 @@ resource rWindParam1 (1002) {
infront, /* wPlane */ infront, /* wPlane */
nil, /* wStorage */ nil, /* wStorage */
$0000 /* wInVerb */ $0000 /* wInVerb */
}; };
resource rPString(10002) {"Press \$11. to cancel."}; resource rPString(10002) {"Press \$11. to cancel."};
@ -944,7 +944,7 @@ resource rWindParam1 (1003) {
infront, /* wPlane */ infront, /* wPlane */
nil, /* wStorage */ nil, /* wStorage */
$0800 /* wInVerb */ $0800 /* wInVerb */
}; };
/* 320 mode */ /* 320 mode */
resource rWindParam1 (1004) { resource rWindParam1 (1004) {
@ -964,7 +964,7 @@ resource rWindParam1 (1004) {
infront, /* wPlane */ infront, /* wPlane */
nil, /* wStorage */ nil, /* wStorage */
$0800 /* wInVerb */ $0800 /* wInVerb */
}; };
resource rWindColor (1) { resource rWindColor (1) {
0x0000, 0x0000,
@ -972,4 +972,4 @@ resource rWindColor (1) {
0x020F, 0x020F,
0xF0AA, 0xF0AA,
0x00F0 0x00F0
}; };