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

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

?? ime.cpp

?? Windows CE 6.0 Word Application 源碼
?? CPP
?? 第 1 頁 / 共 5 頁
字號:
 *				IUndoBuilder &undobldr )
 *
 *	@mfunc
 *		Handle Level 3 WM_IME_COMPOSITION messages.
 *
 *	@comm
 *		Display all of the intermediary composition text as well as the final
 *		reading.
 *
 *	@devnote
 *		This is a rudimentary solution for replacing text in the backing store.
 *		Work is left to do with the undo list, underlining, and hiliting with
 *		colors and the selection.	
 *		
 *	@devnote
 *		A GCS_RESULTSTR message can arrive and the IME will *still* be in
 *		composition string mode. This occurs because the IME's internal
 *		buffers overflowed and it needs to convert the beginning of the buffer
 *		to clear out some room.	When this happens we need to insert the
 *		converted text as normal, but remain in composition processing mode.
 *
 *		Another reason, GCS_RESULTSTR can occur while in composition mode
 *		for Korean because there is only 1 correct choice and no additional
 *		user intervention is necessary, meaning that the converted string can
 *		be sent as the result before composition mode is finished.
 *
 *	@rdesc
 *		HRESULT-S_FALSE for DefWindowProc processing, S_OK if not.
 */
HRESULT CIme_Lev3::CompositionString(
	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, "CIme_Lev3::CompositionString");

#ifdef DEBUG
	static				BOOL fNoRecurse = FALSE;

	Assert ( !fNoRecurse );
	fNoRecurse = TRUE;
#endif			

	// fix, need to come up with error handler for no selection.
	CTxtSelection * const	psel = ed.GetSel();
	CTxtRange			rg(&ed, 0,0);

	HIMC 				hIMC;

	INT					cchOld;
	WCHAR				uniCompStr[256];
	BYTE				startAttrib, attrib[256];

	BOOL				fShowCursor;
	LONG				cursorCP, cchAttrib;

	CCharFormat			baseCF, CF;

	LONG				i,j, selStart;				// For applying attrib
													//	effects.

	LONG				formatMin, formatMost;

	BOOL				fKBSwitchSave;

	
	if ( !psel )									// Needed for Level 3.
		return S_FALSE;

	Assert (psel);

	psel->SetIsChar(TRUE);

	fKBSwitchSave		= ed._fAutoKeyboard;		// Don't allow switch!
	ed._fAutoKeyboard	= FALSE;					//  causes re-entrance.

 	if (  CLEANUP_COMPOSITION_STRING || HAVE_RESULT_STRING  )						// Any final readings?
	{
		psel->ShowCaret(FALSE);
		psel->ShowSelection(FALSE);
		psel->SetSelection(_ichStart+_cchCompStr, _ichStart+_cchCompStr);	

		rg.Set( _ichStart + _cchCompStr, _cchCompStr);// Select old text.
		rg.Set_iCF(_iFormatSave);					// For degenerate case.
		rg.ReplaceRange( 0, NULL, NULL, SELRR_IGNORE);// Delete previous text.

		psel->Set_iCF(_iFormatSave);				// Insert final reading.

		CheckInsertResultString(lparam, ed, undobldr);

		// GuyBark JupiterJ 49758:
		// We may have just changed the font to be a J font to suit the text
		// just entered through the IME. Don't change the font back to what it
		// was before, otherwise the user doesn't know the font used to insert
		// the text.
//		psel->Set_iCF(_iFormatSave);

		psel->ShowSelection(TRUE);
		psel->ShowCaret(TRUE);

		_ichStart = psel->GetCpMin();				// Reset as we may still
		_cchCompStr	= 0;							//  be in composition mode.
		_fHoldNotify = FALSE;						// OK notify client for change
	}

	if ( HAVE_COMPOSITION_STRING )					// In composition mode?
	{												
		hIMC = ed.TxImmGetContext();				// Get host's IME context.

		cchOld = _cchCompStr;
		_cchCompStr = 0;
		cchAttrib = 0;
		if ( hIMC )									// Get new intermediate
		{ 											//  composition string,
													//  attribs, and caret.
			_cchCompStr = GetCompositionStringInfo( hIMC, GCS_COMPSTR,
					uniCompStr,	sizeof(uniCompStr)/sizeof(uniCompStr[0]),
					attrib, sizeof(attrib)/sizeof(attrib[0]),
					&cursorCP, &cchAttrib );

			ed.TxImmReleaseContext( hIMC );			// Done with IME context.

		}														

		// When there is no old text or new text, just show the caret
		// This is the case when client used TerminateIMEComposition with
		// CPS_CANCEL option.
		if ( !cchOld && !_cchCompStr )
			psel->ShowCaret(TRUE);
		else
		{
#ifndef MACPORT			
			// this is to support Korean overstrike mode
			if ( _fKorean && !cchOld && ed._fOverstrike )			
				psel->PrepareIMEOverstrike ( &undobldr );	// get ride of the next char if necessary
#endif

			// Select the old composition text and replace them with
			// the new composition text.
			ed.GetCharFormat(_iFormatSave)->Get(&baseCF);	// Remove underline attrib.

			if (!_fKorean)
			{
				baseCF.dwEffects &= ~CFE_UNDERLINE;
				baseCF.bUnderlineType = 0;
			}

			rg.Set( _ichStart+cchOld, cchOld);			// Select old comp string.

#ifdef PWD_JUPITER
            // GuyBark:
            // If this is a J character, make sure a J font is selected

            // Only change the charset if we may be handling a CJK character.
            if(uniCompStr[0] >= 0x3000)
            {
                baseCF.dwMask   |= CFM_CHARSET;
                baseCF.bCharSet  = GetCharSet(GetKeyboardCodePage());
            }
#endif // PWD_JUPITER

			rg.SetCharFormat(&baseCF, FALSE, NULL);		// Set format for new text.
			LONG ccAdded = rg.CleanseAndReplaceRange( _cchCompStr, uniCompStr, TRUE, NULL );// Replace with new text...
			
			if (!_cchCompStr && _fKorean)
			{
				// make sure the current format is restored.
				psel->Set_iCF(_iFormatSave);
			}

			// ensure that the cursor position and _cchCompStr matched what we have added
			// to avoid the max. text length case.
			_cchCompStr = min(ccAdded, _cchCompStr);

			if ( cursorCP > 0 )
				cursorCP = min(ccAdded, cursorCP) ;

			selStart = -1;
			_invertMin = 0;
			_invertMost = 0;
			if ( ccAdded && ccAdded <= cchAttrib && !_fKorean )		// no Korean style needed
			{
				for ( i = 0; i < ccAdded; )				// Parse the attributes...
				{										//  to apply selection,
														//  and styles.
					
					startAttrib = attrib[i];			// Get attrib's run length.
					for ( j = i+1; j < ccAdded; j++ )			
					{
						if ( startAttrib != attrib[j] )	// Same run until diff.
							break;
					}
														// remember sel start.
					if ( startAttrib == ATTR_TARGET_CONVERTED )
					{
                                                // Windows CE Platforms Bug #10084		May 25,01 v-holee
						if( LANG_CHINESE != PRIMARYLANGID( LOWORD( GetKeyboardLayout(0) ) ))  //
						{
						    Assert ( -1 == selStart );		// only 1 selection??
						    selStart = _ichStart + i;
						    cursorCP = i;			// RAID #4043,8982 fix. If there is ATTR_TARGET_CONVERTED, don"t display caret.
						}
					}
#ifndef PWD_JUPITER
					// Guybark Jupiter 47621:
					// Allow the caret to sit inside an uncomposed string for JupiterJ.
					else if ( startAttrib == ATTR_TARGET_NOTCONVERTED )
						cursorCP = -1;					// turn off caret
#endif // PWD_JUPITER

					CF = baseCF;						// Ask IMEShare for style.
					if ( SetCompositionStyle ( ed, CF, startAttrib ) )
					{
						formatMin = _ichStart + i;		// Book keeping to help
						formatMost = formatMin + (j-i);	//  renderer draw IME
														//  selection.
						if ( formatMin < _invertMin )
							_invertMin = formatMin;

						if ( formatMost > _invertMost )
							_invertMost = formatMost;
					}
					rg.Set( _ichStart + i, -(j-i));		// Apply FE clause's style.
					rg.SetCharFormat(&CF, FALSE, NULL);

					i = j;
				}
			}

			fShowCursor = FALSE;						
			if ( cursorCP >= 0 )						// If a cursor pos exist...
			{											
				cursorCP += _ichStart;					// Set cursor and scroll.
				SetIMECaretWidth ( dxCaret );			// setup initial caret width

	#ifndef MACPORT
				if ( _fKorean && ccAdded )				// Set-up Korean Block
				{										//  cursor.
					LONG	xWidth = dxCaret;

					LONG				iFormat;
					const CCharFormat	*pCF;
					HDC					hdc;
					CCcs				*pccs;			// Font cache.

					if ( psel )
					{
						POINT				ptCurrentPos;		// caret position of previous character
						INT					CurrentCaretHt;		// caret height of current character
						INT					NewCaretHt=0;			// caret height of previous character
						INT					CurrentDescent;		// descent of current character
						INT					NewDescent=0;			// descent  of previous character

						// Force a scroll for Korean block caret.
						// Otherwise, the current Korean character will not display
						// when it is at the end of line for single-lined control.						
						psel->SetSelection( cursorCP+1, cursorCP+1 );

						hdc = ed.TxGetDC();				// Get the font cache
						if ( hdc )
						{
							iFormat = psel->Get_iCF();
							pCF = ed.GetCharFormat(iFormat);
							ReleaseFormats(iFormat, -1);
							if ( pCF )
							{
								pccs = fc().GetCcs(hdc, pCF, ed._pdp->GetZoomNumerator(),
									ed._pdp->GetZoomDenominator(), GetDeviceCaps(hdc, LOGPIXELSY));

								if( pccs )					// If font cache exist...
								{											
									pccs->Include( *uniCompStr, xWidth);

									// setup new character height info for caret height calc.
									NewDescent = pccs->_yDescent;
									NewCaretHt = pccs->_yHeight;

									pccs->Release();
								}
							}
							ed.TxReleaseDC( hdc );
						}

						psel->SetSelection( cursorCP, cursorCP );
						
						CurrentDescent = psel->GetCurrentDescent();
						CurrentCaretHt = (INT)psel->GetCaretHt();

						if ( NewCaretHt == 0 )
							// This is 0 if we fail to get pccs
							NewCaretHt = CurrentCaretHt;
						else if ( CurrentCaretHt != NewCaretHt && ::GetCaretPos( &ptCurrentPos ) )
						{
							// current character font size is diff, adjust the caret position
							// before using the new caret height
							ptCurrentPos.y += (( CurrentCaretHt - NewCaretHt ) -
								( CurrentDescent - NewDescent ));
							ed.TxSetCaretPos ( ptCurrentPos.x, ptCurrentPos.y );
						}

						GetCaretPos( &ptCurrentPos );		// v-holee: Korean block caret 
						psel->ShowCaret(FALSE);				// Because create turns off
						SetIMECaretWidth ( xWidth );		// setup Korean block caret width
						ed.TxCreateCaret(0, (INT) xWidth, NewCaretHt );
						ed.TxSetCaretPos ( ptCurrentPos.x, ptCurrentPos.y ); // v-holee: Korean block caret 
					}
				}
				else
	#endif
				psel->SetSelection( cursorCP, cursorCP );

				if ( selStart < 0 || cursorCP != selStart )
				{									    // Don't display caret if
														//  it is part of target
					fShowCursor = TRUE;					//  that is selected.
				}
			}
 			psel->ShowCaret(fShowCursor);
			
			// we don't want caret, need to reset _fUpdateSelection	so
			// CCallMgr::~CCallMgr() will not display the caret via Update()
			if ( !fShowCursor )
				ed._fUpdateSelection = FALSE;

			// make sure we have set the call manager text changed flag.  This flag
			// may be cleared when calling SetCharFormat
			ed.GetCallMgr()->SetChangeEvent(CN_TEXTCHANGED);

			// setup composition window for Chinese in-caret IME
			if ( !_fKorean )
				IMENotify ( IMN_OPENCANDIDATE, 0x01, ed );
		}

		// don't notify client for changes only when there is composition string available
		if ( _cchCompStr && !ed._fIMEAlwaysNotify )
			_fHoldNotify = TRUE;

	}

	psel->SetIsChar(FALSE);
	psel->CheckUpdateWindow();


