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

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

?? ime.cpp

?? Windows CE 6.0 Word Application 源碼
?? CPP
?? 第 1 頁 / 共 5 頁
字號:

		DWORD				cpMin = psel->GetCpMin();
		DWORD				cpMax = psel->GetCpMost();
		const				CCharFormat	*pCF;
		LONG				iFormat;

		if (cpMin != cpMax)
		{
			// for selection, we need to get the character format at cpMin+1
			CTxtRange rg( &ed, cpMin+1, 0 );
			iFormat = rg.Get_iCF ();

			psel->Set_iCF( iFormat );
		}
		else
			iFormat = psel->Get_iCF ();

		// get current Char format
		pCF = ed.GetCharFormat(iFormat);
		ReleaseFormats(iFormat, -1);

 		// if current font is not set correctly,
		// change to a font preferred by current keyboard.
		if ( pCF && ((UINT)GetCodePage(pCF->bCharSet) != cp))
		{
			psel->CheckChangeFont ( &ed, TRUE, (WORD)GetKeyboardLCID(), cp );
		}
	}
	
	if (piFormat)
		*piFormat = psel ? psel->Get_iCF () : -1;
}

/*
 *	INT CIme::GetCompositionStringInfo( HIMC hIMC, DWORD dwIndex,
 *			  WCHAR *uniCompStr, INT cchMax, BYTE *attrib, INT cbAttrib
 *			  LONG cchAttrib )
 *
 *	@mfunc
 *		For WM_IME_COMPOSITION string processing to get the requested
 *		composition string, by type, and convert it to Unicode.
 *
 *	@devnote
 *		We must use ImmGetCompositionStringA because W is not supported
 *		on Win95.
 *		
 *	@rdesc
 *		INT-cch of the Unicode composition string.
 *		Out param in UniCompStr.
 */
INT CIme::GetCompositionStringInfo(
	HIMC hIMC,			// @parm IME context provided by host.
	DWORD dwIndex,		// @parm The type of composition string.
	WCHAR *uniCompStr,	// @parm Out param, unicode result string.
	INT   cchUniCompStr,// @parm The cch for the Out param.
	BYTE *pattrib,		// @parm Out param, If attribute info is needed.
	INT   cchAttrib,	// @parm The cch of the attribute info.
	LONG *pcursorCP,	// @parm Out param, returns the CP of cusor.
	LONG *pcchAttrib )	// @parm how many attributes returned.
{
	TRACEBEGIN(TRCSUBSYSFE, TRCSCOPEINTERN, "CIme::GetCompositionStringInfo");

    // Pay close attention to cbXXX v. cchXXX in this routine.  One
    // wrinkle:  The attributes returned are an array of BYTEs, one per
    // character in the string - so for pattrib cb==cch.

	BYTE				compStr[sizeof(WCHAR)*256], attribInfo[256];	// Fix for WinCEOS RAID #15245
	INT					j, cbUniCompStr, cbAttrib, cbCompStr, cchCompStr, cbAttribRet, cursor;

#ifndef PWD_JUPITER
	INT					i, iMax;
#endif // PWD_JUPITER

	Assert ( hIMC );
	Assert ( uniCompStr );
    Assert ( cchUniCompStr >= 0 );
    Assert ( !pattrib || cchAttrib >= 0 );

	if ( pcursorCP )								// Init cursor out param.
		*pcursorCP = -1;
	if ( pcchAttrib )
		*pcchAttrib = 0;

    cbUniCompStr = cchUniCompStr * sizeof(WCHAR);
    cbAttrib = cchAttrib * sizeof(WCHAR);
    cbAttribRet = -1;
													// Get composition string.

	cbCompStr = pImmGetCompositionString( hIMC, dwIndex, compStr, sizeof(compStr)-1 );	// Fix for WinCEOS RAID #15245
                    // (ImmGetCompositionString takes size of compStr
                    // in bytes even for Unicode, returns size in bytes)
	if ( cbCompStr > 0 )							// If valid data.
	{
        // GuyBark Jupiter:
        // ImmGetCompositionStringA() doesn't exist on the device. So use the
        // wide version of it, and don't do any of the mbcs->wide stuff here.

#ifndef PWD_JUPITER
        // Convert to unicode
		cchCompStr = UnicodeFromMbcs( uniCompStr, cchUniCompStr,
										(CHAR *) compStr, cbCompStr );
#else
        // We already have the unicode string.
        memcpy((LPBYTE)uniCompStr, (LPBYTE)compStr, min(cbUniCompStr,min(cbCompStr, (INT)(sizeof(WCHAR)*256))));

        // Return number of characters.
        cchCompStr = cbCompStr / sizeof(WCHAR);

#endif // PWD_JUPITER

		if ( pattrib || pcursorCP )					// Need cursor or attribs?
		{
													// Get DBCS Cursor cp.
			cursor = pImmGetCompositionString( hIMC, GCS_CURSORPOS, NULL, 0 );

            if ( pattrib )
            {
                                                    // Get DBCS attributes.
                cbAttribRet = pImmGetCompositionString( hIMC, GCS_COMPATTR,
                                                        attribInfo, 255 );
            }

        // GuyBark Jupiter:
        // ImmGetCompositionStringA() doesn't exist on the device. So use the
        // wide version of it, and don't do any of the mbcs->wide stuff here.
#ifndef PWD_JUPITER
													// MultiToWide conversion.
			iMax = max ( cursor, cbAttribRet );
			if ( NULL == pattrib )
                cbAttrib = cbAttribRet;
			for (i = 0, j = 0; i <= iMax && j < cbAttrib; i++, j++ )
			{
				if ( cursor == i )					// Cursor from DBCS.
					cursor = j;

				if ( IsDBCSLeadByte( compStr[i] ) )
					i++;

                // shouldn't this be j instead of i??
				if ( pattrib && i < cbAttribRet )		// Attrib from DBCS.
					*pattrib++ = attribInfo[i];
			}
            j--;                                    // back off from last byte
                                                    // attrib cch==unicode cch
			Assert ( 0 >= cbAttribRet || j == cchCompStr );   // ??
#else
            // Return attribute array.
            if ( pattrib )
            {
                if ( cbAttribRet >= 0)
                {
                    j = min(cbAttribRet, min(cbAttrib,256));
                    memcpy(pattrib, attribInfo, j);
                }
            }
#endif // PWD_JUPITER

			if ( cursor >= 0 && pcursorCP  )			// If client needs cursor
				*pcursorCP = cursor;					//  or pcchAttrib.
			if ( cbAttribRet >= 0 && pcchAttrib )
				*pcchAttrib = j;
		}
	}
	else
	{
		if ( pcursorCP  )			
			*pcursorCP = 0;
		cchCompStr = 0;
	}

	return cchCompStr;
}

