Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 17 Aug 2004 18:35:45 +0400
From:      Roman Bogorodskiy <bogorodskiy@inbox.ru>
To:        FreeBSD-gnats-submit@FreeBSD.org
Subject:   ports/70576: [ maintainer ] net/wmnet: add new patches
Message-ID:  <E1Bx53x-0001Ck-00.bogorodskiy-inbox-ru@mx2.mail.ru>
Resent-Message-ID: <200408171440.i7HEeCx4034070@freefall.freebsd.org>

next in thread | raw e-mail | index | archive | help

>Number:         70576
>Category:       ports
>Synopsis:       [ maintainer ] net/wmnet: add new patches
>Confidential:   no
>Severity:       non-critical
>Priority:       medium
>Responsible:    freebsd-ports-bugs
>State:          open
>Quarter:        
>Keywords:       
>Date-Required:
>Class:          maintainer-update
>Submitter-Id:   current-users
>Arrival-Date:   Tue Aug 17 14:40:11 GMT 2004
>Closed-Date:
>Last-Modified:
>Originator:     Roman Bogorodskiy
>Release:        FreeBSD 5.2.1-RELEASE-p9 i386
>Organization:
>Environment:
System: FreeBSD lame.novel.ru 5.2.1-RELEASE-p9 FreeBSD 5.2.1-RELEASE-p9 #15: Sun Aug 15 13:20:27 MSD 2004 root@lame.novel.ru:/usr/obj/usr/src/sys/NOV i386

>Description:
	- Add patches from Eugeny N Dzhurinsky <eugenydzh @ jdevelop . com>, 
	which contain some tweaks and new useful features like i.e possibility 
	to set up geometry. 
	- Request for maintainership.

	Maybe PORTREVISION bump is needed. 
>How-To-Repeat:
	
>Fix:

diff -ruN wmnet.orig/Makefile wmnet/Makefile
--- wmnet.orig/Makefile	Tue Aug 17 17:48:48 2004
+++ wmnet/Makefile	Tue Aug 17 18:12:51 2004
@@ -10,7 +10,7 @@
 CATEGORIES=	net windowmaker
 MASTER_SITES=	ftp://ftp.enteract.com/users/rneswold/
 
-MAINTAINER=	ports@FreeBSD.org
+MAINTAINER=	bogorodskiy@inbox.ru
 COMMENT=	A network bandwidth monitor intended for the WindowMaker dock
 
 USE_XPM=	yes
