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