summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRoland Mainz <roland.mainz@nrubsig.org>2005-04-11 01:06:15 +0000
committerRoland Mainz <roland.mainz@nrubsig.org>2005-04-11 01:06:15 +0000
commitfe01739e3a26d6a8666c9c32dd33bdf112ac5d41 (patch)
tree51a9cc1e8e4758ab0e566b1718a155055341fe3c
parentd52a2e64b412065e9d15ff22055c3d00507d608e (diff)
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.c34
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);