Browse Source

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

Jordi Mas i Hernandez 20 years ago
parent
commit
e07caa2bbe

+ 18 - 0
mcs/class/System.Drawing/System.Drawing.Printing/ChangeLog

@@ -1,3 +1,21 @@
+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
+	  
 2005-09-16  Sebastien Pouliot  <[email protected]>
 
 	* InvalidPrinterException.cs: Removed NotImplementedException (not

+ 4 - 1
mcs/class/System.Drawing/System.Drawing.Printing/Duplex.cs

@@ -29,7 +29,10 @@
 //
 using System;
 namespace System.Drawing.Printing 
-{
+{
+#if NET_2_0
+	[Serializable]
+#endif
 	public enum Duplex {
 		Default = -1,
 		Horizontal = 3,

+ 3 - 0
mcs/class/System.Drawing/System.Drawing.Printing/Margins.cs

@@ -36,6 +36,9 @@ using System.ComponentModel;
 
 namespace System.Drawing.Printing
 {
+#if NET_2_0
+	[Serializable]
+#endif
 	[TypeConverter (typeof (MarginsConverter))]
 	public class Margins : ICloneable
 	{

+ 27 - 0
mcs/class/System.Drawing/System.Drawing.Printing/PageSettings.cs

@@ -37,11 +37,18 @@ using System.Runtime.InteropServices;
 
 namespace System.Drawing.Printing
 {
+#if NET_2_0
+	[Serializable]
+#else
 	[ComVisible (false)]
+#endif
 	public class PageSettings : ICloneable
 	{
 		bool _Color;
 		bool _Landscape;
+		float _HardMarginX;
+		float _HardMarginY;
+		RectangleF _PrintableArea;
 		// create a new default Margins object (is 1 inch for all margins)
 		Margins _Margins = new Margins();
 		PaperSize _PaperSize;
@@ -156,7 +163,27 @@ namespace System.Drawing.Printing
 			set{
 				_PrinterSettings = value;
 			}
+		}		
+#if NET_2_0
+		public float HardMarginX {
+			get {
+				return _HardMarginX;
+			}
+		}
+		
+		public float HardMarginY {
+			get {
+				return _HardMarginY;
+			}
 		}
+		
+		public RectangleF PrintableArea {
+			get {
+				return _PrintableArea;
+			}
+		}
+#endif
+
 
 		public object Clone(){
 			return new PageSettings(this.PrinterSettings);

+ 3 - 0
mcs/class/System.Drawing/System.Drawing.Printing/PaperKind.cs

@@ -31,6 +31,9 @@ using System;
 
 namespace System.Drawing.Printing 
 {
+#if NET_2_0
+	[Serializable]
+#endif
 	public enum PaperKind
 	{
 		A2 = 66,

+ 19 - 2
mcs/class/System.Drawing/System.Drawing.Printing/PaperSize.cs

@@ -37,20 +37,29 @@ namespace System.Drawing.Printing
 	/// <summary>
 	/// Summary description for PaperSize.
 	/// </summary>
+#if NET_2_0
+	[Serializable]
+#endif
 	public class PaperSize
 	{
 		string name;
 		int width;
 		int height;
 		PaperKind kind;
-		
+#if NET_2_0
+		public PaperSize ()
+		{
+
+		}
+#endif		
 		public PaperSize(string name, int width, int height)
 		{
 			this.width = width;
 			this.height = height;
 			this.name = name;
 			this.kind = PaperKind.Custom;
-		}
+		}		
+
 		public int Width{
 			get{
 				return width;
@@ -88,6 +97,14 @@ namespace System.Drawing.Printing
 				return kind;
 			}
 		}
+#if NET_2_0
+		[MonoTODO]
+		public int RawKind {
+			get { throw new NotImplementedException(); }
+			set { throw new NotImplementedException(); }
+		}
+
+#endif
 
 		public override string ToString(){
 			string ret = "[PaperSize {0} Kind={1} Height={2} Width={3}]";

+ 32 - 3
mcs/class/System.Drawing/System.Drawing.Printing/PaperSource.cs

@@ -37,11 +37,20 @@ namespace System.Drawing.Printing
 	/// <summary>
 	/// Summary description for PaperSource.
 	/// </summary>
+#if NET_2_0
+	[Serializable]
+#endif	
 	public class PaperSource
 	{
 		PaperSourceKind _Kind;
 		string _SourceName;
 		
+#if NET_2_0
+		public PaperSource ()
+		{
+			
+		}
+#endif
 		// NOTE:how to construct this class?
 		// I have added a constructor, but I am not sure of me...
 		internal PaperSource(string sourceName, PaperSourceKind kind)
@@ -49,15 +58,35 @@ namespace System.Drawing.Printing
 			_SourceName = sourceName;
 			_Kind = kind;
 		}
-		
+
 		public PaperSourceKind Kind{
 			get {
-			return _Kind; }
+				return _Kind; 
+			}
 		}
 		public string SourceName{
 			get {
-			return _SourceName; }
+				return _SourceName;
+			}
+#if NET_2_0
+		set {
+				_SourceName = value;
+			}
+#endif
 		}
+
+#if NET_2_0
+		[MonoTODO]
+		public int RawKind {
+			get {
+				throw new NotImplementedException ();
+			}
+			set {
+				throw new NotImplementedException ();
+			}
+		}		  
+#endif
+
 		public override string ToString(){
 			string ret = "[PaperSource {0} Kind={1}]";
 			return String.Format(ret, this.SourceName, this.Kind);

+ 3 - 0
mcs/class/System.Drawing/System.Drawing.Printing/PaperSourceKind.cs

@@ -30,6 +30,9 @@
 using System;
 namespace System.Drawing.Printing
 {
+#if NET_2_0
+	[Serializable]
+#endif
 	public enum PaperSourceKind {
 		AutomaticFeed = 7,
 		Cassette = 14,

+ 8 - 2
mcs/class/System.Drawing/System.Drawing.Printing/PreviewPrintController.cs

@@ -41,7 +41,13 @@ namespace System.Drawing.Printing
 		public PreviewPrintController()
 		{
 			useantialias = false;
-		}
+		}
+#if NET_2_0
+		[MonoTODO]
+		public virtual bool IsPreview { 
+			get { throw new NotImplementedException(); }
+		}
+#endif		
 
 		[MonoTODO]
 		public override void OnEndPage(PrintDocument document, PrintPageEventArgs e){
@@ -63,7 +69,7 @@ namespace System.Drawing.Printing
 			throw new NotImplementedException ();
 		}
 		
-		public bool UseAntiAlias {
+		public virtual bool UseAntiAlias {
 			get{
 				return useantialias;
 			}

+ 45 - 0
mcs/class/System.Drawing/System.Drawing.Printing/PrintAction.cs

@@ -0,0 +1,45 @@
+//
+// Copyright (C) 2005 Novell, Inc (http://www.novell.com)
+//
+// Permission is hereby granted, free of charge, to any person obtaining
+// a copy of this software and associated documentation files (the
+// "Software"), to deal in the Software without restriction, including
+// without limitation the rights to use, copy, modify, merge, publish,
+// distribute, sublicense, and/or sell copies of the Software, and to
+// permit persons to whom the Software is furnished to do so, subject to
+// the following conditions:
+//
+// The above copyright notice and this permission notice shall be
+// included in all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
+// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+//
+// Authors:
+//
+//   Jordi Mas i Hernandez <[email protected]>
+//
+//
+
+#if NET_2_0
+
+using System;
+
+namespace System.Drawing.Printing
+{
+	public enum PrintAction
+	{
+		PrintToFile	= 0,
+		PrintToPreview	= 1,
+		PrintToPrinter	= 2
+	}
+
+}
+
+#endif
+

+ 7 - 2
mcs/class/System.Drawing/System.Drawing.Printing/PrintController.cs

@@ -38,8 +38,13 @@ namespace System.Drawing.Printing
 	{
 		public PrintController ()
 		{
-		}
-
+		}		
+#if NET_2_0
+		[MonoTODO]
+		public virtual bool IsPreview { 
+			get { throw new NotImplementedException(); }
+		}
+#endif
 		[MonoTODO]
 		public virtual void OnEndPage (PrintDocument document, PrintPageEventArgs e)
 		{

+ 10 - 0
mcs/class/System.Drawing/System.Drawing.Printing/PrintEventArgs.cs

@@ -38,8 +38,18 @@ namespace System.Drawing.Printing
 	/// </summary>
 	public class PrintEventArgs : System.ComponentModel.CancelEventArgs
 	{
+#if NET_2_0
+		internal PrintAction action;
+#endif		
+		
 		public PrintEventArgs()
 		{
 		}
+#if NET_2_0
+		public PrintAction PrintAction {
+			get { return action; }
+		}
+	
+#endif
 	}
 }

+ 8 - 2
mcs/class/System.Drawing/System.Drawing.Printing/PrintRange.cs

@@ -29,10 +29,16 @@
 //
 using System;
 namespace System.Drawing.Printing 
-{
+{
+#if NET_2_0
+	[Serializable]
+#endif
 	public enum PrintRange {
 		AllPages = 0,
 		Selection = 1,
-		SomePages = 2
+		SomePages = 2,
+#if NET_2_0		
+		CurrentPage = 0x400000
+#endif		
 	}
 }

+ 30 - 6
mcs/class/System.Drawing/System.Drawing.Printing/PrinterResolution.cs

@@ -35,17 +35,26 @@ using System;
 
 namespace System.Drawing.Printing 
 {
-
+
+#if NET_2_0
+	[Serializable]
+#endif
 	public class PrinterResolution 
 	{
 		private PrinterResolutionKind kind;
 		private int x;
 		private int y;
-
+		
+#if NET_2_0
+		public PrinterResolution ()
+		{
+		}
+#else
 		private PrinterResolution () 
 		{
 		}
-
+#endif
+	
 		internal PrinterResolution (int x, int y, PrinterResolutionKind kind)
 		{
 			this.x = x;
@@ -56,19 +65,34 @@ namespace System.Drawing.Printing
 		public int X {
 			get {
 				return x;
-			}
+			}
+#if NET_2_0
+			set {
+				x = value;
+			}
+#endif
 		}
 
 		public int Y {
 			get {
 				return y;
-			}
+			}
+#if NET_2_0
+			set {
+				y = value;
+			}
+#endif
 		}
 
 		public PrinterResolutionKind Kind {
 			get {
 				return kind;
-			}
+			}
+#if NET_2_0
+			set {
+				kind = value;
+			}
+#endif
 		}
 
 		public override string ToString ()

+ 4 - 1
mcs/class/System.Drawing/System.Drawing.Printing/PrinterResolutionKind.cs

@@ -29,7 +29,10 @@
 //
 using System;
 namespace System.Drawing.Printing 
-{
+{
+#if NET_2_0
+	[Serializable]
+#endif
 	public enum PrinterResolutionKind {
 		Custom = 0,
 		Draft = -1,

+ 99 - 10
mcs/class/System.Drawing/System.Drawing.Printing/PrinterSettings.cs

@@ -36,11 +36,15 @@ using System;
 using System.Runtime.InteropServices;
 using System.Collections;
 using System.Drawing.Printing;
+using System.ComponentModel;
+using System.Drawing.Imaging;
 
 namespace System.Drawing.Printing
 {
 	[Serializable]
+#if ! NET_2_0
 	[ComVisible(false)]
+#endif	
 	public class PrinterSettings : ICloneable
 	{
 		public PrinterSettings()
@@ -49,7 +53,7 @@ namespace System.Drawing.Printing
 
 		// Public subclasses
 
-		public class PaperSourceCollection : ICollection
+		public class PaperSourceCollection : ICollection, IEnumerable
 		{
 			ArrayList _PaperSources = new ArrayList();
 			
@@ -59,13 +63,24 @@ namespace System.Drawing.Printing
 			}
 			
 			public int Count { get { return _PaperSources.Count; } }
+			int ICollection.Count { get { return _PaperSources.Count; } }
 			bool ICollection.IsSynchronized { get { return false; } }
-			object ICollection.SyncRoot { get { return this; } }
+			object ICollection.SyncRoot { get { return this; } }			
+#if NET_2_0
+			[EditorBrowsable(EditorBrowsableState.Never)]
+      			public int Add (PaperSource paperSource) {throw new NotImplementedException (); }
+			public void CopyTo (PaperSource[] paperSources, int index)  {throw new NotImplementedException (); }
+#endif
 			
 			public virtual PaperSource this[int index] {
 				get { return _PaperSources[index] as PaperSource; }
 			}
 			
+			IEnumerator IEnumerable.GetEnumerator()
+			{
+				return _PaperSources.GetEnumerator();
+			}
+			
 			public IEnumerator GetEnumerator()
 			{
 				return _PaperSources.GetEnumerator();
@@ -77,7 +92,7 @@ namespace System.Drawing.Printing
 			}
 		}
 
-		public class PaperSizeCollection : ICollection
+		public class PaperSizeCollection : ICollection, IEnumerable
 		{
 			ArrayList _PaperSizes = new ArrayList();
 			
@@ -87,13 +102,24 @@ namespace System.Drawing.Printing
 			}
 			
 			public int Count { get { return _PaperSizes.Count; } }
+			int ICollection.Count { get { return _PaperSizes.Count; } }
 			bool ICollection.IsSynchronized { get { return false; } }
-			object ICollection.SyncRoot { get { return this; } }
+			object ICollection.SyncRoot { get { return this; } }			
+#if NET_2_0		
+			[EditorBrowsable(EditorBrowsableState.Never)]
+			public int Add (PaperSize paperSize) {throw new NotImplementedException (); }	
+			public void CopyTo (PaperSize[] paperSizes, int index) {throw new NotImplementedException (); }			
+#endif
 			
 			public virtual PaperSize this[int index] {
 				get { return _PaperSizes[index] as PaperSize; }
 			}
 			
+			IEnumerator IEnumerable.GetEnumerator()
+			{
+				return _PaperSizes.GetEnumerator();
+			}
+			
 			public IEnumerator GetEnumerator()
 			{
 				return _PaperSizes.GetEnumerator();
@@ -105,7 +131,7 @@ namespace System.Drawing.Printing
 			}
 		}
 
-		public class PrinterResolutionCollection : ICollection
+		public class PrinterResolutionCollection : ICollection, IEnumerable
 		{
 			ArrayList _PrinterResolutions = new ArrayList();
 			
@@ -115,13 +141,24 @@ namespace System.Drawing.Printing
 			}
 			
 			public int Count { get { return _PrinterResolutions.Count; } }
+			int ICollection.Count { get { return _PrinterResolutions.Count; } }
 			bool ICollection.IsSynchronized { get { return false; } }
 			object ICollection.SyncRoot { get { return this; } }
-			
+#if NET_2_0
+			[EditorBrowsable(EditorBrowsableState.Never)]
+			public int Add (PrinterResolution printerResolution) {throw new NotImplementedException (); }
+			public void CopyTo (PrinterResolution[] printerResolutions, int index) {throw new NotImplementedException (); }
+#endif			
+						
 			public virtual PrinterResolution this[int index] {
 				get { return _PrinterResolutions[index] as PrinterResolution; }
 			}
 			
+			IEnumerator IEnumerable.GetEnumerator()
+			{
+				return _PrinterResolutions.GetEnumerator();
+			}
+			
 			public IEnumerator GetEnumerator()
 			{
 				return _PrinterResolutions.GetEnumerator();
@@ -133,7 +170,7 @@ namespace System.Drawing.Printing
 			}
 		}
 
-		public class StringCollection : ICollection
+		public class StringCollection : ICollection, IEnumerable
 		{
 			ArrayList _Strings = new ArrayList();
 			
@@ -143,13 +180,24 @@ namespace System.Drawing.Printing
 			}
 			
 			public int Count { get { return _Strings.Count; } }
+			int ICollection.Count { get { return _Strings.Count; } }
 			bool ICollection.IsSynchronized { get { return false; } }
 			object ICollection.SyncRoot { get { return this; } }
-			
+						
 			public virtual string this[int index] {
 				get { return _Strings[index] as string; }
 			}
+#if NET_2_0
+			[EditorBrowsable(EditorBrowsableState.Never)]
+      			public int Add (string value) {throw new NotImplementedException (); }
+      			public void CopyTo (string[] strings, int index) {throw new NotImplementedException (); }
+#endif			
 
+			IEnumerator IEnumerable.GetEnumerator()
+			{
+				return _Strings.GetEnumerator();
+			}
+			
 			public IEnumerator GetEnumerator()
 			{
 				return _Strings.GetEnumerator();
@@ -158,7 +206,7 @@ namespace System.Drawing.Printing
 			void ICollection.CopyTo(Array array, int index)
 			{
 				_Strings.CopyTo(array, index);
-			}
+			}			
 		}
 		
 		//properties
@@ -279,7 +327,14 @@ namespace System.Drawing.Printing
 		{
 			get { throw new NotImplementedException(); }
 		}
-
+#if NET_2_0		
+		[MonoTODO("PrinterSettings.PrintFileName")]
+		public string PrintFileName
+		{
+			get { throw new NotImplementedException(); }
+			set { throw new NotImplementedException(); }
+		}
+#endif
 		[MonoTODO("PrinterSettings.PrinterName")]
 		public string PrinterName
 		{
@@ -333,6 +388,25 @@ namespace System.Drawing.Printing
 		{
 			throw new NotImplementedException();
 		}
+#if NET_2_0
+		[MonoTODO("PrinterSettings.CreateMeasurementGraphics")]
+		public Graphics CreateMeasurementGraphics(bool honorOriginAtMargins)		
+		{
+			throw new NotImplementedException();
+		}
+		
+		[MonoTODO("PrinterSettings.CreateMeasurementGraphics")]
+		public Graphics CreateMeasurementGraphics(PageSettings pageSettings)		
+		{
+			throw new NotImplementedException();
+		}
+		
+		[MonoTODO("PrinterSettings.CreateMeasurementGraphics")]
+		public Graphics CreateMeasurementGraphics (PageSettings pageSettings, bool honorOriginAtMargins)		
+		{
+			throw new NotImplementedException();
+		} 
+#endif		
 
 		[MonoTODO("PrinterSettings.GetHdevmode")]
 		public IntPtr GetHdevmode()
@@ -351,6 +425,21 @@ namespace System.Drawing.Printing
 		{
 			throw new NotImplementedException();
 		}
+		
+#if NET_2_0
+
+		[MonoTODO("IsDirectPrintingSupported")]
+		public bool IsDirectPrintingSupported (Image image)
+		{
+			throw new NotImplementedException();
+		}
+		
+		[MonoTODO("IsDirectPrintingSupported")]
+		public bool IsDirectPrintingSupported (ImageFormat imageFormat)
+		{
+			throw new NotImplementedException();
+		}
+#endif
 
 		[MonoTODO("PrinterSettings.SetHdevmode")]
 		public void SetHdevmode(IntPtr hdevmode)

+ 1 - 0
mcs/class/System.Drawing/System.Drawing.dll.sources

@@ -173,6 +173,7 @@ System.Drawing.Printing/PrintEventHandler.cs
 System.Drawing.Printing/PrintingPermissionAttribute.cs
 System.Drawing.Printing/PrintingPermission.cs
 System.Drawing.Printing/PrintingPermissionLevel.cs
+System.Drawing.Printing/PrintAction.cs
 System.Drawing.Printing/PrintPageEventArgs.cs
 System.Drawing.Printing/PrintPageEventHandler.cs
 System.Drawing.Printing/PrintRange.cs

+ 4 - 0
mcs/class/System.Drawing/System.Drawing/BufferedGraphicsManager.cs

@@ -38,6 +38,10 @@ namespace System.Drawing
 		{
 			graphics_context = new BufferedGraphicsContext ();
 		}
+		
+		private BufferedGraphicsManager ()
+		{				
+		}
 
 		public static BufferedGraphicsContext Current {
 			get { return graphics_context; }

+ 4 - 0
mcs/class/System.Drawing/System.Drawing/ChangeLog

@@ -1,3 +1,7 @@
+2005-12-07 Jordi Mas i Hernandez <[email protected]>
+
+	* BufferedGraphicsManager.cs: Fixes signature
+
 2005-12-05  Peter Dennis Bartok  <[email protected]>
 
 	* Font.cs: