Commit Graph
53 Commits
Author SHA1 Message Date
Carlos Alberto Cortez 3cbc62482a 2009-07-08 Carlos Alberto Cortez <[email protected]>
* PaperSource.cs: Implement RawKind.
	Fixes the remaining bits of #507739.


svn path=/trunk/mcs/; revision=137565
2009-07-08 13:13:58 +00:00
Carlos Alberto Cortez f1e3a57f5b 2009-07-08 Carlos Alberto Cortez <[email protected]>
* PaperSize.cs: Implement support for RawKind.
	Patch by Andy Hume ([email protected]).
	Fixes part of #507739.


svn path=/trunk/mcs/; revision=137559
2009-07-08 11:58:10 +00:00
Carlos Alberto Cortez 207d41b7a5 2009-07-07 Carlos Alberto Cortez <[email protected]>
* PaperSize.cs: Actually implement RawKind by retrieving and setting
	the kind field.


svn path=/trunk/mcs/; revision=137481
2009-07-07 07:08:10 +00:00
Sebastien Pouliot b24dc833fc 2008-11-01 Sebastien Pouliot <[email protected]>
* PrintingServicesUnix.cs: Fix potential crash on 64bit OS. Gendarme
	rule for checking IntPtr has been updated to cover this case as well


svn path=/trunk/mcs/; revision=117611
2008-11-01 16:34:27 +00:00
Sebastien Pouliot 6f720f0e3f 2008-10-12 Sebastien Pouliot <[email protected]>
* PaperSize.cs, PreviewPrintController.cs, PrinterSettings.cs,
	PrintingPermissionAttribute.cs, PrintingPermission.cs: Remove unneeded
	field initialization to their default values.
	[Found using Gendarme AvoidUnneededFieldInitializationRule]


svn path=/trunk/mcs/; revision=115565
2008-10-12 14:48:17 +00:00
Sebastien Pouliot cda1fa7d8d PrintingServicesUnix.cs: Fix AvoidToStringOnStringsRule found using Gendarme.
svn path=/trunk/mcs/; revision=95402
2008-02-10 20:21:47 +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 845acd3fcf * Margins.cs: Overloaded operators are 2.0 only.
svn path=/trunk/mcs/; revision=81102
2007-06-30 13:11:02 +00:00
Sebastien Pouliot 506e9a7397 2007-05-29 Sebastien Pouliot <[email protected]>
* Margins.cs: Implement missing == and != operators (MoMA reports them
	but they were not included in the class status pages). Fix property 
	setters (to check value), reduced code duplication and changed 
	GetHashCode to be less CPU intensive.