diff -ruN wmnet.orig/files/patch-main.c wmnet/files/patch-main.c
--- wmnet.orig/files/patch-main.c	Thu Jan  1 03:00:00 1970
+++ wmnet/files/patch-main.c	Tue Aug 17 18:10:41 2004
@@ -0,0 +1,242 @@
+--- main.c.orig	Sat Jun  5 15:28:39 2004
++++ main.c	Sat Jun  5 15:28:46 2004
+@@ -32,11 +32,11 @@
+ #define LED_SZE_Y (4)
+ 
+ #define LED_ON_NET_X (87)
+-#define LED_ON_NET_Y (66)
++#define LED_ON_NET_Y (92)
+ #define LED_OFF_NET_X (93)
+-#define LED_OFF_NET_Y (66)
++#define LED_OFF_NET_Y (92)
+ #define LED_ERR_NET_X (81)
+-#define LED_ERR_NET_Y (66)
++#define LED_ERR_NET_Y (92)
+ 
+ #define LED_PWR_X (53)
+ #define LED_PWR_Y (7)
+@@ -52,6 +52,7 @@
+ static unsigned findInterface(char const*);
+ static void printversion(void);
+ static char const *rateToStr(unsigned long);
++static double getRate(unsigned long, char *);
+ static void SetErrLED(int);
+ static void SetOffLED(int);
+ static void SetOnLED(int);
+@@ -68,7 +69,7 @@
+ ------------------------------------------------------------------------------*/
+ static void DrawActiveIFS(char const* name)
+ {
+-    copyXPMArea(5, 84, 30, 10, 5, 5);
++    copyXPMArea(5, 110, 30, 10, 5, 5);
+ 
+ 	if (name) {
+ 		int ii, kk = 5;
+@@ -77,9 +78,9 @@
+ 			int const ch = toupper(name[ii]);
+ 
+ 			if (ch >= 'A' && ch <= 'Z')
+-				copyXPMArea((ch - 'A') * 6, 74, 6, 9, kk, 5);
++				copyXPMArea((ch - 'A') * 6, 100, 6, 9, kk, 5);
+ 			else
+-				copyXPMArea((ch - '0') * 6, 64, 6, 9, kk, 5);
++				copyXPMArea((ch - '0') * 6, 90, 6, 9, kk, 5);
+ 			kk += 6;
+ 		}
+ 	}
+@@ -91,25 +92,22 @@
+ static void DrawStats(unsigned ifCurr, int height, int x_left, int y_bottom)
+ {
+     unsigned baseLine = y_bottom - height / 2;
+-    unsigned maxVal = 0, ii;
++    unsigned maxVal = 0, ii, currVal = 0;
+     char const* ptr = 0;
+ 
+     /* Find the maximum value. We'll scale the graph to this value. */
++	unsigned long rcv, xmt;
+ 
+ 	for (ii = 0; ii < G_WIDTH; ++ii) {
+-		unsigned long rcv, xmt;
+ 
+ 		ifGetData(ifCurr, ii, &xmt, &rcv);
+ 
+ 		xmt /= delay;
+ 		rcv /= delay;
+-
+-		if (rcv > maxVal)
+-			maxVal = rcv;
+-		if (xmt > maxVal)
+-			maxVal = xmt;
++		currVal = xmt > rcv ? xmt : rcv ;
++		if (currVal > maxVal)
++			maxVal = currVal;
+     }
+-    ptr = rateToStr(maxVal);
+ 
+     /* Now draw the data points. */
+ 
+@@ -127,27 +125,58 @@
+ 		}
+ 		for (jj = 0; jj < height; ++jj)
+ 			if (y_bottom - jj <= start && y_bottom - jj >= stop)
+-				copyXPMArea(100 + 1, 68, 1, 1, ii + x_left, y_bottom - jj);
++				copyXPMArea(99 + 1, 106, 1, 1, ii + x_left, y_bottom - jj);
+ 			else
+-				copyXPMArea(100, 68, 1, 1, ii + x_left, y_bottom - jj);
++				copyXPMArea(99, 106, 1, 1, ii + x_left, y_bottom - jj);
+ 
+ 		/* Draw the base line. */
+ 
+-		copyXPMArea(100 + 3, 68, 1, 1, ii + x_left, baseLine);
++		copyXPMArea(100, 106, 1, 1, ii + x_left, baseLine);
+ 	}
+ 
+-    /* Now draw the data rate... */
++    /* Now draw the download data rate... */
++	
++	/* Clear area */
++	copyXPMArea( 6, 111, 54 , 9 , 6, 63);
++
++	ptr = rateToStr(rcv);
++	copyXPMArea(('D' - 'A') * 6, 100, 6, 9, 6,
++				62);
++	copyXPMArea(64, 90, 4, 9, 12,
++				62);
++	for (ii = 20; *ptr; ++ptr)
++		if (isdigit(*ptr)) {
++			copyXPMArea((*ptr - '0') * 6, 90, 6, 9, 1 + ii, 62 );
++			ii += 6;
++		} else if ('.' == *ptr) {
++			copyXPMArea(60, 90, 4, 9, 1 + ii, 62);
++			ii += 4;
++		} else {
++			copyXPMArea((toupper(*ptr) - 'A') * 6, 100, 6, 9, 1 + ii,
++						62);
++			ii += 6;
++		}
++    
++	/* Now draw the upload data rate... */
++	
++	/* Clear area */
++	copyXPMArea( 6, 111, 54 , 9 , 6, 76);
+ 
+-	for (ii = 5; *ptr; ++ptr)
++	ptr = rateToStr(xmt);
++	copyXPMArea(('U' - 'A') * 6, 100, 6, 9, 6,
++				75);
++	copyXPMArea(64, 90, 4, 9, 12,
++				75);
++	for (ii = 20; *ptr; ++ptr)
+ 		if (isdigit(*ptr)) {
+-			copyXPMArea((*ptr - '0') * 6, 64, 6, 9, 1 + ii, y_bottom - 10);
++			copyXPMArea((*ptr - '0') * 6, 90, 6, 9, 1 + ii, 75 );
+ 			ii += 6;
+ 		} else if ('.' == *ptr) {
+-			copyXPMArea(60, 64, 4, 9, 1 + ii, y_bottom - 10);
++			copyXPMArea(60, 90, 4, 9, 1 + ii, 75);
+ 			ii += 4;
+ 		} else {
+-			copyXPMArea((toupper(*ptr) - 'A') * 6, 74, 6, 9, 1 + ii,
+-						y_bottom - 10);
++			copyXPMArea((toupper(*ptr) - 'A') * 6, 100, 6, 9, 1 + ii,
++						75);
+ 			ii += 6;
+ 		}
+ 
+@@ -205,41 +234,39 @@
+ ------------------------------------------------------------------------------*/
+ static char const* rateToStr(unsigned long rate)
+ {
+-	static char buffer[7];
+-	char scaleFactor, *ptr = buffer;
++	static char buffer[14];
++	char scaleFactor='\0', *ptr = buffer;
+ 
+-	/* Based upon its magnitude, determine how much 'rate' needs to be
+-	   scaled and also indicate its unit of scale. */
+-
+-	if (rate > 1000000) {
+-		rate /= 100000;
+-		scaleFactor = 'M';
+-	} else if (rate > 1000) {
+-		rate /= 100;
+-		scaleFactor = 'K';
+-	} else {
+-		rate *= 10;
+-		scaleFactor = '\0';
+-	}
++	double drate = getRate(rate,&scaleFactor);
+ 
+-	/* Transform the value into a left - justified string. */
+-
+-	if (rate >= 1000)
+-		*ptr++ = rate / 1000 + '0';
+-	if (rate >= 100)
+-		*ptr++ = (rate / 100) % 10 + '0';
+-	if (rate >= 10)
+-		*ptr++ = (rate / 10) % 10 + '0';
+-	if (scaleFactor) {
+-		*ptr++ = '.';
+-		*ptr++ = rate % 10 + '0';
+-	}
++	/* Transform the rate value into a left - justified string. */
++	ptr+=sprintf(ptr,"%.1f",drate);
+ 	*ptr++ = scaleFactor;
+ 	*ptr = '\0';
+ 	return buffer;
+ }
+ 
+ /*------------------------------------------------------------------------------
++  getRate
++------------------------------------------------------------------------------*/
++static double getRate(unsigned long rate, char *scaleFactor)
++{
++	 double drate = rate;
++
++	/* Based upon its magnitude, determine how much 'rate' needs to be
++	   scaled and also indicate its unit of scale. */
++
++	if (rate > 1048576) {
++		drate /= 1048576;
++		*scaleFactor = 'M';
++	} else if (rate > 1024) {
++		drate /= 1024;
++		*scaleFactor = 'K';
++	}
++	return drate;
++}
++
++/*------------------------------------------------------------------------------
+   SetErrLED
+ ------------------------------------------------------------------------------*/
+ static void SetErrLED(int led)
+@@ -314,10 +341,11 @@
+ {
+     static char const txt[] =
+ 		"\nwmnet, v1p2 - A network interface monitor for WindowMaker.\n\n"
+-		"\t-h         this help screen\n"
+-		"\t-i name    start with interface 'name'\n"
+-		"\t-u delay   seconds between samples (defaults to 1)\n"
+-		"\t-v         print the version number\n";
++		"\t-h               this help screen\n"
++		"\t-i name          start with interface 'name'\n"
++		"\t-u delay         seconds between samples (defaults to 1)\n"
++		"\t-geom <geometry> geometry to use\n"
++		"\t-v               print the version number\n";
+ 
+     fputs(txt, stderr);
+ }
+@@ -425,6 +453,13 @@
+ 			case 'v':
+ 				printversion();
+ 				return 0;
++			
++			case 'g':
++				if (ii + 1 == argc) {
++					printf("wmnet: must specify geometry\n");
++					return 0;
++				}
++				break;
+ 
+ 			default:
+ 				usage();
diff -ruN wmnet.orig/files/patch-wmgeneral.c wmnet/files/patch-wmgeneral.c
--- wmnet.orig/files/patch-wmgeneral.c	Thu Jan  1 03:00:00 1970
+++ wmnet/files/patch-wmgeneral.c	Tue Aug 17 18:10:56 2004
@@ -0,0 +1,38 @@
+--- wmgeneral.c.orig	Wed Aug 26 18:58:57 1998
++++ wmgeneral.c	Sat Jun  5 13:53:35 2004
+@@ -221,7 +221,7 @@
+ 				 char const* pixmask_bits, int pixmask_width,
+ 				 int pixmask_height)
+ {
+-	static char const Geometry[] = "";
++	static char *Geometry = 0;
+ 
+ 	unsigned int borderwidth = 1;
+ 	XClassHint classHint;
+@@ -245,6 +245,17 @@
+ 			display_name = argv[i + 1];
+ 	}
+ 
++	/* Look to see if the caller specified the geometry. If so, we will
++	   use it to place window */
++
++	for (i = 1; argv[i]; i++) {
++		if (!strcmp(argv[i], "-geom")) 
++			Geometry = argv[i + 1];
++	}
++	
++	if (!Geometry)
++		Geometry = "";
++
+ 	if (!(display = XOpenDisplay(display_name))) {
+ 		fprintf(stderr, "%s: can't open display %s\n", wname,
+ 				XDisplayName(display_name));
+@@ -272,7 +283,7 @@
+ 				&mysizehints.height, &dummy);
+ 
+ 	mysizehints.width = 64;
+-	mysizehints.height = 64;
++	mysizehints.height = 90;
+ 		
+ 	win = XCreateSimpleWindow(display, Root, mysizehints.x, mysizehints.y,
+ 							  mysizehints.width, mysizehints.height,
diff -ruN wmnet.orig/files/patch-wmnet-mask.xbm wmnet/files/patch-wmnet-mask.xbm
--- wmnet.orig/files/patch-wmnet-mask.xbm	Thu Jan  1 03:00:00 1970
+++ wmnet/files/patch-wmnet-mask.xbm	Tue Aug 17 18:10:56 2004
@@ -0,0 +1,48 @@
+--- wmnet-mask.xbm.orig	Wed Aug 26 00:07:56 1998
++++ wmnet-mask.xbm	Sat Jun  5 13:52:40 2004
+@@ -1,5 +1,5 @@
+ #define wmnet_mask_width 64
+-#define wmnet_mask_height 64
++#define wmnet_mask_height 90
+ 
+ static char const wmnet_mask_bits[] = {
+  0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+@@ -68,5 +68,37 @@
+ 
+  0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+  0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
++
++ 0xf0, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x0f,
++ 0xf0, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x0f,
++ 0xf0, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x0f,
++ 0xf0, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x0f,
++ 0xf0, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x0f,
++ 0xf0, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x0f,
++ 0xf0, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x0f,
++ 0xf0, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x0f,
++ 0xf0, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x0f,
++ 0xf0, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x0f,
++ 0xf0, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x0f,
++ 
++ 
++ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
++ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
++
++ 0xf0, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x0f,
++ 0xf0, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x0f,
++ 0xf0, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x0f,
++ 0xf0, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x0f,
++ 0xf0, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x0f,
++ 0xf0, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x0f,
++ 0xf0, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x0f,
++ 0xf0, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x0f,
++ 0xf0, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x0f,
++ 0xf0, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x0f,
++ 0xf0, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x0f,
++
++ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
++ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+  0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 };
++ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00
++};
diff -ruN wmnet.orig/files/patch-wmnet-master.xpm wmnet/files/patch-wmnet-master.xpm
--- wmnet.orig/files/patch-wmnet-master.xpm	Thu Jan  1 03:00:00 1970
+++ wmnet/files/patch-wmnet-master.xpm	Tue Aug 17 18:10:56 2004
@@ -0,0 +1,68 @@
+--- wmnet-master.xpm.orig	Wed Aug 26 00:07:57 1998
++++ wmnet-master.xpm	Sat Jun  5 15:06:26 2004
+@@ -1,6 +1,6 @@
+ /* XPM */
+ static char const* wmnet_master_xpm[] = {
+-"160 100 13 1",
++"160 124 13 1",
+ " 	c None",
+ ".	c #0000FF",
+ "+	c #202020",
+@@ -76,6 +76,32 @@
+ "....########################################################....+...............................................................................................",
+ "................................................................+...............................................................................................",
+ "................................................................+...............................................................................................",
++"....@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@....+...............................................................................................",
++"....@++++++++++++++++++++++++++++++++++++++++++++++++++++++#....+...............................................................................................",
++"....@++++++++++++++++++++++++++++++++++++++++++++++++++++++#....+...............................................................................................",
++"....@++++++++++++++++++++++++++++++++++++++++++++++++++++++#....+...............................................................................................",
++"....@++++++++++++++++++++++++++++++++++++++++++++++++++++++#....+...............................................................................................",
++"....@++++++++++++++++++++++++++++++++++++++++++++++++++++++#....+...............................................................................................",
++"....@++++++++++++++++++++++++++++++++++++++++++++++++++++++#....+...............................................................................................",
++"....@++++++++++++++++++++++++++++++++++++++++++++++++++++++#....+...............................................................................................",
++"....@++++++++++++++++++++++++++++++++++++++++++++++++++++++#....+...............................................................................................",
++"....@++++++++++++++++++++++++++++++++++++++++++++++++++++++#....+...............................................................................................",
++"....########################################################....+...............................................................................................",
++"................................................................+...............................................................................................",
++"................................................................+...............................................................................................",
++"....@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@....+...............................................................................................",
++"....@++++++++++++++++++++++++++++++++++++++++++++++++++++++#....+...............................................................................................",
++"....@++++++++++++++++++++++++++++++++++++++++++++++++++++++#....+...............................................................................................",
++"....@++++++++++++++++++++++++++++++++++++++++++++++++++++++#....+...............................................................................................",
++"....@++++++++++++++++++++++++++++++++++++++++++++++++++++++#....+...............................................................................................",
++"....@++++++++++++++++++++++++++++++++++++++++++++++++++++++#....+...............................................................................................",
++"....@++++++++++++++++++++++++++++++++++++++++++++++++++++++#....+...............................................................................................",
++"....@++++++++++++++++++++++++++++++++++++++++++++++++++++++#....+...............................................................................................",
++"....@++++++++++++++++++++++++++++++++++++++++++++++++++++++#....+...............................................................................................",
++"....@++++++++++++++++++++++++++++++++++++++++++++++++++++++#....+...............................................................................................",
++"....########################################################....+...............................................................................................",
++"................................................................+...............................................................................................",
++"................................................................+...............................................................................................",
+ "................................................................+...............................................................................................",
+ "................................................................+...............................................................................................",
+ "+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++.................................................................................",
+@@ -99,15 +125,15 @@
+ "++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++",
+ "................................................................................................................................................................",
+ "....@+++++++++++++++++++++++++++++++#..@+++++++++++++++++++#....+...............................................................................................",
+-".....+++++++++++++++++++++++++++++++............................................................................................................................",
+-".....+++++++++++++++++++++++++++++++............................................................................................................................",
+-".....+++++++++++++++++++++++++++++++............................................................................................................................",
+-".....+++++++++++++++++++++++++++++++............................................................................................................................",
+-".....+++++++++++++++++++++++++++++++............................................................................................................................",
+-".....+++++++++++++++++++++++++++++++............................................................................................................................",
+-".....+++++++++++++++++++++++++++++++............................................................................................................................",
+-".....+++++++++++++++++++++++++++++++............................................................................................................................",
+-".....+++++++++++++++++++++++++++++++............................................................................................................................",
++".....+++++++++++++++++++++++++++++++++++++++++++++++++++++++....................................................................................................",
++".....+++++++++++++++++++++++++++++++++++++++++++++++++++++++....................................................................................................",
++".....+++++++++++++++++++++++++++++++++++++++++++++++++++++++....................................................................................................",
++".....+++++++++++++++++++++++++++++++++++++++++++++++++++++++....................................................................................................",
++".....+++++++++++++++++++++++++++++++++++++++++++++++++++++++....................................................................................................",
++".....+++++++++++++++++++++++++++++++++++++++++++++++++++++++....................................................................................................",
++".....+++++++++++++++++++++++++++++++++++++++++++++++++++++++....................................................................................................",
++".....+++++++++++++++++++++++++++++++++++++++++++++++++++++++....................................................................................................",
++".....+++++++++++++++++++++++++++++++++++++++++++++++++++++++....................................................................................................",
+ "................................................................................................................................................................",
+ "................................................................................................................................................................",
+ "................................................................................................................................................................",
>Release-Note:
>Audit-Trail:
>Unformatted:



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?E1Bx53x-0001Ck-00.bogorodskiy-inbox-ru>