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