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