1
0
mirror of https://git.FreeBSD.org/ports.git synced 2024-12-27 05:10:36 +00:00

- Added knob for the popular and "glamour" split gradient patch

- Pass maintainership to submitter

PR:		ports/101624
Submitted by:	RedChrom <redchrom at gmail.com>
This commit is contained in:
Rong-En Fan 2006-08-10 03:55:20 +00:00
parent ff5be01f38
commit 30a2653164
Notes: svn2git 2021-03-31 03:12:20 +00:00
svn path=/head/; revision=170250
2 changed files with 117 additions and 2 deletions

View File

@ -12,7 +12,7 @@ PORTREVISION= 3
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
@ -28,6 +28,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
${CP} -P ${WRKSRC}/data/rc.xml ${WRKSRC}/data/rc.xml.orig
@ -56,7 +62,7 @@ pre-install:
.endfor
cd ${WRKSRC} && ${FIND} -s data themes -type f \
| ${SED} -e 's:^:share/openbox/:' >> ${PLIST} \
&& ${FIND} data themes -type d | sort -r \
&& ${FIND} data themes -type d | ${SORT} -r \
| ${SED} -e 's:^:@dirrm share/openbox/:' >> ${PLIST}
cd ${WRKSRC}/data && ${FIND} -s * -type f \
| ${SED} -e 's:^:share/openbox/:' >> ${PLIST}

View File

@ -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 {