Browse Source

Dimitar Zhekov <jimmy@is-vn.bg>

Upgrade zgv to 5.7 and remove the obsolete patches.
Add some (svgalib-1.9.x or simply missing?) modes.
Change mouse calculations a bit to avoid int trunc.



git-svn-id: http://www.rocklinux.org/svn/rock-linux/trunk@1053 c5f82cb5-29bc-0310-9cd0-bff59a50e3bc
rocklinux
Rene Rebe 21 years ago
parent
commit
4dd0365f3f
6 changed files with 137 additions and 174 deletions
  1. +2
    -1
      Documentation/Developers/CHANGELOG-RENE
  2. +67
    -0
      package/jimmy/zgv/more-modes.patch
  3. +65
    -0
      package/jimmy/zgv/mousexy-fix.patch
  4. +0
    -169
      package/jimmy/zgv/pre-5.7-stuff.patch
  5. +1
    -2
      package/jimmy/zgv/zgv.conf
  6. +2
    -2
      package/jimmy/zgv/zgv.desc

+ 2
- 1
Documentation/Developers/CHANGELOG-RENE

@ -4,7 +4,8 @@ whole rxr-tree.
*) 2003-08-14 (2.0.0-camp - 2.0.0-rc1)
- Dimitar Zhekov: fontconfig.pc ownership fix and sysfiles cosmetics
- Dimitar Zhekov: fontconfig.pc ownership fix, sysfiles cosmetics and
updated zgv
*) 2003-08-12 (2.0.0-camp - 2.0.0-rc1)

+ 67
- 0
package/jimmy/zgv/more-modes.patch

