View | Details | Raw Unified | Return to bug 172513
Collapse All | Expand All

(-)x11-clocks/dclock/Makefile (-39 / +50 lines)
Lines 1-61 Link Here
1
# New ports collection makefile for:	dclock
1
# Created by: David Leonard <leonard@dstc.edu.au>
2
# Date created:		15 Aug 1996
3
# Whom:			David Leonard <leonard@dstc.edu.au>
4
#
5
# $FreeBSD: ports/x11-clocks/dclock/Makefile,v 1.26 2012/09/07 06:52:56 jgh Exp $
2
# $FreeBSD: ports/x11-clocks/dclock/Makefile,v 1.26 2012/09/07 06:52:56 jgh Exp $
6
#
7
3
8
PORTNAME=	dclock
4
PORTNAME=	dclock
9
PORTVERSION=	2.1.2.8
5
PORTVERSION=	2.2.2
10
PORTREVISION=	5
11
CATEGORIES=	x11-clocks
6
CATEGORIES=	x11-clocks
12
MASTER_SITES=	${MASTER_SITE_DEBIAN}
7
MASTER_SITES=	http://opencircuitdesign.com/~tim/programs/dclock/archive/
13
MASTER_SITE_SUBDIR=	pool/main/d/dclock
8
EXTRACT_SUFX=	.tgz
14
DISTNAME=	dclock_2.1.2.orig
15
16
PATCH_SITES=	${MASTER_SITE_DEBIAN:S,%SUBDIR%,pool/main/d/dclock,}
17
PATCHFILES=	dclock_2.1.2-8.diff.gz
18
PATCH_DIST_STRIP=	-p1
19
9
20
MAINTAINER=	ports@FreeBSD.org
10
MAINTAINER=	ports@FreeBSD.org
21
COMMENT=	A 7-segment digital clock with some optional features
11
COMMENT=	A 7-segment digital clock with some optional features
22
12
23
USE_IMAKE=	yes
13
OPTIONS_DEFINE=	SOX XFT DOCS
24
USE_XORG=	ice sm x11 xext xt
14
OPTIONS_DEFAULT=SOX XFT
15
SOX_DESC=	Install SOX to play audio
25
16
26
WRKSRC=		${WRKDIR}/dclock
17
WRKSRC=		${WRKDIR}/${PORTNAME}
27
MAN1=		dclock.1
28
18
29
OPTIONS_DEFINE=	SOX
19
USE_XORG=	x11 xt
30
SOX_DESC=	Install SOX to play audio
20
USE_PKGCONFIG=	build
31
OPTIONS_DEFAULT=	SOX
32
21
33
.include <bsd.port.pre.mk>
22
CPPFLAGS+=	-I${LOCALBASE}/include
23
LDFLAGS+=	-L${LOCALBASE}/lib -lX11 -lXt -lm
24
25
MAN1=		dclock.1
26
PORTDOCS=	README TODO
27
PLIST_FILES=	bin/dclock \
28
		lib/X11/app-defaults/DClock \
29
		%%DATADIR%%/sounds/bell.wav \
30
		%%DATADIR%%/sounds/digital.wav
31
PLIST_DIRS=	%%DATADIR%%/sounds \
32
		%%DATADIR%%
33
34
.include <bsd.port.options.mk>
34
35
35
.if ${PORT_OPTIONS:MSOX}
36
.if ${PORT_OPTIONS:MSOX}
36
RUN_DEPENDS+=	play:${PORTSDIR}/audio/sox
37
RUN_DEPENDS+=	play:${PORTSDIR}/audio/sox
37
.endif
38
.endif
38
39
40
.if ${PORT_OPTIONS:MXFT}
41
USE_XORG+=	xft
42
CPPFLAGS+=	$$(freetype-config --cflags) -DXFT_SUPPORT
43
LDFLAGS+=	$$(freetype-config --libs) -lXft
44
.endif
45
39
post-patch:
46
post-patch:
40
	@${REINPLACE_CMD} -e 's|%%DATADIR%%|${DATADIR}|' \
47
.for i in Dclock.c Dclock.ad dclock.1
41
				  -e 's|%%LOCALBASE%%|${LOCALBASE}|' \
