Hi Isaac On 29/05/2013 08:35, ibid...@lavabit.com wrote:
I guess this is the testcase that was needed. dtpad in CDE breaks with this fix, due to a missing XmPrintShellCallbackStruct (and possibly other things?)
Thanks for the testcase.
I presume the CDE code has not been updated since before Xprint was deprecated in 2007/2008. We are reluctant to re-introduce Motif's dependency on libXp as it seems it is to be removed as well [1].
I had a look at dtpad and found there is a PRINT_TO_VIDEO symbol in printJob.c that when defined, causes most of the XmPrint... function calls to be skipped. I attach a patch which defines PRINT_TO_VIDEO and allows dtpad to build.
Regards Graham [1] http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=657253
--- printJob.c.orig 2012-10-05 02:10:33.000000000 +0200 +++ printJob.c 2013-05-30 11:13:50.760174871 +0200 @@ -82,6 +82,8 @@ #include "dtpad.h" +#define PRINT_TO_VIDEO + static void _pjCreatePrintShell(PrintJob *pJob); static void _pjCreateOutputWidgets(PrintJob *pJob); static void _pjDoPrint(PrintJob*); @@ -894,9 +896,11 @@ while (! (shell == NULL || XtIsShell(shell)) ) shell = XtParent(shell); +#ifndef PRINT_TO_VIDEO if (shell) XmPrintPopupPDM(pJob->pShell, shell); else +#endif fprintf(stderr, "Internal Error %s: Missing XmPrintShell.", pname); } } @@ -909,6 +913,7 @@ static void _pjPdmNotificationCB (Widget widget, XtPointer client_data, XtPointer call_data) { +#ifndef PRINT_TO_VIDEO PrintJob *pJob = (PrintJob*) client_data; XmPrintShellCallbackStruct *pscbs = (XmPrintShellCallbackStruct*)call_data; char *message = NULL; @@ -931,6 +936,7 @@ if (message != NULL) Warning( pJob->pPad, message, XmDIALOG_WARNING); +#endif } @@ -948,7 +954,9 @@ { PrintJob *pJob = (PrintJob *) client_data; +#ifndef PRINT_TO_VIDEO XmPrintShellCallbackStruct *pscbs = (XmPrintShellCallbackStruct*)call_data; +#endif int top = 0; if (pJob->pOutput == NULL)