Closed Bug 125078 Opened 23 years ago Closed 23 years ago

Implement InitPrintSettingsFromPrinter for GTK+/Xlib

Categories

(Core :: Printing: Output, defect)

x86
Linux
defect
Not set
major

Tracking

()

VERIFIED FIXED
mozilla0.9.9

People

(Reporter: rods, Assigned: roland.mainz)

References

Details

Attachments

(3 files, 3 obsolete files)

If GTK PS or XPrint supports being able to get the current default settings for a printer, then you may want to implement this. Settings such as Page Orientation, Page Size, number of copies etc. The idea is to get them from the printer and set them into the PrintSettings
Depends on: 123554
Severity: normal → major
Status: NEW → ASSIGNED
OS: Windows 2000 → Linux
Summary: Implement InitPrintSettingsFromPrinter for GTK → Implement InitPrintSettingsFromPrinter for GTK+/Xlib
Target Milestone: --- → mozilla0.9.9
Blocks: 118156
Marking nsbeta1+
Keywords: nsbeta1+
Blocks: 125824
Changes: - Implemented |InitPrintSettingsFromPrinter()| for both Xprint and PostScript code - Added PR_LOG() support to |nsDeviceContextSpecXlib| to watch what it is doing, including all values stored in |nsIPrintSettings| by |InitPrintSettingsFromPrinter()| - Introduced a central repository for the paper sizes supported by the postscript module (see nsPostScriptObj.h, |postscript_module_paper_sizes|). This avoids that we always have to change multiple places when we want to change these values. - Cleaned up the prefs used by the PostScript module. PostScript module-specfic prefs are now always using the prefix |print.postscript.| - PostScript module can now take printer-specific argument. Example search order when looking up the "paper_size"-prefs for the printer "foobar": 1. 'print.postscript.printer_foobar.paper_size' 2. 'print.printer_default.paper_size' 3. 'print.postscript.paper_size' This feature allows the user to set printer-specific defaults (and module-specific defaults for systems with more than one print module). - Cleaned-up the |Init()|-method - Other minor cleanup stuff
Attachment #69812 - Flags: needs-work+
Attached patch Patch for 2002-02-13-08-trunk (obsolete) — Splinter Review
Changes since last patch: - Implemented |nsPrinterEnumerator[GTK,Xlib]::GetDefaultPrinterName()|. - Ported Xlib gfx changes over to GTK+ gfx - Modified printdialog.xul to call |setPrinterDefaultsForSelectedPrinter()| (in printdialog.js) each time the user changes the selected printer. This function loads the printer-specific defaults into the nsIPrintSettings
Attachment #69812 - Attachment is obsolete: true
ToDO: - Fix the printjoboptionsdialog.js to use a "weak" match to select the paper size in the loadDialog() function. Currently the code looks like this: -- snip -- createPaperArray(); var selectedInx = 0; for (var i=0;i<gPaperArray.length;i++) { if (print_paper_width == gPaperArray[i].width && print_paper_height == gPaperArray[i].height) { selectedInx = i; break; } } createPaperSizeList(selectedInx); -- snip -- This won't work on all platforms due rounding errors. width/height matches should tolerate a +/-2mm difference and they should convert the paper size to mm first - for example: PostScript module uses inches for all paper sizes, Xprint only millimeters for all paper sizes ... ... I'll file a new patch on sunday...
Changes: - Fixed printjoboptions.js and printjoboptions.xul to find the selected page size even if they differ +/- 5mm - Added page sizes DIN-A5, DIN-A2, DIN-A1 and DIN-A0 (I think we should either query the supported paper sizes from the printer or include all paper sizes (which are tons out there - we miss the whole DIN-B* and DIN-C* series, some US formats, all japanese formats etc. etc. - AFAIK more than 90 entries are missing...)) - Fixed more prefs stuff
Attachment #69829 - Attachment is obsolete: true
Comment on attachment 70017 [details] [diff] [review] New patch for 2002-02-13-08-trunk r=rods
Attachment #70017 - Flags: review+
Comment on attachment 70017 [details] [diff] [review] New patch for 2002-02-13-08-trunk sr=attinasi
Attachment #70017 - Flags: superreview+
Changes: - Fixed a crasher when we delete an non-existing object in the error case - Added the ability to list per-printer paper sizes in the print job options dialog (this code is currently only active for Xprint module printers; I am working for a better solution for PostScript/Xprint/etc. later...)
Attachment #70017 - Attachment is obsolete: true
Comment on attachment 70357 [details] [diff] [review] New patch for 2002-02-13-08-trunk r=rods
Attachment #70357 - Flags: review+
Comment on attachment 70357 [details] [diff] [review] New patch for 2002-02-13-08-trunk sr=attinasi - make me proud, man...
Attachment #70357 - Flags: superreview+
nsPostScriptObj.h is included by a C file (font_metrics.c), so you can't use C++ comments or you'll break IRIX (and maybe a few other platforms).
Patches have been checked in, marking bug as FIXED.
Status: ASSIGNED → RESOLVED
Closed: 23 years ago
Resolution: --- → FIXED
Blocks: 111076
Roland please verify...thanks!
Roland please verify when you get chance...this is nsbeta1+ bug so its showing up on the verification radar... thanks.
The changes to nsDeviceContextSpecG.cpp with this patch broke the build on AIX (strings.h is not included, so strcasecmp was not found). Shouldn't the usage of strcasecmp be changed to nsCRT::strcasecmp?
v
Status: RESOLVED → VERIFIED
sujay wrote: > Roland please verify when you get chance...this is nsbeta1+ bug so its > showing up on the verification radar.. Sorry, I was away for two days... thanks for marking it VERIFIED... :)
Philip K. Warren wrote: > The changes to nsDeviceContextSpecG.cpp with this patch broke the build on AIX > (strings.h is not included, so strcasecmp was not found). Mhhh, yes... this may happen... xx@@@!!!... ;-( strings.h is implicitly included via the XprintUtils header, but AIX is one of the rare platforms which does not ship with libXp.so - which disables the Xprint support in Mozilla... fun... ;-( > Shouldn't the usage > of strcasecmp be changed to nsCRT::strcasecmp? Most nsCRT::*-stuff is going to die. Please use the NSPR calls (PL_strcasecmp() in this case) instead if neccesary... Options: - Add the missing |#include <strings.h>| - Switch from |strcasecmp| to |PL_strcasecmp()| - Enable Xprint support for AIX :)
switching strcasecmp's to PL_strcasecmp since strcasecmp is defined in strings.h which is not included if xprint is not enabled. I consider this a port bustage (aix doesn't compile) however I am having problems getting my aix tinderbox running...
Attachment #71919 - Flags: review+
Comment on attachment 71919 [details] [diff] [review] fix for AIX (platforms without xprint) sr=shaver.
Attachment #71919 - Flags: superreview+
Comment on attachment 71919 [details] [diff] [review] fix for AIX (platforms without xprint) a=asa (on behalf of drivers) for checkin to the 1.0 trunk
Attachment #71919 - Flags: approval+
Fix checked in
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: