15 Commits
Author SHA1 Message Date
Frederik Carlier 831381caa9 Use CoreFX sources for System.Printing (#5041) 2017-06-16 00:57:02 +02:00
Marek Safar b2d5552461 Warnings cleanup
svn path=/trunk/mcs/; revision=111848
2008-08-28 17:45:48 +00:00
Andreia Gaita 66182d5e10 * PrintingServicesWin32.cs: Add enumeration flag to get remote
printers as well as locally connected ones. Fixes #325258

2007-12-10  Andreia Gaita <[email protected]>

svn path=/trunk/mcs/; revision=91039
2007-12-10 11:07:22 +00:00
Gert Driesen df473e219c * PrintingServicesWin32.cs: Pass 0 as mode to DocumentProperties to
obtain the size of the buffer required to hold the DEVMODE structure.
Fixes bug #81723.

svn path=/trunk/mcs/; revision=77890
2007-05-24 03:57:03 +00:00
Andreia Gaita 7dda136e2b 2007-02-16 Andreia Gaita <[email protected]>
Redesign how and when cups gets called to minimize
p/invokes, implements caching of printers and printer
settings as per calberto's patch - #79822, plotter detection, 
duplex, fixes for image disposing, code modularization, 
misc. fixes.

svn path=/trunk/mcs/; revision=73048
2007-02-16 23:10:35 +00:00
Jordi Mas i Hernandez da44c5008d 2006-12-01 Jordi Mas i Hernandez <[email protected]>
* PrintingServicesWin32.cs: Fixes paper sizes reading. The POINT 
	structure is 8 bytes long not 4. This fixes margins calculations 
	(based on the paper size) that were badly broken. 


svn path=/trunk/mcs/; revision=68849
2006-12-01 21:20:55 +00:00
Andreia Gaita a5f86022b8 2006-11-28 Andreia Gaita <[email protected]>
* Form.cs: Removed call to UpdateBounds on Form
constructor, it was causing a call to CreateHandle
before it was supposed to.
* PrintControllerWithStatusDialog: Applied patch
by Chris Toshok to hide controller when there are
no printers available.
PrintDialog.cs: initialize printer settings to 
null - correct DefaultValues test #5
* PrintPreviewControl.cs: Move PrintController
initialization to GeneratePreview
* PrintPreviewDialog.cs: 
- Remove Preview generation	from Document_set(). It is 
called on OnPaint
- Throw InvalidPrinterException on CreateHandle if
a Document is set but there are no printers or 
printer is not valid.
* ThemeWin32Classic: don't paint PrintPreviewControl
if there is nothing to paint

* PageSettings.cs: 
- internal member name changes to help
out with intelisense. 
- Use internal members directly instead of using
corresponding properties so that exceptions are not thrown
* PrintingServicesWin32:
- Only return DefaultPrinter if it is actually valid. This
is because Win32GetDefaultPrinter returns a printer name
even if PrintSpooler is stopped (which should  behave the
same way as if there are no printers installed)
- Do not try to allocate if EnumPrinters returns 0

svn path=/trunk/mcs/; revision=68635
2006-11-29 03:13:04 +00:00
Carlos Alberto Cortez 5b33fc860a 2006-11-24 Carlos Alberto Cortez <[email protected]>
Initial support for PageSettings (color, copies, collate,
	and media size).

	* StandardPrintController.cs: Pass PrintDocument.PageSettings to
	create the Graphics object (althought PageSettings
	contains a PrinterSettings and vice versa, PrintDocument
	can contain non-related PrinterSettings and PageSettings objects).

	* PrintingServices.cs: Likewise.
	* PrintingServicesWin32.cs: Likewise.
	* PrintingServicesUnix.cs: Likewise. Also use cupsParseOptions
	to pass printing options when calling cupsPrintFile. Use "Custom"
	as name for custom pages without associated name (Laxmark printers
	have this problem, causing a nullref exc). Add GetPaperKind () method
	to retrieve and set the right PaperKind value for PaperSize, instead
	of using PaperKind.Custom for all page sizes. Finally save
	PageSettings in DOCINFO to use it later.

	* PrintDocument.cs: Clone PrinterSettings.PageSettings
	instead of creating a new one (this avoid creating an additional
	PrinterSettings instance).


svn path=/trunk/mcs/; revision=68449
2006-11-25 02:20:27 +00:00
Andreia Gaita 33fa99469d * PrintingServicesWin32.cs: fix another dumb typo -
check proper return value from printer validity call

2006-11-17  Andreia Gaita <[email protected]>


svn path=/trunk/mcs/; revision=68117
2006-11-18 03:37:14 +00:00
Andreia Gaita 360de1202f Fixes #79835, implements PrinterSettings.IsValid, throws proper
InvalidPrinterException with differentiated messages.

* PrintingServices.cs: Declares IsPrinterValid to enable easy checking
if printer name is a valid printer

* PrintingServicesWin32.cs: Implements IsPrinterValid, caches 
last assigned printer name and if it is valid to speed up next calls.

* PrintingServicesUnix.cs: Implements IsPrinterValid, caches 
last assigned printer name and if it is valid to speed up next calls.

* PageSettings.cs: 
	- throw InvalidPrinterException in the properties,
	according to the docs: Color, Landscape, PaperSize, PaperSource, 
	PrinterResolution
	- change the private fields above to internal, so that in the
	constructor we can access them without triggering the exceptions
	if there are no printers installed
	
* PrinterSettings.cs: Implement IsValid to call IsPrinterValid
implemented above

* PreviewPrintController.cs: throw InvalidPrinterException on 
StartPrint() if there's no valid printer configured

* InvalidPrinterException.cs: New private GetMessage() to customize
printer error message, used by constructor

2006-11-14 Andreia Gaita <[email protected]>

svn path=/trunk/mcs/; revision=67880
2006-11-14 23:03:43 +00:00
Jordi Mas i Hernandez 466bc86721 2006-09-27 Jordi Mas i Hernandez <[email protected]>
* PrintingServices.cs: Add LoadPrinterPaperSources member
	
	* PrintingServicesWin32.cs: Implements LoadPrinterPaperSources and
	reads the default paper source and size.
	
	* PrintingServicesUnix.cs: Add stub LoadPrinterPaperSources member
	
	* PrinterSettings.cs: Implements PaperSourceCollection property and
	makes default paper source and size from the system.


svn path=/trunk/mcs/; revision=65968
2006-09-27 12:07:06 +00:00
Jordi Mas i Hernandez f36b05098c 2006-05-20 Jordi Mas i Hernandez <[email protected]>
* PrintingServices.cs: GetPrintDialogInfo definition
	* PrintingServicesWin32.cs GetPrintDialogInfo implementation
	* PrintingServicesUnix.cs: GetPrintDialogInfo stub


svn path=/trunk/mcs/; revision=60889
2006-05-20 15:58:22 +00:00
Peter Dennis Bartok 8540a01cb1 2006-02-09 Peter Dennis Bartok <[email protected]>
* ColorPalette.cs, EncoderParameters.cs, EncoderParameter.cs,
	  ImageAttributes.cs: 64bit cleanup and some simplifications

2006-02-09  Peter Dennis Bartok  <[email protected]>

	* PrintingServicesWin32.cs: Simplyfied the code, removing the need
	  for pointer calculations (part of 64bit cleanup)

2006-02-09  Peter Dennis Bartok  <[email protected]>

	* Image.cs, Bitmap.cs: Removed unneeded casts
	* Icon.cs: Fixed code to be 64bit safe


svn path=/trunk/mcs/; revision=56738
2006-02-09 23:58:23 +00:00
Sebastien Pouliot a3a9058c54 2006-01-27 Sebastien Pouliot <[email protected]>
* PrintingServicesWin32.cs: Ensure Marshal.FreeHGlobal is called for 
	all unmanaged memory allocated with AllocHGlobal.


svn path=/trunk/mcs/; revision=56181
2006-01-27 19:16:23 +00:00
Jordi Mas i Hernandez 08351b8c0d 2005-12-22 Jordi Mas i Hernandez <[email protected]>
* PrintingServices.cs: Printing services abstration class
	* PrintingServicesWin32.cs: Win32 printer driver
	* PrintingServicesUnix.cs: Unix printer driver
	* Margins.cs: Fixes exceptions error messages
	* PrinterResolution.cs: Fixes
	* PrintEventArgs.cs: New internal method
	* PrintPageEventArgs.cs: New internal method
	* StandardPrintController.cs: Fixes
	* PrinterUnitConvert.cs: Fixes conversion errors
	* PrintDocument.cs: Fixes to make it print
	* PageSettings.cs: Take margains into account
	* PrintController.cs: Fixes
	* PaperSize.cs: Method to set paper Kind
	* PrinterSettings.cs: Implements settings and fixes
	* 	


svn path=/trunk/mcs/; revision=54735
2005-12-22 17:06:00 +00:00