diff options
author | Roland Mainz <roland.mainz@nrubsig.org> | 2005-04-11 01:06:15 +0000 |
---|---|---|
committer | Roland Mainz <roland.mainz@nrubsig.org> | 2005-04-11 01:06:15 +0000 |
commit | 4d8b36adf2024e6c28ecd266fb3585fdbc2c66f2 (patch) | |
tree | eb7f7b4b6123ad476acc90ec5d8463b5db599dd7 | |
parent | c4d739517989871ad786fd0f5e0ae6a683f7e92f (diff) |
xc/programs/Xserver/Xprint/attributes.csco_port_update-baseXORG-6_8_99_900XORG-6_8_99_9XORG-6_8_99_8XORG-6_8_99_7XORG-6_8_99_6XORG-6_8_99_5XORG-6_8_99_4XORG-6_8_99_3XORG-6_8_99_16XORG-6_8_99_15XORG-6_8_99_14XORG-6_8_99_13XORG-6_8_99_12XORG-6_8_99_11XORG-6_8_99_10
xc/programs/glxgears/glxgears.c
xc/programs/xdbedizzy/xdbedizzy.c
xc/programs/xedit/Imakefile
xc/programs/xedit/Xedit-xprint.ad
xc/programs/xedit/util.c
xc/programs/xedit/xedit.h
xc/programs/xlogo/print.c
xc/programs/xlogo/xlogo.c
xc/programs/xlogo/xlogo.h
xc/programs/xman/Imakefile
xc/programs/xman/print.h
xc/programs/xmore/Imakefile
xc/programs/xmore/print.c
xc/programs/xmore/print.h
xc/programs/xmore/printdialog.c
xc/programs/xphelloworld/xpawhelloworld/xpawhelloworld.c
xc/programs/xphelloworld/xphelloworld/xphelloworld.c
xc/programs/xphelloworld/xpsimplehelloworld/xpsimplehelloworld.c
xc/programs/xphelloworld/xpxmhelloworld/xpxmhelloworld.c
//bugs.freedesktop.org/show_bug.cgi?id=790) attachment #2379
(https://bugs.freedesktop.org/attachment.cgi?id=2379) Implement support
client+Xserver support for passing output (stdout+stderr) of the
spooler command started by the Xprint server back to the application
using the "xp-spooler-command-results" XPJobAttr attribute
(applications can fetch the attribute value after the XPEndJobNotify
event was received; more details can be found in
http://xprint.mozdev.org/docs/dtprint_fspec.ps).
-rw-r--r-- | print.c | 23 | ||||
-rw-r--r-- | xlogo.c | 3 | ||||
-rw-r--r-- | xlogo.h | 2 |
3 files changed, 28 insertions, 0 deletions
@@ -111,6 +111,8 @@ PageSetupCB(Widget widget, XtPointer client_data, XtPointer call_data) void FinishPrinting(AppPrintData *p) { + char *scr; + if (p->printtofile_handle) { if (XpuWaitForPrintFileChild(p->printtofile_handle) != XPGetDocFinished) { fprintf(stderr, "%s: Error while printing to file.\n", ProgramName); @@ -118,6 +120,27 @@ void FinishPrinting(AppPrintData *p) p->printtofile_handle = NULL; } + /* Job completed, check if there are any messages from the spooler command */ + scr = XpGetOneAttribute(p->pdpy, p->pcontext, XPJobAttr, "xp-spooler-command-results"); + if( scr ) + { + if( strlen(scr) > 0 ) + { + const char *msg = XpuCompoundTextToXmb(p->pdpy, scr); + if( msg ) + { + Msg(("Spooler command returned '%s'.\n", msg)); + XpuFreeXmbString(msg); + } + else + { + Msg(("Spooler command returned '%s' (unconverted).\n", scr)); + } + } + + XFree((void *)scr); + } + if (p->printshell) { XtDestroyWidget(p->printshell); p->printshell = NULL; @@ -57,6 +57,7 @@ static XrmOptionDescRec options[] = { {"-sharp", "*sharp", XrmoptionNoArg, "TRUE"}, #endif {"-v", "Verbose", XrmoptionNoArg, "TRUE"}, +{"-q", "Quiet", XrmoptionNoArg, "TRUE"}, #ifdef INCLUDE_XPRINT_SUPPORT {"-print", "Print", XrmoptionNoArg, "TRUE"}, {"-printer", "printer", XrmoptionSepArg, NULL}, @@ -80,6 +81,7 @@ XLogoResourceData userOptions; XtResource resources[] = { {"verbose", "Verbose", XtRBoolean, sizeof(Boolean), Offset(verbose), XtRImmediate, (XtPointer)False}, + {"quiet", "Quiet", XtRBoolean, sizeof(Boolean), Offset(quiet), XtRImmediate, (XtPointer)False}, #ifdef INCLUDE_XPRINT_SUPPORT {"print", "Print", XtRBoolean, sizeof(Boolean), Offset(printAndExit), XtRImmediate, (XtPointer)False}, {"printer", "Printer", XtRString, sizeof(String), Offset(printername), XtRImmediate, (XtPointer)NULL}, @@ -128,6 +130,7 @@ Syntax(Widget toplevel) reasons[n++] = "Usage: "; reasons[n++] = (String)ProgramName; reasons[n++] = " [-fg <color>] [-bg <color>] [-rv] [-bw <pixels>] [-bd <color>]\n"; + reasons[n++] = " [-v] [-q]\n"; reasons[n++] = " [-d [<host>]:[<vs>]]\n"; reasons[n++] = " [-g [<width>][x<height>][<+-><xoff>[<+-><yoff>]]]\n"; #ifdef INCLUDE_XPRINT_SUPPORT @@ -35,9 +35,11 @@ in this Software without prior written authorization from The Open Group. #define Error(x) { printf x ; exit(EXIT_FAILURE); } #define Log(x) { if(userOptions.verbose) printf x; } +#define Msg(x) { if((!userOptions.quiet) || userOptions.verbose) printf x; } typedef struct { Boolean verbose; + Boolean quiet; Boolean printAndExit; String printername; String printfile; |