#ifndef lint static char rcsid[] = "$XConsortium: oclock.c,v 1.6 89/07/21 13:44:46 jim Exp $"; #endif /* lint */ #include #include #include #include #include "Clock.h" #include #include "oclock.bit" #include "oclmask.bit" extern void exit(); /* Command line options table. Only resources are entered here...there is a pass over the remaining options after XtParseCommand is let loose. */ /* Exit with message describing command line format */ void usage() { fprintf(stderr, "usage: oclock\n"); fprintf (stderr, " [-geometry [{width}][x{height}][{+-}{xoff}[{+-}{yoff}]]] [-display [{host}]:[{vs}]]\n"); fprintf(stderr, " [-fg {color}] [-bg {color}] [-bd {color}] [-bw {pixels}]\n"); fprintf(stderr, " [-minute {color}] [-hour {color}] [-jewel {color}]\n"); fprintf(stderr, " [-backing {backing-store}]\n"); exit(1); } static XrmOptionDescRec options[] = { {"-fg", "*Foreground", XrmoptionSepArg, NULL}, {"-bg", "*Background", XrmoptionSepArg, NULL}, {"-foreground", "*Foreground", XrmoptionSepArg, NULL}, {"-background", "*Background", XrmoptionSepArg, NULL}, {"-minute", "*clock.minute", XrmoptionSepArg, NULL}, {"-hour", "*clock.hour", XrmoptionSepArg, NULL}, {"-jewel", "*clock.jewel", XrmoptionSepArg, NULL}, {"-backing", "*clock.backingStore", XrmoptionSepArg, NULL}, #ifdef SHAPE {"-shape", "*clock.shapeWindow", XrmoptionNoArg, "TRUE"}, {"-noshape", "*clock.shapeWindow", XrmoptionNoArg, "FALSE"}, #endif }; void main(argc, argv) int argc; char **argv; { char host[256]; Widget toplevel; Widget clock; Arg arg[2]; int i; toplevel = XtInitialize("main", "Clock", options, XtNumber (options), &argc, argv); if (argc != 1) usage(); i = 0; XtSetArg (arg[i], XtNiconPixmap, XCreateBitmapFromData (XtDisplay(toplevel), XtScreen(toplevel)->root, oclock_bits, oclock_width, oclock_height)); i++; XtSetArg (arg[i], XtNiconMask, XCreateBitmapFromData (XtDisplay(toplevel), XtScreen(toplevel)->root, oclmask_bits, oclmask_width, oclmask_height)); i++; XtSetValues (toplevel, arg, i); clock = XtCreateManagedWidget ("clock", clockWidgetClass, toplevel, NULL, 0); XtRealizeWidget (toplevel); XtMainLoop(); }