Commit 2f0ceb37 authored by Bernhard Link's avatar Bernhard Link

Import gv_3.7.4.orig.tar.gz

parents 3c55063f 27236886
* src/options_gv.c(orientation2extern): Handle "Automatic" orientation
correctly
* src/options_gv.c(pagemedia2extern): For pagemedia, we have to replace
Translation of "Automatic" to "Automatic" befire saving. This is done
by this new function.
* src/options_gv.c(options_gv_cb_save): Call pagemedia2extern. See above
for explanation.
2012-04-01 Markus Steinborn <gnugv_maintainer@yahoo.de>
* configure.ac, src/versionp.h: Bumped version to 3.7.3.91
2012-04-01 A. Costa <agcosta@gis.net>
* doc/gv-update-userconfig: improve wording of gv-update-userconfig manual.
2012-04-01 William Bader <williambader@hotmail.com>
* src/FileSel.c: Fix use of IIMESSAGE with a real argument. Initialize dirp.
* src/Ghostview.c: Give InterpreterFailed() a way to indicate the type of failure.
* src/Scrollbar.c, src/Scrollbar.h: Let XawScrollbarSetThumb pick its arguments as
double or float depending on NeedWidePrototypes. This is required to make the
scroll bar work in Fedora 14.
* src/Vlist.c: Add some IIMESSAGE() lines for debugging. Add a call to ENDMESSAGE()
before an error return to balance the earlier BEGINMESSAGE().
* src/ Vlist.c, src/Vlist.h: Add VlistMaxEntriesVisible(Widget w, int height) to
return the maximum number of entries that can fit in the list.
* src/actions.c: Fix use of IIMESSAGE with a real argument.
* src/doc_misc.c: Loosen the test for media sizes.
* src/gv_misc_res.dat: Add more space around the mag menu. Implement keypad
enter, insert, delete, home, end, prior. Switch buttons for zoom and pan.
* src/gv_user_res.dat: Turn off scrolling eye guide. Add a margin in the geometry.
Add a 10x24 paper size.
* src/magmenu.c: Fix an attempt to increment a NULL pointer.
* src/main.c: Initialize gv_psfile and toc_text.
* src/media.c: Fix an attempt to increment a NULL pointer.
* src/message.h: Write messages to stderr instead of stdout so they aren't buffered.
Add DDMESSAGE1() debug macro for real numbers.
* src/misc.c: Clean up the toc scrolling to avoid leaving empty space when there are
items to fill the space. Fix a possible NULL pointer reference. Fix a possible -1 array
index. Fix an attempt to increment a NULL pointer.
* src/ps.c: Check for %!PS instead of %!PS-Adobe- to recognize old files.
Do not stop parsing comments at a line starting % space. Implement Seascape orientation.
* src/scale.c: Fix an attempt to increment a NULL pointer.
2012-02-29 Markus Steinborn <gnugv_maintainer@yahoo.de> 2012-02-29 Markus Steinborn <gnugv_maintainer@yahoo.de>
* configure.ac, src/versionp.h: Bumped version to 3.7.3.90 * configure.ac, src/versionp.h: Bumped version to 3.7.3.90
......
...@@ -861,7 +861,7 @@ distcheck: dist ...@@ -861,7 +861,7 @@ distcheck: dist
*.zip*) \ *.zip*) \
unzip $(distdir).zip ;;\ unzip $(distdir).zip ;;\
esac esac
chmod -R a-w $(distdir); chmod a+w $(distdir) chmod -R a-w $(distdir); chmod u+w $(distdir)
mkdir $(distdir)/_build mkdir $(distdir)/_build
mkdir $(distdir)/_inst mkdir $(distdir)/_inst
chmod a-w $(distdir) chmod a-w $(distdir)
......
...@@ -9,6 +9,15 @@ by a '#' or a '*' or a '?'. A ...@@ -9,6 +9,15 @@ by a '#' or a '*' or a '?'. A
'#' denotes a change which is noticeable by the user. '#' denotes a change which is noticeable by the user.
'?' describes a known problem which is not fixed yet. '?' describes a known problem which is not fixed yet.
%%%%%%%%%%%%%%%%%%% GV 3.7.4 (March 2013) %%%%%%%%%%%%%%%%%%%%%%%%%%
# Fixed CVE-2012-3386 (by using updated automake)
# Fixed bug-gv] Problem after saving gv-settings
# improve wording of gv-update-userconfig manual
# Scrolling and memory access improved
# README.I18N adjusted for libXaw3d 1.6.x
# Fixed GNU gv 3.6.4 - 3.7.3 page selector button geometry bug
%%%%%%%%%%%%%%%%%%% GV 3.7.3.90 (March 2012) %%%%%%%%%%%%%%%%%%%%%%%%%% %%%%%%%%%%%%%%%%%%% GV 3.7.3.90 (March 2012) %%%%%%%%%%%%%%%%%%%%%%%%%%
# Support for libXaw3d-1.6.x # Support for libXaw3d-1.6.x
......
...@@ -4,7 +4,7 @@ GV I18N Fontset Patch ...@@ -4,7 +4,7 @@ GV I18N Fontset Patch
This patch make gv to support UTF8. This patch make gv to support UTF8.
Note that Xaw3d version 1.5E is required for UTF8-Support. Note that Xaw3d version 1.5E or 1.6.1 or newer is required for UTF8-Support.
Note that UTF8-Mode is currently turned off by default. Note that UTF8-Mode is currently turned off by default.
To enable it, you have two possibilities: To enable it, you have two possibilities:
...@@ -22,7 +22,7 @@ To enable it, you have two possibilities: ...@@ -22,7 +22,7 @@ To enable it, you have two possibilities:
NEED: NEED:
Xaw3d 1.4, 1.5 has a fatal bug in MultiSrc.c line 735-740. Xaw3d 1.4, 1.5 and 1.6.0 and 1.6.1 has a fatal bug in MultiSrc.c line 735-740.
This GV's patch need Xaw3d library patched follow: This GV's patch need Xaw3d library patched follow:
*** xc/lib/Xaw3d/MultiSrc.c Fri May 15 04:03:23 1998 *** xc/lib/Xaw3d/MultiSrc.c Fri May 15 04:03:23 1998
...@@ -58,5 +58,7 @@ patch will fix it: ...@@ -58,5 +58,7 @@ patch will fix it:
/* /*
A collection of Xaw3D 1.5E bug fixing patches can be found on A collection of Xaw3D 1.5E and 1.6.x bug fixing patches can be found on
git://gitorious.org/xaw3d/xaw3d.git. git://gitorious.org/xaw3d/xaw3d.git.
For Xaw3d 1.5E take the master branch, for libXaw3d 1.6.x take the
"v1.6-branch", "v1.6.1-branch" and so on.
...@@ -3360,7 +3360,7 @@ fi ...@@ -3360,7 +3360,7 @@ fi
# Define the identity of the package. # Define the identity of the package.
PACKAGE=gv PACKAGE=gv
VERSION=3.7.3.90 VERSION=3.7.4
cat >>confdefs.h <<_ACEOF cat >>confdefs.h <<_ACEOF
...@@ -3427,7 +3427,7 @@ fi ...@@ -3427,7 +3427,7 @@ fi
VERSION=3.7.3.90 VERSION=3.7.4
MANUALEDITION=First MANUALEDITION=First
......
...@@ -8,14 +8,14 @@ dnl Please process this file with `autoconf' to get a configure script ...@@ -8,14 +8,14 @@ dnl Please process this file with `autoconf' to get a configure script
AC_INIT(src/ps.c) AC_INIT(src/ps.c)
AM_INIT_AUTOMAKE(gv,3.7.3.90) AM_INIT_AUTOMAKE(gv,3.7.4)
AM_CONFIG_HEADER(src/ac_config.h) AM_CONFIG_HEADER(src/ac_config.h)
dnl AM_CONFIG_HEADER(src/ac_config.h) dnl AM_CONFIG_HEADER(src/ac_config.h)
AM_MAINTAINER_MODE AM_MAINTAINER_MODE
dnl gv version dnl gv version
VERSION=3.7.3.90 VERSION=3.7.4
dnl manual edition dnl manual edition
MANUALEDITION=First MANUALEDITION=First
......
...@@ -57,7 +57,7 @@ resource value (loaded from \fI$(HOME)\fP\fB/.Xresources\fP at login time ...@@ -57,7 +57,7 @@ resource value (loaded from \fI$(HOME)\fP\fB/.Xresources\fP at login time
or manually \fBxrdb\fP(1)). or manually \fBxrdb\fP(1)).
Sometimes older values miss things needed by the new GNU gv to work properly. Sometimes older values miss things needed by the new GNU gv to work properly.
This GNU gv will noticy by an old (or missing) version information in this This GNU gv will notice old (or missing) version information in this
file and refuse to start until fixed. file and refuse to start until fixed.
.SH "SEE ALSO" .SH "SEE ALSO"
......
.\" DO NOT MODIFY THIS FILE! It was generated by help2man 1.36. .\" DO NOT MODIFY THIS FILE! It was generated by help2man 1.36.
.TH GV "1" "February 2012" "gv 3.7.3.90" "User Commands" .TH GV "1" "March 2013" "gv 3.7.4" "User Commands"
.SH NAME .SH NAME
gv \- Postscript and PDF viewer gv \- Postscript and PDF viewer
.SH SYNOPSIS .SH SYNOPSIS
......
No preview for this file type
@set UPDATED 11 January 2012 @set UPDATED 29 March 2012
@set UPDATED-MONTH January 2012 @set UPDATED-MONTH March 2012
@set EDITION 3.7.3.90 @set EDITION 3.7.4
@set VERSION 3.7.3.90 @set VERSION 3.7.4
@set UPDATED 11 January 2012 @set UPDATED 29 March 2012
@set UPDATED-MONTH January 2012 @set UPDATED-MONTH March 2012
@set EDITION 3.7.3.90 @set EDITION 3.7.4
@set VERSION 3.7.3.90 @set VERSION 3.7.4
...@@ -1089,7 +1089,7 @@ static void FS_listAction(Widget w, XEvent *event, String *params, Cardinal *npa ...@@ -1089,7 +1089,7 @@ static void FS_listAction(Widget w, XEvent *event, String *params, Cardinal *npa
relfactor = relfactor >= 0 ? (relfactor<=100 ? relfactor : 100) : 0; relfactor = relfactor >= 0 ? (relfactor<=100 ? relfactor : 100) : 0;
if (*nparams>=3) absfactor = atof((char*)(params[2])); if (*nparams>=3) absfactor = atof((char*)(params[2]));
absfactor = absfactor >= 0 ? (absfactor<=200 ? absfactor : 200) : 0; absfactor = absfactor >= 0 ? (absfactor<=200 ? absfactor : 200) : 0;
IIMESSAGE1(absfactor,relfactor) DDMESSAGE1(absfactor,relfactor)
if (REVERSE_SCROLLING) { dx = -dx; } else { dy = -dy; } if (REVERSE_SCROLLING) { dx = -dx; } else { dy = -dy; }
childx = (int) (childx-(dx*absfactor)-(relfactor*childw*dx)/clipw); childx = (int) (childx-(dx*absfactor)-(relfactor*childw*dx)/clipw);
childy = (int) (childy-(dy*absfactor)-(relfactor*childh*dy)/cliph); childy = (int) (childy-(dy*absfactor)-(relfactor*childh*dy)/cliph);
...@@ -1352,7 +1352,7 @@ CombineToPath(String path, char *dir, char *file) ...@@ -1352,7 +1352,7 @@ CombineToPath(String path, char *dir, char *file)
static void SetDirectoryView(FileSelectionWidget fs, char *dir) static void SetDirectoryView(FileSelectionWidget fs, char *dir)
{ {
DIR *dirp; DIR *dirp=NULL;
struct dirent *dp; struct dirent *dp;
String str; String str;
char *temp; char *temp;
......
...@@ -199,7 +199,7 @@ static void SetBackground(Widget,Bool); ...@@ -199,7 +199,7 @@ static void SetBackground(Widget,Bool);
static Boolean Setup(Widget); static Boolean Setup(Widget);
static void StartInterpreter(Widget); static void StartInterpreter(Widget);
static void StopInterpreter(Widget); static void StopInterpreter(Widget);
static void InterpreterFailed(Widget); static void InterpreterFailed(Widget,const char *);
static void ChangeCursor(GhostviewWidget,int); static void ChangeCursor(GhostviewWidget,int);
static XtActionsRec actions[] = static XtActionsRec actions[] =
...@@ -521,7 +521,7 @@ Input(XtPointer client_data, int *source _GL_UNUSED, XtInputId *id _GL_UNUSED) ...@@ -521,7 +521,7 @@ Input(XtPointer client_data, int *source _GL_UNUSED, XtInputId *id _GL_UNUSED)
} }
if (gvw->ghostview.bytes_left > 0 && if (gvw->ghostview.bytes_left > 0 &&
gvw->ghostview.buffer_bytes_left == 0) { gvw->ghostview.buffer_bytes_left == 0) {
InterpreterFailed(w); /* Error occurred */ InterpreterFailed(w,"bytes left"); /* Error occurred */
} }
gvw->ghostview.input_buffer_ptr = gvw->ghostview.input_buffer; gvw->ghostview.input_buffer_ptr = gvw->ghostview.input_buffer;
gvw->ghostview.bytes_left -= gvw->ghostview.buffer_bytes_left; gvw->ghostview.bytes_left -= gvw->ghostview.buffer_bytes_left;
...@@ -543,10 +543,10 @@ Input(XtPointer client_data, int *source _GL_UNUSED, XtInputId *id _GL_UNUSED) ...@@ -543,10 +543,10 @@ Input(XtPointer client_data, int *source _GL_UNUSED, XtInputId *id _GL_UNUSED)
#endif #endif
if (broken_pipe) { if (broken_pipe) {
broken_pipe = False; broken_pipe = False;
InterpreterFailed(w); /* Something bad happened */ InterpreterFailed(w,"broken pope"); /* Something bad happened */
} else if (bytes_written == -1) { } else if (bytes_written == -1) {
if ((errno != EWOULDBLOCK) && (errno != EAGAIN)) { if ((errno != EWOULDBLOCK) && (errno != EAGAIN)) {
InterpreterFailed(w); /* Something bad happened */ InterpreterFailed(w,"write to pipe failed"); /* Something bad happened */
} }
} else { } else {
gvw->ghostview.buffer_bytes_left -= bytes_written; gvw->ghostview.buffer_bytes_left -= bytes_written;
...@@ -566,10 +566,10 @@ Input(XtPointer client_data, int *source _GL_UNUSED, XtInputId *id _GL_UNUSED) ...@@ -566,10 +566,10 @@ Input(XtPointer client_data, int *source _GL_UNUSED, XtInputId *id _GL_UNUSED)
b=write(gvw->ghostview.interpreter_input,"\n",1); b=write(gvw->ghostview.interpreter_input,"\n",1);
if (broken_pipe) { if (broken_pipe) {
broken_pipe = False; broken_pipe = False;
InterpreterFailed(w); /* Something bad happened */ InterpreterFailed(w,"broken pipe writing NL"); /* Something bad happened */
} else if (b == -1) { } else if (b == -1) {
if ((errno != EWOULDBLOCK) && (errno != EAGAIN)) { if ((errno != EWOULDBLOCK) && (errno != EAGAIN)) {
InterpreterFailed(w); /* Something bad happened */ InterpreterFailed(w,"writing NL to pipe failed"); /* Something bad happened */
} }
} }
} }
...@@ -594,10 +594,10 @@ Input(XtPointer client_data, int *source _GL_UNUSED, XtInputId *id _GL_UNUSED) ...@@ -594,10 +594,10 @@ Input(XtPointer client_data, int *source _GL_UNUSED, XtInputId *id _GL_UNUSED)
b = write(gvw->ghostview.interpreter_input, peek_buf, PEEK_SIZE); b = write(gvw->ghostview.interpreter_input, peek_buf, PEEK_SIZE);
if (broken_pipe) { if (broken_pipe) {
broken_pipe = False; broken_pipe = False;
InterpreterFailed(w); InterpreterFailed(w,"broken pipe writing peek buf");
} else if (b == -1) { } else if (b == -1) {
if ((errno != EWOULDBLOCK) && (errno != EAGAIN)) { if ((errno != EWOULDBLOCK) && (errno != EAGAIN)) {
InterpreterFailed(w); /* Something bad happened */ InterpreterFailed(w,"writing peek buf to pipe failed"); /* Something bad happened */
} }
} }
} }
...@@ -637,7 +637,7 @@ Output(XtPointer client_data, int *source, XtInputId *id _GL_UNUSED) ...@@ -637,7 +637,7 @@ Output(XtPointer client_data, int *source, XtInputId *id _GL_UNUSED)
return; return;
} else if (bytes == -1) { } else if (bytes == -1) {
INFMESSAGE(something bad happened in interpreter_output) INFMESSAGE(something bad happened in interpreter_output)
InterpreterFailed(w); /* Something bad happened */ InterpreterFailed(w,"read stdout from pipe failed"); /* Something bad happened */
ENDMESSAGE(Output) ENDMESSAGE(Output)
return; return;
} }
...@@ -652,7 +652,7 @@ Output(XtPointer client_data, int *source, XtInputId *id _GL_UNUSED) ...@@ -652,7 +652,7 @@ Output(XtPointer client_data, int *source, XtInputId *id _GL_UNUSED)
return; return;
} else if (bytes == -1) { } else if (bytes == -1) {
INFMESSAGE(something bad happened in interpreter_error) INFMESSAGE(something bad happened in interpreter_error)
InterpreterFailed(w); /* Something bad happened */ InterpreterFailed(w,"read stderr from pipe failed"); /* Something bad happened */
ENDMESSAGE(Output) ENDMESSAGE(Output)
return; return;
} }
...@@ -1649,11 +1649,12 @@ StopInterpreter(Widget w) ...@@ -1649,11 +1649,12 @@ StopInterpreter(Widget w)
/*###################################################################################*/ /*###################################################################################*/
static void static void
InterpreterFailed(Widget w) InterpreterFailed(Widget w, const char *mesg)
{ {
GhostviewWidget gvw = (GhostviewWidget) w; GhostviewWidget gvw = (GhostviewWidget) w;
BEGINMESSAGE(InterpreterFailed) BEGINMESSAGE(InterpreterFailed)
StopInterpreter(w); StopInterpreter(w);
fprintf(stderr, "Error: %s, errno %d\n", mesg, errno);
XtCallCallbackList(w, gvw->ghostview.message_callback, "Failed"); XtCallCallbackList(w, gvw->ghostview.message_callback, "Failed");
ENDMESSAGE(InterpreterFailed) ENDMESSAGE(InterpreterFailed)
} }
......
...@@ -1385,7 +1385,13 @@ static void NotifyThumb(Widget w, XEvent *event, String *params _GL_UNUSED, Card ...@@ -1385,7 +1385,13 @@ static void NotifyThumb(Widget w, XEvent *event, String *params _GL_UNUSED, Card
Set the scroll bar to the given location. Set the scroll bar to the given location.
###############################################################################*/ ###############################################################################*/
void XawScrollbarSetThumb (Widget w, double top, double shown) void XawScrollbarSetThumb (Widget w,
#if NeedWidePrototypes
double top, double shown
#else
float top, float shown
#endif
)
{ {
SCROLLBARWIDGET w; SCROLLBARWIDGET w;
......
...@@ -132,8 +132,13 @@ _XFUNCPROTOBEGIN ...@@ -132,8 +132,13 @@ _XFUNCPROTOBEGIN
extern void XawScrollbarSetThumb( extern void XawScrollbarSetThumb(
Widget /* scrollbar */, Widget /* scrollbar */,
#if NeedWidePrototypes
double /* top */, double /* top */,
double /* shown */ double /* shown */
#else
float /* top */,
float /* shown */
#endif
); );
_XFUNCPROTOEND _XFUNCPROTOEND
......
...@@ -367,6 +367,7 @@ PaintMark(Widget w, Region region, int entry, int style, Boolean erase) ...@@ -367,6 +367,7 @@ PaintMark(Widget w, Region region, int entry, int style, Boolean erase)
GC gc; GC gc;
BEGINMESSAGE(PaintMark) BEGINMESSAGE(PaintMark)
IIMESSAGE(entry,erase)
if (entry < 0 || entry >= vw->vlist.entries) { if (entry < 0 || entry >= vw->vlist.entries) {
INFMESSAGE(invalid entry) INFMESSAGE(invalid entry)
ENDMESSAGE(PaintMark) ENDMESSAGE(PaintMark)
...@@ -870,12 +871,16 @@ void VlistSetFirstVisible(Widget w, int newf) ...@@ -870,12 +871,16 @@ void VlistSetFirstVisible(Widget w, int newf)
unsigned int height; unsigned int height;
BEGINMESSAGE(VlistSetFirstVisible) BEGINMESSAGE(VlistSetFirstVisible)
IIMESSAGE(newf,vw->vlist.entries)
if (newf < 0) if (newf < 0)
newf = 0; newf = 0;
else if (newf >= vw->vlist.entries) else if (newf >= vw->vlist.entries)
newf = vw->vlist.entries - 1; newf = vw->vlist.entries - 1;
if (newf == -1) if (newf == -1) {
ENDMESSAGE(VlistSetFirstVisible)
return; return;
}
IIMESSAGE(newf,vw->vlist.firstVisible)
if (newf != vw->vlist.firstVisible) { if (newf != vw->vlist.firstVisible) {
vw->vlist.firstVisible = newf; vw->vlist.firstVisible = newf;
/* better not allow the widget to grow that large, but that needs fixing /* better not allow the widget to grow that large, but that needs fixing
...@@ -883,6 +888,7 @@ void VlistSetFirstVisible(Widget w, int newf) ...@@ -883,6 +888,7 @@ void VlistSetFirstVisible(Widget w, int newf)
height = vw->core.height; height = vw->core.height;
if( height >= 0x8000 ) if( height >= 0x8000 )
height = 0x3fff; height = 0x3fff;
IIMESSAGE(vw->core.height,height)
XFillRectangle(XtDisplayOfObject(w), XtWindowOfObject(w), vw->vlist.background_GC, XFillRectangle(XtDisplayOfObject(w), XtWindowOfObject(w), vw->vlist.background_GC,
vw->core.x, vw->core.y, vw->core.width, height); vw->core.x, vw->core.y, vw->core.width, height);
Redisplay(w, NULL, NULL); Redisplay(w, NULL, NULL);
...@@ -904,6 +910,7 @@ void VlistMoveFirstVisible(Widget w, int start, int ydiff) ...@@ -904,6 +910,7 @@ void VlistMoveFirstVisible(Widget w, int start, int ydiff)
int newf; int newf;
BEGINMESSAGE(VlistMoveFirstVisible) BEGINMESSAGE(VlistMoveFirstVisible)
IIMESSAGE(start,ydiff)
ly = vw->vlist.ydelta; ly = vw->vlist.ydelta;
if (debug_p) fprintf(stderr, "move: start=%d ydiff=%d ly=%d\n", start, ydiff, ly); if (debug_p) fprintf(stderr, "move: start=%d ydiff=%d ly=%d\n", start, ydiff, ly);
...@@ -927,13 +934,18 @@ void VlistMoveFirstVisible(Widget w, int start, int ydiff) ...@@ -927,13 +934,18 @@ void VlistMoveFirstVisible(Widget w, int start, int ydiff)
float VlistScrollPosition(Widget w) float VlistScrollPosition(Widget w)
{ {
VlistWidget vw = (VlistWidget)w; VlistWidget vw = (VlistWidget)w;
float position;
#if 0 #if 0
printf("Scroll position %d/%d=%f\n", printf("Scroll position %d/%d=%f\n",
vw->vlist.firstVisible,(int)(vw->vlist.entries), vw->vlist.firstVisible,(int)(vw->vlist.entries),
vw->vlist.firstVisible/(float)(vw->vlist.entries)); vw->vlist.firstVisible/(float)(vw->vlist.entries));
#endif #endif
return vw->vlist.firstVisible/(float)vw->vlist.entries; position = vw->vlist.firstVisible/(float)vw->vlist.entries;
INFMESSAGE(VlistScrollPosition)
IIMESSAGE(vw->vlist.firstVisible,vw->vlist.entries)
FMESSAGE(position)
return position;
} }
float VlistVisibleLength(Widget w, unsigned int height) float VlistVisibleLength(Widget w, unsigned int height)
...@@ -957,5 +969,22 @@ float VlistVisibleLength(Widget w, unsigned int height) ...@@ -957,5 +969,22 @@ float VlistVisibleLength(Widget w, unsigned int height)
entriesvisible/(float)(vw->vlist.entries)); entriesvisible/(float)(vw->vlist.entries));
#endif #endif
percent = entriesvisible/(float)(vw->vlist.entries); percent = entriesvisible/(float)(vw->vlist.entries);
INFMESSAGE(VlistVisibleLength)
IIMESSAGE(entriesvisible,vw->vlist.entries)
FMESSAGE(percent)
return percent; return percent;
} }
int VlistMaxEntriesVisible(Widget w, int height)
{
VlistWidget vw = (VlistWidget)w;
int entriesvisible = -1;
if (vw->vlist.ydelta > 0) {
entriesvisible = (height - vw->label.label_y)/vw->vlist.ydelta;
}
INFIMESSAGE(VlistMaxEntriesVisible,entriesvisible)
return entriesvisible;
}
...@@ -83,5 +83,6 @@ extern void VlistSetFirstVisible(Widget, int); ...@@ -83,5 +83,6 @@ extern void VlistSetFirstVisible(Widget, int);
extern void VlistMoveFirstVisible(Widget, int, int); extern void VlistMoveFirstVisible(Widget, int, int);
extern float VlistScrollPosition(Widget); extern float VlistScrollPosition(Widget);
extern float VlistVisibleLength(Widget, unsigned int); extern float VlistVisibleLength(Widget, unsigned int);
extern int VlistMaxEntriesVisible (Widget, int);
#endif /* _Vlist_h_ */ #endif /* _Vlist_h_ */
...@@ -99,6 +99,7 @@ action_shellConfigureNotify(Widget w, XEvent *event, String *params _GL_UNUSED, ...@@ -99,6 +99,7 @@ action_shellConfigureNotify(Widget w, XEvent *event, String *params _GL_UNUSED,
width = new_width; width = new_width;
height=new_height; height=new_height;
} }
INFMESSAGE(action_shellConfigureNotify calling XawScrollbarSetThumb)
XawScrollbarSetThumb(newtocScroll, XawScrollbarSetThumb(newtocScroll,
VlistScrollPosition(newtoc), VlistScrollPosition(newtoc),
VlistVisibleLength(newtoc,newtocClip->core.height)); VlistVisibleLength(newtoc,newtocClip->core.height));
...@@ -596,7 +597,7 @@ action_movePage(Widget w, XEvent *event, String *params, Cardinal *num_params) ...@@ -596,7 +597,7 @@ action_movePage(Widget w, XEvent *event, String *params, Cardinal *num_params)
relfactor = relfactor >= 0 ? (relfactor<=100 ? relfactor : 100) : 0; relfactor = relfactor >= 0 ? (relfactor<=100 ? relfactor : 100) : 0;
if (*num_params>=3) absfactor = atof((char*)(params[2])); if (*num_params>=3) absfactor = atof((char*)(params[2]));
absfactor = absfactor >= 0 ? (absfactor<=200 ? absfactor : 200) : 0; absfactor = absfactor >= 0 ? (absfactor<=200 ? absfactor : 200) : 0;
IIMESSAGE1(absfactor,relfactor) DDMESSAGE1(absfactor,relfactor)
if (app_res.reverse_scrolling) { dx = -dx; dy = -dy; } if (app_res.reverse_scrolling) { dx = -dx; dy = -dy; }
xp = (int) (xp-(dx*absfactor)-(relfactor*pw*dx)/pvw); xp = (int) (xp-(dx*absfactor)-(relfactor*pw*dx)/pvw);
yp = (int) (yp-(dy*absfactor)-(relfactor*ph*dy)/pvh); yp = (int) (yp-(dy*absfactor)-(relfactor*ph*dy)/pvh);
......
...@@ -134,4 +134,13 @@ Miscellaneous defaults ...@@ -134,4 +134,13 @@ Miscellaneous defaults
#define GV_FTELL ftell #define GV_FTELL ftell
#endif #endif
#ifndef HAVE_GCC_VERSION
#ifdef __GNUC__
#define HAVE_GCC_VERSION(MAJOR, MINOR) \
(__GNUC__ > (MAJOR) || (__GNUC__ == (MAJOR) && __GNUC_MINOR__ >= (MINOR)))
#else
#define HAVE_GCC_VERSION(MAJOR, MINOR) 0
#endif
#endif
#endif /* _GV_CONFIG_H_ */ #endif /* _GV_CONFIG_H_ */
...@@ -221,12 +221,14 @@ doc_preferredMediaOfPage(d,pagenumber,llxP,llyP,urxP,uryP) ...@@ -221,12 +221,14 @@ doc_preferredMediaOfPage(d,pagenumber,llxP,llyP,urxP,uryP)
/* try to map bounding box to standard or document pagemedia */ /* try to map bounding box to standard or document pagemedia */
if (found==-1 && dbb[LLX]==0 && dbb[LLY]==0) { if (found==-1 && dbb[LLX]==0 && dbb[LLY]==0) {
for (dm=(Media) d->media,i=0; !media && i<d->nummedia; i++,dm++) for (dm=(Media) d->media,i=0; !media && i<d->nummedia; i++,dm++)
if ((dm->width==dbb[URX] && dm->height==dbb[URY]) || if (dm->used &&
(dm->width+1==dbb[URX] && dm->height+1==dbb[URY])) media=dm; ((dm->width==dbb[URX] || dm->width+1==dbb[URX]) &&
(dm->height==dbb[URY] || dm->height+1==dbb[URY]))) media=dm;
for (j=0; gv_medias[j] && !media ; j++) { for (j=0; gv_medias[j] && !media ; j++) {
dm = gv_medias[j]; dm = gv_medias[j];
if (dm->used==1 && ((dm->width==dbb[URX] && dm->height==dbb[URY]) || if (dm->used==1 &&
(dm->width+1==dbb[URX] && dm->height+1==dbb[URY]))) media=dm; ((dm->width==dbb[URX] || dm->width+1==dbb[URX]) &&
(dm->height==dbb[URY] || dm->height+1==dbb[URY]))) media=dm;
} }
if (media) found=1; if (media) found=1;
} }
......
...@@ -121,9 +121,9 @@ GV*Scrollbar.thumb: None ...@@ -121,9 +121,9 @@ GV*Scrollbar.thumb: None
!##### Menus !##### Menus
GV*magMenu*VertSpace: 2 GV*magMenu*VertSpace: 15
GV*magMenu*leftMargin: 15 GV*magMenu*leftMargin: 30
GV*magMenu*rightMargin: 15 GV*magMenu*rightMargin: 30
GV*magMenu*justify: center GV*magMenu*justify: center
!##### File Selection widget !##### File Selection widget
...@@ -494,6 +494,12 @@ GV.control.baseTranslations:#replace \n\ ...@@ -494,6 +494,12 @@ GV.control.baseTranslations:#replace \n\
<Key>KP_Subtract: GV_Page(highlight-1) \n\ <Key>KP_Subtract: GV_Page(highlight-1) \n\
<Key>KP_Add: GV_Page(highlight+1) \n\ <Key>KP_Add: GV_Page(highlight+1) \n\
<Key>KP_Enter: GV_Page(page=highlighted)\n\ <Key>KP_Enter: GV_Page(page=highlighted)\n\
<Key>KP_Insert: GV_Page(page-5) \n\
<Key>KP_Delete: GV_Page(page+5) \n\
<Key>KP_Home: GV_Page(page=0) \n\
<Key>KP_End: GV_Page(page=99999) \n\
<Key>KP_Prior: GV_Page(page-1) \n\
<Key>KP_Next: GV_Page(page+1) \n\
\ \
~c ~s <Key>Return: GV_Page(down,!page+1,top) \n\ ~c ~s <Key>Return: GV_Page(down,!page+1,top) \n\
<Key>Return: GV_Page(top,!page-1,down) \n\ <Key>Return: GV_Page(top,!page-1,down) \n\
...@@ -564,42 +570,42 @@ GV*SimpleMenu.baseTranslations:#replace\n\ ...@@ -564,42 +570,42 @@ GV*SimpleMenu.baseTranslations:#replace\n\
!##### Ghostview widget !##### Ghostview widget
GV*Ghostview.baseTranslations: #replace \n\ GV*Ghostview.baseTranslations: #replace \n\
~Button2 ~Button3 <Btn1Down>: cursor(scroll) \ ~Button1 ~Button3 <Btn2Down>: cursor(scroll) \
GV_MovePage(start) \ GV_MovePage(start) \
GV_EraseLocator() \n\ GV_EraseLocator() \n\
~Button2 ~Button3 <Btn1Motion>: GV_MovePage(move,1.0,0) \n\ ~Button1 ~Button3 <Btn2Motion>: GV_MovePage(move,1.0,0) \n\
<Btn1Up>: cursor(normal) \ <Btn2Up>: cursor(normal) \
GV_MovePage(stop) \ GV_MovePage(stop) \
GV_OtherPage() \ GV_OtherPage() \
notify() \n\ notify() \n\
~Button1 ~Button3 s <Btn2Down>: cursor(scroll) \ ~Button2 ~Button3 s <Btn1Down>: cursor(scroll) \
GV_MovePage(start) \ GV_MovePage(start) \
GV_EraseLocator() \ GV_EraseLocator() \
GV_MiscMenu(init) \n\ GV_MiscMenu(init) \n\
~Button1 ~Button3 s <Btn2Motion>: GV_MovePage(move,0,1.0) \n\ ~Button2 ~Button3 s <Btn1Motion>: GV_MovePage(move,0,1.0) \n\
s <Btn2Up>: cursor(normal) \ s <Btn1Up>: cursor(normal) \
GV_MiscMenu(popup) \ GV_MiscMenu(popup) \
notify() \n\ notify() \n\
~Button1 ~Button2 s <Btn3Down>: GV_MagMenu(begin) \n\ ~Button1 ~Button2 s <Btn3Down>: GV_MagMenu(begin) \n\
~Button1 ~Button2 s <Btn3Motion>: GV_MagMenu(extend) \n\ ~Button1 ~Button2 s <Btn3Motion>: GV_MagMenu(extend) \n\
~Button1 ~Button2 s <Btn3Up>: GV_MagMenu(choose) \n\ ~Button1 ~Button2 s <Btn3Up>: GV_MagMenu(choose) \n\
~Button1 ~Button3 <Btn2Down>: GV_MagMenu(begin) \n\ ~Button2 ~Button3 <Btn1Down>: GV_MagMenu(begin) \n\
Button2 <Btn1Down>: GV_MagMenu(reset) \n\ Button1 <Btn2Down>: GV_MagMenu(reset) \n\
Button2 <Btn3Down>: GV_MagMenu(reset) \n\ Button1 <Btn3Down>: GV_MagMenu(reset) \n\
~Button1 ~Button3 <Btn2Motion>: GV_MagMenu(extend) \n\ ~Button2 ~Button3 <Btn1Motion>: GV_MagMenu(extend) \n\
~Button1 ~Button3 <Btn2Up>: GV_MagMenu(choose) \n\ ~Button2 ~Button3 <Btn1Up>: GV_MagMenu(choose) \n\
~Button1 ~Button2 <Btn3Down>: cursor(scroll) \ ~Button1 ~Button2 <Btn3Down>: cursor(scroll) \
GV_MovePage(start) \ GV_MovePage(start) \
GV_EraseLocator() \ GV_EraseLocator() \
GV_MiscMenu(init) \n\ GV_MiscMenu(init) \n\
Button3 <Btn1Down>: GV_MiscMenu(reset) \n\
Button3 <Btn2Down>: GV_MiscMenu(reset) \n\ Button3 <Btn2Down>: GV_MiscMenu(reset) \n\
Button3 <Btn1Down>: GV_MiscMenu(reset) \n\
~Button1 ~Button2 <Btn3Motion>: GV_MovePage(move,0,1.0) \n\ ~Button1 ~Button2 <Btn3Motion>: GV_MovePage(move,0,1.0) \n\
<Btn3Up>: cursor(normal) \ <Btn3Up>: cursor(normal) \
GV_MiscMenu(popup) \ GV_MiscMenu(popup) \
notify() \n\ notify() \n\
Button1 ~Button3 <Btn2Down>: GV_Page(redisplay) \n\ Button2 ~Button3 <Btn1Down>: GV_Page(redisplay) \n\
Button1 ~Button2 <Btn3Down>: GV_Page(redisplay) \n\ Button2 ~Button1 <Btn3Down>: GV_Page(redisplay) \n\
<Message>: message() \n\ <Message>: message() \n\
<EnterWindow>: notify() \n\ <EnterWindow>: notify() \n\
<LeaveWindow>: GV_EraseLocator() \n\ <LeaveWindow>: GV_EraseLocator() \n\
......