[PATCH] the return of the twm rubberband

CaT (cat@zip.com.au)
Fri, 6 Jun 2003 01:54:18 +1000


Cos it's missing and I like it and it got into the last version. Not
quite thesame as afterstep now does some a border of width 3 but close
enough for now :)

diff -aur afterstep-stable.o/libAfterStep/afterstep.h afterstep-stable/libAfterStep/afterstep.h
--- afterstep-stable.o/libAfterStep/afterstep.h	Thu May  8 07:29:01 2003
+++ afterstep-stable/libAfterStep/afterstep.h	Thu Jun  5 19:43:38 2003
@@ -255,7 +255,7 @@
 #define IsValidDesk(d)		(d!=INVALID_DESK)
 
 
-#define MAX_RUBBER_BAND         6
+#define MAX_RUBBER_BAND         7
 
 struct icon_t;
 struct button_t;
diff -aur afterstep-stable.o/libAfterStep/outline.c afterstep-stable/libAfterStep/outline.c
--- afterstep-stable.o/libAfterStep/outline.c	Tue Mar  4 18:42:39 2003
+++ afterstep-stable/libAfterStep/outline.c	Thu Jun  5 20:38:55 2003
@@ -210,6 +210,31 @@
 	return count + 4;
 }
 
+int
+make_twm_segments (ASOutlineSegment *s, XRectangle *geom, unsigned int scr_width, unsigned int scr_height)
+{
+	int count = 0 ;
+	/* Outline box : */
+	count += make_rectangle_segments(s, geom->x, geom->y, geom->width, geom->height);
+	/* Inside grid : */
+	if(s) {
+		s = &(s[count]);
+		s[0].y = geom->y + geom->height/3;
+		s[1].y = geom->y + geom->height - geom->height/3;
+		s[1].x = s[0].x = geom->x + 1;
+		s[1].size = s[0].size = geom->width - 1;
+		s[1].vertical = s[0].vertical = False;
+
+		s[2].x = geom->x + geom->width/3;
+		s[3].x = geom->x + geom->width - geom->width/3;
+		s[3].y = s[2].y = geom->y + 1;
+		s[3].size = s[2].size = geom->height - 1;
+		s[3].vertical = s[2].vertical = True;
+	}
+	return count + 4;
+}
+
+
 as_outline_handler outline_handlers[MAX_RUBBER_BAND+1] =
 {
     make_fvwm_segments,         /* 0 is the old default FVWM style look                                */
@@ -218,7 +243,8 @@
     make_tek_segments,          /* 3 is a cool tech-looking outline.                                   */
     make_tek2_segments,         /* 4 is another cool tech-looking outline.                             */
     make_corner_segments,       /* 5 is the corners of the window with a crosshair in the middle.      */
-    make_hash_segments          /* 6 is lines spanning the whole screen framing the window. (CAD style)*/
+    make_hash_segments,         /* 6 is lines spanning the whole screen framing the window. (CAD style)*/
+    make_twm_segments           /* 7 is the old twm style look.                                        */
 };
 
 /***********************************************************************

-- 
Martin's distress was in contrast to the bitter satisfaction of some
of his fellow marines as they surveyed the scene. "The Iraqis are sick
people and we are the chemotherapy," said Corporal Ryan Dupre. "I am
starting to hate this country. Wait till I get hold of a friggin' Iraqi.
No, I won't get hold of one. I'll just kill him."
	- http://www.informationclearinghouse.info/article2479.htm
_______________________________________________
The AfterStep Window Manager for X User's Mailing List
http://mail.afterstep.org/mailman/listinfo/as-users