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