summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlan Coopersmith <alan.coopersmith@oracle.com>2024-02-13 17:31:00 -0800
committerAlan Coopersmith <alan.coopersmith@oracle.com>2024-02-13 17:31:00 -0800
commit3fd68cb4ed34958cfc4d6cea123377f070561181 (patch)
treeac980b344e469c0ed785a99fd35cc792a1acaf6d
parent8d5ae4a89ac057bc26db9c819136460331ffd29b (diff)
unifdef INCLUDE_XPRINT_SUPPORT
Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
-rw-r--r--buttons.c22
-rw-r--r--defs.h7
-rw-r--r--handler.c114
-rw-r--r--main.c3
-rw-r--r--man.h9
5 files changed, 0 insertions, 155 deletions
diff --git a/buttons.c b/buttons.c
index c5fa1a4..18a976d 100644
--- a/buttons.c
+++ b/buttons.c
@@ -282,10 +282,6 @@ CreateManpageWidget(ManpageGlobals * man_globals,
XtSetValues(man_globals->both_screens_entry, arglist, ONE);
}
-#ifdef INCLUDE_XPRINT_SUPPORT
- XtSetArg(arglist[0], XtNsensitive, True);
- XtSetValues(man_globals->print_entry, arglist, ONE);
-#endif /* INCLUDE_XPRINT_SUPPORT */
man_globals->label = XtCreateManagedWidget("manualTitle", labelWidgetClass,
hpane, NULL, (Cardinal) 0);
@@ -441,9 +437,6 @@ CreateOptionMenu(ManpageGlobals * man_globals, Widget parent)
BOTH_SCREENS,
REMOVE_MANPAGE,
OPEN_MANPAGE,
-#ifdef INCLUDE_XPRINT_SUPPORT
- PRINT_MANPAGE,
-#endif /* INCLUDE_XPRINT_SUPPORT */
SHOW_VERSION,
QUIT
};
@@ -479,33 +472,18 @@ CreateOptionMenu(ManpageGlobals * man_globals, Widget parent)
case 6:
man_globals->open_entry = entry;
break;
-#ifdef INCLUDE_XPRINT_SUPPORT
- case 7:
- man_globals->print_entry = entry;
- break;
- case 8:
- man_globals->version_entry = entry;
- break;
- case 9:
- man_globals->quit_entry = entry;
- break;
-#else /* !INCLUDE_XPRINT_SUPPORT */
case 7:
man_globals->version_entry = entry;
break;
case 8:
man_globals->quit_entry = entry;
break;
-#endif /* !INCLUDE_XPRINT_SUPPORT */
default:
Error(("CreateOptionMenu: Unknown id=%d\n", i));
break;
}
}
-#ifdef INCLUDE_XPRINT_SUPPORT
- XtVaSetValues(man_globals->print_entry, XtNsensitive, FALSE, NULL);
-#endif /* INCLUDE_XPRINT_SUPPORT */
}
/* Function Name: CreateSectionMenu
diff --git a/defs.h b/defs.h
index fe09b6b..14fdd11 100644
--- a/defs.h
+++ b/defs.h
@@ -69,11 +69,7 @@ from the X Consortium.
/* Names of the menu buttons */
-#ifdef INCLUDE_XPRINT_SUPPORT
-#define NUM_OPTIONS 10 /* Number of menu options. */
-#else /* !INCLUDE_XPRINT_SUPPORT */
#define NUM_OPTIONS 9 /* Number of menu options. */
-#endif /* !INCLUDE_XPRINT_SUPPORT */
#define DIRECTORY "displayDirectory"
#define MANPAGE "displayManualPage"
@@ -82,9 +78,6 @@ from the X Consortium.
#define BOTH_SCREENS "showBothScreens"
#define REMOVE_MANPAGE "removeThisManpage"
#define OPEN_MANPAGE "openNewManpage"
-#ifdef INCLUDE_XPRINT_SUPPORT
-#define PRINT_MANPAGE "printManualPage"
-#endif /* INCLUDE_XPRINT_SUPPORT */
#define SHOW_VERSION "showVersion"
#define QUIT "quit"
diff --git a/handler.c b/handler.c
index e34995e..fb43c5c 100644
--- a/handler.c
+++ b/handler.c
@@ -41,10 +41,6 @@ from the X Consortium.
#include <sys/stat.h>
#include "globals.h"
#include "vendor.h"
-#ifdef INCLUDE_XPRINT_SUPPORT
-#include "printdialog.h"
-#include "print.h"
-#endif /* INCLUDE_XPRINT_SUPPORT */
#ifdef RELEASE_VERSION
#define XMAN_VERSION "Xman Version " PACKAGE_VERSION " - X11R" RELEASE_VERSION
@@ -90,10 +86,6 @@ OptionCallback(Widget w, XtPointer pointer, XtPointer junk)
RemoveThisManpage(XtParent(w), NULL, NULL, NULL);
else if (w == man_globals->open_entry) /* Open new manpage */
CreateNewManpage(XtParent(w), NULL, NULL, NULL);
-#ifdef INCLUDE_XPRINT_SUPPORT
- else if (w == man_globals->print_entry) /* Print current manpage */
- PrintThisManpage(XtParent(w), NULL, NULL, NULL);
-#endif /* INCLUDE_XPRINT_SUPPORT */
else if (w == man_globals->version_entry) /* Get version */
ShowVersion(XtParent(w), NULL, NULL, NULL);
else if (w == man_globals->quit_entry) /* Quit. */
@@ -639,112 +631,6 @@ Search(Widget w, XEvent * event, String * params, Cardinal * num_params)
}
}
-#ifdef INCLUDE_XPRINT_SUPPORT
-static void
-printshellDestroyXtProc(Widget w, XtPointer client_data, XtPointer callData)
-{
- ManpageGlobals *mg = GetGlobals(w);
-
- XawPrintDialogClosePrinterConnection(mg->printdialog, False);
-}
-
-static void
-printOKXtProc(Widget w, XtPointer client_data, XtPointer callData)
-{
- XawPrintDialogCallbackStruct *pdcs =
- (XawPrintDialogCallbackStruct *) callData;
- Cardinal n;
- Arg args[2];
- ManpageGlobals *mg = GetGlobals(w);
- Widget topwindow = mg->This_Manpage;
- FILE *file;
-
- Log(("printOKXtProc: OK.\n"));
-
- /* Get file object */
- n = 0;
- XtSetArg(args[n], XtNfile, &file);
- n++;
- XtGetValues(mg->manpagewidgets.manpage, args, n);
- Assertion(file != NULL, (("printOKXtProc: file == NULL.\n")));
-
- DoPrintManpage("Xman",
- file, topwindow,
- pdcs->pdpy, pdcs->pcontext, pdcs->colorspace,
- printshellDestroyXtProc,
- mg->manpage_title,
- pdcs->printToFile ? pdcs->printToFileName : NULL);
-
- XtPopdown(mg->printdialog_shell);
-}
-
-static void
-printCancelXtProc(Widget w, XtPointer client_data, XtPointer callData)
-{
- ManpageGlobals *mg = GetGlobals(w);
-
- Log(("printCancelXtProc: cancel.\n"));
- XtPopdown(mg->printdialog_shell);
-
- Log(("destroying print dialog shell...\n"));
- XtDestroyWidget(mg->printdialog_shell);
- mg->printdialog_shell = NULL;
- mg->printdialog = NULL;
- Log(("... done\n"));
-}
-
-/* Function Name: PrintThisManpage
- * Description: Print the current manual page.
- * Arguments: mg - manpage globals
- * Returns: none.
- */
-
-/*ARGSUSED*/
-void
-PrintThisManpage(Widget w, XEvent * event, String * params,
- Cardinal * num_params)
-{
- ManpageGlobals *mg = GetGlobals(w);
- Dimension width, height;
- Position x, y;
- Widget parent = mg->This_Manpage;
- Widget topwindow = mg->This_Manpage;
-
- Log(("print!\n"));
-
- if (!mg->printdialog) {
- int n;
- Arg args[20];
-
- n = 0;
- XtSetArg(args[n], XtNallowShellResize, True);
- n++;
- mg->printdialog_shell = XtCreatePopupShell("printdialogshell",
- transientShellWidgetClass,
- topwindow, args, n);
- n = 0;
- mg->printdialog =
- XtCreateManagedWidget("printdialog", printDialogWidgetClass,
- mg->printdialog_shell, args, n);
- XtAddCallback(mg->printdialog, XawNOkCallback, printOKXtProc, NULL);
- XtAddCallback(mg->printdialog, XawNCancelCallback, printCancelXtProc,
- NULL);
-
- XtRealizeWidget(mg->printdialog_shell);
- }
-
- /* Center dialog */
- XtVaGetValues(mg->printdialog_shell,
- XtNwidth, &width, XtNheight, &height, NULL);
-
- x = (Position) (XWidthOfScreen(XtScreen(parent)) - width) / 2;
- y = (Position) (XHeightOfScreen(XtScreen(parent)) - height) / 3;
-
- XtVaSetValues(mg->printdialog_shell, XtNx, x, XtNy, y, NULL);
-
- XtPopup(mg->printdialog_shell, XtGrabNonexclusive);
-}
-#endif /* INCLUDE_XPRINT_SUPPORT */
/* Function Name: ShowVersion
* Description: Show current version.
diff --git a/main.c b/main.c
index 0d9f3fe..fe61bd2 100644
--- a/main.c
+++ b/main.c
@@ -121,9 +121,6 @@ static XtActionsRec xman_actions[] = {
{"CreateNewManpage", CreateNewManpage},
{"RemoveThisManpage", RemoveThisManpage},
{"SaveFormattedPage", SaveFormattedPage},
-#ifdef INCLUDE_XPRINT_SUPPORT
- {"PrintThisManpage", PrintThisManpage},
-#endif /* INCLUDE_XPRINT_SUPPORT */
{"ShowVersion", ShowVersion},
};
diff --git a/man.h b/man.h
index bdb66e4..a026259 100644
--- a/man.h
+++ b/man.h
@@ -147,11 +147,6 @@ typedef struct _ManpageGlobals {
search_entry, both_screens_entry, remove_entry,
open_entry, print_entry, version_entry, quit_entry;
-#ifdef INCLUDE_XPRINT_SUPPORT
- /* Print objects and data */
- Widget printdialog_shell; /* Shell for the print dialog */
- Widget printdialog; /* Print dialog */
-#endif /*INCLUDE_XPRINT_SUPPORT */
/* Misc. */
char manpage_title[80]; /* The label to use for the current manpage. */
@@ -244,10 +239,6 @@ void SaveFormattedPage(Widget w, XEvent * event, String * params,
Cardinal * num_params);
void Search(Widget w, XEvent * event, String * params, Cardinal * num_params);
-#ifdef INCLUDE_XPRINT_SUPPORT
-void PrintThisManpage(Widget w, XEvent * event, String * params,
- Cardinal * num_params);
-#endif /* INCLUDE_XPRINT_SUPPORT */
void ShowVersion(Widget w, XEvent * event, String * params,
Cardinal * num_params);