ports/101624: x11-wm/openbox added support for the split gradient
redchrom at gmail.com
redchrom at gmail.com
Tue Aug 8 04:20:36 UTC 2006
>Number: 101624
>Category: ports
>Synopsis: x11-wm/openbox added support for the split gradient
>Confidential: no
>Severity: non-critical
>Priority: low
>Responsible: freebsd-ports-bugs
>State: open
>Quarter:
>Keywords:
>Date-Required:
>Class: change-request
>Submitter-Id: current-users
>Arrival-Date: Tue Aug 08 04:20:25 GMT 2006
>Closed-Date:
>Last-Modified:
>Originator: RedChrom
>Release: FreeBSD 6.1-STABLE i386
>Organization:
ISPSystem
>Environment:
System: FreeBSD death.ispvds.com 6.1-STABLE FreeBSD 6.1-STABLE #0: Mon Jul 24 07:01:18 CEST 2006 root at dione.ispsystem.net:/root/src/sys/i386/compile/ISPSYSTEM i386
>Description:
* Added knob for the popular and "glamour" split gradient patch :)
* Changed MAINTAINER to me
>How-To-Repeat:
Please, apply the patch.
>Fix:
--- openbox_patch begins here ---
diff -urN openbox.orig/Makefile openbox/Makefile
--- openbox.orig/Makefile Tue Aug 8 13:09:41 2006
+++ openbox/Makefile Tue Aug 8 13:10:11 2006
@@ -12,7 +12,7 @@
CATEGORIES= x11-wm
MASTER_SITES= http://icculus.org/openbox/releases/
-MAINTAINER= ports at FreeBSD.org
+MAINTAINER= redchrom at gmail.com
COMMENT= Derived from, and similar to, Blackbox
LIB_DEPENDS= Xft.2:${PORTSDIR}/x11-fonts/libXft
@@ -27,6 +27,12 @@
USE_GNOME= glib20 libxml2
USE_X_PREFIX= yes
INSTALLS_SHLIB= yes
+
+.if defined(WITH_SPLITGRADIENT)
+post-patch::
+ @${ECHO} "===> Applying split gradient patch"
+ cd ${BUILD_WRKSRC}; ${PATCH} -p1 < ${PATCHDIR}/extra-patch-gradient
+.endif
post-build:
cd ${WRKSRC}/po && ${LOCALBASE}/bin/msgfmt -c -o ja.mo ja.po
diff -urN openbox.orig/files/extra-patch-gradient openbox/files/extra-patch-gradient
--- openbox.orig/files/extra-patch-gradient Thu Jan 1 08:00:00 1970
+++ openbox/files/extra-patch-gradient Tue Aug 8 12:41:08 2006
@@ -0,0 +1,109 @@
+diff -urN openbox-3.2.orig/render/gradient.c openbox-3.2/render/gradient.c
+--- openbox-3.2.orig/render/gradient.c Tue Aug 8 12:39:59 2006
++++ openbox-3.2/render/gradient.c Tue Aug 8 12:40:14 2006
+@@ -24,6 +24,7 @@
+
+ static void highlight(RrPixel32 *x, RrPixel32 *y, gboolean raised);
+ static void gradient_solid(RrAppearance *l, gint w, gint h);
++static void gradient_split(RrAppearance *a, gint w, gint h);
+ static void gradient_vertical(RrSurface *sf, gint w, gint h);
+ static void gradient_horizontal(RrSurface *sf, gint w, gint h);
+ static void gradient_diagonal(RrSurface *sf, gint w, gint h);
+@@ -41,6 +42,9 @@
+ case RR_SURFACE_SOLID:
+ gradient_solid(a, w, h);
+ break;
++ case RR_SURFACE_SPLIT:
++ gradient_split(a, w, h);
++ break;
+ case RR_SURFACE_VERTICAL:
+ gradient_vertical(&a->surface, w, h);
+ break;
+@@ -357,6 +361,64 @@
+ } \
+ } \
+ } \
++}
++
++static void gradient_split(RrAppearance *a, gint w, gint h)
++{
++ gint x, y1, y3, r, g, b;
++ RrSurface *sf = &a->surface;
++ RrPixel32 *data = sf->pixel_data;
++ RrPixel32 current;
++ RrColor *primary_light, *secondary_light;
++
++ r = sf->primary->r;
++ r += r >> 2;
++ g = sf->primary->g;
++ g += g >> 2;
++ b = sf->primary->b;
++ b += b >> 2;
++ if (r > 0xFF) r = 0xFF;
++ if (g > 0xFF) g = 0xFF;
++ if (b > 0xFF) b = 0xFF;
++ primary_light = RrColorNew(a->inst, r, g, b);
++
++ r = sf->secondary->r;
++ r += r >> 4;
++ g = sf->secondary->g;
++ g += g >> 4;
++ b = sf->secondary->b;
++ b += b >> 4;
++ if (r > 0xFF) r = 0xFF;
++ if (g > 0xFF) g = 0xFF;
++ if (b > 0xFF) b = 0xFF;
++ secondary_light = RrColorNew(a->inst, r, g, b);
++
++ VARS(y1);
++ SETUP(y1, primary_light, sf->primary, (h / 2) -1);
++
++ VARS(y3);
++ SETUP(y3, sf->secondary, secondary_light, (h / 2) -1);
++
++ for (y1 = h - 1; y1 > (h / 2) -1; --y1) { /* 0 -> h-1 */
++ current = COLOR(y1);
++ for (x = w - 1; x >= 0; --x) /* 0 -> w */
++ *(data++) = current;
++
++ NEXT(y1);
++ }
++
++
++ for (y3 = (h / 2) - 1; y3 > 0; --y3) {
++ current = COLOR(y3);
++ for (x = w - 1; x >= 0; --x)
++ *(data++) = current;
++
++ NEXT(y3);
++ }
++
++ current = COLOR(y3);
++ for (x = w - 1; x >= 0; --x) /* 0 -> w */
++ *(data++) = current;
+ }
+
+ static void gradient_horizontal(RrSurface *sf, gint w, gint h)
+diff -urN openbox-3.2.orig/render/render.h openbox-3.2/render/render.h
+--- openbox-3.2.orig/render/render.h Tue Aug 8 12:39:59 2006
++++ openbox-3.2/render/render.h Tue Aug 8 12:40:14 2006
+@@ -60,6 +60,7 @@
+ RR_SURFACE_NONE,
+ RR_SURFACE_PARENTREL,
+ RR_SURFACE_SOLID,
++ RR_SURFACE_SPLIT,
+ RR_SURFACE_HORIZONTAL,
+ RR_SURFACE_VERTICAL,
+ RR_SURFACE_DIAGONAL,
+diff -urN openbox-3.2.orig/render/theme.c openbox-3.2/render/theme.c
+--- openbox-3.2.orig/render/theme.c Tue Aug 8 12:39:59 2006
++++ openbox-3.2/render/theme.c Tue Aug 8 12:40:14 2006
+@@ -1200,6 +1200,8 @@
+ *grad = RR_SURFACE_HORIZONTAL;
+ else if (strstr(tex, "vertical") != NULL)
+ *grad = RR_SURFACE_VERTICAL;
++ else if (strstr(tex, "split") != NULL)
++ *grad = RR_SURFACE_SPLIT;
+ else
+ *grad = RR_SURFACE_DIAGONAL;
+ } else {
--- openbox_patch ends here ---
>Release-Note:
>Audit-Trail:
>Unformatted:
More information about the freebsd-ports-bugs
mailing list