R6.6 is the Xorg base-line

parents
This diff is collapsed.
/*
* $Xorg: Clock.h,v 1.4 2001/02/09 02:05:39 xorgcvs Exp $
*/
/***********************************************************
Copyright 1987, 1988, 1998 The Open Group
Permission to use, copy, modify, distribute, and sell this software and its
documentation for any purpose is hereby granted without fee, provided that
the above copyright notice appear in all copies and that both that
copyright notice and this permission notice appear in supporting
documentation.
The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
Except as contained in this notice, the name of The Open Group shall not be
used in advertising or otherwise to promote the sale, use or other dealings
in this Software without prior written authorization from The Open Group.
Copyright 1987, 1988 by Digital Equipment Corporation, Maynard, Massachusetts.
All Rights Reserved
Permission to use, copy, modify, and distribute this software and its
documentation for any purpose and without fee is hereby granted,
provided that the above copyright notice appear in all copies and that
both that copyright notice and this permission notice appear in
supporting documentation, and that the name of Digital not be
used in advertising or publicity pertaining to distribution of the
software without specific, written prior permission.
DIGITAL DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING
ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL
DIGITAL BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR
ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION,
ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
SOFTWARE.
******************************************************************/
#ifndef _XawClock_h
#define _XawClock_h
/***********************************************************************
*
* Clock Widget
*
***********************************************************************/
#include <X11/Xmu/Converters.h>
/* Parameters:
Name Class RepType Default Value
---- ----- ------- -------------
analog Boolean Boolean True
background Background Pixel white
backingStore BackingStore BackingStore default
border BorderColor Pixel Black
borderWidth BorderWidth Dimension 1
chime Boolean Boolean False
destroyCallback Callback Pointer NULL
font Font XFontStruct* fixed
foreground Foreground Pixel black
hand Foreground Pixel black
height Height Dimension 164
highlight Foreground Pixel black
mappedWhenManaged MappedWhenManaged Boolean True
padding Margin int 8
update Interval int 60 (seconds)
width Width Dimension 164
x Position Position 0
y Position Position 0
*/
/* Resource names used to the clock widget */
/* color of hands */
#define XtNhand "hands"
/* Boolean: digital if FALSE */
#define XtNanalog "analog"
/* Boolean: */
#define XtNchime "chime"
/* Int: amount of space around outside of clock */
#define XtNpadding "padding"
typedef struct _ClockRec *ClockWidget; /* completely defined in ClockPrivate.h */
typedef struct _ClockClassRec *ClockWidgetClass; /* completely defined in ClockPrivate.h */
extern WidgetClass clockWidgetClass;
#endif /* _XawClock_h */
/* DON'T ADD STUFF AFTER THIS #endif */
/*
* $Xorg: ClockP.h,v 1.4 2001/02/09 02:05:39 xorgcvs Exp $
*/
/***********************************************************
Copyright 1987, 1988, 1998 The Open Group
Permission to use, copy, modify, distribute, and sell this software and its
documentation for any purpose is hereby granted without fee, provided that
the above copyright notice appear in all copies and that both that
copyright notice and this permission notice appear in supporting
documentation.
The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
Except as contained in this notice, the name of The Open Group shall not be
used in advertising or otherwise to promote the sale, use or other dealings
in this Software without prior written authorization from The Open Group.
Copyright 1987, 1988 by Digital Equipment Corporation, Maynard, Massachusetts.
All Rights Reserved
Permission to use, copy, modify, and distribute this software and its
documentation for any purpose and without fee is hereby granted,
provided that the above copyright notice appear in all copies and that
both that copyright notice and this permission notice appear in
supporting documentation, and that the name of Digital not be
used in advertising or publicity pertaining to distribution of the
software without specific, written prior permission.
DIGITAL DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING
ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL
DIGITAL BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR
ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION,
ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
SOFTWARE.
******************************************************************/
#ifndef _XawClockP_h
#define _XawClockP_h
#include <X11/Xos.h> /* Needed for struct tm. */
#include "Clock.h"
#include <X11/Xaw/SimpleP.h>
#define SEG_BUFF_SIZE 128
#define ASCII_TIME_BUFLEN 32 /* big enough for 26 plus slop */
/* New fields for the clock widget instance record */
typedef struct {
Pixel fgpixel; /* color index for text */
Pixel Hipixel; /* color index for Highlighting */
Pixel Hdpixel; /* color index for hands */
XFontStruct *font; /* font for text */
GC myGC; /* pointer to GraphicsContext */
GC EraseGC; /* eraser GC */
GC HandGC; /* Hand GC */
GC HighGC; /* Highlighting GC */
/* start of graph stuff */
int update; /* update frequence */
Dimension radius; /* radius factor */
int backing_store; /* backing store type */
Boolean chime;
Boolean beeped;
Boolean analog;
Boolean show_second_hand;
Dimension second_hand_length;
Dimension minute_hand_length;
Dimension hour_hand_length;
Dimension hand_width;
Dimension second_hand_width;
Position centerX;
Position centerY;
int numseg;
int padding;
XPoint segbuff[SEG_BUFF_SIZE];
XPoint *segbuffptr;
XPoint *hour, *sec;
struct tm otm ;
XtIntervalId interval_id;
char prev_time_string[ASCII_TIME_BUFLEN];
} ClockPart;
/* Full instance record declaration */
typedef struct _ClockRec {
CorePart core;
SimplePart simple;
ClockPart clock;
} ClockRec;
/* New fields for the Clock widget class record */
typedef struct {int dummy;} ClockClassPart;
/* Full class record declaration. */
typedef struct _ClockClassRec {
CoreClassPart core_class;
SimpleClassPart simple_class;
ClockClassPart clock_class;
} ClockClassRec;
/* Class pointer. */
extern ClockClassRec clockClassRec;
#endif /* _XawClockP_h */
XClock.input: false
#define clock_mask_width 48
#define clock_mask_height 48
static unsigned char clock_mask_bits[] = {
0x00, 0x00, 0xfe, 0x3f, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x3f, 0x00, 0x00,
0x00, 0x00, 0xfe, 0x3f, 0x00, 0x00, 0x00, 0x80, 0xff, 0xff, 0x00, 0x00,
0x00, 0xe0, 0xff, 0xff, 0x03, 0x00, 0x00, 0xf0, 0xff, 0xff, 0x07, 0x00,
0x00, 0xf8, 0xff, 0xff, 0x0f, 0x00, 0x00, 0xfc, 0xff, 0xff, 0x1f, 0x00,
0x00, 0xfe, 0xff, 0xff, 0x3f, 0x00, 0x00, 0xff, 0xff, 0xff, 0x7f, 0x00,
0x80, 0xff, 0xff, 0xff, 0xff, 0x00, 0xc0, 0xff, 0xff, 0xff, 0xff, 0x01,
0xe0, 0xff, 0xff, 0xff, 0xff, 0x03, 0xe0, 0xff, 0xff, 0xff, 0xff, 0x03,
0xf0, 0xff, 0xff, 0xff, 0xff, 0x07, 0xf0, 0xff, 0xff, 0xff, 0xff, 0x07,
0xf8, 0xff, 0xff, 0xff, 0xff, 0x0f, 0xf8, 0xff, 0xff, 0xff, 0xff, 0x0f,
0xf8, 0xff, 0xff, 0xff, 0xff, 0x0f, 0xfc, 0xff, 0xff, 0xff, 0xff, 0x1f,
0xfc, 0xff, 0xff, 0xff, 0xff, 0x1f, 0xfc, 0xff, 0xff, 0xff, 0xff, 0x1f,
0xfc, 0xff, 0xff, 0xff, 0xff, 0x7f, 0xfc, 0xff, 0xff, 0xff, 0xff, 0x7f,
0xfc, 0xff, 0xff, 0xff, 0xff, 0x7f, 0xfc, 0xff, 0xff, 0xff, 0xff, 0x7f,
0xfc, 0xff, 0xff, 0xff, 0xff, 0x1f, 0xfc, 0xff, 0xff, 0xff, 0xff, 0x1f,
0xfc, 0xff, 0xff, 0xff, 0xff, 0x0f, 0xf8, 0xff, 0xff, 0xff, 0xff, 0x0f,
0xf8, 0xff, 0xff, 0xff, 0xff, 0x0f, 0xf0, 0xff, 0xff, 0xff, 0xff, 0x07,
0xf0, 0xff, 0xff, 0xff, 0xff, 0x07, 0xe0, 0xff, 0xff, 0xff, 0xff, 0x03,
0xe0, 0xff, 0xff, 0xff, 0xff, 0x01, 0xc0, 0xff, 0xff, 0xff, 0xff, 0x01,
0x80, 0xff, 0xff, 0xff, 0xff, 0x00, 0x00, 0xff, 0xff, 0xff, 0x7f, 0x00,
0x00, 0xfe, 0xff, 0xff, 0x3f, 0x00, 0x00, 0xfc, 0xff, 0xff, 0x1f, 0x00,
0x00, 0xf8, 0xff, 0xff, 0x0f, 0x00, 0x00, 0xf0, 0xff, 0xff, 0x07, 0x00,
0x00, 0xe0, 0xff, 0xff, 0x03, 0x00, 0x00, 0x80, 0xff, 0xff, 0x00, 0x00,
0x00, 0x00, 0xfe, 0x3f, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x3f, 0x00, 0x00,
0x00, 0x00, 0xfe, 0x3f, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x3f, 0x00, 0x00};
#define clock_width 48
#define clock_height 48
#define clock_x_hot -1
#define clock_y_hot -1
static unsigned char clock_bits[] = {
0x00, 0x00, 0xfe, 0x3f, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x3f, 0x00, 0x00,
0x00, 0x00, 0xfe, 0x3f, 0x00, 0x00, 0x00, 0x80, 0xff, 0xff, 0x00, 0x00,
0x00, 0xe0, 0xff, 0xff, 0x03, 0x00, 0x00, 0xf0, 0xff, 0xff, 0x07, 0x00,
0x00, 0xf8, 0x87, 0xf1, 0x0f, 0x00, 0x00, 0xfc, 0x80, 0x81, 0x1f, 0x00,
0x00, 0x3e, 0x80, 0x01, 0x3e, 0x00, 0x00, 0x9f, 0x01, 0xc0, 0x7c, 0x00,
0x80, 0x8f, 0x01, 0xc0, 0xf8, 0x00, 0xc0, 0x07, 0x00, 0x00, 0xf0, 0x01,
0xe0, 0x03, 0x00, 0x00, 0xe0, 0x03, 0xe0, 0x01, 0x00, 0x00, 0xc0, 0x03,
0xf0, 0x00, 0x00, 0x40, 0x80, 0x07, 0xf0, 0x06, 0x00, 0xe0, 0xb0, 0x07,
0x78, 0x06, 0x00, 0xf0, 0x30, 0x0f, 0x78, 0x00, 0x00, 0x78, 0x00, 0x0f,
0x78, 0x00, 0x00, 0x3c, 0x00, 0x0f, 0x3c, 0x00, 0x00, 0x1e, 0x00, 0x1e,
0x3c, 0x00, 0x00, 0x0f, 0x00, 0x1e, 0x3c, 0x00, 0x80, 0x07, 0x00, 0x1e,
0x3c, 0x00, 0xc0, 0x03, 0x00, 0x7e, 0xfc, 0x01, 0xc0, 0x03, 0xc0, 0x7f,
0xfc, 0x01, 0x80, 0x07, 0xc0, 0x7f, 0x3c, 0x00, 0x00, 0x0f, 0x00, 0x7e,
0x3c, 0x00, 0x00, 0x1e, 0x00, 0x1e, 0x3c, 0x00, 0x00, 0x1c, 0x00, 0x1e,
0x7c, 0x00, 0x00, 0x08, 0x00, 0x0f, 0x78, 0x00, 0x00, 0x00, 0x00, 0x0f,
0x78, 0x06, 0x00, 0x00, 0x30, 0x0f, 0xf0, 0x06, 0x00, 0x00, 0xb0, 0x07,
0xf0, 0x00, 0x00, 0x00, 0x80, 0x07, 0xe0, 0x01, 0x00, 0x00, 0xc0, 0x03,
0xe0, 0x03, 0x00, 0x00, 0xe0, 0x01, 0xc0, 0x07, 0x00, 0x00, 0xf0, 0x01,
0x80, 0x8f, 0x01, 0xc0, 0xf8, 0x00, 0x00, 0x9f, 0x01, 0xc0, 0x7c, 0x00,
0x00, 0x3e, 0x80, 0x01, 0x3e, 0x00, 0x00, 0xfc, 0x80, 0x81, 0x1f, 0x00,
0x00, 0xf8, 0x87, 0xf1, 0x0f, 0x00, 0x00, 0xf0, 0xff, 0xff, 0x07, 0x00,
0x00, 0xe0, 0xff, 0xff, 0x03, 0x00, 0x00, 0x80, 0xff, 0xff, 0x00, 0x00,
0x00, 0x00, 0xfe, 0x3f, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x3f, 0x00, 0x00,
0x00, 0x00, 0xfe, 0x3f, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x3f, 0x00, 0x00};
/* $Xorg: xclock.c,v 1.4 2001/02/09 02:05:39 xorgcvs Exp $ */
/*
* xclock -- Hacked from Tony Della Fera's much hacked clock program.
*/
/*
Copyright 1989, 1998 The Open Group
Permission to use, copy, modify, distribute, and sell this software and its
documentation for any purpose is hereby granted without fee, provided that
the above copyright notice appear in all copies and that both that
copyright notice and this permission notice appear in supporting
documentation.
The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
Except as contained in this notice, the name of The Open Group shall not be
used in advertising or otherwise to promote the sale, use or other dealings
in this Software without prior written authorization from The Open Group.
*/
#include <X11/Xatom.h>
#include <X11/Intrinsic.h>
#include <X11/StringDefs.h>
#include <X11/Shell.h>
#include "Clock.h"
#include <X11/Xaw/Cardinals.h>
#include "clock.bit"
#include "clmask.bit"
#ifdef XKB
#include <X11/extensions/XKBbells.h>
#endif
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. */
static XrmOptionDescRec options[] = {
{"-chime", "*clock.chime", XrmoptionNoArg, "TRUE"},
{"-hd", "*clock.hands", XrmoptionSepArg, NULL},
{"-hands", "*clock.hands", XrmoptionSepArg, NULL},
{"-hl", "*clock.highlight", XrmoptionSepArg, NULL},
{"-highlight", "*clock.highlight", XrmoptionSepArg, NULL},
{"-update", "*clock.update", XrmoptionSepArg, NULL},
{"-padding", "*clock.padding", XrmoptionSepArg, NULL},
{"-d", "*clock.analog", XrmoptionNoArg, "FALSE"},
{"-digital", "*clock.analog", XrmoptionNoArg, "FALSE"},
{"-analog", "*clock.analog", XrmoptionNoArg, "TRUE"},
};
static void quit();
static XtActionsRec xclock_actions[] = {
{ "quit", quit },
};
static Atom wm_delete_window;
/*
* Report the syntax for calling xclock.
*/
Syntax(call)
char *call;
{
(void) printf ("Usage: %s [-analog] [-bw <pixels>] [-digital]\n", call);
(void) printf (" [-fg <color>] [-bg <color>] [-hd <color>]\n");
(void) printf (" [-hl <color>] [-bd <color>]\n");
(void) printf (" [-fn <font_name>] [-help] [-padding <pixels>]\n");
(void) printf (" [-rv] [-update <seconds>] [-display displayname]\n");
(void) printf (" [-geometry geom]\n\n");
exit(1);
}
static void die(w, client_data, call_data)
Widget w;
XtPointer client_data;
XtPointer call_data;
{
XCloseDisplay(XtDisplayOfObject(w));
exit(0);
}
static void quit (w, event, params, num_params)
Widget w; /* ApplicationShellWidget */
XEvent *event;
String *params;
Cardinal *num_params;
{
Arg arg;
if (event->type == ClientMessage &&
event->xclient.data.l[0] != wm_delete_window) {
#ifdef XKB
XkbStdBell(XtDisplay(w), XtWindow(w), 0, XkbBI_MinorError);
#else
XBell (XtDisplay(w), 0);
#endif
} else {
/* resign from the session */
XtSetArg(arg, XtNjoinSession, False);
XtSetValues(w, &arg, ONE);
die(w, NULL, NULL);
}
}
static void save(w, client_data, call_data)
Widget w;
XtPointer client_data, call_data;
{
XtCheckpointToken token = (XtCheckpointToken) call_data;
/* we have nothing to save */
token->save_success = True;
}
void main(argc, argv)
int argc;
char **argv;
{
Widget toplevel;
Arg arg;
Pixmap icon_pixmap = None;
XtAppContext app_con;
toplevel = XtOpenApplication(&app_con, "XClock",
options, XtNumber(options), &argc, argv, NULL,
sessionShellWidgetClass, NULL, ZERO);
if (argc != 1) Syntax(argv[0]);
XtAddCallback(toplevel, XtNdieCallback, die, NULL);
XtAddCallback(toplevel, XtNsaveCallback, save, NULL);
XtAppAddActions (app_con, xclock_actions, XtNumber(xclock_actions));
/*
* This is a hack so that wm_delete_window will do something useful
* in this single-window application.
*/
XtOverrideTranslations(toplevel,
XtParseTranslationTable ("<Message>WM_PROTOCOLS: quit()"));
XtSetArg(arg, XtNiconPixmap, &icon_pixmap);
XtGetValues(toplevel, &arg, ONE);
if (icon_pixmap == None) {
arg.value = (XtArgVal)XCreateBitmapFromData(XtDisplay(toplevel),
XtScreen(toplevel)->root,
(char *)clock_bits, clock_width, clock_height);
XtSetValues (toplevel, &arg, ONE);
}
XtSetArg(arg, XtNiconMask, &icon_pixmap);
XtGetValues(toplevel, &arg, ONE);
if (icon_pixmap == None) {
arg.value = (XtArgVal)XCreateBitmapFromData(XtDisplay(toplevel),
XtScreen(toplevel)->root,
(char *)clock_mask_bits, clock_mask_width,
clock_mask_height);
XtSetValues (toplevel, &arg, ONE);
}
XtCreateManagedWidget ("clock", clockWidgetClass, toplevel, NULL, ZERO);
XtRealizeWidget (toplevel);
wm_delete_window = XInternAtom (XtDisplay(toplevel), "WM_DELETE_WINDOW",
False);
(void) XSetWMProtocols (XtDisplay(toplevel), XtWindow(toplevel),
&wm_delete_window, 1);
XtAppMainLoop (app_con);
}
.\" $Xorg: xclock.man,v 1.4 2001/02/09 02:05:39 xorgcvs Exp $
.\" Copyright 1988, 1994, 1998 The Open Group
.\"
.\" Permission to use, copy, modify, distribute, and sell this software and its
.\" documentation for any purpose is hereby granted without fee, provided that
.\" the above copyright notice appear in all copies and that both that
.\" copyright notice and this permission notice appear in supporting
.\" documentation.
.\"
.\" The above copyright notice and this permission notice shall be included
.\" in all copies or substantial portions of the Software.
.\"
.\" THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
.\" OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
.\" MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
.\" IN NO EVENT SHALL THE OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR
.\" OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
.\" ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
.\" OTHER DEALINGS IN THE SOFTWARE.
.\"
.\" Except as contained in this notice, the name of The Open Group shall
.\" not be used in advertising or otherwise to promote the sale, use or
.\" other dealings in this Software without prior written authorization
.\" from The Open Group.
.TH XCLOCK 1 "Release 6.4" "X Version 11"
.SH NAME
xclock \- analog / digital clock for X
.SH SYNOPSIS
.ta 8n
\fBxclock\fP [ \fB\-help\fP ] [ \fB\-analog\fP ] [ \fB\-digital\fP ]
[ \fB\-chime\fP ] [ \fB\-hd\fP \fIcolor\fP ]
[ \fB\-hl\fP \fIcolor\fP ] [ \fB\-update\fP \fIseconds\fP ]
[ \fB\-padding\fP \fInumber\fP ]
.SH DESCRIPTION
The
.I xclock
program displays the time in analog or digital form. The time is continuously
updated at a frequency which may be specified by the user.
.SH OPTIONS
.I Xclock
accepts all of the standard X Toolkit command line options along with the
additional options listed below:
.TP 8
.B \-help
This option indicates that a brief summary of the allowed options should be
printed on the standard error.
.TP 8
.B \-analog
This option indicates that a conventional 12 hour clock face with tick marks
and hands should be used. This is the default.
.TP 8
\fB\-digital\fP or \fB\-d\fP
This option indicates that a 24 hour digital clock should be used.
.TP 8
.B \-chime
This option indicates that the clock should chime
once on the half hour and twice on the hour.
.TP 8
\fB\-hands\fP \fIcolor\fP (or \fB\-hd\fP \fIcolor\fP)
This option specifies the color of the hands on an analog clock. The default
is \fIblack\fP.
.TP 8
\fB\-highlight\fP \fIcolor\fP (or \fB\-hl\fP \fIcolor\fP)
This option specifies the color of the edges of the hands on an analog clock,
and is only useful on color displays. The default is \fIblack\fP.
.TP 8
.B \-update \fIseconds\fP
This option specifies the frequency in seconds at which \fIxclock\fP
should update its display. If the clock is obscured and then exposed,
it will be updated immediately. A value of 30 seconds or less will enable a
second hand on an analog clock. The default is 60 seconds.
.TP 8
.B \-padding \fInumber\fP
This option specifies the width in pixels of the padding
between the window border and clock text or picture. The default is 10
on a digital clock and 8 on an analog clock.
.SH X DEFAULTS
This program uses the
.I Clock
widget. It understands all of the core resource names and classes as well as:
.PP
.TP 8
.B width (\fPclass\fB Width)
Specifies the width of the clock. The default for analog clocks is 164
pixels; the default for digital clocks is whatever is needed to hold the
clock when displayed in the chosen font.
.TP 8
.B height (\fPclass\fB Height)
Specifies the height of the clock. The default for analog clocks is 164
pixels; the default for digital clocks is whatever is needed to hold the
clock when displayed in the chosen font.
.TP 8
.B update (\fPclass\fB Interval)
Specifies the frequency in seconds at which the time should be redisplayed.
.TP 8
.B foreground (\fPclass\fB Foreground)
Specifies the color for the tic marks. The default is depends on whether
\fIreverseVideo\fP is specified. If \fIreverseVideo\fP is specified
the default is \fIlwhite\fP, otherwise the default is \fIblack\fP.
.TP 8
.B hands (\fPclass\fB Foreground)
Specifies the color of the insides of the clock's hands. The default is
depends on whether
\fIreverseVideo\fP is specified. If \fIreverseVideo\fP is specified
the default is \fIlwhite\fP, otherwise the default is \fIblack\fP.
.TP 8
.B highlight (\fPclass\fB Foreground)
Specifies the color used to highlight the clock's hands. The default is
depends on whether
\fIreverseVideo\fP is specified. If \fIreverseVideo\fP is specified
the default is \fIlwhite\fP, otherwise the default is \fIblack\fP.
.TP 8
.B analog (\fPclass\fB Boolean)
Specifies whether or not an analog clock should be used instead of a digital
one. The default is True.
.TP 8
.B chime (\fPclass\fB Boolean)
Specifies whether or not a bell should be rung on the hour and half hour.
.TP 8
.B padding (\fPclass\fB Margin)
Specifies the amount of internal padding in pixels to be used. The default is
8.
.TP 8
.B font (\fPclass\fB Font)
Specifies the font to be used for the digital clock. Note that variable width
fonts currently will not always display correctly.
.SH WIDGETS
In order to specify resources, it is useful to know the hierarchy of
the widgets which compose \fIxclock\fR. In the notation below,
indentation indicates hierarchical structure. The widget class name
is given first, followed by the widget instance name.
.sp
.nf
.TA .5i
.ta .5i
XClock xclock
Clock clock
.fi
.sp
.SH ENVIRONMENT
.PP
.TP 8
.B DISPLAY
to get the default host and display number.
.TP 8
.B XENVIRONMENT
to get the name of a resource file that overrides the global resources
stored in the RESOURCE_MANAGER property.
.SH FILES
<XRoot>/lib/X11/app-defaults/XClock - specifies required resources
.SH "SEE ALSO"
X(1), xrdb(1), time(3C)
.SH BUGS
.I Xclock
believes the system clock.
.PP
When in digital mode, the string should be centered automatically.
.SH AUTHORS
Tony Della Fera (MIT-Athena, DEC)
.br
Dave Mankins (MIT-Athena, BBN)
.br
Ed Moy (UC Berkeley)
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment