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

? 歡迎來(lái)到蟲(chóng)蟲(chóng)下載站! | ?? 資源下載 ?? 資源專(zhuān)輯 ?? 關(guān)于我們
? 蟲(chóng)蟲(chóng)下載站

?? ime.cpp

?? Windows CE 6.0 Word Application 源碼
?? CPP
?? 第 1 頁(yè) / 共 5 頁(yè)
字號(hào):
//
// 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() )
	{

?? 快捷鍵說(shuō)明

復(fù)制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號(hào) Ctrl + =
減小字號(hào) Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
日韩一区二区三区电影在线观看| 欧美三级一区二区| 在线观看91精品国产麻豆| 中文字幕 久热精品 视频在线| 亚洲一区二区四区蜜桃| 国产高清久久久| 日韩欧美久久久| 午夜成人免费视频| 91在线视频18| 国产三级精品视频| 久久66热re国产| 欧美人伦禁忌dvd放荡欲情| 日韩一区在线播放| 国产精品88av| 日韩欧美国产午夜精品| 香蕉久久一区二区不卡无毒影院| 91啪九色porn原创视频在线观看| 国产日韩影视精品| 国产真实乱子伦精品视频| 56国语精品自产拍在线观看| 亚洲午夜三级在线| 在线亚洲+欧美+日本专区| 国产精品短视频| 国产成人三级在线观看| 久久久亚洲精华液精华液精华液| 老司机午夜精品| 3atv在线一区二区三区| 亚洲第一激情av| 欧美日韩一区二区欧美激情| 一区二区视频在线| 91日韩在线专区| 亚洲少妇屁股交4| 99久久综合狠狠综合久久| 91免费看片在线观看| 国产精品伦理一区二区| 成人免费黄色大片| 国产精品久久夜| 国产午夜精品一区二区三区嫩草 | 亚洲欧美激情插 | 日韩av不卡一区二区| 欧美人动与zoxxxx乱| 视频一区视频二区在线观看| 欧美日韩精品一区二区三区 | 一区二区在线观看不卡| 色婷婷综合久久久久中文一区二区| 国产精品第五页| 色综合天天视频在线观看| 亚洲美女精品一区| 色屁屁一区二区| 亚洲电影在线免费观看| 91麻豆精品国产91久久久更新时间| 午夜精品久久久久久久| 欧美一级一区二区| 精品一区二区在线看| 久久一区二区视频| 粗大黑人巨茎大战欧美成人| 国产精品国产三级国产专播品爱网 | 久久一留热品黄| 成人午夜在线播放| 一区二区三区小说| 欧美三级中文字| 美国毛片一区二区三区| 久久久美女毛片| 99视频有精品| 亚洲午夜日本在线观看| 91精品国产aⅴ一区二区| 精品一区二区三区在线播放| 久久精品男人的天堂| 中文字幕二三区不卡| 99久久婷婷国产综合精品| 洋洋成人永久网站入口| 制服丝袜亚洲播放| 国产一区二区主播在线| 最新热久久免费视频| 欧美三级欧美一级| 久久av资源网| 国产精品色噜噜| 精品视频在线免费| 国模无码大尺度一区二区三区| 欧美高清在线精品一区| 在线看日本不卡| 久久99精品一区二区三区三区| 国产嫩草影院久久久久| 色88888久久久久久影院野外| 日韩精彩视频在线观看| 国产视频不卡一区| 色婷婷av一区二区三区大白胸| 蜜桃视频在线观看一区| 国产精品久久久久影院| 欧美精品黑人性xxxx| 成人一区二区三区中文字幕| 午夜伦理一区二区| 亚洲国产精品ⅴa在线观看| 欧美四级电影网| 国产盗摄女厕一区二区三区 | 国产色产综合产在线视频| 一本色道久久综合亚洲91 | 亚洲1区2区3区4区| 国产午夜精品久久| 欧美在线免费播放| 国产精品一区二区久久不卡| 亚洲日本乱码在线观看| 欧美电影免费观看高清完整版在| 91丝袜高跟美女视频| 麻豆freexxxx性91精品| 亚洲精品乱码久久久久| 久久综合色综合88| 欧美日韩综合不卡| 成人午夜电影小说| 理论电影国产精品| 亚洲国产日韩综合久久精品| 久久精品人人爽人人爽| 91麻豆精品国产91久久久| 99久久精品费精品国产一区二区| 久久av中文字幕片| 天堂在线一区二区| 亚洲欧美视频在线观看视频| 久久亚洲私人国产精品va媚药| 欧美日韩久久不卡| av电影在线观看不卡 | 亚洲午夜激情网站| 中文字幕成人在线观看| 日韩一区二区在线看| 欧美午夜不卡在线观看免费| 成人激情免费网站| 国产专区综合网| 日韩高清国产一区在线| 亚洲影院久久精品| 国产精品家庭影院| 欧美激情一区在线观看| 久久综合九色综合97婷婷女人| 91麻豆精品国产综合久久久久久| 欧美做爰猛烈大尺度电影无法无天| 成人激情综合网站| 国产成人午夜精品5599 | 一区二区三区在线高清| 国产精品久久久久久久久免费相片| 精品国免费一区二区三区| 欧美精品在线一区二区| 欧美三级午夜理伦三级中视频| 色综合 综合色| 成人99免费视频| 成人天堂资源www在线| 国产精品综合在线视频| 九九视频精品免费| 美女久久久精品| 免费成人av资源网| 天堂va蜜桃一区二区三区漫画版| 亚洲一区二区三区中文字幕在线| 亚洲免费在线视频| 亚洲视频在线观看一区| 综合电影一区二区三区| 国产精品激情偷乱一区二区∴| 国产精品三级在线观看| 国产精品久久久久永久免费观看| 欧美国产日韩在线观看| 中文字幕二三区不卡| 国产精品久久久一本精品| 国产精品美日韩| 国产精品久久久久久久久免费桃花| 中文天堂在线一区| 国产精品不卡在线| 亚洲欧美日韩国产手机在线| 亚洲猫色日本管| 一区二区三区电影在线播| 亚洲国产精品久久一线不卡| 亚洲午夜三级在线| 日本欧美肥老太交大片| 久久超级碰视频| 国产伦精品一区二区三区在线观看| 国产精品亚洲人在线观看| 成人性生交大片免费看在线播放| 成人精品一区二区三区四区| 91在线观看高清| 精品视频色一区| 欧美一个色资源| 久久影院午夜片一区| 国产精品麻豆视频| 一区二区免费看| 首页国产欧美久久| 久久国产日韩欧美精品| 国产精品原创巨作av| av不卡免费电影| 欧美日韩在线三区| 欧美大片国产精品| 国产精品久久久久久久久图文区| 亚洲免费观看高清完整版在线观看| 亚洲一区二区在线播放相泽 | 26uuu另类欧美亚洲曰本| 久久精品国产久精国产| 国产一区二三区好的| av午夜精品一区二区三区| 在线精品视频一区二区| 日韩欧美中文字幕精品| 国产丝袜美腿一区二区三区| 一区二区三区蜜桃网| 精品亚洲porn| aa级大片欧美| 91精品国产综合久久婷婷香蕉 | 色婷婷精品久久二区二区蜜臀av|