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

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

?? ime.cpp

?? Windows CE 6.0 Word Application 源碼
?? CPP
?? 第 1 頁 / 共 5 頁
字號:
//
// Copyright (c) Microsoft Corporation.  All rights reserved.
//
//
// Use of this source code is subject to the terms of the Microsoft shared
// source or premium shared source license agreement under which you licensed
// this source code. If you did not accept the terms of the license agreement,
// you are not authorized to use this source code. For the terms of the license,
// please see the license agreement between you and Microsoft or, if applicable,
// see the SOURCE.RTF on your install media or the root of your tools installation.
// THE SOURCE CODE IS PROVIDED "AS IS", WITH NO WARRANTIES.
//
/*
 *	@doc	INTERNAL
 *
 *	@module ime.cpp -- support for Win95 IME API |
 *	
 *		Most everything to do with FE composition string editing passes
 *		through here.
 *	
 *	Authors: <nl>
 *		Jon Matousek <nl>
 *		Hon Wah Chan <nl>
 *		Justin Voskuhl <nl>
 *
 *	History: <nl>
 *		10/18/1995		jonmat	Cleaned up level 2 code and converted it into
 *								a class hierarchy supporting level 3.
 *
 *
 */								

#include "_common.h"
#include "_font.h"
#include "_edit.h"
#include "_select.h"
#include "_m_undo.h"
#include "_dispml.h"

#include "_ime.h"
#include "_rtfconv.h"	// Needed for GetCodePage

BOOL forceLevel2 = FALSE;

ASSERTDATA

#define HAVE_COMPOSITION_STRING ( 0 != (lparam & (GCS_COMPSTR | GCS_COMPATTR)))
#define CLEANUP_COMPOSITION_STRING ( 0 == lparam )
#define HAVE_RESULT_STRING ( 0 != (lparam & GCS_RESULTSTR))


/*
 *	HRESULT StartCompositionGlue ( CTxtEdit &ed, IUndoBuilder &undobldr )
 *	
 *	@func
 *		Initiates an IME composition string edit.
 *	@comm
 *		Called from the message loop to handle WM_IME_STARTCOMPOSITION.
 *		This is a glue routine into the IME object hierarchy.
 *
 *	@devnote
 *		We decide if we are going to do a level 2 or level 3 IME
 *		composition string edit. Currently, the only reason to
 *		create a level 2 IME is if the IME has a special UI, or it is
 *		a "near caret" IME, such as the ones found in PRC and Taiwan.
 *		Near caret simply means that a very small window opens up
 *		near the caret, but not on or at the caret.
 *
 *	@rdesc
 *		HRESULT-S_FALSE for DefWindowProc processing, S_OK if not.
 */
HRESULT StartCompositionGlue (
	CTxtEdit &ed,				// @parm the containing text edit.
	BOOL	 fIsNotProtected,	// @parm TRUE if Not Protected Nor ReadOnly
	IUndoBuilder &undobldr)		// @parm required to modify the text.
{
	TRACEBEGIN(TRCSUBSYSFE, TRCSCOPEINTERN, "StartCompositionGlue");

	// note that in some locales (PRC), we may still be in composition mode
	// when a new start composition call comes in.  Just reset our state
	// and go on.

	if ( fHaveIMMProcs && !ed.IsIMEComposition() )
	{
		if ( fIsNotProtected )
		{

			// if a special UI, or IME is "near caret", then drop into lev. 2 mode.
			DWORD	imeProperties;

			imeProperties = pImmGetProperty( GetKeyboardLayout(0), IGP_PROPERTY );

			if ( 0 != ( imeProperties & IME_PROP_SPECIAL_UI )
				|| 0 == ( imeProperties & IME_PROP_AT_CARET )
				|| forceLevel2 )
			{
				ed._ime = new CIme_Lev2 ( ed );		// level 2 IME.
			}
			else
			{
				ed._ime = new CIme_Lev3 ( ed );		// level 3 IME->TrueInline.
			}
		}
		else
		{
			// protect or read-only, need to ignore all ime input
			ed._ime = new CIme_Protected;
		}
	}

	if ( ed.IsIMEComposition() )					// make the method call.
	{
		return ed._ime->StartComposition ( ed, undobldr );
	}

	return S_FALSE;
}