svn path=/trunk/mcs/; revision=78135
2007-05-29 15:14:44 +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
Sebastien Pouliot 52fc59a004 2007-05-23 Sebastien Pouliot <[email protected]>
* PreviewPrintController.cs: Reduce bitmap size and avoid scaling the
	print preview (fix bug #80765). Patch from Vladimir Dimitrov.
	* PrintingServicesUnix.cs: Reorder calculation to avoid loss of 
	precision in integer division. Use printer resolution for Cairo
	fallback. Patch from Vladimir Dimitrov.


svn path=/trunk/mcs/; revision=77837
2007-05-23 14:38:40 +00:00
Andreia Gaita 1c442c83ad * PrintingServices.cs: Add missing static method SysPrn.GetPrintDialogInfo
for SWF to call up printing dialogues.

2007-03-13  Andreia Gaita  <[email protected]>

svn path=/trunk/mcs/; revision=74206
2007-03-13 20:27:34 +00:00
Andreia Gaita 20bb09af74 2007-02-21 Andreia Gaita <[email protected]>
* PrintingServicesUnix.cs: Report an error in the console if there is
a problem opening the printer.

svn path=/trunk/mcs/; revision=73289
2007-02-22 00:24:29 +00:00
Andreia Gaita 4a6f551587 2007-02-21 Andreia Gaita <[email protected]>
* PrintingServicesUnix.cs: don't free up pointers unnecessarily (doh)

svn path=/trunk/mcs/; revision=73268
2007-02-21 18:42:53 +00:00
Andreia Gaita 142921787d 2007-02-21 Andreia Gaita <[email protected]>
* PrintingServicesUnix.cs: add checks and try blocks to make sure
things don't blow up if we try to double free anything (not that
we're trying to do anything like that :p )

svn path=/trunk/mcs/; revision=73264
2007-02-21 18:08:29 +00:00
Andreia Gaita 3dd97999d2 2007-02-20 Andreia Gaita <[email protected]>
* PrintingServicesUnix.cs: fix a double-free bug

svn path=/trunk/mcs/; revision=73263
2007-02-21 17:36:43 +00:00
Andreia Gaita 9cbe08c5c3 2007-02-20 Andreia Gaita <[email protected]>
* PrintingServicesUnix.cs: Fix leak caused by not calling cupsFreeDests
	on certain codepaths. Fix return value of cupsFreeDests to void.

svn path=/trunk/mcs/; revision=73208
2007-02-20 18:59:27 +00:00
Andreia Gaita 0b5d6119ab 2007-02-20 Andreia Gaita <[email protected]>
* PrintingServicesUnix.cs: Correct missing static initialization
of loaded printers hashtable, unit tests were failing (oops :p)

svn path=/trunk/mcs/; revision=73170
2007-02-20 14:07:27 +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
Sebastien Pouliot 5ed9a98698 2007-02-09 Sebastien Pouliot <[email protected]>
* PrintingServicesUnix.cs: Ensure we free the original pointer in
	GetAlternativeDefaultPrinter (not the one used for iteration).


svn path=/trunk/mcs/; revision=72542
2007-02-09 14:19:48 +00:00
Andreia Gaita d41f32888e 2007-01-19 Andreia Gaita <[email protected]>
* PrintingServicesUnix.cs: Add is_default flag check for 
detecting default printer when cupsGetDefault doesn't return
valid values (mainly ubuntu). Fixes #80198, #80519

svn path=/trunk/mcs/; revision=71372
2007-01-19 22:41:06 +00:00
Sebastien Pouliot 1f724f01a8 PrintingServices.cs: Unify platform detection code.
svn path=/trunk/mcs/; revision=70733
2007-01-09 19:31:14 +00:00
Carlos Alberto Cortez 37fa66d50b 2006-12-04 Carlos Alberto Cortez <[email protected]>
* PrintingServicesUnix.cs: Add "landscape" option
	when using PaperSettings.Landscape set to true. Also
	swap the width and height for the postscript file.


svn path=/trunk/mcs/; revision=69014
2006-12-05 05:57:20 +00:00
Andreia Gaita b3379e6e39 2006-12-02 Andreia Gaita <[email protected]>
* PrintingServicesUnix: Proper size structure use for 64 bit
support.

svn path=/trunk/mcs/; revision=68878
2006-12-02 18:13:29 +00:00
Andreia Gaita 4b9e949427 2006-12-01 Andreia Gaita <[email protected]>
* PrintingServicesUnix: *properly* check return value from 
cupsGetDefault. If there are no default printers set, 
check if there are installed printers, and use that.
Hopefully fixes #79835

svn path=/trunk/mcs/; revision=68872
2006-12-02 00:08:11 +00:00
Andreia Gaita b1dab8b8be Hopefully fixes #79835
* PrintingServicesUnix: check return value from cupsGetDefault.

2006-12-01  Andreia Gaita  <[email protected]>

	
	

svn path=/trunk/mcs/; revision=68864
2006-12-01 22:06:28 +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
Jordi Mas i Hernandez a80595c165 2006-11-25 Jordi Mas i Hernandez <[email protected]>
* PrintingServicesUnix.cs: Implements GetPrintDialogInfo


svn path=/trunk/mcs/; revision=68454
2006-11-25 10:36:07 +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
Chris Toshok 09a2b539dd 2006-11-16 Chris Toshok <[email protected]>
* PreviewPrintController.cs: fix typo - don't throw
	InvalidPrinterException when it wasn't supposed to be.


svn path=/trunk/mcs/; revision=68047
2006-11-17 03:37:56 +00:00
Carlos Alberto Cortez 85696e7b1e 2006-11-16 Carlos Alberto Cortez <[email protected]>
* PrintDocument.cs: Use QueryPageSettingsEventArgs.PageSettings
	in PrintPageEventArgs, instead of using the default one (mimic
	.Net behaviour).

	* PageSettings.cs: Implement Clone the right way (intead of using
	the default page settings).


svn path=/trunk/mcs/; revision=68030
2006-11-16 19:07:00 +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 99eceeb81b * PrintingServicesUnix.cs: Implements LoadPrinterPaperSources member,
simplifies GetPaperSizeName and loads paper source and size defaults

2006-09-27 Jordi Mas i Hernandez <[email protected]>


svn path=/trunk/mcs/; revision=65976
2006-09-27 17:26:59 +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
Chris Toshok a0780d5bbb 2006-08-02 Chris Toshok <[email protected]>
* PreviewPrintController.cs: scale the Graphics context we pass
	back from OnStartPage such that the preview looks the way the
	printed output will.


svn path=/trunk/mcs/; revision=63258
2006-08-02 16:39:57 +00:00
Carlos Alberto Cortez c422874876 2006-07-28 Carlos Alberto Cortez <[email protected]>
* PrintDocument.cs: When null is passed to PrinterSettings,
	it should be set to a new PrinterSettings instance, and should never
	be null.

	* PrinterSettings.cs: Default value for Copies should be 1. Also
	add a space in the ToString method, to correctly show the printer
	info.


svn path=/trunk/mcs/; revision=63110
2006-07-28 19:36:25 +00:00
Chris Toshok b566a6548d 2006-07-26 Chris Toshok <[email protected]>
* PrinterSettings.cs: expose PrintFileName in the 1.1 case as an
	internal property, so we can get at it from MWF.

	* PrintingServicesUnix.cs: handle print to file, and also remove
	the temp file after sending the data to the printer.  fix some
	dllimports to match the rest of system.drawing.

	* PreviewPrintController.cs: implement this (warning, it'll eat
	all your memory until we get a real Metafile implementation, as
	we're storing bitmaps).

	* PrintDocument.cs: shift the graphics context stuff around a bit
	in Print(), so that the events after OnStartPrint are passed the
	graphics context the controller created there, and we use the
	return value of OnStartPage to do all drawing.


svn path=/trunk/mcs/; revision=63020
2006-07-26 23:02:29 +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
Jordi Mas i Hernandez 9fd6cbc11f 2006-04-14 Jordi Mas i Hernandez <[email protected]>
* PrintingServicesUnix.cs: Replace cupsGetPrinters deprecated API call


svn path=/trunk/mcs/; revision=60683
2006-05-14 09:20:50 +00:00
Jordi Mas i Hernandez 48e7e27ab1 2006-04-13 Jordi Mas i Hernandez <[email protected]>
* PrintingServicesUnix.cs: Checks if cups is installed
	* PrinterSettings.cs: PrintToFile property and ToString method


svn path=/trunk/mcs/; revision=60679
2006-05-13 18:18:36 +00:00
Sebastien Pouliot fd0c615c45 2006-04-28 Sebastien Pouliot <[email protected]>
* PrintController.cs: corcompare fix. No public ctor in 2.0.
	* PrinterSettings.cs: corcompare fix. Clone method isn't virtual.


svn path=/trunk/mcs/; revision=60052
2006-04-28 19:13:23 +00:00
Sebastien Pouliot a91b0dc4ef 2006-03-21 Sebastien Pouliot <[email protected]>
* PrintingServicesUnix.cs: cupsGetPrinters(char***) requires to free 
	each individual string and (finally) the list. Note that this call is
	deprecated.


svn path=/trunk/mcs/; revision=58270
2006-03-22 00:00:06 +00:00
Peter Dennis Bartok 6bfdefe3d7 2006-03-13 Peter Dennis Bartok <[email protected]>
* PrintingServicesUnix.cs: Handle not having a printer


svn path=/trunk/mcs/; revision=57931
2006-03-14 00:10:10 +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 3e3aff3acb 2006-01-15 Jordi Mas i Hernandez <[email protected]>
* PrintingServicesUnix.cs: Allow setting the dpy's for the surface


svn path=/trunk/mcs/; revision=55609
2006-01-15 21:20:28 +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
Jordi Mas i Hernandez e07caa2bbe In System.Drawing.Printing:
2005-12-07 Jordi Mas i Hernandez <[email protected]>
	
	* PrinterResolutionKind.cs: Fixes signature for .Net 2.0
	* PaperKind.cs: Fixes signature for .Net 2.0
	* PaperSource.cs: Fixes signature for .Net 2.0
	* Margins.cs: Fixes signature for .Net 2.0
	* PrinterResolution.cs: Fixes signature for .Net 2.0
	* PrintEventArgs.cs: Fixes signature for .Net 2.0
	* PrintAction.cs: New enum in .Net 2.0
	* PageSettings.cs:  Fixes signature for .Net 2.0
	* PaperSourceKind.cs:  Fixes signature for .Net 2.0
	* PrintController.cs: Fixes signature for .Net 2.0
	* Duplex.cs: Fixes signature for .Net 2.0
	* PaperSize.cs: Fixes signature for .Net 2.0
	* PreviewPrintController.cs: Fixes signature for .Net 2.0
	* PrinterSettings.cs: Fixes signature for .Net 2.0
	* PrintRange.cs: Fixes signature for .Net 2.0
	  
In System.Drawing:
2005-12-07 Jordi Mas i Hernandez <[email protected]>

	* BufferedGraphicsManager.cs: Fixes signature


svn path=/trunk/mcs/; revision=54028
2005-12-07 12:19:45 +00:00