diff options
-rw-r--r-- | XMore.ad | 58 | ||||
-rw-r--r-- | print.c | 21 | ||||
-rw-r--r-- | print.h | 14 | ||||
-rw-r--r-- | xmore.c | 11 |
4 files changed, 57 insertions, 47 deletions
@@ -31,30 +31,36 @@ *quit.tip: Quit application *print.tip: Print file -! tip messages for print dialog -*printdialog*main*ok.tip: Print -*printdialog*main*cancel.tip: Cancel printing -*printdialog*main*setup.tip: Configure printer options (page size, orientation, etc.) -*printdialog*main*desclabel.tip: Short description of printer -*printdialog*main*desc.tip: Short description of printer -*printdialog*main*info.tip: Display additional information about this printer -*printdialog*main*namelabel.tip: Name of selected printer -*printdialog*main*name.tip: Name of selected printer -*printdialog*main*selectprinter.tip: Select a different printer -*printdialog*main*filenamelabel.tip: File where the output should be stored -*printdialog*main*filename.tip: File where the output should be stored -*printdialog*main*selectfile.tip: Select file where the output should be stored -*printdialog*main*printtoprinter.tip: Send print job to printer -*printdialog*main*printtofile.tip: Save print job in a file -*printdialog*setup*ok.tip: Commit changes -*printdialog*setup*cancel.tip: Cancel and reset to defaults -*printdialog*setup*paperlist.tip: Select paper size -*printdialog*setup*resolutionlist.tip: Select page resolution -*printdialog*setup*orientationlist.tip: Select page orientation -*printdialog*setup*plexlist.tip: Select page plex mode (simplex, duplex, etc.) -*printdialog*setup*jobcopieslabel.tip: Set number of job copies -*printdialog*setup*jobcopies.tip: Set number of job copies -*printdialog*printerselection*ok.tip: Switch printer -*printdialog*printerselection*cancel.tip: Cancel printer selection -*printdialog*printerselection*list.tip: Select printer name from list +! Use "white" as background for printing +*printshell*background: white + +! Print dialog +*printdialogshell*geometry: 600x120 +*printdialogshell*setup*geometry: 600x400 +*printdialogshell*printerselection*geometry: 400x150 +*printdialog*main*ok.tip: Print +*printdialog*main*cancel.tip: Cancel printing +*printdialog*main*setup.tip: Configure printer options (page size, orientation, etc.) +*printdialog*main*desclabel.tip: Short description of printer +*printdialog*main*desc.tip: Short description of printer +*printdialog*main*info.tip: Display additional information about this printer +*printdialog*main*namelabel.tip: Name of selected printer +*printdialog*main*name.tip: Name of selected printer +*printdialog*main*selectprinter.tip: Select a different printer +*printdialog*main*filenamelabel.tip: File where the output should be stored +*printdialog*main*filename.tip: File where the output should be stored +*printdialog*main*selectfile.tip: Select file where the output should be stored +*printdialog*main*printtoprinter.tip: Send print job to printer +*printdialog*main*printtofile.tip: Save print job in a file +*printdialog*setup*ok.tip: Commit changes +*printdialog*setup*cancel.tip: Cancel and reset to defaults +*printdialog*setup*paperlist.tip: Select paper size +*printdialog*setup*resolutionlist.tip: Select page resolution +*printdialog*setup*orientationlist.tip: Select page orientation +*printdialog*setup*plexlist.tip: Select page plex mode (simplex, duplex, etc.) +*printdialog*setup*jobcopieslabel.tip: Set number of job copies +*printdialog*setup*jobcopies.tip: Set number of job copies +*printdialog*printerselection*ok.tip: Switch printer +*printdialog*printerselection*cancel.tip: Cancel printer selection +*printdialog*printerselection*list.tip: Select printer name from list ! EOF. @@ -265,15 +265,15 @@ XFontSet GetPrintTextFontSet(const char *appname, Display *pdpy, long dpi) } if (!fontset) - Error(("XCreateFontSet() failure.\n")); + Error(("GetPrintTextFontSet: XCreateFontSet() failure.\n")); return fontset; } -void DoPrint(const char *programname, - Widget textsource, Widget toplevel, - Display *pdpy, XPContext pcontext, - XtCallbackProc pdpyDestroyCB, - const char *jobtitle, const char *toFile) +void DoPrintTextSource(const char *programname, + Widget textsource, Widget toplevel, + Display *pdpy, XPContext pcontext, + XtCallbackProc pdpyDestroyCB, + const char *jobtitle, const char *toFile) { long dpi = 0; int n; @@ -313,7 +313,7 @@ void DoPrint(const char *programname, n = 0; XtSetArg(args[n], XawNlayoutMode, XawPrintLAYOUTMODE_DRAWABLEAREA); n++; - apd->printshell = CreatePrintShell(toplevel, apd->pscreen, "print", args, n); + apd->printshell = CreatePrintShell(toplevel, apd->pscreen, "printshell", args, n); n = 0; XtSetArg(args[n], XtNresizable, True); n++; @@ -324,6 +324,7 @@ void DoPrint(const char *programname, #ifdef PRINT_PAGEHEADER n = 0; + XtSetArg(args[n], XtNinternational, True); n++; XtSetArg(args[n], XtNfromHoriz, NULL); n++; XtSetArg(args[n], XtNfromVert, NULL); n++; XtSetArg(args[n], XtNtop, XtChainTop); n++; @@ -335,13 +336,14 @@ void DoPrint(const char *programname, apd->content.pageheaderlabel = XtCreateManagedWidget("pageinfo", labelWidgetClass, apd->content.form, args, n); #endif /* PRINT_PAGEHEADER */ + font_extents = XExtentsOfFontSet(textfontset); + n = 0; + XtSetArg(args[n], XtNinternational, True); n++; XtSetArg(args[n], XtNtextSource, textsource); n++; XtSetArg(args[n], XtNscrollHorizontal, XawtextScrollNever); n++; XtSetArg(args[n], XtNscrollVertical, XawtextScrollNever); n++; - font_extents = XExtentsOfFontSet(textfontset); - /* Usually I would expect that using |XtNfromVert, apd->content.pageheaderlabel| * would be the correct way to place the text widget with the main content below * the page header widget - but for an unknown reason this doesn not work: The @@ -358,6 +360,7 @@ void DoPrint(const char *programname, #endif XtSetArg(args[n], XtNfontSet, textfontset); n++; apd->content.text = XtCreateManagedWidget("text", asciiTextWidgetClass, apd->content.form, args, n); + /* Disable the caret - that is not needed for printing */ XawTextDisplayCaret(apd->content.text, False); @@ -36,12 +36,12 @@ in this Software without prior written authorization from The Open Group. #include <X11/XprintUtil/xprintutil.h> /* Prototypes */ -void DoPrint(const char *programname, - Widget textsource, - Widget toplevel, - Display *pdpy, XPContext pcontext, - XtCallbackProc printDisplayDestroyCallback, - const char *jobTitle, - const char *toFile); +void DoPrintTextSource(const char *programname, + Widget textsource, + Widget toplevel, + Display *pdpy, XPContext pcontext, + XtCallbackProc printDisplayDestroyCallback, + const char *jobTitle, + const char *toFile); #endif /* !XMORE_PRINT_H */ @@ -164,11 +164,11 @@ printOKXtProc(Widget w, XtPointer client_data, XtPointer callData) * because it is used for the job title AND the page headers... */ sprintf(printJobNameBuffer, "XMore print job %s", viewFileName); - DoPrint(ProgramName, - textsource, toplevel, - pdcs->pdpy, pdcs->pcontext, printshellDestroyXtProc, - printJobNameBuffer, - pdcs->printToFile?pdcs->printToFileName:NULL); + DoPrintTextSource(ProgramName, + textsource, toplevel, + pdcs->pdpy, pdcs->pcontext, printshellDestroyXtProc, + printJobNameBuffer, + pdcs->printToFile?pdcs->printToFileName:NULL); XtPopdown(printdialog_shell); } @@ -247,6 +247,7 @@ int main( int argc, char *argv[] ) ProgramName = argv[0]; + XtSetLanguageProc(NULL, NULL, NULL); toplevel = XtOpenApplication(&app, "XMore", options, XtNumber(options), &argc, argv, fallback_resources, |