2016-05-14 00:35:41 +00:00
|
|
|
#if __ORCAC__
|
|
|
|
#pragma lint -1
|
2015-09-24 00:40:17 +00:00
|
|
|
#pragma noroot
|
2016-05-14 02:44:12 +00:00
|
|
|
segment "VNCview GS";
|
2016-05-14 00:35:41 +00:00
|
|
|
#endif
|
2015-09-24 00:40:17 +00:00
|
|
|
|
|
|
|
#include <window.h>
|
|
|
|
#include <quickdraw.h>
|
|
|
|
#include <qdaux.h>
|
|
|
|
#include <desk.h>
|
|
|
|
#include <memory.h>
|
|
|
|
#include <resources.h>
|
|
|
|
#include <tcpip.h>
|
|
|
|
#include <menu.h>
|
|
|
|
#include <control.h>
|
|
|
|
#include <misctool.h>
|
|
|
|
#include <scrap.h>
|
|
|
|
#include <stdio.h>
|
|
|
|
#include <stdlib.h>
|
|
|
|
#include <event.h>
|
|
|
|
#include <limits.h>
|
|
|
|
|
|
|
|
#include "vncsession.h"
|
|
|
|
#include "vncview.h"
|
|
|
|
#include "vncdisplay.h"
|
|
|
|
#include "colortables.h"
|
|
|
|
#include "menus.h"
|
|
|
|
#include "clipboard.h"
|
|
|
|
#include "desktopsize.h"
|
|
|
|
#include "mouse.h"
|
|
|
|
#include "keyboard.h"
|
|
|
|
#include "copyrect.h"
|
|
|
|
#include "raw.h"
|
|
|
|
#include "hextile.h"
|
|
|
|
|
|
|
|
/* This prototype should be in <window.h> but is bogusly commented out there */
|
|
|
|
extern pascal void SetContentOrigin2(Word, Word, Word, GrafPortPtr) inline(0x570E,dispatcher);
|
|
|
|
|
|
|
|
void DoDesktopSize (void) {
|
2015-09-24 01:26:03 +00:00
|
|
|
#define screenTooBigError 2010
|
2015-09-24 00:40:17 +00:00
|
|
|
unsigned long contentOrigin;
|
2015-09-24 01:26:03 +00:00
|
|
|
Point * contentOriginPtr = (void *) &contentOrigin;
|
2015-09-24 00:40:17 +00:00
|
|
|
unsigned int newX, newY;
|
|
|
|
Boolean changeOrigin = FALSE;
|
|
|
|
unsigned int oldWinHeight, oldWinWidth;
|
|
|
|
|
|
|
|
fbWidth = rectWidth;
|
|
|
|
fbHeight = rectHeight;
|
|
|
|
|
|
|
|
if ((fbWidth > 16384) || (fbHeight > 16384)) {
|
|
|
|
AlertWindow(awResource, NULL, screenTooBigError);
|
2015-09-24 01:26:03 +00:00
|
|
|
DoClose(vncWindow);
|
2015-09-24 01:56:33 +00:00
|
|
|
}
|
2015-09-24 00:40:17 +00:00
|
|
|
|
|
|
|
oldWinHeight = winHeight;
|
|
|
|
oldWinWidth = winWidth;
|
2016-05-14 02:44:12 +00:00
|
|
|
winHeight = WIN_HEIGHT;
|
|
|
|
winWidth = (hRez == 640) ? WIN_WIDTH_640 : WIN_WIDTH_320;
|
2015-09-24 00:40:17 +00:00
|
|
|
if (fbWidth < winWidth)
|
2015-09-24 01:26:03 +00:00
|
|
|
winWidth = fbWidth;
|
2015-09-24 00:40:17 +00:00
|
|
|
if (fbHeight < winHeight)
|
2015-09-24 01:26:03 +00:00
|
|
|
winHeight = fbHeight;
|
2015-09-24 00:40:17 +00:00
|
|
|
if (oldWinHeight != winHeight || oldWinWidth != winWidth)
|
2015-09-24 01:26:03 +00:00
|
|
|
SizeWindow(winWidth, winHeight, vncWindow);
|
2015-09-24 00:40:17 +00:00
|
|
|
|
|
|
|
/* Scroll if area displayed is going away */
|
|
|
|
contentOrigin = GetContentOrigin(vncWindow);
|
|
|
|
newX = contentOriginPtr->h;
|
|
|
|
newY = contentOriginPtr->v;
|
|
|
|
|
|
|
|
if (contentOriginPtr->h + winWidth > fbWidth) {
|
2015-09-24 01:26:03 +00:00
|
|
|
newX = fbWidth - winWidth;
|
2015-09-24 00:40:17 +00:00
|
|
|
changeOrigin = TRUE;
|
2015-09-24 01:56:33 +00:00
|
|
|
}
|
2015-09-24 00:40:17 +00:00
|
|
|
if (contentOriginPtr->v + winHeight > fbHeight) {
|
2015-09-24 01:26:03 +00:00
|
|
|
newY = fbHeight - winHeight;
|
2015-09-24 00:40:17 +00:00
|
|
|
changeOrigin = TRUE;
|
2015-09-24 01:56:33 +00:00
|
|
|
}
|
2015-09-24 00:40:17 +00:00
|
|
|
SetContentOrigin2(1, newX, newY, vncWindow);
|
|
|
|
|
|
|
|
SetDataSize(fbWidth, fbHeight, vncWindow);
|
|
|
|
DrawControls(vncWindow);
|
|
|
|
|
|
|
|
displayInProgress = FALSE;
|
|
|
|
|
2015-09-24 01:26:03 +00:00
|
|
|
NextRect(); /* Prepare for next rect */
|
2015-09-24 01:56:33 +00:00
|
|
|
}
|
2015-09-24 00:40:17 +00:00
|
|
|
|