diff options
author | Kristian Høgsberg <krh@redhat.com> | 2004-08-16 16:36:16 +0000 |
---|---|---|
committer | Kristian Høgsberg <krh@redhat.com> | 2004-08-16 16:36:16 +0000 |
commit | 6b12ddbb33c8722e50e7f69f456ba0ba72b76ddd (patch) | |
tree | 6dc1ed1e5b008f3ce289ef72986761931d03336e /commands.c | |
parent | d980ac394b3f828ce3c03d5894218d712d7b2846 (diff) |
As discussed and agreed on on the release-wranglers meeting of August 16,XORG-6_7_99_903XORG-6_7_99_902XORG-6_7_99_901
I'm committing the patch from bug #1060 to back out unconditional
Xprint functionality.
Back out Xprint changes.
Revert xman to CVS of June 5, revert xlogo to CVS of May 8, revert xedit to
CVS of April 25, to back out unconditional Xprint support.
Fix up Xprint config logic to be like the rest of the extensions:
BuildXprint is a one-stop option for disabling everything Xprint
related. XprtServer controls building Xprt, BuildXprintLib controls
building Xprint libs and BuildXprintClients controls building clients
related to Xprint. BuiltXprint defaults to YES and the other options
respects relevant settings, i.e. BuildServer and BuildServersOnly.
Build Xaw regardless of BuildXprintLib setting.
Only build xphelloworld, xplsprinters and xprehashprinterlist when
BuildXprintClients it YES. Disable building xmore, it has always
supported XawPrintShell.
Make Xprint support depend on BuildXprintLib.
Diffstat (limited to 'commands.c')
-rw-r--r-- | commands.c | 124 |
1 files changed, 4 insertions, 120 deletions
@@ -29,14 +29,10 @@ #include <X11/Xfuncs.h> #include <X11/Xos.h> #include "xedit.h" -#include "printdialog.h" -#include "print.h" #ifdef CRAY #include <unistd.h> #endif #include <stdlib.h> -#include <stdio.h> -#include <limits.h> #include <string.h> #include <dirent.h> #include <pwd.h> @@ -45,17 +41,6 @@ #include <X11/IntrinsicP.h> #include <X11/Xaw/TextSrcP.h> -/* Turn a NULL pointer string into an empty string */ -#define NULLSTR(x) (((x)!=NULL)?(x):("")) - -#define Error(x) { printf x ; exit(EXIT_FAILURE); } -#define Assertion(expr, msg) { if (!(expr)) { Error msg } } -#define Log(x) { if (True) printf x; } - -static Widget printdialog_shell = NULL; -static Widget printdialog = NULL; -static char printJobNameBuffer[PATH_MAX+256]; - void ResetSourceChanged(xedit_flist_item*); static void ResetDC(Widget, XtPointer, XtPointer); @@ -353,8 +338,8 @@ DoSave(Widget w, XtPointer client_data, XtPointer call_data) XtRemoveCallback(scratch, XtNcallback, SourceChanged, (XtPointer)item); item->source = scratch = - XtVaCreateWidget("textSource", - multiSrcObjectClass, + XtVaCreateWidget("textSource", international ? + multiSrcObjectClass : asciiSrcObjectClass, topwindow, XtNtype, XawAsciiFile, XtNeditType, XawtextEdit, @@ -491,8 +476,8 @@ ReallyDoLoad(char *name, char *filename) XtSetArg(args[num_args], XtNstring, NULL); num_args++; } - source = XtVaCreateWidget("textSource", - multiSrcObjectClass, + source = XtVaCreateWidget("textSource", international ? + multiSrcObjectClass : asciiSrcObjectClass, topwindow, XtNtype, XawAsciiFile, XtNeditType, XawtextEdit, @@ -515,107 +500,6 @@ ReallyDoLoad(char *name, char *filename) return (True); } -static void -printshellDestroyXtProc(Widget w, XtPointer client_data, XtPointer callData) -{ - XawPrintDialogClosePrinterConnection(printdialog, False); -} - -static void -printOKXtProc(Widget w, XtPointer client_data, XtPointer callData) -{ - XawPrintDialogCallbackStruct *pdcs = (XawPrintDialogCallbackStruct *)callData; - Cardinal n; - Arg args[2]; - Widget textsource; - - Log(("printOKXtProc: OK.\n")); - - /* Get TextSource object */ - n = 0; - XtSetArg(args[n], XtNtextSource, &textsource); n++; - XtGetValues(textwindow, args, n); - - Assertion(textsource != NULL, (("printOKXtProc: textsource == NULL.\n"))); - - /* ||printJobNameBuffer| must live as long the print job prints - * because it is used for the job title AND the page headers... */ - sprintf(printJobNameBuffer, "Xedit print job"); - - DoPrintTextSource("Xedit", - textsource, topwindow, - pdcs->pdpy, pdcs->pcontext, printshellDestroyXtProc, - printJobNameBuffer, - pdcs->printToFile?pdcs->printToFileName:NULL); - - XtPopdown(printdialog_shell); -} - -static void -printCancelXtProc(Widget w, XtPointer client_data, XtPointer callData) -{ - Log(("printCancelXtProc: cancel.\n")); - XtPopdown(printdialog_shell); - - Log(("destroying print dialog shell...\n")); - XtDestroyWidget(printdialog_shell); - printdialog_shell = NULL; - printdialog = NULL; - Log(("... done\n")); -} - - -/*ARGSUSED*/ -void -PrintFile(Widget w, XEvent *event, String *params, Cardinal *num_params) -{ - DoPrint(w, NULL, NULL); -} - -/*ARGSUSED*/ -void -DoPrint(Widget w, XtPointer client_data, XtPointer call_data) -{ - Dimension width, height; - Position x, y; - Widget parent = topwindow; - Log(("print!\n")); - - if (!printdialog) { - int n; - Arg args[20]; - - n = 0; - XtSetArg(args[n], XtNallowShellResize, True); n++; - printdialog_shell = XtCreatePopupShell("printdialogshell", - transientShellWidgetClass, - topwindow, args, n); - n = 0; - printdialog = XtCreateManagedWidget("printdialog", printDialogWidgetClass, - printdialog_shell, args, n); - XtAddCallback(printdialog, XawNOkCallback, printOKXtProc, NULL); - XtAddCallback(printdialog, XawNCancelCallback, printCancelXtProc, NULL); - - XtRealizeWidget(printdialog_shell); - } - - /* Center dialog */ - XtVaGetValues(printdialog_shell, - XtNwidth, &width, - XtNheight, &height, - NULL); - - x = (Position)(XWidthOfScreen( XtScreen(parent)) - width) / 2; - y = (Position)(XHeightOfScreen(XtScreen(parent)) - height) / 3; - - XtVaSetValues(printdialog_shell, - XtNx, x, - XtNy, y, - NULL); - - XtPopup(printdialog_shell, XtGrabNonexclusive); -} - /* Function Name: SourceChanged * Description: A callback routine called when the source has changed. * Arguments: w - the text source that has changed. |