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