summaryrefslogtreecommitdiff
path: root/graphics/xv/patches/patch-am
blob: 11eab1f68d48e8d58e97c6fc4790dc2df7fc8a4e (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
$NetBSD: patch-am,v 1.2 2004/03/29 00:50:41 dillo Exp $

This patch is based on
http://www.mit.edu/afs/athena/contrib/graphics/src/xv/patches/png/xvpng.diff
It was edited to fit into the NetBSD Packages Collection! - HF

It is also based on
ftp://ftp.trilon.com/pub/xv/patches/longname.patch
---------------------------------------------------------------------------


--- xvbrowse.c.orig	Sun Mar 21 21:27:18 2004
+++ xvbrowse.c
@@ -61,6 +61,7 @@ typedef unsigned int mode_t;  /* file mo
 #include "bits/br_pic"
 #include "bits/br_pi"
 #include "bits/br_pic2"
+#include "bits/br_png"
 
 #include "bits/br_trash"
 #include "bits/fcurs"
@@ -106,7 +107,8 @@ typedef unsigned int mode_t;  /* file mo
 #define BF_PI       31
 #define BF_PIC2     32
 #define BF_PCD      33
-#define BF_MAX      34    /* # of built-in icons */
+#define BF_PNG      34
+#define BF_MAX      35    /* # of built-in icons */
 
 #define ISLOADABLE(ftyp) (ftyp!=BF_DIR  && ftyp!=BF_CHR && ftyp!=BF_BLK && \
 			  ftyp!=BF_SOCK && ftyp!=BF_FIFO) 
@@ -543,6 +545,7 @@ void CreateBrowse(geom, fgstr, bgstr, hi
   bfIcons[BF_PI]  = MakePix1(br->win,br_pi_bits,br_pi_width,br_pi_height);
   bfIcons[BF_PIC2]=MakePix1(br->win,br_pic2_bits,br_pic2_width,br_pic2_height);
   bfIcons[BF_PCD] = MakePix1(br->win,br_pcd_bits,br_pcd_width,br_pcd_height);
+  bfIcons[BF_PNG]=MakePix1(br->win,br_png_bits,br_png_width,br_png_height);
 
 
   /* check that they all got built */
@@ -1509,6 +1512,7 @@ static void drawIcon(br, num)
   if (StringWidth(str) > ISPACE_WIDE-6) {
     int dotpos; 
     strncpy(tmpstr, str, (size_t) 56);
+    tmpstr[56] = '\0';
     dotpos = strlen(tmpstr);
     strcat(tmpstr,"...");
 
@@ -3045,6 +3049,7 @@ static void scanFile(br, bf, name)
     case RFT_PI:       bf->ftype = BF_PI;       break;
     case RFT_PIC2:     bf->ftype = BF_PIC2;     break;
     case RFT_PCD:      bf->ftype = BF_PCD;      break;
+    case RFT_PNG:      bf->ftype = BF_PNG;      break;
     }
   }
 }
@@ -3612,6 +3617,7 @@ static void genIcon(br, bf)
   case RFT_PI:       strcat(str,"PI file");               break;
   case RFT_PIC2:     strcat(str,"PIC2 file");             break;
   case RFT_PCD:      strcat(str,"PhotoCD file");          break;
+  case RFT_PNG:      strcat(str,"PNG file");              break;
   default:           strcat(str,"file of unknown type");  break;
   }