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