summaryrefslogtreecommitdiffstats
path: root/contrib/groff/xditview
diff options
context:
space:
mode:
authorasmodai <asmodai@FreeBSD.org>2000-01-12 09:51:43 +0000
committerasmodai <asmodai@FreeBSD.org>2000-01-12 09:51:43 +0000
commit2e2c9047c3a8b5b6fdcdcd4585d5b114f31cd386 (patch)
tree723c5fa18b7084a4da09e4e42000ef10cbc884fa /contrib/groff/xditview
parent35cdaa022af3f495aa21a1292d85ee40b28f86fb (diff)
downloadFreeBSD-src-2e2c9047c3a8b5b6fdcdcd4585d5b114f31cd386.zip
FreeBSD-src-2e2c9047c3a8b5b6fdcdcd4585d5b114f31cd386.tar.gz
Virgin import of FSF groff v1.15
Diffstat (limited to 'contrib/groff/xditview')
-rw-r--r--contrib/groff/xditview/ChangeLog57
-rw-r--r--contrib/groff/xditview/Dvi.c49
-rw-r--r--contrib/groff/xditview/DviP.h2
-rw-r--r--contrib/groff/xditview/GXditview-ad.h52
-rw-r--r--contrib/groff/xditview/Imakefile7
-rw-r--r--contrib/groff/xditview/README2
-rw-r--r--contrib/groff/xditview/TODO2
-rw-r--r--contrib/groff/xditview/ad2c62
-rw-r--r--contrib/groff/xditview/device.c11
-rw-r--r--contrib/groff/xditview/draw.c40
-rw-r--r--contrib/groff/xditview/font.c2
-rw-r--r--contrib/groff/xditview/gray1.bm4
-rw-r--r--contrib/groff/xditview/gray2.bm4
-rw-r--r--contrib/groff/xditview/gray3.bm4
-rw-r--r--contrib/groff/xditview/gray4.bm4
-rw-r--r--contrib/groff/xditview/gray5.bm4
-rw-r--r--contrib/groff/xditview/gray6.bm4
-rw-r--r--contrib/groff/xditview/gray7.bm4
-rw-r--r--contrib/groff/xditview/gray8.bm4
-rw-r--r--contrib/groff/xditview/xditview.c22
-rw-r--r--contrib/groff/xditview/xtotroff.c2
21 files changed, 299 insertions, 43 deletions
diff --git a/contrib/groff/xditview/ChangeLog b/contrib/groff/xditview/ChangeLog
index 35a6924..6dffe9e 100644
--- a/contrib/groff/xditview/ChangeLog
+++ b/contrib/groff/xditview/ChangeLog
@@ -1,3 +1,60 @@
+1999-12-21 Werner LEMBERG <wl@gnu.org>
+
+ * README: Fixed ftp GNU address.
+
+1999-12-13 Werner LEMBERG <wl@gnu.org>
+
+ * device.c: Use extern declarations of strtok(), strchr(), and
+ getenv() only if not defined as macros.
+
+1999-11-18 Larry Jones <larry.jones@sdrc.com>
+
+ * xditview.c: Add fallback_resources to allow running without
+ access to the app-defaults file.
+
+ * Imakefile: Added rule to create app-defaults to a C header file.
+
+ * GXditview-ad.h: New file containing fallback default resources.
+
+ * ad2c: New file to do the app-defaults -> C header file
+ conversion.
+
+1999-10-27 Larry Jones <larry.jones@sdrc.com>
+
+ * font.c (DisposeFontSizes): If there's a problem loading a font,
+ xditview will fall-back and use the default font, but it hasn't
+ checked before unloading fonts which could result in unloading the
+ default font (possibly multiple times) and then X errors.
+
+1999-09-13 Werner LEMBERG <wl@gnu.org>
+
+ * Imakefile (extraclean): Added Makefile.
+
+ * xditview.c (main, MakePrompt): Fixing compilation warnings.
+
+ * TODO: Imakefile should be replaced with a configure script.
+
+1999-09-12 Werner LEMBERG <wl@gnu.org>
+
+ * Imakefile (GROFF_FONTPATH): Another addition.
+
+ * device.c (FONTPATH): Update to match current groff version.
+
+1999-09-11 Larry Jones <larry.jones@sdrc.com>
+
+ * Imakefile (GROFF_LIBDIR, GROFF_FONTPATH): Update to match
+ current groff version.
+
+ * Dvi.c (Realize, Destroy), DviP.h, draw.c (setFillGC), gray*.bm:
+ Allow 8 levels of gray rather than just 1.
+
+ * draw.c (DrawFilledCircle, DrawFilledEllipse, DrawFilledPolygon):
+ Draw outlines to prevent gaps between abutting figures.
+
+1999-05-27 Werner LEMBERG <wl@gnu.org>
+
+ * xtotroff.c (usage): Fixed typo.
+
Mon Sep 11 10:40:33 1995 James Clark <jjc@jclark.com>
* device.c (INT_MIN, INT_MAX): Don't define if already defined.
diff --git a/contrib/groff/xditview/Dvi.c b/contrib/groff/xditview/Dvi.c
index fe4eee2..5eae76d 100644
--- a/contrib/groff/xditview/Dvi.c
+++ b/contrib/groff/xditview/Dvi.c
@@ -186,7 +186,14 @@ static void Initialize(request, new)
dw->dvi.native = 0;
}
-#include <X11/bitmaps/gray>
+#include "gray1.bm"
+#include "gray2.bm"
+#include "gray3.bm"
+#include "gray4.bm"
+#include "gray5.bm"
+#include "gray6.bm"
+#include "gray7.bm"
+#include "gray8.bm"
static void
Realize (w, valueMask, attrs)
@@ -211,16 +218,37 @@ Realize (w, valueMask, attrs)
GCForeground|GCCapStyle|GCJoinStyle
|GCLineWidth,
&values);
- dw->dvi.gray = XCreateBitmapFromData(XtDisplay (w), XtWindow (w),
- gray_bits,
- gray_width, gray_height);
+ dw->dvi.gray[0] = XCreateBitmapFromData(XtDisplay (w), XtWindow (w),
+ gray1_bits,
+ gray1_width, gray1_height);
+ dw->dvi.gray[1] = XCreateBitmapFromData(XtDisplay (w), XtWindow (w),
+ gray2_bits,
+ gray2_width, gray2_height);
+ dw->dvi.gray[2] = XCreateBitmapFromData(XtDisplay (w), XtWindow (w),
+ gray3_bits,
+ gray3_width, gray3_height);
+ dw->dvi.gray[3] = XCreateBitmapFromData(XtDisplay (w), XtWindow (w),
+ gray4_bits,
+ gray4_width, gray4_height);
+ dw->dvi.gray[4] = XCreateBitmapFromData(XtDisplay (w), XtWindow (w),
+ gray5_bits,
+ gray5_width, gray5_height);
+ dw->dvi.gray[5] = XCreateBitmapFromData(XtDisplay (w), XtWindow (w),
+ gray6_bits,
+ gray6_width, gray6_height);
+ dw->dvi.gray[6] = XCreateBitmapFromData(XtDisplay (w), XtWindow (w),
+ gray7_bits,
+ gray7_width, gray7_height);
+ dw->dvi.gray[7] = XCreateBitmapFromData(XtDisplay (w), XtWindow (w),
+ gray8_bits,
+ gray8_width, gray8_height);
values.background = dw->dvi.background;
- values.stipple = dw->dvi.gray;
+ values.stipple = dw->dvi.gray[5];
dw->dvi.fill_GC = XCreateGC (XtDisplay (w), XtWindow (w),
GCForeground|GCBackground|GCStipple,
&values);
- dw->dvi.fill_type = DVI_FILL_BLACK;
+ dw->dvi.fill_type = 9;
if (dw->dvi.file)
OpenFile (dw);
@@ -235,7 +263,14 @@ Destroy(w)
XFreeGC (XtDisplay (w), dw->dvi.normal_GC);
XFreeGC (XtDisplay (w), dw->dvi.fill_GC);
- XFreePixmap (XtDisplay (w), dw->dvi.gray);
+ XFreePixmap (XtDisplay (w), dw->dvi.gray[0]);
+ XFreePixmap (XtDisplay (w), dw->dvi.gray[1]);
+ XFreePixmap (XtDisplay (w), dw->dvi.gray[2]);
+ XFreePixmap (XtDisplay (w), dw->dvi.gray[3]);
+ XFreePixmap (XtDisplay (w), dw->dvi.gray[4]);
+ XFreePixmap (XtDisplay (w), dw->dvi.gray[5]);
+ XFreePixmap (XtDisplay (w), dw->dvi.gray[6]);
+ XFreePixmap (XtDisplay (w), dw->dvi.gray[7]);
DestroyFontMap (dw->dvi.font_map);
DestroyFileMap (dw->dvi.file_map);
device_destroy (dw->dvi.device);
diff --git a/contrib/groff/xditview/DviP.h b/contrib/groff/xditview/DviP.h
index c3b7d2c..851fdfe 100644
--- a/contrib/groff/xditview/DviP.h
+++ b/contrib/groff/xditview/DviP.h
@@ -168,7 +168,7 @@ typedef struct {
#define DVI_FILL_GRAY 1
#define DVI_FILL_BLACK 2
int fill_type;
- Pixmap gray;
+ Pixmap gray[8];
int backing_store;
XFontStruct *font;
int display_enable;
diff --git a/contrib/groff/xditview/GXditview-ad.h b/contrib/groff/xditview/GXditview-ad.h
new file mode 100644
index 0000000..d9be3da
--- /dev/null
+++ b/contrib/groff/xditview/GXditview-ad.h
@@ -0,0 +1,52 @@
+"GXditview.height: 840",
+"GXditview.paned.allowResize: true",
+"GXditview.paned.viewport.allowVert: true",
+"GXditview.paned.viewport.allowHoriz: true",
+"GXditview.paned.viewport.skipAdjust: false",
+"GXditview.paned.viewport.width: 600",
+"GXditview.paned.viewport.height: 800",
+"GXditview.paned.viewport.showGrip: false",
+"GXditview.paned.label.skipAdjust: true",
+"GXditview.paned.viewport.dvi.translations: #augment \
+ <Btn1Down>: XawPositionSimpleMenu(menu) MenuPopup(menu)\\n\
+ <Key>Next: NextPage()\\n\
+ <Key>n: NextPage()\\n\
+ <Key>space: NextPage()\\n\
+ <Key>Return: NextPage()\\n\
+ <Key>Prior: PreviousPage()\\n\
+ <Key>p: PreviousPage()\\n\
+ <Key>BackSpace: PreviousPage()\\n\
+ <Key>Delete: PreviousPage()\\n\
+ <Key>Select: SelectPage()\\n\
+ <Key>Find: OpenFile()\\n\
+ <Key>r: Rerasterize()\\n\
+ <Key>q: Quit()",
+"GXditview.paned.label.translations: #augment \
+ <Btn1Down>: XawPositionSimpleMenu(menu) MenuPopup(menu)\\n\
+ <Key>Next: NextPage()\\n\
+ <Key>n: NextPage()\\n\
+ <Key>space: NextPage()\\n\
+ <Key>Return: NextPage()\\n\
+ <Key>Prior: PreviousPage()\\n\
+ <Key>p: PreviousPage()\\n\
+ <Key>BackSpace: PreviousPage()\\n\
+ <Key>Delete: PreviousPage()\\n\
+ <Key>Select: SelectPage()\\n\
+ <Key>Find: OpenFile()\\n\
+ <Key>r: Rerasterize()\\n\
+ <Key>q: Quit()",
+"GXditview.menu.nextPage.label: Next Page",
+"GXditview.menu.previousPage.label: Previous Page",
+"GXditview.menu.selectPage.label: Select Page",
+"GXditview.menu.print.label: Print",
+"GXditview.menu.openFile.label: Open",
+"GXditview.menu.quit.label: Quit",
+"GXditview.promptShell.allowShellResize: true",
+"GXditview.promptShell.promptDialog.value.translations: #override \
+ <Key>Return: Accept()",
+"GXditview.promptShell.promptDialog.accept.label: Accept",
+"GXditview.promptShell.promptDialog.accept.translations: #override \
+ <BtnUp>: Accept() unset()",
+"GXditview.promptShell.promptDialog.cancel.label: Cancel",
+"GXditview.promptShell.promptDialog.cancel.translations: #override \
+ <BtnUp>: Cancel() unset()",
diff --git a/contrib/groff/xditview/Imakefile b/contrib/groff/xditview/Imakefile
index 62ac707..e0a9c66 100644
--- a/contrib/groff/xditview/Imakefile
+++ b/contrib/groff/xditview/Imakefile
@@ -1,4 +1,4 @@
-GROFF_LIBDIR = /usr/local/lib/groff
+GROFF_LIBDIR = /usr/local/share/groff
GROFF_FONTDIR = $(GROFF_LIBDIR)/font
GROFF_FONTPATH = .:$(GROFF_FONTDIR):/usr/local/lib/font:/usr/lib/font
DPIS = 75 100
@@ -46,7 +46,10 @@ fonts: xtotroff DESC FontMap
$$dir/xtotroff -g -r $$dpi -s 12 $$dir/FontMap); \
done
+GXditview-ad.h: GXditview.ad
+ /bin/sh ad2c GXditview.ad >GXditview-ad.h
+
extraclean: clean
- -rm -f junk tmp grot old
+ -rm -f junk tmp grot old Makefile
FORCE:
diff --git a/contrib/groff/xditview/README b/contrib/groff/xditview/README
index b99a991..7e061b0 100644
--- a/contrib/groff/xditview/README
+++ b/contrib/groff/xditview/README
@@ -8,7 +8,7 @@ See the file INSTALL in this directory for installation instructions.
xditview is copyrighted by MIT under the usual X terms (see
gxditview.man); my changes to it are in the public domain.
-Please report bugs to bug-groff@prep.ai.mit.edu.
+Please report bugs to bug-groff@gnu.org.
James Clark
jjc@jclark.com
diff --git a/contrib/groff/xditview/TODO b/contrib/groff/xditview/TODO
index 83a3ca1..161a7cf 100644
--- a/contrib/groff/xditview/TODO
+++ b/contrib/groff/xditview/TODO
@@ -1,3 +1,5 @@
+Replace Imakefile with a configure script.
+
Better error handling.
Resource and command-line option to specify font path.
diff --git a/contrib/groff/xditview/ad2c b/contrib/groff/xditview/ad2c
new file mode 100644
index 0000000..651ab8c
--- /dev/null
+++ b/contrib/groff/xditview/ad2c
@@ -0,0 +1,62 @@
+#!/bin/sh
+#
+# ad2c : Convert app-defaults file to C strings decls.
+#
+# George Ferguson, ferguson@cs.rcohester.edu, 12 Nov 1990.
+# 19 Mar 1991: gf
+# Made it self-contained.
+# 6 Jan 1992: mycroft@gnu.ai.mit.edu (Charles Hannum)
+# Removed use of "-n" and ":read" label since Gnu and
+# IBM sed print pattern space on "n" command. Still works
+# with Sun sed, of course.
+# 7 Jan 1992: matthew@sunpix.East.Sun.COM (Matthew Stier)
+# Escape quotes after escaping backslashes.
+# 8 Jul 1992: Version 1.6
+# Manpage fixes.
+# 19 Apr 1993: Version 1.7
+# Remove comments that were inside the sed command since
+# some versions of sed don't like them. The comments are
+# now given here in the header.
+#
+# Comments on the script by line:
+# /^!/d Remove comments
+# /^$/d Remove blanks
+# s/\\/\\\\/g Escape backslashes...
+# s/\\$//g ...except the line continuation ones
+# s/"/\\"/g Escape quotes
+# s/^/"/ Add leading quote
+# : test Establish label for later branch
+# /\\$/b slash Branch to label "slash" if line ends in backslash
+# s/$/",/ Otherwise add closing quote and comma...
+# p ...output the line...
+# d ...and clear the pattern space so it's not printed again
+# : slash Branch comes here if line ends in backslash
+# n Read next line, append to pattern space
+# [...] The "d" and "s" commands that follow just delete
+# comments and blank lines and escape control sequences
+# b test Branch up to see if the line ends in backslash or not
+#
+
+sed '
+/^!/d
+/^$/d
+s/\\/\\\\/g
+s/\\$//g
+s/"/\\"/g
+s/^/"/
+: test
+/\\$/b slash
+s/$/",/
+p
+d
+: slash
+n
+/^!/d
+/^$/d
+s/"/\\"/g
+s/\\\\/\\/g
+s/\\n/\\\\n/g
+s/\\t/\\\\t/g
+s/\\f/\\\\f/g
+s/\\b/\\\\b/g
+b test' "$@"
diff --git a/contrib/groff/xditview/device.c b/contrib/groff/xditview/device.c
index 399f064..f1e51de 100644
--- a/contrib/groff/xditview/device.c
+++ b/contrib/groff/xditview/device.c
@@ -9,7 +9,7 @@
#include "device.h"
#ifndef FONTPATH
-#define FONTPATH "/usr/local/lib/groff/font:/usr/local/lib/font:/usr/lib/font"
+#define FONTPATH "/usr/local/share/groff/font:/usr/local/lib/font:/usr/lib/font"
#endif
#ifndef isascii
@@ -17,8 +17,15 @@
#endif
extern void exit();
-extern char *strtok(), *strchr();
+#ifndef strtok
+extern char *strtok();
+#endif
+#ifndef strchr
+extern char *strchr();
+#endif
+#ifndef getenv
extern char *getenv();
+#endif
/* Name of environment variable containing path to be used for
searching for device and font description files. */
diff --git a/contrib/groff/xditview/draw.c b/contrib/groff/xditview/draw.c
index 7715cde..69e86cd 100644
--- a/contrib/groff/xditview/draw.c
+++ b/contrib/groff/xditview/draw.c
@@ -422,32 +422,24 @@ setFillGC (dw)
DviWidget dw;
{
int fill_type;
-
- if (dw->dvi.fill == DVI_FILL_MAX)
- fill_type = DVI_FILL_BLACK;
- else if (dw->dvi.fill == 0)
- fill_type = DVI_FILL_WHITE;
- else
- fill_type = DVI_FILL_GRAY;
+ unsigned long mask = GCFillStyle | GCForeground;
+
+ fill_type = (dw->dvi.fill * 10) / (DVI_FILL_MAX + 1);
if (dw->dvi.fill_type != fill_type) {
XGCValues values;
- switch (fill_type) {
- case DVI_FILL_WHITE:
+ if (fill_type <= 0) {
values.foreground = dw->dvi.background;
values.fill_style = FillSolid;
- break;
- case DVI_FILL_BLACK:
+ } else if (fill_type >= 9) {
values.foreground = dw->dvi.foreground;
values.fill_style = FillSolid;
- break;
- case DVI_FILL_GRAY:
+ } else {
values.foreground = dw->dvi.foreground;
values.fill_style = FillOpaqueStippled;
- break;
+ values.stipple = dw->dvi.gray[fill_type - 1];
+ mask |= GCStipple;
}
- XChangeGC(XtDisplay (dw), dw->dvi.fill_GC,
- GCFillStyle|GCForeground,
- &values);
+ XChangeGC(XtDisplay (dw), dw->dvi.fill_GC, mask, &values);
dw->dvi.fill_type = fill_type;
}
}
@@ -493,6 +485,9 @@ DrawFilledCircle (dw, diam)
XFillArc (XtDisplay (dw), XtWindow (dw), dw->dvi.fill_GC,
XPos (dw), YPos (dw) - d/2,
d, d, 0, 64*360);
+ XDrawArc (XtDisplay (dw), XtWindow (dw), dw->dvi.fill_GC,
+ XPos (dw), YPos (dw) - d/2,
+ d, d, 0, 64*360);
}
DrawEllipse (dw, a, b)
@@ -515,6 +510,9 @@ DrawFilledEllipse (dw, a, b)
XFillArc (XtDisplay (dw), XtWindow (dw), dw->dvi.fill_GC,
XPos (dw), YPos (dw) - DeviceToX (dw, b/2),
DeviceToX (dw, a), DeviceToX (dw, b), 0, 64*360);
+ XDrawArc (XtDisplay (dw), XtWindow (dw), dw->dvi.fill_GC,
+ XPos (dw), YPos (dw) - DeviceToX (dw, b/2),
+ DeviceToX (dw, a), DeviceToX (dw, b), 0, 64*360);
}
DrawArc (dw, x0, y0, x1, y1)
@@ -590,9 +588,9 @@ DrawFilledPolygon (dw, v, n)
AdjustCacheDeltas (dw);
setFillGC (dw);
- p = (XPoint *)XtMalloc((n + 1)*sizeof(XPoint));
- p[0].x = XPos (dw);
- p[0].y = YPos (dw);
+ p = (XPoint *)XtMalloc((n + 2)*sizeof(XPoint));
+ p[0].x = p[n+1].x = XPos (dw);
+ p[0].y = p[n+1].y = YPos (dw);
dx = 0;
dy = 0;
for (i = 0; i < n; i++) {
@@ -603,6 +601,8 @@ DrawFilledPolygon (dw, v, n)
}
XFillPolygon (XtDisplay (dw), XtWindow (dw), dw->dvi.fill_GC,
p, n + 1, Complex, CoordModeOrigin);
+ XDrawLines (XtDisplay (dw), XtWindow (dw), dw->dvi.fill_GC,
+ p, n + 2, CoordModeOrigin);
XtFree((char *)p);
}
diff --git a/contrib/groff/xditview/font.c b/contrib/groff/xditview/font.c
index ecfba4e..2e028aa 100644
--- a/contrib/groff/xditview/font.c
+++ b/contrib/groff/xditview/font.c
@@ -202,7 +202,7 @@ DisposeFontSizes (dw, fs)
next = fs->next;
if (fs->x_name)
XtFree (fs->x_name);
- if (fs->font) {
+ if (fs->font && fs->font != dw->dvi.default_font) {
XUnloadFont (XtDisplay (dw), fs->font->fid);
XFree ((char *)fs->font);
}
diff --git a/contrib/groff/xditview/gray1.bm b/contrib/groff/xditview/gray1.bm
new file mode 100644
index 0000000..c40a95e
--- /dev/null
+++ b/contrib/groff/xditview/gray1.bm
@@ -0,0 +1,4 @@
+#define gray1_width 3
+#define gray1_height 3
+static char gray1_bits[] = {
+ 0x00, 0x02, 0x00};
diff --git a/contrib/groff/xditview/gray2.bm b/contrib/groff/xditview/gray2.bm
new file mode 100644
index 0000000..e87a1bc
--- /dev/null
+++ b/contrib/groff/xditview/gray2.bm
@@ -0,0 +1,4 @@
+#define gray2_width 3
+#define gray2_height 3
+static char gray2_bits[] = {
+ 0x00, 0x03, 0x00};
diff --git a/contrib/groff/xditview/gray3.bm b/contrib/groff/xditview/gray3.bm
new file mode 100644
index 0000000..d9313eb
--- /dev/null
+++ b/contrib/groff/xditview/gray3.bm
@@ -0,0 +1,4 @@
+#define gray3_width 3
+#define gray3_height 3
+static char gray3_bits[] = {
+ 0x00, 0x03, 0x02};
diff --git a/contrib/groff/xditview/gray4.bm b/contrib/groff/xditview/gray4.bm
new file mode 100644
index 0000000..dad142a
--- /dev/null
+++ b/contrib/groff/xditview/gray4.bm
@@ -0,0 +1,4 @@
+#define gray4_width 3
+#define gray4_height 3
+static char gray4_bits[] = {
+ 0x00, 0x07, 0x02};
diff --git a/contrib/groff/xditview/gray5.bm b/contrib/groff/xditview/gray5.bm
new file mode 100644
index 0000000..5f57618
--- /dev/null
+++ b/contrib/groff/xditview/gray5.bm
@@ -0,0 +1,4 @@
+#define gray5_width 3
+#define gray5_height 3
+static char gray5_bits[] = {
+ 0x04, 0x07, 0x02};
diff --git a/contrib/groff/xditview/gray6.bm b/contrib/groff/xditview/gray6.bm
new file mode 100644
index 0000000..b76701d
--- /dev/null
+++ b/contrib/groff/xditview/gray6.bm
@@ -0,0 +1,4 @@
+#define gray6_width 3
+#define gray6_height 3
+static char gray6_bits[] = {
+ 0x04, 0x07, 0x03};
diff --git a/contrib/groff/xditview/gray7.bm b/contrib/groff/xditview/gray7.bm
new file mode 100644
index 0000000..ef47bc6
--- /dev/null
+++ b/contrib/groff/xditview/gray7.bm
@@ -0,0 +1,4 @@
+#define gray7_width 3
+#define gray7_height 3
+static char gray7_bits[] = {
+ 0x05, 0x07, 0x03};
diff --git a/contrib/groff/xditview/gray8.bm b/contrib/groff/xditview/gray8.bm
new file mode 100644
index 0000000..12de7cb
--- /dev/null
+++ b/contrib/groff/xditview/gray8.bm
@@ -0,0 +1,4 @@
+#define gray8_width 3
+#define gray8_height 3
+static char gray8_bits[] = {
+ 0x05, 0x07, 0x07};
diff --git a/contrib/groff/xditview/xditview.c b/contrib/groff/xditview/xditview.c
index 6894cee..e836cf5 100644
--- a/contrib/groff/xditview/xditview.c
+++ b/contrib/groff/xditview/xditview.c
@@ -57,6 +57,11 @@ static char rcsid[] = "$XConsortium: xditview.c,v 1.17 89/12/10 17:05:08 rws Exp
extern FILE *popen();
extern void exit();
+static String fallback_resources[] = {
+#include "GXditview-ad.h"
+ NULL
+};
+
static struct app_resources {
char *print_command;
char *filename;
@@ -156,7 +161,7 @@ XtActionsRec xditview_actions[] = {
static char pageLabel[256] = "Page <none>";
-void main(argc, argv)
+int main(argc, argv)
int argc;
char **argv;
{
@@ -165,14 +170,15 @@ void main(argc, argv)
static Arg labelArgs[] = {
{XtNlabel, (XtArgVal) pageLabel},
};
+ XtAppContext xtcontext;
Arg topLevelArgs[2];
Widget entry;
Arg pageNumberArgs[1];
int page_number;
- toplevel = XtInitialize("main", "GXditview",
+ toplevel = XtAppInitialize(&xtcontext, "GXditview",
options, XtNumber (options),
- &argc, argv);
+ &argc, argv, fallback_resources, NULL, 0);
if (argc > 2)
Syntax(argv[0]);
@@ -182,8 +188,7 @@ void main(argc, argv)
if (app_resources.print_command)
strcpy(current_print_command, app_resources.print_command);
- XtAppAddActions(XtWidgetToApplicationContext(toplevel),
- xditview_actions, XtNumber (xditview_actions));
+ XtAppAddActions(xtcontext, xditview_actions, XtNumber (xditview_actions));
XtSetArg (topLevelArgs[0], XtNiconPixmap,
XCreateBitmapFromData (XtDisplay (toplevel),
@@ -228,7 +233,8 @@ void main(argc, argv)
XtRealizeWidget (toplevel);
if (file_name)
SetPageNumber (page_number);
- XtMainLoop();
+ XtAppMainLoop(xtcontext);
+ return 0;
}
static void
@@ -515,8 +521,8 @@ void (*func)();
char *def;
{
static Arg dialogArgs[] = {
- {XtNlabel, NULL},
- {XtNvalue, NULL},
+ {XtNlabel, 0},
+ {XtNvalue, 0},
};
Arg valueArgs[1];
Arg centerArgs[2];
diff --git a/contrib/groff/xditview/xtotroff.c b/contrib/groff/xditview/xtotroff.c
index 16e8c26..3e4e78b 100644
--- a/contrib/groff/xditview/xtotroff.c
+++ b/contrib/groff/xditview/xtotroff.c
@@ -207,7 +207,7 @@ static usage(prog)
char *prog;
{
fprintf (stderr,
- "usage: %s [-g] [-r resolution] [-s pointsize FontMap\n",
+ "usage: %s [-g] [-r resolution] [-s pointsize] FontMap\n",
prog);
exit (1);
}
OpenPOWER on IntegriCloud