From owner-freebsd-ports-bugs@FreeBSD.ORG Tue Aug 8 04:20:36 2006 Return-Path: X-Original-To: freebsd-ports-bugs@hub.freebsd.org Delivered-To: freebsd-ports-bugs@hub.freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 9D13D16A4E0 for ; Tue, 8 Aug 2006 04:20:36 +0000 (UTC) (envelope-from gnats@FreeBSD.org) Received: from freefall.freebsd.org (freefall.freebsd.org [216.136.204.21]) by mx1.FreeBSD.org (Postfix) with ESMTP id D6B6A43D68 for ; Tue, 8 Aug 2006 04:20:25 +0000 (GMT) (envelope-from gnats@FreeBSD.org) Received: from freefall.freebsd.org (gnats@localhost [127.0.0.1]) by freefall.freebsd.org (8.13.4/8.13.4) with ESMTP id k784KPNW022000 for ; Tue, 8 Aug 2006 04:20:25 GMT (envelope-from gnats@freefall.freebsd.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.13.4/8.13.4/Submit) id k784KPsR021999; Tue, 8 Aug 2006 04:20:25 GMT (envelope-from gnats) Resent-Date: Tue, 8 Aug 2006 04:20:25 GMT Resent-Message-Id: <200608080420.k784KPsR021999@freefall.freebsd.org> Resent-From: FreeBSD-gnats-submit@FreeBSD.org (GNATS Filer) Resent-To: freebsd-ports-bugs@FreeBSD.org Resent-Reply-To: FreeBSD-gnats-submit@FreeBSD.org, redchrom@gmail.com Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 8CC8416A4E5 for ; Tue, 8 Aug 2006 04:19:38 +0000 (UTC) (envelope-from root@death.ispvds.com) Received: from death.ispvds.com (death.ispvds.com [82.146.33.163]) by mx1.FreeBSD.org (Postfix) with ESMTP id BAB7843D45 for ; Tue, 8 Aug 2006 04:19:29 +0000 (GMT) (envelope-from root@death.ispvds.com) Received: by death.ispvds.com (Postfix, from userid 0) id 9D54B2E10FE; Tue, 8 Aug 2006 04:19:29 +0000 (UTC) Message-Id: <20060808041929.9D54B2E10FE@death.ispvds.com> Date: Tue, 8 Aug 2006 04:19:29 +0000 (UTC) From: redchrom@gmail.com To: FreeBSD-gnats-submit@FreeBSD.org X-Send-Pr-Version: 3.113 Cc: Subject: ports/101624: x11-wm/openbox added support for the split gradient X-BeenThere: freebsd-ports-bugs@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: redchrom@gmail.com List-Id: Ports bug reports List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 08 Aug 2006 04:20:36 -0000 >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@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@FreeBSD.org +MAINTAINER= redchrom@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: