13 #ifndef LIBVNCSERVER_ALLOW24BPP
15 printf(
"I need the ALLOW24BPP LibVNCServer flag to work\n");
22 if(down && (key==
XK_Escape || key==
'q' || key==
'Q'))
26 int main(
int argc,
char** argv)
31 rfbScreenInfoPtr rfbScreen;
34 in=fopen(argv[1],
"rb");
36 printf(
"Couldn't find file %s.\n",argv[1]);
41 fgets(buffer,1024,in);
42 if(strncmp(buffer,
"P6",2)) {
43 printf(
"Not a ppm.\n");
49 fgets(buffer,1024,in);
50 }
while(buffer[0]==
'#');
55 fgets(buffer,1024,in);
63 paddedWidth+=4-(
width&3);
70 rfbScreen->desktopName = argv[1];
72 rfbScreen->desktopName =
"Picture";
73 rfbScreen->alwaysShared =
TRUE;
74 rfbScreen->kbdAddEvent = HandleKey;
77 rfbScreen->httpDir =
"../webclients";
80 rfbScreen->frameBuffer = (
char*)malloc(paddedWidth*3*
height);
81 if(!rfbScreen->frameBuffer)
87 if(
width != paddedWidth) {
88 int padCount = 3*(paddedWidth -
width);
90 memmove(rfbScreen->frameBuffer+3*paddedWidth*j,
91 rfbScreen->frameBuffer+3*
width*j,
93 memset(rfbScreen->frameBuffer+3*paddedWidth*(j+1)-padCount,
void rfbInitServer(rfbScreenInfoPtr rfbScreen)
void rfbRunEventLoop(rfbScreenInfoPtr screenInfo, long usec, rfbBool runInBackground)
void rfbCloseClient(rfbClientPtr cl)
rfbScreenInfoPtr rfbGetScreen(int *argc, char **argv, int width, int height, int bitsPerSample, int samplesPerPixel, int bytesPerPixel)