亚洲欧美第一页_禁久久精品乱码_粉嫩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一区二区三区免费野_久草精品视频
久久99精品国产.久久久久久| 性做久久久久久久免费看| 欧美乱妇20p| 一本大道久久a久久精品综合| 国产一区二区三区免费| 蜜臀久久99精品久久久久宅男| 亚洲自拍偷拍综合| 综合久久久久久| 国产精品另类一区| 国产夜色精品一区二区av| 日韩精品一区二区三区在线播放| 欧美日韩高清一区二区| 中文字幕在线视频一区| 色综合久久综合网欧美综合网| 国产麻豆精品久久一二三| 国产精品国产精品国产专区不蜜| 久久综合久久综合久久| 日韩精品影音先锋| 久久一夜天堂av一区二区三区 | 久久网站最新地址| 日韩精品一区在线| 精品99999| 国产日韩精品视频一区| 国产色婷婷亚洲99精品小说| 欧美激情中文字幕| 亚洲欧美色综合| 亚洲高清免费观看| 欧美a级一区二区| 国内欧美视频一区二区| 国产精品亚洲人在线观看| 成人深夜福利app| 91丝袜呻吟高潮美腿白嫩在线观看| 91啪亚洲精品| 8x8x8国产精品| 337p粉嫩大胆色噜噜噜噜亚洲| 国产亚洲精品免费| 亚洲靠逼com| 日韩高清不卡一区二区三区| 国产一区日韩二区欧美三区| 成人国产精品免费网站| 欧美性受xxxx黑人xyx性爽| 日韩一区二区三区电影在线观看| www久久精品| 亚洲精品中文在线| 秋霞成人午夜伦在线观看| 国产成人综合亚洲网站| 色偷偷久久人人79超碰人人澡| 欧美情侣在线播放| 中文欧美字幕免费| 亚洲亚洲精品在线观看| 黄色日韩网站视频| 色欧美88888久久久久久影院| 欧美一级片在线看| 中文字幕一区二区三区在线不卡| 亚洲一区电影777| 国产在线精品免费| 色天天综合色天天久久| 精品少妇一区二区三区在线播放 | 欧美图片一区二区三区| 精品国产亚洲在线| 亚洲最大成人综合| 国产高清精品久久久久| 欧美丰满少妇xxxbbb| 国产精品萝li| 激情图片小说一区| 欧美日韩一区二区三区在线| 国产精品毛片久久久久久久| 久久精品国产77777蜜臀| 在线观看不卡视频| 中文字幕一区二区三区视频| 久久99精品国产麻豆不卡| 欧美亚洲禁片免费| 亚洲视频一区二区在线| 国产精品1区2区3区在线观看| 欧美精品高清视频| 亚洲精选视频免费看| 成人小视频免费在线观看| 欧美电影精品一区二区| 玉米视频成人免费看| 国产情人综合久久777777| 亚洲视频一二区| 亚洲一区二区三区四区五区中文 | 国产精品午夜在线| 国内不卡的二区三区中文字幕 | 亚洲综合在线观看视频| 国产v综合v亚洲欧| 欧美tk—视频vk| 久久精品国产精品亚洲综合| 欧美一区二区播放| 性做久久久久久| 欧美亚洲精品一区| 亚洲高清一区二区三区| 欧洲精品在线观看| 亚洲精品中文在线观看| 色8久久人人97超碰香蕉987| 亚洲日本va午夜在线影院| 成人sese在线| 亚洲视频一二区| 色综合久久天天| 一区二区三区毛片| 欧美精品一二三| 日本视频一区二区三区| 欧美一级日韩免费不卡| 免费在线视频一区| 日韩欧美综合在线| 国产综合色精品一区二区三区| 日韩欧美国产不卡| 激情另类小说区图片区视频区| 日韩欧美一卡二卡| 国产精品99久| 中文字幕一区二区三区在线观看 | 91香蕉国产在线观看软件| 国产精品麻豆久久久| 91在线观看一区二区| 亚洲色大成网站www久久九九| 97精品国产露脸对白| 亚洲综合免费观看高清完整版在线| 欧美亚洲日本一区| 日本视频免费一区| 久久婷婷国产综合国色天香| 处破女av一区二区| 亚洲综合免费观看高清在线观看| 91精品国产91久久久久久最新毛片| 黄网站免费久久| 亚洲三级在线播放| 日韩一区二区三区免费观看| 国产福利一区二区| 亚洲午夜电影网| 久久先锋影音av| 91麻豆精品一区二区三区| 亚洲国产你懂的| 国产亚洲美州欧州综合国| 91国偷自产一区二区三区观看 | 精品一区二区国语对白| 中文字幕欧美日韩一区| 欧美在线啊v一区| 欧美一区二区在线不卡| 欧美精品粉嫩高潮一区二区| 欧美顶级少妇做爰| 51精品久久久久久久蜜臀| 欧美日韩一级二级三级| 欧美一区二区三区日韩| 亚洲成a人v欧美综合天堂| 欧美成人一区二区三区| 91碰在线视频| 国内精品免费**视频| 一区二区三区**美女毛片| 久久精品欧美一区二区三区不卡 | 在线播放91灌醉迷j高跟美女 | 国产精品一区在线观看你懂的| 国产精品欧美久久久久无广告 | 一区二区三区鲁丝不卡| 精品欧美一区二区在线观看| 欧美老女人第四色| 99久久免费视频.com| 久久国产乱子精品免费女| 亚洲欧美偷拍另类a∨色屁股| 久久综合色天天久久综合图片| 91福利视频在线| 大胆欧美人体老妇| 国产精品996| 国产综合色在线| 免费黄网站欧美| 日韩中文欧美在线| 亚洲午夜久久久| 亚洲免费高清视频在线| 一色桃子久久精品亚洲| 国产人久久人人人人爽| 久久久噜噜噜久久人人看| 日韩女优毛片在线| 欧美一区二区日韩一区二区| 在线电影国产精品| 欧美日韩一二三| 在线看日本不卡| 91久久精品一区二区二区| 成人动漫一区二区在线| eeuss国产一区二区三区| 国产.精品.日韩.另类.中文.在线.播放| 看电视剧不卡顿的网站| 蜜臀av性久久久久av蜜臀妖精| 日本在线观看不卡视频| 日本美女一区二区三区视频| 日产国产欧美视频一区精品| 日韩成人dvd| 精品一区二区免费在线观看| 黄色小说综合网站| 国产98色在线|日韩| 成人黄色777网| 色婷婷精品久久二区二区蜜臂av| 91视频免费观看| 欧美午夜不卡视频| 日韩一区二区免费电影| 精品盗摄一区二区三区| 国产亚洲视频系列| 亚洲天堂网中文字| 一区二区三区欧美视频| 日本不卡的三区四区五区| 狠狠狠色丁香婷婷综合激情| 国产成人综合网| 色综合婷婷久久|