亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關(guān)于我們
? 蟲蟲下載站

?? printer.java

?? 源碼為Eclipse開源開發(fā)平臺桌面開發(fā)工具SWT的源代碼,
?? JAVA
?? 第 1 頁 / 共 2 頁
字號:
/******************************************************************************* * Copyright (c) 2000, 2004 IBM Corporation and others. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Common Public License v1.0 * which accompanies this distribution, and is available at * http://www.eclipse.org/legal/cpl-v10.html *  * Contributors: *     IBM Corporation - initial API and implementation *******************************************************************************/package org.eclipse.swt.printing;import org.eclipse.swt.*;import org.eclipse.swt.graphics.*;import org.eclipse.swt.internal.win32.*;/** * Instances of this class are used to print to a printer. * Applications create a GC on a printer using <code>new GC(printer)</code> * and then draw on the printer GC using the usual graphics calls. * <p> * A <code>Printer</code> object may be constructed by providing * a <code>PrinterData</code> object which identifies the printer. * A <code>PrintDialog</code> presents a print dialog to the user * and returns an initialized instance of <code>PrinterData</code>. * Alternatively, calling <code>new Printer()</code> will construct a * printer object for the user's default printer. * </p><p> * Application code must explicitly invoke the <code>Printer.dispose()</code>  * method to release the operating system resources managed by each instance * when those instances are no longer required. * </p> * * @see PrinterData * @see PrintDialog */public final class Printer extends Device {	/**	 * the handle to the printer DC	 * (Warning: This field is platform dependent)	 */	public int handle;	/**	 * the printer data describing this printer	 */	PrinterData data;	/**	 * whether or not a GC was created for this printer	 */	boolean isGCCreated = false;	/**	 * strings used to access the Windows registry	 * (Warning: These fields are platform dependent)	 */	static TCHAR profile;	static TCHAR appName;	static TCHAR keyName;	static {		profile = new TCHAR(0, "PrinterPorts", true); //$NON-NLS-1$		appName = new TCHAR(0, "windows", true); //$NON-NLS-1$		keyName = new TCHAR(0, "device", true); //$NON-NLS-1$	}	/** * Returns an array of <code>PrinterData</code> objects * representing all available printers. * * @return the list of available printers */public static PrinterData[] getPrinterList() {	int length = 1024;	/* Use the character encoding for the default locale */	TCHAR buf = new TCHAR(0, length);	TCHAR nullBuf = new TCHAR(0, 1);	int n = OS.GetProfileString(profile, null, nullBuf, buf, length);	if (n == 0) return new PrinterData[0];	String[] deviceNames = new String[5];	int nameCount = 0;	int index = 0;	for (int i = 0; i < n; i++) {		if (buf.tcharAt(i) == 0) {			if (nameCount == deviceNames.length) {				String[] newNames = new String[deviceNames.length + 5];				System.arraycopy(deviceNames, 0, newNames, 0, deviceNames.length);				deviceNames = newNames;			}			deviceNames[nameCount] = buf.toString(index, i - index);			nameCount++;			index = i + 1;		}	}	PrinterData printerList[] = new PrinterData[nameCount];	for (int p = 0; p < nameCount; p++) {		String device = deviceNames[p];		String driver = ""; //$NON-NLS-1$		if (OS.GetProfileString(profile, new TCHAR(0, device, true), nullBuf, buf, length) > 0) {			int commaIndex = 0;			while (buf.tcharAt(commaIndex) != ',' && commaIndex < length) commaIndex++;			if (commaIndex < length) {				driver = buf.toString(0, commaIndex);			}		}		printerList[p] = new PrinterData(driver, device);	}	return printerList;}/** * Returns a <code>PrinterData</code> object representing * the default printer or <code>null</code> if there is no  * printer available on the System. * * @return the default printer data or null *  * @since 2.1 */public static PrinterData getDefaultPrinterData() {	String deviceName = null;	int length = 1024;	/* Use the character encoding for the default locale */	TCHAR buf = new TCHAR(0, length);	TCHAR nullBuf = new TCHAR(0, 1);	int n = OS.GetProfileString(appName, keyName, nullBuf, buf, length);	if (n == 0) return null;	int commaIndex = 0;	while(buf.tcharAt(commaIndex) != ',' && commaIndex < length) commaIndex++;	if (commaIndex < length) {		deviceName = buf.toString(0, commaIndex);			}	String driver = ""; //$NON-NLS-1$	if (OS.GetProfileString(profile, new TCHAR(0, deviceName, true), nullBuf, buf, length) > 0) {		commaIndex = 0;		while (buf.tcharAt(commaIndex) != ',' && commaIndex < length) commaIndex++;		if (commaIndex < length) {			driver = buf.toString(0, commaIndex);			}	}	return new PrinterData(driver, deviceName);}static DeviceData checkNull (PrinterData data) {	if (data == null) data = new PrinterData();	if (data.driver == null || data.name == null) {		PrinterData defaultPrinter = getDefaultPrinterData();		if (defaultPrinter == null) SWT.error(SWT.ERROR_NO_HANDLES);		data.driver = defaultPrinter.driver;		data.name = defaultPrinter.name;			}	return data;}/** * Constructs a new printer representing the default printer. * <p> * You must dispose the printer when it is no longer required.  * </p> * * @exception SWTError <ul> *    <li>ERROR_NO_HANDLES - if there are no valid printers * </ul> * * @see Device#dispose */public Printer() {	this(null);}/** * Constructs a new printer given a <code>PrinterData</code> * object representing the desired printer. * <p> * You must dispose the printer when it is no longer required.  * </p> * * @param data the printer data for the specified printer * * @exception IllegalArgumentException <ul> *    <li>ERROR_INVALID_ARGUMENT - if the specified printer data does not represent a valid printer * </ul> * @exception SWTError <ul> *    <li>ERROR_NO_HANDLES - if there are no valid printers * </ul> * * @see Device#dispose */public Printer(PrinterData data) {	super(checkNull(data));}/**	  * Creates the printer handle. * This method is called internally by the instance creation * mechanism of the <code>Device</code> class. */protected void create(DeviceData deviceData) {	data = (PrinterData)deviceData;	/* Use the character encoding for the default locale */	TCHAR driver = new TCHAR(0, data.driver, true);	TCHAR device = new TCHAR(0, data.name, true);	int lpInitData = 0;	byte buffer [] = data.otherData;	int hHeap = OS.GetProcessHeap();	if (buffer != null && buffer.length != 0) {		lpInitData = OS.HeapAlloc(hHeap, OS.HEAP_ZERO_MEMORY, buffer.length);		OS.MoveMemory(lpInitData, buffer, buffer.length);	}	handle = OS.CreateDC(driver, device, 0, lpInitData);	if (lpInitData != 0) OS.HeapFree(hHeap, 0, lpInitData);	if (handle == 0) SWT.error(SWT.ERROR_NO_HANDLES);}/**	  * Invokes platform specific functionality to allocate a new GC handle. * <p> * <b>IMPORTANT:</b> This method is <em>not</em> part of the public * API for <code>Printer</code>. It is marked public only so that it * can be shared within the packages provided by SWT. It is not * available on all platforms, and should never be called from * application code. * </p> * * @param data the platform specific GC data  * @return the platform specific GC handle */public int internal_new_GC(GCData data) {	if (handle == 0) SWT.error(SWT.ERROR_NO_HANDLES);	if (data != null) {		if (isGCCreated) SWT.error(SWT.ERROR_INVALID_ARGUMENT);		int mask = SWT.LEFT_TO_RIGHT | SWT.RIGHT_TO_LEFT;		if ((data.style & mask) != 0) {			data.layout = (data.style & SWT.RIGHT_TO_LEFT) != 0 ? OS.LAYOUT_RTL : 0;		} else {			data.style |= SWT.LEFT_TO_RIGHT;		}		data.device = this;		data.hFont = OS.GetCurrentObject(handle, OS.OBJ_FONT);		isGCCreated = true;	}	return handle;}/**	  * Invokes platform specific functionality to dispose a GC handle. * <p> * <b>IMPORTANT:</b> This method is <em>not</em> part of the public * API for <code>Printer</code>. It is marked public only so that it * can be shared within the packages provided by SWT. It is not * available on all platforms, and should never be called from * application code. * </p> * * @param hDC the platform specific GC handle * @param data the platform specific GC data  */public void internal_dispose_GC(int hDC, GCData data) {	if (data != null) isGCCreated = false;}/** * Starts a print job and returns true if the job started successfully

?? 快捷鍵說明

復(fù)制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
精品国产人成亚洲区| 青娱乐精品在线视频| 亚洲gay无套男同| 国产精品一线二线三线| 欧美中文字幕不卡| 国产视频不卡一区| 日本中文在线一区| 欧美日韩一区在线观看| 综合色天天鬼久久鬼色| 狠狠色丁香久久婷婷综合_中 | 成人av在线电影| 欧美一区二区三区精品| 亚洲午夜精品在线| 色中色一区二区| 国产精品麻豆欧美日韩ww| 精品一区二区精品| 欧美一级片在线观看| 亚洲一区二区视频在线观看| 精一区二区三区| 欧美极品少妇xxxxⅹ高跟鞋| 欧美日韩的一区二区| 欧美一区二区三区在线观看视频 | 91福利区一区二区三区| 国产三区在线成人av| 韩国一区二区三区| 久久众筹精品私拍模特| 韩国理伦片一区二区三区在线播放| 欧美日韩一区成人| 亚洲aaa精品| 欧美三级中文字幕| 一级女性全黄久久生活片免费| 99免费精品在线观看| 欧美—级在线免费片| 国产激情偷乱视频一区二区三区 | 555夜色666亚洲国产免| 午夜电影网一区| 51精品秘密在线观看| 日本一不卡视频| 精品日韩在线观看| 激情综合亚洲精品| 久久麻豆一区二区| 波多野结衣亚洲一区| 国产精品伦理在线| 色综合久久天天| 亚洲h在线观看| 久久众筹精品私拍模特| 成人av动漫在线| 亚洲欧美激情小说另类| 欧美视频在线不卡| 久久99最新地址| 国产精品人人做人人爽人人添 | 中文字幕一区在线观看视频| 91美女在线看| 日韩二区在线观看| 欧美精彩视频一区二区三区| 色婷婷激情一区二区三区| 亚洲成av人片一区二区| 精品处破学生在线二十三| 成人性生交大合| 亚洲成人午夜影院| 久久久电影一区二区三区| 99国产欧美另类久久久精品| 舔着乳尖日韩一区| 久久精品一区二区| 在线亚洲一区二区| 麻豆91精品视频| 亚洲伦理在线精品| 日韩精品一区国产麻豆| 成人午夜电影网站| 日韩精品一级二级| 欧美激情自拍偷拍| 91精品国产免费| 99re8在线精品视频免费播放| 婷婷夜色潮精品综合在线| 欧美国产1区2区| 欧美一二区视频| 91年精品国产| 国产精品原创巨作av| 视频一区欧美精品| 国产精品免费久久久久| 日韩一级欧美一级| 91浏览器在线视频| 国产成人aaa| 欧美aaaaa成人免费观看视频| 日韩理论电影院| 国产亚洲一区字幕| 欧美一区2区视频在线观看| 99久久精品免费| 国产一区二区在线影院| 亚洲 欧美综合在线网络| 中国色在线观看另类| 欧美成人福利视频| 欧美高清你懂得| 色婷婷综合久色| 99视频有精品| 粉嫩aⅴ一区二区三区四区五区| 日本一不卡视频| 一级女性全黄久久生活片免费| 国产视频一区二区在线| 精品国免费一区二区三区| 欧美肥妇bbw| 欧美日韩精品欧美日韩精品一综合| 成人免费高清视频在线观看| 国产综合久久久久久久久久久久| 日本欧美一区二区| 丝袜诱惑制服诱惑色一区在线观看 | 欧美国产精品一区二区| 欧美xingq一区二区| 91精品国产色综合久久不卡蜜臀 | 亚洲自拍偷拍九九九| 亚洲欧美日韩系列| 自拍偷拍亚洲综合| 亚洲嫩草精品久久| 亚洲男同性视频| 亚洲已满18点击进入久久| 亚洲精品成人少妇| 亚洲一区二区三区中文字幕| 亚洲黄一区二区三区| 一区二区三区资源| 亚洲国产婷婷综合在线精品| 亚洲国产中文字幕在线视频综合| 亚洲国产综合在线| 亚洲www啪成人一区二区麻豆 | 日韩视频中午一区| 欧美videos大乳护士334| 精品欧美一区二区久久| 久久久久久久久99精品| 久久精品免视看| |精品福利一区二区三区| 亚洲黄网站在线观看| 日韩精品电影在线观看| 精品一区二区三区免费观看| 国产成人综合自拍| 91丝袜高跟美女视频| 欧美日韩一卡二卡| 2024国产精品| 自拍偷拍欧美精品| 丝袜国产日韩另类美女| 国产精品一线二线三线| 91啦中文在线观看| 欧美精品自拍偷拍| 久久久久九九视频| 最新国产精品久久精品| 亚洲电影在线免费观看| 国产精品1区2区3区在线观看| 99久久免费精品| 91精品一区二区三区在线观看| 精品av综合导航| 亚洲激情自拍偷拍| 看国产成人h片视频| zzijzzij亚洲日本少妇熟睡| 欧美日韩aaaaa| 国产三区在线成人av| 亚洲最新视频在线观看| 久久99热国产| 在线视频一区二区三区| 久久久久久免费网| 亚洲sss视频在线视频| 国产成人在线网站| 欧美人与性动xxxx| 中文字幕一区视频| 狠狠色丁香久久婷婷综| 在线亚洲一区二区| 国产精品网站在线播放| 麻豆一区二区99久久久久| 99久久er热在这里只有精品15| 欧美大片一区二区| 亚洲在线中文字幕| 国产91综合网| 欧美一级黄色录像| 亚洲一区二区视频在线| 成人h精品动漫一区二区三区| 日韩一区二区精品葵司在线| 一区二区三区中文字幕在线观看| 国产99精品国产| 2020国产精品| 日本色综合中文字幕| 欧美熟乱第一页| 亚洲精品成人精品456| av在线播放不卡| 久久久三级国产网站| 久久99精品国产.久久久久久| 欧美日韩国产系列| 亚洲视频一区在线观看| 成人黄色av电影| 国产日韩欧美精品在线| 久久99久久久欧美国产| 欧美一区二区在线免费观看| 亚洲v精品v日韩v欧美v专区| 色噜噜狠狠一区二区三区果冻| 国产精品久久精品日日| 东方aⅴ免费观看久久av| 久久久久久久性| 国产成人免费视频网站高清观看视频| 日韩欧美一区二区久久婷婷| 日本欧美肥老太交大片| 91精品国产全国免费观看| 日韩中文欧美在线| 欧美一区二区三区在线观看视频| 日日骚欧美日韩|