< prev index next >

src/java.desktop/windows/native/libawt/windows/awt_PrintControl.cpp

Print this page




  37 static const double LOMETRIC_TO_POINTS = (72.0 / 254.0);
  38 
  39 
  40 /* Values must match those defined in WPrinterJob.java */
  41 static const DWORD SET_COLOR = 0x00000200;
  42 static const DWORD SET_ORIENTATION = 0x00004000;
  43 static const DWORD SET_DUP_VERTICAL = 0x00000010;
  44 static const DWORD SET_DUP_HORIZONTAL = 0x00000020;
  45 static const DWORD SET_RES_HIGH = 0x00000040;
  46 static const DWORD SET_RES_LOW = 0x00000080;
  47 
  48 
  49 /* These methods and fields are on sun.awt.windows.WPrinterJob */
  50 jfieldID  AwtPrintControl::dialogOwnerPeerID;
  51 jmethodID AwtPrintControl::getPrintDCID;
  52 jmethodID AwtPrintControl::setPrintDCID;
  53 jmethodID AwtPrintControl::getDevmodeID;
  54 jmethodID AwtPrintControl::setDevmodeID;
  55 jmethodID AwtPrintControl::getDevnamesID;
  56 jmethodID AwtPrintControl::setDevnamesID;

  57 jfieldID  AwtPrintControl::driverDoesMultipleCopiesID;
  58 jfieldID  AwtPrintControl::driverDoesCollationID;
  59 jmethodID AwtPrintControl::getWin32MediaID;
  60 jmethodID AwtPrintControl::setWin32MediaID;
  61 jmethodID AwtPrintControl::getWin32MediaTrayID;
  62 jmethodID AwtPrintControl::setWin32MediaTrayID;
  63 jmethodID AwtPrintControl::getColorID;
  64 jmethodID AwtPrintControl::getCopiesID;
  65 jmethodID AwtPrintControl::getSelectID;
  66 jmethodID AwtPrintControl::getDestID;
  67 jmethodID AwtPrintControl::getDialogID;
  68 jmethodID AwtPrintControl::getFromPageID;
  69 jmethodID AwtPrintControl::getMaxPageID;
  70 jmethodID AwtPrintControl::getMinPageID;
  71 jmethodID AwtPrintControl::getCollateID;
  72 jmethodID AwtPrintControl::getOrientID;
  73 jmethodID AwtPrintControl::getQualityID;
  74 jmethodID AwtPrintControl::getPrintToFileEnabledID;
  75 jmethodID AwtPrintControl::getPrinterID;
  76 jmethodID AwtPrintControl::setPrinterID;


 222                 port = _tcstok(NULL, TEXT(","));
 223             }
 224         }
 225     }
 226 
 227     return FALSE;
 228 }
 229 
 230 
 231 void AwtPrintControl::initIDs(JNIEnv *env, jclass cls)
 232 {
 233     TRY;
 234 
 235     jclass cls = env->FindClass("sun/awt/windows/WPrinterJob");
 236     CHECK_NULL(cls);
 237 
 238     AwtPrintControl::dialogOwnerPeerID =
 239       env->GetFieldID(cls, "dialogOwnerPeer", "Ljava/awt/peer/ComponentPeer;");
 240     DASSERT(AwtPrintControl::dialogOwnerPeerID != NULL);
 241     CHECK_NULL(AwtPrintControl::dialogOwnerPeerID);





 242 
 243     AwtPrintControl::getPrintDCID = env->GetMethodID(cls, "getPrintDC", "()J");
 244     DASSERT(AwtPrintControl::getPrintDCID != NULL);
 245     CHECK_NULL(AwtPrintControl::getPrintDCID);
 246 
 247     AwtPrintControl::setPrintDCID =
 248         env->GetMethodID(cls, "setPrintDC", "(J)V");
 249     DASSERT(AwtPrintControl::setPrintDCID != NULL);
 250     CHECK_NULL(AwtPrintControl::setPrintDCID);
 251 
 252     AwtPrintControl::getDevmodeID = env->GetMethodID(cls, "getDevMode", "()J");
 253     DASSERT(AwtPrintControl::getDevmodeID != NULL);
 254     CHECK_NULL(AwtPrintControl::getDevmodeID);
 255 
 256     AwtPrintControl::setDevmodeID =
 257         env->GetMethodID(cls, "setDevMode", "(J)V");
 258     DASSERT(AwtPrintControl::setDevmodeID != NULL);
 259     CHECK_NULL(AwtPrintControl::setDevmodeID);
 260 
 261     AwtPrintControl::getDevnamesID =




  37 static const double LOMETRIC_TO_POINTS = (72.0 / 254.0);
  38 
  39 
  40 /* Values must match those defined in WPrinterJob.java */
  41 static const DWORD SET_COLOR = 0x00000200;
  42 static const DWORD SET_ORIENTATION = 0x00004000;
  43 static const DWORD SET_DUP_VERTICAL = 0x00000010;
  44 static const DWORD SET_DUP_HORIZONTAL = 0x00000020;
  45 static const DWORD SET_RES_HIGH = 0x00000040;
  46 static const DWORD SET_RES_LOW = 0x00000080;
  47 
  48 
  49 /* These methods and fields are on sun.awt.windows.WPrinterJob */
  50 jfieldID  AwtPrintControl::dialogOwnerPeerID;
  51 jmethodID AwtPrintControl::getPrintDCID;
  52 jmethodID AwtPrintControl::setPrintDCID;
  53 jmethodID AwtPrintControl::getDevmodeID;
  54 jmethodID AwtPrintControl::setDevmodeID;
  55 jmethodID AwtPrintControl::getDevnamesID;
  56 jmethodID AwtPrintControl::setDevnamesID;
  57 jmethodID AwtPrintControl::getParentWindowID;
  58 jfieldID  AwtPrintControl::driverDoesMultipleCopiesID;
  59 jfieldID  AwtPrintControl::driverDoesCollationID;
  60 jmethodID AwtPrintControl::getWin32MediaID;
  61 jmethodID AwtPrintControl::setWin32MediaID;
  62 jmethodID AwtPrintControl::getWin32MediaTrayID;
  63 jmethodID AwtPrintControl::setWin32MediaTrayID;
  64 jmethodID AwtPrintControl::getColorID;
  65 jmethodID AwtPrintControl::getCopiesID;
  66 jmethodID AwtPrintControl::getSelectID;
  67 jmethodID AwtPrintControl::getDestID;
  68 jmethodID AwtPrintControl::getDialogID;
  69 jmethodID AwtPrintControl::getFromPageID;
  70 jmethodID AwtPrintControl::getMaxPageID;
  71 jmethodID AwtPrintControl::getMinPageID;
  72 jmethodID AwtPrintControl::getCollateID;
  73 jmethodID AwtPrintControl::getOrientID;
  74 jmethodID AwtPrintControl::getQualityID;
  75 jmethodID AwtPrintControl::getPrintToFileEnabledID;
  76 jmethodID AwtPrintControl::getPrinterID;
  77 jmethodID AwtPrintControl::setPrinterID;


 223                 port = _tcstok(NULL, TEXT(","));
 224             }
 225         }
 226     }
 227 
 228     return FALSE;
 229 }
 230 
 231 
 232 void AwtPrintControl::initIDs(JNIEnv *env, jclass cls)
 233 {
 234     TRY;
 235 
 236     jclass cls = env->FindClass("sun/awt/windows/WPrinterJob");
 237     CHECK_NULL(cls);
 238 
 239     AwtPrintControl::dialogOwnerPeerID =
 240       env->GetFieldID(cls, "dialogOwnerPeer", "Ljava/awt/peer/ComponentPeer;");
 241     DASSERT(AwtPrintControl::dialogOwnerPeerID != NULL);
 242     CHECK_NULL(AwtPrintControl::dialogOwnerPeerID);
 243 
 244     AwtPrintControl::getParentWindowID = env->GetMethodID(cls,
 245                                        "getParentWindowID", "()J");
 246     DASSERT(AwtPrintControl::getParentWindowID != NULL);
 247     CHECK_NULL(AwtPrintControl::getParentWindowID);
 248 
 249     AwtPrintControl::getPrintDCID = env->GetMethodID(cls, "getPrintDC", "()J");
 250     DASSERT(AwtPrintControl::getPrintDCID != NULL);
 251     CHECK_NULL(AwtPrintControl::getPrintDCID);
 252 
 253     AwtPrintControl::setPrintDCID =
 254         env->GetMethodID(cls, "setPrintDC", "(J)V");
 255     DASSERT(AwtPrintControl::setPrintDCID != NULL);
 256     CHECK_NULL(AwtPrintControl::setPrintDCID);
 257 
 258     AwtPrintControl::getDevmodeID = env->GetMethodID(cls, "getDevMode", "()J");
 259     DASSERT(AwtPrintControl::getDevmodeID != NULL);
 260     CHECK_NULL(AwtPrintControl::getDevmodeID);
 261 
 262     AwtPrintControl::setDevmodeID =
 263         env->GetMethodID(cls, "setDevMode", "(J)V");
 264     DASSERT(AwtPrintControl::setDevmodeID != NULL);
 265     CHECK_NULL(AwtPrintControl::setDevmodeID);
 266 
 267     AwtPrintControl::getDevnamesID =


< prev index next >