48
	@${REINPLACE_CMD} -e \
42
				  ${WRKSRC}/Dclock.c \
49
		's|%%DATADIR%%|${DATADIR}| ; \
43
				  ${WRKSRC}/Dclock.ad \
50
		 s|%%LOCALBASE%%|${LOCALBASE}|' ${WRKSRC}/${i}
44
				  ${WRKSRC}/dclock.1
45
	@${MV} ${WRKSRC}/dclock.1 ${WRKSRC}/dclock.man
46
47
post-install:
48
	${INSTALL_DATA} ${WRKSRC}/Dclock.ad ${PREFIX}/lib/X11/app-defaults/DClock
49
	${MKDIR} ${DATADIR}/sounds
50
.for f in bell.wav digital.wav
51
	${INSTALL_DATA} ${WRKSRC}/sounds/${f} ${DATADIR}/sounds
52
.endfor
51
.endfor
52
53
do-build:
54
	(cd ${WRKSRC} \
55
		&& ${CC} ${CFLAGS} ${CPPFLAGS} *.c -o ${PORTNAME} ${LDFLAGS})
56
57
do-install:
58
	(cd ${WRKSRC} \
59
		&& ${INSTALL_PROGRAM} dclock ${PREFIX}/bin \
60
		&& ${INSTALL_MAN} dclock.1 ${MANPREFIX}/man/man1 \
61
		&& ${INSTALL_DATA} Dclock.ad \
62
			${PREFIX}/lib/X11/app-defaults/DClock)
63
	@${MKDIR} ${DATADIR}/sounds
64
	(cd ${WRKSRC}/sounds && ${INSTALL_DATA} *.wav ${DATADIR}/sounds)
53
.if ${PORT_OPTIONS:MDOCS}
65
.if ${PORT_OPTIONS:MDOCS}
54
	${MKDIR} ${DOCSDIR}
66
	@${MKDIR} ${DOCSDIR}
55
.for f in README TODO
67
.for f in ${PORTDOCS}
56
	${INSTALL_DATA} ${WRKSRC}/${f} ${DOCSDIR}
68
	(cd ${WRKSRC} && ${INSTALL_DATA} ${f} ${DOCSDIR})
57
.endfor
69
.endfor
58
	${INSTALL_DATA} ${WRKSRC}/debian/changelog ${DOCSDIR}/changelog.Debian
59
.endif
70
.endif
60
71
61
.include <bsd.port.post.mk>
72
.include <bsd.port.mk>
(-)x11-clocks/dclock/distinfo (-4 / +2 lines)
Lines 1-4 Link Here
1
SHA256 (dclock_2.1.2.orig.tar.gz) = e613b2ea01e7bc41c1ae76b2ae7a5ad81805e2aba29c0e843fa2f9b28518136e
1
SHA256 (dclock-2.2.2.tgz) = af329ecf8e1a27defc8f060b94219bd054e79a7dc53e508b79265bcfbc380021
2
SIZE (dclock_2.1.2.orig.tar.gz) = 51418
2
SIZE (dclock-2.2.2.tgz) = 65429
3
SHA256 (dclock_2.1.2-8.diff.gz) = 52fb10719e998ace55676c665f5b6eba348f3d8f6083c636942a145edfb0334b
4
SIZE (dclock_2.1.2-8.diff.gz) = 5247
(-)x11-clocks/dclock/files/patch-Dclock.ad (-19 / +17 lines)
Lines 1-6 Link Here
1
--- Dclock.ad.orig	Sun Dec 18 00:18:10 2005
1
--- Dclock.ad.orig	2008-07-03 14:39:21.000000000 +0900
2
+++ Dclock.ad	Sun Dec 18 00:20:00 2005
2
+++ Dclock.ad	2012-09-27 19:01:16.000000000 +0900
3
@@ -1,14 +1,14 @@
3
@@ -1,13 +1,13 @@
4
 !       sample dclock defaults
4
 !       sample dclock defaults
5
-dclock*geometry:                240x87+271+5
5
-dclock*geometry:                240x87+271+5
6
-dclock*foreground:              chartreuse
6
-dclock*foreground:              chartreuse
Lines 10-30 Link Here
10
-dclock*borderWidth:		2
10
-dclock*borderWidth:		2
11
-dclock*widthFactor:		0.143
11
-dclock*widthFactor:		0.143
12
-dclock*spaceFactor:		0.062
12
-dclock*spaceFactor:		0.062
13
-dclock*bellFile:		/usr/share/sounds/bell.wav
13
-dclock*bellFile:		/usr/share/sound/bell.wav
14
-dclock*alarmFile:		/usr/share/sounds/digital.wav
14
-dclock*alarmFile:		/usr/share/sound/digital.wav
15
-dclock*font:                    *helvetica-medium-r-normal--14*
15
-dclock*font:                    *helvetica-medium-r-normal--14*
16
-dclock*audioPlay:		/usr/bin/play
16
-dclock*audioPlay:		/usr/bin/play
17
-dclock.input:			true
17
+*geometry:                240x87+271+5
18
+*geometry:	240x87+271+5
18
+*foreground:              chartreuse
19
+*foreground:	chartreuse
19
+*background:              DarkSlateGray
20
+*background:	DarkSlateGray
20
+*led_off:              	DarkGreen
21
+*led_off:	DarkGreen
21
+*borderColor:             white
22
+*borderColor:	white
22
+*borderWidth:		2
23
+*borderWidth:	2
23
+*widthFactor:		0.143
24
+*widthFactor:	0.143
24
+*spaceFactor:		0.062
25
+*spaceFactor:	0.062
25
+*bellFile:		%%DATADIR%%/sound/bell.wav
26
+*bellFile:	%%DATADIR%%/sounds/bell.wav
26
+*alarmFile:		%%DATADIR%%/sound/digital.wav
27
+*alarmFile:	%%DATADIR%%/sounds/digital.wav
27
+*font:                    *helvetica-medium-r-normal--14*
28
+*font:		*helvetica-medium-r-normal--14*
28
+*audioPlay:		%%LOCALBASE%%/bin/play
29
+*audioPlay:	%%LOCALBASE%%/bin/play
30
+.input:		true
(-)x11-clocks/dclock/files/patch-Dclock.c (-5 / +377 lines)
Lines 1-18 Link Here
1
--- Dclock.c.orig	Sat Dec 17 23:46:28 2005
1
--- Dclock.c.orig	2008-07-08 13:00:35.000000000 +0900
2
+++ Dclock.c	Sat Dec 17 23:47:28 2005
2
+++ Dclock.c	2012-10-08 00:49:08.000000000 +0900
3
@@ -9,9 +9,9 @@
3
@@ -8,10 +8,10 @@
4
 #include <stdio.h>
4
 #include <stdlib.h>
5
 #include <unistd.h>
5
 #include <unistd.h>
6
 #include <string.h>
6
 #include <string.h>
7
-#include <values.h>
7
-#include <values.h>
8
+#include <limits.h>
8
+#include <limits.h>
9
 #include <math.h>
9
 #include <time.h>
10
 #include <time.h>
10
-#include <wait.h>
11
-#include <wait.h>
11
+#include <sys/wait.h>
12
+#include <sys/wait.h>
12
 #include <errno.h>
13
 #include <errno.h>
13
 #include <X11/IntrinsicP.h>
14
 #include <X11/IntrinsicP.h>
14
 #include <X11/Xos.h>
15
 #include <X11/Xos.h>
15
@@ -171,7 +171,7 @@
16
@@ -66,7 +66,7 @@
17
 static int old_digs[4];
18
 static struct tm before;
19
 static char *saved_date;
20
-static cur_position;	/* outline current digit for setting alarm */
21
+static int cur_position;	/* outline current digit for setting alarm */
22
 static struct { int hrs, mins; } Alarm;
23
 static int TopOffset = 0;
24
 
25
@@ -165,7 +165,7 @@
26
 	XtOffset(DclockWidget,dclock.font), XtRString, "fixed"},
27
 #ifdef XFT_SUPPORT
28
     { XftNfontName, "fontName", XtRString, sizeof(String),
29
-	XtOffset(DclockWidget,dclock.xftfontname), XtRString, "charter"},
30
+	XtOffset(DclockWidget,dclock.xftfontname), XtRString, NULL},
31
 #endif