/*
 *	HRESULT CompositionStringGlue ( const LPARAM lparam, CTxtEdit &ed,
 *		IUndoBuilder &undobldr )
 *	
 *	@func
 *		Handle all intermediary and final composition strings.
 *
 *	@comm
 *		Called from the message loop to handle WM_IME_COMPOSITION.
 *		This is a glue routine into the IME object hierarchy.
 *		We may be called independently of a WM_IME_STARTCOMPOSITION
 *		message, in which case we return S_FALSE to allow the
 *		DefWindowProc to return WM_IME_CHAR messages.
 *
 *	@devnote
 *		Side Effect: the _ime object may be deleted if composition
 *		string processing is finished.
 *		
 *	@rdesc
 *		HRESULT-S_FALSE for DefWindowProc processing, S_OK if not.
 */
HRESULT CompositionStringGlue (
	const LPARAM lparam,		// @parm associated with message.
	CTxtEdit &ed,				// @parm the containing text edit.
	IUndoBuilder &undobldr )	// @parm required to modify the text.
{
	TRACEBEGIN(TRCSUBSYSFE, TRCSCOPEINTERN, "CompositionStringGlue");

	HRESULT hr = S_FALSE;

	if ( ed.IsIMEComposition() )					// A priori fHaveIMMProcs.
	{
		ed._ime->_compMessageRefCount++;			// For proper deletion.

													// Make the method call.
		hr = ed._ime->CompositionString(lparam, ed, undobldr);

		ed._ime->_compMessageRefCount--;			// For proper deletion.
		Assert ( ed._ime->_compMessageRefCount >= 0);

		CheckDestroyIME ( ed );						// Finished processing?
	}
	else // even when not in composition mode, we may receive a result string.
	{
		CIme::CheckKeyboardFontMatching ( GetKeyboardCodePage(), ed, NULL );
		hr = CIme::CheckInsertResultString( lparam, ed, undobldr );
	}

	return hr;
}

/*
 *	HRESULT EndCompositionGlue ( CTxtEdit &ed, IUndoBuilder &undobldr )
 *
 *	@func
 *		Composition string processing is about to end.
 *
 *	@comm
 *		Called from the message loop to handle WM_IME_ENDCOMPOSITION.
 *		This is a glue routine into the IME object hierarchy.
 *
 *	@devnote
 *		The only time we have to handle WM_IME_ENDCOMPOSITION is when the
 *		user changes input method during typing.  For such case, we will get
 *		a WM_IME_ENDCOMPOSITION message without getting a WM_IME_COMPOSITION
 *		message with GCS_RESULTSTR later.  So, we will call CompositionStringGlue
 *		with GCS_RESULTSTR to let CompositionString to get rid of the string.
 *		
 *	@rdesc
 *		HRESULT-S_FALSE for DefWindowProc processing, S_OK if not.
 */
HRESULT EndCompositionGlue (
	CTxtEdit &ed,				// @parm the containing text edit.
	IUndoBuilder &undobldr)	// @parm required to modify the text.
{
	TRACEBEGIN(TRCSUBSYSFE, TRCSCOPEINTERN, "EndCompositionGlue");

	if ( ed.IsIMEComposition() )
	{
		// set this flag. If we are still in composition mode, then
		// let the CompositionStringGlue() to destroy the ime object.
		ed._ime->_fDestroy = TRUE;

		// remove any remaining composition string.
		CompositionStringGlue( GCS_COMPSTR , ed, undobldr );

		// finished with IME, destroy it.
		CheckDestroyIME ( ed );
		
	}
	return S_FALSE;
}

/*
 *	void CheckDestroyIME ( CTxtEdit &ed )
 *
 *	@func
 *		Check for IME and see detroy if it needs it..
 *
 */
void CheckDestroyIME (
	CTxtEdit &ed )
{
	TRACEBEGIN(TRCSUBSYSFE, TRCSCOPEINTERN, "CheckDestroyIME");
	
	if ( ed.IsIMEComposition() && ed._ime->_fDestroy )
	{
		if ( 0 == ed._ime->_compMessageRefCount )
		{
			BOOL bKorean = ed._ime->IsKoreanMode();

		 	delete ed._ime;							// All done with object.
			ed._ime = NULL;

			CTxtSelection	*psel = ed.GetSel();
			if ( psel )
			{
				if ( bKorean )
				{
					// reset the caret position
					DWORD cp = psel->GetCp();
					psel->SetSelection (cp, cp);
				}

				psel->ShowCaret(TRUE);
			}

			if ( !ed.IsRich() )						// For nonRich, make sure
			{										//  to nuke runs.
				// Tell document to dump its format runs
				ed.HandleIMEToPlain();
			}
		}
	}
}

