It looks most of these (post-4.3.0) changes should be borrowed from upstream CVS. Amazing how much bug traffic this little client generates. See attachment. Comments welcome. The only one that looks potentially troublesome to me is the first hunk of the Imakefile patch. I'd probably leave that out. -- G. Branden Robinson | One doesn't have a sense of humor. Debian GNU/Linux | It has you. branden@debian.org | -- Larry Gelbart http://people.debian.org/~branden/ |
Index: Clock.c =================================================================== RCS file: /cvs/xc/programs/xclock/Clock.c,v retrieving revision 3.24 retrieving revision 3.26 diff -u -r3.24 -r3.26 --- Clock.c 21 Oct 2002 13:33:07 -0000 3.24 +++ Clock.c 25 Oct 2003 00:52:37 -0000 3.26 @@ -46,7 +46,7 @@ SOFTWARE. ******************************************************************/ -/* $XFree86: xc/programs/xclock/Clock.c,v 3.24 2002/10/21 13:33:07 alanh Exp $ */ +/* $XFree86: xc/programs/xclock/Clock.c,v 3.26 2003/10/25 00:52:37 dawes Exp $ */ #include <X11/Xlib.h> #include <X11/StringDefs.h> @@ -133,15 +133,15 @@ {XtNforeground, XtCForeground, XtRXftColor, sizeof(XftColor), offset(fg_color), XtRString, XtDefaultForeground}, {XtNhourColor, XtCForeground, XtRXftColor, sizeof(XftColor), - offset(hour_color), XtRString, "rgba:7f/00/00/c0"}, + offset(hour_color), XtRString, XtDefaultForeground}, {XtNminuteColor, XtCForeground, XtRXftColor, sizeof(XftColor), - offset(min_color), XtRString, "rgba:00/7f/7f/c0"}, + offset(min_color), XtRString, XtDefaultForeground}, {XtNsecondColor, XtCForeground, XtRXftColor, sizeof(XftColor), - offset(sec_color), XtRString, "rgba:00/00/ff/80"}, + offset(sec_color), XtRString, XtDefaultForeground}, {XtNmajorColor, XtCForeground, XtRXftColor, sizeof(XftColor), - offset(major_color), XtRString, "rgba:7f/00/00/c0"}, + offset(major_color), XtRString, XtDefaultForeground}, {XtNminorColor, XtCForeground, XtRXftColor, sizeof(XftColor), - offset(minor_color), XtRString, "rgba:00/7f/7f/c0"}, + offset(minor_color), XtRString, XtDefaultForeground}, {XtNface, XtCFace, XtRXftFont, sizeof (XftFont *), offset (face), XtRString, ""}, #endif @@ -563,7 +563,7 @@ #endif } -#if XRENDER +#ifdef XRENDER static void RenderPrepare (ClockWidget w, XftColor *color) { Index: Imakefile =================================================================== RCS file: /cvs/xc/programs/xclock/Imakefile,v retrieving revision 1.4 retrieving revision 1.9 diff -u -r1.4 -r1.9 --- Imakefile 1 Jul 2002 02:26:00 -0000 1.4 +++ Imakefile 17 Nov 2003 15:18:06 -0000 1.9 @@ -2,17 +2,17 @@ -XCOMM $XFree86: xc/programs/xclock/Imakefile,v 1.4 2002/07/01 02:26:00 tsi Exp $ +XCOMM $XFree86: xc/programs/xclock/Imakefile,v 1.9 2003/11/17 15:18:06 tsi Exp $ #ifndef XClockUseRender #define XClockUseRender BuildRenderLibrary #endif #if XClockUseRender - XRENDERDEFS = -DXRENDER - XRENDERDEPS = XftClientDepLibs $(DEPXFTLIB) $(DEPXRENDERLIB) - XRENDERLIBS = XftClientLibs $(XRENDERLIB) -lm - XRENDERINCS = $(XFTINCLUDES) $(XRENDERINCLUDES) + XRENDERDEFS = -DXRENDER -DXFREE86_FT2 + XRENDERDEPS = XftClientDepLibs + XRENDERLIBS = XftClientLibs MathLibrary + XRENDERINCS = $(XFTINCLUDES) $(XRENDERINCLUDES) -I$(XBUILDINCDIR) #endif DEPLIBS = $(XRENDERDEPS) XkbClientDepLibs XawClientDepLibs LOCAL_LIBRARIES = $(XRENDERLIBS) XkbClientLibs XawClientLibs @@ -24,3 +24,4 @@ ComplexProgramTarget(xclock) InstallAppDefaults(XClock) +InstallAppDefaultsLong(XClk-col,XClock-color) Index: xclock.c =================================================================== RCS file: /cvs/xc/programs/xclock/xclock.c,v retrieving revision 1.16 retrieving revision 1.17 diff -u -r1.16 -r1.17 --- xclock.c 21 Oct 2002 13:33:08 -0000 1.16 +++ xclock.c 29 Dec 2003 09:10:37 -0000 1.17 @@ -29,7 +29,7 @@ used in advertising or otherwise to promote the sale, use or other dealings in this Software without prior written authorization from The Open Group. */ -/* $XFree86: xc/programs/xclock/xclock.c,v 1.16 2002/10/21 13:33:08 alanh Exp $ */ +/* $XFree86: xc/programs/xclock/xclock.c,v 1.17 2003/12/29 09:10:37 herrb Exp $ */ #include <stdio.h> #include <stdlib.h> @@ -89,13 +89,14 @@ static void Syntax(char *call) { - (void) printf ("Usage: %s [-analog] [-bw <pixels>] [-digital] [-brief] [-utime] [-strftime <fmt-str>]\n", call); + (void) printf ("Usage: %s [-analog] [-bw <pixels>] [-digital] [-brief]\n", call); + (void) printf (" [-utime] [-strftime <fmt-str>]\n"); (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"); #ifdef XRENDER - (void) printf (" [-render] [-face <face name>] [-sharp]\n"); + (void) printf (" [-[no]render] [-face <face name>] [-sharp]\n"); #endif (void) printf (" [-geometry geom] [-twelve] [-twentyfour]\n\n"); exit(1); Index: xclock.man =================================================================== RCS file: /cvs/xc/programs/xclock/xclock.man,v retrieving revision 1.13 retrieving revision 1.16 diff -u -r1.13 -r1.16 --- xclock.man 21 Oct 2002 13:33:08 -0000 1.13 +++ xclock.man 7 Jul 2003 15:34:29 -0000 1.16 @@ -23,7 +23,7 @@ .\" other dealings in this Software without prior written authorization .\" from The Open Group. .\" -.\" $XFree86: xc/programs/xclock/xclock.man,v 1.13 2002/10/21 13:33:08 alanh Exp $ +.\" $XFree86: xc/programs/xclock/xclock.man,v 1.16 2003/07/07 15:34:29 eich Exp $ .\" .TH XCLOCK 1 __xorgversion__ .SH NAME @@ -35,6 +35,10 @@ [ \fB\-hl\fP \fIcolor\fP ] [ \fB\-update\fP \fIseconds\fP ] [ \fB\-strftime\fP \fIformat\fP ] [ \fB\-padding\fP \fInumber\fP ] +[ \fB\-norender\fP ] +[ \fB\-render\fP ] +[ \fB\-sharp\fP ] +[ \fB\-face\fP \fIpattern\fP ] .SH DESCRIPTION The .I xclock @@ -84,10 +88,12 @@ \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. +This option is effectively ignored when Xrender is in use. .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. +This option is effectively ignored when Xrender is in use. .TP 8 .B \-update \fIseconds\fP This option specifies the frequency in seconds at which \fIxclock\fP @@ -99,6 +105,24 @@ 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. +.TP 8 +.B \-render +This option tells \fIxclock\fP to use the Xrender extension to draw an +anti-aliased face. This is the default if \fIxclock\fP has been +compiled with Xrender support. +Note that the color selection options and resources used when Xrender is +in effect differ from the standard options. +.TP 8 +.B \-norender +This option turns off the use of Xrender to draw the clock. +.TP 8 +.B \-sharp +This option tells \fIxclock\fP to use sharper edges when drawn using +the Xrender extension. +.TP 8 +.B \-face \fIpattern\fP +This option specifies the font to use in digital mode when the +Xrender extension is used. .SH X DEFAULTS This program uses the .I Clock @@ -119,22 +143,24 @@ 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 +Specifies the color for the tick marks. The default 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 +Specifies the color of the insides of the clock's hands. The default depends on whether \fIreverseVideo\fP is specified. If \fIreverseVideo\fP is specified the default is \fIlwhite\fP, otherwise the default is \fIblack\fP. +Note that this resource is not used when Xrender is in effect. .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. +Note that this resource is not used when Xrender is in effect. .TP 8 .B analog (\fPclass\fB Boolean) Specifies whether or not an analog clock should be used instead of a digital @@ -154,6 +180,48 @@ .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. +This font is only used when Xrender is not in effect. +.TP 8 +.B render (\fPclass\fB Boolean) +Specifies whether or not the Xrender extension should be used for the +display. The default is True if \fIxclock\fP has been compiled with +Xrender support. +.PP +When Xrender is in effect, the following additional resources are +understood: +.PP +.TP 8 +.B face (\fPclass\fB FaceName) +Specify the pattern for the font to be used for the digital clock when +Xrender is used. +.TP 8 +.B sharp (\fPclass\fB Boolean) +Specifies if sharp edges should be used when rendering the clock. +The default is False. +.TP 8 +.B buffer (\fPclass\fB Boolean) +Specifies that the updates of the image are drawn to a pixmap before copied +into the window instead drawing them into the window directly. +.PP +The defaults of the following color resources depend 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 hourColor (\fPclass\fB Foreground) +The color of the hour hand. +.TP 8 +.B minuteColor (\fPclass\fB Foreground) +The color of the minute hand. +.TP 8 +.B secondColor (\fPclass\fB Foreground) +The color of the second hand. +.TP 8 +.B majorColor (\fPclass\fB Foreground) +The color of the major scale ticks (i. e. each five minutes). +.TP 8 +.B minorColor (\fPclass\fB Foreground) +The color of the minor scale ticks (between major ticks). .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, @@ -161,7 +229,7 @@ is given first, followed by the widget instance name. .sp .nf -.TA .5i +.\".TA .5i .ta .5i XClock xclock Clock clock --- /dev/null 2004-01-26 17:46:47.000000000 -0500 +++ XClk-col.ad 2003-11-01 00:34:34.000000000 -0500 @@ -0,0 +1,11 @@ +! $XFree86: xc/programs/xclock/XClk-col.ad,v 1.2 2003/10/24 20:38:15 tsi Exp $ + +#include "XClock" + +#ifdef RENDER +XClock.Clock.hourColor: rgba:7f/00/00/c0 +XClock.Clock.minuteColor: rgba:00/7f/7f/c0 +XClock.Clock.secondColor: rgba:00/00/ff/80 +XClock.Clock.majorColor: rgba:7f/00/00/c0 +XClock.Clock.minorColor: rgba:00/7f/7f/c0 +#endif
Attachment:
signature.asc
Description: Digital signature