亚洲欧美第一页_禁久久精品乱码_粉嫩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一区二区三区免费野_久草精品视频
日韩av不卡一区二区| 成人污污视频在线观看| 亚洲国产精品t66y| 欧美日韩在线三级| 国产aⅴ精品一区二区三区色成熟| 一区二区三国产精华液| 久久久九九九九| 欧美一区二区日韩| 日本精品视频一区二区三区| 国产伦精品一区二区三区免费 | 久久精品亚洲精品国产欧美kt∨ | 国产精品欧美久久久久无广告| 欧美裸体一区二区三区| 99久久er热在这里只有精品15 | 欧美亚洲禁片免费| 成人在线综合网| 久久99这里只有精品| 丝袜美腿亚洲一区| 一区二区三区在线免费视频 | 日韩国产在线观看一区| 亚洲九九爱视频| 中文乱码免费一区二区| 精品欧美黑人一区二区三区| 91精品国产综合久久蜜臀| 欧美性猛片aaaaaaa做受| 91免费版pro下载短视频| 成人妖精视频yjsp地址| 国产成人在线视频网站| 国产在线精品不卡| 蜜桃视频一区二区三区在线观看| 亚洲高清不卡在线| 亚洲自拍都市欧美小说| 亚洲乱码国产乱码精品精可以看| 国产精品久久久久婷婷二区次| 2021久久国产精品不只是精品| 日韩免费观看2025年上映的电影| 欧美日韩精品高清| 欧美三级电影网站| 欧美三级韩国三级日本一级| 欧美日韩大陆一区二区| 欧美日韩成人一区二区| 欧美日韩成人综合在线一区二区| 欧美日韩日日夜夜| 欧美日韩色一区| 91精品啪在线观看国产60岁| 日韩写真欧美这视频| 日韩片之四级片| 欧美成人午夜电影| 国产三级一区二区| 国产精品国产三级国产a | 久久精品国产免费看久久精品| 日韩高清欧美激情| 欧美96一区二区免费视频| 青青草91视频| 狠狠色丁香婷婷综合久久片| 国产原创一区二区| 成人中文字幕电影| 在线观看亚洲a| 欧美精品在线观看播放| 日韩一级成人av| 国产三级精品视频| 亚洲色图欧美在线| 婷婷中文字幕综合| 麻豆精品一区二区综合av| 久久99热狠狠色一区二区| 懂色av一区二区夜夜嗨| 色婷婷综合久久久中文字幕| 欧美精品高清视频| 久久久久久99久久久精品网站| 国产精品久久久久久久久免费樱桃| 亚洲欧美日韩国产综合在线| 亚洲国产日韩精品| 精品一区二区三区香蕉蜜桃| 成人精品视频网站| 欧美日韩精品一区视频| 26uuu亚洲| 一区二区在线观看视频在线观看| 男女男精品网站| 成人综合婷婷国产精品久久| 欧美色老头old∨ideo| 精品国产在天天线2019| 亚洲欧美日韩在线| 精品影院一区二区久久久| 91亚洲精华国产精华精华液| 日韩一区二区三区在线视频| 中文字幕在线不卡视频| 日韩精品亚洲一区| 成人h版在线观看| 欧美一区二区三区在| 最近中文字幕一区二区三区| 日韩av电影天堂| 91免费观看在线| 久久久精品免费网站| 午夜视频在线观看一区二区| 国产成人啪免费观看软件| 欧美日韩在线播放三区四区| 亚洲国产精品成人久久综合一区| 日韩制服丝袜先锋影音| 99久久精品免费观看| 欧美成人国产一区二区| 亚洲一卡二卡三卡四卡五卡| 国产成人av一区二区| 91精品国产欧美一区二区18| 亚洲色图另类专区| 国产99精品国产| 日韩精品一区二区三区四区视频| 亚洲图片欧美一区| 本田岬高潮一区二区三区| 精品久久久久一区二区国产| 亚洲在线观看免费| 99re热视频这里只精品| 国产丝袜在线精品| 久久99精品久久久久久动态图| 欧美日韩午夜影院| 亚洲精品少妇30p| 91丨九色丨蝌蚪丨老版| 国产丝袜美腿一区二区三区| 国内国产精品久久| 91精品国产综合久久婷婷香蕉 | 亚瑟在线精品视频| 色婷婷综合五月| 1024成人网| 成人综合婷婷国产精品久久蜜臀| 精品成人在线观看| 老色鬼精品视频在线观看播放| 欧美日韩激情一区| 一区二区三区精品在线| 色先锋资源久久综合| 亚洲欧洲av在线| caoporm超碰国产精品| 国产精品视频九色porn| 国产精品99久久久久久有的能看| 日韩欧美卡一卡二| 精品系列免费在线观看| 日韩欧美成人激情| 久久99国产精品久久99| 精品播放一区二区| 国产精品18久久久久久vr| 久久无码av三级| 国产a视频精品免费观看| 国产精品三级在线观看| 顶级嫩模精品视频在线看| 亚洲国产精品传媒在线观看| 成人午夜激情视频| 国产精品无码永久免费888| 顶级嫩模精品视频在线看| 中文字幕一区二区三区四区不卡| 成人av影视在线观看| 亚洲天堂成人在线观看| 在线观看成人小视频| 亚洲高清免费观看高清完整版在线观看| 欧美色窝79yyyycom| 丝袜美腿亚洲综合| 久久综合九色欧美综合狠狠| 国产91露脸合集magnet| 中文字幕在线播放不卡一区| 在线观看av不卡| 五月天激情综合| 久久久欧美精品sm网站| 99久久精品免费| 午夜欧美大尺度福利影院在线看| 欧美一级日韩免费不卡| 国产精品中文字幕一区二区三区| 国产午夜亚洲精品理论片色戒| av不卡在线观看| 天天综合色天天综合色h| 欧美电影免费观看高清完整版| 国产一区二区三区四| 亚洲美女免费视频| 欧美一区二区三区公司| 国产99久久久久| 午夜精品福利一区二区三区蜜桃| 欧美成人午夜电影| 91麻豆自制传媒国产之光| 日韩**一区毛片| 中文字幕一区免费在线观看| 欧美日韩mp4| 国产福利不卡视频| 亚洲成人自拍网| 国产日韩欧美亚洲| 欧美色综合网站| 国产成人a级片| 午夜精品福利久久久| 国产日产亚洲精品系列| 欧美午夜一区二区三区免费大片| 久久精品国产秦先生| 一区二区三区四区激情| 欧美一二三四区在线| 成人中文字幕电影| 日本va欧美va瓶| 国产精品久久久久久久久动漫| 69堂成人精品免费视频| www.在线欧美| 国产在线精品一区二区不卡了 | 在线观看不卡一区| 国产精品一二二区| 免费日本视频一区| 一区二区三区美女| 国产精品伦理一区二区| 日韩视频一区二区三区 |