* PrintingServicesWin32.cs: Pass 0 as mode to DocumentProperties to
[mono.git] / mcs / class / System.Drawing / System.Drawing.Printing / ChangeLog
1 2007-05-24  Gert Driesen  <drieseng@users.sourceforge.net>
2
3         * PrintingServicesWin32.cs: Pass 0 as mode to DocumentProperties to
4         obtain the size of the buffer required to hold the DEVMODE structure.
5         Fixes bug #81723.
6
7 2007-05-23  Sebastien Pouliot  <sebastien@ximian.com>
8
9         * PreviewPrintController.cs: Reduce bitmap size and avoid scaling the
10         print preview (fix bug #80765). Patch from Vladimir Dimitrov.
11         * PrintingServicesUnix.cs: Reorder calculation to avoid loss of 
12         precision in integer division. Use printer resolution for Cairo
13         fallback. Patch from Vladimir Dimitrov.
14
15 2007-03-13  Andreia Gaita  <avidigal@novell.com>
16
17         * PrintingServices.cs: Add missing static method SysPrn.GetPrintDialogInfo
18         for SWF to call up printing dialogues.
19
20 2007-02-21  Andreia Gaita  <avidigal@novell.com>
21         
22         * PrintingServicesUnix.cs: Report an error in the console if there is
23         a problem opening the printer.
24
25 2007-02-21  Andreia Gaita  <avidigal@novell.com>
26
27         * PrintingServicesUnix.cs: don't free up pointers unnecessarily (doh)
28
29 2007-02-21  Andreia Gaita  <avidigal@novell.com>
30
31         * PrintingServicesUnix.cs: add checks and try blocks to make sure
32         things don't blow up if we try to double free anything (not that
33         we're trying to do anything like that :p )
34
35 2007-02-21  Andreia Gaita  <avidigal@novell.com>
36
37         * PrintingServicesUnix.cs: fix a double-free bug
38
39 2007-02-20  Andreia Gaita  <avidigal@novell.com>
40
41         * PrintingServicesUnix.cs: Fix leak caused by not calling cupsFreeDests
42         on certain codepaths. Fix return value of cupsFreeDests to void.
43         
44 2007-02-20  Andreia Gaita  <avidigal@novell.com>
45         
46         * PrintingServicesUnix.cs: Correct missing static initialization
47         of loaded printers hashtable, unit tests were failing (oops :p)
48
49 2007-02-17  Marek (please complete)
50
51         * PrintPreviewController, InvalidPrinterException: 
52         Remove warnings
53
54 2007-02-16  Andreia Gaita  <avidigal@novell.com>
55
56         Redesign how and when cups gets called to minimize
57         p/invokes, implements caching of printers and printer
58         settings as per calberto's patch - #79822, plotter detection, 
59         duplex, fixes for image disposing, code modularization, 
60         misc. fixes.
61         
62         * PageSettings.cs: Check and ignore null setter values on
63         paper sizes, sources and resolutions.
64         
65         * PaperSize.cs: Add default paper size flag
66         
67         * PaperSource.cs: Add default paper source flag, minor code
68         beautification
69         
70         * PrinterSettings.cs: Add duplex and plotter implementation, 
71         modify calls to PrintingServices to support caching, add
72         a printer capabilities list to store specific printer options - 
73         only loaded with cups, for now. Move the internal list classes
74         to the end of the code so as not to clutter.
75         
76         * PrintingServices.cs: Separate the PrintingServices class in 2 - 
77         PrintingServices and GlobalPrintingServices (see calberto's patch
78         in #79822). The PrintingServices class is where all the methods
79         caching information reside, the GlobalPrintingServices methods do 
80         no caching.
81         The cached information resides on the Printer class, added to the 
82         SysPrn class.
83         
84         * PrintingServicesUnix.cs: Big rewrite. 
85         - Essentially, redesigned and modularized the code to minimize cups 
86         calls. Then, applied the caching so all the cups calls are reduced 
87         to a minimum, by loading a list of printers onto a hashtable, then 
88         loading the settings of the chosen printer and saving that in the 
89         hashtable all in one go.
90         - Also, fixes for loading       the proper default values of the printer, 
91         which are stored in it's global options;
92         - Modularization of cups/ppd loading methods (LoadPrinterOptions, 
93         LoadOptionList, OpenPrinter, ClosePrinter) so we don't repeat 
94         cups/ppd loading loops everywhere. 
95         - Proper disposing of pointers and structures, calling the proper
96         cups free calls.
97         - Add duplex support
98         
99         * PrintingServicesWin32.cs: IsPrinterValid is no longer caching the value,
100         since it should be supporting global caching as well, though that is not
101         yet complete on win32. Implements plotter detection support, and changes for
102         the new PrinterSettings/GlobalPrinterSettings structure. Some minor changes
103         the code to minimize p/invoke calls (load the printer sources and sizes 
104         before accessing the collections)
105         
106         * StandardPrintController.cs: PrinterSettings/GlobalPrinterSettings structure
107         changes
108
109 2007-02-09  Sebastien Pouliot  <sebastien@ximian.com>
110
111         * PrintingServicesUnix.cs: Ensure we free the original pointer in
112         GetAlternativeDefaultPrinter (not the one used for iteration).
113
114 2007-01-19  Andreia Gaita  <avidigal@novell.com>
115
116         * PrintingServicesUnix.cs: Add is_default flag check for 
117         detecting default printer when cupsGetDefault doesn't return
118         valid values (mainly ubuntu). Fixes #80198, #80519
119
120 2007-01-09  Sebastien Pouliot  <sebastien@ximian.com>
121
122         * PrintingServices.cs: Unify platform detection code.
123
124 2006-12-04  Carlos Alberto Cortez <calberto.cortez@gmail.com>
125
126         * PrintingServicesUnix.cs: Add "landscape" option
127         when using PaperSettings.Landscape set to true. Also
128         swap the width and height for the postscript file.
129
130 2006-12-01  Andreia Gaita  <avidigal@novell.com>
131
132         * PrintingServicesUnix: Proper size structure use for 64 bit
133         support.
134
135 2006-12-01  Andreia Gaita  <avidigal@novell.com>
136
137         * PrintingServicesUnix: *properly* check return value from 
138         cupsGetDefault. If there are no default printers set, 
139         check if there are installed printers, and use that.
140         Hopefully fixes #79835
141
142 2006-12-01  Andreia Gaita  <avidigal@novell.com>
143
144         * PrintingServicesUnix: check return value from cupsGetDefault.
145         Hopefully fixes #79835
146
147 2006-12-01 Jordi Mas i Hernandez <jordimash@gmail.com>
148
149         * PrintingServicesWin32.cs: Fixes paper sizes reading. The POINT 
150         structure is 8 bytes long not 4. This fixes margins calculations 
151         (based on the paper size) that were badly broken. 
152
153 2006-11-28  Andreia Gaita  <avidigal@novell.com>
154
155         * PageSettings.cs: 
156         - internal member name changes to help
157         out with intelisense. 
158         - Use internal members directly instead of using
159         corresponding properties so that exceptions are not thrown
160         * PrintingServicesWin32:
161         - Only return DefaultPrinter if it is actually valid. This
162         is because Win32GetDefaultPrinter returns a printer name
163         even if PrintSpooler is stopped (which should  behave the
164         same way as if there are no printers installed)
165         - Do not try to allocate if EnumPrinters returns 0
166         
167 2006-11-25 Jordi Mas i Hernandez <jordimash@gmail.com>
168
169         * PrintingServicesUnix.cs: Implements GetPrintDialogInfo
170
171 2006-11-24  Carlos Alberto Cortez <calberto.cortez@gmail.com>
172         
173         Initial support for PageSettings (color, copies, collate,
174         and media size).
175
176         * StandardPrintController.cs: Pass PrintDocument.PageSettings to
177         create the Graphics object (althought PageSettings
178         contains a PrinterSettings and vice versa, PrintDocument
179         can contain non-related PrinterSettings and PageSettings objects).
180
181         * PrintingServices.cs: Likewise.
182         * PrintingServicesWin32.cs: Likewise.
183         * PrintingServicesUnix.cs: Likewise. Also use cupsParseOptions
184         to pass printing options when calling cupsPrintFile. Use "Custom"
185         as name for custom pages without associated name (Laxmark printers
186         have this problem, causing a nullref exc). Add GetPaperKind () method
187         to retrieve and set the right PaperKind value for PaperSize, instead
188         of using PaperKind.Custom for all page sizes. Finally save
189         PageSettings in DOCINFO to use it later.
190
191         * PrintDocument.cs: Clone PrinterSettings.PageSettings
192         instead of creating a new one (this avoid creating an additional
193         PrinterSettings instance).
194
195 2006-11-17  Andreia Gaita <avidigal@novell.com>
196
197         * PrintingServicesWin32.cs: fix another dumb typo - 
198         check proper return value from printer validity call
199
200 2006-11-16  Chris Toshok  <toshok@ximian.com>
201
202         * PreviewPrintController.cs: fix typo - don't throw
203         InvalidPrinterException when it wasn't supposed to be.
204
205 2006-11-16  Carlos Alberto Cortez <calberto.cortez@gmail.com>
206
207         * PrintDocument.cs: Use QueryPageSettingsEventArgs.PageSettings
208         in PrintPageEventArgs, instead of using the default one (mimic
209         .Net behaviour).
210
211         * PageSettings.cs: Implement Clone the right way (intead of using
212         the default page settings).
213
214 2006-11-14 Andreia Gaita <avidigal@novell.com>
215         Fixes #79835, implements PrinterSettings.IsValid, throws proper
216         InvalidPrinterException with differentiated messages.
217         
218         * PrintingServices.cs: Declares IsPrinterValid to enable easy checking
219         if printer name is a valid printer
220         
221         * PrintingServicesWin32.cs: Implements IsPrinterValid, caches 
222         last assigned printer name and if it is valid to speed up next calls.
223         
224         * PrintingServicesUnix.cs: Implements IsPrinterValid, caches 
225         last assigned printer name and if it is valid to speed up next calls.
226         
227         * PageSettings.cs: 
228                 - throw InvalidPrinterException in the properties,
229                 according to the docs: Color, Landscape, PaperSize, PaperSource, 
230                 PrinterResolution
231                 - change the private fields above to internal, so that in the
232                 constructor we can access them without triggering the exceptions
233                 if there are no printers installed
234                 
235         * PrinterSettings.cs: Implement IsValid to call IsPrinterValid
236         implemented above
237         
238         * PreviewPrintController.cs: throw InvalidPrinterException on 
239         StartPrint() if there's no valid printer configured
240         
241         * InvalidPrinterException.cs: New private GetMessage() to customize
242         printer error message, used by constructor
243
244 2006-09-27 Jordi Mas i Hernandez <jordimash@gmail.com>
245
246         * PrintingServicesUnix.cs: Implements LoadPrinterPaperSources member,
247         simplifies GetPaperSizeName and loads paper source and size defaults
248
249 2006-09-27 Jordi Mas i Hernandez <jordimash@gmail.com>
250
251         * PrintingServices.cs: Add LoadPrinterPaperSources member
252         
253         * PrintingServicesWin32.cs: Implements LoadPrinterPaperSources and
254         reads the default paper source and size.
255         
256         * PrintingServicesUnix.cs: Add stub LoadPrinterPaperSources member
257         
258         * PrinterSettings.cs: Implements PaperSourceCollection property and
259         makes default paper source and size from the system.
260
261 2006-08-02  Chris Toshok  <toshok@ximian.com>
262
263         * PreviewPrintController.cs: scale the Graphics context we pass
264         back from OnStartPage such that the preview looks the way the
265         printed output will.
266
267 2006-07-28  Carlos Alberto Cortez <calberto.cortez@gmail.com>
268
269         * PrintDocument.cs: When null is passed to PrinterSettings,
270         it should be set to a new PrinterSettings instance, and should never
271         be null.
272
273         * PrinterSettings.cs: Default value for Copies should be 1. Also
274         add a space in the ToString method, to correctly show the printer
275         info.
276
277 2006-07-26  Chris Toshok  <toshok@ximian.com>
278
279         * PrinterSettings.cs: expose PrintFileName in the 1.1 case as an
280         internal property, so we can get at it from MWF.
281
282         * PrintingServicesUnix.cs: handle print to file, and also remove
283         the temp file after sending the data to the printer.  fix some
284         dllimports to match the rest of system.drawing.
285
286         * PreviewPrintController.cs: implement this (warning, it'll eat
287         all your memory until we get a real Metafile implementation, as
288         we're storing bitmaps).
289
290         * PrintDocument.cs: shift the graphics context stuff around a bit
291         in Print(), so that the events after OnStartPrint are passed the
292         graphics context the controller created there, and we use the
293         return value of OnStartPage to do all drawing.
294
295 2006-05-20 Jordi Mas i Hernandez <jordimash@gmail.com>
296
297         * PrintingServices.cs: GetPrintDialogInfo definition
298         * PrintingServicesWin32.cs GetPrintDialogInfo implementation
299         * PrintingServicesUnix.cs: GetPrintDialogInfo stub
300
301 2006-04-14 Jordi Mas i Hernandez <jordimash@gmail.com>
302
303         * PrintingServicesUnix.cs: Replace cupsGetPrinters deprecated API call
304
305 2006-04-13 Jordi Mas i Hernandez <jordimash@gmail.com>
306
307         * PrintingServicesUnix.cs: Checks if cups is installed
308         * PrinterSettings.cs: PrintToFile property and ToString method
309
310 2006-04-28  Sebastien Pouliot  <sebastien@ximian.com>
311
312         * PrintController.cs: corcompare fix. No public ctor in 2.0.
313         * PrinterSettings.cs: corcompare fix. Clone method isn't virtual.
314
315 2006-03-21  Sebastien Pouliot  <sebastien@ximian.com>
316
317         * PrintingServicesUnix.cs: cupsGetPrinters(char***) requires to free 
318         each individual string and (finally) the list. Note that this call is
319         deprecated.
320
321 2006-03-13  Peter Dennis Bartok  <pbartok@novell.com>
322
323         * PrintingServicesUnix.cs: Handle not having a printer
324
325 2006-02-09  Peter Dennis Bartok  <pbartok@novell.com>
326
327         * PrintingServicesWin32.cs: Simplyfied the code, removing the need
328           for pointer calculations (part of 64bit cleanup)
329
330 2006-01-27  Sebastien Pouliot  <sebastien@ximian.com>
331
332         * PrintingServicesWin32.cs: Ensure Marshal.FreeHGlobal is called for 
333         all unmanaged memory allocated with AllocHGlobal.
334
335 2006-01-15 Jordi Mas i Hernandez <jordimash@gmail.com>
336
337         * PrintingServicesUnix.cs: Allow setting the dpy's for the surface
338
339 2005-12-22 Jordi Mas i Hernandez <jordimash@gmail.com>
340
341         * PrintingServices.cs: Printing services abstration class
342         * PrintingServicesWin32.cs: Win32 printer driver
343         * PrintingServicesUnix.cs: Unix printer driver
344         * Margins.cs: Fixes exceptions error messages
345         * PrinterResolution.cs: Fixes
346         * PrintEventArgs.cs: New internal method
347         * PrintPageEventArgs.cs: New internal method
348         * StandardPrintController.cs: Fixes
349         * PrinterUnitConvert.cs: Fixes conversion errors
350         * PrintDocument.cs: Fixes to make it print
351         * PageSettings.cs: Take margains into account
352         * PrintController.cs: Fixes
353         * PaperSize.cs: Method to set paper Kind
354         * PrinterSettings.cs: Implements settings and fixes
355         *       
356
357 2005-12-07 Jordi Mas i Hernandez <jordimash@gmail.com>
358         
359         * PrinterResolutionKind.cs: Fixes signature for .Net 2.0
360         * PaperKind.cs: Fixes signature for .Net 2.0
361         * PaperSource.cs: Fixes signature for .Net 2.0
362         * Margins.cs: Fixes signature for .Net 2.0
363         * PrinterResolution.cs: Fixes signature for .Net 2.0
364         * PrintEventArgs.cs: Fixes signature for .Net 2.0
365         * PrintAction.cs: New enum in .Net 2.0
366         * PageSettings.cs:  Fixes signature for .Net 2.0
367         * PaperSourceKind.cs:  Fixes signature for .Net 2.0
368         * PrintController.cs: Fixes signature for .Net 2.0
369         * Duplex.cs: Fixes signature for .Net 2.0
370         * PaperSize.cs: Fixes signature for .Net 2.0
371         * PreviewPrintController.cs: Fixes signature for .Net 2.0
372         * PrinterSettings.cs: Fixes signature for .Net 2.0
373         * PrintRange.cs: Fixes signature for .Net 2.0
374           
375 2005-09-16  Sebastien Pouliot  <sebastien@ximian.com>
376
377         * InvalidPrinterException.cs: Removed NotImplementedException (not
378         required) and added a demand for SerializationFormatter on the 
379         GetObjectData method.
380         * PrintingPermission.cs: Throw ArgumentException if the class or 
381         version attributes are missing in the supplied XML (only in 1.x).
382
383 2005-03-23 Jordi Mas i Hernandez <jordi@ximian.com>
384         * PaperKind.cs: fixes wrong enum values
385
386 2005-01-27  Lluis Sanchez Gual  <lluis@novell.com>
387
388         * MarginsConverter.cs: Implemented support for InstanceDescriptor.