32
     { XtNangle, "Slope", XtRFloat, sizeof(float),
33
 	XtOffset(DclockWidget,dclock.angle), XtRFloat, (caddr_t)&sslope},
34
@@ -182,7 +182,7 @@
16
     { XtNbellFile, "bellFile", XtRString, sizeof(String),
35
     { XtNbellFile, "bellFile", XtRString, sizeof(String),
17
 	XtOffset(DclockWidget,dclock.bellfile), XtRString, (String)NULL},
36
 	XtOffset(DclockWidget,dclock.bellfile), XtRString, (String)NULL},
18
     { XtNaudioPlay, "audioPlay", XtRString, sizeof(String),
37
     { XtNaudioPlay, "audioPlay", XtRString, sizeof(String),
Lines 21-23 Link Here
21
 };
40
 };
22
 
41
 
23
 /* Define the Dclock widget */
42
 /* Define the Dclock widget */
43
@@ -235,7 +235,7 @@
44
  * These stipples give different densities for the
45
  * different stages of fading.
46
  */
47
-static unsigned char stpl_1_8th[] =
48
+static char stpl_1_8th[] =
49
 {
50
     0x80, 0x80, 0x08, 0x08, 0x80, 0x80, 0x08, 0x08,
51
     0x80, 0x80, 0x08, 0x08, 0x80, 0x80, 0x08, 0x08,
52
@@ -243,7 +243,7 @@
53
     0x80, 0x80, 0x08, 0x08, 0x80, 0x80, 0x08, 0x08
54
 };
55
 
56
-static unsigned char stpl_1_4th[] =
57
+static char stpl_1_4th[] =
58
 {
59
     0x88, 0x88, 0x22, 0x22, 0x88, 0x88, 0x22, 0x22,
60
     0x88, 0x88, 0x22, 0x22, 0x88, 0x88, 0x22, 0x22,
61
@@ -251,7 +251,7 @@
62
     0x88, 0x88, 0x22, 0x22, 0x88, 0x88, 0x22, 0x22
63
 };
64
 
65
-static unsigned char stpl_3_8ths[] =
66
+static char stpl_3_8ths[] =
67
 {
68
     0xA2, 0xA2, 0x15, 0x15, 0xA8, 0xA8, 0x45, 0x45,
69
     0x2A, 0x2A, 0x51, 0x51, 0x8A, 0x8A, 0x54, 0x54,
70
@@ -259,7 +259,7 @@
71
     0x2A, 0x2A, 0x51, 0x51, 0x8A, 0x8A, 0x54, 0x54
72
 };
73
 
