summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authordscho <dscho>2005-01-20 14:22:48 +0000
committerdscho <dscho>2005-01-20 14:22:48 +0000
commit80ca7cf1d324366836f3b55c786cad45fa9680ce (patch)
treedcac9311478e92801ddedf232c9cc1ff1427a318
parentcafeb40fed7b08b2c21e30445837101a50f088c2 (diff)
downloadlibtdevnc-80ca7cf1.tar.gz
libtdevnc-80ca7cf1.zip
no need to strdup for MakeXCursor
-rwxr-xr-xtest/cursortest.c15
1 files changed, 10 insertions, 5 deletions
diff --git a/test/cursortest.c b/test/cursortest.c
index 79ab6e9..195fc60 100755
--- a/test/cursortest.c
+++ b/test/cursortest.c
@@ -72,7 +72,7 @@ void SetXCursor(rfbScreenInfoPtr rfbScreen)
"xxxx xxxx";
rfbCursorPtr c;
- c=rfbMakeXCursor(width,height,strdup(cursor),strdup(mask));
+ c=rfbMakeXCursor(width,height,cursor,mask);
c->xhot=width/2;c->yhot=height/2;
rfbSetCursor(rfbScreen, c);
@@ -128,7 +128,7 @@ void SetXCursor2(rfbScreenInfoPtr rfbScreen)
" ";
rfbCursorPtr c;
- c=rfbMakeXCursor(width,height,strdup(cursor),strdup(mask));
+ c=rfbMakeXCursor(width,height,cursor,mask);
c->xhot=0;c->yhot=0;
rfbSetCursor(rfbScreen, c);
@@ -176,7 +176,7 @@ void SetRichCursor(rfbScreenInfoPtr rfbScreen)
" xxxxxxxxxxxxxxxx "
" ";
- c=rfbMakeXCursor(w,h,strdup(bitmap),strdup(bitmap));
+ c=rfbMakeXCursor(w,h,bitmap,bitmap);
c->xhot = 16; c->yhot = 24;
c->richSource = (char*)malloc(w*h*bpp);
@@ -215,7 +215,7 @@ void SetRichCursor2(rfbScreenInfoPtr rfbScreen)
"xxxxxxxxxxxxx x"
"xxxxxxxxxxxxx x";
/* c=rfbScreen->cursor = rfbMakeXCursor(w,h,bitmap,bitmap); */
- c=rfbMakeXCursor(w,h,strdup(bitmap),strdup(bitmap));
+ c=rfbMakeXCursor(w,h,bitmap,bitmap);
c->xhot = 5; c->yhot = 7;
c->richSource = (char*)malloc(w*h*bpp);
@@ -299,6 +299,11 @@ void doptr(int buttonMask,int x,int y,rfbClientPtr cl)
counter=0;
}
}
+ if(buttonMask&2) {
+ rfbScreenCleanup(cl->screen);
+ exit(0);
+ }
+
if(buttonMask&4)
rfbCloseClient(cl);
@@ -327,7 +332,7 @@ int main(int argc,char** argv)
rfbInitServer(rfbScreen);
rfbLog("Change cursor shape with left mouse button,\n\t"
- "quit with right one.\n");
+ "quit with right one (middle button quits server).\n");
/* this is the blocking event loop, i.e. it never returns */
/* 40000 are the microseconds to wait on select(), i.e. 0.04 seconds */