[Pkg-wmaker-commits] [wmppp.app] 66/120: wmgeneral: Bump to 1998-09-14 version found in wmckgmail, wmitime, wmsmp.app, wmSMPmon, and wmtz.

Doug Torrance dtorrance-guest at moszumanska.debian.org
Thu Aug 27 12:04:36 UTC 2015


This is an automated email from the git hooks/post-receive script.

dtorrance-guest pushed a commit to branch master
in repository wmppp.app.

commit 1008415a46481e029b5eb84336064a8eb67daa34
Author: Doug Torrance <dtorrance at monmouthcollege.edu>
Date:   Tue May 19 22:30:48 2015 -0500

    wmgeneral: Bump to 1998-09-14 version found in wmckgmail, wmitime, wmsmp.app, wmSMPmon, and wmtz.
    
    Note that wmckgmail and wmtz were identical; this is the version we use.
    wmSMPmon differed only with some whitespace.
    
    wmitime differed only with a bugfix (a segfault when -display is given with
    no argument), but this will be fixed again in the next commit.
    
    wmsm.app had patched wmgeneral to work with its xpm; instead we patch its
    xpm to work with wmgeneral.
---
 wmgeneral/wmgeneral.c | 37 +++++++++++++++++++++++++++----------
 1 file changed, 27 insertions(+), 10 deletions(-)

diff --git a/wmgeneral/wmgeneral.c b/wmgeneral/wmgeneral.c
index 44de5b9..c064b39 100644
--- a/wmgeneral/wmgeneral.c
+++ b/wmgeneral/wmgeneral.c
@@ -11,7 +11,10 @@
 
 	---
 	CHANGES:
-	---
+    ---
+    14/09/1998 (Dave Clark, clarkd at skyia.com)
+        * Updated createXBMfromXPM routine
+        * Now supports >256 colors
 	11/09/1998 (Martijn Pieterse, pieterse at xs4all.nl)
 		* Removed a bug from parse_rcfile. You could
 		  not use "start" in a command if a label was
@@ -287,22 +290,36 @@ int CheckMouseRegion(int x, int y) {
 \*******************************************************************************/
 void createXBMfromXPM(char *xbm, char **xpm, int sx, int sy) {
 
-	int		i,j;
-	int		width, height, numcol;
-	char	zero;
+	int		i,j,k;
+	int		width, height, numcol, depth;
+    int 	zero=0;
 	unsigned char	bwrite;
-	int		bcount;
+    int		bcount;
+    int     curpixel;
+
+	sscanf(*xpm, "%d %d %d %d", &width, &height, &numcol, &depth);
 
 
-	sscanf(*xpm, "%d %d %d", &width, &height, &numcol);
+    for (k=0; k!=depth; k++)
+    {
+        zero <<=8;
+        zero |= xpm[1][k];
+    }
 
-	zero = xpm[1][0];
 	for (i=numcol+1; i < numcol+sy+1; i++) {
 		bcount = 0;
 		bwrite = 0;
-		for (j=0; j<sx; j++) {
-			bwrite >>= 1;
-			if (xpm[i][j] != zero) {
+		for (j=0; j<sx*depth; j+=depth) {
+            bwrite >>= 1;
+
+            curpixel=0;
+            for (k=0; k!=depth; k++)
+            {
+                curpixel <<=8;
+                curpixel |= xpm[i][j+k];
+            }
+
+            if ( curpixel != zero ) {
 				bwrite += 128;
 			}
 			bcount++;

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-wmaker/wmppp.app.git



More information about the Pkg-wmaker-commits mailing list