/*
 *	void PostIMECharGlue ( CTxtEdit &ed )
 *
 *	@func
 *		Called after processing a single WM_IME_CHAR in order to
 *		update the position of the IME's composition window. This
 *		is glue code to call the CIME virtual equivalent.
 */
void PostIMECharGlue (
	CTxtEdit &ed )				// @parm the containing text edit.
{
	TRACEBEGIN(TRCSUBSYSFE, TRCSCOPEINTERN, "PostIMECharGlue");

	if ( ed.IsIMEComposition() )
	{
		ed._ime->PostIMEChar( ed );
	}
}

/*
 *	HRESULT IMENotifyGlue ( const WPARAM wparam, const LPARAM lparam,
 *				CTxtEdit &ed )
 *
 *	@func
 *		IME is going to change some state.
 *
 *	@comm
 *		Currently we are interested in knowing when the candidate
 *		window is about to be opened.
 *		
 *	@rdesc
 *		HRESULT-S_FALSE for DefWindowProc processing, S_OK if not.
 */
HRESULT IMENotifyGlue (
	const WPARAM wparam,		// @parm associated with message.
	const LPARAM lparam,		// @parm associated with message.
	CTxtEdit &ed )				// @parm the containing text edit.
{
	TRACEBEGIN(TRCSUBSYSFE, TRCSCOPEINTERN, "IMENotifyGlue");

#if 0
	if (IMN_SETOPENSTATUS == wparam)
	{
		if (!pImmGetOpenStatus(ed.TxImmGetContext()))
		{
			// change to English keyboard if KANA mode is not on
			if (!(GetKeyState(VK_KANA) & 0x1))
				ed._ime->CheckKeyboardFontMatching ( 1252, ed, NULL );
		}
	}
#endif

	if ( ed.IsIMEComposition() )					// A priori fHaveIMMProcs.
	{												// Make the method call.
		return ed._ime->IMENotify ( wparam, lparam, ed );
	}
	
	return S_FALSE;
}

/*
 *	void IMECompositionFull ( CTxtEdit &ed )
 *
 *	@func
 *		Current IME Composition window is full.
 *
 *	@comm
 *		Called from the message loop to handle WM_IME_COMPOSITIONFULL.
 *		This message applied to Level 2 only.  We will use the default
 *		IME Composition window.
 *
 */
void IMECompositionFull (
	CTxtEdit &ed)				// @parm the containing text edit.
{
	TRACEBEGIN(TRCSUBSYSFE, TRCSCOPEINTERN, "IMECompositionFull");

	if ( ed.IsIMEComposition() )
	{
#ifndef MACPORT
		HIMC 				hIMC	= ed.TxImmGetContext();
		COMPOSITIONFORM		cf;

		if ( hIMC )
		{																									
			// no room for text input in the current level 2 IME window,
			// fall back to use the default IME window for input.
			cf.dwStyle = CFS_DEFAULT;
			pImmSetCompositionWindow( hIMC, &cf );	// Set composition window.
			ed.TxImmReleaseContext( hIMC );			// Done with IME context.
		}
#endif
 	}
}

/*
 *	LRESULT OnGetIMECompositionMode ( CTxtEdit &ed )
 *
 *	@mfunc
 *		Returns whether or not IME composition is being handled by RE,
 *		and if so, what level of processing.
 *		
 *	@rdesc
 *		One of ICM_NOTOPEN, ICM_LEVEL2_5, ICM_LEVEL2_SUI, ICM_LEVEL2, ICM_LEVEL3.
 */
LRESULT OnGetIMECompositionMode (
	CTxtEdit &ed )	  	// @parm the containing text edit.
{
	LRESULT lres;

	lres = ICM_NOTOPEN;
	if ( ed.IsIMEComposition() )
	{
		if ( IME_LEVEL_2 == ed._ime->_imeLevel )
		{
#ifndef MACPORT
			DWORD imeProperties;

			imeProperties = pImmGetProperty( GetKeyboardLayout(0), IGP_PROPERTY );
			if ( imeProperties & IME_PROP_AT_CARET)
				lres = ICM_LEVEL2_5;				// level 2.5.
			else if	( imeProperties & IME_PROP_SPECIAL_UI )
				lres = ICM_LEVEL2_SUI;				// special UI.
			else
#endif
				lres = ICM_LEVEL2;					// stock level 2.
		}
		else if ( IME_LEVEL_3 == ed._ime->_imeLevel )
		{
			lres = ICM_LEVEL3;
		}
	}

	return lres;
}

/*
 *	BOOL IMECheckGetInvertRange(CTxtEdit *ed, LONG &invertMin, LONG &invertMost)
 *
 *	@func
 *		helper func that returns the min invertMin and max invertMost across a
 *		range of IME composition characters. This is required by the renderer to
 *		know if to treat the current line as a line that contains a selection
 *		as we use the renderer's invert selection code to invert the IME text.
 *
 *	@comm
 *		Unlike a single selection, there can be noncontiguous IME inverted
 *		selections.
 */
BOOL IMECheckGetInvertRange(CTxtEdit *ed, LONG &invertMin, LONG &invertMost)
{
	TRACEBEGIN(TRCSUBSYSFE, TRCSCOPEINTERN, "IMECheckGetInvertRange");

	if ( ed && ed->IsIMEComposition() )
	{
		 invertMin		= ed->_ime->_invertMin;
		 invertMost		= ed->_ime->_invertMost;

		 return TRUE;
	}

	return FALSE;
}

/*
 *	void CIme::CheckKeyboardFontMatching ( CTxtEdit &ed, LONG *piFormat )
 *	
 *	@mfunc
 *		Check if the current font matches the keyboard Codepage.
 *
 *	@comm
 *		Called from CIme_Lev2::CIme_Lev2 and CompositionStringGlue
 *
 *	@devnote
 *		We need to switch to a preferred font for the keyboard during IME input.
 *		Otherwise, we will dispay garbage.
 *		
 */
