pkgsrc-Changes archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

CVS commit: pkgsrc/graphics/xv



Module Name:    pkgsrc
Committed By:   tsutsui
Date:           Sat Apr 19 23:14:24 UTC 2025

Modified Files:
        pkgsrc/graphics/xv: Makefile distinfo
        pkgsrc/graphics/xv/patches: patch-Imakefile patch-config.h patch-xv.c
            patch-xv.h patch-xvevent.c
Added Files:
        pkgsrc/graphics/xv/patches: patch-xvbmp.c patch-xvsmooth.c

Log Message:
xv: apply several fixes from forked upstream.

- https://gitlab.com/DavidGriffith/xv/-/commit/60a25db1
  > Updated xvbmp.c to support reading the three newer versions of BMP format.
- https://gitlab.com/DavidGriffith/xv/-/commit/b91710b5
  > Fix off-by-one's resulting in dereferencing out-of-bound memory.
- https://gitlab.com/DavidGriffith/xv/-/commit/a84406cb
  > Add XrandR support.
- https://gitlab.com/DavidGriffith/xv/-/commit/72c80bff
  > Fix off-by-one in smoothing code and use better interpolation/rounding.
- https://gitlab.com/DavidGriffith/xv/-/commit/f9d46bd9
  > Eliminate flicker

Bump PKGREVISION.


To generate a diff of this commit:
cvs rdiff -u -r1.102 -r1.103 pkgsrc/graphics/xv/Makefile
cvs rdiff -u -r1.30 -r1.31 pkgsrc/graphics/xv/distinfo
cvs rdiff -u -r1.4 -r1.5 pkgsrc/graphics/xv/patches/patch-Imakefile
cvs rdiff -u -r1.1 -r1.2 pkgsrc/graphics/xv/patches/patch-config.h \
    pkgsrc/graphics/xv/patches/patch-xv.c \
    pkgsrc/graphics/xv/patches/patch-xvevent.c
cvs rdiff -u -r1.2 -r1.3 pkgsrc/graphics/xv/patches/patch-xv.h
cvs rdiff -u -r0 -r1.1 pkgsrc/graphics/xv/patches/patch-xvbmp.c \
    pkgsrc/graphics/xv/patches/patch-xvsmooth.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: pkgsrc/graphics/xv/Makefile
diff -u pkgsrc/graphics/xv/Makefile:1.102 pkgsrc/graphics/xv/Makefile:1.103
--- pkgsrc/graphics/xv/Makefile:1.102   Sat Nov 25 08:03:01 2023
+++ pkgsrc/graphics/xv/Makefile Sat Apr 19 23:14:24 2025
@@ -1,7 +1,7 @@
-# $NetBSD: Makefile,v 1.102 2023/11/25 08:03:01 tsutsui Exp $
+# $NetBSD: Makefile,v 1.103 2025/04/19 23:14:24 tsutsui Exp $
 
 DISTNAME=      xv-3.10a
-PKGREVISION=   30
+PKGREVISION=   31
 CATEGORIES=    graphics x11
 MASTER_SITES=  ftp://ftp.cis.upenn.edu/pub/xv/
 DISTFILES=     ${DEFAULT_DISTFILES} ${JUMBO_PATCHES}

Index: pkgsrc/graphics/xv/distinfo
diff -u pkgsrc/graphics/xv/distinfo:1.30 pkgsrc/graphics/xv/distinfo:1.31
--- pkgsrc/graphics/xv/distinfo:1.30    Sat Mar 23 18:07:38 2024
+++ pkgsrc/graphics/xv/distinfo Sat Apr 19 23:14:24 2025
@@ -1,4 +1,4 @@
-$NetBSD: distinfo,v 1.30 2024/03/23 18:07:38 tsutsui Exp $
+$NetBSD: distinfo,v 1.31 2025/04/19 23:14:24 tsutsui Exp $
 
 BLAKE2s (xv-3.10a-enhancements.20070520-20081216.diff) = 1333e3066444f6adf64e83c33a129a46143678d4b2c805f3740baae1320d3449
 SHA512 (xv-3.10a-enhancements.20070520-20081216.diff) = d7152799f6ec65404496b8d83a93681122fe1280741ffe4d20d7dc1b3791873081c778b3d9806f1217b9d45f5b5bfce6fdbfb655c26ed5e87388a6f517c4f2f7
