diff options
author | Roland Mainz <roland.mainz@nrubsig.org> | 2004-05-30 22:44:01 +0000 |
---|---|---|
committer | Roland Mainz <roland.mainz@nrubsig.org> | 2004-05-30 22:44:01 +0000 |
commit | cf44083fa20c4f39a89a63ced16974c832039325 (patch) | |
tree | 67d06e3aab038d423ea38299395483bda6fec6d6 /print.c | |
parent | 3b70888a54396c1b5ab67be863b189c7b8775695 (diff) |
Fix for http://freedesktop.org/bugzilla/show_bug.cgi?id=695 - Add print
support to Xedit
Diffstat (limited to 'print.c')
-rw-r--r-- | print.c | 21 |
1 files changed, 12 insertions, 9 deletions
@@ -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); |