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

View File

@ -60,7 +60,7 @@ void DoCopyRect (void) {
SendFBUpdateRequest(FALSE, rectX, rectY, rectWidth, rectHeight);
displayInProgress = FALSE;
return;
}
}
/* 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.
@ -71,5 +71,5 @@ void DoCopyRect (void) {
displayInProgress = FALSE;
NextRect(); /* Prepare for next rect */
}
}

View File

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

View File

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

View File

@ -38,10 +38,10 @@ void SendKeyEvent (BOOLEAN keyDownFlag, unsigned long key)
unsigned char keyDownFlag;
unsigned int padding;
unsigned long key;
} keyEvent = { 4 /* Message Type 4 */,
0,
0 /* Zero the padding */
};
} keyEvent = { 4 /* Message Type 4 */,
0,
0 /* Zero the padding */
};
keyEvent.keyDownFlag = !!keyDownFlag;
keyEvent.key = SwapBytes4(key);
@ -83,8 +83,8 @@ void ProcessKeyEvent (void)
case 0x77: key = 0xFF57; break; /* End */
case 0x74: key = 0xFF55; break; /* Page Up */
case 0x79: key = 0xFF56; break; /* Page Down */
}
}
}
if (key == 0x7f)
key = 0xFF08; /* Delete -> BackSpace */
@ -98,7 +98,7 @@ void ProcessKeyEvent (void)
key += 0x40; /* Undo effect of control on upper-case char. */
else
key += 0x60; /* Undo effect of control */
}
}
else switch (key) {
case 0x1B: key = 0xFF1B; break; /* Escape */
case 0x09: key = 0xFF09; break; /* Tab */
@ -108,8 +108,8 @@ void ProcessKeyEvent (void)
case 0x15: key = 0xFF53; break; /* Right arrow */
case 0x0A: key = 0xFF54; break; /* Down arrow */
case 0x18: key = 0xFF0B; break; /* Clear / NumLock -> Clear */
}
}
}
/* 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

View File

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

66
raw.cc
View File

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

View File

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

View File

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

View File

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

View File

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