@@ -9,18 +9,20 @@ Size (xv-3.10a-jumbo-patches-20070520.ta
 BLAKE2s (xv-3.10a.tar.gz) = 1a48a6b641074c1fc1c51a01d6516024489ed0fab550abdd708f7d12aef8d292
 SHA512 (xv-3.10a.tar.gz) = 5b8c5890503e2796638921cabae8967e458c73e332acea8561b1025ed13c771bc44c0e309b4592852e33726eeaa9784f933d1312073b0ba2e0b8c0cedabcaa3f
 Size (xv-3.10a.tar.gz) = 2259124 bytes
-SHA1 (patch-Imakefile) = 129ecbffa87166858cdaa60a0089e5c34da4ab0d
+SHA1 (patch-Imakefile) = cebd636b0b0782c6c18f90e2b9b503751c34e8c6
 SHA1 (patch-bits_br__webp) = 47f2495f0e8d443e0e20b718593de331cf319dea
-SHA1 (patch-config.h) = fd0ef6bbf774a57dd0bb94676927dcc6eeef1014
+SHA1 (patch-config.h) = 44e0c07e6bdef840b2e2c5b793d7854252254117
 SHA1 (patch-vdcomp.c) = 4c603cdc2c01925fed283b2aa6030d1933cdaddc
-SHA1 (patch-xv.c) = 6f42b3cfa60fc724b9022b61794201252161e60a
-SHA1 (patch-xv.h) = abe4ae7018bc62b983274c47c31741f0474d48ac
+SHA1 (patch-xv.c) = 6f4024903cb8b35a6ab2aba656b540f0df2566fb
+SHA1 (patch-xv.h) = cbdaac0a10a7b7eca56cbd4147c35943c2349604
+SHA1 (patch-xvbmp.c) = 4b85101668d79b6dd4616199d6a6d53170df7df9
 SHA1 (patch-xvbrowse.c) = f15e6e8e4db2776f072f34355ecad7844a764c2a
 SHA1 (patch-xvdir.c) = 070714b588bc28f5d6e8974a88c960c6ab9df94f
-SHA1 (patch-xvevent.c) = bfb7fd815b8ff86f68c09098c74ab0adc8a36a32
+SHA1 (patch-xvevent.c) = 2be8b41579283607f2f37ced2594220425b0abfe
 SHA1 (patch-xvinfo.c) = 33b2392de259f1380e5be180f8e7293a9551fc52
 SHA1 (patch-xvmisc.c) = ad326175632736e2d6dd257972d8cba5b24635a3
 SHA1 (patch-xvpcd.c) = 1825015f441b9af91916f9a62e8d1dee6ddfdef9
 SHA1 (patch-xvpng.c) = 2bda08bae67fcf127c49b9ed780b7a247579c088
+SHA1 (patch-xvsmooth.c) = 927ae2df2bf783cb822cea0881c26522a88761a6
 SHA1 (patch-xvwebp.c) = 9bffcb775d641f50d778ad026cb66880b74e7462
 SHA1 (patch-xvxbm.c) = b856397794a4025e001c3a5867010288ed61bedb

Index: pkgsrc/graphics/xv/patches/patch-Imakefile
diff -u pkgsrc/graphics/xv/patches/patch-Imakefile:1.4 pkgsrc/graphics/xv/patches/patch-Imakefile:1.5
--- pkgsrc/graphics/xv/patches/patch-Imakefile:1.4      Sat Mar 23 18:07:38 2024
+++ pkgsrc/graphics/xv/patches/patch-Imakefile  Sat Apr 19 23:14:24 2025
@@ -1,4 +1,4 @@
-$NetBSD: patch-Imakefile,v 1.4 2024/03/23 18:07:38 tsutsui Exp $
+$NetBSD: patch-Imakefile,v 1.5 2025/04/19 23:14:24 tsutsui Exp $
 
 - use jpeg, png, tiff, and zlib from pkgsrc
 - make ghostscript support optional
@@ -6,8 +6,10 @@ $NetBSD: patch-Imakefile,v 1.4 2024/03/2
   https://gitlab.com/DavidGriffith/xv/-/commit/5682a07e
   and use libwebp from pkgsrc
 - fix build errors on NetBSD/vax
+- pull XRandR support from forked upstream
+  https://gitlab.com/DavidGriffith/xv/-/commit/a84406cb
 
---- Imakefile.orig     2024-03-23 18:02:14.701404322 +0000
+--- Imakefile.orig     2025-04-19 21:39:43.875821441 +0000
 +++ Imakefile
 @@ -6,13 +6,20 @@
  /* if, for whatever reason, you're unable to get the JPEG library to compile
@@ -52,7 +54,18 @@ $NetBSD: patch-Imakefile,v 1.4 2024/03/2
  VPRINTF=      -DNEED_VPRINTF -DINTSPRINTF -DLONGINT -DNOVOID
  #else 
  #  if defined(RtArchitecture) && !defined(AIXArchitecture)
-@@ -116,28 +127,84 @@ MGCSFX = -DMGCSFXDIR=\"$(MGCSFXDIR)\"
+@@ -109,6 +120,10 @@ MGCSFXDIR = $(LIBDIR)
+ /* Directory of default configuration file. */
+ MGCSFX = -DMGCSFXDIR=\"$(MGCSFXDIR)\"
+ 
++#if BuildRandRLibrary
++XRANDR    = -DDOXRANDR
++XRANDRLIB = -lXrandr
++#endif
+ 
+ 
+ 
+@@ -116,28 +131,84 @@ MGCSFX = -DMGCSFXDIR=\"$(MGCSFXDIR)\"
  
  /* This marks the end of the configuration parameters */
  
@@ -139,17 +152,19 @@ $NetBSD: patch-Imakefile,v 1.4 2024/03/2
  
  #if defined(SCOArchitecture)
  SCO= -Dsco -DPOSIX -DNO_RANDOM 
-@@ -149,14 +216,15 @@ SYS_LIBRARIES=        -lm
+@@ -149,14 +220,16 @@ SYS_LIBRARIES=        -lm
  #endif
  
  
 -DEPLIBS = $(LIBJPEG) $(LIBTIFF)
 -LOCAL_LIBRARIES = $(XLIB) $(DEPLIBS)
 +DEPLIBS = $(DEPLIBJPEG) $(DEPLIBTIFF) $(DEPLIBPNG) $(DEPLIBWEBP) $(DEPLIBZLIB)
-+LOCAL_LIBRARIES = $(XLIB) $(LIBJPEG) $(LIBTIFF) $(LIBPNG) $(LIBWEBP) $(LIBZLIB)
++LOCAL_LIBRARIES = $(XRANDRLIB) $(XLIB) $(LIBJPEG) $(LIBTIFF) $(LIBPNG) \
++      $(LIBWEBP) $(LIBZLIB)
  
- DEFINES= $(SCO) $(UNIX) $(NODIRENT) $(VPRINTF) $(TIMERS) \
+-DEFINES= $(SCO) $(UNIX) $(NODIRENT) $(VPRINTF) $(TIMERS) \
 -      $(HPUX7) $(JPEG) $(TIFF) $(PDS) $(DXWM) $(RAND) \
++DEFINES= $(SCO) $(UNIX) $(NODIRENT) $(VPRINTF) $(TIMERS) $(XRANDR) \
 +      $(HPUX7) $(JPEG) $(TIFF) $(GS) $(PNG) $(WEBP) $(PDS) $(DXWM) $(RAND) \
        $(BACKING_STORE) $(BSDTYPES) $(SGI) $(MGCSFX)
  
@@ -159,7 +174,7 @@ $NetBSD: patch-Imakefile,v 1.4 2024/03/2
  
  SRCS1 =       xv.c xvevent.c xvroot.c xvmisc.c xvimage.c xvcolor.c xvsmooth.c \
        xv24to8.c xvgif.c xvpm.c xvinfo.c xvctrl.c xvscrl.c xvalg.c \
-@@ -166,7 +234,7 @@ SRCS1 =    xv.c xvevent.c xvroot.c xvmisc.c
+@@ -166,7 +239,7 @@ SRCS1 =    xv.c xvevent.c xvroot.c xvmisc.c
        xvbrowse.c xvtext.c xvpcx.c xviff.c xvtarga.c xvxpm.c xvcut.c \
        xvxwd.c xvfits.c xvpng.c xvzx.c xvwbmp.c xvpcd.c \
        xvmag.c xvpic.c xvmaki.c xvpi.c xvpic2.c xvvd.c xvmgcsfx.c \
@@ -168,7 +183,7 @@ $NetBSD: patch-Imakefile,v 1.4 2024/03/2
  
  OBJS1 =       xv.o xvevent.o xvroot.o xvmisc.o xvimage.o xvcolor.o xvsmooth.o \
        xv24to8.o xvgif.o xvpm.o xvinfo.o xvctrl.o xvscrl.o xvalg.o \
-@@ -176,7 +244,7 @@ OBJS1 =    xv.o xvevent.o xvroot.o xvmisc.o
+@@ -176,7 +249,7 @@ OBJS1 =    xv.o xvevent.o xvroot.o xvmisc.o
        xvbrowse.o xvtext.o xvpcx.o xviff.o xvtarga.o xvxpm.o xvcut.o \
        xvxwd.o xvfits.o xvpng.o xvzx.o xvwbmp.o xvpcd.o \
        xvmag.o xvpic.o xvmaki.o xvpi.o xvpic2.o xvvd.o xvmgcsfx.o \

Index: pkgsrc/graphics/xv/patches/patch-config.h
diff -u pkgsrc/graphics/xv/patches/patch-config.h:1.1 pkgsrc/graphics/xv/patches/patch-config.h:1.2
--- pkgsrc/graphics/xv/patches/patch-config.h:1.1       Thu Feb 21 14:32:32 2019
+++ pkgsrc/graphics/xv/patches/patch-config.h   Sat Apr 19 23:14:24 2025
@@ -1,9 +1,11 @@
-$NetBSD: patch-config.h,v 1.1 2019/02/21 14:32:32 tsutsui Exp $
+$NetBSD: patch-config.h,v 1.2 2025/04/19 23:14:24 tsutsui Exp $
 
 - make ghostscript support optional
 - use pkgsrc ${PREFIX} for ghostscript files
+- pull XRandR support from forked upstream
+  https://gitlab.com/DavidGriffith/xv/-/commit/a84406cb
 
---- config.h.orig      2019-02-21 14:07:37.592173395 +0000
+--- config.h.orig      2025-04-19 21:39:43.932827163 +0000
 +++ config.h
 @@ -112,10 +112,12 @@
   * should not need to be changed
@@ -21,3 +23,20 @@ $NetBSD: patch-config.h,v 1.1 2019/02/21
  
  
  /***************************************************************************
+@@ -282,6 +284,16 @@
+ /* #  define TV_FONTSET "-*-fixed-medium-r-normal--%d-*" */
+ #endif /* TV_L10N */
+ 
++/***************************************************************************
++ * X11 Rotate And Resize Support
++ *
++ * if you want XV to adjust the max(pect) sizes to your current screen size
++ * and you have the XRandR headers and library installed
++ */
++
++#ifdef DOXRANDR
++#  define HAVE_XRR
++#endif
+ 
+ /***************************************************************************
+  * User definable filter support:
Index: pkgsrc/graphics/xv/patches/patch-xv.c
diff -u pkgsrc/graphics/xv/patches/patch-xv.c:1.1 pkgsrc/graphics/xv/patches/patch-xv.c:1.2
--- pkgsrc/graphics/xv/patches/patch-xv.c:1.1   Sun Jul 30 07:55:45 2023
+++ pkgsrc/graphics/xv/patches/patch-xv.c       Sat Apr 19 23:14:24 2025
@@ -1,11 +1,36 @@
-$NetBSD: patch-xv.c,v 1.1 2023/07/30 07:55:45 tsutsui Exp $
+$NetBSD: patch-xv.c,v 1.2 2025/04/19 23:14:24 tsutsui Exp $
 
 - add webp support from forked upstream
   https://gitlab.com/DavidGriffith/xv/-/commit/5682a07e
+- pull XRandR support from forked upstream
+  https://gitlab.com/DavidGriffith/xv/-/commit/a84406cb
+- pull flicker fix from forked upstream
+  https://gitlab.com/DavidGriffith/xv/-/commit/f9d46bd9
 
---- xv.c.orig  2023-07-30 04:38:20.015663071 +0000
+--- xv.c.orig  2025-04-19 21:59:18.981323758 +0000
 +++ xv.c
-@@ -337,6 +337,10 @@ int main(argc, argv)
+@@ -140,6 +140,9 @@ static int  argcmp                   PAR
+                                            int, int, int *));
+ static void add_filelist_to_namelist PARM((char *, char **, int *, int));
+ 
++#ifdef HAVE_XRR
++extern int RRevent_number, RRerror_number;
++#endif
+ 
+ /* formerly local vars in main, made local to this module when
+    parseResources() and parseCmdLine() were split out of main() */
+@@ -169,6 +172,10 @@ int main(argc, argv)
+ #ifdef TV_L10N
+   int    j;
+ #endif
++#ifdef HAVE_XRR
++  int major = -1, minor = -1;
++  int nScreens;
++#endif
+   XColor ecdef;
+   Window rootReturn, parentReturn, *children;
+   unsigned int numChildren, rootDEEP;
+@@ -337,6 +344,10 @@ int main(argc, argv)
    pngW = (Window) NULL;  pngUp = 0;
  #endif
  
@@ -16,7 +41,7 @@ $NetBSD: patch-xv.c,v 1.1 2023/07/30 07:
    pcdW = (Window) NULL;  pcdUp = 0;
  
  #ifdef HAVE_PIC2
-@@ -980,6 +984,11 @@ int main(argc, argv)
+@@ -980,6 +991,11 @@ int main(argc, argv)
    XSetTransientForHint(theDisp, pngW, dirW);
  #endif
  
@@ -28,7 +53,47 @@ $NetBSD: patch-xv.c,v 1.1 2023/07/30 07:
  #ifdef HAVE_PCD
    CreatePCDW();
    XSetTransientForHint(theDisp, pcdW, dirW);
-@@ -1870,6 +1879,9 @@ static void cmdSyntax()
+@@ -1030,8 +1046,26 @@ int main(argc, argv)
+   /* make std colormap, maybe */
+   ChangeCmapMode(colorMapMode, 0, 0);
+ 
++  /* Xrandr */
++#ifdef HAVE_XRR
++  if (!XRRQueryExtension(theDisp, &RRevent_number, &RRerror_number)) {
++    major = -1;
++  } else {
++    if (DEBUG) fprintf(stderr, "XRRQueryExtension: %d, %d\n", RRevent_number, RRerror_number);
+ 
++    if (!XRRQueryVersion(theDisp, &major, &minor)) {
++      if (DEBUG) fprintf(stderr, "XRRQueryVersion failed!\n");
++    } else {
++      if (DEBUG) fprintf(stderr, "XRRQueryVersion: %d, %d\n", major, minor);
++    }
+ 
++    nScreens = ScreenCount(theDisp);
++
++    for (i = 0; i < nScreens; i++) {
++      XRRSelectInput(theDisp, RootWindow(theDisp, i), RRScreenChangeNotifyMask);
++    }
++  }
++#endif
+ 
+   /* Do The Thing... */
+   mainLoop();
+@@ -1182,10 +1216,10 @@ static void useOtherVisual(vinfo, best)
+     XFlush(theDisp);
+     XSync(theDisp, False);
+ 
+-    xswa.background_pixel = 0;
++    xswa.background_pixmap = None;
+     xswa.border_pixel     = 1;
+     xswa.colormap         = theCmap;
+-    xswamask = CWBackPixel | CWBorderPixel | CWColormap;
++    xswamask = CWBackPixmap | CWBorderPixel | CWColormap;
+ 
+     win = XCreateWindow(theDisp, rootW, 0, 0, 100, 100, 2, (int) dispDEEP,
+                       InputOutput, theVisual, xswamask, &xswa);
+@@ -1870,6 +1904,9 @@ static void cmdSyntax()
  #ifdef HAVE_PNG
    VersionInfoPNG();
  #endif
@@ -38,7 +103,7 @@ $NetBSD: patch-xv.c,v 1.1 2023/07/30 07:
    /* pbm/pgm/ppm support is native, not via pbmplus/netpbm libraries */
    fprintf(stderr, "\n");
  
-@@ -3121,6 +3133,15 @@ int ReadFileType(fname)
+@@ -3121,6 +3158,15 @@ int ReadFileType(fname)
             magicno[2]=='N'  && magicno[3]=='G')               rv = RFT_PNG;
  #endif
  