void CIme::CheckKeyboardFontMatching (
	UINT cp,
	CTxtEdit &ed,
	LONG	*piFormat )
{
	CTxtSelection		* const psel	= ed.GetSel();

	Assert ( psel );

	if ( psel && ed.IsRich() )
	{

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
色天天综合久久久久综合片| 亚洲在线观看免费视频| 欧美日韩aaa| 欧美日韩国产一区二区三区地区| 99在线视频精品| 色综合网色综合| 色琪琪一区二区三区亚洲区| 99久久精品国产毛片| 97国产精品videossex| bt欧美亚洲午夜电影天堂| 波多野结衣的一区二区三区| 色又黄又爽网站www久久| 色香蕉久久蜜桃| 欧美日韩一区三区| 日韩欧美视频在线| 久久久久亚洲蜜桃| 中文字幕欧美一区| 亚洲电影你懂得| 国内精品写真在线观看| 成人在线一区二区三区| 99久久国产免费看| 欧美老年两性高潮| 国产日韩在线不卡| 一区二区三区国产精品| 视频在线观看一区二区三区| 老司机精品视频在线| 成人一二三区视频| 欧美视频精品在线| 久久久美女毛片 | 亚洲成人免费影院| 蜜桃视频在线一区| 99视频精品全部免费在线| 欧美在线观看一二区| 久久蜜桃av一区二区天堂| 最新国产成人在线观看| 欧美a级一区二区| 国产成人免费视频网站高清观看视频| 91亚洲男人天堂| 久久综合色婷婷| 一区二区国产视频| 国产馆精品极品| 制服丝袜av成人在线看| 国产精品国产自产拍在线| 麻豆成人免费电影| 在线一区二区三区四区五区| 亚洲精品在线免费观看视频| 亚洲精品国产a| 国产高清视频一区| 日韩一区和二区| 一区二区三区四区激情| 国产成人亚洲精品青草天美| 欧美久久久久免费| 亚洲精品你懂的| 成人美女视频在线看| 欧美成人乱码一区二区三区| 亚洲综合色自拍一区| 成人av影视在线观看| 精品国产一区二区精华| 轻轻草成人在线| 欧美吞精做爰啪啪高潮| 亚洲欧美国产高清| 99国产精品久久久久久久久久| 日韩一区二区麻豆国产| 水蜜桃久久夜色精品一区的特点| www.在线欧美| 中文字幕在线一区| 成人免费毛片app| 欧美v国产在线一区二区三区| 性做久久久久久| 在线欧美日韩精品| 亚洲激情网站免费观看| 91丨九色丨尤物| 成人免费一区二区三区视频| 免费不卡在线观看| 在线91免费看| 美女视频一区二区| 日韩欧美第一区| 加勒比av一区二区| 久久五月婷婷丁香社区| 亚洲大片免费看| 欧美精品99久久久**| 午夜亚洲国产au精品一区二区| 95精品视频在线| 亚洲在线观看免费视频| 欧美日韩日日夜夜| 蜜桃精品视频在线观看| 日韩一区二区视频| 亚洲大片免费看| 91蜜桃传媒精品久久久一区二区| 最新中文字幕一区二区三区 | 中文字幕高清不卡| 成人免费观看视频| 中文字幕日韩一区| 欧美偷拍一区二区| 久久99久久99| 国产精品伦理一区二区| 91久久精品午夜一区二区| 日韩高清不卡一区二区| 久久综合999| 99久久久免费精品国产一区二区 | 亚洲第一电影网| 日韩一二三四区| 成人av片在线观看| 性做久久久久久久免费看| 亚洲精品在线电影| 日本大香伊一区二区三区| 免费成人在线观看| 最新不卡av在线| 欧美一区二区三区性视频| www.亚洲精品| 奇米一区二区三区av| 国产午夜精品一区二区| 色婷婷综合久久久| 国产精品一区二区在线观看不卡| 亚洲色图20p| 久久久精品tv| 欧美麻豆精品久久久久久| 国产成+人+日韩+欧美+亚洲| 亚洲狠狠爱一区二区三区| 久久久久久电影| 欧美日韩一区二区电影| 丁香亚洲综合激情啪啪综合| 三级在线观看一区二区| 中文字幕二三区不卡| 精品国产欧美一区二区| 欧美性感一类影片在线播放| 大尺度一区二区| 精品一区二区三区日韩| 亚洲国产视频一区二区| 国产精品久久久久久久第一福利| 日韩精品专区在线影院重磅| 欧洲亚洲国产日韩| 94色蜜桃网一区二区三区| 国产精品自拍在线| 久久精品国产久精国产爱| 亚洲一二三区在线观看| 亚洲视频在线观看三级| 亚洲国产精品精华液ab| 337p粉嫩大胆噜噜噜噜噜91av| 欧美人妇做爰xxxⅹ性高电影| 色偷偷久久一区二区三区| 成人伦理片在线| 成人精品在线视频观看| 国产精品一级黄| 国产一区福利在线| 激情综合五月婷婷| 国产一区亚洲一区| 韩日av一区二区| 黄网站免费久久| 国产精品一级片在线观看| 国模大尺度一区二区三区| 精品一区二区三区免费观看 | 日本一区二区在线不卡| 久久久激情视频| 欧美激情一区在线观看| 欧美国产精品一区二区三区| 国产清纯在线一区二区www| 久久久精品人体av艺术| 国产人伦精品一区二区| 国产精品三级在线观看| 中文字幕一区二区日韩精品绯色| 中文字幕欧美区| 亚洲品质自拍视频| 亚洲成人免费看| 美女免费视频一区| 黄页视频在线91| 成人午夜又粗又硬又大| 91麻豆免费观看| 欧美日韩大陆一区二区| 精品久久久久久久人人人人传媒 | 亚洲精品写真福利| 五月天久久比比资源色| 麻豆极品一区二区三区| 国产成人精品影院| 91国在线观看| 日韩精品在线网站| 欧美一区二区久久| 欧美激情在线看| 亚洲国产精品一区二区久久恐怖片| 爽爽淫人综合网网站| 国产一区 二区 三区一级| 99精品在线观看视频| 91精品国产丝袜白色高跟鞋| 2欧美一区二区三区在线观看视频| 国产精品每日更新| 天堂va蜜桃一区二区三区漫画版| 狠狠色狠狠色综合系列| 色婷婷综合久久久久中文一区二区| 欧美久久高跟鞋激| 国产精品免费人成网站| 免费视频最近日韩| 久久国产剧场电影| 在线观看区一区二| 国产亚洲污的网站| 视频一区国产视频| 91麻豆精品在线观看| 久久久精品影视| 日本午夜一区二区| 在线国产电影不卡| 亚洲国产精品99久久久久久久久|