Added simple examples

pull/1/head
dscho 20 years ago
parent 1694a57460
commit 1e60fc200a

@ -1,3 +1,4 @@
added simple and simple15 example (really simple examples)
long standing http bug (.jar was sent twice) fixed by a friend of Karl named Mike
http options in cargs
when closing a client and no longer listening for new ones, don't crash

@ -10,3 +10,6 @@ vncev
Makefile.in
.deps
colourmaptest
simple
simple15

@ -12,7 +12,7 @@ endif
noinst_HEADERS=radon.h
noinst_PROGRAMS=example pnmshow regiontest pnmshow24 fontsel \
vncev storepasswd colourmaptest $(BACKGROUND_TEST) $(MAC)
vncev storepasswd colourmaptest simple simple15 $(BACKGROUND_TEST) $(MAC)
LDADD = ../libvncserver.a

@ -86,7 +86,7 @@ CFLAGS = -I..
noinst_HEADERS = radon.h
noinst_PROGRAMS = example pnmshow regiontest pnmshow24 fontsel \
vncev storepasswd colourmaptest $(BACKGROUND_TEST) $(MAC)
vncev storepasswd colourmaptest simple simple15 $(BACKGROUND_TEST) $(MAC)
LDADD = ../libvncserver.a
@ -102,7 +102,8 @@ CONFIG_CLEAN_FILES =
@HAVE_LIBPTHREAD_FALSE@@OSX_TRUE@ vncev$(EXEEXT) \
@HAVE_LIBPTHREAD_FALSE@@OSX_TRUE@ storepasswd$(EXEEXT) \
@HAVE_LIBPTHREAD_FALSE@@OSX_TRUE@ colourmaptest$(EXEEXT) \
@HAVE_LIBPTHREAD_FALSE@@OSX_TRUE@ mac$(EXEEXT)
@HAVE_LIBPTHREAD_FALSE@@OSX_TRUE@ simple$(EXEEXT) \
@HAVE_LIBPTHREAD_FALSE@@OSX_TRUE@ simple15$(EXEEXT) mac$(EXEEXT)
@HAVE_LIBPTHREAD_FALSE@@OSX_FALSE@noinst_PROGRAMS = example$(EXEEXT) \
@HAVE_LIBPTHREAD_FALSE@@OSX_FALSE@ pnmshow$(EXEEXT) \
@HAVE_LIBPTHREAD_FALSE@@OSX_FALSE@ regiontest$(EXEEXT) \
@ -110,7 +111,9 @@ CONFIG_CLEAN_FILES =
@HAVE_LIBPTHREAD_FALSE@@OSX_FALSE@ fontsel$(EXEEXT) \
@HAVE_LIBPTHREAD_FALSE@@OSX_FALSE@ vncev$(EXEEXT) \
@HAVE_LIBPTHREAD_FALSE@@OSX_FALSE@ storepasswd$(EXEEXT) \
@HAVE_LIBPTHREAD_FALSE@@OSX_FALSE@ colourmaptest$(EXEEXT)
@HAVE_LIBPTHREAD_FALSE@@OSX_FALSE@ colourmaptest$(EXEEXT) \
@HAVE_LIBPTHREAD_FALSE@@OSX_FALSE@ simple$(EXEEXT) \
@HAVE_LIBPTHREAD_FALSE@@OSX_FALSE@ simple15$(EXEEXT)
@HAVE_LIBPTHREAD_TRUE@@OSX_TRUE@noinst_PROGRAMS = example$(EXEEXT) \
@HAVE_LIBPTHREAD_TRUE@@OSX_TRUE@ pnmshow$(EXEEXT) \
@HAVE_LIBPTHREAD_TRUE@@OSX_TRUE@ regiontest$(EXEEXT) \
@ -118,6 +121,8 @@ CONFIG_CLEAN_FILES =
@HAVE_LIBPTHREAD_TRUE@@OSX_TRUE@ fontsel$(EXEEXT) vncev$(EXEEXT) \
@HAVE_LIBPTHREAD_TRUE@@OSX_TRUE@ storepasswd$(EXEEXT) \
@HAVE_LIBPTHREAD_TRUE@@OSX_TRUE@ colourmaptest$(EXEEXT) \
@HAVE_LIBPTHREAD_TRUE@@OSX_TRUE@ simple$(EXEEXT) \
@HAVE_LIBPTHREAD_TRUE@@OSX_TRUE@ simple15$(EXEEXT) \
@HAVE_LIBPTHREAD_TRUE@@OSX_TRUE@ blooptest$(EXEEXT) mac$(EXEEXT)
@HAVE_LIBPTHREAD_TRUE@@OSX_FALSE@noinst_PROGRAMS = example$(EXEEXT) \
@HAVE_LIBPTHREAD_TRUE@@OSX_FALSE@ pnmshow$(EXEEXT) \
@ -127,6 +132,8 @@ CONFIG_CLEAN_FILES =
@HAVE_LIBPTHREAD_TRUE@@OSX_FALSE@ vncev$(EXEEXT) \
@HAVE_LIBPTHREAD_TRUE@@OSX_FALSE@ storepasswd$(EXEEXT) \
@HAVE_LIBPTHREAD_TRUE@@OSX_FALSE@ colourmaptest$(EXEEXT) \
@HAVE_LIBPTHREAD_TRUE@@OSX_FALSE@ simple$(EXEEXT) \
@HAVE_LIBPTHREAD_TRUE@@OSX_FALSE@ simple15$(EXEEXT) \
@HAVE_LIBPTHREAD_TRUE@@OSX_FALSE@ blooptest$(EXEEXT)
PROGRAMS = $(noinst_PROGRAMS)
@ -169,6 +176,16 @@ regiontest_OBJECTS = regiontest.$(OBJEXT)
regiontest_LDADD = $(LDADD)
regiontest_DEPENDENCIES = ../libvncserver.a
regiontest_LDFLAGS =
simple_SOURCES = simple.c
simple_OBJECTS = simple.$(OBJEXT)
simple_LDADD = $(LDADD)
simple_DEPENDENCIES = ../libvncserver.a
simple_LDFLAGS =
simple15_SOURCES = simple15.c
simple15_OBJECTS = simple15.$(OBJEXT)
simple15_LDADD = $(LDADD)
simple15_DEPENDENCIES = ../libvncserver.a
simple15_LDFLAGS =
storepasswd_SOURCES = storepasswd.c
storepasswd_OBJECTS = storepasswd.$(OBJEXT)
storepasswd_LDADD = $(LDADD)
@ -190,17 +207,19 @@ depcomp = $(SHELL) $(top_srcdir)/depcomp
@AMDEP_TRUE@ $(DEPDIR)/colourmaptest.Po $(DEPDIR)/example.Po \
@AMDEP_TRUE@ $(DEPDIR)/fontsel.Po $(DEPDIR)/mac.Po \
@AMDEP_TRUE@ $(DEPDIR)/pnmshow.Po $(DEPDIR)/pnmshow24.Po \
@AMDEP_TRUE@ $(DEPDIR)/regiontest.Po $(DEPDIR)/storepasswd.Po \
@AMDEP_TRUE@ $(DEPDIR)/regiontest.Po $(DEPDIR)/simple.Po \
@AMDEP_TRUE@ $(DEPDIR)/simple15.Po $(DEPDIR)/storepasswd.Po \
@AMDEP_TRUE@ $(DEPDIR)/vncev.Po
COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \
$(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
LINK = $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) $(LDFLAGS) -o $@
DIST_SOURCES = blooptest.c colourmaptest.c example.c fontsel.c mac.c \
pnmshow.c pnmshow24.c regiontest.c storepasswd.c vncev.c
pnmshow.c pnmshow24.c regiontest.c simple.c simple15.c \
storepasswd.c vncev.c
HEADERS = $(noinst_HEADERS)
DIST_COMMON = $(noinst_HEADERS) Makefile.am Makefile.in
SOURCES = blooptest.c colourmaptest.c example.c fontsel.c mac.c pnmshow.c pnmshow24.c regiontest.c storepasswd.c vncev.c
SOURCES = blooptest.c colourmaptest.c example.c fontsel.c mac.c pnmshow.c pnmshow24.c regiontest.c simple.c simple15.c storepasswd.c vncev.c
all: all-am
@ -240,6 +259,12 @@ pnmshow24$(EXEEXT): $(pnmshow24_OBJECTS) $(pnmshow24_DEPENDENCIES)
regiontest$(EXEEXT): $(regiontest_OBJECTS) $(regiontest_DEPENDENCIES)
@rm -f regiontest$(EXEEXT)
$(LINK) $(regiontest_LDFLAGS) $(regiontest_OBJECTS) $(regiontest_LDADD) $(LIBS)
simple$(EXEEXT): $(simple_OBJECTS) $(simple_DEPENDENCIES)
@rm -f simple$(EXEEXT)
$(LINK) $(simple_LDFLAGS) $(simple_OBJECTS) $(simple_LDADD) $(LIBS)
simple15$(EXEEXT): $(simple15_OBJECTS) $(simple15_DEPENDENCIES)
@rm -f simple15$(EXEEXT)
$(LINK) $(simple15_LDFLAGS) $(simple15_OBJECTS) $(simple15_LDADD) $(LIBS)
storepasswd$(EXEEXT): $(storepasswd_OBJECTS) $(storepasswd_DEPENDENCIES)
@rm -f storepasswd$(EXEEXT)
$(LINK) $(storepasswd_LDFLAGS) $(storepasswd_OBJECTS) $(storepasswd_LDADD) $(LIBS)
@ -261,6 +286,8 @@ distclean-compile:
@AMDEP_TRUE@@am__include@ @am__quote@$(DEPDIR)/pnmshow.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@$(DEPDIR)/pnmshow24.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@$(DEPDIR)/regiontest.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@$(DEPDIR)/simple.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@$(DEPDIR)/simple15.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@$(DEPDIR)/storepasswd.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@$(DEPDIR)/vncev.Po@am__quote@

@ -0,0 +1,10 @@
#include <rfb/rfb.h>
int main(int argc,char** argv)
{
rfbScreenInfoPtr server=rfbGetScreen(&argc,argv,400,300,8,3,4);
server->frameBuffer=malloc(400*300*4);
rfbInitServer(server);
rfbRunEventLoop(server,-1,FALSE);
return(0);
}

@ -0,0 +1,24 @@
/* This example shows how to use 15-bit (which is handled as 16-bit
internally). */
#include <rfb/rfb.h>
int main(int argc,char** argv)
{
int i,j;
uint16_t* f;
rfbScreenInfoPtr server=rfbGetScreen(&argc,argv,400,300,5,3,2);
server->frameBuffer=malloc(400*300*2);
f=(uint16_t*)server->frameBuffer;
for(j=0;j<300;j++)
for(i=0;i<400;i++)
f[j*400+i]=/* red */ ((j*32/300) << 10) |
/* green */ (((j+400-i)*32/700) << 5) |
/* blue */ ((i*32/400));
rfbInitServer(server);
rfbRunEventLoop(server,-1,FALSE);
return(0);
}

@ -66,7 +66,7 @@ libvncserver; try CVS until I release 0.6.
The simplest server looks like this:<br><br>
<pre>
#include <rfb/rfb.h>
#include &lt;rfb/rfb.h&gt;
int main(int argc,char** argv)
{

Loading…
Cancel
Save