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 | fe01739e3a26d6a8666c9c32dd33bdf112ac5d41 (patch) | |
tree | 51a9cc1e8e4758ab0e566b1718a155055341fe3c | |
parent | d52a2e64b412065e9d15ff22055c3d00507d608e (diff) |
xc/programs/Xserver/Xprint/attributes.csco_port_update-baseXORG-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_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-- | xdbedizzy.c | 34 |
1 files changed, 29 insertions, 5 deletions
diff --git a/xdbedizzy.c b/xdbedizzy.c index 9577bb9..a9f82fd 100644 --- a/xdbedizzy.c +++ b/xdbedizzy.c @@ -52,6 +52,7 @@ /* Turn a NULL pointer string into an empty string */ #define NULLSTR(x) (((x)!=NULL)?(x):("")) #define Log(x) { if(verbose) printf x; } +#define Msg(x) { printf x; } /* Global variables */ static char *ProgramName = NULL; @@ -421,25 +422,25 @@ void main_loop(void) case ButtonPress: switch (event.xbutton.button) { case 1: - printf("ButtonPress: faster: %g\n", delta); + Msg(("ButtonPress: faster: %g\n", delta)); delta += 0.005; break; case 2: - printf("ButtonPress: slower: %g\n", delta); + Msg(("ButtonPress: slower: %g\n", delta)); delta += -0.005; break; case 3: if (manual_paused) { - printf("ButtonPress: manual resume.\n"); + Msg(("ButtonPress: manual resume.\n")); manual_paused = False; } else { - printf("ButtonPress: manual pause.\n"); + Msg(("ButtonPress: manual pause.\n")); manual_paused = True; } } break; case KeyPress: - printf("KeyPress: done.\n"); + Msg(("KeyPress: done.\n")); done = True; break; case ConfigureNotify: @@ -782,11 +783,34 @@ int main(int argc, char *argv[]) main_loop(); if (doPrint) { + char *scr; + /* End the print job - the final results are sent by the X print * server to the spooler sub system. */ Log(("finishing print job.\n")); + /* Job completed, check if there are any messages from the spooler command */ + scr = XpGetOneAttribute(dpy, pcontext, XPJobAttr, "xp-spooler-command-results"); + if( scr ) + { + if( strlen(scr) > 0 ) + { + const char *msg = XpuCompoundTextToXmb(dpy, scr); + if( msg ) + { + Msg(("Spooler command returned:\n%s", msg)); + XpuFreeXmbString(msg); + } + else + { + Msg(("Spooler command returned (unconverted):\n%s", scr)); + } + } + + XFree((void *)scr); + } + if (toFile) { if (XpuWaitForPrintFileChild(printtofile_handle) != XPGetDocFinished) { fprintf(stderr, "%s: Error while printing to file.\n", ProgramName); |