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

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

?? bidiutil.java

?? 源碼為Eclipse開源開發平臺桌面開發工具SWT的源代碼,
?? JAVA
?? 第 1 頁 / 共 2 頁
字號:
/******************************************************************************* * Copyright (c) 2000, 2004 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.internal;import java.util.Hashtable;import org.eclipse.swt.SWT;import org.eclipse.swt.graphics.GC;import org.eclipse.swt.internal.win32.*;/* * Wraps Win32 API used to bidi enable the StyledText widget. */public class BidiUtil {	// Keyboard language ids	public static final int KEYBOARD_NON_BIDI = 0;	public static final int KEYBOARD_BIDI = 1;	// bidi flag	static int isBidiPlatform = -1;	// getRenderInfo flag values	public static final int CLASSIN = 1;	public static final int LINKBEFORE = 2;	public static final int LINKAFTER = 4;	// variables used for providing a listener mechanism for keyboard language 	// switching 	static Hashtable languageMap = new Hashtable ();	static Hashtable keyMap = new Hashtable ();	static Hashtable oldProcMap = new Hashtable ();	/*	 * This code is intentionally commented.  In order	 * to support CLDC, .class cannot be used because	 * it does not compile on some Java compilers when	 * they are targeted for CLDC.	 */	//	static Callback callback = new Callback (BidiUtil.class, "windowProc", 4);	static final String CLASS_NAME = "org.eclipse.swt.internal.BidiUtil";	static Callback callback;	static {		try {			callback = new Callback (Class.forName (CLASS_NAME), "windowProc", 4);		} catch (ClassNotFoundException e) {}	}	// GetCharacterPlacement constants	static final int GCP_REORDER = 0x0002;	static final int GCP_GLYPHSHAPE = 0x0010;	static final int GCP_LIGATE = 0x0020;	static final int GCP_CLASSIN = 0x00080000;	static final byte GCPCLASS_ARABIC = 2;	static final byte GCPCLASS_HEBREW = 2;		static final byte GCPCLASS_LOCALNUMBER = 4;	static final byte GCPCLASS_LATINNUMBER = 5;	static final int GCPGLYPH_LINKBEFORE = 0x8000;	static final int GCPGLYPH_LINKAFTER = 0x4000;	// ExtTextOut constants	static final int ETO_CLIPPED = 0x4;	static final int ETO_GLYPH_INDEX = 0x0010;	// Windows primary language identifiers	static final int LANG_ARABIC = 0x01;	static final int LANG_HEBREW = 0x0d;	// code page identifiers	static final String CD_PG_HEBREW = "1255";	static final String CD_PG_ARABIC = "1256";	// ActivateKeyboard constants	static final int HKL_NEXT = 1;	static final int HKL_PREV = 0;	/*	 * Public character class constants are the same as Windows 	 * platform constants. 	 * Saves conversion of class array in getRenderInfo to arbitrary 	 * constants for now.	 */	public static final int CLASS_HEBREW = GCPCLASS_ARABIC;	public static final int CLASS_ARABIC = GCPCLASS_HEBREW;	public static final int CLASS_LOCALNUMBER = GCPCLASS_LOCALNUMBER;	public static final int CLASS_LATINNUMBER = GCPCLASS_LATINNUMBER;	public static final int REORDER = GCP_REORDER;					public static final int LIGATE = GCP_LIGATE;	public static final int GLYPHSHAPE = GCP_GLYPHSHAPE;/** * Adds a language listener. The listener will get notified when the language of * the keyboard changes (via Alt-Shift on Win platforms).  Do this by creating a  * window proc for the Control so that the window messages for the Control can be * monitored. * <p> * * @param hwnd the handle of the Control that is listening for keyboard language  *  changes * @param runnable the code that should be executed when a keyboard language change *  occurs */public static void addLanguageListener (int hwnd, Runnable runnable) {	languageMap.put(new Integer(hwnd), runnable);	subclass(hwnd);}/** * Proc used for OS.EnumSystemLanguageGroups call during isBidiPlatform test. */static int EnumSystemLanguageGroupsProc(int lpLangGrpId, int lpLangGrpIdString, int lpLangGrpName, int options, int lParam) {	if (lpLangGrpId == OS.LGRPID_HEBREW) {		isBidiPlatform = 1;		return 0;	}	if (lpLangGrpId == OS.LGRPID_ARABIC) {		isBidiPlatform = 1;		return 0;	}	return 1;} /** * Wraps the ExtTextOut function. * <p> * * @param gc the gc to use for rendering * @param renderBuffer the glyphs to render as an array of characters * @param renderDx the width of each glyph in renderBuffer * @param x x position to start rendering * @param y y position to start rendering */public static void drawGlyphs(GC gc, char[] renderBuffer, int[] renderDx, int x, int y) {	int length = renderDx.length;		if (!OS.IsWinCE && (OS.WIN32_MAJOR << 16 | OS.WIN32_MINOR) >= (4 << 16 | 10)) {		if (OS.GetLayout (gc.handle) != 0) {			reverse(renderDx);			renderDx[length-1]--;               //fixes bug 40006			reverse(renderBuffer);		}	}		// render transparently to avoid overlapping segments. fixes bug 40006	int oldBkMode = OS.SetBkMode(gc.handle, OS.TRANSPARENT);	OS.ExtTextOutW(gc.handle, x, y, ETO_GLYPH_INDEX , null, renderBuffer, renderBuffer.length, renderDx);	OS.SetBkMode(gc.handle, oldBkMode);}/** * Return ordering and rendering information for the given text.  Wraps the GetFontLanguageInfo * and GetCharacterPlacement functions. * <p> *  * @param gc the GC to use for measuring of this line, input parameter * @param text text that bidi data should be calculated for, input parameter * @param order an array of integers representing the visual position of each character in *  the text array, output parameter * @param classBuffer an array of integers representing the type (e.g., ARABIC, HEBREW,  *  LOCALNUMBER) of each character in the text array, input/output parameter * @param dx an array of integers representing the pixel width of each glyph in the returned *  glyph buffer, output paramteter * @param flags an integer representing rendering flag information, input parameter * @param offsets text segments that should be measured and reordered separately, input  *  parameter. See org.eclipse.swt.custom.BidiSegmentEvent for details. * @return buffer with the glyphs that should be rendered for the given text */public static char[] getRenderInfo(GC gc, String text, int[] order, byte[] classBuffer, int[] dx, int flags, int [] offsets) {	int fontLanguageInfo = OS.GetFontLanguageInfo(gc.handle);	int hHeap = OS.GetProcessHeap();	int[] lpCs = new int[8];	int cs = OS.GetTextCharset(gc.handle);	boolean isRightOriented = false;	if (!OS.IsWinCE && (OS.WIN32_MAJOR << 16 | OS.WIN32_MINOR) >= (4 << 16 | 10)) {		isRightOriented = OS.GetLayout(gc.handle) != 0;	} 	OS.TranslateCharsetInfo(cs, lpCs, OS.TCI_SRCCHARSET);	TCHAR textBuffer = new TCHAR(lpCs[1], text, false);	int byteCount = textBuffer.length();	boolean linkBefore = (flags & LINKBEFORE) == LINKBEFORE;	boolean linkAfter = (flags & LINKAFTER) == LINKAFTER;	GCP_RESULTS result = new GCP_RESULTS();	result.lStructSize = GCP_RESULTS.sizeof;	result.nGlyphs = byteCount;	int lpOrder = result.lpOrder = OS.HeapAlloc(hHeap, OS.HEAP_ZERO_MEMORY, byteCount * 4);	int lpDx = result.lpDx = OS.HeapAlloc(hHeap, OS.HEAP_ZERO_MEMORY, byteCount * 4);	int lpClass = result.lpClass = OS.HeapAlloc(hHeap, OS.HEAP_ZERO_MEMORY, byteCount);	int lpGlyphs = result.lpGlyphs = OS.HeapAlloc(hHeap, OS.HEAP_ZERO_MEMORY, byteCount * 2);	// set required dwFlags	int dwFlags = 0;	int glyphFlags = 0;	// Always reorder.  We assume that if we are calling this function we're	// on a platform that supports bidi.  Fixes 20690.	dwFlags |= GCP_REORDER;	if ((fontLanguageInfo & GCP_LIGATE) == GCP_LIGATE) {		dwFlags |= GCP_LIGATE;		glyphFlags |= 0;	}	if ((fontLanguageInfo & GCP_GLYPHSHAPE) == GCP_GLYPHSHAPE) {		dwFlags |= GCP_GLYPHSHAPE;		if (linkBefore) {			glyphFlags |= GCPGLYPH_LINKBEFORE;		}		if (linkAfter) {			glyphFlags |= GCPGLYPH_LINKAFTER;		}	}	byte[] lpGlyphs2;	if (linkBefore || linkAfter) {		lpGlyphs2 = new byte[2];		lpGlyphs2[0]=(byte)glyphFlags;		lpGlyphs2[1]=(byte)(glyphFlags >> 8);	}	else {		lpGlyphs2 = new byte[] {(byte) glyphFlags};	}	OS.MoveMemory(result.lpGlyphs, lpGlyphs2, lpGlyphs2.length);	if ((flags & CLASSIN) == CLASSIN) {		// set classification values for the substring		dwFlags |= GCP_CLASSIN;		OS.MoveMemory(result.lpClass, classBuffer, classBuffer.length);	}	char[] glyphBuffer = new char[result.nGlyphs];	int glyphCount = 0;	for (int i=0; i<offsets.length-1; i++) {		int offset = offsets [i];		int length = offsets [i+1] - offsets [i];		// The number of glyphs expected is <= length (segment length);		// the actual number returned may be less in case of Arabic ligatures.		result.nGlyphs = length;		TCHAR textBuffer2 = new TCHAR(lpCs[1], text.substring(offset, offset + length), false);		OS.GetCharacterPlacement(gc.handle, textBuffer2, textBuffer2.length(), 0, result, dwFlags);		if (dx != null) {			int [] dx2 = new int [result.nGlyphs];			OS.MoveMemory(dx2, result.lpDx, dx2.length * 4);			if (isRightOriented) { 				reverse(dx2);			} 			System.arraycopy (dx2, 0, dx, glyphCount, dx2.length);		}		if (order != null) {			int [] order2 = new int [length];			OS.MoveMemory(order2, result.lpOrder, order2.length * 4);			translateOrder(order2, glyphCount, isRightOriented);			System.arraycopy (order2, 0, order, offset, length);		}		if (classBuffer != null) {			byte [] classBuffer2 = new byte [length];			OS.MoveMemory(classBuffer2, result.lpClass, classBuffer2.length);			System.arraycopy (classBuffer2, 0, classBuffer, offset, length);		}		char[] glyphBuffer2 = new char[result.nGlyphs];		OS.MoveMemory(glyphBuffer2, result.lpGlyphs, glyphBuffer2.length * 2);		if (isRightOriented) {			reverse(glyphBuffer2);		} 		System.arraycopy (glyphBuffer2, 0, glyphBuffer, glyphCount, glyphBuffer2.length);		glyphCount += glyphBuffer2.length;		// We concatenate successive results of calls to GCP.		// For Arabic, it is the only good method since the number of output		// glyphs might be less than the number of input characters.		// This assumes that the whole line is built by successive adjacent		// segments without overlapping.		result.lpOrder += length * 4;		result.lpDx += length * 4;		result.lpClass += length;		result.lpGlyphs += glyphBuffer2.length * 2;	}	/* Free the memory that was allocated. */	OS.HeapFree(hHeap, 0, lpGlyphs);	OS.HeapFree(hHeap, 0, lpClass);	OS.HeapFree(hHeap, 0, lpDx);	OS.HeapFree(hHeap, 0, lpOrder);	return glyphBuffer;}/** * Return bidi ordering information for the given text.  Does not return rendering  * information (e.g., glyphs, glyph distances).  Use this method when you only need  * ordering information.  Doing so will improve performance.  Wraps the  * GetFontLanguageInfo and GetCharacterPlacement functions. * <p> *  * @param gc the GC to use for measuring of this line, input parameter * @param text text that bidi data should be calculated for, input parameter * @param order an array of integers representing the visual position of each character in *  the text array, output parameter * @param classBuffer an array of integers representing the type (e.g., ARABIC, HEBREW,  *  LOCALNUMBER) of each character in the text array, input/output parameter * @param flags an integer representing rendering flag information, input parameter * @param offsets text segments that should be measured and reordered separately, input  *  parameter. See org.eclipse.swt.custom.BidiSegmentEvent for details. */public static void getOrderInfo(GC gc, String text, int[] order, byte[] classBuffer, int flags, int [] offsets) {	int fontLanguageInfo = OS.GetFontLanguageInfo(gc.handle);	int hHeap = OS.GetProcessHeap();	int[] lpCs = new int[8];	int cs = OS.GetTextCharset(gc.handle);	OS.TranslateCharsetInfo(cs, lpCs, OS.TCI_SRCCHARSET);	TCHAR textBuffer = new TCHAR(lpCs[1], text, false);	int byteCount = textBuffer.length();	boolean isRightOriented = false;	if (!OS.IsWinCE && (OS.WIN32_MAJOR << 16 | OS.WIN32_MINOR) >= (4 << 16 | 10)) {		isRightOriented = OS.GetLayout(gc.handle) != 0;	} 	GCP_RESULTS result = new GCP_RESULTS();	result.lStructSize = GCP_RESULTS.sizeof;	result.nGlyphs = byteCount;	int lpOrder = result.lpOrder = OS.HeapAlloc(hHeap, OS.HEAP_ZERO_MEMORY, byteCount * 4);	int lpClass = result.lpClass = OS.HeapAlloc(hHeap, OS.HEAP_ZERO_MEMORY, byteCount);	// set required dwFlags, these values will affect how the text gets rendered and	// ordered	int dwFlags = 0;	// Always reorder.  We assume that if we are calling this function we're	// on a platform that supports bidi.  Fixes 20690.	dwFlags |= GCP_REORDER;	if ((fontLanguageInfo & GCP_LIGATE) == GCP_LIGATE) {		dwFlags |= GCP_LIGATE;

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
色综合色狠狠天天综合色| 久久久久97国产精华液好用吗| 91精品国产一区二区| 久久久久久久精| 亚洲国产欧美在线| www.久久久久久久久| 欧美一区二区日韩一区二区| 亚洲人成精品久久久久| 国内外成人在线| 在线成人免费观看| 一区二区三区波多野结衣在线观看| 国产综合久久久久影院| 欧美人体做爰大胆视频| 亚洲精品免费播放| 成人app网站| 久久精品欧美日韩| 麻豆精品国产91久久久久久| 欧美精品自拍偷拍| 亚洲国产一区二区三区青草影视| 成人美女在线观看| 欧美激情在线看| 国产一区二区三区av电影| 日韩丝袜情趣美女图片| 日韩高清欧美激情| 欧美二区在线观看| 五月激情综合网| 欧美疯狂性受xxxxx喷水图片| 亚洲综合清纯丝袜自拍| 欧美羞羞免费网站| 亚洲日韩欧美一区二区在线| 高清免费成人av| 中文字幕精品一区二区三区精品| 国产乱色国产精品免费视频| 久久久久久久久99精品| 国产+成+人+亚洲欧洲自线| 久久精品人人做| 成人免费精品视频| ...av二区三区久久精品| 91在线视频官网| 怡红院av一区二区三区| 欧美在线免费观看视频| 午夜精品一区在线观看| 日韩一区二区麻豆国产| 国产资源精品在线观看| 中文字幕巨乱亚洲| 在线影视一区二区三区| 亚洲成人免费在线观看| 日韩欧美在线综合网| 国模无码大尺度一区二区三区| 久久久综合网站| 色综合一区二区三区| 亚洲国产你懂的| 欧美va日韩va| 不卡视频在线看| 亚洲成人免费视频| 亚洲精品在线免费观看视频| 波多野结衣91| 亚洲午夜视频在线观看| 亚洲精品一区在线观看| 91视频免费观看| 久久精品国内一区二区三区| 中文一区在线播放| 欧美日韩不卡在线| 国产盗摄一区二区三区| 亚洲第一av色| 久久久久久亚洲综合| 欧美在线999| 国产自产视频一区二区三区| 亚洲激情第一区| 日韩精品专区在线影院重磅| av午夜一区麻豆| 日韩高清在线观看| 国产精品国产三级国产普通话蜜臀| 欧美视频一区在线| 国产精品香蕉一区二区三区| 亚洲一区欧美一区| 国产丝袜美腿一区二区三区| 91成人看片片| 高清成人免费视频| 日韩不卡一区二区| 亚洲精品免费一二三区| 久久午夜免费电影| 欧美日韩成人综合在线一区二区| 国产成人高清视频| 久久不见久久见免费视频1| 亚洲丝袜美腿综合| 久久精品欧美日韩精品| 欧美一个色资源| 欧美三级一区二区| 91在线小视频| 成人午夜视频在线观看| 另类调教123区| 亚洲国产一区二区视频| 亚洲丝袜另类动漫二区| 国产欧美久久久精品影院| 欧美一级淫片007| 欧美亚洲国产bt| 色天使色偷偷av一区二区| 国产成人免费av在线| 精品一区二区三区久久| 男人的j进女人的j一区| 亚洲成va人在线观看| 亚洲国产一区二区视频| 亚洲综合激情网| 一区二区在线观看视频在线观看| 中文字幕欧美三区| 日本一区二区视频在线| 久久久久久久久免费| 欧美成人激情免费网| 日韩女同互慰一区二区| 日韩限制级电影在线观看| 欧美丰满少妇xxxbbb| 欧美精品v国产精品v日韩精品| 欧美日韩三级视频| 欧美日韩www| 欧美一区二区三区思思人| 欧美精品一级二级| 欧美一区二区精品| 欧美不卡一二三| 久久综合色天天久久综合图片| 欧美精品一区二区三区在线播放| 日韩一区和二区| 欧美精品一区二区在线观看| 久久综合九色欧美综合狠狠| 久久精品亚洲麻豆av一区二区| 国产亚洲综合在线| 1区2区3区国产精品| 一区二区三区久久久| 三级不卡在线观看| 久久91精品国产91久久小草| 国产精品亚洲一区二区三区妖精| 国产91在线|亚洲| 成人国产精品免费观看| 一本一本大道香蕉久在线精品| 欧美亚洲动漫精品| 精品国产亚洲在线| 中文字幕不卡的av| 一区二区三区影院| 免费高清在线一区| 国产sm精品调教视频网站| www.在线欧美| 91国产丝袜在线播放| 日韩午夜激情av| 国产精品久久久久一区二区三区 | 日本一区二区免费在线观看视频| 欧美不卡123| 国产精品视频观看| 亚洲成年人网站在线观看| 黄色日韩网站视频| 91亚洲精品久久久蜜桃| 欧美电影一区二区三区| 国产亚洲午夜高清国产拍精品| 亚洲精品精品亚洲| 久久99最新地址| 91色视频在线| 精品久久久久99| 一区二区三区中文在线| 久久99精品久久久久久国产越南| 成人激情动漫在线观看| 欧美日韩精品一区二区天天拍小说| 2017欧美狠狠色| 亚洲图片欧美色图| 国产河南妇女毛片精品久久久| 91麻豆自制传媒国产之光| 91精品国产色综合久久不卡电影| 国产亲近乱来精品视频| 日本欧洲一区二区| 99精品1区2区| 久久久久久久精| 污片在线观看一区二区| 暴力调教一区二区三区| 精品电影一区二区| 午夜国产精品一区| 色婷婷av久久久久久久| 国产日韩一级二级三级| 人禽交欧美网站| 91黄色在线观看| 国产精品不卡在线观看| 捆绑变态av一区二区三区| 欧美日本在线视频| 一区二区三区四区在线播放| 成人天堂资源www在线| 精品理论电影在线| 奇米亚洲午夜久久精品| 色老头久久综合| 亚洲视频每日更新| 成人午夜精品在线| 久久天堂av综合合色蜜桃网| 日韩精品电影在线观看| 欧美日韩一区二区三区高清| 亚洲人成人一区二区在线观看 | 色狠狠综合天天综合综合| 国产欧美一区二区在线观看| 国模少妇一区二区三区| 欧美v日韩v国产v| 久久aⅴ国产欧美74aaa| 欧美成人精品福利| 国产一区二区三区久久久| 久久亚洲综合色一区二区三区| 九色综合狠狠综合久久|