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