wmclock: Remove trailing whitespace.
This commit is contained in:
parent
b5fff28b2f
commit
f6dbc7ead1
|
@ -4,16 +4,16 @@
|
||||||
|
|
||||||
2010-12-03 20:28 brucec
|
2010-12-03 20:28 brucec
|
||||||
* Imakefile: Bumped version to 1.0.13, add warning flags.
|
* Imakefile: Bumped version to 1.0.13, add warning flags.
|
||||||
|
|
||||||
* INSTALL: Updated compiler and flags example.
|
* INSTALL: Updated compiler and flags example.
|
||||||
|
|
||||||
* wmclock.c, weekday.xpm: Integrated Debian nopolling patch and
|
* wmclock.c, weekday.xpm: Integrated Debian nopolling patch and
|
||||||
FreeBSD's weekday and year patches. Added function prototypes.
|
FreeBSD's weekday and year patches. Added function prototypes.
|
||||||
|
|
||||||
* wmclock.spec.in: Bumped version to 1.0.13, changed ExecPrefix to
|
* wmclock.spec.in: Bumped version to 1.0.13, changed ExecPrefix to
|
||||||
/usr/local since /usr/X11R6 is obsolete.
|
/usr/local since /usr/X11R6 is obsolete.
|
||||||
|
|
||||||
* lang.polish: Added Polish language files, contributed by
|
* lang.polish: Added Polish language files, contributed by
|
||||||
oyd11 at softhome.net
|
oyd11 at softhome.net
|
||||||
|
|
||||||
* lang.croatian: Added Croatian language files, contributed by Josip
|
* lang.croatian: Added Croatian language files, contributed by Josip
|
||||||
|
@ -30,7 +30,7 @@
|
||||||
|
|
||||||
2000-03-08 07:59 jmknoble
|
2000-03-08 07:59 jmknoble
|
||||||
|
|
||||||
* Imakefile: `tar' target was copying CVS directories.
|
* Imakefile: `tar' target was copying CVS directories.
|
||||||
Restructured it a bit to avoid that.
|
Restructured it a bit to avoid that.
|
||||||
|
|
||||||
* Imakefile: `distclean' target could prove troublesome by
|
* Imakefile: `distclean' target could prove troublesome by
|
||||||
|
@ -53,7 +53,7 @@
|
||||||
stored in CVS.
|
stored in CVS.
|
||||||
|
|
||||||
* wmclock.c, xpm/mask.xbm: Compiling with gcc -Wall -ansi -pedantic
|
* wmclock.c, xpm/mask.xbm: Compiling with gcc -Wall -ansi -pedantic
|
||||||
revealed that the mask bitmap should be declared as unsigned char.
|
revealed that the mask bitmap should be declared as unsigned char.
|
||||||
XCreateBitmapFromData() expects char *, though, so we cast the mask
|
XCreateBitmapFromData() expects char *, though, so we cast the mask
|
||||||
bitmap data explicitly.
|
bitmap data explicitly.
|
||||||
|
|
||||||
|
|
|
@ -11,47 +11,47 @@ System.
|
||||||
|
|
||||||
(1) Run the `configure' script to configure the language support that
|
(1) Run the `configure' script to configure the language support that
|
||||||
is built into wmclock. For example:
|
is built into wmclock. For example:
|
||||||
|
|
||||||
./configure --lang english
|
./configure --lang english
|
||||||
|
|
||||||
For a list of the available languages, use:
|
For a list of the available languages, use:
|
||||||
|
|
||||||
./configure --help
|
./configure --help
|
||||||
|
|
||||||
The configure script also creates a Makefile out of the Imakefile
|
The configure script also creates a Makefile out of the Imakefile
|
||||||
using xmkmf.
|
using xmkmf.
|
||||||
|
|
||||||
(2) Compile:
|
(2) Compile:
|
||||||
|
|
||||||
make
|
make
|
||||||
|
|
||||||
You may specify the C compiler to use and additional command-line
|
You may specify the C compiler to use and additional command-line
|
||||||
options for the C compiler using the `CC' and `CDEBUGFLAGS'
|
options for the C compiler using the `CC' and `CDEBUGFLAGS'
|
||||||
variables, respectively. For example:
|
variables, respectively. For example:
|
||||||
|
|
||||||
make CC=clang CDEBUGFLAGS='-O4 -march=pentium2'
|
make CC=clang CDEBUGFLAGS='-O4 -march=pentium2'
|
||||||
|
|
||||||
|
|
||||||
(3) Test wmclock:
|
(3) Test wmclock:
|
||||||
|
|
||||||
./wmclock
|
./wmclock
|
||||||
|
|
||||||
(If it appears to work as expected, *don't dock it*. Wait until
|
(If it appears to work as expected, *don't dock it*. Wait until
|
||||||
after you've installed it).
|
after you've installed it).
|
||||||
|
|
||||||
(4) Install:
|
(4) Install:
|
||||||
|
|
||||||
su
|
su
|
||||||
make install
|
make install
|
||||||
make install.man
|
make install.man
|
||||||
|
|
||||||
Optionally, install all the month and weekday pixmaps for use
|
Optionally, install all the month and weekday pixmaps for use
|
||||||
with the `-monthxpm' and `-weekdayxpm' options:
|
with the `-monthxpm' and `-weekdayxpm' options:
|
||||||
|
|
||||||
make install.share
|
make install.share
|
||||||
|
|
||||||
(5) You're done. See the README file accompanying this one for
|
(5) You're done. See the README file accompanying this one for
|
||||||
instructions on installing wmclock into Window Maker's dock.
|
instructions on installing wmclock into Window Maker's dock.
|
||||||
|
|
||||||
--
|
--
|
||||||
Bruce Cran <bruce@bluestop.org>
|
Bruce Cran <bruce@bluestop.org>
|
||||||
|
|
|
@ -3,14 +3,14 @@ VERSION = 1.0.14
|
||||||
DATE = 2010-Dec-22
|
DATE = 2010-Dec-22
|
||||||
|
|
||||||
DEFINES = -DVERSION=\"$(VERSION)\"
|
DEFINES = -DVERSION=\"$(VERSION)\"
|
||||||
CFLAGS += -Wall -pedantic -Wshadow -Wmissing-prototypes -Wcast-align
|
CFLAGS += -Wall -pedantic -Wshadow -Wmissing-prototypes -Wcast-align
|
||||||
CFLAGS += -Wcast-qual -Wchar-subscripts -Wpointer-arith
|
CFLAGS += -Wcast-qual -Wchar-subscripts -Wpointer-arith
|
||||||
CFLAGS += -Wredundant-decls -Wstrict-prototypes
|
CFLAGS += -Wredundant-decls -Wstrict-prototypes
|
||||||
|
|
||||||
XPMLIB = -L$(PREFIX)/lib/X11 -lXpm
|
XPMLIB = -L$(PREFIX)/lib/X11 -lXpm
|
||||||
DEPLIBS = $(DEPXLIB)
|
DEPLIBS = $(DEPXLIB)
|
||||||
|
|
||||||
LOCAL_LIBRARIES = $(XPMLIB) $(XLIB)
|
LOCAL_LIBRARIES = $(XPMLIB) $(XLIB)
|
||||||
|
|
||||||
LINTLIBS = $(LINTXLIB)
|
LINTLIBS = $(LINTXLIB)
|
||||||
|
|
||||||
|
|
|
@ -31,7 +31,7 @@ wmclock according to the instructions, there are three steps:
|
||||||
(1) Start wmclock. The easiest way to accomplish this is to accept
|
(1) Start wmclock. The easiest way to accomplish this is to accept
|
||||||
the defaults for things such as led color, blinking, etc, and
|
the defaults for things such as led color, blinking, etc, and
|
||||||
just start the clock:
|
just start the clock:
|
||||||
|
|
||||||
wmclock
|
wmclock
|
||||||
|
|
||||||
(2) Drag the resulting wmclock appicon to an empty slot in your dock.
|
(2) Drag the resulting wmclock appicon to an empty slot in your dock.
|
||||||
|
@ -70,7 +70,7 @@ wmclock and Window Maker:
|
||||||
Clip is collapsed, you won't be able to see the wmclock appicon,
|
Clip is collapsed, you won't be able to see the wmclock appicon,
|
||||||
even though it's running. Make sure you uncollapse your Clip and
|
even though it's running. Make sure you uncollapse your Clip and
|
||||||
look for wmclock there if it doesn't appear on your desktop.
|
look for wmclock there if it doesn't appear on your desktop.
|
||||||
|
|
||||||
- If your Clip is too close to your dock, you may have difficulty
|
- If your Clip is too close to your dock, you may have difficulty
|
||||||
docking wmclock, because the Clip may grab the wmclock appicon
|
docking wmclock, because the Clip may grab the wmclock appicon
|
||||||
instead. Try moving your Clip farther away from your dock before
|
instead. Try moving your Clip farther away from your dock before
|
||||||
|
@ -137,5 +137,5 @@ other dealings in the software.
|
||||||
|
|
||||||
Your mileage may vary. Eat your vegetables.
|
Your mileage may vary. Eat your vegetables.
|
||||||
|
|
||||||
--
|
--
|
||||||
Bruce Cran <bruce@bluestop.org>
|
Bruce Cran <bruce@bluestop.org>
|
||||||
|
|
2
wmclock/configure
vendored
2
wmclock/configure
vendored
|
@ -19,7 +19,7 @@ PrintHelp() {
|
||||||
cat <<EOF
|
cat <<EOF
|
||||||
|
|
||||||
Usage: ${0} [--lang <language>]
|
Usage: ${0} [--lang <language>]
|
||||||
|
|
||||||
Options:
|
Options:
|
||||||
--lang <language>
|
--lang <language>
|
||||||
Configure wmclock to use day and month names for the specified
|
Configure wmclock to use day and month names for the specified
|
||||||
|
|
|
@ -1,12 +1,12 @@
|
||||||
/* dynlist.c: Dynamic lists and buffers in C.
|
/* dynlist.c: Dynamic lists and buffers in C.
|
||||||
* created 1999-Jan-06 15:34 jmk
|
* created 1999-Jan-06 15:34 jmk
|
||||||
* autodate: 2000-Mar-08 02:25
|
* autodate: 2000-Mar-08 02:25
|
||||||
*
|
*
|
||||||
* by Jim Knoble <jmknoble@pobox.com>
|
* by Jim Knoble <jmknoble@pobox.com>
|
||||||
* Copyright (C) 1999 Jim Knoble
|
* Copyright (C) 1999 Jim Knoble
|
||||||
*
|
*
|
||||||
* Disclaimer:
|
* Disclaimer:
|
||||||
*
|
*
|
||||||
* The software is provided "as is", without warranty of any kind,
|
* The software is provided "as is", without warranty of any kind,
|
||||||
* express or implied, including but not limited to the warranties of
|
* express or implied, including but not limited to the warranties of
|
||||||
* merchantability, fitness for a particular purpose and
|
* merchantability, fitness for a particular purpose and
|
||||||
|
@ -14,7 +14,7 @@
|
||||||
* claim, damages or other liability, whether in an action of
|
* claim, damages or other liability, whether in an action of
|
||||||
* contract, tort or otherwise, arising from, out of or in connection
|
* contract, tort or otherwise, arising from, out of or in connection
|
||||||
* with the software or the use or other dealings in the software.
|
* with the software or the use or other dealings in the software.
|
||||||
*
|
*
|
||||||
* Permission to use, copy, modify, distribute, and sell this software
|
* Permission to use, copy, modify, distribute, and sell this software
|
||||||
* and its documentation for any purpose is hereby granted without
|
* and its documentation for any purpose is hereby granted without
|
||||||
* fee, provided that the above copyright notice appear in all copies
|
* fee, provided that the above copyright notice appear in all copies
|
||||||
|
@ -35,7 +35,7 @@
|
||||||
int append_to_list(char ***list_ptr, int *list_len, int *i, char *item)
|
int append_to_list(char ***list_ptr, int *list_len, int *i, char *item)
|
||||||
{
|
{
|
||||||
char **tmp_ptr;
|
char **tmp_ptr;
|
||||||
|
|
||||||
if (*i >= *list_len)
|
if (*i >= *list_len)
|
||||||
{
|
{
|
||||||
*list_len += LIST_CHUNK_SIZE;
|
*list_len += LIST_CHUNK_SIZE;
|
||||||
|
@ -55,7 +55,7 @@ int append_to_list(char ***list_ptr, int *list_len, int *i, char *item)
|
||||||
int append_to_buf(char **buf, int *buflen, int *i, int c)
|
int append_to_buf(char **buf, int *buflen, int *i, int c)
|
||||||
{
|
{
|
||||||
char *tmp_buf;
|
char *tmp_buf;
|
||||||
|
|
||||||
if (*i >= *buflen)
|
if (*i >= *buflen)
|
||||||
{
|
{
|
||||||
*buflen += BUF_CHUNK_SIZE;
|
*buflen += BUF_CHUNK_SIZE;
|
||||||
|
@ -79,7 +79,7 @@ int append_string_to_buf(char **buf, int *buflen, int *i, char *s)
|
||||||
int addlen;
|
int addlen;
|
||||||
int n;
|
int n;
|
||||||
char *tmp_buf;
|
char *tmp_buf;
|
||||||
|
|
||||||
n = strlen(s);
|
n = strlen(s);
|
||||||
if (*i >= *buflen)
|
if (*i >= *buflen)
|
||||||
{
|
{
|
||||||
|
|
|
@ -1,12 +1,12 @@
|
||||||
/* dynlist.h: Dynamic lists and buffers in C
|
/* dynlist.h: Dynamic lists and buffers in C
|
||||||
* created 1999-Jan-06 15:04 jmk
|
* created 1999-Jan-06 15:04 jmk
|
||||||
* autodate: 2000-Mar-08 02:26
|
* autodate: 2000-Mar-08 02:26
|
||||||
*
|
*
|
||||||
* by Jim Knoble <jmknoble@pobox.com>
|
* by Jim Knoble <jmknoble@pobox.com>
|
||||||
* Copyright (C) 1999 Jim Knoble
|
* Copyright (C) 1999 Jim Knoble
|
||||||
*
|
*
|
||||||
* Disclaimer:
|
* Disclaimer:
|
||||||
*
|
*
|
||||||
* The software is provided "as is", without warranty of any kind,
|
* The software is provided "as is", without warranty of any kind,
|
||||||
* express or implied, including but not limited to the warranties of
|
* express or implied, including but not limited to the warranties of
|
||||||
* merchantability, fitness for a particular purpose and
|
* merchantability, fitness for a particular purpose and
|
||||||
|
@ -14,7 +14,7 @@
|
||||||
* claim, damages or other liability, whether in an action of
|
* claim, damages or other liability, whether in an action of
|
||||||
* contract, tort or otherwise, arising from, out of or in connection
|
* contract, tort or otherwise, arising from, out of or in connection
|
||||||
* with the software or the use or other dealings in the software.
|
* with the software or the use or other dealings in the software.
|
||||||
*
|
*
|
||||||
* Permission to use, copy, modify, distribute, and sell this software
|
* Permission to use, copy, modify, distribute, and sell this software
|
||||||
* and its documentation for any purpose is hereby granted without
|
* and its documentation for any purpose is hereby granted without
|
||||||
* fee, provided that the above copyright notice appear in all copies
|
* fee, provided that the above copyright notice appear in all copies
|
||||||
|
|
|
@ -1,15 +1,15 @@
|
||||||
/* wmclock.c: a dockable clock applet for Window Maker
|
/* wmclock.c: a dockable clock applet for Window Maker
|
||||||
* created 1999-Apr-09 jmk
|
* created 1999-Apr-09 jmk
|
||||||
*
|
*
|
||||||
* by Jim Knoble <jmknoble@pobox.com>
|
* by Jim Knoble <jmknoble@pobox.com>
|
||||||
* Copyright (C) 1999 Jim Knoble
|
* Copyright (C) 1999 Jim Knoble
|
||||||
*
|
*
|
||||||
* Significant portions of this software are derived from asclock by
|
* Significant portions of this software are derived from asclock by
|
||||||
* Beat Christen <spiff@longstreet.ch>. Such portions are copyright
|
* Beat Christen <spiff@longstreet.ch>. Such portions are copyright
|
||||||
* by Beat Christen and the other authors of asclock.
|
* by Beat Christen and the other authors of asclock.
|
||||||
*
|
*
|
||||||
* Disclaimer:
|
* Disclaimer:
|
||||||
*
|
*
|
||||||
* The software is provided "as is", without warranty of any kind,
|
* The software is provided "as is", without warranty of any kind,
|
||||||
* express or implied, including but not limited to the warranties of
|
* express or implied, including but not limited to the warranties of
|
||||||
* merchantability, fitness for a particular purpose and
|
* merchantability, fitness for a particular purpose and
|
||||||
|
@ -227,7 +227,7 @@ char *version = VERSION;
|
||||||
void showUsage(void)
|
void showUsage(void)
|
||||||
{
|
{
|
||||||
char **cpp;
|
char **cpp;
|
||||||
|
|
||||||
fprintf(stderr, "Usage: %s [option [option ...]]\n\n", progName);
|
fprintf(stderr, "Usage: %s [option [option ...]]\n\n", progName);
|
||||||
for (cpp = usageText; *cpp; cpp++)
|
for (cpp = usageText; *cpp; cpp++)
|
||||||
{
|
{
|
||||||
|
@ -248,7 +248,7 @@ void showVersion()
|
||||||
int buildCommand(char *command, char **buf, int *buf_len, int *i)
|
int buildCommand(char *command, char **buf, int *buf_len, int *i)
|
||||||
{
|
{
|
||||||
int status;
|
int status;
|
||||||
|
|
||||||
status = append_string_to_buf(buf, buf_len, i, command);
|
status = append_string_to_buf(buf, buf_len, i, command);
|
||||||
if (APPEND_FAILURE == status)
|
if (APPEND_FAILURE == status)
|
||||||
{
|
{
|
||||||
|
@ -297,26 +297,26 @@ void GetXpms(void)
|
||||||
char ledBright[64];
|
char ledBright[64];
|
||||||
char ledDim[64];
|
char ledDim[64];
|
||||||
int status;
|
int status;
|
||||||
|
|
||||||
#ifdef ONLY_SHAPED_WINDOW
|
#ifdef ONLY_SHAPED_WINDOW
|
||||||
clock_xpm = mask_xpm;
|
clock_xpm = mask_xpm;
|
||||||
#else /* !ONLY_SHAPED_WINDOW */
|
#else /* !ONLY_SHAPED_WINDOW */
|
||||||
clock_xpm = enableShapedWindow ? mask_xpm : clk_xpm;
|
clock_xpm = enableShapedWindow ? mask_xpm : clk_xpm;
|
||||||
#endif /* ONLY_SHAPED_WINDOW */
|
#endif /* ONLY_SHAPED_WINDOW */
|
||||||
|
|
||||||
/* for the colormap */
|
/* for the colormap */
|
||||||
XGetWindowAttributes(dpy, rootWindow, &attributes);
|
XGetWindowAttributes(dpy, rootWindow, &attributes);
|
||||||
|
|
||||||
/* get user-defined color */
|
/* get user-defined color */
|
||||||
if (!XParseColor(dpy, attributes.colormap, ledColor, &color))
|
if (!XParseColor(dpy, attributes.colormap, ledColor, &color))
|
||||||
{
|
{
|
||||||
showError("parse color", ledColor);
|
showError("parse color", ledColor);
|
||||||
}
|
}
|
||||||
|
|
||||||
sprintf(ledBright, "%c c #%04X%04X%04X", LED_XPM_BRIGHT_CHAR,
|
sprintf(ledBright, "%c c #%04X%04X%04X", LED_XPM_BRIGHT_CHAR,
|
||||||
color.red, color.green, color.blue);
|
color.red, color.green, color.blue);
|
||||||
led_xpm[LED_XPM_BRIGHT_LINE_INDEX] = &ledBright[0];
|
led_xpm[LED_XPM_BRIGHT_LINE_INDEX] = &ledBright[0];
|
||||||
|
|
||||||
color.red = makeDimColor(color.red);
|
color.red = makeDimColor(color.red);
|
||||||
color.green = makeDimColor(color.green);
|
color.green = makeDimColor(color.green);
|
||||||
color.blue = makeDimColor(color.blue);
|
color.blue = makeDimColor(color.blue);
|
||||||
|
@ -327,7 +327,7 @@ void GetXpms(void)
|
||||||
clockBg.attributes.closeness = DEFAULT_XPM_CLOSENESS;
|
clockBg.attributes.closeness = DEFAULT_XPM_CLOSENESS;
|
||||||
clockBg.attributes.valuemask |=
|
clockBg.attributes.valuemask |=
|
||||||
(XpmReturnPixels | XpmReturnExtensions | XpmCloseness);
|
(XpmReturnPixels | XpmReturnExtensions | XpmCloseness);
|
||||||
|
|
||||||
if (useUserClockXpm)
|
if (useUserClockXpm)
|
||||||
{
|
{
|
||||||
status = XpmReadFileToPixmap(dpy, rootWindow, userClockXpm,
|
status = XpmReadFileToPixmap(dpy, rootWindow, userClockXpm,
|
||||||
|
@ -381,7 +381,7 @@ void GetXpms(void)
|
||||||
&months.pixmap, &months.mask,
|
&months.pixmap, &months.mask,
|
||||||
&months.attributes);
|
&months.attributes);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
status = XpmCreatePixmapFromData(dpy, rootWindow, month_xpm,
|
status = XpmCreatePixmapFromData(dpy, rootWindow, month_xpm,
|
||||||
&months.pixmap, &months.mask,
|
&months.pixmap, &months.mask,
|
||||||
|
@ -406,7 +406,7 @@ void GetXpms(void)
|
||||||
weekdays.attributes.closeness = DEFAULT_XPM_CLOSENESS;
|
weekdays.attributes.closeness = DEFAULT_XPM_CLOSENESS;
|
||||||
weekdays.attributes.valuemask |=
|
weekdays.attributes.valuemask |=
|
||||||
(XpmReturnPixels | XpmReturnExtensions | XpmCloseness);
|
(XpmReturnPixels | XpmReturnExtensions | XpmCloseness);
|
||||||
if (useUserWeekdayXpm)
|
if (useUserWeekdayXpm)
|
||||||
{
|
{
|
||||||
status = XpmReadFileToPixmap(dpy, rootWindow, userWeekdayXpm,
|
status = XpmReadFileToPixmap(dpy, rootWindow, userWeekdayXpm,
|
||||||
&weekdays.pixmap, &weekdays.mask,
|
&weekdays.pixmap, &weekdays.mask,
|
||||||
|
@ -429,7 +429,7 @@ int flushExposeEvents(Window w)
|
||||||
{
|
{
|
||||||
XEvent dummy;
|
XEvent dummy;
|
||||||
int i = 0;
|
int i = 0;
|
||||||
|
|
||||||
while (XCheckTypedWindowEvent(dpy, w, Expose, &dummy))
|
while (XCheckTypedWindowEvent(dpy, w, Expose, &dummy))
|
||||||
{
|
{
|
||||||
i++;
|
i++;
|
||||||
|
@ -453,14 +453,14 @@ Pixel GetColor(const char *colorName)
|
||||||
{
|
{
|
||||||
XColor color;
|
XColor color;
|
||||||
XWindowAttributes attributes;
|
XWindowAttributes attributes;
|
||||||
|
|
||||||
XGetWindowAttributes(dpy, rootWindow, &attributes);
|
XGetWindowAttributes(dpy, rootWindow, &attributes);
|
||||||
color.pixel = 0;
|
color.pixel = 0;
|
||||||
if (!XParseColor(dpy, attributes.colormap, colorName, &color))
|
if (!XParseColor(dpy, attributes.colormap, colorName, &color))
|
||||||
{
|
{
|
||||||
showError("parse color", colorName);
|
showError("parse color", colorName);
|
||||||
}
|
}
|
||||||
else if (!XAllocColor(dpy, attributes.colormap, &color))
|
else if (!XAllocColor(dpy, attributes.colormap, &color))
|
||||||
{
|
{
|
||||||
showError("allocate color", colorName);
|
showError("allocate color", colorName);
|
||||||
}
|
}
|
||||||
|
@ -472,9 +472,9 @@ int mytime(void)
|
||||||
{
|
{
|
||||||
struct timeval tv;
|
struct timeval tv;
|
||||||
struct timezone tz;
|
struct timezone tz;
|
||||||
|
|
||||||
gettimeofday(&tv, &tz);
|
gettimeofday(&tv, &tz);
|
||||||
|
|
||||||
return(tv.tv_sec);
|
return(tv.tv_sec);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -484,9 +484,9 @@ void showYear(void)
|
||||||
int year;
|
int year;
|
||||||
int digitXOffset;
|
int digitXOffset;
|
||||||
int digitYOffset;
|
int digitYOffset;
|
||||||
|
|
||||||
year = localTime->tm_year + 1900;
|
year = localTime->tm_year + 1900;
|
||||||
|
|
||||||
digitYOffset = LED_NUM_Y_OFFSET;
|
digitYOffset = LED_NUM_Y_OFFSET;
|
||||||
digitXOffset = LED_NUM_WIDTH * (year / 1000);
|
digitXOffset = LED_NUM_WIDTH * (year / 1000);
|
||||||
XCopyArea(dpy, led.pixmap, visible.pixmap, normalGC,
|
XCopyArea(dpy, led.pixmap, visible.pixmap, normalGC,
|
||||||
|
@ -512,7 +512,7 @@ void showTime12(void)
|
||||||
int digitXOffset;
|
int digitXOffset;
|
||||||
int digitYOffset;
|
int digitYOffset;
|
||||||
int localHour = localTime->tm_hour % 12;
|
int localHour = localTime->tm_hour % 12;
|
||||||
|
|
||||||
if (0 == localHour)
|
if (0 == localHour)
|
||||||
{
|
{
|
||||||
localHour = 12;
|
localHour = 12;
|
||||||
|
@ -531,7 +531,7 @@ void showTime12(void)
|
||||||
PM_X_OFFSET, PM_Y_OFFSET, PM_WIDTH, PM_HEIGHT,
|
PM_X_OFFSET, PM_Y_OFFSET, PM_WIDTH, PM_HEIGHT,
|
||||||
xPos[AMPM_X_POS], yPos[DIGIT_Y_POS] + PM_Y_OFFSET);
|
xPos[AMPM_X_POS], yPos[DIGIT_Y_POS] + PM_Y_OFFSET);
|
||||||
}
|
}
|
||||||
|
|
||||||
digitYOffset = LED_NUM_Y_OFFSET;
|
digitYOffset = LED_NUM_Y_OFFSET;
|
||||||
if (localHour > 9)
|
if (localHour > 9)
|
||||||
{
|
{
|
||||||
|
@ -559,7 +559,7 @@ void showTime24(void)
|
||||||
{
|
{
|
||||||
int digitXOffset;
|
int digitXOffset;
|
||||||
int digitYOffset;
|
int digitYOffset;
|
||||||
|
|
||||||
digitYOffset = LED_NUM_Y_OFFSET;
|
digitYOffset = LED_NUM_Y_OFFSET;
|
||||||
digitXOffset = LED_NUM_WIDTH * (localTime->tm_hour / 10);
|
digitXOffset = LED_NUM_WIDTH * (localTime->tm_hour / 10);
|
||||||
XCopyArea(dpy, led.pixmap, visible.pixmap, normalGC,
|
XCopyArea(dpy, led.pixmap, visible.pixmap, normalGC,
|
||||||
|
@ -583,17 +583,17 @@ void showTime(void)
|
||||||
{
|
{
|
||||||
int xOffset;
|
int xOffset;
|
||||||
int yOffset;
|
int yOffset;
|
||||||
|
|
||||||
/* Zeit auslesen */
|
/* Zeit auslesen */
|
||||||
actualTime = mytime();
|
actualTime = mytime();
|
||||||
actualMinutes = actualTime / 60;
|
actualMinutes = actualTime / 60;
|
||||||
|
|
||||||
localTime = localtime(&actualTime);
|
localTime = localtime(&actualTime);
|
||||||
|
|
||||||
/* leere clock holen */
|
/* leere clock holen */
|
||||||
XCopyArea(dpy, clockBg.pixmap, visible.pixmap, normalGC,
|
XCopyArea(dpy, clockBg.pixmap, visible.pixmap, normalGC,
|
||||||
0, 0, sizeHints.width, sizeHints.height, 0, 0);
|
0, 0, sizeHints.width, sizeHints.height, 0, 0);
|
||||||
|
|
||||||
if (enableYearDisplay)
|
if (enableYearDisplay)
|
||||||
{
|
{
|
||||||
showYear();
|
showYear();
|
||||||
|
@ -606,14 +606,14 @@ void showTime(void)
|
||||||
{
|
{
|
||||||
showTime24();
|
showTime24();
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Monat */
|
/* Monat */
|
||||||
xOffset = MONTH_X_OFFSET;
|
xOffset = MONTH_X_OFFSET;
|
||||||
yOffset = MONTH_HEIGHT * (localTime->tm_mon);
|
yOffset = MONTH_HEIGHT * (localTime->tm_mon);
|
||||||
XCopyArea(dpy, months.pixmap, visible.pixmap, normalGC,
|
XCopyArea(dpy, months.pixmap, visible.pixmap, normalGC,
|
||||||
xOffset, yOffset, MONTH_WIDTH, MONTH_HEIGHT,
|
xOffset, yOffset, MONTH_WIDTH, MONTH_HEIGHT,
|
||||||
xPos[MONTH_X_POS], yPos[MONTH_Y_POS]);
|
xPos[MONTH_X_POS], yPos[MONTH_Y_POS]);
|
||||||
|
|
||||||
/* Datum */
|
/* Datum */
|
||||||
yOffset = DATE_Y_OFFSET;
|
yOffset = DATE_Y_OFFSET;
|
||||||
if (localTime->tm_mday > 9)
|
if (localTime->tm_mday > 9)
|
||||||
|
@ -634,14 +634,14 @@ void showTime(void)
|
||||||
xOffset, yOffset, DATE_NUM_WIDTH, DATE_NUM_HEIGHT,
|
xOffset, yOffset, DATE_NUM_WIDTH, DATE_NUM_HEIGHT,
|
||||||
xPos[DATE_CENTER_X_POS], yPos[DATE_Y_POS]);
|
xPos[DATE_CENTER_X_POS], yPos[DATE_Y_POS]);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Wochentag */
|
/* Wochentag */
|
||||||
xOffset = WEEKDAY_X_OFFSET;
|
xOffset = WEEKDAY_X_OFFSET;
|
||||||
yOffset = WEEKDAY_HEIGHT * ((localTime->tm_wday + 6) % 7);
|
yOffset = WEEKDAY_HEIGHT * ((localTime->tm_wday + 6) % 7);
|
||||||
XCopyArea(dpy, weekdays.pixmap, visible.pixmap, normalGC,
|
XCopyArea(dpy, weekdays.pixmap, visible.pixmap, normalGC,
|
||||||
xOffset, yOffset, WEEKDAY_WIDTH, WEEKDAY_HEIGHT,
|
xOffset, yOffset, WEEKDAY_WIDTH, WEEKDAY_HEIGHT,
|
||||||
xPos[WEEKDAY_X_POS], yPos[WEEKDAY_Y_POS]);
|
xPos[WEEKDAY_X_POS], yPos[WEEKDAY_Y_POS]);
|
||||||
|
|
||||||
if ((!enableBlinking) && (!enableYearDisplay))
|
if ((!enableBlinking) && (!enableYearDisplay))
|
||||||
{
|
{
|
||||||
/* Sekunden Doppelpunkt ein */
|
/* Sekunden Doppelpunkt ein */
|
||||||
|
@ -657,7 +657,7 @@ void showTime(void)
|
||||||
char *extractProgName(char *argv0)
|
char *extractProgName(char *argv0)
|
||||||
{
|
{
|
||||||
char *prog_name = NULL;
|
char *prog_name = NULL;
|
||||||
|
|
||||||
if (NULL != argv0)
|
if (NULL != argv0)
|
||||||
{
|
{
|
||||||
prog_name = strrchr(argv0, '/');
|
prog_name = strrchr(argv0, '/');
|
||||||
|
@ -677,7 +677,7 @@ char *extractProgName(char *argv0)
|
||||||
int processArgs(int argc, char **argv)
|
int processArgs(int argc, char **argv)
|
||||||
{
|
{
|
||||||
int i;
|
int i;
|
||||||
|
|
||||||
for (i = 1; i < argc; i++)
|
for (i = 1; i < argc; i++)
|
||||||
{
|
{
|
||||||
if (0 == strcmp(argv[i], "--"))
|
if (0 == strcmp(argv[i], "--"))
|
||||||
|
@ -826,7 +826,7 @@ int main(int argc, char **argv)
|
||||||
{
|
{
|
||||||
int i;
|
int i;
|
||||||
unsigned int borderWidth = 0;
|
unsigned int borderWidth = 0;
|
||||||
char *displayName = NULL;
|
char *displayName = NULL;
|
||||||
XGCValues gcValues;
|
XGCValues gcValues;
|
||||||
unsigned long gcMask;
|
unsigned long gcMask;
|
||||||
XEvent event;
|
XEvent event;
|
||||||
|
@ -835,11 +835,11 @@ int main(int argc, char **argv)
|
||||||
Pixmap shapeMask;
|
Pixmap shapeMask;
|
||||||
struct timeval nextEvent;
|
struct timeval nextEvent;
|
||||||
unsigned int blinkCounter = 0;
|
unsigned int blinkCounter = 0;
|
||||||
|
|
||||||
/* Parse command line options */
|
/* Parse command line options */
|
||||||
progName = extractProgName(argv[0]);
|
progName = extractProgName(argv[0]);
|
||||||
processArgs(argc, argv);
|
processArgs(argc, argv);
|
||||||
|
|
||||||
/* init led position */
|
/* init led position */
|
||||||
#ifndef ONLY_SHAPED_WINDOW
|
#ifndef ONLY_SHAPED_WINDOW
|
||||||
for (i = 0; i < NUM_Y_POSITIONS; i++)
|
for (i = 0; i < NUM_Y_POSITIONS; i++)
|
||||||
|
@ -848,7 +848,7 @@ int main(int argc, char **argv)
|
||||||
}
|
}
|
||||||
for (i = 0; i < NUM_X_POSITIONS; i++)
|
for (i = 0; i < NUM_X_POSITIONS; i++)
|
||||||
{
|
{
|
||||||
xPos[i] = enableShapedWindow ? xPosShaped[i] : xPosUnshaped[i];
|
xPos[i] = enableShapedWindow ? xPosShaped[i] : xPosUnshaped[i];
|
||||||
}
|
}
|
||||||
#else /* ONLY_SHAPED_WINDOW */
|
#else /* ONLY_SHAPED_WINDOW */
|
||||||
for (i = 0; i < NUM_Y_POSITIONS; i++)
|
for (i = 0; i < NUM_Y_POSITIONS; i++)
|
||||||
|
@ -871,23 +871,23 @@ int main(int argc, char **argv)
|
||||||
xPos[i] += timePos12[i];
|
xPos[i] += timePos12[i];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Open the display */
|
/* Open the display */
|
||||||
dpy = XOpenDisplay(displayName);
|
dpy = XOpenDisplay(displayName);
|
||||||
if (NULL == dpy)
|
if (NULL == dpy)
|
||||||
{
|
{
|
||||||
fprintf(stderr, "%s: can't open display %s\n", progName,
|
fprintf(stderr, "%s: can't open display %s\n", progName,
|
||||||
XDisplayName(displayName));
|
XDisplayName(displayName));
|
||||||
exit(1);
|
exit(1);
|
||||||
}
|
}
|
||||||
screen = DefaultScreen(dpy);
|
screen = DefaultScreen(dpy);
|
||||||
rootWindow = RootWindow(dpy, screen);
|
rootWindow = RootWindow(dpy, screen);
|
||||||
displayDepth = DefaultDepth(dpy, screen);
|
displayDepth = DefaultDepth(dpy, screen);
|
||||||
xFd = XConnectionNumber(dpy);
|
xFd = XConnectionNumber(dpy);
|
||||||
|
|
||||||
/* Icon Daten nach XImage konvertieren */
|
/* Icon Daten nach XImage konvertieren */
|
||||||
GetXpms();
|
GetXpms();
|
||||||
|
|
||||||
/* Create a window to hold the banner */
|
/* Create a window to hold the banner */
|
||||||
sizeHints.x = 0;
|
sizeHints.x = 0;
|
||||||
sizeHints.y = 0;
|
sizeHints.y = 0;
|
||||||
|
@ -898,16 +898,16 @@ int main(int argc, char **argv)
|
||||||
sizeHints.base_width = clockBg.attributes.width;
|
sizeHints.base_width = clockBg.attributes.width;
|
||||||
sizeHints.base_height = clockBg.attributes.height;
|
sizeHints.base_height = clockBg.attributes.height;
|
||||||
sizeHints.flags = USSize | USPosition | PMinSize | PMaxSize | PBaseSize;
|
sizeHints.flags = USSize | USPosition | PMinSize | PMaxSize | PBaseSize;
|
||||||
|
|
||||||
bgPixel = GetColor("white");
|
bgPixel = GetColor("white");
|
||||||
fgPixel = GetColor("black");
|
fgPixel = GetColor("black");
|
||||||
|
|
||||||
XWMGeometry(dpy, screen, geometry, NULL, borderWidth, &sizeHints,
|
XWMGeometry(dpy, screen, geometry, NULL, borderWidth, &sizeHints,
|
||||||
&sizeHints.x, &sizeHints.y, &sizeHints.width, &sizeHints.height,
|
&sizeHints.x, &sizeHints.y, &sizeHints.width, &sizeHints.height,
|
||||||
&sizeHints.win_gravity);
|
&sizeHints.win_gravity);
|
||||||
sizeHints.width = clockBg.attributes.width;
|
sizeHints.width = clockBg.attributes.width;
|
||||||
sizeHints.height = clockBg.attributes.height;
|
sizeHints.height = clockBg.attributes.height;
|
||||||
|
|
||||||
win = XCreateSimpleWindow(dpy, rootWindow, sizeHints.x, sizeHints.y,
|
win = XCreateSimpleWindow(dpy, rootWindow, sizeHints.x, sizeHints.y,
|
||||||
sizeHints.width, sizeHints.height,
|
sizeHints.width, sizeHints.height,
|
||||||
borderWidth, fgPixel, bgPixel);
|
borderWidth, fgPixel, bgPixel);
|
||||||
|
@ -920,10 +920,10 @@ int main(int argc, char **argv)
|
||||||
classHint.res_name = progName;
|
classHint.res_name = progName;
|
||||||
classHint.res_class = className;
|
classHint.res_class = className;
|
||||||
XSetClassHint(dpy, win, &classHint);
|
XSetClassHint(dpy, win, &classHint);
|
||||||
|
|
||||||
XSelectInput(dpy, win, OUR_WINDOW_EVENTS);
|
XSelectInput(dpy, win, OUR_WINDOW_EVENTS);
|
||||||
XSelectInput(dpy, iconWin, OUR_WINDOW_EVENTS);
|
XSelectInput(dpy, iconWin, OUR_WINDOW_EVENTS);
|
||||||
|
|
||||||
if (0 == XStringListToTextProperty(&progName, 1, &wmName))
|
if (0 == XStringListToTextProperty(&progName, 1, &wmName))
|
||||||
{
|
{
|
||||||
fprintf(stderr, "%s: can't allocate window name text property\n",
|
fprintf(stderr, "%s: can't allocate window name text property\n",
|
||||||
|
@ -931,7 +931,7 @@ int main(int argc, char **argv)
|
||||||
exit(-1);
|
exit(-1);
|
||||||
}
|
}
|
||||||
XSetWMName(dpy, win, &wmName);
|
XSetWMName(dpy, win, &wmName);
|
||||||
|
|
||||||
/* Create a GC for drawing */
|
/* Create a GC for drawing */
|
||||||
gcMask = GCForeground | GCBackground | GCGraphicsExposures;
|
gcMask = GCForeground | GCBackground | GCGraphicsExposures;
|
||||||
gcValues.foreground = fgPixel;
|
gcValues.foreground = fgPixel;
|
||||||
|
@ -947,7 +947,7 @@ int main(int argc, char **argv)
|
||||||
XShapeCombineMask(dpy, iconWin, ShapeBounding, 0, 0, shapeMask,
|
XShapeCombineMask(dpy, iconWin, ShapeBounding, 0, 0, shapeMask,
|
||||||
ShapeSet);
|
ShapeSet);
|
||||||
}
|
}
|
||||||
|
|
||||||
wmHints.initial_state = WithdrawnState;
|
wmHints.initial_state = WithdrawnState;
|
||||||
wmHints.icon_window = iconWin;
|
wmHints.icon_window = iconWin;
|
||||||
wmHints.icon_x = sizeHints.x;
|
wmHints.icon_x = sizeHints.x;
|
||||||
|
@ -982,7 +982,7 @@ int main(int argc, char **argv)
|
||||||
fprintf(stderr, "%s: cleaning up zombies (time %ld)\n",
|
fprintf(stderr, "%s: cleaning up zombies (time %ld)\n",
|
||||||
progName, actualTime);
|
progName, actualTime);
|
||||||
#endif /* DEBUG */
|
#endif /* DEBUG */
|
||||||
if (NULL != commandToExec)
|
if (NULL != commandToExec)
|
||||||
{
|
{
|
||||||
waitpid(0, NULL, WNOHANG);
|
waitpid(0, NULL, WNOHANG);
|
||||||
}
|
}
|
||||||
|
@ -1036,7 +1036,7 @@ int main(int argc, char **argv)
|
||||||
if (NULL != commandToExec)
|
if (NULL != commandToExec)
|
||||||
{
|
{
|
||||||
pid_t fork_pid;
|
pid_t fork_pid;
|
||||||
|
|
||||||
if ((NULL == commandBuf) &&
|
if ((NULL == commandBuf) &&
|
||||||
(!buildCommand(commandToExec, &commandBuf,
|
(!buildCommand(commandToExec, &commandBuf,
|
||||||
&commandLength, &commandIndex)))
|
&commandLength, &commandIndex)))
|
||||||
|
@ -1078,9 +1078,9 @@ int main(int argc, char **argv)
|
||||||
XFreePixmap(dpy, visible.pixmap);
|
XFreePixmap(dpy, visible.pixmap);
|
||||||
#endif /* ONLY_SHAPED_WINDOW */
|
#endif /* ONLY_SHAPED_WINDOW */
|
||||||
XCloseDisplay(dpy);
|
XCloseDisplay(dpy);
|
||||||
exit(0);
|
exit(0);
|
||||||
default:
|
default:
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
XFlush(dpy);
|
XFlush(dpy);
|
||||||
|
|
|
@ -1,12 +1,12 @@
|
||||||
.\" wmclock.man: manual page for wmclock -*- nroff -*-
|
.\" wmclock.man: manual page for wmclock -*- nroff -*-
|
||||||
.\" created 1999-Apr-09 jmk
|
.\" created 1999-Apr-09 jmk
|
||||||
.\"
|
.\"
|
||||||
.\" by Jim Knoble <jmknoble@pobox.com>
|
.\" by Jim Knoble <jmknoble@pobox.com>
|
||||||
.\" Copyright (C) 1999 Jim Knoble
|
.\" Copyright (C) 1999 Jim Knoble
|
||||||
.\" Based on asclock.man by Dan Weeks.
|
.\" Based on asclock.man by Dan Weeks.
|
||||||
.\"
|
.\"
|
||||||
.\" Disclaimer:
|
.\" Disclaimer:
|
||||||
.\"
|
.\"
|
||||||
.\" The software is provided "as is", without warranty of any kind,
|
.\" The software is provided "as is", without warranty of any kind,
|
||||||
.\" express or implied, including but not limited to the warranties of
|
.\" express or implied, including but not limited to the warranties of
|
||||||
.\" merchantability, fitness for a particular purpose and
|
.\" merchantability, fitness for a particular purpose and
|
||||||
|
@ -130,7 +130,7 @@ Window Maker's preferences utility when you click on
|
||||||
.PP
|
.PP
|
||||||
When you use
|
When you use
|
||||||
.B wmclock
|
.B wmclock
|
||||||
with the
|
with the
|
||||||
.B \-exe
|
.B \-exe
|
||||||
option,
|
option,
|
||||||
.B wmclock
|
.B wmclock
|
||||||
|
@ -140,7 +140,7 @@ while the mouse cursor is over
|
||||||
.B Wmclock
|
.B Wmclock
|
||||||
uses the
|
uses the
|
||||||
.BR system (3)
|
.BR system (3)
|
||||||
function from the C library (and ultimately
|
function from the C library (and ultimately
|
||||||
.BR /bin/sh )
|
.BR /bin/sh )
|
||||||
to run the command; hence, the command must be in Bourne-shell syntax.
|
to run the command; hence, the command must be in Bourne-shell syntax.
|
||||||
.SS Using Alternate Month and Weekday Abbreviations
|
.SS Using Alternate Month and Weekday Abbreviations
|
||||||
|
|
Loading…
Reference in a new issue