@@ -54,7 +119,7 @@ $NetBSD: patch-xv.c,v 1.1 2023/07/30 07:
  #ifdef HAVE_PDS
    else if (strncmp((char *) magicno,  "NJPL1I00", (size_t) 8)==0 ||
           strncmp((char *) magicno+2,"NJPL1I",   (size_t) 6)==0 ||
-@@ -3258,6 +3279,10 @@ int ReadPicFile(fname, ftype, pinfo, qui
+@@ -3258,6 +3304,10 @@ int ReadPicFile(fname, ftype, pinfo, qui
    case RFT_PNG:     rv = LoadPNG   (fname, pinfo);         break;
  #endif
  
@@ -65,3 +130,22 @@ $NetBSD: patch-xv.c,v 1.1 2023/07/30 07:
  #ifdef HAVE_PDS
    case RFT_PDSVICAR: rv = LoadPDS  (fname, pinfo);         break;
  #endif
+@@ -3890,7 +3940,7 @@ static void createMainWindow(geom, name)
+   hints.flags |= PSize | PMaxSize;
+ 
+   xswa.bit_gravity      = StaticGravity;
+-  xswa.background_pixel = bg;
++  xswa.background_pixmap  = None;
+   xswa.border_pixel     = fg;
+   xswa.colormap         = theCmap;
+ 
+@@ -3905,7 +3955,8 @@ static void createMainWindow(geom, name)
+      that windows, by default, have backing-store turned on, then the
+      image window will, too */
+ 
+-  xswamask = CWBackPixel | CWBorderPixel | CWColormap /* | CWBackingStore */;
++  /* CWBackPixel */
++  xswamask = CWBackPixmap | CWBorderPixel | CWColormap /* | CWBackingStore */;
+   if (!clearonload) xswamask |= CWBitGravity;
+ 
+   if (mainW) {
Index: pkgsrc/graphics/xv/patches/patch-xvevent.c
diff -u pkgsrc/graphics/xv/patches/patch-xvevent.c:1.1 pkgsrc/graphics/xv/patches/patch-xvevent.c:1.2
--- pkgsrc/graphics/xv/patches/patch-xvevent.c:1.1      Sun Jul 30 07:55:45 2023
+++ pkgsrc/graphics/xv/patches/patch-xvevent.c  Sat Apr 19 23:14:24 2025
@@ -1,12 +1,25 @@
-$NetBSD: patch-xvevent.c,v 1.1 2023/07/30 07:55:45 tsutsui Exp $
+$NetBSD: patch-xvevent.c,v 1.2 2025/04/19 23:14:24 tsutsui Exp $
 
 - add webp support using pkgsrc libwebp, from forked upstream
   https://gitlab.com/DavidGriffith/xv/-/commit/5682a07e
  - a pasto of a comment is also fixed
+- pull XRandR support from forked upstream
+  https://gitlab.com/DavidGriffith/xv/-/commit/a84406cb
 
---- xvevent.c.orig     2023-07-30 04:38:20.332206971 +0000
+--- xvevent.c.orig     2025-04-19 21:39:44.233828504 +0000
 +++ xvevent.c
-@@ -212,6 +212,9 @@ int HandleEvent(event, donep)
+@@ -74,6 +74,10 @@ static void   annotatePic      PARM((voi
+ static int    debkludge_offx;
+ static int    debkludge_offy;
+ 
++#ifdef HAVE_XRR
++int RRevent_number = -1, RRerror_number = -1;
++#endif
++
+ /****************/
+ int EventLoop()
+ /****************/
+@@ -212,6 +216,9 @@ int HandleEvent(event, donep)
  #ifdef HAVE_PNG
    static int wasPngUp=0;
  #endif
@@ -16,7 +29,18 @@ $NetBSD: patch-xvevent.c,v 1.1 2023/07/3
  #ifdef HAVE_PCD
    static int wasPcdUp=0;
  #endif
-@@ -307,6 +310,10 @@ int HandleEvent(event, donep)
+@@ -221,6 +228,10 @@ int HandleEvent(event, donep)
+ #ifdef HAVE_MGCSFX
+   static int wasMgcSfxUp=0;
+ #endif
++#ifdef HAVE_XRR
++  int screen;
++  XRRScreenChangeNotifyEvent *xrr_event;
++#endif
+ 
+   static int mainWKludge=0;  /* force first mainW expose after a mainW config
+                               to redraw all of mainW */
+@@ -307,6 +318,10 @@ int HandleEvent(event, donep)
      if (PNGCheckEvent (event)) break;   /* event has been processed */
  #endif
  
@@ -27,7 +51,7 @@ $NetBSD: patch-xvevent.c,v 1.1 2023/07/3
      if (PCDCheckEvent(event)) break;    /* event has been processed */
  
  #ifdef HAVE_PIC2
-@@ -462,6 +469,10 @@ int HandleEvent(event, donep)
+@@ -462,6 +477,10 @@ int HandleEvent(event, donep)
        else if (client_event->window == pngW)  PNGDialog(0);
  #endif
  
@@ -38,7 +62,7 @@ $NetBSD: patch-xvevent.c,v 1.1 2023/07/3
        else if (client_event->window == pcdW)  PCDDialog(0);
  
  #ifdef HAVE_PIC2
-@@ -664,6 +675,9 @@ int HandleEvent(event, donep)
+@@ -664,6 +683,9 @@ int HandleEvent(event, donep)
  #ifdef HAVE_PNG
        if (wasPngUp)  { PNGDialog(wasPngUp);    wasPngUp=0; }
  #endif
@@ -48,7 +72,7 @@ $NetBSD: patch-xvevent.c,v 1.1 2023/07/3
  #ifdef HAVE_PCD
        if (wasPcdUp)  { PCDDialog(wasPcdUp);    wasPcdUp=0; }
  #endif
-@@ -716,6 +730,9 @@ int HandleEvent(event, donep)
+@@ -716,6 +738,9 @@ int HandleEvent(event, donep)
  #ifdef HAVE_PNG
          if (pngUp)  { wasPngUp  = pngUp;   PNGDialog(0); }
  #endif
@@ -58,7 +82,34 @@ $NetBSD: patch-xvevent.c,v 1.1 2023/07/3
  #ifdef HAVE_PCD
          if (pcdUp)  { wasPcdUp = pcdUp;    PCDDialog(0); }
  #endif
-@@ -1338,6 +1355,10 @@ static void handleButtonEvent(event, don
+@@ -904,11 +929,24 @@ int HandleEvent(event, donep)
+     }
+     break;
+ 
+-
+-
+   default: break;             /* ignore unexpected events */
+   }  /* switch */
+ 
++#ifdef HAVE_XRR
++  if (event->type == RRevent_number + RRScreenChangeNotify) {
++    XRRUpdateConfiguration(event);
++    XSync (theDisp, False);
++    xrr_event = (XRRScreenChangeNotifyEvent *)event;
++
++    screen = XRRRootToScreen(theDisp, xrr_event->window);
++
++    dispWIDE = DisplayWidth(theDisp, screen);
++    dispHIGH = DisplayHeight(theDisp, screen);
++    maxWIDE = vrWIDE = dispWIDE;  maxHIGH = vrHIGH = dispHIGH;
++    HandleDispMode();
++  }
++#endif
++
+   frominterrupt = 0;
+   *donep = done;
+   return(retval);
+@@ -1338,6 +1376,10 @@ static void handleButtonEvent(event, don
      if (PNGCheckEvent (event)) break;
  #endif
  
@@ -69,7 +120,7 @@ $NetBSD: patch-xvevent.c,v 1.1 2023/07/3
  #ifdef HAVE_PCD
      if (PCDCheckEvent (event)) break; /* event has been processed */
  #endif
-@@ -1621,6 +1642,10 @@ static void handleKeyEvent(event, donep,
+@@ -1621,6 +1663,10 @@ static void handleKeyEvent(event, donep,
      if (PNGCheckEvent (event)) break;
  #endif
  
@@ -80,7 +131,7 @@ $NetBSD: patch-xvevent.c,v 1.1 2023/07/3
      if (PCDCheckEvent (event)) break;
  
  #ifdef HAVE_PIC2
-@@ -2704,6 +2729,10 @@ static void onInterrupt(i)
+@@ -2704,6 +2750,10 @@ static void onInterrupt(i)
    if (pngUp) PNGDialog(0);    /* close png window */
  #endif
  

Index: pkgsrc/graphics/xv/patches/patch-xv.h
diff -u pkgsrc/graphics/xv/patches/patch-xv.h:1.2 pkgsrc/graphics/xv/patches/patch-xv.h:1.3
--- pkgsrc/graphics/xv/patches/patch-xv.h:1.2   Sun Jul 30 07:55:45 2023
+++ pkgsrc/graphics/xv/patches/patch-xv.h       Sat Apr 19 23:14:24 2025
@@ -1,12 +1,14 @@
-$NetBSD: patch-xv.h,v 1.2 2023/07/30 07:55:45 tsutsui Exp $
+$NetBSD: patch-xv.h,v 1.3 2025/04/19 23:14:24 tsutsui Exp $
 
 - don't declare errno and sys_errlist
 - use strerror
 - use getcwd, not getwd
 - add webp support from forked upstream
   https://gitlab.com/DavidGriffith/xv/-/commit/5682a07e
+- pull XRandR support from forked upstream
+  https://gitlab.com/DavidGriffith/xv/-/commit/a84406cb
 
---- xv.h.orig  2023-07-30 04:38:20.907901851 +0000
+--- xv.h.orig  2025-04-19 21:39:44.640689781 +0000
 +++ xv.h
 @@ -139,9 +139,7 @@
  #endif
@@ -48,7 +50,19 @@ $NetBSD: patch-xv.h,v 1.2 2023/07/30 07:
  #  endif
  #endif
  
-@@ -392,7 +392,7 @@
+@@ -222,6 +222,11 @@
+ #include <X11/Xatom.h>
+ #include <X11/Xmd.h>
+ 
++#ifdef HAVE_XRR
++#include <X11/Xproto.h>
++#include <X11/extensions/Xrandr.h>
++#endif
++
+ #ifdef TV_L10N
+ #  include <X11/Xlocale.h>
+ #endif
+@@ -392,7 +397,7 @@
  #  endif
  #endif
  
@@ -57,7 +71,7 @@ $NetBSD: patch-xv.h,v 1.2 2023/07/30 07:
  #  define USE_GETCWD
  #endif
  
-@@ -411,6 +411,9 @@
+@@ -411,6 +416,9 @@
  /* END OF CONFIGURATION INFO */
  /*****************************/
  
@@ -67,7 +81,7 @@ $NetBSD: patch-xv.h,v 1.2 2023/07/30 07:
  
  #ifdef DOJPEG
  #  define HAVE_JPEG
-@@ -568,6 +571,12 @@
+@@ -568,6 +576,12 @@
  #  define F_TIFINC  0
  #endif
  
@@ -80,7 +94,7 @@ $NetBSD: patch-xv.h,v 1.2 2023/07/30 07:
  #ifdef HAVE_PNG
  #  define F_PNGINC  1
  #else
-@@ -621,7 +630,8 @@
+@@ -621,7 +635,8 @@
  #define F_JPC       ( 0 + F_PNGINC + F_JPGINC)
  #define F_JP2       ( 0 + F_PNGINC + F_JPGINC + F_JP2INC)
  #define F_GIF       ( 0 + F_PNGINC + F_JPGINC + F_JP2INC + F_JP2INC)  /* always avail; index varies */
@@ -90,7 +104,7 @@ $NetBSD: patch-xv.h,v 1.2 2023/07/30 07:
  #define F_PS        ( 1 + F_TIFF)
  #define F_PBMRAW    ( 2 + F_TIFF)
  #define F_PBMASCII  ( 3 + F_TIFF)
-@@ -691,6 +701,7 @@
+@@ -691,6 +706,7 @@
  #define RFT_PI       (JP_EXT_RFT + 4)
  #define RFT_PIC2     (JP_EXT_RFT + 5)
  #define RFT_MGCSFX   (JP_EXT_RFT + 6)
@@ -98,7 +112,7 @@ $NetBSD: patch-xv.h,v 1.2 2023/07/30 07:
  
  /* definitions for page up/down, arrow up/down list control */
  #define LS_PAGEUP   0
-@@ -1404,6 +1415,11 @@ WHERE Window        pngW;
+@@ -1404,6 +1420,11 @@ WHERE Window        pngW;
  WHERE int           pngUp;        /* is pngW mapped, or what? */
  #endif
  
@@ -110,7 +124,7 @@ $NetBSD: patch-xv.h,v 1.2 2023/07/30 07:
  
  #ifdef ENABLE_FIXPIX_SMOOTH
  WHERE int           do_fixpix_smooth;  /* GRR 19980607: runtime FS dithering */
-@@ -2094,6 +2110,14 @@ int LoadSunRas             PARM((char *,
+@@ -2094,6 +2115,14 @@ int LoadSunRas             PARM((char *,
  int WriteSunRas            PARM((FILE *, byte *, int, int, int, byte *,
                                 byte *, byte*, int, int, int));
  

Added files:

Index: pkgsrc/graphics/xv/patches/patch-xvbmp.c
diff -u /dev/null pkgsrc/graphics/xv/patches/patch-xvbmp.c:1.1
--- /dev/null   Sat Apr 19 23:14:24 2025
+++ pkgsrc/graphics/xv/patches/patch-xvbmp.c    Sat Apr 19 23:14:24 2025
@@ -0,0 +1,46 @@
+$NetBSD: patch-xvbmp.c,v 1.1 2025/04/19 23:14:24 tsutsui Exp $
+
+- Pull fixes from https://gitlab.com/DavidGriffith/xv
+ - https://gitlab.com/DavidGriffith/xv/-/commit/60a25db1
+   > Updated xvbmp.c to support reading the three newer versions of BMP format.
+
+--- xvbmp.c.orig       2025-04-19 20:57:51.312309284 +0000
++++ xvbmp.c
+@@ -27,8 +27,11 @@
+ #define BI_PNG       5   /* BMP version 5 (not yet supported) */
+ 
+ #define WIN_OS2_OLD 12
+-#define WIN_NEW     40
+ #define OS2_NEW     64
++#define WIN_3X      40
++#define WIN_95_NT4  108
++#define WIN_98_2K   124
++#define WIN_NT_2K   128
+ 
+ #if (defined(UINT_MAX) && UINT_MAX != 0xffffffffU)
+ #  error XV's BMP code requires 32-bit unsigned integer type, but u_int isn't
+@@ -95,7 +98,8 @@ int LoadBMP(fname, pinfo)
+ 
+   biSize          = getint(fp);
+ 
+-  if (biSize == WIN_NEW || biSize == OS2_NEW) {
++  if (biSize == WIN_3X || biSize == OS2_NEW ||
++      biSize == WIN_95_NT4 || biSize == WIN_98_2K || biSize == WIN_NT_2K) {
+     biWidth         = getint(fp);
+     biHeight        = getint(fp);
+     biPlanes        = getshort(fp);
+@@ -315,8 +319,12 @@ int LoadBMP(fname, pinfo)
+   pinfo->colType = F_FULLCOLOR;
+ 
+   sprintf(pinfo->fullInfo, "%sBMP, %d bit%s per pixel%s.  (%ld bytes)",
+-        ((biSize==WIN_OS2_OLD) ? "Old OS/2 " :
+-         (biSize==WIN_NEW)     ? "Windows "  : ""),
++        ((biSize==WIN_OS2_OLD) ? "OS/2 1.x " :
++         (biSize==OS2_NEW)     ? "OS/2 2.x " :
++         (biSize==WIN_3X)      ? "Windows 3.x "  :
++         (biSize==WIN_95_NT4)  ? "Windows 95/NT4 " :
++         (biSize==WIN_98_2K)   ? "Windows 98/2000" :
++         (biSize==WIN_NT_2K)   ? "Windows NT/2000 " : ""),
+         biBitCount,  (biBitCount == 1) ? "" : "s",
+         cmpstr, filesize);
+ 
Index: pkgsrc/graphics/xv/patches/patch-xvsmooth.c
diff -u /dev/null pkgsrc/graphics/xv/patches/patch-xvsmooth.c:1.1
--- /dev/null   Sat Apr 19 23:14:24 2025
+++ pkgsrc/graphics/xv/patches/patch-xvsmooth.c Sat Apr 19 23:14:24 2025
@@ -0,0 +1,89 @@
+$NetBSD: patch-xvsmooth.c,v 1.1 2025/04/19 23:14:24 tsutsui Exp $
+
+- Pull fixes from https://gitlab.com/DavidGriffith/xv
+ - https://gitlab.com/DavidGriffith/xv/-/commit/b91710b5
+   > Fix off-by-one's resulting in dereferencing out-of-bound memory.
+ - https://gitlab.com/DavidGriffith/xv/-/commit/72c80bff
+   > Fix off-by-one in smoothing code and use better interpolation/rounding.
+
+--- xvsmooth.c.orig    2025-04-19 20:44:26.706721543 +0000
++++ xvsmooth.c
+@@ -254,7 +254,7 @@ int   is24, swide, shigh, dwide, dhigh;
+   bperpix = (is24) ? 3 : 1;
+ 
+   for (j=0; j<=swide; j++)
+-    pixarr[j] = (j*dwide + (15*swide)/16) / swide;
++    pixarr[j] = ((2 * j + 1 ) * dwide) / ( 2 * swide);
+ 
+   cptr = pic824;  cptr1 = cptr + swide * bperpix;
+ 
+@@ -369,26 +369,12 @@ int   is24, swide, shigh, dwide, dhigh;
+ 
+   lastline = linecnt = 0;
+ 
+-  for (i=0, clptr=pic824; i<=shigh; i++, clptr+=swide*bperpix) {
++  for (i=0, clptr=pic824; i<shigh; i++, clptr+=swide*bperpix) {
+     ProgressMeter(0, shigh, i, "Smooth");
+     if ((i&15) == 0) WaitCursor();
+ 
+     thisline = (i * dhigh + (15*shigh)/16) / shigh;
+ 
+-    if (thisline != lastline) {  /* copy a line to pic24 */
+-      for (j=0; j<dwide; j++) {
+-      *pic24++ = lbufR[j] / linecnt;
+-      *pic24++ = lbufG[j] / linecnt;
+-      *pic24++ = lbufB[j] / linecnt;
+-      }
+-
+-      xvbzero( (char *) lbufR, dwide * sizeof(int));  /* clear out line bufs */
+-      xvbzero( (char *) lbufG, dwide * sizeof(int));
+-      xvbzero( (char *) lbufB, dwide * sizeof(int));
+-      linecnt = 0;  lastline = thisline;
+-    }
+-
+-
+     for (j=0, cxptr=cxarr; j<dwide; j++, cxptr++) {
+       cptr  = clptr + *cxptr * bperpix;
+       if (*cxptr < swide-1) cptr1 = cptr + 1*bperpix;
+@@ -407,6 +393,21 @@ int   is24, swide, shigh, dwide, dhigh;
+     }
+ 
+     linecnt++;
++
++    thisline = ((2 * i + 3) * dhigh) / (2 * shigh);
++
++    if (thisline != lastline) {  /* copy a line to pic24 */
++      for (j=0; j<dwide; j++) {
++       *pic24++ = lbufR[j] / linecnt;
++       *pic24++ = lbufG[j] / linecnt;
++       *pic24++ = lbufB[j] / linecnt;
++      }
++
++      xvbzero( (char *) lbufR, dwide * sizeof(int));  /* clear out line bufs */
++      xvbzero( (char *) lbufG, dwide * sizeof(int));
++      xvbzero( (char *) lbufB, dwide * sizeof(int));
++      linecnt = 0;  lastline = thisline;
++    }
+   }
+ 
+ 
+@@ -463,16 +464,16 @@ int   is24, swide, shigh, dwide, dhigh;
+   bperpix = (is24) ? 3 : 1;
+ 
+   for (j=0; j<=swide; j++)
+-    pixarr[j] = (j*dwide + (15*swide)/16) / swide;
++    pixarr[j] = ((2 * j + 1) * dwide) / (2 * swide);
+ 
+   lastline = linecnt = pixR = pixG = pixB = 0;
+   cptr = pic824;
+ 
+-  for (i=0; i<=shigh; i++) {
++  for (i=0; i<shigh; i++) {
+     ProgressMeter(0, shigh, i, "Smooth");
+     if ((i&15) == 0) WaitCursor();
+ 
+-    thisline = (i * dhigh + (15*shigh)/16 ) / shigh;
++    thisline = ((2 * i + 1) * dhigh) / (2 * shigh);
+ 
+     if ((thisline != lastline)) {      /* copy a line to pic24 */
+       pixR = pixG = pixB = pixcnt = lastpix = 0;



Home | Main Index | Thread Index | Old Index