@ -0,0 +1,67 @@
--- ./src/modesel.c.orig 2003-04-05 17:41:04.000000000 +0300
+++ ./src/modesel.c 2003-08-09 14:06:55.000000000 +0300
@@ -28,8 +28,12 @@
{ G360x480x256, 360,480,8,1, RK_NO_KEY, 0,'8' },
/* SVGA 8-bit modes */
+ { G400x300x256, 400,300,8,1, RK_NO_KEY, 0,RK_NO_KEY },
+ { G512x384x256, 512,384,8,1, RK_NO_KEY, 0,RK_NO_KEY },
{ G640x480x256, 640,480,8,1, RK_F1, 0,RK_F1 },
+ { G720x540x256, 720,540,8,1, RK_NO_KEY, 0,RK_NO_KEY },
{ G800x600x256, 800,600,8,1, RK_F2, 0,RK_F2 },
+ { G960x720x256, 960,720,8,1, RK_NO_KEY, 0,RK_NO_KEY },
{ G1024x768x256, 1024,768,8,1, RK_F3, 0,RK_F3 },
{ G1280x1024x256, 1280,1024,8,1, RK_F4, 0,RK_F4 },
{ G1152x864x256, 1152,864,8,1, RK_NO_KEY, 1,RK_F2 },
@@ -38,8 +42,12 @@
/* SVGA 15-bit modes */
{ G320x200x32K, 320,200,15,2, RK_NO_KEY, 0,RK_F5 },
{ G320x240x32K, 320,240,15,2, RK_NO_KEY, 0,RK_NO_KEY },
+ { G400x300x32K, 400,300,15,2, RK_NO_KEY, 0,RK_NO_KEY },
+ { G512x384x32K, 512,384,15,2, RK_NO_KEY, 0,RK_NO_KEY },
{ G640x480x32K, 640,480,15,2, RK_NO_KEY, 0,RK_F8 },
+ { G720x540x32K, 720,540,15,2, RK_NO_KEY, 0,RK_NO_KEY },
{ G800x600x32K, 800,600,15,2, RK_NO_KEY, 0,RK_SHIFT_F1 },
+ { G960x720x32K, 960,720,15,2, RK_NO_KEY, 0,RK_NO_KEY },
{ G1024x768x32K, 1024,768,15,2, RK_NO_KEY, 0,RK_SHIFT_F4 },
{ G1280x1024x32K, 1280,1024,15,2, RK_NO_KEY, 0,RK_SHIFT_F7 },
{ G1152x864x32K, 1152,864,15,2, RK_NO_KEY, 1,RK_F3 },
@@ -48,8 +56,12 @@
/* SVGA 16-bit modes */
{ G320x200x64K, 320,200,16,2, RK_NO_KEY, 0,RK_F6 },
{ G320x240x64K, 320,240,16,2, RK_NO_KEY, 0,RK_NO_KEY },
+ { G400x300x64K, 400,300,16,2, RK_NO_KEY, 0,RK_NO_KEY },
+ { G512x384x64K, 512,384,16,2, RK_NO_KEY, 0,RK_NO_KEY },
{ G640x480x64K, 640,480,16,2, RK_NO_KEY, 0,RK_F9 },
+ { G720x540x64K, 720,540,16,2, RK_NO_KEY, 0,RK_NO_KEY },
{ G800x600x64K, 800,600,16,2, RK_NO_KEY, 0,RK_SHIFT_F2 },
+ { G960x720x64K, 960,720,16,2, RK_NO_KEY, 0,RK_NO_KEY },
{ G1024x768x64K, 1024,768,16,2, RK_NO_KEY, 0,RK_SHIFT_F5 },
{ G1280x1024x64K, 1280,1024,16,2, RK_NO_KEY, 0,RK_SHIFT_F8 },
{ G1152x864x64K, 1152,864,16,2, RK_NO_KEY, 1,RK_F4 },
@@ -64,8 +76,12 @@
*/
{ G320x200x16M32, 320,200,24,4, RK_NO_KEY, 0,RK_F7 },
{ G320x240x16M32, 320,240,24,4, RK_NO_KEY, 0,'^' },
+ { G400x300x16M32, 400,300,24,4, RK_NO_KEY, 0,RK_NO_KEY },
+ { G512x384x16M32, 512,384,24,4, RK_NO_KEY, 0,RK_NO_KEY },
{ G640x480x16M32, 640,480,24,4, RK_NO_KEY, 0,RK_F10 },
+ { G720x540x16M32, 720,540,24,4, RK_NO_KEY, 0,RK_NO_KEY },
{ G800x600x16M32, 800,600,24,4, RK_NO_KEY, 0,RK_SHIFT_F3 },
+ { G960x720x16M32, 960,720,24,4, RK_NO_KEY, 0,RK_NO_KEY },
{ G1024x768x16M32, 1024,768,24,4, RK_NO_KEY, 0,RK_SHIFT_F6 },
{ G1280x1024x16M32, 1280,1024,24,4, RK_NO_KEY, 1,RK_F1 },
{ G1152x864x16M32, 1152,864,24,4, RK_NO_KEY, 1,RK_F5 },
@@ -79,8 +95,12 @@
*/
{ G320x200x16M, 320,200,24,3, RK_NO_KEY, 0,RK_F7 },
{ G320x240x16M, 320,240,24,3, RK_NO_KEY, 0,'^' },
+ { G400x300x16M, 400,300,24,3, RK_NO_KEY, 0,RK_NO_KEY },
+ { G512x384x16M, 512,384,24,3, RK_NO_KEY, 0,RK_NO_KEY },
{ G640x480x16M, 640,480,24,3, RK_NO_KEY, 0,RK_F10 },
+ { G720x540x16M, 720,540,24,3, RK_NO_KEY, 0,RK_NO_KEY },
{ G800x600x16M, 800,600,24,3, RK_NO_KEY, 0,RK_SHIFT_F3 },
+ { G960x720x16M, 960,720,24,3, RK_NO_KEY, 0,RK_NO_KEY },
{ G1024x768x16M, 1024,768,24,3, RK_NO_KEY, 0,RK_SHIFT_F6 },
{ G1280x1024x16M, 1280,1024,24,3, RK_NO_KEY, 1,RK_F1 },
{ G1152x864x16M, 1152,864,24,3, RK_NO_KEY, 1,RK_F5 },

+ 65
- 0
package/jimmy/zgv/mousexy-fix.patch

