=============================================================================== XV Modification Notes The following is my notes on posible modifications of the XV program to allow improved usage of the program. I do suggest you keep a copy of the original unmodified XV, particularly if you decied to modify thumbnail size! The Source for XV I used was the last XV 3.10a release http://www.trilon.com/xv/downloads.html#src-distrib Then patched with the latest Greg's XV Jumbo Patch http://www.sonic.net/~roelofs/greg_xv.html NOW I use the active development from jasper software (see below) =============================================================================== Jasper Soft Version Movifications... Issue report for larger Icon sizes.... See https://github.com/jasper-software/xv/issues/11 Download Software git client https://github.com/jasper-software/xv.git dnf install xv-4.1.1-1.fc38.src.rpm Install dependancies needed to build (via fedora rpm system) yum-builddep xv Apply diffs for various personal mods... larger Icon size... in "xvbrowse.c" =======8<--------CUT HERE---------- diff -c xv/src/xvbrowse.c xv-jasper-AT/src/xvbrowse.c *** xv/src/xvbrowse.c 2024-04-08 10:57:07.739206321 +1000 --- xv-jasper-AT/src/xvbrowse.c 2023-10-27 17:48:50.000000000 +1000 *************** *** 145,165 **** /* some people like bigger icons; 4:3 aspect ratio is recommended * (NOTE: standard XV binaries will not be able to read larger icons!) */ #ifndef ISIZE_WIDE ! # define ISIZE_WIDE 80 /* maximum size of an icon */ #endif #ifndef ISIZE_HIGH ! # define ISIZE_HIGH 60 #endif #ifndef ISIZE_WPAD ! # define ISIZE_WPAD 16 /* extra horizontal padding between icons */ #endif #ifndef INUM_WIDE ! # define INUM_WIDE 6 /* size initial window to hold this many icons */ #endif #ifndef INUM_HIGH ! # define INUM_HIGH 3 #endif #define ISPACE_WIDE (ISIZE_WIDE+ISIZE_WPAD) /* icon spacing */ --- 145,165 ---- /* some people like bigger icons; 4:3 aspect ratio is recommended * (NOTE: standard XV binaries will not be able to read larger icons!) */ #ifndef ISIZE_WIDE ! # define ISIZE_WIDE 120 /* maximum size of an icon */ #endif #ifndef ISIZE_HIGH ! # define ISIZE_HIGH 90 #endif #ifndef ISIZE_WPAD ! # define ISIZE_WPAD 4 /* extra horizontal padding between icons */ #endif #ifndef INUM_WIDE ! # define INUM_WIDE 5 /* size initial window to hold this many icons */ #endif #ifndef INUM_HIGH ! # define INUM_HIGH 6 #endif #define ISPACE_WIDE (ISIZE_WIDE+ISIZE_WPAD) /* icon spacing */ =======8<--------CUT HERE---------- Kludge to prevent windows moving due to window manager =======8<--------CUT HERE---------- diff -c xv/src/xv.c xv-jasper-AT/src/xv.c *** xv/src/xv.c 2024-04-08 10:57:07.738206314 +1000 --- xv-jasper-AT/src/xv.c 2023-10-27 17:53:48.000000000 +1000 *************** *** 2803,2808 **** --- 2803,2810 ---- if (vexpand < 0.0) eHIGH=(int)(aspHIGH / -vexpand); /* neg: reciprocal */ else eHIGH=(int)(aspHIGH * vexpand); + kludge_x = kludge_y = -1; /* location not given */ + if (maingeom) { /* deal with geometry spec. Note, they shouldn't have given us *both* an expansion factor and a geomsize. The geomsize wins out */ *************** *** 2812,2817 **** --- 2814,2822 ---- gewide = eWIDE; gehigh = eHIGH; i = XParseGeometry(maingeom,&x,&y,&w,&h); + kludge_x = x; /* record the window location - and place window here */ + kludge_y = y; + if (i&WidthValue) gewide = (int) w; if (i&HeightValue) gehigh = (int) h; diff -c xv/src/xv.h xv-jasper-AT/src/xv.h *** xv/src/xv.h 2024-04-08 10:57:07.738206314 +1000 --- xv-jasper-AT/src/xv.h 2023-10-27 17:52:19.000000000 +1000 *************** *** 1248,1253 **** --- 1248,1255 ---- WHERE int ch_offx,ch_offy; /* ChngAttr ofst for reparented windows */ WHERE int kludge_offx, /* WM kludges for SetWindowPos routine */ kludge_offy; + WHERE int kludge_x, /* WM kludges for SetWindowPos routine */ + kludge_y; WHERE int winCtrPosKludge; /* kludge for popup positioning... */ WHERE int ignoreConfigs; /* an evil kludge... */ diff -c xv/src/xvevent.c xv-jasper-AT/src/xvevent.c *** xv/src/xvevent.c 2024-04-08 10:57:07.742206343 +1000 --- xv-jasper-AT/src/xvevent.c 2023-10-27 17:55:01.000000000 +1000 *************** *** 2352,2357 **** --- 2352,2362 ---- xwc.x = xwa->x - xwa->border_width - ch_offx; xwc.y = xwa->y - xwa->border_width - ch_offy; + if (kludge_x > 0) { + xwc.x = kludge_x; + xwc.y = kludge_y; + } + if (!xwa->border_width) xwa->border_width = bwidth; xwc.border_width = xwa->border_width; =======8<--------CUT HERE---------- Pause slideshow on 'w' (wait) key... =======8<--------CUT HERE---------- *** xv/src/xvevent.c 2024-04-08 11:13:30.292951751 +1000 --- xv-jasper-AT/src/xvevent.c 2023-10-27 17:55:01.000000000 +1000 *************** *** 1948,1953 **** --- 1948,1956 ---- case 'H': FakeButtonPress(&gbut[G_BHISTEQ]); break; case 'N': FakeButtonPress(&gbut[G_BMAXCONT]); break; + /* wait pause/resume */ + case 'w': waitsec = -waitsec; break; + default: break; } } =======8<--------CUT HERE---------- Building # Install devel dependancies needed to build (via fedora rpm system) # EG; cmake jsoncpp rhash libX11 jasper etc... sudo yum-builddep xv build/build cp tmp_cmake/install/bin/xv ~/bin =============================================================================== =============================================================================== Changes I developed on older sources... ------------------------------------------------------------------------------- Max Number and size of Schnauzer. I found that a maximum of 4 browser windows were not enough... In "xv.h" change the the following defines... #define MAXNAMES 4096 /* max # of files in ctrlW list */ #define MAXBRWIN 4 /* max # of vis browser windows */ to #define MAXNAMES 65536 /* max # of files in ctrlW list */ #define MAXBRWIN 16 /* max # of vis browser windows */ ------------------------------------------------------------------------------- Increase XV thumbnail size (caution) The calculations was incorperated into jumbo patch 20070520 making icons size and inital array size adjustments easy. On a larger display, I found the 80x60 thumbnail size is a little small. Warning a unmodified xv will think larger thumbnails as bogus and ignore them. It does NOT however over-write them unless you "update" or re-"generate" specific icons. I suggest you do not copy larger .xvpic thumbs to machines where a different XV might be running. Alturnativally prehaps you can rename the "thumbnail" directory from ".xvpics" to ".xvpics-120" (set in "xv.h") so that both sets can co-exist. I did not bother to do this. Also I suggest you keep the 4x3 aspect ratio of the thumbnails In "xvbrowse.c" modify.. #define ISIZE_WIDE 80 /* maximum size of an icon */ #define ISIZE_HIGH 60 to #define ISIZE_WIDE 100 /* maximum size of an icon */ #define ISIZE_HIGH 75 or even larger at #define ISIZE_WIDE 120 /* maximum size of an icon -- my selection */ #define ISIZE_HIGH 90 or #define ISIZE_WIDE 160 /* maximum size of an icon */ #define ISIZE_HIGH 120 You may also like to remove some of the extra width space around icons... #define ISPACE_WIDE (ISIZE_WIDE+16) /* icon spacing */ to #define ISPACE_WIDE (ISIZE_WIDE+4) /* icon spacing */ To do all this properly with window size adjustments needed, this context diff patch will do the job for you... =======8<--------CUT HERE---------- *** xvbrowse.c.orig Sun Jun 2 14:02:48 2002 --- xvbrowse.c Sun Jun 2 14:18:12 2002 *************** *** 115,123 **** #define ISLOADABLE(ftyp) (ftyp!=BF_DIR && ftyp!=BF_CHR && ftyp!=BF_BLK && \ ftyp!=BF_SOCK && ftyp!=BF_FIFO) - #define DEF_BROWWIDE 615 /* default size of window */ - #define DEF_BROWHIGH 356 - #define SCROLLVERT 8 /* height of scroll region at top/bottom of iconw */ #define PAGEVERT 40 /* during rect drag, if further than this, page */ --- 115,120 ---- *************** *** 129,138 **** #define BOTMARGIN 58 /* room for a row of buttons and a line of text */ #define LRMARGINS 5 /* left and right margins */ ! #define ISIZE_WIDE 80 /* maximum size of an icon */ ! #define ISIZE_HIGH 60 ! #define ISPACE_WIDE (ISIZE_WIDE+16) /* icon spacing */ #define ISPACE_TOP 4 /* dist btwn top of ISPACE and ISIZE */ #define ISPACE_TTOP 4 /* dist btwn bot of icon and title */ #define ISPACE_HIGH (ISIZE_HIGH+ISPACE_TOP+ISPACE_TTOP+16+4) --- 126,138 ---- #define BOTMARGIN 58 /* room for a row of buttons and a line of text */ #define LRMARGINS 5 /* left and right margins */ ! #define ISIZE_WIDE 120 /* maximum size of an icon */ ! #define ISIZE_HIGH 90 ! ! #define ISIZE_WPAD 4 /* less padding */ ! #define INUM_WIDE 5 /* size initial window to hold this many icons */ ! #define INUM_HIGH 6 /* more height */ ! #define ISPACE_WIDE (ISIZE_WIDE+ISIZE_WPAD) /* icon spacing */ #define ISPACE_TOP 4 /* dist btwn top of ISPACE and ISIZE */ #define ISPACE_TTOP 4 /* dist btwn bot of icon and title */ #define ISPACE_HIGH (ISIZE_HIGH+ISPACE_TOP+ISPACE_TTOP+16+4) *************** *** 167,172 **** --- 167,179 ---- #define BUTTW 80 #define BUTTH 24 + + /* Original size of window was 615 x 356 for 80x60 thumbs in 6x3 array */ + #define DEF_BROWWIDE (ISPACE_WIDE * INUM_WIDE + LRMARGINS * 2 + 22) + #define DEF_BROWHIGH (ISPACE_HIGH * INUM_HIGH + BUTTH * 2 + 16 + 24) + /* the last number is a fudge, EG extra spaces, borders etc */ static char *showHstr = "Show hidden files"; static char *hideHstr = "Hide 'hidden' files"; =======8<--------CUT HERE--------- =============================================================================== Wait/Resume Slideshow Key This patch adds a 'w' key that will enable and disable (pause) automatic slideshow (-wait option). I always hated that you could not 'pause' the wait timeout. If -wait is not given it defaults to 5 secs but 'paused' =======8<--------CUT HERE---------- *** xvevent.c.orig 2008-12-14 11:18:36.000000000 +1000 --- xvevent.c 2008-12-14 11:41:22.000000000 +1000 *************** *** 1916,1921 **** --- 1916,1924 ---- case 'H': FakeButtonPress(&gbut[G_BHISTEQ]); break; case 'N': FakeButtonPress(&gbut[G_BMAXCONT]); break; + /* wait pause/resume */ + case 'w': waitsec = -waitsec; break; + default: break; } } =======8<--------CUT HERE---------- ------------------------------------------------------------------------------- WARNING: xv jumbo patch 20070520 The "USE_TICKS" seems to get the meaning of 'time' wrong (too large) That is the returned 'elapsed_ticks' is too small in relation to CLK_TCK by a factor of 100 #if 0 out the use of this in xv.h Also recomend replacing the sleep() in xvevent.c with usleep() usleep(250000); /* 1/4 sec sleep */ =============================================================================== Patch to 'fix' the XV window position Basically it notes the position given in -geometry, and always trys to return the XV main window to that position, regardless of Window manager moves or drifts. This is perfect for use in slide shows. patch is against XV jumbo patch 20070520 =======8<--------CUT HERE---------- diff -c xv-3.10a-jumbo20070520/Makefile xv-3.10a-jumbo20070520-at/Makefile diff -c xv-3.10a-jumbo20070520/xv.c xv-3.10a-jumbo20070520-at/xv.c *** xv-3.10a-jumbo20070520/xv.c 2008-12-14 12:27:24.000000000 +1000 --- xv-3.10a-jumbo20070520-at/xv.c 2010-03-01 00:29:53.000000000 +1000 *************** *** 2771,2776 **** --- 2771,2778 ---- if (vexpand < 0.0) eHIGH=(int)(aspHIGH / -vexpand); /* neg: reciprocal */ else eHIGH=(int)(aspHIGH * vexpand); + kludge_x = kludge_y = -1; /* location not given */ + if (maingeom) { /* deal with geometry spec. Note, they shouldn't have given us *both* an expansion factor and a geomsize. The geomsize wins out */ *************** *** 2780,2785 **** --- 2782,2791 ---- gewide = eWIDE; gehigh = eHIGH; i = XParseGeometry(maingeom,&x,&y,&w,&h); + kludge_x = x; /* record the window location - and place window here */ + kludge_y = y; + + if (i&WidthValue) gewide = (int) w; if (i&HeightValue) gehigh = (int) h; diff -c xv-3.10a-jumbo20070520/xv.h xv-3.10a-jumbo20070520-at/xv.h *** xv-3.10a-jumbo20070520/xv.h 2008-12-14 14:22:15.000000000 +1000 --- xv-3.10a-jumbo20070520-at/xv.h 2010-03-01 00:26:05.000000000 +1000 *************** *** 1186,1191 **** --- 1186,1193 ---- WHERE int ch_offx,ch_offy; /* ChngAttr ofst for reparented windows */ WHERE int kludge_offx, /* WM kludges for SetWindowPos routine */ kludge_offy; + WHERE int kludge_x, /* WM kludges for SetWindowPos routine */ + kludge_y; WHERE int winCtrPosKludge; /* kludge for popup positioning... */ WHERE int ignoreConfigs; /* an evil kludge... */ diff -c xv-3.10a-jumbo20070520/xvevent.c xv-3.10a-jumbo20070520-at/xvevent.c *** xv-3.10a-jumbo20070520/xvevent.c 2008-12-14 14:27:24.000000000 +1000 --- xv-3.10a-jumbo20070520-at/xvevent.c 2010-03-01 00:35:03.000000000 +1000 *************** *** 2323,2328 **** --- 2323,2333 ---- xwc.x = xwa->x - xwa->border_width - ch_offx; xwc.y = xwa->y - xwa->border_width - ch_offy; + if (kludge_x > 0) { + xwc.x = kludge_x; + xwc.y = kludge_y; + } + if (!xwa->border_width) xwa->border_width = bwidth; xwc.border_width = xwa->border_width; =======8<--------CUT HERE---------- -------------------------------------------------------------------------------