src/solaris/classes/sun/print/CUPSPrinter.java

Print this page




  60     //public static boolean useIPPMedia = false; will be used later
  61 
  62     private MediaPrintableArea[] cupsMediaPrintables;
  63     private MediaSizeName[] cupsMediaSNames;
  64     private CustomMediaSizeName[] cupsCustomMediaSNames;
  65     private MediaTray[] cupsMediaTrays;
  66 
  67     public  int nPageSizes = 0;
  68     public  int nTrays = 0;
  69     private  String[] media;
  70     private  float[] pageSizes;
  71     private String printer;
  72 
  73     private static boolean libFound;
  74     private static String cupsServer = null;
  75     private static int cupsPort = 0;
  76 
  77     static {
  78         // load awt library to access native code
  79         java.security.AccessController.doPrivileged(
  80             new sun.security.action.LoadLibraryAction("awt"));





  81         libFound = initIDs();
  82         if (libFound) {
  83            cupsServer = getCupsServer();
  84            cupsPort = getCupsPort();
  85         }
  86     }
  87 
  88 
  89     CUPSPrinter (String printerName) {
  90         if (printerName == null) {
  91             throw new IllegalArgumentException("null printer name");
  92         }
  93         printer = printerName;
  94         cupsMediaSNames = null;
  95         cupsMediaPrintables = null;
  96         cupsMediaTrays = null;
  97         initialized = false;
  98 
  99         if (!libFound) {
 100             throw new RuntimeException("cups lib not found");




  60     //public static boolean useIPPMedia = false; will be used later
  61 
  62     private MediaPrintableArea[] cupsMediaPrintables;
  63     private MediaSizeName[] cupsMediaSNames;
  64     private CustomMediaSizeName[] cupsCustomMediaSNames;
  65     private MediaTray[] cupsMediaTrays;
  66 
  67     public  int nPageSizes = 0;
  68     public  int nTrays = 0;
  69     private  String[] media;
  70     private  float[] pageSizes;
  71     private String printer;
  72 
  73     private static boolean libFound;
  74     private static String cupsServer = null;
  75     private static int cupsPort = 0;
  76 
  77     static {
  78         // load awt library to access native code
  79         java.security.AccessController.doPrivileged(
  80             new java.security.PrivilegedAction<Void>() {
  81                 public Void run() {
  82                     System.loadLibrary("awt");
  83                     return null;
  84                 }
  85             });
  86         libFound = initIDs();
  87         if (libFound) {
  88            cupsServer = getCupsServer();
  89            cupsPort = getCupsPort();
  90         }
  91     }
  92 
  93 
  94     CUPSPrinter (String printerName) {
  95         if (printerName == null) {
  96             throw new IllegalArgumentException("null printer name");
  97         }
  98         printer = printerName;
  99         cupsMediaSNames = null;
 100         cupsMediaPrintables = null;
 101         cupsMediaTrays = null;
 102         initialized = false;
 103 
 104         if (!libFound) {
 105             throw new RuntimeException("cups lib not found");