98 Commits
Author SHA1 Message Date
Frederik Carlier 831381caa9 Use CoreFX sources for System.Printing (#5041) 2017-06-16 00:57:02 +02:00
Frederik Carlier 0526617e0a System.Drawing: Start consuming sources from corefx
Closes https://github.com/mono/mono/pull/4980
2017-06-06 23:46:01 +02:00
Frederik Carlier 62a24d06c2 System.Drawing: Various netstandard1.6 compat fixes (#4863)
Minor fixes which make System.Drawing compatible with netstandard1.6:
- Use MemoryStream.ToArray instead of .GetBuffer
- Use RuntimeInformation.IsOSPlatform to determine the operating system
- Use Stream.Dispose instead of Stream.Close
- Disable serialization support for exceptions
- Don't use AppDomain
2017-05-15 21:10:01 +02:00
Frederik Carlier f121eb73d4 [System.Drawing] NS1.6 compatibility: Use GetTypeInfo () where required (#4861)
* netstandard1.6 compatibility: Use GetTypeInfo () where required

A lot of methods have moved from Type to TypeInfo in netstandard1.6, add calls to GetTypeInfo ()
where required to support compiling System.Drawing on netstandard1.6

* Add missing using statement
2017-05-15 02:23:43 +02:00
Frederik Carlier 1540749175 Make System.Drawing code compatible with .NET Core (#4548) 2017-03-17 23:30:35 +01:00
Frederik Carlier 6447228e30 Remove CAS attributes from System.Drawing (#4544) 2017-03-17 00:10:44 +01:00
Marek Safar 47a6f56439 [bcl] Clean up some warnings 2016-11-29 19:16:02 +01:00
Paul Gofman bbf7ea470a [System.Drawing.Printing] CUPS default PageSize and InputSlot should override PPD defaults.
There is already a test case for that (PrintingServicesUnixTest.cs,
Bug602934_PrinterSettingsReturnActualValues) which fails when user
configured options are different from PPD settings. Patch also makes
this test not to fail if "Resolution" option is not present in CUPS
options.

*Update: removed leftover debug Console.WriteLine from patch
2016-02-19 13:01:10 +03:00
Alexander Köplinger b03e606287 Remove ChangeLog files from the repo
They weren't updated in the last 6 years and aren't helpful anymore (e.g. by causing unrelated matches during git grep searches).
2016-01-29 19:17:06 +01:00
guerrysemones eefcd3b42e This is a patch to fix bug 34123. System.Drawing.Printing.PrintingServicesUnix is failing to print on Mac OSX Yosemite because the CUPS function cupsTempFile now always returns an empty string. This function was deprecated. Now replacing cupsTempFile call with call to cupsTempFd to fix printing. I do not see a clear way to unit test this, and there appear to be no prior unit tests covering this. Essentially we are swapping a function call for another that returns the same type of result. This was tested on my copy of net_4_x master. The same fix could be applied to mono version 3 also. This change is released under the MIT license. 2015-09-23 13:32:46 -05:00
Zoltan Varga 0985d4aa4b [bcl] Remove NET_2_0 defines from the class libs. This has been done using: unifdef -t -DNET_2_0 -o <filename> <filename>. 2015-01-13 15:29:38 -05:00
Eberhard Beilharz 049a349dae [Printing] Improve reported printer settings (Fixes #602934)
Report the actual values of the printer driver in printer settings
instead of using hard coded default values. This fixes Novell bug
#602934 (https://bugzilla.novell.com/show_bug.cgi?id=602934).
2014-02-28 16:45:46 +01:00
Miguel de Icaza 1c19405a83 [class libraries] drop NET_1_0 definitions 2012-06-02 21:46:34 -04:00
Raja R Harinath cd51491631 Fix a few cases of mixed line-endings
This is a scripted conversion of mixed line-ending files to LF-only or CRLF-only
based on which patch is smaller.  I used a threshold of upto a quarter of the
lines to determine whether to keep the patch or not.
2010-07-26 02:20:13 +05:30
Raja R Harinath b293948fb7 EOL handling
This set of .gitattributes was automatically generated from the list of files
that GIT tried to normalize when I enabled automatic EOL conversion.

With this set of attributes, we prevent automated EOL conversion on files that
we know will cause trouble down the road.
2010-07-25 20:17:39 +05:30
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
Marek Safar b2d5552461 Warnings cleanup
svn path=/trunk/mcs/; revision=111848
2008-08-28 17:45:48 +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
Marek Safar a4cccaa722 Removed warnings.
svn path=/trunk/mcs/; revision=73053
2007-02-17 13:19:13 +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