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

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關于我們
? 蟲蟲下載站

?? oleclientsite.java

?? 源碼為Eclipse開源開發平臺桌面開發工具SWT的源代碼,
?? JAVA
?? 第 1 頁 / 共 4 頁
字號:
/******************************************************************************* * Copyright (c) 2000, 2003 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.ole.win32;import java.io.File;import java.io.FileOutputStream;import java.io.FileInputStream;import java.io.IOException;import org.eclipse.swt.*;import org.eclipse.swt.internal.Compatibility;import org.eclipse.swt.internal.ole.win32.*;import org.eclipse.swt.graphics.*;import org.eclipse.swt.widgets.*;import org.eclipse.swt.internal.win32.*;/** * OleClientSite provides a site to manage an embedded OLE Document within a container. * * <p>The OleClientSite provides the following capabilities: * <ul> *  <li>creates the in-place editor for a blank document or opening an existing OLE Document * 	<li>lays the editor out *	<li>provides a mechanism for activating and deactivating the Document *	<li>provides a mechanism for saving changes made to the document * </ul> * * <p>This object implements the OLE Interfaces IUnknown, IOleClientSite, IAdviseSink,  * IOleInPlaceSite * * <p>Note that although this class is a subclass of <code>Composite</code>, * it does not make sense to add <code>Control</code> children to it, * or set a layout on it. * </p><p> * <dl> *	<dt><b>Styles</b> <dd>BORDER  *	<dt><b>Events</b> <dd>Dispose, Move, Resize * </dl> * */public class OleClientSite extends Composite {			// Interfaces for this Ole Client Container	private COMObject  iUnknown;	private COMObject  iOleClientSite;	private COMObject  iAdviseSink;	private COMObject  iOleInPlaceSite;	private COMObject  iOleDocumentSite;	protected GUID appClsid;	private GUID objClsid;	private int  refCount;		// References to the associated Frame.	protected OleFrame frame;		// Access to the embedded/linked Ole Object 	protected IUnknown                  objIUnknown;	protected IOleObject                 objIOleObject;	protected IViewObject2             objIViewObject2;	protected IOleInPlaceObject     objIOleInPlaceObject;	protected IOleCommandTarget objIOleCommandTarget;	protected IOleDocumentView    objDocumentView;		   	// Related storage information	protected IStorage tempStorage;     // IStorage interface of the receiver		// Internal state and style information	private int     aspect;    // the display aspect of the embedded object, e.g., DvaspectContent or DvaspectIcon	private int     type;      // Indicates the type of client that can be supported inside this container	private boolean isStatic;  // Indicates item's display is static, i.e., a bitmap, metafile, etc.	private RECT borderWidths = new RECT();	private RECT indent = new RECT();	private boolean inUpdate = false;	private boolean inInit = true;	private boolean inDispose = false;			private static final String WORDPROGID = "Word.Document"; //$NON-NLS-1$	private Listener listener;		static final int STATE_NONE = 0;	static final int STATE_RUNNING = 1;	static final int STATE_INPLACEACTIVE = 2;	static final int STATE_UIACTIVE = 3;	static final int STATE_ACTIVE = 4;	int state = STATE_NONE;	protected OleClientSite(Composite parent, int style) {	/*	 * NOTE: this constructor should never be used by itself because it does	 * not create an Ole Object	 */	super(parent, style);		createCOMInterfaces();		// install the Ole Frame for this Client Site	while (parent != null) {		if (parent instanceof OleFrame){			frame = (OleFrame)parent;			break;		}		parent = parent.getParent();	}	if (frame == null) OLE.error(SWT.ERROR_INVALID_ARGUMENT);	frame.AddRef();		aspect   = COM.DVASPECT_CONTENT;	type     = COM.OLEEMBEDDED;	isStatic = false;	listener = new Listener() {		public void handleEvent(Event e) {			switch (e.type) {			case SWT.Resize :			case SWT.Move :    onResize(e); break;			case SWT.Dispose : onDispose(e); break;			case SWT.FocusIn:  onFocusIn(e); break;			case SWT.FocusOut:  onFocusOut(e); break;			case SWT.Paint:    onPaint(e); break;			case SWT.Traverse: onTraverse(e); break;			case SWT.KeyDown: /* required for traversal */ break;			default :				OLE.error(SWT.ERROR_NOT_IMPLEMENTED);			}		}	};	frame.addListener(SWT.Resize, listener);	frame.addListener(SWT.Move, listener);	addListener(SWT.Dispose, listener);	addListener(SWT.FocusIn, listener);	addListener(SWT.FocusOut, listener);	addListener(SWT.Paint, listener);	addListener(SWT.Traverse, listener);	addListener(SWT.KeyDown, listener);}/** * Create an OleClientSite child widget using the OLE Document type associated with the * specified file.  The OLE Document type is determined either through header information in the file  * or through a Registry entry for the file extension. Use style bits to select a particular look  * or set of properties. * * @param parent a composite widget; must be an OleFrame * @param style the bitwise OR'ing of widget styles * @param file the file that is to be opened in this OLE Document * * @exception SWTError * <ul><li>ERROR_THREAD_INVALID_ACCESS when called from the wrong thread *     <li>ERROR_ERROR_NULL_ARGUMENT when the parent is null</ul> * @exception SWTError * <ul><li>ERROR_CANNOT_CREATE_OBJECT when failed to create OLE Object *     <li>ERROR_INVALID_ARGUMENT when the parent is not an OleFrame *     <li>ERROR_CANNOT_OPEN_FILE when failed to open file *     <li>ERROR_INTERFACES_NOT_INITIALIZED when unable to create callbacks for OLE Interfaces</ul> * */public OleClientSite(Composite parent, int style, File file) {	this(parent, style);	try {		if (file == null || file.isDirectory() || !file.exists())			OLE.error(OLE.ERROR_INVALID_ARGUMENT);					// Is there an associated CLSID?		appClsid = new GUID();		char[] fileName = (file.getAbsolutePath()+"\0").toCharArray();		int result = COM.GetClassFile(fileName, appClsid);		if (result != COM.S_OK)			OLE.error(OLE.ERROR_INVALID_CLASSID, result);		// associated CLSID may not be installed on this machine		if (getProgramID() == null)			OLE.error(OLE.ERROR_INVALID_CLASSID, result);					// Open a temporary storage object		tempStorage = createTempStorage();		// Create ole object with storage object		int[] address = new int[1];		result = COM.OleCreateFromFile(appClsid, fileName, COM.IIDIUnknown, COM.OLERENDER_DRAW, null, 0, tempStorage.getAddress(), address);		if (result != COM.S_OK)			OLE.error(OLE.ERROR_CANNOT_CREATE_OBJECT, result);		objIUnknown = new IUnknown(address[0]);				// Init sinks		addObjectReferences();				if (COM.OleRun(objIUnknown.getAddress()) == OLE.S_OK) state = STATE_RUNNING;	} catch (SWTException e) {		dispose();		disposeCOMInterfaces();		throw e;	}}/** * Create an OleClientSite child widget to edit a blank document using the specified OLE Document * application.  Use style bits to select a particular look or set of properties. * * @param parent a composite widget; must be an OleFrame * @param style the bitwise OR'ing of widget styles * @param progID the unique program identifier of am OLE Document application;  *               the value of the ProgID key or the value of the VersionIndependentProgID key specified *               in the registry for the desired OLE Document (for example, the VersionIndependentProgID *               for Word is Word.Document) * * @exception SWTError * <ul><li>ERROR_THREAD_INVALID_ACCESS when called from the wrong thread *     <li>ERROR_ERROR_NULL_ARGUMENT when the parent is null *     <li>ERROR_INVALID_CLASSID when the progId does not map to a registered CLSID *     <li>ERROR_INVALID_ARGUMENT when the parent is not an OleFrame *     <li>ERROR_CANNOT_CREATE_OBJECT when failed to create OLE Object *     <li>ERROR_INTERFACES_NOT_INITIALIZED when unable to create callbacks for OLE Interfaces</ul> * */public OleClientSite(Composite parent, int style, String progId) {	this(parent, style);	try {		appClsid = getClassID(progId);		if (appClsid == null)			OLE.error(OLE.ERROR_INVALID_CLASSID);					// Open a temporary storage object		tempStorage = createTempStorage();			// Create ole object with storage object		int[] address = new int[1];		int result = COM.OleCreate(appClsid, COM.IIDIUnknown, COM.OLERENDER_DRAW, null, 0, tempStorage.getAddress(), address);		if (result != COM.S_OK)			OLE.error(OLE.ERROR_CANNOT_CREATE_OBJECT, result);		objIUnknown = new IUnknown(address[0]);		// Init sinks		addObjectReferences();		if (COM.OleRun(objIUnknown.getAddress()) == OLE.S_OK) state = STATE_RUNNING;			} catch (SWTException e) {		dispose();		disposeCOMInterfaces();		throw e;	}}/** * Create an OleClientSite child widget to edit the specified file using the specified OLE Document * application.  Use style bits to select a particular look or set of properties.  * <p> * <b>IMPORTANT:</b> This method is <em>not</em> part of the public * API for <code>OleClientSite</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 parent a composite widget; must be an OleFrame * @param style the bitwise OR'ing of widget styles * @param progID the unique program identifier of am OLE Document application;  *               the value of the ProgID key or the value of the VersionIndependentProgID key specified *               in the registry for the desired OLE Document (for example, the VersionIndependentProgID *               for Word is Word.Document) * @param file the file that is to be opened in this OLE Document * * @exception SWTError * <ul><li>ERROR_THREAD_INVALID_ACCESS when called from the wrong thread *     <li>ERROR_ERROR_NULL_ARGUMENT when the parent is null *     <li>ERROR_INVALID_CLASSID when the progId does not map to a registered CLSID *     <li>ERROR_CANNOT_CREATE_OBJECT when failed to create OLE Object *     <li>ERROR_CANNOT_OPEN_FILE when failed to open file *     <li>ERROR_INVALID_ARGUMENT when the parent is not an OleFrame *     <li>ERROR_INTERFACES_NOT_INITIALIZED when unable to create callbacks for OLE Interfaces</ul> * */public OleClientSite(Composite parent, int style, String progId, File file) {	this(parent, style);	try {		if (file == null || file.isDirectory() || !file.exists()) OLE.error(OLE.ERROR_INVALID_ARGUMENT);						appClsid = getClassID(progId);				// Are we opening this file with the preferred OLE object?		char[] fileName = (file.getAbsolutePath()+"\0").toCharArray();		GUID fileClsid = new GUID();		COM.GetClassFile(fileName, fileClsid);			if (COM.IsEqualGUID(appClsid, fileClsid)){			// Using the same application that created file, therefore, use default mechanism.			tempStorage = createTempStorage();			// Create ole object with storage object			int[] address = new int[1];			int result = COM.OleCreateFromFile(appClsid, fileName, COM.IIDIUnknown, COM.OLERENDER_DRAW, null, 0, tempStorage.getAddress(), address);			if (result != COM.S_OK) OLE.error(OLE.ERROR_CANNOT_CREATE_OBJECT, result);			objIUnknown = new IUnknown(address[0]);		} else {			// Not using the same application that created file, therefore, copy from original file to a new storage file			IStorage storage = null;			if (COM.StgIsStorageFile(fileName) == COM.S_OK) {				int[] address = new int[1];				int mode = COM.STGM_READ | COM.STGM_TRANSACTED | COM.STGM_SHARE_EXCLUSIVE;				int result = COM.StgOpenStorage(fileName, 0, mode, 0, 0, address); //Does an AddRef if successful				if (result != COM.S_OK) OLE.error(OLE.ERROR_CANNOT_OPEN_FILE, result);				storage = new IStorage(address[0]);			} else {				// Original file is not a Storage file so copy contents to a stream in a new storage file				int[] address = new int[1];				int mode = COM.STGM_READWRITE | COM.STGM_DIRECT | COM.STGM_SHARE_EXCLUSIVE | COM.STGM_CREATE;				int result = COM.StgCreateDocfile(null, mode | COM.STGM_DELETEONRELEASE, 0, address); // Increments ref count if successful				if (result != COM.S_OK) OLE.error(OLE.ERROR_CANNOT_OPEN_FILE, result);				storage = new IStorage(address[0]);				// Create a stream on the storage object.				// Word does not follow the standard and does not use "CONTENTS" as the name of				// its primary stream				String streamName = "CONTENTS"; //$NON-NLS-1$				GUID wordGUID = getClassID(WORDPROGID);				if (COM.IsEqualGUID(appClsid, wordGUID)) streamName = "WordDocument"; //$NON-NLS-1$				address = new int[1];				result = storage.CreateStream(streamName, mode, 0, 0, address); // Increments ref count if successful				if (result != COM.S_OK) {					storage.Release();					OLE.error(OLE.ERROR_CANNOT_OPEN_FILE, result);				}				IStream stream = new IStream(address[0]);				try {					// Copy over data in file to named stream					FileInputStream fileInput = new FileInputStream(file);					int increment = 1024*4;					byte[] buffer = new byte[increment];					int count = 0;					while((count = fileInput.read(buffer)) > 0){						int pv = COM.CoTaskMemAlloc(count);						OS.MoveMemory(pv, buffer, count);						result = stream.Write(pv, count, null) ;						COM.CoTaskMemFree(pv);						if (result != COM.S_OK) {

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
成人开心网精品视频| 欧美激情综合在线| 麻豆专区一区二区三区四区五区| 亚洲午夜成aⅴ人片| 91成人免费网站| 五月天精品一区二区三区| 日韩亚洲欧美一区| 黄一区二区三区| 中文字幕欧美三区| av中文一区二区三区| 蜜臀av国产精品久久久久| 亚洲美女少妇撒尿| 亚洲综合色噜噜狠狠| 日韩精品91亚洲二区在线观看| 毛片av一区二区| 不卡av在线免费观看| 色美美综合视频| 精品久久久久久综合日本欧美| 久久久99久久精品欧美| 日韩伦理免费电影| 亚洲国产wwwccc36天堂| 国产曰批免费观看久久久| 日本韩国一区二区| 欧美精品一区二区在线播放| 亚洲一区在线看| 久久av老司机精品网站导航| 欧美午夜精品久久久久久超碰| 欧美变态口味重另类| 一区二区三区在线免费观看| 国产白丝网站精品污在线入口| 在线观看亚洲一区| 国产日韩av一区| 天天综合网天天综合色| 国产91精品一区二区麻豆网站| 国精产品一区一区三区mba桃花| 欧美日韩一区二区三区免费看| 欧美日韩亚洲另类| 欧美日韩高清在线| 激情久久五月天| 美女视频第一区二区三区免费观看网站 | 久久精品视频一区| 欧美视频一区二| 国产一区二区毛片| 日韩精品一卡二卡三卡四卡无卡| 国产婷婷色一区二区三区在线| 欧美日韩一区二区三区在线| 不卡视频在线看| 国产欧美日韩三级| 麻豆高清免费国产一区| 日韩视频永久免费| 久久成人免费网| 精品国产123| 99热这里都是精品| 久久婷婷国产综合精品青草| 日韩av电影免费观看高清完整版在线观看 | 亚洲一区二区在线免费观看视频| 2020国产精品自拍| 欧美不卡一二三| 日韩精品一区二区三区视频在线观看 | 欧美mv日韩mv国产网站app| 亚洲欧洲综合另类| 色综合久久久久综合体桃花网| 日韩视频在线你懂得| 欧美亚洲愉拍一区二区| 在线视频综合导航| 欧美精品粉嫩高潮一区二区| 欧美日韩一区二区在线观看| 欧美老女人第四色| 91.xcao| 欧美mv日韩mv| 久久久青草青青国产亚洲免观| 国产午夜精品一区二区三区四区| 精品国产精品一区二区夜夜嗨| 久久久久99精品国产片| 国产精品盗摄一区二区三区| 一区二区激情视频| 日韩精品亚洲专区| 丁香婷婷综合网| 欧美亚州韩日在线看免费版国语版| 欧美三级在线看| 亚洲精品在线一区二区| 亚洲欧洲色图综合| 日本成人在线看| 91丝袜国产在线播放| 欧美一级生活片| 亚洲欧美激情一区二区| 日日夜夜精品视频免费| www.亚洲人| 亚洲精品在线观看视频| 亚洲欧美激情视频在线观看一区二区三区| 亚洲第一福利一区| 国产成人99久久亚洲综合精品| 欧美精品日韩一本| 国产精品护士白丝一区av| 国产精品一区二区在线播放| 欧美影院一区二区| 亚洲国产精品激情在线观看| 久久不见久久见免费视频1| 欧美性受极品xxxx喷水| 亚洲免费在线看| 99久久精品国产一区二区三区| 欧美美女bb生活片| 欧美性猛交xxxx乱大交退制版 | 日韩在线一二三区| 午夜av一区二区| 欧美亚洲综合在线| 极品少妇一区二区| 国产一区二区三区在线观看免费视频| 精品一区二区三区久久| 国产成人精品免费网站| 91福利视频久久久久| 精品日韩一区二区三区| 亚洲精品国产无天堂网2021| 日韩电影网1区2区| 99久久精品国产毛片| 91.成人天堂一区| 国产精品无码永久免费888| 亚洲自拍欧美精品| 国产精品一区二区你懂的| 欧美性生活影院| 亚洲国产成人在线| 毛片av中文字幕一区二区| 91丨九色丨尤物| 精品不卡在线视频| 亚洲一区日韩精品中文字幕| 国产精品一区在线| 欧美日韩亚洲综合| 综合激情成人伊人| 国内精品第一页| 欧美日韩一区国产| 国产精品国产馆在线真实露脸| 老司机精品视频导航| 色吧成人激情小说| 国产欧美精品区一区二区三区| 视频一区视频二区中文字幕| 99热在这里有精品免费| xfplay精品久久| 日本最新不卡在线| 欧美亚一区二区| 亚洲欧美日韩在线不卡| 成人国产精品免费观看动漫| 精品国产欧美一区二区| 青青草国产成人99久久| 91福利在线播放| 亚洲欧美日韩在线| 国产91精品一区二区| 久久久久久综合| 狠狠色狠狠色综合日日91app| 7777精品伊人久久久大香线蕉的 | 亚洲男同性恋视频| 成人教育av在线| 久久久久久久久久电影| 极品少妇xxxx精品少妇| 日韩三级伦理片妻子的秘密按摩| 亚洲成人中文在线| 欧美综合在线视频| 亚洲精品一二三区| 在线视频一区二区三| 亚洲视频网在线直播| a亚洲天堂av| 国产精品久久久久影视| 丁香婷婷综合网| 国产精品美女久久久久久久| 成人小视频在线观看| 欧美国产欧美综合| 懂色av一区二区三区蜜臀| 久久精品网站免费观看| 国产电影一区在线| 国产精品欧美一区二区三区| 99视频有精品| 夜色激情一区二区| 欧美视频一区二区三区在线观看 | 亚洲成人激情综合网| 欧美又粗又大又爽| 亚洲成人精品影院| 欧美一级搡bbbb搡bbbb| 国产自产高清不卡| 国产日韩av一区| 91麻豆福利精品推荐| 一区二区激情小说| 日韩一区二区免费电影| 国产曰批免费观看久久久| 久久久久99精品国产片| 成人av在线电影| 亚洲免费电影在线| 欧美精品vⅰdeose4hd| 精品一区二区三区免费毛片爱 | 日韩欧美国产电影| 国产suv精品一区二区6| 一区二区三区在线视频免费 | 夜夜嗨av一区二区三区四季av| 91福利视频网站| 麻豆成人免费电影| 欧美国产1区2区| 欧美三级日本三级少妇99| 激情小说欧美图片| 亚洲欧美日韩在线不卡| 日韩一级成人av| 成人美女在线观看| 亚洲成人动漫在线观看|