/*
 *	void CIme::SetCompositionFont ( CTxtEdit &ed, BOOL *pbUnderLineMode )
 *
 *	@mfunc
 *		Important for level 2 IME so that the composition window
 *		has the correct font. The lfw to lfa copy is due to the fact that
 *		Win95 does not support the W)ide call.
 *		It is also important for both level 2 and level 3 IME so that
 *		the candidate list window has the proper. font.
 */
void CIme::SetCompositionFont (
	CTxtEdit &ed, 		 		// @parm the containing text edit.
	BOOL	 *pbUnderLineMode)	// @parm the original char Underline mode
{
	TRACEBEGIN(TRCSUBSYSFE, TRCSCOPEINTERN, "CIme::SetCompositionFont" );
													
#ifndef MACPORT
	
	HIMC 				hIMC = ed.TxImmGetContext();// Get host's IME context.

	CTxtSelection		*psel;						// Selection.

	HDC					hdc;
	CCcs				*pccs;						// Font cache.
	LOGFONTW			lfw;
#ifndef PWD_JUPITER
	LOGFONTA			lfa;
#endif // PWD_JUPITER

	if ( hIMC )
	{												
		hdc 	= ed.TxGetDC();					
		if ( hdc )									//  the selection.
		{
			psel	= ed.GetSel();					// Get the font cache for
			if ( psel )
			{
				const	CCharFormat	*pCF;
				
				pCF = ed.GetCharFormat(_iFormatSave);

				if ( pCF )
				{
					BOOL	bFontOK = TRUE;

					if ( !ed.IsRich())
					{
						// We haven't done any font matching for plain text control,
						// check if this font maches current keyboard codepage.
						// If they don't match, we don't want to call ImmSetCompositionFont
						// or else the Candidate list will show garbage.
						if ( (UINT)GetCodePage(pCF->bCharSet) != GetKeyboardCodePage() )
							bFontOK = FALSE;
					}

					if ( bFontOK )
					{
#ifdef PWD_JUPITER
                        // GuyBark: Make sure the candidate window is displaying a J font.
                        CCharFormat CFj;

                        memcpy(&CFj, pCF, sizeof(CCharFormat));
                        CFj.bCharSet = GetCharSet(GetKeyboardCodePage());

                        pccs = fc().GetCcs(hdc, &CFj, ed._pdp->GetZoomNumerator(),
                            ed._pdp->GetZoomDenominator(), GetDeviceCaps(hdc, LOGPIXELSY));
#else
						pccs = fc().GetCcs(hdc, pCF, ed._pdp->GetZoomNumerator(),
							ed._pdp->GetZoomDenominator(), GetDeviceCaps(hdc, LOGPIXELSY));
#endif // PWD_JUPITER

						if( pccs )							// If font cache exist...
						{		
							lfw = pccs->_lf;				// Note: W to A copy.

                            // GuyBark: On the device, there is no ansi version of ImmSetCompositionFont().
#ifndef PWD_JUPITER
							memcpy(&lfa, &lfw, sizeof(lfa) - sizeof(lfa.lfFaceName));
	    					MbcsFromUnicode(
	    						lfa.lfFaceName, sizeof(lfa.lfFaceName), lfw.lfFaceName,
								-1, CP_ACP, UN_NOOBJECTS);

							// WinCE RAID #7183 fix.
							if(_imeLevel != IME_LEVEL_3){
							pImmSetCompositionFont( hIMC, &lfa );	
							}
#else
							// WinCE RAID #7183 fix.
							if(_imeLevel != IME_LEVEL_3){
							pImmSetCompositionFont( hIMC, &lfw );	
							}
#endif
							pccs->Release();
						}
					}

					if (pbUnderLineMode)
					{
						*pbUnderLineMode = (pCF->dwEffects & CFE_UNDERLINE);
					}
				}
			}
			ed.TxReleaseDC( hdc );
		}

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

/*
 *	void CIme::SetCompositionForm ( CTxtEdit &ed )
 *
 *	@mfunc
 *		Important for level 2 IME so that the composition window
 *		is positioned correctly.
 *
 *	@comm
 *		We go through a lot of work to get the correct height. This requires
 *		getting information from the font cache and the selection.
 */
void CIme::SetCompositionForm (
	CTxtEdit &ed )	   	// @parm the containing text edit.
{
	TRACEBEGIN(TRCSUBSYSFE, TRCSCOPEINTERN, "CIme::SetCompositionForm" );
													
#ifndef MACPORT
	HIMC 				hIMC;

	CTxtSelection		*psel;						// Selection.

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

	COMPOSITIONFORM		cf;
	RECT				rcInset;

	
	if ( IME_LEVEL_2 == GetIMELevel() )
	{
		hIMC = ed.TxImmGetContext();				// Get host's IME context.
		
		if ( hIMC )
		{												
			psel	= ed.GetSel();					// Get the font cache for

			if (NULL == psel)
			{
			    AssertSz(psel, "Memory allocation eror in CIme::SetCompositionForm");
			    return;
			}    

			hdc 	= ed.TxGetDC();					
			if ( hdc )								//  the selection.
			{
				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));
				}
				ed.TxReleaseDC( hdc );
			}

			// 1st line starts at caret
			if ( GetCaretPos( &cf.ptCurrentPos ) == FALSE
				|| cf.ptCurrentPos.x < 0  || cf.ptCurrentPos.y < 0 )
			{
				// Update the caret since the current caret is not visible
				if ( ed.fInplaceActive() )
				{	
					psel->UpdateCaret(TRUE);		// To force a scroll
					GetCaretPos( &cf.ptCurrentPos );
				}
			}

			if( pccs )								// If font cache exist...
			{										// Finer caret adjustment.
				if ( psel->GetCurrentDescent() >= 0 && psel->GetCaretHt() > 1 )
				{
					// Adjusted for the different in descents between current
					//  selected font and the current character.
					cf.ptCurrentPos.y += psel->GetCaretHt()
						+ (  pccs->_yDescent - psel->GetCurrentDescent()
						   - pccs->_yHeight );
				}
				pccs->Release();
			}

			// Bounding rect for the IME (lev 2) composition window, causing
			//  composition text to be wrapped within it.
			cf.dwStyle = CFS_RECT;
			ed.TxGetClientRect( &cf.rcArea );		// Set-up bounding rect.
			ed.TxGetViewInset( &rcInset, NULL );
			cf.rcArea.right 	-= rcInset.right;
			cf.rcArea.bottom 	-= rcInset.bottom;
			cf.rcArea.left 		+= rcInset.left;
			cf.rcArea.top 		+= rcInset.top;

			// Make sure the starting point is not
			// outside the rcArea.  This happens when
			// there is no text on the current line and the user
			// has selected a large font size.
			if (cf.ptCurrentPos.y < cf.rcArea.top)
				cf.ptCurrentPos.y = cf.rcArea.top;
			else if (cf.ptCurrentPos.y > cf.rcArea.bottom)
				cf.ptCurrentPos.y = cf.rcArea.bottom;

			if (cf.ptCurrentPos.x < cf.rcArea.left)
				cf.ptCurrentPos.x = cf.rcArea.left;
			else if (cf.ptCurrentPos.x > cf.rcArea.right)
				cf.ptCurrentPos.x = cf.rcArea.right;

			pImmSetCompositionWindow( hIMC, &cf );	// Set composition window.

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



/*
 *
 *	CIme::TerminateIMEComposition ( CTxtEdit &ed )
 *
 *	@mfunc	Terminate the IME Composition mode using CPS_COMPLETE
 *	@comm	The IME will generate WM_IME_COMPOSITION with the result string
 *
 */
void CIme::TerminateIMEComposition(
	CTxtEdit &ed, 			// @parm the containing text edit.
	TerminateMode mode)
{
	TRACEBEGIN(TRCSUBSYSFE, TRCSCOPEINTERN, "CIme::TerminateIMEComposition");
	DWORD dwTerminateMethod;

	HIMC hIMC = ed.TxImmGetContext();

	dwTerminateMethod = CPS_COMPLETE;
	if ( IME_LEVEL_2 == GetIMELevel()		// force cancel for near-caret IME
		 || mode == TERMINATE_FORCECANCEL	// caller wants force cancel
		 || ed._fIMECancelComplete )		// Client wants force cancel
	{
		dwTerminateMethod = CPS_CANCEL;
	}
	
	// force the IME to terminate the current session
	if (hIMC)
	{
		BOOL retCode;

		retCode = pImmNotifyIME( hIMC, NI_COMPOSITIONSTR,
			dwTerminateMethod, 0);
		
		if ( !retCode && !ed._fIMECancelComplete )
		{
			// CPS_COMPLETE fail, try CPS_CANCEL.  This happen with some ime which do not support
			// CPS_COMPLETE option (e.g. ABC IME version 4 with Win95 simplified Chinese)
			retCode = pImmNotifyIME( hIMC, NI_COMPOSITIONSTR, CPS_CANCEL, 0);

		}
		

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
91久久精品日日躁夜夜躁欧美| 亚洲第一福利一区| 色天天综合色天天久久| 欧美在线高清视频| 91精品在线一区二区| 欧美体内she精视频| 午夜国产不卡在线观看视频| 欧美色涩在线第一页| 国产精品888| 制服视频三区第一页精品| 一区二区三区四区高清精品免费观看 | 久久成人免费日本黄色| 国产在线精品一区二区夜色| 欧美一区二区三区成人| 中文字幕乱码久久午夜不卡 | 亚洲国产精品影院| 国产高清成人在线| 国产精品国产精品国产专区不蜜| 日韩精品电影在线观看| av日韩在线网站| 中文字幕一区av| 91在线视频播放地址| 国产视频一区二区在线观看| 免费成人在线观看视频| 欧美日本一区二区三区四区| 国产乱码精品一区二区三区av| 日韩免费高清电影| 一区二区免费在线| 色噜噜狠狠成人网p站| 一区二区三区久久| 欧美一级理论性理论a| 亚洲视频网在线直播| 91在线观看污| 亚洲精品乱码久久久久久日本蜜臀| 极品销魂美女一区二区三区| 日韩欧美黄色影院| 久久精品国产亚洲a| 久久久夜色精品亚洲| 久久久久久亚洲综合| 成人免费高清视频| 亚洲日本青草视频在线怡红院| 成人av手机在线观看| 一区二区三区在线视频观看58| 成人av影视在线观看| 亚洲视频在线一区| 91精品在线观看入口| 波多野结衣中文字幕一区| 一区二区三区日韩| 欧美日韩久久一区二区| 久久91精品国产91久久小草| 亚洲伦理在线精品| 久久久久久一二三区| 亚洲免费av高清| 欧美日韩亚洲国产综合| 玖玖九九国产精品| 综合婷婷亚洲小说| 久久亚洲捆绑美女| 日韩欧美中文字幕精品| 国产精品亚洲第一区在线暖暖韩国| 亚洲一区自拍偷拍| 国产精品国产自产拍高清av| 欧美激情中文不卡| 日韩视频一区二区三区在线播放| 99精品偷自拍| 成人午夜视频在线| 国产成人av电影在线播放| 高清shemale亚洲人妖| 欧美亚洲精品一区| av一区二区三区黑人| 成人污污视频在线观看| 激情综合色综合久久| 美女视频网站黄色亚洲| 精品一区二区综合| 成人av在线资源网站| 成人aa视频在线观看| 日本电影亚洲天堂一区| 9191久久久久久久久久久| 日韩三级在线免费观看| 国产精品网站在线观看| 亚洲视频一区在线| av中文字幕不卡| 亚洲va天堂va国产va久| 精品亚洲porn| 成人高清免费观看| 欧美性感一类影片在线播放| 欧美电视剧在线看免费| 亚洲欧美日韩中文字幕一区二区三区 | 欧美精品在线观看播放| 26uuu亚洲综合色欧美| 亚洲女人****多毛耸耸8| 欧美a级一区二区| 99久久99久久精品免费看蜜桃 | 亚洲影视在线播放| 九色综合国产一区二区三区| 99久久国产综合色|国产精品| 91麻豆精品国产91| 久久久久久久久久久电影| 午夜不卡av在线| 色综合久久久久久久久| 国产欧美精品一区aⅴ影院| 日本最新不卡在线| 91国产成人在线| 亚洲女爱视频在线| av一区二区三区黑人| 欧美大片国产精品| 91啪亚洲精品| 亚洲欧美一区二区三区国产精品| 奇米色777欧美一区二区| 日韩电影免费在线看| 国产一区二区不卡| 日韩久久久久久| 美女网站一区二区| 在线免费观看日韩欧美| 亚洲欧美自拍偷拍| 成人av第一页| 亚洲欧美一区二区三区孕妇| av在线播放不卡| 一区二区三区不卡视频在线观看| av一区二区三区在线| 麻豆91精品视频| 日本一区二区视频在线观看| 亚洲成av人片一区二区三区| 91丝袜国产在线播放| 亚洲一区二区三区美女| 精品久久久久久久久久久久包黑料 | 亚洲高清免费视频| 日韩精品一区二区在线观看| av网站免费线看精品| 日本免费新一区视频 | 日本高清成人免费播放| 热久久国产精品| 26uuu成人网一区二区三区| 久久精品亚洲精品国产欧美kt∨ | 在线日韩av片| 国产美女久久久久| 亚洲一区中文在线| 久久精品日产第一区二区三区高清版| 91蜜桃视频在线| 大尺度一区二区| 理论片日本一区| 日韩精品电影在线观看| 亚洲一区二区三区在线| 成人欧美一区二区三区小说| 精品欧美一区二区三区精品久久| 99免费精品视频| 成人av在线电影| 粉嫩av一区二区三区在线播放| 日本午夜一区二区| 亚洲一区二区三区视频在线| 精品国偷自产国产一区| 91精品综合久久久久久| 欧美日韩精品欧美日韩精品| 欧美性色综合网| 欧洲人成人精品| 欧美亚洲综合在线| 欧美日韩国产美女| 日韩免费视频一区| 欧美r级电影在线观看| 久久综合久久鬼色中文字| 久久综合网色—综合色88| 精品国产伦理网| 国产欧美精品一区aⅴ影院| 国产精品免费人成网站| 亚洲女同一区二区| 图片区小说区国产精品视频| 日韩成人精品在线| 午夜精品福利视频网站| 日本午夜一本久久久综合| 亚洲精品免费一二三区| 日韩一二在线观看| 久久免费美女视频| 欧美极品美女视频| 国产精品久久久久久久久免费樱桃 | 亚洲欧洲国产日本综合| 一区二区三区精品视频| 久久精品99久久久| 91在线观看美女| 精品国产一区二区亚洲人成毛片| 一区免费观看视频| 蜜桃视频第一区免费观看| 国产99久久久久久免费看农村| 在线视频国产一区| 3d动漫精品啪啪1区2区免费| 国产精品嫩草久久久久| 久久se这里有精品| 欧洲视频一区二区| 国产精品美女一区二区| 精品一区二区三区久久| 色综合色综合色综合色综合色综合 | 国产一区二区免费看| 色999日韩国产欧美一区二区| www国产成人| 精品一区二区免费在线观看| 91精品国产丝袜白色高跟鞋| 一区二区三区四区不卡视频| av色综合久久天堂av综合| 中文字幕精品—区二区四季| 麻豆精品新av中文字幕| 欧美人与性动xxxx| 午夜久久久久久电影|