#ifdef DEBUG
	fNoRecurse = FALSE;
#endif

	ed._fAutoKeyboard = fKBSwitchSave;				// Allow KB switching.

	return S_OK;									// No DefWindowProc
}													//  processing.

/*
 *	BOOL CIme_Lev3::SetCompositionStyle ( CTxtEdit &ed, CCharFormat &CF, UINT attribute )
 *
 *	@mfunc
 *		Set up a composition clause's character formmatting.
 *
 *	@comm
 *		If we loaded Office's IMEShare.dll, then we ask it what the formatting
 *		should be, otherwise we use our own, hardwired default formatting.
 *
 *	@devnote
 *		Note the use of pointers to functions when dealing with IMEShare funcs.
 *		This is because we dynamically load the IMEShare.dll.
 *
 *	@rdesc
 *		BOOL - This is because CFU_INVERT is treated like a selection by
 *			the renderer, and we need to know the the min invertMin and
 *			the max invertMost to know if the rendered line should be treated
 *			as if there are selections to be drawn.
 */
BOOL CIme_Lev3::SetCompositionStyle (
	CTxtEdit &ed,
	CCharFormat &CF,
	UINT attribute )
{
#pragma message ("This needs to be reviewed")

// GuyBark: We want this on Windows CE's PWord.
// #if 0
#ifdef PWD_JUPITER

	BOOL			fInvertStyleUsed = FALSE;

	CF.dwEffects &= ~CFE_UNDERLINE;			// default.
	CF.bUnderlineType = 0;

// GuyBark: there's no shared ime in the shared Office dll on the device.
//#ifndef MACPORT
#ifdef NEVER
	const IMESTYLE	*pIMEStyle;
	UINT			ulID;

	COLORREF		color;

	// load ImeShare if it has not been done
	if ( !fLoadIMEShareProcs )
	{
		InitNLSProcTable( LOAD_IMESHARE );
		fLoadIMEShareProcs = TRUE;
	}

	if ( fHaveIMEShareProcs )
	{
		pIMEStyle = pPIMEStyleFromAttr( attribute );
		if ( NULL == pIMEStyle )
			goto defaultStyle;

		CF.dwEffects &= ~CFE_BOLD & ~CFE_ITALIC;

		if ( pFBoldIMEStyle ( pIMEStyle ) )
			CF.dwEffects |= CFE_BOLD;

		if ( pFItalicIMEStyle ( pIMEStyle ) )
			CF.dwEffects |= CFE_ITALIC;

		if ( pFUlIMEStyle ( pIMEStyle ) )
		{
			CF.dwEffects |= CFE_UNDERLINE;
			CF.bUnderlineType = CFU_UNDERLINE;

			ulID = pIdUlIMEStyle ( pIMEStyle );
			if ( UINTIMEBOGUS != ulID )
			{
				if ( IMESTY_UL_DOTTED == ulID )
					CF.bUnderlineType = CFU_UNDERLINEDOTTED;
			}
		}

		color = pRGBFromIMEColorStyle( pPColorStyleTextFromIMEStyle ( pIMEStyle ));
		if ( UINTIMEBOGUS != color )
		{
			CF.dwEffects &= ~CFE_AUTOCOLOR;
			CF.crTextColor = color;
		}
		
		color = pRGBFromIMEColorStyle( pPColorStyleBackFromIMEStyle ( pIMEStyle ));
		if ( UINTIMEBOGUS != color )
		{
			CF.dwEffects &= ~CFE_AUTOBACKCOLOR;
			CF.crBackColor = color;

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
一本一道久久a久久精品综合蜜臀| 三级精品在线观看| 毛片不卡一区二区| 日韩国产欧美视频| 91免费版pro下载短视频| 久久青草国产手机看片福利盒子 | 精品国产免费一区二区三区四区 | 国产另类ts人妖一区二区| 激情成人综合网| 日韩一区二区麻豆国产| 日韩精品国产精品| 日韩欧美中文一区| 国内一区二区在线| 日本一区二区三区国色天香| 国产福利一区在线| 日本一区二区三区久久久久久久久不 | 精品日韩在线观看| 亚洲女人****多毛耸耸8| 91蝌蚪porny九色| 五月婷婷另类国产| 欧美日韩国产高清一区二区三区 | 91精品国产美女浴室洗澡无遮挡| 亚洲免费毛片网站| 99精品在线观看视频| 亚洲一区精品在线| 国产欧美1区2区3区| 99国产精品久久久久久久久久久| 一区二区三区欧美在线观看| 欧美va在线播放| 色综合一个色综合亚洲| 久久精品噜噜噜成人av农村| 日韩理论片网站| 欧美三级欧美一级| 成年人国产精品| 国产精品综合二区| 毛片av一区二区| 奇米影视一区二区三区小说| 中文字幕的久久| 精品国产亚洲在线| 日韩一级二级三级| 欧美日韩国产小视频在线观看| 国产精品亚洲一区二区三区在线| 亚洲欧洲www| 国产精品久久久久久久久免费樱桃| 中文字幕不卡在线观看| 99久久亚洲一区二区三区青草| 蜜桃91丨九色丨蝌蚪91桃色| 国产精品免费视频网站| 国产毛片精品国产一区二区三区| 一区二区三区四区高清精品免费观看 | 久久亚洲春色中文字幕久久久| 欧美四级电影在线观看| 丰满白嫩尤物一区二区| 国产成人免费视频| 9久草视频在线视频精品| 色菇凉天天综合网| 欧美日韩电影在线| 91极品美女在线| 欧美一区二区三区白人| 欧美成人一区二区三区片免费| 久久久精品黄色| 亚洲欧洲av另类| 亚洲成人www| 久久国产人妖系列| 97精品超碰一区二区三区| 欧美日韩久久久一区| 精品粉嫩aⅴ一区二区三区四区| 国产亚洲欧洲997久久综合| 精品国产乱码久久久久久牛牛 | 成人一区二区视频| 国产成人精品aa毛片| 在线成人午夜影院| 国产精品网站在线观看| 中文字幕巨乱亚洲| 蜜臀91精品一区二区三区| 日本韩国欧美在线| 国产亚洲制服色| 日本在线不卡视频一二三区| 94-欧美-setu| 欧美一区二区黄| 亚洲国产综合在线| 91在线视频免费观看| 欧美大胆人体bbbb| 日本成人在线网站| 欧美一区二区三区婷婷月色| 中文字幕日本不卡| 波多野结衣在线aⅴ中文字幕不卡| 日韩欧美国产小视频| 亚洲综合丝袜美腿| 91在线看国产| 亚洲素人一区二区| 欧美性做爰猛烈叫床潮| 一区二区在线观看视频| 国产福利不卡视频| 欧美激情一区三区| 99精品黄色片免费大全| 久久久亚洲午夜电影| 一区二区三区高清| 丁香六月综合激情| 精品国产乱码久久久久久蜜臀| 奇米888四色在线精品| 欧美婷婷六月丁香综合色| 亚洲欧美在线视频观看| 欧美亚洲日本一区| 激情五月婷婷综合| 日韩理论电影院| 欧美日韩国产色站一区二区三区| 无码av免费一区二区三区试看| 久久久久久久av麻豆果冻| 成人性色生活片| 曰韩精品一区二区| 5月丁香婷婷综合| 国内成人免费视频| 一区二区三区精品| 欧美精品一区二区精品网| 99久久精品免费精品国产| 香蕉影视欧美成人| 欧美大白屁股肥臀xxxxxx| 久久国产精品露脸对白| 一区二区三区四区高清精品免费观看| 在线不卡一区二区| 91久久一区二区| 国产·精品毛片| 国产在线播放一区| 精品亚洲成a人在线观看| 午夜精品一区二区三区免费视频| 亚洲精品一区二区三区在线观看| 91麻豆精品国产91久久久久| 五月天一区二区三区| 综合久久国产九一剧情麻豆| www欧美成人18+| 精品国产精品一区二区夜夜嗨| 欧美日韩成人综合| 欧美图片一区二区三区| 成人久久18免费网站麻豆| 成人在线一区二区三区| 久久激情五月婷婷| 国产乱码精品一品二品| 国产aⅴ综合色| 色爱区综合激月婷婷| 在线免费观看日本一区| youjizz久久| 欧美午夜精品电影| 精品视频免费在线| 精品国产露脸精彩对白| 精品国产乱码久久久久久老虎 | 香蕉久久一区二区不卡无毒影院| 亚洲一区自拍偷拍| 韩日精品视频一区| 91免费观看在线| 99精品视频中文字幕| 欧美系列在线观看| 久久久美女毛片 | 99热99精品| 91精品国产一区二区人妖| 久久久精品人体av艺术| 一区二区三区国产| 国产高清不卡一区二区| 91麻豆精品国产91久久久更新时间| 久久久久国产精品厨房| 婷婷综合在线观看| 国产精品一区二区在线看| 欧美色区777第一页| 久久先锋影音av鲁色资源网| 日韩一区有码在线| www精品美女久久久tv| 麻豆成人综合网| 99re热这里只有精品视频| 国产午夜亚洲精品午夜鲁丝片| 亚洲精品国产无天堂网2021| 国产乱码精品一区二区三| 日韩欧美一级精品久久| 午夜久久电影网| 99久久婷婷国产| 国产日本欧美一区二区| 午夜a成v人精品| 69堂国产成人免费视频| 亚洲图片自拍偷拍| 7777精品伊人久久久大香线蕉最新版| 国产喂奶挤奶一区二区三区| 天堂av在线一区| 337p亚洲精品色噜噜狠狠| 同产精品九九九| 久久女同性恋中文字幕| 99久久伊人网影院| 亚洲国产综合在线| 欧美精品一区二区三区视频| 青青草97国产精品免费观看| 久久综合视频网| 波多野结衣中文字幕一区| 亚洲一区在线免费观看| 欧美福利电影网| 国产a区久久久| 亚洲精品ww久久久久久p站| 欧洲中文字幕精品| 国产麻豆视频一区二区| 亚洲综合一二三区| 国产剧情一区二区| 一区二区欧美国产| 中文字幕二三区不卡|