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
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
|
diff -u -r ghostview-1.5.orig/Ghostview.c ghostview-1.5/Ghostview.c
--- ghostview-1.5.orig/Ghostview.c Sat Jul 24 02:29:12 1993
+++ ghostview-1.5/Ghostview.c Fri Nov 9 20:41:29 2001
@@ -1112,7 +1112,7 @@
if (gvw->ghostview.disable_start) return;
argv[argc++] = gvw->ghostview.interpreter;
- argv[argc++] = "-sDEVICE=x11";
+ argv[argc++] = "-sDEVICE=x11alpha";
argv[argc++] = "-dNOPAUSE";
if (gvw->ghostview.quiet) argv[argc++] = "-dQUIET";
if (gvw->ghostview.safer) argv[argc++] = "-dSAFER";
@@ -1832,7 +1832,7 @@
** Build Ghostscript startup command
*/
strcpy(cmd, gvw->ghostview.interpreter);
- strcat(cmd, " \"-sDEVICE=x11\" \"-dNOPAUSE\" ");
+ strcat(cmd, " \"-sDEVICE=x11alpha\" \"-dNOPAUSE\" ");
if (gvw->ghostview.quiet) strcat(cmd, "\"-dQUIET\" ");
if (gvw->ghostview.safer) strcat(cmd, "\"-dSAFER\" ");
if (gvw->ghostview.arguments) {
diff -u -r ghostview-1.5.orig/SelFile.c ghostview-1.5/SelFile.c
--- ghostview-1.5.orig/SelFile.c Sat Nov 10 00:01:06 2001
+++ ghostview-1.5/SelFile.c Sat Nov 10 00:01:20 2001
@@ -44,9 +44,11 @@
#include <stdio.h>
#include <errno.h>
/* BSD 4.3 errno.h does not declare errno */
+#ifdef BSD
extern int errno;
extern int sys_nerr;
extern char *sys_errlist[];
+#endif
#include <sys/param.h>
#include <X11/cursorfont.h>
@@ -685,7 +687,7 @@
SFpositionWidget(selFile);
XtMapWidget(selFile);
-#if defined(SVR4) || defined(SYSV) || defined(USG)
+#if defined(SVR4) || defined(SYSV) || defined(USG) || defined(__GLIBC__)
if (!getcwd(SFstartDir, MAXPATHLEN)) {
#else /* defined(SVR4) || defined(SYSV) || defined(USG) */
if (!getwd(SFstartDir)) {
diff -u -r ghostview-1.5.orig/ghostview.man ghostview-1.5/ghostview.man
--- ghostview-1.5.orig/ghostview.man Sat Jul 24 02:29:12 1993
+++ ghostview-1.5/ghostview.man Thu Nov 8 06:32:50 2001
@@ -33,7 +33,7 @@
.br
.B ghostview
[\-monochrome] [\-grayscale] [\-color]
-[\-[no]title] [\-[no]date] [\-[no]locator] [\-[no]labels]
+[\-[no]title] [\-[no]wtitle] [\-[no]date] [\-[no]locator] [\-[no]labels]
[\-resolution\ \fIdpi\fP] [\-dpi\ \fIdpi\fP]
[\-xdpi\ \fIdpi\fP] [\-ydpi\ \fIdpi\fP] [\-magstep\ \fIn\fP]
[\-[no]safer] [\-[no]quiet] [\-arguments\ \fIarguments\fP]
@@ -463,6 +463,9 @@
.IP "\fBshowTitle (\fPclass\fB Labels)\fP" 1i
Tells whether to display the \fB%%Title\fP comment.
The default is ``true''.
+.IP "\fBwindowTitle (\fPclass\fB Labels)\fP" 1i
+Tells whether to copy the \fB%%Title\fP comment into the window title.
+The default is ``true''.
.IP "\fBshowDate (\fPclass\fB Labels)\fP" 1i
Tells whether to display the \fB%%Data\fP comment.
The default is ``true''.
@@ -623,6 +626,10 @@
Equivalent to setting ``Ghostview.showTitle: True''.
.IP \fB\-notitle\fP 1i
Equivalent to setting ``Ghostview.showTitle: False''.
+.IP \fB\-wtitle\fP 1i
+Equivalent to setting ``Ghostview.windowTitle: True''.
+.IP \fB\-nowtitle\fP 1i
+Equivalent to setting ``Ghostview.windowTitle: False''.
.IP \fB\-date\fP 1i
Equivalent to setting ``Ghostview.showDate: True''.
.IP \fB\-nodate\fP 1i
diff -u -r ghostview-1.5.orig/gv.h ghostview-1.5/gv.h
--- ghostview-1.5.orig/gv.h Sat Jul 24 02:29:12 1993
+++ ghostview-1.5/gv.h Thu Nov 8 06:32:50 2001
@@ -39,6 +39,7 @@
/* Application resources */
typedef struct _AppResources {
Boolean show_title; /* whether to show title */
+ Boolean window_title; /* whether to put document title in window title */
Boolean show_date; /* whether to show date */
Boolean show_locator; /* whether to show locator */
Boolean auto_center; /* whether to automatically center the page */
@@ -103,6 +104,8 @@
extern XErrorHandler old_Xerror;
extern Boolean dying;
extern XErrorEvent bomb;
+extern XTextProperty nameprop;
+extern String version;
enum {OPEN, PRINT_WHOLE, PRINT_MARKED, SAVE};
extern int mode;
diff -u -r ghostview-1.5.orig/main.c ghostview-1.5/main.c
--- ghostview-1.5.orig/main.c Sat Jul 24 02:29:12 1993
+++ ghostview-1.5/main.c Thu Nov 8 06:32:50 2001
@@ -55,11 +55,13 @@
extern char *getenv();
-static String version = "Ghostview, version 1.5";
+String version = "Ghostview, version 1.5";
static XtResource resources[] = {
{"showTitle", "Labels", XtRBoolean, sizeof(Boolean),
XtOffsetOf(AppResources, show_title), XtRImmediate, (XtPointer)True},
+ {"windowTitle", "Labels", XtRBoolean, sizeof(Boolean),
+ XtOffsetOf(AppResources, window_title), XtRImmediate, (XtPointer)True},
{"showDate", "Labels", XtRBoolean, sizeof(Boolean),
XtOffsetOf(AppResources, show_date), XtRImmediate, (XtPointer)True},
{"showLocator", "Labels", XtRBoolean, sizeof(Boolean),
@@ -138,6 +140,8 @@
{"-page", ".page", XrmoptionSepArg, NULL},
{"-title", ".showTitle", XrmoptionNoArg, "True"},
{"-notitle", ".showTitle", XrmoptionNoArg, "False"},
+ {"-wtitle", ".windowTitle", XrmoptionNoArg, "True"},
+ {"-nowtitle", ".windowTitle", XrmoptionNoArg, "False"},
{"-date", ".showDate", XrmoptionNoArg, "True"},
{"-nodate", ".showDate", XrmoptionNoArg, "False"},
{"-locator", ".showLocator", XrmoptionNoArg, "True"},
@@ -287,6 +291,7 @@
XErrorHandler old_Xerror; /* standard error handler */
Boolean dying; /* whether an X error caused our exit */
XErrorEvent bomb; /* what the error was */
+XTextProperty nameprop; /* the XStringProperty for the window name */
XtAppContext app_con;
AppResources app_res;
@@ -363,7 +368,6 @@
Boolean set_vert_dist;
String s1, s2;
XFontStruct *font;
- XTextProperty nameprop;
Dimension bottomMargin, leftMargin, rightMargin, topMargin;
Dimension width, height;
Dimension button_width;
@@ -371,6 +375,7 @@
static XawTextSelectType sarry[] =
{XawselectLine, XawselectAll, XawselectNull};
+ nameprop.value= 0;
XtToolkitInitialize();
XtSetTypeConverter(XtRString, XtRPageOrientation,
XmuCvtStringToPageOrientation, NULL, 0,
@@ -871,7 +876,7 @@
XtSetArg(args[0], XtNtransientFor, toplevel);
XtSetValues(dialogpopup, args, ONE);
XSetWMProtocols(dpy, XtWindow(toplevel), &wm_delete_window, 1);
- if (XStringListToTextProperty(&version, 1, &nameprop)) {
+ if (nameprop.value) {
XSetWMName(dpy, XtWindow(toplevel), &nameprop);
}
diff -u -r ghostview-1.5.orig/misc.c ghostview-1.5/misc.c
--- ghostview-1.5.orig/misc.c Sat Jul 24 02:29:12 1993
+++ ghostview-1.5/misc.c Thu Nov 8 06:32:50 2001
@@ -56,10 +56,13 @@
#include <errno.h>
/* BSD 4.3 errno.h does not declare errno */
-extern int errno;
+
#ifdef VMS
#include <perror.h>
-#else
+#endif
+
+#ifdef BSD
+extern int errno;
extern int sys_nerr;
extern char *sys_errlist[];
#endif
@@ -297,6 +300,7 @@
static String nothing = "";
String label;
Pixmap bitmap;
+ char *title, *versionfilename;
/* Reset to a known state. */
psfree(olddoc);
@@ -328,6 +332,30 @@
titlemenu = build_label_menu(titlebutton, "title", label, bitmap);
}
+ if (nameprop.value) {
+ XFree(nameprop.value);
+ nameprop.value = 0;
+ }
+ if (app_res.window_title) {
+ if (doc && doc->title) {
+ title = doc->title;
+ } else if (filename) {
+ title = filename;
+ } else {
+ title = "";
+ }
+ versionfilename = XtMalloc(strlen(version)+3+strlen(title)+1);
+ strcpy(versionfilename, version);
+ strcat(versionfilename, " - ");
+ strcat(versionfilename, title);
+ XStringListToTextProperty(&versionfilename, 1, &nameprop);
+ XtFree(versionfilename);
+ } else {
+ XStringListToTextProperty(&version, 1, &nameprop);
+ }
+ if (nameprop.value && XtIsRealized(toplevel)) {
+ XSetWMName(XtDisplay(toplevel), XtWindow(toplevel), &nameprop);
+ }
if (app_res.show_date) {
if (doc && doc->date) {
label = doc->date;
|