Date: Wed, 24 Dec 2014 13:02:37 +0000 (UTC) From: Antoine Brodin <antoine@FreeBSD.org> To: ports-committers@freebsd.org, svn-ports-all@freebsd.org, svn-ports-head@freebsd.org Subject: svn commit: r375453 - in head/x11/bbdock: . files Message-ID: <201412241302.sBOD2bIe019426@svn.freebsd.org>
next in thread | raw e-mail | index | archive | help
Author: antoine Date: Wed Dec 24 13:02:36 2014 New Revision: 375453 URL: https://svnweb.freebsd.org/changeset/ports/375453 QAT: https://qat.redports.org/buildarchive/r375453/ Log: Properly support png 1.5 Obtained from: upstream, markusfisch/bbdock on github Modified: head/x11/bbdock/Makefile head/x11/bbdock/files/patch-Slot.cc Modified: head/x11/bbdock/Makefile ============================================================================== --- head/x11/bbdock/Makefile Wed Dec 24 12:39:41 2014 (r375452) +++ head/x11/bbdock/Makefile Wed Dec 24 13:02:36 2014 (r375453) @@ -12,11 +12,10 @@ COMMENT= Application launcher for Blackb LICENSE= BSD3CLAUSE -LIB_DEPENDS= libpng15.so:${PORTSDIR}/graphics/png +LIB_DEPENDS= libpng.so:${PORTSDIR}/graphics/png GNU_CONFIGURE= yes USE_XORG= x11 -CPPFLAGS+= -I${LOCALBASE}/include/libpng15 PORTDOCS= README PLIST_FILES= bin/bbdock Modified: head/x11/bbdock/files/patch-Slot.cc ============================================================================== --- head/x11/bbdock/files/patch-Slot.cc Wed Dec 24 12:39:41 2014 (r375452) +++ head/x11/bbdock/files/patch-Slot.cc Wed Dec 24 13:02:36 2014 (r375453) @@ -1,10 +1,55 @@ ---- src/Slot.cc.orig 2011-03-29 21:48:36.000000000 +0200 -+++ src/Slot.cc 2012-05-06 10:01:10.000000000 +0200 -@@ -38,6 +38,7 @@ - #include <string> +--- src/Slot.cc.orig 2011-03-29 19:48:36 UTC ++++ src/Slot.cc +@@ -420,6 +420,8 @@ const bool Slot::hasFocus() + */ + void Slot::loadIcon() + { ++ png_bytep *rowPointers; ++ + destroyIcon(); + width = height = 0; - #include "Slot.hh" -+#include "pngpriv.h" +@@ -446,27 +448,29 @@ void Slot::loadIcon() + PNG_TRANSFORM_BGR, + 0 ); - extern char **environ; +- if( !(info->valid & PNG_INFO_IDAT) || +- !(normalicon = new int[info->width*info->height]) ) ++ width = png_get_image_width( png, info ); ++ height = png_get_image_height( png, info ); ++ ++ if( !png_get_valid( png, info, PNG_INFO_IDAT ) || ++ !(normalicon = new int[width*height]) ) + throw 0; +- for( int y = 0, *src, *dest = normalicon; +- y < info->height && (src = (int *) info->row_pointers[y]); +- y++, dest += info->width ) +- memcpy( dest, src, info->width<<2 ); ++ rowPointers = png_get_rows( png, info ); + +- width = info->width; +- height = info->height; ++ for( int y = 0, *src, *dest = normalicon; ++ y < height && (src = (int *) rowPointers[y]); ++ y++, dest += width ) ++ memcpy( dest, src, width<<2 ); + + // convert grayscale image to rgb +- if( info->color_type == PNG_COLOR_TYPE_GRAY_ALPHA ) +- for( int y = info->height, *line = normalicon; +- --y; line += info->width ) ++ if( png_get_color_type(png, info) == PNG_COLOR_TYPE_GRAY_ALPHA ) ++ for( int y = height, *line = normalicon; ++ --y; line += width ) + { +- unsigned char *dest = (unsigned char *) line+(info->width<<2); +- unsigned char *src = (unsigned char *) line+(info->width<<1); ++ unsigned char *dest = (unsigned char *) line+(width<<2); ++ unsigned char *src = (unsigned char *) line+(width<<1); + +- for( int x = info->width; --x; ) ++ for( int x = width; --x; ) + { + *(--dest) = *(--src); + *(--dest) = *(--src);
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201412241302.sBOD2bIe019426>