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