forgot to copy the patch over from the old version to the new
authorRyan Phillips <rphillips@gentoo.org>
Mon, 4 Nov 2002 07:44:40 +0000 (07:44 +0000)
committerRyan Phillips <rphillips@gentoo.org>
Mon, 4 Nov 2002 07:44:40 +0000 (07:44 +0000)
app-text/ghostview/files/ghostview-1.5-r1-gentoo.diff [new file with mode: 0644]

diff --git a/app-text/ghostview/files/ghostview-1.5-r1-gentoo.diff b/app-text/ghostview/files/ghostview-1.5-r1-gentoo.diff
new file mode 100644 (file)
index 0000000..4de1cc9
--- /dev/null
@@ -0,0 +1,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;