dotgnu-pnet-commits
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Dotgnu-pnet-commits] CVS: pnetlib/System.Drawing/Toolkit ToolkitManager


From: Rhys Weatherley <address@hidden>
Subject: [Dotgnu-pnet-commits] CVS: pnetlib/System.Drawing/Toolkit ToolkitManager.cs, 1.6, 1.7 UnixPrintingSystem.cs, 1.1, 1.2
Date: Sat, 19 Jul 2003 07:04:28 -0400

Update of /cvsroot/dotgnu-pnet/pnetlib/System.Drawing/Toolkit
In directory subversions:/tmp/cvs-serv17603/System.Drawing/Toolkit

Modified Files:
        ToolkitManager.cs UnixPrintingSystem.cs 
Log Message:


Create the correct printing system for Unix systems; use the
default printer if the printer name is "null".


Index: ToolkitManager.cs
===================================================================
RCS file: 
/cvsroot/dotgnu-pnet/pnetlib/System.Drawing/Toolkit/ToolkitManager.cs,v
retrieving revision 1.6
retrieving revision 1.7
diff -C2 -r1.6 -r1.7
*** ToolkitManager.cs   18 Jul 2003 05:17:56 -0000      1.6
--- ToolkitManager.cs   19 Jul 2003 11:04:26 -0000      1.7
***************
*** 68,73 ****
                        }
  
        // Get or set the active printing system.
-       [TODO]
        public static IToolkitPrintingSystem PrintingSystem
                        {
--- 68,90 ----
                        }
  
+       // Determine if this platform appears to be Unix-ish.
+       private static bool IsUnix()
+                       {
+                       #if !ECMA_COMPAT
+                               if(Environment.OSVersion.Platform != 
(PlatformID)128) /* Unix */
+                       #else
+                               if(Path.DirectorySeparatorChar == '\\' ||
+                                  Path.AltDirectorySeparatorChar == '\\')
+                       #endif
+                               {
+                                       return false;
+                               }
+                               else
+                               {
+                                       return true;
+                               }
+                       }
+ 
        // Get or set the active printing system.
        public static IToolkitPrintingSystem PrintingSystem
                        {
***************
*** 78,83 ****
                                                if(printingSystem == null)
                                                {
!                                                       // TODO: create a 
system-specific printing system.
!                                                       printingSystem = new 
NullPrintingSystem();
                                                }
                                                return printingSystem;
--- 95,107 ----
                                                if(printingSystem == null)
                                                {
!                                                       if(IsUnix())
!                                                       {
!                                                               printingSystem 
= new UnixPrintingSystem();
!                                                       }
!                                                       else
!                                                       {
!                                                               // TODO: Win32 
printing system.
!                                                               printingSystem 
= new NullPrintingSystem();
!                                                       }
                                                }
                                                return printingSystem;
***************
*** 128,143 ****
                                // Determine the name of the toolkit we wish to 
use.
                                String name;
!                       #if !ECMA_COMPAT
!                               if(Environment.OSVersion.Platform != 
(PlatformID)128) /* Unix */
!                       #else
!                               if(Path.DirectorySeparatorChar == '\\' ||
!                                  Path.AltDirectorySeparatorChar == '\\')
!                       #endif
                                {
!                                       name = "System.Drawing.Win32";
                                }
                                else
                                {
!                                       name = "System.Drawing.Xsharp";
                                }
  
--- 152,162 ----
                                // Determine the name of the toolkit we wish to 
use.
                                String name;
!                               if(IsUnix())
                                {
!                                       name = "System.Drawing.Xsharp";
                                }
                                else
                                {
!                                       name = "System.Drawing.Win32";
                                }
  

Index: UnixPrintingSystem.cs
===================================================================
RCS file: 
/cvsroot/dotgnu-pnet/pnetlib/System.Drawing/Toolkit/UnixPrintingSystem.cs,v
retrieving revision 1.1
retrieving revision 1.2
diff -C2 -r1.1 -r1.2
*** UnixPrintingSystem.cs       7 Jun 2003 22:40:58 -0000       1.1
--- UnixPrintingSystem.cs       19 Jul 2003 11:04:26 -0000      1.2
***************
*** 65,68 ****
--- 65,72 ----
                                        return new UnixPrinter(name);
                                }
+                               else if(name == null)
+                               {
+                                       return new 
UnixPrinter(DefaultPrinterName);
+                               }
                                else
                                {





reply via email to

[Prev in Thread] Current Thread [Next in Thread]