#include #include #include #include #include #include #include #include #include #include #include #include "vnc.h" /* ------------------------------------------------------------------ */ static void usage(FILE *fp) { fprintf(fp, "This is a simple vnc client\n" "\n" "usage: vnc-client [options] hostname displayno\n" "options:\n" " -h Print this text.\n" " -k Send locally translated keysyms. Default is to send\n" " us-layout keysyms no matter what the local kbd layout is.\n" "\n" "-- \n" "(c) 2006 Gerd Hoffmann \n"); } int main(int argc, char *argv[]) { int keysyms = 0; int c; gtk_init(&argc, &argv); for (;;) { if (-1 == (c = getopt(argc, argv, "hk"))) break; switch (c) { case 'k': keysyms = 1; break; case 'h': usage(stdout); exit(0); default: usage(stderr); exit(1); } } if (optind+2 > argc) { usage(stderr); exit(1); } if (NULL == vnc_open(argv[optind], atoi(argv[optind+1]), 1, keysyms)) exit(1); gtk_main(); fprintf(stderr,"bye...\n"); exit(0); }