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'))
26int 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]==
'#');
54 printf(
"Failed to get width or height.\n");
58 fgets(buffer,1024,in);
66 paddedWidth+=4-(
width&3);
73 rfbScreen->desktopName = argv[1];
75 rfbScreen->desktopName =
"Picture";
76 rfbScreen->alwaysShared =
TRUE;
77 rfbScreen->kbdAddEvent = HandleKey;
80 rfbScreen->httpDir =
"../webclients";
83 if (paddedWidth>SIZE_MAX/3 || (
height!=0 && paddedWidth*3>SIZE_MAX/
height))
85 rfbScreen->frameBuffer = (
char*)malloc(paddedWidth*3*
height);
86 if(!rfbScreen->frameBuffer)
92 if(
width != paddedWidth) {
93 int padCount = 3*(paddedWidth -
width);
95 memmove(rfbScreen->frameBuffer+3*paddedWidth*j,
96 rfbScreen->frameBuffer+3*
width*j,
98 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)