74
-static unsigned char stpl_one_half[] =
75
+static char stpl_one_half[] =
76
 {
77
     0x55, 0x55, 0xAA, 0xAA, 0x55, 0x55, 0xAA, 0xAA,
78
     0x55, 0x55, 0xAA, 0xAA, 0x55, 0x55, 0xAA, 0xAA,
79
@@ -344,6 +344,12 @@
80
 segment_pts tiny_segment_pts;
81
 segment_pts norm_segment_pts;
82
 
83
+#ifdef XFT_SUPPORT
84
+#define XFT_COND(dclock) ((dclock).xftfontname)
85
+#else
86
+#define XFT_COND(dclock) (0)
87
+#endif
88
+
89
 /* ARGSUSED */
90
 static void
91
 Initialize (request, new)
92
@@ -386,11 +392,13 @@
93
     if (new->dclock.sec_gap < 0.0) new->dclock.sec_gap = 0.0;
94
 
95
 #ifdef XFT_SUPPORT
96
-    new->dclock.xftfont = XftFontOpen(dpy, DefaultScreen(dpy),
97
+    if (XFT_COND(new->dclock)) {
98
+       new->dclock.xftfont = XftFontOpen(dpy, DefaultScreen(dpy),
99
 		XFT_FAMILY, XftTypeString, new->dclock.xftfontname,
100
 		XFT_SIZE, XftTypeDouble, ((float)new->core.height / 6.0) - 4.0,
101
 		NULL);
102
-    new->dclock.xftdraw = NULL;
103
+       new->dclock.xftdraw = NULL;
104
+    }
105
 #endif
106
 
107
     GetGC(new);
108
@@ -447,11 +455,11 @@
109
     if (new->dclock.date_fmt && !*new->dclock.date_fmt)
110
 	new->dclock.date_fmt = NULL;
111
     if (new->dclock.dateup && new->dclock.date_fmt)
112
-#ifdef XFT_SUPPORT
113
+    if (XFT_COND(new->dclock)) {
114
 	TopOffset = new->core.height / 6;
115
-#else
116
+    } else {
117
 	TopOffset = new->dclock.font->ascent + new->dclock.font->descent;
118
-#endif
119
+    }
120
 
121
     else
122
 	TopOffset = 0;
123
@@ -493,7 +501,7 @@
124
 
125
 static void
126
 invert_bitmap(bm, h, w)
127
-unsigned char *bm;
128
+char *bm;
129
 int h, w;
130
 {
131
     int i, *wp;
132
@@ -519,7 +527,7 @@
133
     XtCreateWindow(w, InputOutput, (Visual *)CopyFromParent, *valueMask, attrs);
134
 
135
 #ifdef XFT_SUPPORT
136
-    if (dw->dclock.xftdraw == NULL) {
137
+    if (XFT_COND(dw->dclock) && dw->dclock.xftdraw == NULL) {
138
 	XColor color;
139
 	Colormap cm = DefaultColormap(dp, sc);
140
 
141
@@ -574,7 +582,8 @@
142
     XDestroyRegion(clip_colon);
143
 
144
 #ifdef XFT_SUPPORT
145
-    XftFontClose(XtDisplay(w), w->dclock.xftfont);
146
+    if (XFT_COND(w->dclock))
147
+	XftFontClose(XtDisplay(w), w->dclock.xftfont);
148
 #endif
149
 }
150
 
151
@@ -596,11 +605,13 @@
152
     winheight = w->core.height;
153
 
154
 #ifdef XFT_SUPPORT
155
-    XftFontClose(dpy, w->dclock.xftfont);
156
-    w->dclock.xftfont = XftFontOpen(dpy, DefaultScreen(dpy),
157
+    if(XFT_COND(w->dclock)) {
158
+	XftFontClose(dpy, w->dclock.xftfont);
159
+	w->dclock.xftfont = XftFontOpen(dpy, DefaultScreen(dpy),
160
 		XFT_FAMILY, XftTypeString, w->dclock.xftfontname,
161
 		XFT_SIZE, XftTypeDouble, ((float)winheight / 6.0) - 4.0,
162
 		NULL);
163
+    }
164
 #endif
165
 
166
     y_ratio = (float)winheight / CLOCK_HEIGHT;
167
@@ -608,11 +619,13 @@
168
     if (w->dclock.date_fmt || !w->dclock.display_time || w->dclock.alarm ||
169
 	w->dclock.bell)
170
 	/* make win temporarily shorter so digits will fit on top of date */
171
-#ifdef XFT_SUPPORT
172
-	winheight -= w->core.height / 6;
173
-#else
174
-	winheight -= w->dclock.font->ascent + w->dclock.font->descent;
175
-#endif
176
+    {
177
+	if(XFT_COND(w->dclock)) {
178
+	    winheight -= w->core.height / 6;
179
+	} else {
180
+	    winheight -= w->dclock.font->ascent + w->dclock.font->descent;
181
+	}
182
+    }
183
 
184
     /*
185
      * if the width of all segments are equal, then the width in x is the
186
@@ -1351,7 +1364,7 @@
187
     XtAppContext app;
188
     Boolean save_scroll = w->dclock.scroll;
189
     Boolean save_fade = w->dclock.fade;
190
-    long t;
191
+    time_t t;
192
 
193
     if (!XtIsRealized((Widget)w))
194
 	return;
195
@@ -1421,7 +1434,7 @@
196
 {
197
     char buf[11];
198
     Boolean alarm_went_off = False;
199
-    long t = time(0);
200
+    time_t t = time(0);
201
     register struct tm *l_time = localtime(&t);
202
     float digit_w = w->dclock.digit_w;
203
     float digit_h = w->dclock.digit_h;
204
@@ -1522,7 +1535,7 @@
205
     Pixmap new_pix[4];
206
     int new_digs[4], digitxpos, digitypos;
207
     int cur_sec = 0;
208
-    long t;
209
+    time_t t;
210
     register struct tm *now;
211
 
212
 /* definitions for the window x and y positions of each of the large digits. */
213
@@ -1585,7 +1598,7 @@
214
 	unsigned long fade_rate = w->dclock.fade_rate * 1000;
215
 
216
 	for (i = 0; i < 4; i++)    /* if pixmaps don't match, fade it */
217
-	    if (chgd[i] = (new_pix[i] != old_pix[i]))
218
+	    if ((chgd[i] = (new_pix[i] != old_pix[i])))
219
 	    {
220
 		tmp_pix[i] = XCreatePixmap(dpy, win, (int)(digit_w + slope_add),
221
 			(int)digit_h, DefaultDepthOfScreen(XtScreen(w)));
222
@@ -1669,51 +1682,60 @@
223
     char datestr[128];
224
     register char *p;
225
     int x, datep;
226
+    int tsize;
227
 #ifdef XFT_SUPPORT
228
-    int tsize = w->core.height / 6;
229
     XGlyphInfo xftextents;
230
-#else
231
-    int tsize = w->dclock.font->ascent + w->dclock.font->descent;
232
 #endif
233
 
234
+    if (XFT_COND(w->dclock)) {
235
+	tsize = w->core.height / 6;
236
+    } else {
237
+	tsize = w->dclock.font->ascent + w->dclock.font->descent;
238
+    }
239
+
240
     if (!w->dclock.display_time)
241
 	datep = strlen(strcpy(datestr, "Push HERE to Set/Unset Alarm"));
242
     else
243
         datep = strftime(datestr, 128, w->dclock.date_fmt, now);
244
 
245
+    if (XFT_COND(w->dclock)) {
246
 #ifdef XFT_SUPPORT
247
-    XftTextExtents8(dpy, w->dclock.xftfont, datestr, datep, &xftextents);
248
-    x = (w->core.width - xftextents.width) / 2;
249
-#else
250
-    x = (w->core.width - XTextWidth(w->dclock.font, datestr, datep)) / 2;
251
+	XftTextExtents8(dpy, w->dclock.xftfont, (FcChar8*)datestr, datep, &xftextents);
252
+	x = (w->core.width - xftextents.width) / 2;
253
 #endif
254
+    } else {
255
+	x = (w->core.width - XTextWidth(w->dclock.font, datestr, datep)) / 2;
256
+    }
257
+
258
     if (x < 2)
259
 	x = 2;
260
     if (TopOffset) {
261
-
262
+	if (XFT_COND(w->dclock)) {
263
 #ifdef XFT_SUPPORT
264
-	XftDrawRect(w->dclock.xftdraw, &w->dclock.xftbg, 0, 0, winwidth, tsize);
265
-	XftDrawString8(w->dclock.xftdraw, &w->dclock.xftfg, w->dclock.xftfont, x,
266
-		(BORDER/2) + tsize - 2, datestr, datep);
267
-#else
268
-	XFillRectangle(dpy, win, w->dclock.backGC,
269
-	    0, 0, winwidth, tsize);
270
-	XDrawString(dpy, win, w->dclock.foreGC,
271
-		x, ((BORDER/2)+w->dclock.xftfont->height), datestr, datep);
272
+	    XftDrawRect(w->dclock.xftdraw, &w->dclock.xftbg, 0, 0, winwidth, tsize);
273
+	    XftDrawString8(w->dclock.xftdraw, &w->dclock.xftfg, w->dclock.xftfont, x,
274
+		(BORDER/2) + tsize - 2, (FcChar8*)datestr, datep);
275
 #endif
276
+	} else {
277
+	    XFillRectangle(dpy, win, w->dclock.backGC,
278
+		0, 0, winwidth, tsize);
279
+	    XDrawString(dpy, win, w->dclock.foreGC,
280
+		x, ((BORDER/2)+tsize), datestr, datep);
281
+	}
282
     } else {
283
-
284
+	if (XFT_COND(w->dclock)) {
285
 #ifdef XFT_SUPPORT
286
-	XftDrawRect(w->dclock.xftdraw, &w->dclock.xftbg, 0, winheight - tsize,
287
+	    XftDrawRect(w->dclock.xftdraw, &w->dclock.xftbg, 0, winheight - tsize,
288
 		winwidth, tsize);
289
-	XftDrawString8(w->dclock.xftdraw, &w->dclock.xftfg, w->dclock.xftfont, x,
290
-		winheight - BORDER - 2, datestr, datep);
291
-#else
292
-	XFillRectangle(dpy, win, w->dclock.backGC,
293
-	    0, winheight - tsize, winwidth, tsize);
294
-	XDrawString(dpy, win, w->dclock.foreGC,
295
-		x, winheight - BORDER, datestr, datep);
296
+	    XftDrawString8(w->dclock.xftdraw, &w->dclock.xftfg, w->dclock.xftfont, x,
297
+		winheight - BORDER - 2, (FcChar8*)datestr, datep);
298
 #endif
299
+	} else {
300
+	    XFillRectangle(dpy, win, w->dclock.backGC,
301
+		0, winheight - tsize, winwidth, tsize);
302
+	    XDrawString(dpy, win, w->dclock.foreGC,
303
+		x, winheight - BORDER, datestr, datep);
304
+	}
305
     }
306
 }
307
 
308
@@ -1992,13 +2014,13 @@
309
     w->dclock.date_fmt = saved_date;
310
     saved_date = tmp;
311
 
312
-    if (w->dclock.dateup && w->dclock.date_fmt)
313
-#ifdef XFT_SUPPORT
314
-	TopOffset = w->core.height / 6;
315
-#else
316
-	TopOffset = w->dclock.font->ascent + w->dclock.font->descent;
317
-#endif
318
-    else
319
+    if (w->dclock.dateup && w->dclock.date_fmt) {
320
+	if (XFT_COND(w->dclock)) {
321
+	    TopOffset = w->core.height / 6;
322
+	} else {
323
+	    TopOffset = w->dclock.font->ascent + w->dclock.font->descent;
324
+	}
325
+    } else
326
 	TopOffset = 0;
327
 
328
     before.tm_wday = -1;
329
@@ -2021,13 +2043,13 @@
330
     XtSetArg(arg, XtNdateUp, !w->dclock.dateup);
331
     XtSetValues((Widget)w, &arg, 1);
332
 
333
-    if (w->dclock.dateup && w->dclock.date_fmt)
334
-#ifdef XFT_SUPPORT
335
-	TopOffset = w->core.height / 6;
336
-#else
337
-	TopOffset = w->dclock.font->ascent + w->dclock.font->descent;
338
-#endif
339
-    else
340
+    if (w->dclock.dateup && w->dclock.date_fmt) {
341
+	if (XFT_COND(w->dclock)) {
342
+	    TopOffset = w->core.height / 6;
343
+	} else {
344
+	    TopOffset = w->dclock.font->ascent + w->dclock.font->descent;
345
+	}
346
+    } else
347
 	TopOffset = 0;
348
 
349
     ResizeNow(w);
350
@@ -2038,7 +2060,7 @@
351
 toggle_bell(w)
352
 DclockWidget w;
353
 {
354
-    if (w->dclock.bell = !w->dclock.bell) {
355
+    if ((w->dclock.bell = !w->dclock.bell)) {
356
 	playbell(w, 1);
357
     }
358
     ResizeNow(w);
359
@@ -2159,7 +2181,7 @@
360
 DclockWidget w;
361
 XButtonEvent *event;
362
 {
363
-    static saved_secs, saved_miltime, saved_fade, saved_blink;
364
+    static int saved_secs, saved_miltime, saved_fade, saved_blink;
365
 
366
     if (event->button == 3) {
367
 	if (!(w->dclock.display_time = !w->dclock.display_time)) {
368
@@ -2184,20 +2206,20 @@
369
 	 */
370
 	int i, x, y = (int)((BORDER/2)*y_ratio) + TopOffset;
371
 	/* first check to see if user toggles the alarm */
372
-#ifdef XFT_SUPPORT
373
-	if (TopOffset)
374
+	if (XFT_COND(w->dclock)) {
375
+	    if (TopOffset)
376
 		i = (BORDER + (w->core.height / 6))
377
 			- event->y;
378
-	else
379
+	    else
380
 		i = event->y - (winheight - (w->core.height / 6));
381
-#else
382
-	if (TopOffset)
383
+	} else {
384
+	    if (TopOffset)
385
 		i = (BORDER + (w->dclock.font->ascent + w->dclock.font->descent))
386
 			- event->y;
387
-	else
388
+	    else
389
 		i = event->y - (winheight - (w->dclock.font->ascent
390
 			+ w->dclock.font->descent));
391
-#endif
392
+	}
393
 	if (i >= 0)
394
 	    toggle_alarm(w);
395
 	else for (i = 0; i < 4; i++) {
(-)x11-clocks/dclock/files/patch-DclockP.h (+12 lines)
Line 0 Link Here
1
--- DclockP.h.orig	2008-07-08 12:56:09.000000000 +0900
2
+++ DclockP.h	2012-10-07 23:57:24.000000000 +0900
3
@@ -9,7 +9,9 @@
4
 #include "Dclock.h"
5
 
6
 /* Add -DXFT_SUPPORT in the Imakefile for freefont support */
7
+#ifdef XFT_SUPPORT
8
 #include <X11/Xft/Xft.h>
9
+#endif
10
 
11
 
12
 typedef struct {
(-)x11-clocks/dclock/files/patch-dclock.c (+32 lines)
Line 0 Link Here
1
--- dclock.c.orig	2008-07-08 12:35:18.000000000 +0900
2
+++ dclock.c	2012-10-08 00:28:47.000000000 +0900
3
@@ -7,6 +7,7 @@
4
  * manager: *Dclock.seconds: on
5
  */
6
 #include <stdio.h>
7
+#include <stdlib.h>
8
 #include <locale.h>
9
 #include <X11/Intrinsic.h>
10
 #include "Dclock.h"
11
@@ -114,6 +115,7 @@
12
     { "quit",	quit },
13
 };
14
 
15
+int
16
 main(argc, argv)
17
 char *argv[];
18
 {
19
@@ -122,10 +124,11 @@
20
     char *name, *rindex();
21
     XWMHints     *wmhints;       /* for proper input focus */
22
 
23
-    if (name = rindex(argv[0], '/'))
24
+    if ((name = rindex(argv[0], '/'))) {
25
 	name++;
26
-    else
27
+    } else {
28
 	name = argv[0];
29
+    }
30
 
31
     setlocale(LC_TIME, "");
32
 
(-)x11-clocks/dclock/pkg-descr (-2 / +1 lines)
Lines 4-8 Link Here
4
version 2.0. This port uses Debian porting as upstream, which is based
4
version 2.0. This port uses Debian porting as upstream, which is based
5
on Tim's version and also includes some additional features and fixes.
5
on Tim's version and also includes some additional features and fixes.
6
6
7
WWW: http://opencircuitdesign.com/~tim/
7
WWW: http://opencircuitdesign.com/~tim/programs/dclock/
8
WWW: http://packages.qa.debian.org/d/dclock.html
(-)x11-clocks/dclock/pkg-plist (-11 lines)
Lines 1-11 Link Here
1
@comment $FreeBSD: ports/x11-clocks/dclock/pkg-plist,v 1.4 2005/12/18 14:54:18 pav Exp $
2
bin/dclock
3
lib/X11/app-defaults/DClock
4
%%DATADIR%%/sounds/bell.wav
5
%%DATADIR%%/sounds/digital.wav
6
@dirrm %%DATADIR%%/sounds
7
@dirrm %%DATADIR%%
8
%%PORTDOCS%%%%DOCSDIR%%/README
9
%%PORTDOCS%%%%DOCSDIR%%/TODO
10
%%PORTDOCS%%%%DOCSDIR%%/changelog.Debian
11
%%PORTDOCS%%@dirrm %%DOCSDIR%%

Return to bug 172513