@ -0,0 +1,65 @@
--- ./src/readnbkey.c.orig 2003-04-05 16:40:39.000000000 +0300
+++ ./src/readnbkey.c 2003-08-10 12:27:23.000000000 +0300
@@ -62,7 +62,7 @@
/* saved mx/my in in range 0..MPOS_SAVE_MAX. */
-#define MPOS_SAVE_MAX 16383
+#define MPOS_SAVE_MAX 16383.0
static int old_click_status=0,new_click_status=0;
@@ -276,7 +276,8 @@
}
-static int saved_mx=0,saved_my=0;
+/* All save/restore calculations are done in float to avoid int truncating. */
+static float saved_mx=0.0,saved_my=0.0;
/* save mouse pointer's current position. used when switching over
* to the panning-follows-mouse model used by vgadisp.c, so that on
@@ -288,7 +289,7 @@
*/
void save_mouse_pos()
{
-int mx,my;
+float mx,my;
if(!has_mouse) return;
@@ -297,13 +298,13 @@
*/
if(vga_getcurrentmode()==TEXT)
{
- mx=MPOS_SAVE_MAX/2;
- my=MPOS_SAVE_MAX/2;
+ mx=MPOS_SAVE_MAX/2.0;
+ my=MPOS_SAVE_MAX/2.0;
}
else
{
- mx=(mouse_getx()*MPOS_SAVE_MAX)/(vga_getxdim()-1);
- my=(mouse_gety()*MPOS_SAVE_MAX)/(vga_getydim()-1);
+ mx=(mouse_getx()*MPOS_SAVE_MAX)/(vga_getxdim()-1.0);
+ my=(mouse_gety()*MPOS_SAVE_MAX)/(vga_getydim()-1.0);
}
/* just in case */
if(mx>MPOS_SAVE_MAX) mx=MPOS_SAVE_MAX;
@@ -323,12 +324,13 @@
/* restore saved pos assuming given size screen */
void restore_mouse_pos_with_size(int width,int height)
{
-int mx,my;
+extern float roundf(float x); /* may be missing from math.h, must be declared */
+float mx,my;
if(!has_mouse) return;
-mx=(saved_mx*(width-1))/MPOS_SAVE_MAX;
-my=(saved_my*(height-1))/MPOS_SAVE_MAX;
+mx=roundf((saved_mx*(width-1.0))/MPOS_SAVE_MAX);
+my=roundf((saved_my*(height-1.0))/MPOS_SAVE_MAX);
/* just in case */
if(mx>width-1) mx=width-1;
if(my>height-1) my=height-1;

+ 0
- 169
package/jimmy/zgv/pre-5.7-stuff.patch

@ -1,169 +0,0 @@
# --- ROCK-COPYRIGHT-NOTE-BEGIN ---
#
# This copyright note is auto-generated by ./scripts/Create-CopyPatch.
# Please add additional copyright information _after_ the line containing
# the ROCK-COPYRIGHT-NOTE-END tag. Otherwise it might get removed by
# the ./scripts/Create-CopyPatch script. Do not edit this copyright text!
#
# ROCK Linux: rock-src/package/jimmy/zgv/pre-5.7-stuff.patch
# ROCK Linux is Copyright (C) 1998 - 2003 Clifford Wolf
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or
# (at your option) any later version. A copy of the GNU General Public
# License can be found at Documentation/COPYING.
#
# Many people helped and are helping developing ROCK Linux. Please
# have a look at http://www.rocklinux.org/ and the Documentation/TEAM
# file for details.
#
# --- ROCK-COPYRIGHT-NOTE-END ---
--- ./doc/makeman.awk.orig 2001-09-20 21:59:49.000000000 +0300
+++ ./doc/makeman.awk 2003-07-12 13:59:13.000000000 +0300
@@ -216,7 +216,7 @@
{
$0=gensub(/^@itemx?[[:blank:]]+(.*)/, \
(first_item[table_lvl]?"":".RE\n") \
- table_type[table_lvl] "{\\1}\n.RS", 0)
+ table_type[table_lvl] "{\\1}\n.RS", 1)
}
first_item[table_lvl]=0
@@ -290,8 +290,8 @@
# @value
while(/@value\{/)
{
- valname=gensub(/.*@value\{([^}]+)\}.*/, "\\1", 0, para)
- para=gensub(/@value\{([^}]+)\}/, var_value[valname], 0, para)
+ valname=gensub(/.*@value\{([^}]+)\}.*/, "\\1", 1, para)
+ para=gensub(/@value\{([^}]+)\}/, var_value[valname], 1, para)
}
# @{samp,file,var,cite,emph} -> italic
--- ./doc/zgv.texi.orig 2002-05-05 04:06:54.000000000 +0300
+++ ./doc/zgv.texi 2003-07-12 13:59:13.000000000 +0300
@@ -387,6 +387,14 @@
If disabled, don't prompt for confirmation when deleting all tagged
files.
+@vindex auto-mode-fit-diff
+@item --auto-mode-fit-diff @var{delta_val}
+When choosing an auto-mode-fit mode, add delta to each mode's width and
+height. For example, with a delta of 20 any picture up to 820x620 will
+be displayed in an 800x600 mode if possible. If delta is negative, for
+example -20, the effect is reverse: any picture above 780x580 will be
+displayed in a mode with a resolution higher than 800x600 if possible.
+
@vindex dither-16col-fast
@item --dither-16col-fast
(Normally enabled, use @code{--dither-16col-fast=off} to disable.) By
--- ./src/mousecur.c.orig 1999-06-28 19:04:11.000000000 +0300
+++ ./src/mousecur.c 2003-07-12 13:59:13.000000000 +0300
@@ -37,9 +37,9 @@
#define MOUSECUR_YSIZE 16
#define MOUSECUR_PIXMAP_SIZE (MOUSECUR_XSIZE*MOUSECUR_YSIZE)
-/* next two pixmaps are *3 as must be able to handle up to 24-bit modes */
-static unsigned char mouseptr_save[MOUSECUR_PIXMAP_SIZE*3];
-static unsigned char mouseptr_pixmap[MOUSECUR_PIXMAP_SIZE*3];
+/* next two pixmaps are *4 as must be able to handle up to 32-bpp modes */
+static unsigned char mouseptr_save[MOUSECUR_PIXMAP_SIZE*4];
+static unsigned char mouseptr_pixmap[MOUSECUR_PIXMAP_SIZE*4];
static unsigned char mouseptr_pixmap_orig[MOUSECUR_PIXMAP_SIZE]=
{
/* 1 is black, 2 is white, 0 is transparent */
@@ -94,15 +94,7 @@
if(!has_mouse) return;
-switch(cols)
- {
- case 16777216:
- screen_bytepp=3; break;
- case 65536: case 32768:
- screen_bytepp=2; break;
- default:
- screen_bytepp=1;
- }
+screen_bytepp=vga_getmodeinfo(mode)->bytesperpixel;
screen_width =vga_getxdim();
screen_height=vga_getydim();
@@ -139,6 +131,12 @@
switch(screen_bytepp)
{
+ case 4:
+ mouseptr_pixmap[f*4 ]=(val&255);
+ mouseptr_pixmap[f*4+1]=(val>>8);
+ mouseptr_pixmap[f*4+2]=(val>>16);
+ mouseptr_pixmap[f*4+3]=0;
+ break;
case 3:
mouseptr_pixmap[f*3 ]=(val&255);
mouseptr_pixmap[f*3+1]=(val>>8);
@@ -175,7 +173,7 @@
/* we need to save existing data, then draw the mouse. */
if(usegl)
{
- /* gl-using 8/15/16/24-bit version */
+ /* gl-using 8/15/16/24/32-bpp version */
gl_getbox(savex,savey,savew,saveh,mouseptr_save);
/* since there's no gl_putboxpartmask, and clipping doesn't work for
* gl_putboxmask, we have to do either masking or clipping ourselves.
--- ./src/options.src.orig 2002-04-07 04:34:12.000000000 +0300
+++ ./src/options.src 2003-07-12 13:59:13.000000000 +0300
@@ -57,6 +57,7 @@
"contrast" 0 1 1 REQ_ARG get_double &cfg.contrast
"delete-single-prompt" 0 1 1 OPT_ARG get_bool_and_inv &cfg.nodelprompt
"delete-tagged-prompt" 0 1 1 OPT_ARG get_bool_and_inv &cfg.nodelprompt_tagged
+"auto-mode-fit-diff" 0 1 1 REQ_ARG get_int &cfg.deltamodefit
"dither-16col-fast" 0 1 1 OPT_ARG get_bool &cfg.fastdither16col
"fake-cols" 0 1 1 OPT_ARG get_bool &cfg.fakecols
"force-fs-16col" 0 1 1 OPT_ARG get_bool &cfg.force16fs
--- ./src/rc_config.h.orig 2002-04-07 04:33:25.000000000 +0300
+++ ./src/rc_config.h 2003-07-12 13:59:13.000000000 +0300
@@ -37,6 +37,7 @@
int bc_order_rev;
int xzgvkeys;
int automodefit;
+ int deltamodefit;
double initial_picgamma;
int fsmagic;
int black_bg;
--- ./src/rcfile.c.orig 2002-04-07 04:34:58.000000000 +0300
+++ ./src/rcfile.c 2003-07-12 13:59:13.000000000 +0300
@@ -240,6 +243,7 @@
cfg.bc_order_rev=0;
cfg.xzgvkeys=0;
cfg.automodefit=0;
+cfg.deltamodefit=0;
cfg.initial_picgamma=1.0;
cfg.fsmagic=0;
cfg.black_bg=0;
@@ -676,6 +680,9 @@
" (normally enabled, use --delete-tagged-prompt=off to\n"
" disable) if *disabled*, don't prompt for confirmation\n"
" when deleting tagged files (with `D').\n"
+" --auto-mode-fit-diff delta_val\n"
+" Add delta to the width and height of each mode when\n"
+" doing an auto-mode-fit (default 0, may be negative).\n"
" --dither-16col-fast\n"
" (normally enabled, use --dither-16col-fast=off to\n"
" disable) if *disabled*, use (much) slower but\n"
--- ./src/vgadisp.c.orig 2002-05-05 04:16:12.000000000 +0300
+++ ./src/vgadisp.c 2003-07-12 13:59:13.000000000 +0300
@@ -606,8 +606,9 @@
h=md_ptr->height;
/* has to be >= pic size, but <= current best-fit mode. */
- if(w>=width && h>=height && w<=newmode_w && h<=newmode_h)
- newmode=md_ptr->mode,newmode_w=w,newmode_h=h;
+ if(w+cfg.deltamodefit>=width && h+cfg.deltamodefit>=height)
+ if(w<=newmode_w && h<=newmode_h)
+ newmode=md_ptr->mode,newmode_w=w,newmode_h=h;
/* also track biggest mode as backup in case no mode fits it all. */
if(w>=bigmode_w && h>=bigmode_h)

+ 1
- 2
package/jimmy/zgv/zgv.conf

@ -27,12 +27,11 @@ zgv_postmake() {
jpeg-speed 1
mouse yes
EOT
chmod 0755 $root/$prefix/bin/zgv
chmod 0755 $root/$prefix/bin/zgv # we're using svgalib-1.9.x
}
premake="mkdir -p $root/$prefix/man/man1"
makeopt="$makeopt PREFIX=$root/$prefix WARNOPTS=\"-Wall -I/usr/include/libpng\""
inmake="$MAKE info"
makeinstopt="PREFIX=$root/$prefix $makeinstopt"
postmake=zgv_postmake
postdoc="rm -f $docdir/{$pkg,$pkg-[0-9]}"

+ 2
- 2
package/jimmy/zgv/zgv.desc

@ -35,8 +35,8 @@
[L] GPL
[S] Stable
[V] 5.6
[V] 5.7
[P] X -----5---9 682.000
[D] 974974394 zgv-5.6.tar.gz ftp://sunsite.unc.edu/pub/Linux/apps/graphics/viewers/svga/
[D] 4035674879 zgv-5.7.tar.gz ftp://sunsite.unc.edu/pub/Linux/apps/graphics/viewers/svga/

Loading…
Cancel
Save