[Pkg-wmaker-commits] [wmtime] 26/101: Imported Debian patch 1.0b2-11
Doug Torrance
dtorrance-guest at moszumanska.debian.org
Mon Aug 24 23:59:25 UTC 2015
This is an automated email from the git hooks/post-receive script.
dtorrance-guest pushed a commit to branch master
in repository wmtime.
commit 38f8deafb171f50e0027cccf8b3b4971b53dc5da
Author: Doug Torrance <dtorrance at monmouthcollege.edu>
Date: Thu Sep 19 21:09:40 2013 -0500
Imported Debian patch 1.0b2-11
---
debian/changelog | 30 +-
debian/compat | 2 +-
debian/control | 9 +-
debian/copyright | 126 ++++-
debian/patches/previous_changes.diff | 729 ++++++++++++++++++++++++++
debian/patches/series | 5 +
debian/patches/wmtime-fix-compiler-flags.diff | 37 ++
debian/patches/wmtime-fix-noseconds.diff | 51 ++
debian/patches/wmtime-l10n.diff | 105 ++++
debian/patches/wmtime-make-install.diff | 16 +
debian/rules | 99 +---
debian/source/format | 1 +
debian/watch | 2 +
wmgeneral/wmgeneral.c | 40 +-
wmtime/Makefile | 10 +-
wmtime/wmtime-master.xpm | 66 +--
wmtime/wmtime.1 | 178 -------
wmtime/wmtime.c | 190 +++----
18 files changed, 1216 insertions(+), 480 deletions(-)
diff --git a/debian/changelog b/debian/changelog
index f9682a9..49d7492 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -1,7 +1,29 @@
+wmtime (1.0b2-11) unstable; urgency=low
+
+ * New maintainer (Closes: #691813).
+ * debian/compat
+ + Bump to 9.
+ * debian/control
+ + Changed homepage and maintainer.
+ + Bump Standards-Version to 3.9.4, no changes required.
+ * debian/watch
+ + Added.
+ * debian/patches
+ + Switched to dpkg-source 3.0 (quilt) format.
+ + Fixed -noseconds garbage, patch by Andrew Deason (Closes: #639626).
+ + Fixed date localization, patch by Milan Cermak (Closes: #661843).
+ + Fix Makefile to enable hardening, patch by John Paul Adrian Glaubitz.
+ * debian/rules
+ + Simplified to debhelper 7 style.
+ * debian/copyright
+ + Updated to new format.
+
+ -- Doug Torrance <dtorrance at monmouthcollege.edu> Thu, 19 Sep 2013 21:09:40 -0500
+
wmtime (1.0b2-10) unstable; urgency=low
* New maintainer. (Closes: #487135)
- * Checked the debian files against the latest standard. (Closes: Bug#379574)
+ * Checked the debian files against the latest standard. (Closes: #379574)
* Moved menu item to Applications/System/Monitoring.
* Minor code corrections to avoid build warnings.
@@ -32,9 +54,9 @@ wmtime (1.0b2-6) unstable; urgency=low
* New maintainer.
* Added a manual page for wmtime. It was inspired by Adriaan Peeters'
- work. (Closes: Bug#181684)
- * Added the -geometry option. (Closes: Bug#182278, Bug#212426)
- * Added the -noseconds option. (Closes: Bug#25438)
+ work. (Closes: #181684)
+ * Added the -geometry option. (Closes: #182278, #212426)
+ * Added the -noseconds option. (Closes: #25438)
* Fixed some buffer overflow problems.
-- Simon Law <sfllaw at debian.org> Thu, 09 Oct 2003 17:52:34 -0400
diff --git a/debian/compat b/debian/compat
index b8626c4..ec63514 100644
--- a/debian/compat
+++ b/debian/compat
@@ -1 +1 @@
-4
+9
diff --git a/debian/control b/debian/control
index 16498db..0eee71a 100644
--- a/debian/control
+++ b/debian/control
@@ -1,9 +1,12 @@
Source: wmtime
Section: x11
Priority: optional
-Maintainer: Paul Harris <harris.pc at gmail.com>
-Build-Depends: debhelper (>= 7), libx11-dev, libxpm-dev, libxext-dev
-Standards-Version: 3.8.0
+Maintainer: Doug Torrance <dtorrance at monmouthcollege.edu>
+Build-Depends: debhelper (>= 9), libx11-dev, libxpm-dev, libxext-dev
+Standards-Version: 3.9.4
+Homepage: http://wmaker.friedcheese.org
+Vcs-Browser: http://repo.or.cz/r/dockapps.git
+Vcs-Git: git://repo.or.cz/dockapps.git
Package: wmtime
Architecture: any
diff --git a/debian/copyright b/debian/copyright
index 7e44a6e..58ccf97 100644
--- a/debian/copyright
+++ b/debian/copyright
@@ -1,29 +1,97 @@
-This package was debianized by Fredrik Hallenberg hallon at debian.org on
-Wed, 15 Jul 1998 18:18:07 +0200.
-
-It was downloaded from http://www.xs4all.nl/~warp/files/wmtime-1.0b2.tar.gz
-
-Upstream Authors: Martijn Pieterse <pieterse at xs4all.nl>
- Antoine Nulle <warp at xs4all.nl>
-
-Upstream Copyright:
-
- Copyright (c) 1997, 1998 by Martijn Pieterse and Antoine Nulle
-
- This program is free software; you can redistribute it and/or modify it
- under the terms of the GNU General Public License as published by the
- Free Software Foundation; either version 2, or (at your option) any
- later version.
-
- This program is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- GNU General Public License for more details.
-
- You should have received a copy of the GNU General Public License
- along with this program; if not, write to the
- Free Software Foundation, Inc.,
- 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA.
-
-On Debian GNU/Linux systems, the complete text of the GNU General
-Public License can be found in `/usr/share/common-licenses/GPL'.
+Format: http://www.debian.org/doc/packaging-manuals/copyright-format/1.0/
+Upstream-Name: wmtime
+Upstream-Contact: Doug Torrance <profzoom at hotmail.com>
+Source: http://wmaker.friedcheese.org
+
+Files: *
+Copyright: 1997, 1998 Martijn Pieterse and Antoine Nulle
+License: GPL-2
+
+Files: wmtime/wmtime.1
+Copyright: 2003 Software in the Public Interest, Inc.
+License: GPL-2+
+
+Files: wmgeneral/misc.c
+Copyright: 1997 Alfredo K. Kojima
+License: GPL-2+
+
+Files: wmgeneral/list.*
+Copyright: 1993, 1994 Free Software Foundation, Inc.
+License: GPL-2+ with exception
+
+Files: debian/*
+Copyright: 2012 Doug Torrance
+License: GPL-2+
+
+License: GPL-2
+ This program is free software; you can redistribute it
+ and/or modify it under the terms of the GNU General Public
+ License as published by the Free Software Foundation; either
+ version 2 of the License.
+ .
+ This program is distributed in the hope that it will be
+ useful, but WITHOUT ANY WARRANTY; without even the implied
+ warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
+ PURPOSE. See the GNU General Public License for more
+ details.
+ .
+ You should have received a copy of the GNU General Public
+ License along with this package; if not, write to the Free
+ Software Foundation, Inc., 51 Franklin St, Fifth Floor,
+ Boston, MA 02110-1301 USA
+ .
+ On Debian systems, the full text of the GNU General Public
+ License version 2 can be found in the file
+ `/usr/share/common-licenses/GPL-2'.
+
+License: GPL-2+
+ This program is free software; you can redistribute it
+ and/or modify it under the terms of the GNU General Public
+ License as published by the Free Software Foundation; either
+ version 2 of the License, or (at your option) any later
+ version.
+ .
+ This program is distributed in the hope that it will be
+ useful, but WITHOUT ANY WARRANTY; without even the implied
+ warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
+ PURPOSE. See the GNU General Public License for more
+ details.
+ .
+ You should have received a copy of the GNU General Public
+ License along with this package; if not, write to the Free
+ Software Foundation, Inc., 51 Franklin St, Fifth Floor,
+ Boston, MA 02110-1301 USA
+ .
+ On Debian systems, the full text of the GNU General Public
+ License version 2 can be found in the file
+ `/usr/share/common-licenses/GPL-2'.
+
+License: GPL-2+ with exception
+ This program is free software; you can redistribute it
+ and/or modify it under the terms of the GNU General Public
+ License as published by the Free Software Foundation; either
+ version 2 of the License, or (at your option) any later
+ version.
+ .
+ This program is distributed in the hope that it will be
+ useful, but WITHOUT ANY WARRANTY; without even the implied
+ warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
+ PURPOSE. See the GNU General Public License for more
+ details.
+ .
+ You should have received a copy of the GNU General Public
+ License along with this package; if not, write to the Free
+ Software Foundation, Inc., 51 Franklin St, Fifth Floor,
+ Boston, MA 02110-1301 USA
+ .
+ On Debian systems, the full text of the GNU General Public
+ License version 2 can be found in the file
+ `/usr/share/common-licenses/GPL-2'.
+ .
+ As a special exception, if you link this library with files compiled with
+ GCC to produce an executable, this does not cause the resulting executable
+ to be covered by the GNU General Public License. This exception does not
+ however invalidate any other reasons why the executable file might be
+ covered by the GNU General Public License.
+
+
diff --git a/debian/patches/previous_changes.diff b/debian/patches/previous_changes.diff
new file mode 100644
index 0000000..d080833
--- /dev/null
+++ b/debian/patches/previous_changes.diff
@@ -0,0 +1,729 @@
+Description: All previous patches
+ This patch contains all of the previous patches up to Debian revision version 1.0b2-11. Needed in debian/patches after upgrading debian/compat from 4 to 9.
+
+
+--- wmtime-1.0b2.orig/wmgeneral/wmgeneral.c
++++ wmtime-1.0b2/wmgeneral/wmgeneral.c
+@@ -12,6 +12,8 @@
+ ---
+ CHANGES:
+ ---
++ 10/10/2003 (Simon Law, sfllaw at debian.org)
++ * changed the parse_rcfile function to use getline instead of fgets.
+ 02/05/1998 (Martijn Pieterse, pieterse at xs4all.nl)
+ * changed the read_rc_file to parse_rcfile, as suggester by Marcelo E. Magallon
+ * debugged the parse_rc file.
+@@ -21,6 +23,7 @@
+
+ */
+
++#define _GNU_SOURCE
+ #include <stdlib.h>
+ #include <stdio.h>
+ #include <string.h>
+@@ -43,6 +46,11 @@ int screen;
+ int x_fd;
+ int d_depth;
+ XSizeHints mysizehints;
++/* Deal with strange X11 function prototyping...
++ * If I don't do this, I will get warnings about the sign
++ * of the width/height variables - which are thrown away anyway. */
++int dummy_int_width, dummy_int_height;
++unsigned int uint_width, uint_height;
+ XWMHints mywmhints;
+ Pixel back_pix, fore_pix;
+ char *Geometry = "";
+@@ -83,17 +91,18 @@ int CheckMouseRegion(int, int);
+ void parse_rcfile(const char *filename, rckeys *keys) {
+
+ char *p;
+- char temp[128];
++ char *line = NULL;
++ size_t line_size = 0;
+ char *tokens = " :\t\n";
+ FILE *fp;
+ int i,key;
+
+ fp = fopen(filename, "r");
+ if (fp) {
+- while (fgets(temp, 128, fp)) {
++ while (getline(&line, &line_size, fp) >= 0) {
+ key = 0;
+ while (key >= 0 && keys[key].label) {
+- if ((p = strstr(temp, keys[key].label))) {
++ if ((p = strstr(line, keys[key].label))) {
+ p += strlen(keys[key].label);
+ p += strspn(p, tokens);
+ if ((i = strcspn(p, "#\n"))) p[i] = 0;
+@@ -270,6 +279,7 @@ void openXwindow(int argc, char *argv[],
+ unsigned int borderwidth = 1;
+ XClassHint classHint;
+ char *display_name = NULL;
++ char *geometry = NULL;
+ char *wname = argv[0];
+ XTextProperty name;
+
+@@ -282,7 +292,9 @@ void openXwindow(int argc, char *argv[],
+
+ for (i=1; argv[i]; i++) {
+ if (!strcmp(argv[i], "-display"))
+- display_name = argv[i+1];
++ display_name = argv[++i];
++ else if (!strcmp(argv[i], "-geometry"))
++ geometry = argv[++i];
+ }
+
+ if (!(display = XOpenDisplay(display_name))) {
+@@ -307,16 +319,21 @@ void openXwindow(int argc, char *argv[],
+ fore_pix = GetColor("black");
+
+ XWMGeometry(display, screen, Geometry, NULL, borderwidth, &mysizehints,
+- &mysizehints.x, &mysizehints.y,&mysizehints.width,&mysizehints.height, &dummy);
+-
+- mysizehints.width = 64;
+- mysizehints.height = 64;
++ &mysizehints.x, &mysizehints.y,
++ &dummy_int_width, &dummy_int_height, &dummy);
++ if (geometry)
++ XParseGeometry(geometry, &mysizehints.x, &mysizehints.y,
++ &uint_width, &uint_height);
++
++ /* Override width/height anyway */
++ uint_width = 64;
++ uint_height = 64;
+
+ win = XCreateSimpleWindow(display, Root, mysizehints.x, mysizehints.y,
+- mysizehints.width, mysizehints.height, borderwidth, fore_pix, back_pix);
++ uint_width, uint_height, borderwidth, fore_pix, back_pix);
+
+ iconwin = XCreateSimpleWindow(display, win, mysizehints.x, mysizehints.y,
+- mysizehints.width, mysizehints.height, borderwidth, fore_pix, back_pix);
++ uint_width, uint_height, borderwidth, fore_pix, back_pix);
+
+ /* Activate hints */
+ XSetWMNormalHints(display, win, &mysizehints);
+@@ -364,3 +381,6 @@ void openXwindow(int argc, char *argv[],
+ XMapWindow(display, win);
+
+ }
++
++/* vim: ts=4 columns=82
++ */
+--- wmtime-1.0b2.orig/wmtime/Makefile
++++ wmtime-1.0b2/wmtime/Makefile
+@@ -4,12 +4,16 @@ OBJS = wmtime.o \
+ ../wmgeneral/wmgeneral.o \
+ ../wmgeneral/misc.o \
+ ../wmgeneral/list.o
++XPMS = wmtime-master.xpm wmtime-mask.xbm
++
++CC = gcc
++CFLAGS = -O2
+
+ .c.o:
+- cc -c -O2 -Wall $< -o $*.o
++ $(CC) $(CFLAGS) -c -Wall $< -o $*.o
+
+-wmtime: $(OBJS)
+- cc -o wmtime $^ $(LIBDIR) $(LIBS)
++wmtime: $(OBJS) $(XPMS)
++ $(CC) $(CFLAGS) -o wmtime $(OBJS) $(LIBDIR) $(LIBS)
+
+ clean::
+ for i in $(OBJS) ; do \
+--- /dev/null
++++ wmtime-1.0b2/wmtime/wmtime.1
+@@ -0,0 +1,178 @@
++'\" t
++.\" Man page for wmtime
++.\" Copyright (c) 2003 Software in the Public Interest, Inc.
++.\"
++.\" This program is free software; you can redistribute it and/or modify
++.\" it under the terms of the GNU General Public License as published by
++.\" the Free Software Foundation; either version 2 of the License, or (at
++.\" your option) any later version.
++.\"
++.\" This program is distributed in the hope that it will be useful, but
++.\" WITHOUT ANY WARRANTY; without even the implied warranty of
++.\" MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
++.\" General Public License for more details.
++.\"
++.\" You should have received a copy of the GNU General Public License
++.\" along with this program; if not, write to the Free Software
++.\" Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA.
++.\"
++.TH WMTIME 1 "May 1998" "WMTIME 1.0b2"
++
++.SH NAME
++wmtime \- Window Maker dockapp that displays the time and date
++
++.SH SYNOPSIS
++
++.B wmtime
++[
++.I OPTION
++]
++
++.SH DESCRIPTION
++
++.B WMTime
++displays the time and date and gives you some nice additional
++features too. It is intended for docking in Window Maker.
++
++It currently provides:
++
++.IP \(bu 4
++the time and date;
++
++.IP \(bu
++a realtime morphing interface (analog <> digital mode);
++.IP \(bu
++auto\-scaled and anti\-aliased hands;
++.IP \(bu
++localization, displaying the day and date in various languages;
++.IP \(bu
++three user\-defined commands to launch.
++
++.SH OPTIONS
++
++.TP
++.BR \-d , \ \-digital
++Display the digital clock on startup, instead of the analog clock.
++
++.TP
++.BI \-display \ display
++This option specifies the X server to contact; see
++.IR X(7x) .
++
++.TP
++.BI \-geometry \ geometry
++This option specifies the preferred position of clock; see
++.IR X(7x) .
++
++.TP
++.BR \-n , \ \-noseconds
++Disables the second hand.
++
++.TP
++.B \-h
++Show help information.
++
++.TP
++.B \-v
++Print the version number.
++
++.SH USAGE
++The
++.B WMTime
++window is separated into top and bottom sections. The top section
++contains a clock and the bottom section contains the date.
++
++The clock can be toggled between analog and digital modes. To do this,
++click in the bottom section of the window.
++
++WMTime can also be used to launch programs. You may click either left,
++middle, or right mouse buttons in the top section of the window. The
++pre\-configured program will be launched according to the mouse button
++clicked. (see
++.B CONFIGURATION FILE
++below.)
++
++In order to move
++.BR WMTime ,
++drag on the outer edges. These are not sensitive to mouse clicks.
++
++.SH "DOCKING IN WINDOW MANAGERS"
++
++.TP
++Window Maker
++
++Window Maker users should drag and drop the
++.B WMTime
++window on the Dock. Then, right\-click on the border of the window and
++select \*(lqSettings...\*(rq. Check \*(lqStart when Window Maker
++is started\*(rq.
++
++.TP
++AfterStep
++
++AfterStep users should put the following in their
++.I $HOME/.steprc
++
++.RS 16
++Wharf wmtime \- MaxSwallow "wmtime" wmtime &
++.RE
++
++.TP
++Other window managers
++
++.B WMTime
++runs nicely as a 64x64 shaped icon on your desktop.
++
++.SH "CONFIGURATION FILE"
++
++.B WMTime
++can launch three user\-defined commands, triggered by left, middle and
++right mouse button clicks. You can define the commands to launch in
++.I $HOME/.wmtimerc
++
++.RS
++.PD 0
++left: xterm
++.PP
++middle: xload
++.PP
++right: xcalc
++.PP
++.PD
++.RE
++
++If
++.B WMTime
++detects a
++.I $HOME/.wmtimerc
++file, it will launch the appropriate command when you click on the clock.
++
++The system administrator can define default commands in
++.IR /etc/wmtimerc .
++The administrator may also choose to \*(lqfix\*(rq particular commands,
++making it impossible for users to change. These commands can be defined in
++.IR /etc/wmtimerc.fixed ,
++although this isn't a nice thing to do.
++
++.SH FILES
++
++.I /etc/wmtimerc
++.br
++.I $HOME/.wmtimerc
++.br
++.I /etc/wmtimerc.fixed
++
++.SH AUTHORS
++
++.B WMTime
++was written by Martijn Pieterse and Antoine Nulle.
++
++This manual page was written by Simon Law <sfllaw at debian.org> for the
++.B Debian
++system (but may be used by others). It is based on the documentation provided
++by the original program.
++
++This manual is free software; you can redistribute it and/or modify
++it under the terms of the GNU General Public License as published by
++the Free Software Foundation; either version 2 of the License, or (at
++your option) any later version.
+--- wmtime-1.0b2.orig/wmtime/wmtime-master.xpm
++++ wmtime-1.0b2/wmtime/wmtime-master.xpm
+@@ -29,44 +29,44 @@ static char * wmtime_master_xpm[] = {
+ " X......................................................o X......................................................o ................................",
+ " X.........................OOO..........................o X......................................................o ................................",
+ " X.........................OOO+.........................o X......................................................o ................................",
+-" X..............@@.........OOO+........@@...............o X...++++...++++.......++++...++++.......++++...++++....o ................................",
+-" X..............@@+.........+++........@@+..............o X..+....+.+....+..+..+....+.+....+..+..+....+.+....+...o ................................",
+-" X...............++.....................++..............o X..+....+.+....+..+..+....+.+....+..+..+....+.+....+...o ................................",
+-" X......................................................o X..+....+.+....+.....+....+.+....+.....+....+.+....+...o ................................",
++" X..............@@.........OOO+........@@...............o X......................................................o ................................",
++" X..............@@+.........+++........@@+..............o X......................................................o ................................",
++" X...............++.....................++..............o X......................................................o ................................",
++" X......................................................o X......................................................o ................................",
++" X......................................................o X......................................................o ................................",
++" X......................................................o X......................................................o ................................",
++" X......@@......................................@@......o X......................................................o ................................",
++" X......@@+.....................................@@+.....o X......................................................o ................................",
++" X.......++......................................++.....o X......................................................o ................................",
++" X......................................................o X......................................................o ................................",
++" X......................................................o X......................................................o ................................",
++" X......................................................o X......................................................o ................................",
+ " X......................................................o X...++++...++++.......++++...++++.......++++...++++....o ................................",
+-" X......................................................o X..+....+.+....+.....+....+.+....+.....+....+.+....+...o ................................",
+-" X......@@......................................@@......o X..+....+.+....+..+..+....+.+....+..+..+....+.+....+...o ................................",
+-" X......@@+.....................................@@+.....o X..+....+.+....+..+..+....+.+....+..+..+....+.+....+...o ................................",
+-" X.......++......................................++.....o X...++++...++++.......++++...++++.......++++...++++....o ................................",
++" X......................................................o X..+....+.+....+..+..+....+.+....+..+..+....+.+....+...o ................................",
++" X......................................................o X..+....+.+....+..+..+....+.+....+..+..+....+.+....+...o ................................",
++" X..OOO...........................................OOO...o X..+....+.+....+.....+....+.+....+.....+....+.+....+...o ................................",
++" X..OOO+..........................................OOO+..o X...++++...++++.......++++...++++.......++++...++++....o ................................",
++" X..OOO+..........................................OOO+..o X..+....+.+....+.....+....+.+....+.....+....+.+....+...o ................................",
++" X...+++...........................................+++..o X..+....+.+....+..+..+....+.+....+..+..+....+.+....+...o ................................",
++" X......................................................o X..+....+.+....+..+..+....+.+....+..+..+....+.+....+...o ................................",
++" X......................................................o X...++++...++++.......++++...++++.......++++...++++....o ................................",
++" X......................................................o X......................................................o ................................",
++" X......................................................o X......................................................o ................................",
+ " X......................................................o X......................................................o ................................",
+ " X......................................................o X......................................................o ................................",
++" X......@@......................................@@......o X......................................................o ................................",
++" X......@@+.....................................@@+.....o X......................................................o ................................",
++" X.......++......................................++.....o X......................................................o ................................",
+ " X......................................................o X......................................................o ................................",
+ " X......................................................o X......................................................o ................................",
+-" X......................................................o oooooooooooooooooooooooooooooooooooooooooooooooooooooooo ................................",
+-" X......................................................o ................................",
+-" X..OOO...........................................OOO...o ................................",
+-" X..OOO+..........................................OOO+..o ................................",
+-" X..OOO+..........................................OOO+..o ................................",
+-" X...+++...........................................+++..o ................................",
+-" X......................................................o ................................",
+-" X......................................................o ................................",
+-" X......................................................o ................................",
+-" X......................................................o ................................",
+-" X......................................................o ................................",
+-" X......................................................o ................................",
+-" X......@@......................................@@......o ................................",
+-" X......@@+.....................................@@+.....o ................................",
+-" X.......++......................................++.....o ................................",
+-" X......................................................o ................................",
+-" X......................................................o ................................",
+-" X......................................................o ................................",
+-" X..............@@.....................@@...............o ................................",
+-" X..............@@+........OOO.........@@+..............o ................................",
+-" X...............++........OOO+.........++..............o ................................",
+-" X.........................OOO+.........................o ................................",
+-" X..........................+++.........................o ................................",
+-" X......................................................o ................................",
+-" oooooooooooooooooooooooooooooooooooooooooooooooooooooooo ................................",
++" X......................................................o X......................................................o ................................",
++" X..............@@.....................@@...............o X......................................................o ................................",
++" X..............@@+........OOO.........@@+..............o X......................................................o ................................",
++" X...............++........OOO+.........++..............o X......................................................o ................................",
++" X.........................OOO+.........................o X......................................................o ................................",
++" X..........................+++.........................o X......................................................o ................................",
++" X......................................................o X......................................................o ................................",
++" oooooooooooooooooooooooooooooooooooooooooooooooooooooooo oooooooooooooooooooooooooooooooooooooooooooooooooooooooo ................................",
+ " ................................",
+ " ................................",
+ " XXXXXXXXXXXXXXXX XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX XXXXXXXXXXXXXXXX XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX ................................",
+--- wmtime-1.0b2.orig/wmtime/wmtime.c
++++ wmtime-1.0b2/wmtime/wmtime.c
+@@ -26,6 +26,13 @@
+ ----
+ Changes:
+ ----
++ 15/07/2008 (Paul Harris, harris.pc at gmail.com)
++ * Minor changes to correct build warnings
++ 09/10/2003 (Simon Law, sfllaw at debian.org)
++ * Add -geometry support
++ * Add -noseconds support
++ * Make the digital clock fill the space provided
++ * Eliminated exploitable static buffers
+ 17/05/1998 (Antoine Nulle, warp at xs4all.nl)
+ * Updated version number and some other minor stuff
+ 16/05/1998 (Antoine Nulle, warp at xs4all.nl)
+@@ -50,6 +57,7 @@
+ * Copied the source from wmmon.
+ */
+
++#define _GNU_SOURCE
+ #include <stdlib.h>
+ #include <stdio.h>
+ #include <time.h>
+@@ -76,9 +84,9 @@
+ /* Defines */
+ /***********/
+
+-#define LEFT_ACTION (NULL)
+-#define MIDDLE_ACTION (NULL)
+-#define RIGHT_ACTION (NULL)
++const char* default_left_action = NULL;
++const char* default_middle_action = NULL;
++const char* default_right_action = NULL;
+
+ #define WMMON_VERSION "1.0b2"
+
+@@ -86,55 +94,63 @@
+ /* Global Variables */
+ /********************/
+
+-char *ProgName;
+ int digital = 0;
++int noseconds = 0;
+ char day_of_week[7][3] = { "SU", "MO", "TU", "WE", "TH", "FR", "SA" };
+-char mon_of_year[12][4] = { "JAN", "FEB", "MAR", "APR", "MAY", "JUN", "JUL", "AUG", "SEP", "OCT", "NOW", "DEC" };
++char mon_of_year[12][4] = { "JAN", "FEB", "MAR", "APR", "MAY", "JUN", "JUL", "AUG", "SEP", "OCT", "NOV", "DEC" };
+
+ /* functions */
+-void usage(void);
++void usage(char *);
+ void printversion(void);
+
+ void wmtime_routine(int, char **);
+ void get_lang();
+
+-void main(int argc, char *argv[]) {
++int main(int argc, char *argv[]) {
+
+ int i;
+-
+-
+- /* Parse Command Line */
++ char *name = argv[0];
+
+- ProgName = argv[0];
+- if (strlen(ProgName) >= 6)
+- ProgName += (strlen(ProgName) - 6);
+-
+ for (i=1; i<argc; i++) {
+ char *arg = argv[i];
+
+ if (*arg=='-') {
+ switch (arg[1]) {
+ case 'd' :
+- if (strcmp(arg+1, "display") && strcmp(arg+1, "digital")) {
+- usage();
+- exit(1);
++ if (strcmp(arg+1, "display")
++ && strcmp(arg+1, "digital") && strcmp(arg+1, "d")) {
++ usage(name);
++ return 1;
+ }
+- if (!strcmp(arg+1, "digital"))
++ if (!strcmp(arg+1, "digital") || !(strcmp(arg+1, "d")))
+ digital = 1;
+ break;
++ case 'g' :
++ if (strcmp(arg+1, "geometry")) {
++ usage(name);
++ return 1;
++ }
++ break;
++ case 'n' :
++ if (strcmp(arg+1, "noseconds") && strcmp(arg+1, "n")) {
++ usage(name);
++ return 1;
++ } else {
++ noseconds = 1;
++ }
++ break;
+ case 'v' :
+ printversion();
+- exit(0);
+- break;
++ return 0;
+ default:
+- usage();
+- exit(0);
+- break;
++ usage(name);
++ return 1;
+ }
+ }
+ }
+ get_lang();
+ wmtime_routine(argc, argv);
++ return 0;
+ }
+
+ /************/
+@@ -143,19 +159,22 @@ void main(int argc, char *argv[]) {
+ void get_lang(){
+ FILE *fp;
+ int i;
+- char temp[5];
++ const int line_size = 5;
++ char line[line_size];
+
+ fp=fopen("language","r");
+ if (fp) {
++ /* Grab the days of the week */
+ for (i=0;i<7;i++){
+- fgets(temp,4,fp);
+- strncpy(day_of_week[i],temp,2);
++ fgets(line, line_size, fp);
++ strncpy(day_of_week[i], line, 2);
+ };
++ /* Grab the names of the months */
+ for (i=0;i<12;i++){
+- fgets(temp,5,fp);
+- strncpy(mon_of_year[i],temp,3);
++ fgets(line, line_size, fp);
++ strncpy(mon_of_year[i], line, 3);
+ };
+- fclose(fp);
++ fclose(fp);
+ };
+ }
+
+@@ -191,39 +210,38 @@ void wmtime_routine(int argc, char **arg
+ long curtime;
+ long nexttime;
+
+- char temp[128];
+- char *p;
++ char *conffile = NULL;
+
+ /* Scan through ~/.wmtimerc for the mouse button actions. */
+- if (LEFT_ACTION) left_action = strdup(LEFT_ACTION);
+- if (MIDDLE_ACTION) middle_action = strdup(MIDDLE_ACTION);
+- if (RIGHT_ACTION) right_action = strdup(RIGHT_ACTION);
+-
+- /* Scan throught the .rc files */
+- strcpy(temp, "/etc/wmtimerc");
+- parse_rcfile(temp, wmtime_keys);
+-
+- p = getenv("HOME");
+- strcpy(temp, p);
+- strcat(temp, "/.wmtimerc");
+- parse_rcfile(temp, wmtime_keys);
++ if (default_left_action) left_action = strdup(default_left_action);
++ if (default_middle_action) middle_action = strdup(default_middle_action);
++ if (default_right_action) right_action = strdup(default_right_action);
+
+- strcpy(temp, "/etc/wmtimerc.fixed");
+- parse_rcfile(temp, wmtime_keys);
++ /* Scan through the .rc files */
++ if (asprintf(&conffile, "/etc/wmtimerc") >= 0) {
++ parse_rcfile(conffile, wmtime_keys);
++ free(conffile);
++ }
+
++ if (asprintf(&conffile, "%s/.wmtimerc", getenv("HOME")) >= 0) {
++ parse_rcfile(conffile, wmtime_keys);
++ free(conffile);
++ }
++
++ if (asprintf(&conffile, "/etc/wmtimerc.fixed") >= 0) {
++ parse_rcfile(conffile, wmtime_keys);
++ free(conffile);
++ }
+
+ openXwindow(argc, argv, wmtime_master_xpm, wmtime_mask_bits, 128, 64);
+
+- copyXPMArea(0, 0, 128, 64, 0, 98);
+- if (digital) {
+- copyXPMArea(64, 0, 64, 64, 0, 0);
+- setMaskXY(-64, 0);
+- } else {
+- copyXPMArea(0, 0, 64, 64, 64, 0);
+- setMaskXY(0, 0);
+- }
++ /* Mask out the right parts of the clock */
++ copyXPMArea(0, 0, 128, 64, 0, 98); /* Draw the borders */
++ copyXPMArea(0, 0, 64, 64, 64, 0); /* Draw the clock face */
++ copyXPMArea(64, 98, 64, 64, 0, 0); /* Draw the LCD background */
++ setMaskXY(0, 0);
+
+- /* add mouse region */
++ /* add mouse region */
+ AddMouseRegion(0, 5, 48, 58, 60);
+ AddMouseRegion(1, 5, 5, 58, 46);
+
+@@ -282,12 +300,10 @@ void wmtime_routine(int argc, char **arg
+
+ if (digital) {
+ copyXPMArea(64, 98, 64, 64, 0, 0);
+- setMaskXY(-64, 0);
+ DrawTime(time_struct->tm_hour, time_struct->tm_min, time_struct->tm_sec);
+ DrawDate(time_struct->tm_wday, time_struct->tm_mday, time_struct->tm_mon);
+ } else {
+- copyXPMArea(0, 98, 64, 64, 0, 0);
+- setMaskXY(0, 0);
++ copyXPMArea(0, 98, 64, 64, 0, 0);
+ DrawWijzer(time_struct->tm_hour, time_struct->tm_min, time_struct->tm_sec);
+ DrawDate(time_struct->tm_wday, time_struct->tm_mday, time_struct->tm_mon);
+ }
+@@ -324,24 +340,28 @@ void wmtime_routine(int argc, char **arg
+ \*******************************************************************************/
+
+ void DrawTime(int hr, int min, int sec) {
+-
+-
+- char temp[16];
+- char *p = temp;
++ const int time_size = 16;
++ char time[time_size];
++ char *p = time;
+ int i,j,k=6;
+
+ /* 7x13 */
+
+- sprintf(temp, "%02d:%02d:%02d ", hr, min, sec);
++ if (noseconds) {
++ snprintf(time, time_size, "%02d:%02d ", hr, min);
++ }
++ else {
++ snprintf(time, time_size, "%02d:%02d:%02d ", hr, min, sec);
++ }
+
+- for (i=0; i<3; i++) {
++ for (i=0; i < 3; i++) {
+ for (j=0; j<2; j++) {
+- copyXPMArea((*p-'0')*7 + 1, 84, 8, 13, k, 6);
++ copyXPMArea((*p-'0')*7 + 1, 84, 8, 13, k, 18);
+ k += 7;
+ p++;
+ }
+ if (*p == ':') {
+- copyXPMArea(71, 84, 5, 13, k, 6);
++ copyXPMArea(71, 84, 5, 13, k, 18);
+ k += 4;
+ p++;
+ }
+@@ -353,15 +373,15 @@ void DrawTime(int hr, int min, int sec)
+ \*******************************************************************************/
+
+ void DrawDate(int wkday, int dom, int month) {
+-
+-
+- char temp[16];
+- char *p = temp;
++ const int date_size = 16;
++ char date[date_size];
++ char *p = date;
+ int i,k;
+
+ /* 7x13 */
+
+- sprintf(temp, "%.2s%02d%.3s ", day_of_week[wkday], dom, mon_of_year[month]);
++ snprintf(date, date_size,
++ "%.2s%02d%.3s ", day_of_week[wkday], dom, mon_of_year[month]);
+
+ k = 5;
+ for (i=0; i<2; i++) {
+@@ -541,6 +561,9 @@ void DrawWijzer(int hr, int min, int sec
+ }
+ }
+ /**********************************************************************/
++ if (noseconds)
++ return; /* Skip drawing the seconds. */
++
+ psi = sec * (M_PI / 30.0);
+
+ dx = floor(sin(psi) * 22 * 0.9 + 0.5);
+@@ -612,15 +635,16 @@ void DrawWijzer(int hr, int min, int sec
+ |* usage *|
+ \*******************************************************************************/
+
+-void usage(void) {
+-
+- fprintf(stderr, "\nwmtime - programming: tijno, (de)bugging & design: warp, web hosting: bobby\n\n");
+- fprintf(stderr, "usage:\n");
+- fprintf(stderr, "\t-digital\tdigital clock\n");
+- fprintf(stderr, "\t-display <display name>\n");
+- fprintf(stderr, "\t-h\tthis screen\n");
+- fprintf(stderr, "\t-v\tprint the version number\n");
+- fprintf(stderr, "\n");
++void usage(char *name) {
++ printf("Usage: %s [OPTION]...\n", name);
++ printf("WindowMaker dockapp that displays the time and date.\n");
++ printf("\n");
++ printf(" -d, -digital display the digital clock\n");
++ printf(" -display DISPLAY contact the DISPLAY X server\n");
++ printf(" -geometry GEOMETRY position the clock at GEOMETRY\n");
++ printf(" -n, -noseconds disables the second hand\n");
++ printf(" -h display this help and exit\n");
++ printf(" -v output version information and exit\n");
+ }
+
+ /*******************************************************************************\
+@@ -628,8 +652,8 @@ void usage(void) {
+ \*******************************************************************************/
+
+ void printversion(void) {
+-
+- if (!strcmp(ProgName, "wmtime")) {
+- fprintf(stderr, "%s\n", WMMON_VERSION);
+- }
++ printf("WMTime version %s\n", WMMON_VERSION);
+ }
++
++/* vim: sw=4 ts=4 columns=82
++ */
diff --git a/debian/patches/series b/debian/patches/series
new file mode 100644
index 0000000..40b071f
--- /dev/null
+++ b/debian/patches/series
@@ -0,0 +1,5 @@
+previous_changes.diff
+wmtime-fix-noseconds.diff
+wmtime-l10n.diff
+wmtime-make-install.diff
+wmtime-fix-compiler-flags.diff
diff --git a/debian/patches/wmtime-fix-compiler-flags.diff b/debian/patches/wmtime-fix-compiler-flags.diff
new file mode 100644
index 0000000..e3004bd
--- /dev/null
+++ b/debian/patches/wmtime-fix-compiler-flags.diff
@@ -0,0 +1,37 @@
+Description: Fix compiler and linker flags in Makefile.
+ The Makefile of wmtime had to be patched in order for CFLAGS
+ not to be redefined by the Makefile but to use the CFLAGS
+ passed by debhelper and add additional flags through
+ string concatenation. LDFLAGS and CPPFLAGS weren't passed
+ at all and have been added to the linker command line.
+ .
+
+--
+
+Author: John Paul Adrian Glaubitz <glaubitz at physik.fu-berlin.de>
+Bug-Debian: (none)
+Applied-Upstream: (none)
+
+---
+
+Index: wmtime-1.0b2/wmtime/Makefile
+===================================================================
+--- wmtime-1.0b2.orig/wmtime/Makefile 2013-09-21 20:32:56.000000000 +0200
++++ wmtime-1.0b2/wmtime/Makefile 2013-09-21 20:43:10.386769250 +0200
+@@ -7,13 +7,13 @@
+ XPMS = wmtime-master.xpm wmtime-mask.xbm
+
+ CC = gcc
+-CFLAGS = -O2
++CFLAGS += -O2
+
+ .c.o:
+- $(CC) $(CFLAGS) -c -Wall $< -o $*.o
++ $(CC) $(CFLAGS) $(CPPFLAGS) $(LDFLAGS) -c -Wall $< -o $*.o
+
+ wmtime: $(OBJS) $(XPMS)
+- $(CC) $(CFLAGS) -o wmtime $(OBJS) $(LIBDIR) $(LIBS)
++ $(CC) $(CFLAGS) $(CPPFLAGS) $(LDFLAGS) -o wmtime $(OBJS) $(LIBDIR) $(LIBS)
+
+ clean::
+ for i in $(OBJS) ; do \
diff --git a/debian/patches/wmtime-fix-noseconds.diff b/debian/patches/wmtime-fix-noseconds.diff
new file mode 100644
index 0000000..812897c
--- /dev/null
+++ b/debian/patches/wmtime-fix-noseconds.diff
@@ -0,0 +1,51 @@
+Description: wmtime draws garbage when -noseconds is given
+
+wmtime draws a small amount of garbage to the screen when -noseconds is
+given, because DrawTime reads beyond the given string buffer. This
+doesn't trigger all the time for me (I assume due to the nondeterminism
+of reading uninitialized memory or something), but it pretty clearly
+happens if I switch VTs.
+
+The attached patch limits the amount of the formatted string we try to
+read, so we don't read beyond the end of the string. Fixes it for me.
+
+--
+Andrew Deason
+adeason at dson.org
+Author: Andrew Deason <adeason at dson.org>
+Bug-Debian: http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=639626
+Applied-Upstream: http://repo.or.cz/w/dockapps.git/commit/2295cacec4c6ffbe7d31868d0d016abfb6899011
+
+---
+ wmtime/wmtime.c | 5 ++++-
+ 1 files changed, 4 insertions(+), 1 deletions(-)
+
+diff --git a/wmtime/wmtime.c b/wmtime/wmtime.c
+index 2dfed0c..6f1a007 100644
+--- a/wmtime/wmtime.c
++++ b/wmtime/wmtime.c
+@@ -344,17 +344,20 @@ void DrawTime(int hr, int min, int sec) {
+ char time[time_size];
+ char *p = time;
+ int i,j,k=6;
++ int numfields;
+
+ /* 7x13 */
+
+ if (noseconds) {
+ snprintf(time, time_size, "%02d:%02d ", hr, min);
++ numfields = 2;
+ }
+ else {
+ snprintf(time, time_size, "%02d:%02d:%02d ", hr, min, sec);
++ numfields = 3;
+ }
+
+- for (i=0; i < 3; i++) {
++ for (i=0; i < numfields; i++) {
+ for (j=0; j<2; j++) {
+ copyXPMArea((*p-'0')*7 + 1, 84, 8, 13, k, 18);
+ k += 7;
+--
+1.7.5.4
+
diff --git a/debian/patches/wmtime-l10n.diff b/debian/patches/wmtime-l10n.diff
new file mode 100644
index 0000000..1a79ae8
--- /dev/null
+++ b/debian/patches/wmtime-l10n.diff
@@ -0,0 +1,105 @@
+Description: date localization for real (with locales and so)
+Hi,
+the package wmtime claims that it supports localization. Looking into the code,
+it seems more like date customization.
+When claiming "localization", it should work as such - respecting LANG, LC_ALL,
+etc. environment variables and use locales for the day and month abbreviations.
+
+Please see my patch which adds such support.
+Regards,
+Milan Cermak
+Author: Milan Cermak <mcermak at chello.cz>
+Bug-Debian: http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=661843
+Applied-Upstream: http://repo.or.cz/w/dockapps.git/commit/13243aa4898f845820c267e22953827593b8487a
+
+diff -Naur wmtime-1.0b2.orig/wmtime/wmtime.c wmtime-1.0b3.orig/wmtime/wmtime.c
+--- wmtime-1.0b2.orig/wmtime/wmtime.c 2011-10-14 14:01:32.696870000 +0200
++++ wmtime-1.0b3.orig/wmtime/wmtime.c 2012-02-29 21:16:33.022405000 +0100
+@@ -65,6 +65,10 @@
+ #include <fcntl.h>
+ #include <unistd.h>
+ #include <math.h>
++#include <locale.h>
++#include <langinfo.h>
++#include <iconv.h>
++#include <ctype.h>
+
+ #include <sys/wait.h>
+ #include <sys/param.h>
+@@ -148,7 +152,10 @@
+ }
+ }
+ }
+- get_lang();
++
++ if (setlocale(LC_ALL, "") != NULL)
++ get_lang();
++
+ wmtime_routine(argc, argv);
+ return 0;
+ }
+@@ -156,26 +163,44 @@
+ /************/
+ /* get_lang */
+ /************/
+-void get_lang(){
+- FILE *fp;
+- int i;
+- const int line_size = 5;
+- char line[line_size];
+-
+- fp=fopen("language","r");
+- if (fp) {
+- /* Grab the days of the week */
+- for (i=0;i<7;i++){
+- fgets(line, line_size, fp);
+- strncpy(day_of_week[i], line, 2);
+- };
+- /* Grab the names of the months */
+- for (i=0;i<12;i++){
+- fgets(line, line_size, fp);
+- strncpy(mon_of_year[i], line, 3);
+- };
+- fclose(fp);
+- };
++void get_lang(void)
++{
++ char langbuf[10], outbuf[10];
++ char *inp, *outp;
++ iconv_t icd;
++ int i, ret;
++ size_t insize, outsize;
++
++ icd = iconv_open("ASCII//TRANSLIT", nl_langinfo(CODESET));
++ if (icd < 0)
++ return;
++
++ for (i = 0; i < 7; i++) {
++ strncpy(langbuf, nl_langinfo(ABDAY_1 + i), 10);
++ insize = outsize = 10;
++ inp = langbuf;
++ outp = outbuf;
++ do {
++ ret = iconv(icd, &inp, &insize, &outp, &outsize);
++ } while (outsize > 0 && ret > 0);
++ for (outp = outbuf, outsize = 0; *outp != 0 && outsize < 2;
++ outp++, outsize++)
++ day_of_week[i][outsize] = toupper(*outp);
++ }
++ for (i = 0; i < 12; i++) {
++ strncpy(langbuf, nl_langinfo(ABMON_1 + i), 10);
++ insize = outsize = 10;
++ inp = langbuf;
++ outp = outbuf;
++ do {
++ ret = iconv(icd, &inp, &insize, &outp, &outsize);
++ } while (outsize > 0 && ret > 0);
++ for (outp = outbuf, outsize = 0; *outp != 0 && outsize < 3;
++ outp++, outsize++)
++ mon_of_year[i][outsize] = toupper(*outp);
++ }
++
++ iconv_close(icd);
+ }
+
+ /*******************************************************************************\
diff --git a/debian/patches/wmtime-make-install.diff b/debian/patches/wmtime-make-install.diff
new file mode 100644
index 0000000..ba0aad7
--- /dev/null
+++ b/debian/patches/wmtime-make-install.diff
@@ -0,0 +1,16 @@
+Description: Added install option to Makefile
+
+Previously, "make install" was not available when installing wmtime, so this was added so that "dh_auto_build" could work.
+
+Author: Doug Torrance <profzoom at hotmail.com>
+
+--- wmtime-1.0b2.orig/wmtime/Makefile
++++ wmtime-1.0b2/wmtime/Makefile
+@@ -20,3 +20,7 @@ clean::
+ rm $$i; \
+ done
+ rm wmtime
++
++install:: wmtime
++ install -m 755 wmtime $(DESTDIR)/usr/bin
++
diff --git a/debian/rules b/debian/rules
index 5e50ce6..1cbfef8 100755
--- a/debian/rules
+++ b/debian/rules
@@ -1,93 +1,16 @@
#!/usr/bin/make -f
-#
-# debian/rules file for wmtime.
-# Copyright (C) 2003 Software in the Public Interest.
-#
-# This program is free software; you can redistribute it and/or modify
-# it under the terms of the GNU General Public License as published by
-# the Free Software Foundation; either version 2 of the License, or (at
-# your option) any later version.
-#
-# This program is distributed in the hope that it will be useful, but
-# WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-# General Public License for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with this program; if not, write to the Free Software
-# Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
-#
-# Based on the sample debian/rules that uses debhelper.
-# GNU copyright 1997 to 1999 by Joey Hess.
-# Uncomment this to turn on verbose mode.
-#export DH_VERBOSE=1
+%:
+ dh $@
-ifneq (,$(findstring debug,$(DEB_BUILD_OPTIONS)))
- CFLAGS += -g
-endif
-ifeq (,$(findstring nostrip,$(DEB_BUILD_OPTIONS)))
- INSTALL_PROGRAM += -s
-endif
+override_dh_auto_build:
+ dh_auto_build
+ dh_auto_build --sourcedirectory=wmtime
-build: build-stamp
+override_dh_clean:
+ dh_auto_clean
+ make -C wmtime clean || true
-build-stamp:
- dh_testdir
-
- cd wmtime; $(MAKE)
-
- touch build-stamp
-
-clean:
- dh_testdir
- dh_testroot
- rm -f build-stamp
-
- -cd wmtime; $(MAKE) clean
-
- dh_clean
-
-install: build
- dh_testdir
- dh_testroot
- dh_clean -k
- dh_installdirs
-
- install -m 755 wmtime/wmtime $(CURDIR)/debian/wmtime/usr/bin
-
-# Build architecture-independent files here.
-binary-indep: build install
-# We have nothing to do by default.
-
-# Build architecture-dependent files here.
-binary-arch: build install
- dh_testdir
- dh_testroot
- dh_installdebconf
- dh_installdocs
- dh_installexamples
- dh_installmenu
-# dh_installlogrotate
-# dh_installemacsen
-# dh_installpam
-# dh_installmime
-# dh_installinit
-# dh_installcron
- dh_installman
-# dh_installinfo
- dh_installchangelogs CHANGES
- dh_link
- dh_strip
- dh_compress
- dh_fixperms
-# dh_makeshlibs
- dh_installdeb
-# dh_perl
- dh_shlibdeps
- dh_gencontrol
- dh_md5sums
- dh_builddeb
-
-binary: binary-indep binary-arch
-.PHONY: build clean binary-indep binary-arch binary install
+override_dh_install:
+ dh_auto_install
+ make -C wmtime DESTDIR=$(CURDIR)/debian/wmtime install
diff --git a/debian/source/format b/debian/source/format
new file mode 100644
index 0000000..163aaf8
--- /dev/null
+++ b/debian/source/format
@@ -0,0 +1 @@
+3.0 (quilt)
diff --git a/debian/watch b/debian/watch
new file mode 100644
index 0000000..d9c2bc8
--- /dev/null
+++ b/debian/watch
@@ -0,0 +1,2 @@
+version=3
+http://wmaker.friedcheese.org/downloads/wmtime-(.+).tar.gz
\ No newline at end of file
diff --git a/wmgeneral/wmgeneral.c b/wmgeneral/wmgeneral.c
index d5fdcb6..a4f13c1 100644
--- a/wmgeneral/wmgeneral.c
+++ b/wmgeneral/wmgeneral.c
@@ -12,8 +12,6 @@
---
CHANGES:
---
- 10/10/2003 (Simon Law, sfllaw at debian.org)
- * changed the parse_rcfile function to use getline instead of fgets.
02/05/1998 (Martijn Pieterse, pieterse at xs4all.nl)
* changed the read_rc_file to parse_rcfile, as suggester by Marcelo E. Magallon
* debugged the parse_rc file.
@@ -23,7 +21,6 @@
*/
-#define _GNU_SOURCE
#include <stdlib.h>
#include <stdio.h>
#include <string.h>
@@ -46,11 +43,6 @@ int screen;
int x_fd;
int d_depth;
XSizeHints mysizehints;
-/* Deal with strange X11 function prototyping...
- * If I don't do this, I will get warnings about the sign
- * of the width/height variables - which are thrown away anyway. */
-int dummy_int_width, dummy_int_height;
-unsigned int uint_width, uint_height;
XWMHints mywmhints;
Pixel back_pix, fore_pix;
char *Geometry = "";
@@ -91,18 +83,17 @@ int CheckMouseRegion(int, int);
void parse_rcfile(const char *filename, rckeys *keys) {
char *p;
- char *line = NULL;
- size_t line_size = 0;
+ char temp[128];
char *tokens = " :\t\n";
FILE *fp;
int i,key;
fp = fopen(filename, "r");
if (fp) {
- while (getline(&line, &line_size, fp) >= 0) {
+ while (fgets(temp, 128, fp)) {
key = 0;
while (key >= 0 && keys[key].label) {
- if ((p = strstr(line, keys[key].label))) {
+ if ((p = strstr(temp, keys[key].label))) {
p += strlen(keys[key].label);
p += strspn(p, tokens);
if ((i = strcspn(p, "#\n"))) p[i] = 0;
@@ -279,7 +270,6 @@ void openXwindow(int argc, char *argv[], char *pixmap_bytes[], char *pixmask_bit
unsigned int borderwidth = 1;
XClassHint classHint;
char *display_name = NULL;
- char *geometry = NULL;
char *wname = argv[0];
XTextProperty name;
@@ -292,9 +282,7 @@ void openXwindow(int argc, char *argv[], char *pixmap_bytes[], char *pixmask_bit
for (i=1; argv[i]; i++) {
if (!strcmp(argv[i], "-display"))
- display_name = argv[++i];
- else if (!strcmp(argv[i], "-geometry"))
- geometry = argv[++i];
+ display_name = argv[i+1];
}
if (!(display = XOpenDisplay(display_name))) {
@@ -319,21 +307,16 @@ void openXwindow(int argc, char *argv[], char *pixmap_bytes[], char *pixmask_bit
fore_pix = GetColor("black");
XWMGeometry(display, screen, Geometry, NULL, borderwidth, &mysizehints,
- &mysizehints.x, &mysizehints.y,
- &dummy_int_width, &dummy_int_height, &dummy);
- if (geometry)
- XParseGeometry(geometry, &mysizehints.x, &mysizehints.y,
- &uint_width, &uint_height);
-
- /* Override width/height anyway */
- uint_width = 64;
- uint_height = 64;
+ &mysizehints.x, &mysizehints.y,&mysizehints.width,&mysizehints.height, &dummy);
+
+ mysizehints.width = 64;
+ mysizehints.height = 64;
win = XCreateSimpleWindow(display, Root, mysizehints.x, mysizehints.y,
- uint_width, uint_height, borderwidth, fore_pix, back_pix);
+ mysizehints.width, mysizehints.height, borderwidth, fore_pix, back_pix);
iconwin = XCreateSimpleWindow(display, win, mysizehints.x, mysizehints.y,
- uint_width, uint_height, borderwidth, fore_pix, back_pix);
+ mysizehints.width, mysizehints.height, borderwidth, fore_pix, back_pix);
/* Activate hints */
XSetWMNormalHints(display, win, &mysizehints);
@@ -381,6 +364,3 @@ void openXwindow(int argc, char *argv[], char *pixmap_bytes[], char *pixmask_bit
XMapWindow(display, win);
}
-
-/* vim: ts=4 columns=82
- */
diff --git a/wmtime/Makefile b/wmtime/Makefile
index 26b8571..5227739 100755
--- a/wmtime/Makefile
+++ b/wmtime/Makefile
@@ -4,16 +4,12 @@ OBJS = wmtime.o \
../wmgeneral/wmgeneral.o \
../wmgeneral/misc.o \
../wmgeneral/list.o
-XPMS = wmtime-master.xpm wmtime-mask.xbm
-
-CC = gcc
-CFLAGS = -O2
.c.o:
- $(CC) $(CFLAGS) -c -Wall $< -o $*.o
+ cc -c -O2 -Wall $< -o $*.o
-wmtime: $(OBJS) $(XPMS)
- $(CC) $(CFLAGS) -o wmtime $(OBJS) $(LIBDIR) $(LIBS)
+wmtime: $(OBJS)
+ cc -o wmtime $^ $(LIBDIR) $(LIBS)
clean::
for i in $(OBJS) ; do \
diff --git a/wmtime/wmtime-master.xpm b/wmtime/wmtime-master.xpm
index d6571a5..2d6bc1b 100644
--- a/wmtime/wmtime-master.xpm
+++ b/wmtime/wmtime-master.xpm
@@ -29,44 +29,44 @@ static char * wmtime_master_xpm[] = {
" X......................................................o X......................................................o ................................",
" X.........................OOO..........................o X......................................................o ................................",
" X.........................OOO+.........................o X......................................................o ................................",
-" X..............@@.........OOO+........@@...............o X......................................................o ................................",
-" X..............@@+.........+++........@@+..............o X......................................................o ................................",
-" X...............++.....................++..............o X......................................................o ................................",
-" X......................................................o X......................................................o ................................",
-" X......................................................o X......................................................o ................................",
-" X......................................................o X......................................................o ................................",
-" X......@@......................................@@......o X......................................................o ................................",
-" X......@@+.....................................@@+.....o X......................................................o ................................",
-" X.......++......................................++.....o X......................................................o ................................",
-" X......................................................o X......................................................o ................................",
-" X......................................................o X......................................................o ................................",
-" X......................................................o X......................................................o ................................",
+" X..............@@.........OOO+........@@...............o X...++++...++++.......++++...++++.......++++...++++....o ................................",
+" X..............@@+.........+++........@@+..............o X..+....+.+....+..+..+....+.+....+..+..+....+.+....+...o ................................",
+" X...............++.....................++..............o X..+....+.+....+..+..+....+.+....+..+..+....+.+....+...o ................................",
+" X......................................................o X..+....+.+....+.....+....+.+....+.....+....+.+....+...o ................................",
" X......................................................o X...++++...++++.......++++...++++.......++++...++++....o ................................",
-" X......................................................o X..+....+.+....+..+..+....+.+....+..+..+....+.+....+...o ................................",
-" X......................................................o X..+....+.+....+..+..+....+.+....+..+..+....+.+....+...o ................................",
-" X..OOO...........................................OOO...o X..+....+.+....+.....+....+.+....+.....+....+.+....+...o ................................",
-" X..OOO+..........................................OOO+..o X...++++...++++.......++++...++++.......++++...++++....o ................................",
-" X..OOO+..........................................OOO+..o X..+....+.+....+.....+....+.+....+.....+....+.+....+...o ................................",
-" X...+++...........................................+++..o X..+....+.+....+..+..+....+.+....+..+..+....+.+....+...o ................................",
-" X......................................................o X..+....+.+....+..+..+....+.+....+..+..+....+.+....+...o ................................",
-" X......................................................o X...++++...++++.......++++...++++.......++++...++++....o ................................",
-" X......................................................o X......................................................o ................................",
-" X......................................................o X......................................................o ................................",
+" X......................................................o X..+....+.+....+.....+....+.+....+.....+....+.+....+...o ................................",
+" X......@@......................................@@......o X..+....+.+....+..+..+....+.+....+..+..+....+.+....+...o ................................",
+" X......@@+.....................................@@+.....o X..+....+.+....+..+..+....+.+....+..+..+....+.+....+...o ................................",
+" X.......++......................................++.....o X...++++...++++.......++++...++++.......++++...++++....o ................................",
" X......................................................o X......................................................o ................................",
" X......................................................o X......................................................o ................................",
-" X......@@......................................@@......o X......................................................o ................................",
-" X......@@+.....................................@@+.....o X......................................................o ................................",
-" X.......++......................................++.....o X......................................................o ................................",
" X......................................................o X......................................................o ................................",
" X......................................................o X......................................................o ................................",
-" X......................................................o X......................................................o ................................",
-" X..............@@.....................@@...............o X......................................................o ................................",
-" X..............@@+........OOO.........@@+..............o X......................................................o ................................",
-" X...............++........OOO+.........++..............o X......................................................o ................................",
-" X.........................OOO+.........................o X......................................................o ................................",
-" X..........................+++.........................o X......................................................o ................................",
-" X......................................................o X......................................................o ................................",
-" oooooooooooooooooooooooooooooooooooooooooooooooooooooooo oooooooooooooooooooooooooooooooooooooooooooooooooooooooo ................................",
+" X......................................................o oooooooooooooooooooooooooooooooooooooooooooooooooooooooo ................................",
+" X......................................................o ................................",
+" X..OOO...........................................OOO...o ................................",
+" X..OOO+..........................................OOO+..o ................................",
+" X..OOO+..........................................OOO+..o ................................",
+" X...+++...........................................+++..o ................................",
+" X......................................................o ................................",
+" X......................................................o ................................",
+" X......................................................o ................................",
+" X......................................................o ................................",
+" X......................................................o ................................",
+" X......................................................o ................................",
+" X......@@......................................@@......o ................................",
+" X......@@+.....................................@@+.....o ................................",
+" X.......++......................................++.....o ................................",
+" X......................................................o ................................",
+" X......................................................o ................................",
+" X......................................................o ................................",
+" X..............@@.....................@@...............o ................................",
+" X..............@@+........OOO.........@@+..............o ................................",
+" X...............++........OOO+.........++..............o ................................",
+" X.........................OOO+.........................o ................................",
+" X..........................+++.........................o ................................",
+" X......................................................o ................................",
+" oooooooooooooooooooooooooooooooooooooooooooooooooooooooo ................................",
" ................................",
" ................................",
" XXXXXXXXXXXXXXXX XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX XXXXXXXXXXXXXXXX XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX ................................",
diff --git a/wmtime/wmtime.1 b/wmtime/wmtime.1
deleted file mode 100644
index f17156c..0000000
--- a/wmtime/wmtime.1
+++ /dev/null
@@ -1,178 +0,0 @@
-'\" t
-.\" Man page for wmtime
-.\" Copyright (c) 2003 Software in the Public Interest, Inc.
-.\"
-.\" This program is free software; you can redistribute it and/or modify
-.\" it under the terms of the GNU General Public License as published by
-.\" the Free Software Foundation; either version 2 of the License, or (at
-.\" your option) any later version.
-.\"
-.\" This program is distributed in the hope that it will be useful, but
-.\" WITHOUT ANY WARRANTY; without even the implied warranty of
-.\" MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-.\" General Public License for more details.
-.\"
-.\" You should have received a copy of the GNU General Public License
-.\" along with this program; if not, write to the Free Software
-.\" Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA.
-.\"
-.TH WMTIME 1 "May 1998" "WMTIME 1.0b2"
-
-.SH NAME
-wmtime \- Window Maker dockapp that displays the time and date
-
-.SH SYNOPSIS
-
-.B wmtime
-[
-.I OPTION
-]
-
-.SH DESCRIPTION
-
-.B WMTime
-displays the time and date and gives you some nice additional
-features too. It is intended for docking in Window Maker.
-
-It currently provides:
-
-.IP \(bu 4
-the time and date;
-
-.IP \(bu
-a realtime morphing interface (analog <> digital mode);
-.IP \(bu
-auto\-scaled and anti\-aliased hands;
-.IP \(bu
-localization, displaying the day and date in various languages;
-.IP \(bu
-three user\-defined commands to launch.
-
-.SH OPTIONS
-
-.TP
-.BR \-d , \ \-digital
-Display the digital clock on startup, instead of the analog clock.
-
-.TP
-.BI \-display \ display
-This option specifies the X server to contact; see
-.IR X(7x) .
-
-.TP
-.BI \-geometry \ geometry
-This option specifies the preferred position of clock; see
-.IR X(7x) .
-
-.TP
-.BR \-n , \ \-noseconds
-Disables the second hand.
-
-.TP
-.B \-h
-Show help information.
-
-.TP
-.B \-v
-Print the version number.
-
-.SH USAGE
-The
-.B WMTime
-window is separated into top and bottom sections. The top section
-contains a clock and the bottom section contains the date.
-
-The clock can be toggled between analog and digital modes. To do this,
-click in the bottom section of the window.
-
-WMTime can also be used to launch programs. You may click either left,
-middle, or right mouse buttons in the top section of the window. The
-pre\-configured program will be launched according to the mouse button
-clicked. (see
-.B CONFIGURATION FILE
-below.)
-
-In order to move
-.BR WMTime ,
-drag on the outer edges. These are not sensitive to mouse clicks.
-
-.SH "DOCKING IN WINDOW MANAGERS"
-
-.TP
-Window Maker
-
-Window Maker users should drag and drop the
-.B WMTime
-window on the Dock. Then, right\-click on the border of the window and
-select \*(lqSettings...\*(rq. Check \*(lqStart when Window Maker
-is started\*(rq.
-
-.TP
-AfterStep
-
-AfterStep users should put the following in their
-.I $HOME/.steprc
-
-.RS 16
-Wharf wmtime \- MaxSwallow "wmtime" wmtime &
-.RE
-
-.TP
-Other window managers
-
-.B WMTime
-runs nicely as a 64x64 shaped icon on your desktop.
-
-.SH "CONFIGURATION FILE"
-
-.B WMTime
-can launch three user\-defined commands, triggered by left, middle and
-right mouse button clicks. You can define the commands to launch in
-.I $HOME/.wmtimerc
-
-.RS
-.PD 0
-left: xterm
-.PP
-middle: xload
-.PP
-right: xcalc
-.PP
-.PD
-.RE
-
-If
-.B WMTime
-detects a
-.I $HOME/.wmtimerc
-file, it will launch the appropriate command when you click on the clock.
-
-The system administrator can define default commands in
-.IR /etc/wmtimerc .
-The administrator may also choose to \*(lqfix\*(rq particular commands,
-making it impossible for users to change. These commands can be defined in
-.IR /etc/wmtimerc.fixed ,
-although this isn't a nice thing to do.
-
-.SH FILES
-
-.I /etc/wmtimerc
-.br
-.I $HOME/.wmtimerc
-.br
-.I /etc/wmtimerc.fixed
-
-.SH AUTHORS
-
-.B WMTime
-was written by Martijn Pieterse and Antoine Nulle.
-
-This manual page was written by Simon Law <sfllaw at debian.org> for the
-.B Debian
-system (but may be used by others). It is based on the documentation provided
-by the original program.
-
-This manual is free software; you can redistribute it and/or modify
-it under the terms of the GNU General Public License as published by
-the Free Software Foundation; either version 2 of the License, or (at
-your option) any later version.
diff --git a/wmtime/wmtime.c b/wmtime/wmtime.c
index 2dfed0c..800d2f3 100644
--- a/wmtime/wmtime.c
+++ b/wmtime/wmtime.c
@@ -26,13 +26,6 @@
----
Changes:
----
- 15/07/2008 (Paul Harris, harris.pc at gmail.com)
- * Minor changes to correct build warnings
- 09/10/2003 (Simon Law, sfllaw at debian.org)
- * Add -geometry support
- * Add -noseconds support
- * Make the digital clock fill the space provided
- * Eliminated exploitable static buffers
17/05/1998 (Antoine Nulle, warp at xs4all.nl)
* Updated version number and some other minor stuff
16/05/1998 (Antoine Nulle, warp at xs4all.nl)
@@ -57,7 +50,6 @@
* Copied the source from wmmon.
*/
-#define _GNU_SOURCE
#include <stdlib.h>
#include <stdio.h>
#include <time.h>
@@ -84,9 +76,9 @@
/* Defines */
/***********/
-const char* default_left_action = NULL;
-const char* default_middle_action = NULL;
-const char* default_right_action = NULL;
+#define LEFT_ACTION (NULL)
+#define MIDDLE_ACTION (NULL)
+#define RIGHT_ACTION (NULL)
#define WMMON_VERSION "1.0b2"
@@ -94,63 +86,55 @@ const char* default_right_action = NULL;
/* Global Variables */
/********************/
+char *ProgName;
int digital = 0;
-int noseconds = 0;
char day_of_week[7][3] = { "SU", "MO", "TU", "WE", "TH", "FR", "SA" };
-char mon_of_year[12][4] = { "JAN", "FEB", "MAR", "APR", "MAY", "JUN", "JUL", "AUG", "SEP", "OCT", "NOV", "DEC" };
+char mon_of_year[12][4] = { "JAN", "FEB", "MAR", "APR", "MAY", "JUN", "JUL", "AUG", "SEP", "OCT", "NOW", "DEC" };
/* functions */
-void usage(char *);
+void usage(void);
void printversion(void);
void wmtime_routine(int, char **);
void get_lang();
-int main(int argc, char *argv[]) {
+void main(int argc, char *argv[]) {
int i;
- char *name = argv[0];
+
+
+ /* Parse Command Line */
+ ProgName = argv[0];
+ if (strlen(ProgName) >= 6)
+ ProgName += (strlen(ProgName) - 6);
+
for (i=1; i<argc; i++) {
char *arg = argv[i];
if (*arg=='-') {
switch (arg[1]) {
case 'd' :
- if (strcmp(arg+1, "display")
- && strcmp(arg+1, "digital") && strcmp(arg+1, "d")) {
- usage(name);
- return 1;
+ if (strcmp(arg+1, "display") && strcmp(arg+1, "digital")) {
+ usage();
+ exit(1);
}
- if (!strcmp(arg+1, "digital") || !(strcmp(arg+1, "d")))
+ if (!strcmp(arg+1, "digital"))
digital = 1;
break;
- case 'g' :
- if (strcmp(arg+1, "geometry")) {
- usage(name);
- return 1;
- }
- break;
- case 'n' :
- if (strcmp(arg+1, "noseconds") && strcmp(arg+1, "n")) {
- usage(name);
- return 1;
- } else {
- noseconds = 1;
- }
- break;
case 'v' :
printversion();
- return 0;
+ exit(0);
+ break;
default:
- usage(name);
- return 1;
+ usage();
+ exit(0);
+ break;
}
}
}
get_lang();
wmtime_routine(argc, argv);
- return 0;
}
/************/
@@ -159,22 +143,19 @@ int main(int argc, char *argv[]) {
void get_lang(){
FILE *fp;
int i;
- const int line_size = 5;
- char line[line_size];
+ char temp[5];
fp=fopen("language","r");
if (fp) {
- /* Grab the days of the week */
for (i=0;i<7;i++){
- fgets(line, line_size, fp);
- strncpy(day_of_week[i], line, 2);
+ fgets(temp,4,fp);
+ strncpy(day_of_week[i],temp,2);
};
- /* Grab the names of the months */
for (i=0;i<12;i++){
- fgets(line, line_size, fp);
- strncpy(mon_of_year[i], line, 3);
+ fgets(temp,5,fp);
+ strncpy(mon_of_year[i],temp,3);
};
- fclose(fp);
+ fclose(fp);
};
}
@@ -210,38 +191,39 @@ void wmtime_routine(int argc, char **argv) {
long curtime;
long nexttime;
- char *conffile = NULL;
+ char temp[128];
+ char *p;
/* Scan through ~/.wmtimerc for the mouse button actions. */
- if (default_left_action) left_action = strdup(default_left_action);
- if (default_middle_action) middle_action = strdup(default_middle_action);
- if (default_right_action) right_action = strdup(default_right_action);
-
- /* Scan through the .rc files */
- if (asprintf(&conffile, "/etc/wmtimerc") >= 0) {
- parse_rcfile(conffile, wmtime_keys);
- free(conffile);
- }
+ if (LEFT_ACTION) left_action = strdup(LEFT_ACTION);
+ if (MIDDLE_ACTION) middle_action = strdup(MIDDLE_ACTION);
+ if (RIGHT_ACTION) right_action = strdup(RIGHT_ACTION);
- if (asprintf(&conffile, "%s/.wmtimerc", getenv("HOME")) >= 0) {
- parse_rcfile(conffile, wmtime_keys);
- free(conffile);
- }
+ /* Scan throught the .rc files */
+ strcpy(temp, "/etc/wmtimerc");
+ parse_rcfile(temp, wmtime_keys);
+
+ p = getenv("HOME");
+ strcpy(temp, p);
+ strcat(temp, "/.wmtimerc");
+ parse_rcfile(temp, wmtime_keys);
+
+ strcpy(temp, "/etc/wmtimerc.fixed");
+ parse_rcfile(temp, wmtime_keys);
- if (asprintf(&conffile, "/etc/wmtimerc.fixed") >= 0) {
- parse_rcfile(conffile, wmtime_keys);
- free(conffile);
- }
openXwindow(argc, argv, wmtime_master_xpm, wmtime_mask_bits, 128, 64);
- /* Mask out the right parts of the clock */
- copyXPMArea(0, 0, 128, 64, 0, 98); /* Draw the borders */
- copyXPMArea(0, 0, 64, 64, 64, 0); /* Draw the clock face */
- copyXPMArea(64, 98, 64, 64, 0, 0); /* Draw the LCD background */
- setMaskXY(0, 0);
+ copyXPMArea(0, 0, 128, 64, 0, 98);
+ if (digital) {
+ copyXPMArea(64, 0, 64, 64, 0, 0);
+ setMaskXY(-64, 0);
+ } else {
+ copyXPMArea(0, 0, 64, 64, 64, 0);
+ setMaskXY(0, 0);
+ }
- /* add mouse region */
+ /* add mouse region */
AddMouseRegion(0, 5, 48, 58, 60);
AddMouseRegion(1, 5, 5, 58, 46);
@@ -300,10 +282,12 @@ void wmtime_routine(int argc, char **argv) {
if (digital) {
copyXPMArea(64, 98, 64, 64, 0, 0);
+ setMaskXY(-64, 0);
DrawTime(time_struct->tm_hour, time_struct->tm_min, time_struct->tm_sec);
DrawDate(time_struct->tm_wday, time_struct->tm_mday, time_struct->tm_mon);
} else {
- copyXPMArea(0, 98, 64, 64, 0, 0);
+ copyXPMArea(0, 98, 64, 64, 0, 0);
+ setMaskXY(0, 0);
DrawWijzer(time_struct->tm_hour, time_struct->tm_min, time_struct->tm_sec);
DrawDate(time_struct->tm_wday, time_struct->tm_mday, time_struct->tm_mon);
}
@@ -340,28 +324,24 @@ void wmtime_routine(int argc, char **argv) {
\*******************************************************************************/
void DrawTime(int hr, int min, int sec) {
- const int time_size = 16;
- char time[time_size];
- char *p = time;
+
+
+ char temp[16];
+ char *p = temp;
int i,j,k=6;
/* 7x13 */
- if (noseconds) {
- snprintf(time, time_size, "%02d:%02d ", hr, min);
- }
- else {
- snprintf(time, time_size, "%02d:%02d:%02d ", hr, min, sec);
- }
+ sprintf(temp, "%02d:%02d:%02d ", hr, min, sec);
- for (i=0; i < 3; i++) {
+ for (i=0; i<3; i++) {
for (j=0; j<2; j++) {
- copyXPMArea((*p-'0')*7 + 1, 84, 8, 13, k, 18);
+ copyXPMArea((*p-'0')*7 + 1, 84, 8, 13, k, 6);
k += 7;
p++;
}
if (*p == ':') {
- copyXPMArea(71, 84, 5, 13, k, 18);
+ copyXPMArea(71, 84, 5, 13, k, 6);
k += 4;
p++;
}
@@ -373,15 +353,15 @@ void DrawTime(int hr, int min, int sec) {
\*******************************************************************************/
void DrawDate(int wkday, int dom, int month) {
- const int date_size = 16;
- char date[date_size];
- char *p = date;
+
+
+ char temp[16];
+ char *p = temp;
int i,k;
/* 7x13 */
- snprintf(date, date_size,
- "%.2s%02d%.3s ", day_of_week[wkday], dom, mon_of_year[month]);
+ sprintf(temp, "%.2s%02d%.3s ", day_of_week[wkday], dom, mon_of_year[month]);
k = 5;
for (i=0; i<2; i++) {
@@ -561,9 +541,6 @@ void DrawWijzer(int hr, int min, int sec) {
}
}
/**********************************************************************/
- if (noseconds)
- return; /* Skip drawing the seconds. */
-
psi = sec * (M_PI / 30.0);
dx = floor(sin(psi) * 22 * 0.9 + 0.5);
@@ -635,16 +612,15 @@ void DrawWijzer(int hr, int min, int sec) {
|* usage *|
\*******************************************************************************/
-void usage(char *name) {
- printf("Usage: %s [OPTION]...\n", name);
- printf("WindowMaker dockapp that displays the time and date.\n");
- printf("\n");
- printf(" -d, -digital display the digital clock\n");
- printf(" -display DISPLAY contact the DISPLAY X server\n");
- printf(" -geometry GEOMETRY position the clock at GEOMETRY\n");
- printf(" -n, -noseconds disables the second hand\n");
- printf(" -h display this help and exit\n");
- printf(" -v output version information and exit\n");
+void usage(void) {
+
+ fprintf(stderr, "\nwmtime - programming: tijno, (de)bugging & design: warp, web hosting: bobby\n\n");
+ fprintf(stderr, "usage:\n");
+ fprintf(stderr, "\t-digital\tdigital clock\n");
+ fprintf(stderr, "\t-display <display name>\n");
+ fprintf(stderr, "\t-h\tthis screen\n");
+ fprintf(stderr, "\t-v\tprint the version number\n");
+ fprintf(stderr, "\n");
}
/*******************************************************************************\
@@ -652,8 +628,8 @@ void usage(char *name) {
\*******************************************************************************/
void printversion(void) {
- printf("WMTime version %s\n", WMMON_VERSION);
-}
-/* vim: sw=4 ts=4 columns=82
- */
+ if (!strcmp(ProgName, "wmtime")) {
+ fprintf(stderr, "%s\n", WMMON_VERSION);
+ }
+}
--
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-wmaker/wmtime.git
More information about the Pkg-wmaker-commits
mailing list