summaryrefslogtreecommitdiffstats
path: root/mac.c
diff options
context:
space:
mode:
authordscho <dscho>2001-12-21 15:27:10 +0000
committerdscho <dscho>2001-12-21 15:27:10 +0000
commit1d514588737cc744b74848464343cfa2056866ae (patch)
tree7bd5c653c93efd3c34a15f63e222c311898d2c4a /mac.c
parentcddeb0d9d261d0a7f6e987c69d6123f5aedeebbe (diff)
downloadlibtdevnc-1d514588737cc744b74848464343cfa2056866ae.tar.gz
libtdevnc-1d514588737cc744b74848464343cfa2056866ae.zip
shared mode added
Diffstat (limited to 'mac.c')
-rw-r--r--mac.c17
1 files changed, 15 insertions, 2 deletions
diff --git a/mac.c b/mac.c
index 94ef5d2..ff37f01 100644
--- a/mac.c
+++ b/mac.c
@@ -266,6 +266,8 @@ PtrAddEvent(buttonMask, x, y, cl)
(buttonMask & (1 << 7)) ? TRUE : FALSE);
}
+Bool viewOnly = FALSE, sharedMode = FALSE;
+
void
ScreenInit(int argc, char**argv)
{
@@ -278,8 +280,15 @@ ScreenInit(int argc, char**argv)
rfbScreen->paddedWidthInBytes = CGDisplayBytesPerRow(kCGDirectMainDisplay);
rfbScreen->frameBuffer =
(char *)CGDisplayBaseAddress(kCGDirectMainDisplay);
- rfbScreen->ptrAddEvent = PtrAddEvent;
- rfbScreen->kbdAddEvent = KbdAddEvent;
+
+ if(!viewOnly) {
+ rfbScreen->ptrAddEvent = PtrAddEvent;
+ rfbScreen->kbdAddEvent = KbdAddEvent;
+ }
+ if(sharedMode) {
+ rfbScreen->rfbAlwaysShared = TRUE;
+ }
+
rfbInitServer(rfbScreen);
}
@@ -321,6 +330,10 @@ int main(int argc,char *argv[])
startTime = time(0);
} else if(strcmp(argv[i],"-runforever")==0) {
disconnectAfterFirstClient = FALSE;
+ } else if(strcmp(argv[i],"-viewonly")==0) {
+ viewOnly=TRUE;
+ } else if(strcmp(argv[i],"-shared")==0) {
+ sharedMode=TRUE;
}
ScreenInit(argc,argv);