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>
* configure.ac, src/versionp.h: Bumped version to 3.7.3.90
......
......@@ -861,7 +861,7 @@ distcheck: dist
*.zip*) \
unzip $(distdir).zip ;;\
esac
chmod -R a-w $(distdir); chmod a+w $(distdir)
chmod -R a-w $(distdir); chmod u+w $(distdir)
mkdir $(distdir)/_build
mkdir $(distdir)/_inst
chmod a-w $(distdir)
......
......@@ -9,6 +9,15 @@ by a '#' or a '*' or a '?'. A
'#' denotes a change which is noticeable by the user.
'?' 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) %%%%%%%%%%%%%%%%%%%%%%%%%%
# Support for libXaw3d-1.6.x
......
......@@ -4,7 +4,7 @@ GV I18N Fontset Patch
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.
To enable it, you have two possibilities:
......@@ -22,7 +22,7 @@ To enable it, you have two possibilities:
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:
*** xc/lib/Xaw3d/MultiSrc.c Fri May 15 04:03:23 1998
......@@ -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.
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
# Define the identity of the package.
PACKAGE=gv
VERSION=3.7.3.90
VERSION=3.7.4
cat >>confdefs.h <<_ACEOF
......@@ -3427,7 +3427,7 @@ fi
VERSION=3.7.3.90
VERSION=3.7.4
MANUALEDITION=First
......
......@@ -8,14 +8,14 @@ dnl Please process this file with `autoconf' to get a configure script
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)
dnl AM_CONFIG_HEADER(src/ac_config.h)
AM_MAINTAINER_MODE
dnl gv version
VERSION=3.7.3.90
VERSION=3.7.4
dnl manual edition
MANUALEDITION=First
......
......@@ -57,7 +57,7 @@ resource value (loaded from \fI$(HOME)\fP\fB/.Xresources\fP at login time
or manually \fBxrdb\fP(1)).
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.
.SH "SEE ALSO"
......
.\" 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
gv \- Postscript and PDF viewer
.SH SYNOPSIS
......
No preview for this file type
@set UPDATED 11 January 2012
@set UPDATED-MONTH January 2012
@set EDITION 3.7.3.90
@set VERSION 3.7.3.90
@set UPDATED 29 March 2012
@set UPDATED-MONTH March 2012
@set EDITION 3.7.4
@set VERSION 3.7.4
@set UPDATED 11 January 2012
@set UPDATED-MONTH January 2012
@set EDITION 3.7.3.90
@set VERSION 3.7.3.90
@set UPDATED 29 March 2012
@set UPDATED-MONTH March 2012
@set EDITION 3.7.4
@set VERSION 3.7.4
......@@ -1089,7 +1089,7 @@ static void FS_listAction(Widget w, XEvent *event, String *params, Cardinal *npa
relfactor = relfactor >= 0 ? (relfactor<=100 ? relfactor : 100) : 0;
if (*nparams>=3) absfactor = atof((char*)(params[2]));
absfactor = absfactor >= 0 ? (absfactor<=200 ? absfactor : 200) : 0;
IIMESSAGE1(absfactor,relfactor)
DDMESSAGE1(absfactor,relfactor)
if (REVERSE_SCROLLING) { dx = -dx; } else { dy = -dy; }
childx = (int) (childx-(dx*absfactor)-(relfactor*childw*dx)/clipw);
childy = (int) (childy-(dy*absfactor)-(relfactor*childh*dy)/cliph);
......@@ -1352,7 +1352,7 @@ CombineToPath(String path, char *dir, char *file)
static void SetDirectoryView(FileSelectionWidget fs, char *dir)
{
DIR *dirp;
DIR *dirp=NULL;
struct dirent *dp;
String str;
char *temp;
......
......@@ -199,7 +199,7 @@ static void SetBackground(Widget,Bool);
static Boolean Setup(Widget);
static void StartInterpreter(Widget);
static void StopInterpreter(Widget);
static void InterpreterFailed(Widget);
static void InterpreterFailed(Widget,const char *);
static void ChangeCursor(GhostviewWidget,int);
static XtActionsRec actions[] =
......@@ -521,7 +521,7 @@ Input(XtPointer client_data, int *source _GL_UNUSED, XtInputId *id _GL_UNUSED)
}
if (gvw->ghostview.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.bytes_left -= gvw->ghostview.buffer_bytes_left;
......@@ -543,10 +543,10 @@ Input(XtPointer client_data, int *source _GL_UNUSED, XtInputId *id _GL_UNUSED)
#endif
if (broken_pipe) {
broken_pipe = False;
InterpreterFailed(w); /* Something bad happened */
InterpreterFailed(w,"broken pope"); /* Something bad happened */
} else if (bytes_written == -1) {
if ((errno != EWOULDBLOCK) && (errno != EAGAIN)) {
InterpreterFailed(w); /* Something bad happened */
InterpreterFailed(w,"write to pipe failed"); /* Something bad happened */
}
} else {
gvw->ghostview.buffer_bytes_left -= bytes_written;
......@@ -566,10 +566,10 @@ Input(XtPointer client_data, int *source _GL_UNUSED, XtInputId *id _GL_UNUSED)
b=write(gvw->ghostview.interpreter_input,"\n",1);
if (broken_pipe) {
broken_pipe = False;
InterpreterFailed(w); /* Something bad happened */
InterpreterFailed(w,"broken pipe writing NL"); /* Something bad happened */
} else if (b == -1) {
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)
b = write(gvw->ghostview.interpreter_input, peek_buf, PEEK_SIZE);
if (broken_pipe) {
broken_pipe = False;
InterpreterFailed(w);
InterpreterFailed(w,"broken pipe writing peek buf");
} else if (b == -1) {
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)
return;
} else if (bytes == -1) {
INFMESSAGE(something bad happened in interpreter_output)
InterpreterFailed(w); /* Something bad happened */
InterpreterFailed(w,"read stdout from pipe failed"); /* Something bad happened */
ENDMESSAGE(Output)
return;
}
......@@ -652,7 +652,7 @@ Output(XtPointer client_data, int *source, XtInputId *id _GL_UNUSED)
return;
} else if (bytes == -1) {
INFMESSAGE(something bad happened in interpreter_error)
InterpreterFailed(w); /* Something bad happened */
InterpreterFailed(w,"read stderr from pipe failed"); /* Something bad happened */
ENDMESSAGE(Output)
return;
}
......@@ -1649,11 +1649,12 @@ StopInterpreter(Widget w)
/*###################################################################################*/
static void
InterpreterFailed(Widget w)
InterpreterFailed(Widget w, const char *mesg)
{
GhostviewWidget gvw = (GhostviewWidget) w;
BEGINMESSAGE(InterpreterFailed)
StopInterpreter(w);
fprintf(stderr, "Error: %s, errno %d\n", mesg, errno);
XtCallCallbackList(w, gvw->ghostview.message_callback, "Failed");
ENDMESSAGE(InterpreterFailed)
}
......
......@@ -1385,7 +1385,13 @@ static void NotifyThumb(Widget w, XEvent *event, String *params _GL_UNUSED, Card
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;
......
......@@ -132,8 +132,13 @@ _XFUNCPROTOBEGIN
extern void XawScrollbarSetThumb(
Widget /* scrollbar */,
#if NeedWidePrototypes
double /* top */,
double /* shown */
#else
float /* top */,
float /* shown */
#endif
);
_XFUNCPROTOEND
......
......@@ -367,6 +367,7 @@ PaintMark(Widget w, Region region, int entry, int style, Boolean erase)
GC gc;
BEGINMESSAGE(PaintMark)
IIMESSAGE(entry,erase)
if (entry < 0 || entry >= vw->vlist.entries) {
INFMESSAGE(invalid entry)
ENDMESSAGE(PaintMark)
......@@ -870,12 +871,16 @@ void VlistSetFirstVisible(Widget w, int newf)
unsigned int height;
BEGINMESSAGE(VlistSetFirstVisible)
IIMESSAGE(newf,vw->vlist.entries)
if (newf < 0)
newf = 0;
else if (newf >= vw->vlist.entries)
newf = vw->vlist.entries - 1;
if (newf == -1)
if (newf == -1) {
ENDMESSAGE(VlistSetFirstVisible)
return;
}
IIMESSAGE(newf,vw->vlist.firstVisible)
if (newf != vw->vlist.firstVisible) {
vw->vlist.firstVisible = newf;
/* better not allow the widget to grow that large, but that needs fixing
......@@ -883,6 +888,7 @@ void VlistSetFirstVisible(Widget w, int newf)
height = vw->core.height;
if( height >= 0x8000 )
height = 0x3fff;
IIMESSAGE(vw->core.height,height)
XFillRectangle(XtDisplayOfObject(w), XtWindowOfObject(w), vw->vlist.background_GC,
vw->core.x, vw->core.y, vw->core.width, height);
Redisplay(w, NULL, NULL);
......@@ -904,6 +910,7 @@ void VlistMoveFirstVisible(Widget w, int start, int ydiff)
int newf;
BEGINMESSAGE(VlistMoveFirstVisible)
IIMESSAGE(start,ydiff)
ly = vw->vlist.ydelta;
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)
float VlistScrollPosition(Widget w)
{
VlistWidget vw = (VlistWidget)w;
float position;
#if 0
printf("Scroll position %d/%d=%f\n",
vw->vlist.firstVisible,(int)(vw->vlist.entries),
vw->vlist.firstVisible/(float)(vw->vlist.entries));
#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)
......@@ -957,5 +969,22 @@ float VlistVisibleLength(Widget w, unsigned int height)
entriesvisible/(float)(vw->vlist.entries));
#endif
percent = entriesvisible/(float)(vw->vlist.entries);
INFMESSAGE(VlistVisibleLength)
IIMESSAGE(entriesvisible,vw->vlist.entries)
FMESSAGE(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);
extern void VlistMoveFirstVisible(Widget, int, int);
extern float VlistScrollPosition(Widget);
extern float VlistVisibleLength(Widget, unsigned int);
extern int VlistMaxEntriesVisible (Widget, int);
#endif /* _Vlist_h_ */
......@@ -99,6 +99,7 @@ action_shellConfigureNotify(Widget w, XEvent *event, String *params _GL_UNUSED,
width = new_width;
height=new_height;
}
INFMESSAGE(action_shellConfigureNotify calling XawScrollbarSetThumb)
XawScrollbarSetThumb(newtocScroll,
VlistScrollPosition(newtoc),
VlistVisibleLength(newtoc,newtocClip->core.height));
......@@ -596,7 +597,7 @@ action_movePage(Widget w, XEvent *event, String *params, Cardinal *num_params)
relfactor = relfactor >= 0 ? (relfactor<=100 ? relfactor : 100) : 0;
if (*num_params>=3) absfactor = atof((char*)(params[2]));
absfactor = absfactor >= 0 ? (absfactor<=200 ? absfactor : 200) : 0;
IIMESSAGE1(absfactor,relfactor)
DDMESSAGE1(absfactor,relfactor)
if (app_res.reverse_scrolling) { dx = -dx; dy = -dy; }
xp = (int) (xp-(dx*absfactor)-(relfactor*pw*dx)/pvw);
yp = (int) (yp-(dy*absfactor)-(relfactor*ph*dy)/pvh);
......
......@@ -134,4 +134,13 @@ Miscellaneous defaults
#define GV_FTELL ftell
#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_ */
......@@ -221,12 +221,14 @@ doc_preferredMediaOfPage(d,pagenumber,llxP,llyP,urxP,uryP)
/* try to map bounding box to standard or document pagemedia */
if (found==-1 && dbb[LLX]==0 && dbb[LLY]==0) {
for (dm=(Media) d->media,i=0; !media && i<d->nummedia; i++,dm++)
if ((dm->width==dbb[URX] && dm->height==dbb[URY]) ||
(dm->width+1==dbb[URX] && dm->height+1==dbb[URY])) media=dm;
if (dm->used &&
((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++) {
dm = gv_medias[j];
if (dm->used==1 && ((dm->width==dbb[URX] && dm->height==dbb[URY]) ||
(dm->width+1==dbb[URX] && dm->height+1==dbb[URY]))) media=dm;
if (dm->used==1 &&
((dm->width==dbb[URX] || dm->width+1==dbb[URX]) &&
(dm->height==dbb[URY] || dm->height+1==dbb[URY]))) media=dm;
}
if (media) found=1;
}
......
......@@ -121,9 +121,9 @@ GV*Scrollbar.thumb: None
!##### Menus
GV*magMenu*VertSpace: 2
GV*magMenu*leftMargin: 15
GV*magMenu*rightMargin: 15
GV*magMenu*VertSpace: 15
GV*magMenu*leftMargin: 30
GV*magMenu*rightMargin: 30
GV*magMenu*justify: center
!##### File Selection widget
......@@ -494,6 +494,12 @@ GV.control.baseTranslations:#replace \n\
<Key>KP_Subtract: GV_Page(highlight-1) \n\
<Key>KP_Add: GV_Page(highlight+1) \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\
<Key>Return: GV_Page(top,!page-1,down) \n\
......@@ -564,42 +570,42 @@ GV*SimpleMenu.baseTranslations:#replace\n\
!##### Ghostview widget
GV*Ghostview.baseTranslations: #replace \n\
~Button2 ~Button3 <Btn1Down>: cursor(scroll) \
~Button1 ~Button3 <Btn2Down>: cursor(scroll) \
GV_MovePage(start) \
GV_EraseLocator() \n\
~Button2 ~Button3 <Btn1Motion>: GV_MovePage(move,1.0,0) \n\
<Btn1Up>: cursor(normal) \
~Button1 ~Button3 <Btn2Motion>: GV_MovePage(move,1.0,0) \n\
<Btn2Up>: cursor(normal) \
GV_MovePage(stop) \
GV_OtherPage() \
notify() \n\
~Button1 ~Button3 s <Btn2Down>: cursor(scroll) \
~Button2 ~Button3 s <Btn1Down>: cursor(scroll) \
GV_MovePage(start) \
GV_EraseLocator() \
GV_MiscMenu(init) \n\
~Button1 ~Button3 s <Btn2Motion>: GV_MovePage(move,0,1.0) \n\
s <Btn2Up>: cursor(normal) \
~Button2 ~Button3 s <Btn1Motion>: GV_MovePage(move,0,1.0) \n\
s <Btn1Up>: cursor(normal) \
GV_MiscMenu(popup) \
notify() \n\
~Button1 ~Button2 s <Btn3Down>: GV_MagMenu(begin) \n\
~Button1 ~Button2 s <Btn3Motion>: GV_MagMenu(extend) \n\
~Button1 ~Button2 s <Btn3Up>: GV_MagMenu(choose) \n\
~Button1 ~Button3 <Btn2Down>: GV_MagMenu(begin) \n\
Button2 <Btn1Down>: GV_MagMenu(reset) \n\
Button2 <Btn3Down>: GV_MagMenu(reset) \n\
~Button1 ~Button3 <Btn2Motion>: GV_MagMenu(extend) \n\
~Button1 ~Button3 <Btn2Up>: GV_MagMenu(choose) \n\
~Button2 ~Button3 <Btn1Down>: GV_MagMenu(begin) \n\
Button1 <Btn2Down>: GV_MagMenu(reset) \n\
Button1 <Btn3Down>: GV_MagMenu(reset) \n\
~Button2 ~Button3 <Btn1Motion>: GV_MagMenu(extend) \n\
~Button2 ~Button3 <Btn1Up>: GV_MagMenu(choose) \n\
~Button1 ~Button2 <Btn3Down>: cursor(scroll) \
GV_MovePage(start) \
GV_EraseLocator() \
GV_MiscMenu(init) \n\
Button3 <Btn1Down>: 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\
<Btn3Up>: cursor(normal) \
GV_MiscMenu(popup) \
notify() \n\
Button1 ~Button3 <Btn2Down>: GV_Page(redisplay) \n\
Button1 ~Button2 <Btn3Down>: GV_Page(redisplay) \n\
Button2 ~Button3 <Btn1Down>: GV_Page(redisplay) \n\
Button2 ~Button1 <Btn3Down>: GV_Page(redisplay) \n\
<Message>: message() \n\
<EnterWindow>: notify() \n\
<LeaveWindow>: GV_EraseLocator() \n\
......
......@@ -13,12 +13,13 @@ GV.respectDSC: True
GV.ignoreEOF: True
GV.confirmPrint: True
GV.reverseScrolling: False
GV.scrollingEyeGuide: True
GV.scrollingEyeGuide: False
GV.autoResize: True
GV.maximumWidth: screen-20
GV.maximumHeight: screen-44
GV.minimumWidth: 400
GV.minimumHeight: 430
GV.geometry: +5+5
GV.confirmQuit: 1
GV.watchFile: False
GV.watchFileFrequency: 1000
......@@ -68,6 +69,7 @@ GV.medias: Letter, 612 792 \n\
# 9x12, 648 864 \n\
# 10x13, 720 936 \n\
10x14, 720 1008 \n\
14x24, 1008 1728 \n\
Executive, 540 720 \n\
# A0, 2384 3370 \n\
# A1, 1684 2384 \n\
......
......@@ -118,6 +118,7 @@ MagMenuEntry *magmenu_parseMagMenuEntries(s)
*entries++ = entry;
}
n--;
if (!nl) break;
c=++nl;
}
if (!have_entry) {
......
......@@ -114,8 +114,8 @@
#endif /* USE_SIGNAL_HANDLER */
#define BITSOF(name) name ## _bits
#define WIDTHOF(name) name ## _height
#define HEIGHTOF(name) name ## _width
#define WIDTHOF(name) name ## _width
#define HEIGHTOF(name) name ## _height
#define BITMAP_ARGS(name)\
(const char*)BITSOF(name), WIDTHOF(name), HEIGHTOF(name)
......@@ -346,11 +346,13 @@ int main(int argc, char *argv[])
gv_class = GV_CLASS;
gv_pending_page_request=NO_CURRENT_PAGE;
gv_gs_arguments = NULL;
gv_psfile = NULL;
gv_filename = NULL;
gv_filename_unc = NULL;
gv_filename_dsc = NULL;
gv_filename_old = NULL;
gv_filename_raw = NULL;
toc_text = NULL;
infopopup = NULL;
confirmpopup = NULL;
dialogpopup = NULL;
......
......@@ -120,6 +120,7 @@ Media *media_parseMedias(s)
*medias++ = media;
}
n--;
if (!nl) break;
c=++nl;
}
if (!have_media) {
......
......@@ -76,21 +76,21 @@
#define MESSAGE_PRINTF(format,value) { \
char __indent[100]; unsigned short __len;\
MESSAGE_GETINDENT(__indent,__len); \
printf(__indent); \
printf(format,value); \
fprintf(stderr,__indent); \
fprintf(stderr,format,value); \
}
#define MESSAGE2_PRINTF(format,value1,value2) { \
char __indent[100]; unsigned short __len; \
MESSAGE_GETINDENT(__indent,__len); \
printf(__indent); \
printf(format,value1,value2); \
fprintf(stderr,__indent); \
fprintf(stderr,format,value1,value2); \
}
#define BEGIN_MESSAGE(txt) { \
char __indent[100]; unsigned short __len; \
MESSAGE_GETINDENT(__indent,__len) \
printf("%s\273\273\273 %s%s%s <%s>\n", \
fprintf(stderr,"%s\273\273\273 %s%s%s <%s>\n", \
__indent, \
MESSAGE_B_ESC,MESSAGE_STRING(txt),MESSAGE_E_ESC,\
MESSAGE_FILE \
......@@ -103,7 +103,7 @@
char __indent[100]; unsigned short __len; \
MESSAGE_GETINDENT(__indent,__len) \
if (__len>= 4) __indent[__len-4] = '\0'; \
printf("%s\253\253\253 %s%s%s <%s>\n", \
fprintf(stderr,"%s\253\253\253 %s%s%s <%s>\n", \
__indent, \
MESSAGE_B_ESC,MESSAGE_STRING(txt),MESSAGE_E_ESC,\
MESSAGE_FILE \
......@@ -194,6 +194,7 @@
# define SMESSAGE1(st) MESSAGE_PRINTF(#st "=%s\n",st ? st : MESSAGE_NULL_PTR)
# define INFSMESSAGE1(txt,st) MESSAGE_PRINTF(#txt " " #st "=%s\n",st ? st : MESSAGE_NULL_PTR)
# define IIMESSAGE1(it1,it2) MESSAGE2_PRINTF(#it1 "=%d, " #it2 "=%d\n",it1,it2)
# define DDMESSAGE1(dt1,dt2) MESSAGE2_PRINTF(#dt1 "=%f, " #dt2 "=%f\n",dt1,dt2)
# define INFIIMESSAGE1(txt,it1,it2) MESSAGE2_PRINTF(#txt " " #it1 "=%d, " #it2 "=%d\n",it1,it2)
#else
# define BEGINMESSAGE1(txt) BEGIN_MESSAGE(txt)
......@@ -206,6 +207,7 @@
# define SMESSAGE1(st) MESSAGE_PRINTF("st=%s\n",st ? st : MESSAGE_NULL_PTR)
# define INFSMESSAGE1(txt,st) MESSAGE_PRINTF("txt st=%s\n",st ? st : MESSAGE_NULL_PTR)
# define IIMESSAGE1(it1,it2) MESSAGE2_PRINTF("it1=%d, it2=%d\n",it1,it2)
# define DDMESSAGE1(dt1,dt2) MESSAGE2_PRINTF("dt1=%d, dt2=%d\n",dt1,dt2)
# define INFIIMESSAGE1(txt,it1,it2) MESSAGE2_PRINTF("txt it1=%d, it2=%d\n",it1,it2)
#endif
......@@ -221,6 +223,7 @@
# define SMESSAGE1(st)
# define INFSMESSAGE1(txt,st)
# define IIMESSAGE1(it1,it2)
# define DDMESSAGE1(dt1,dt2)
# define INFIIMESSAGE1(txt,it1,it2)
#endif /* MESSAGES1 */
......
......@@ -288,6 +288,7 @@ misc_setPageMarker(int entry, int kind, XEvent *event, Boolean check_toc)
/* kind: 0 = selected, 1 = highlighted , 2 = bring selected in sight*/
{
int firstvisible, lastvisible;
int maxvisible, numentries;
Boolean b = False;
INFMESSAGE(misc_setPageMarker)
if (toc_text && (entry >= 0)) {
......@@ -300,7 +301,18 @@ misc_setPageMarker(int entry, int kind, XEvent *event, Boolean check_toc)
if (entry<0) return;
}
firstvisible = VlistGetFirstVisible(newtoc);
if (firstvisible > entry || (entry > 0 && firstvisible >= entry)) {
maxvisible = VlistMaxEntriesVisible(newtoc, newtocClip->core.height);
numentries = VlistEntries(newtoc);
IIMESSAGE(entry,firstvisible)
IIMESSAGE(maxvisible,numentries)
if (numentries < maxvisible) {
/* check if everything fits */
/* this can happen if the window size is increased */
if (entry != 0) {
VlistSetFirstVisible(newtoc, 0);
b = True;
}
} else if (firstvisible > entry || (entry > 0 && firstvisible >= entry)) {
if (entry > 0)
VlistSetFirstVisible(newtoc, entry - 1);
else
......@@ -310,8 +322,13 @@ misc_setPageMarker(int entry, int kind, XEvent *event, Boolean check_toc)
/* sadly newtoc does not know it's height, so it cannot be told
* to made an item visible and we need to trick: */
lastvisible = VlistEntryOfPosition(newtoc, newtocClip->core.height);
IIMESSAGE(lastvisible,maxvisible)
if (entry > firstvisible && entry >= lastvisible) {
VlistSetFirstVisible(newtoc, entry - (lastvisible - firstvisible - 1));
int firstentry;
firstentry = entry - (lastvisible - firstvisible - 1); /* make the entry second last */
if (firstentry > numentries - maxvisible) firstentry = numentries - maxvisible; /* avoid empty holes at the end */
if (firstentry < 0) firstentry = 0; /* keep in range */
VlistSetFirstVisible(newtoc, firstentry);
b = True;
}
}
......@@ -1041,6 +1058,7 @@ setup_ghostview(void)
}
XtSetValues(newtoc, args, n);
ClipWidgetSetCoordinates(newtocClip,0,0);
INFMESSAGE(setup_ghostview calling XawScrollbarSetThumb)
XawScrollbarSetThumb(newtocScroll,
VlistScrollPosition(newtoc),
VlistVisibleLength(newtoc,newtocClip->core.height));
......@@ -1197,6 +1215,8 @@ set_new_scale(void)
}
default_xdpi *= ascale;
default_ydpi *= ascale;
INFIMESSAGE(old scale base,gv_scale_base_current);
INFIMESSAGE(new scale base,new_scale_base);
XtSetArg(args[0], XtNleftBitmap, None);
if (gv_scale_base_current >=0) XtSetValues(scaleEntry[gv_scale_base_current],args, ONE);
XtSetArg(args[0], XtNleftBitmap, app_res.selected_bitmap);
......@@ -1319,6 +1339,7 @@ set_newBitmapIfChanged(Widget w, Pixmap new_bitmap)
Pixmap old_bitmap;
BEGINMESSAGE(set_newBitmapIfChanged)
if (!w) return; /* continuing will eventually cause a core dump */
XtSetArg(args[0], XtNleftBitmap, &old_bitmap);
XtGetValues(w, args, ONE);
if (new_bitmap != old_bitmap) {
......@@ -1423,6 +1444,7 @@ set_pagemediaButton_label(int media_id)
if (media_id>=0) {
Widget w;
if (pagemediaEntry[media_id]) w = pagemediaEntry[media_id];
else if (media_id <= 0) w = NULL;
else w = pagemediaEntry[media_id-1];
if (!w)
goto out;
......
......@@ -135,6 +135,7 @@ MiscMenuEntry *miscmenu_parseMiscMenuEntries(s)
}
}
n--;
if (!nl) break;
c=++nl;
}
if (!have_entry) {
......
......@@ -370,6 +370,15 @@ static char* orientation2extern(String