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

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關(guān)于我們
? 蟲蟲下載站

?? editor.cxx

?? 一個(gè)可以提供語法高亮顯示的編輯器
?? CXX
?? 第 1 頁 / 共 2 頁
字號(hào):
// Scintilla source code edit control
/** @file Editor.cxx
 ** Main code for the edit control.
 **/
// Copyright 1998-2003 by Neil Hodgson <neilh@scintilla.org>
// The License.txt file describes the conditions under which this software may be distributed.

#include <stdlib.h>
#include <string.h>
#include <stdio.h>
#include <ctype.h>

#include "Platform.h"

#ifndef PLAT_QT
#define INCLUDE_DEPRECATED_FEATURES
#endif
#include "Scintilla.h"

#include "ContractionState.h"
#include "SVector.h"
#include "CellBuffer.h"
#include "KeyMap.h"
#include "Indicator.h"
#include "XPM.h"
#include "LineMarker.h"
#include "Style.h"
#include "ViewStyle.h"
#include "Document.h"
#include "Editor.h"

Caret::Caret() :
active(false), on(false), period(500) {}

Timer::Timer() :
ticking(false), ticksToWait(0), tickerID(0) {}

LineLayout::LineLayout(int maxLineLength_) :
	lineStarts(0),
	lenLineStarts(0),
	lineNumber(-1),
	inCache(false),
	maxLineLength(-1),
	numCharsInLine(0),
	validity(llInvalid),
	xHighlightGuide(0),
	highlightColumn(0),
	selStart(0),
	selEnd(0),
	containsCaret(false),
	edgeColumn(0),
	chars(0),
	styles(0),
	indicators(0),
	positions(0),
	widthLine(wrapWidthInfinite),
	lines(1) {
	Resize(maxLineLength_);
}

LineLayout::~LineLayout() {
	Free();
}

void LineLayout::Resize(int maxLineLength_) {
	if (maxLineLength_ > maxLineLength) {
		Free();
		chars = new char[maxLineLength_ + 1];
		styles = new char[maxLineLength_ + 1];
		indicators = new char[maxLineLength_ + 1];
		// Extra position allocated as sometimes the Windows
		// GetTextExtentExPoint API writes an extra element.
		positions = new int[maxLineLength_ + 1 + 1];
		maxLineLength = maxLineLength_;
	}
}

void LineLayout::Free() {
	delete []chars;
	chars = 0;
	delete []styles;
	styles = 0;
	delete []indicators;
	indicators = 0;
	delete []positions;
	positions = 0;
	delete []lineStarts;
	lineStarts = 0;
}

void LineLayout::Invalidate(validLevel validity_) {
	if (validity > validity_)
		validity = validity_;
}

void LineLayout::SetLineStart(int line, int start) {
	if ((line >= lenLineStarts) && (line != 0)) {
		int newMaxLines = line + 20;
		int *newLineStarts = new int[newMaxLines];
		if (!newLineStarts)
			return;
		for (int i = 0; i < newMaxLines; i++) {
			if (i < lenLineStarts)
				newLineStarts[i] = lineStarts[i];
			else
				newLineStarts[i] = 0;
		}
		delete []lineStarts;
		lineStarts = newLineStarts;
		lenLineStarts = newMaxLines;
	}
	lineStarts[line] = start;
}

void LineLayout::SetBracesHighlight(Range rangeLine, Position braces[],
                                    char bracesMatchStyle, int xHighlight) {
	if (rangeLine.ContainsCharacter(braces[0])) {
		int braceOffset = braces[0] - rangeLine.start;
		if (braceOffset < numCharsInLine) {
			bracePreviousStyles[0] = styles[braceOffset];
			styles[braceOffset] = bracesMatchStyle;
		}
	}
	if (rangeLine.ContainsCharacter(braces[1])) {
		int braceOffset = braces[1] - rangeLine.start;
		if (braceOffset < numCharsInLine) {
			bracePreviousStyles[1] = styles[braceOffset];
			styles[braceOffset] = bracesMatchStyle;
		}
	}
	if ((braces[0] >= rangeLine.start && braces[1] <= rangeLine.end) ||
	        (braces[1] >= rangeLine.start && braces[0] <= rangeLine.end)) {
		xHighlightGuide = xHighlight;
	}
}

void LineLayout::RestoreBracesHighlight(Range rangeLine, Position braces[]) {
	if (rangeLine.ContainsCharacter(braces[0])) {
		int braceOffset = braces[0] - rangeLine.start;
		if (braceOffset < numCharsInLine) {
			styles[braceOffset] = bracePreviousStyles[0];
		}
	}
	if (rangeLine.ContainsCharacter(braces[1])) {
		int braceOffset = braces[1] - rangeLine.start;
		if (braceOffset < numCharsInLine) {
			styles[braceOffset] = bracePreviousStyles[1];
		}
	}
	xHighlightGuide = 0;
}

LineLayoutCache::LineLayoutCache() :
	level(0), length(0), size(0), cache(0),
	allInvalidated(false), styleClock(-1) {
	Allocate(0);
}

LineLayoutCache::~LineLayoutCache() {
	Deallocate();
}

void LineLayoutCache::Allocate(int length_) {
	allInvalidated = false;
	length = length_;
	size = length;
	if (size > 1) {
		size = (size / 16 + 1) * 16;
	}
	if (size > 0) {
		cache = new LineLayout * [size];
	}
	for (int i = 0; i < size; i++)
		cache[i] = 0;
}

void LineLayoutCache::AllocateForLevel(int linesOnScreen, int linesInDoc) {
	int lengthForLevel = 0;
	if (level == llcCaret) {
		lengthForLevel = 1;
	} else if (level == llcPage) {
		lengthForLevel = linesOnScreen + 1;
	} else if (level == llcDocument) {
		lengthForLevel = linesInDoc;
	}
	if (lengthForLevel > size) {
		Deallocate();
	} else if (lengthForLevel < length) {
		for (int i = lengthForLevel; i < length; i++) {
			delete cache[i];
			cache[i] = 0;
		}
	}
	if (!cache) {
		Allocate(lengthForLevel);
	}
}

void LineLayoutCache::Deallocate() {
	for (int i = 0; i < length; i++)
		delete cache[i];
	delete []cache;
	cache = 0;
	length = 0;
}

void LineLayoutCache::Invalidate(LineLayout::validLevel validity_) {
	if (cache && !allInvalidated) {
		for (int i = 0; i < length; i++) {
			if (cache[i]) {
				cache[i]->Invalidate(validity_);
			}
		}
		if (validity_ == LineLayout::llInvalid) {
			allInvalidated = true;
		}
	}
}

void LineLayoutCache::SetLevel(int level_) {
	allInvalidated = false;
	if ((level_ != -1) && (level != level_)) {
		level = level_;
		Deallocate();
	}
}

LineLayout *LineLayoutCache::Retrieve(int lineNumber, int lineCaret, int maxChars, int styleClock_,
                                      int linesOnScreen, int linesInDoc) {
	AllocateForLevel(linesOnScreen, linesInDoc);
	if (styleClock != styleClock_) {
		Invalidate(LineLayout::llCheckTextAndStyle);
		styleClock = styleClock_;
	}
	allInvalidated = false;
	int pos = -1;
	LineLayout *ret = 0;
	if (((level == llcCaret) || (level == llcPage)) && (lineNumber == lineCaret)) {
		pos = 0;
	} else if (level == llcPage) {
		pos = lineNumber % length;
	} else if (level == llcDocument) {
		pos = lineNumber;
	}
	if (pos >= 0) {
		if (cache && (pos < length)) {
			if (cache[pos]) {
				if ((cache[pos]->lineNumber != lineNumber) ||
				        (cache[pos]->maxLineLength < maxChars)) {
					delete cache[pos];
					cache[pos] = 0;
				}
			}
			if (!cache[pos]) {
				cache[pos] = new LineLayout(maxChars);
			}
			if (cache[pos]) {
				cache[pos]->lineNumber = lineNumber;
				cache[pos]->inCache = true;
				ret = cache[pos];
			}
		}
	}

	if (!ret) {
		ret = new LineLayout(maxChars);
		ret->lineNumber = lineNumber;
	}

	return ret;
}

void LineLayoutCache::Dispose(LineLayout *ll) {
	allInvalidated = false;
	if (ll) {
		if (!ll->inCache) {
			delete ll;
		}
	}
}

Editor::Editor() {
	ctrlID = 0;

	stylesValid = false;

	printMagnification = 0;
	printColourMode = SC_PRINT_NORMAL;
	printWrapState = eWrapWord;
	cursorMode = SC_CURSORNORMAL;
	controlCharSymbol = 0;	/* Draw the control characters */

	hasFocus = false;
	hideSelection = false;
	inOverstrike = false;
	errorStatus = 0;
	mouseDownCaptures = true;

	bufferedDraw = true;
	twoPhaseDraw = true;

	lastClickTime = 0;
	dwellDelay = SC_TIME_FOREVER;
	ticksToDwell = SC_TIME_FOREVER;
	dwelling = false;
	ptMouseLast.x = 0;
	ptMouseLast.y = 0;
	inDragDrop = false;
	dropWentOutside = false;
	posDrag = invalidPosition;
	posDrop = invalidPosition;
	selectionType = selChar;

	lastXChosen = 0;
	lineAnchor = 0;
	originalAnchorPos = 0;

	selType = selStream;
	xStartSelect = 0;
	xEndSelect = 0;
	primarySelection = true;

	caretXPolicy = CARET_SLOP | CARET_EVEN;
	caretXSlop = 50;

	caretYPolicy = CARET_EVEN;
	caretYSlop = 0;

	searchAnchor = 0;

	xOffset = 0;
	xCaretMargin = 50;
	horizontalScrollBarVisible = true;
	scrollWidth = 2000;
	verticalScrollBarVisible = true;
	endAtLastLine = true;

	pixmapLine = Surface::Allocate();
	pixmapSelMargin = Surface::Allocate();
	pixmapSelPattern = Surface::Allocate();
	pixmapIndentGuide = Surface::Allocate();
	pixmapIndentGuideHighlight = Surface::Allocate();

	currentPos = 0;
	anchor = 0;

	targetStart = 0;
	targetEnd = 0;
	searchFlags = 0;

	topLine = 0;
	posTopLine = 0;

	needUpdateUI = true;
	braces[0] = invalidPosition;
	braces[1] = invalidPosition;
	bracesMatchStyle = STYLE_BRACEBAD;
	highlightGuideColumn = 0;

	theEdge = 0;

	paintState = notPainting;

	modEventMask = SC_MODEVENTMASKALL;

	pdoc = new Document();
	pdoc->AddRef();
	pdoc->AddWatcher(this, 0);

	recordingMacro = false;
	foldFlags = 0;

	wrapState = eWrapNone;
	wrapWidth = LineLayout::wrapWidthInfinite;
	docLineLastWrapped = -1;

	hsStart = -1;
	hsEnd = -1;

	llc.SetLevel(LineLayoutCache::llcCaret);
}

Editor::~Editor() {
	pdoc->RemoveWatcher(this, 0);
	pdoc->Release();
	pdoc = 0;
	DropGraphics();
	delete pixmapLine;
	delete pixmapSelMargin;
	delete pixmapSelPattern;
	delete pixmapIndentGuide;
	delete pixmapIndentGuideHighlight;
}

void Editor::Finalise() {
	CancelModes();
}

void Editor::DropGraphics() {
	pixmapLine->Release();
	pixmapSelMargin->Release();
	pixmapSelPattern->Release();
	pixmapIndentGuide->Release();
}

void Editor::InvalidateStyleData() {
	stylesValid = false;
	palette.Release();
	DropGraphics();
	llc.Invalidate(LineLayout::llInvalid);
}

void Editor::InvalidateStyleRedraw() {
	NeedWrapping();
	InvalidateStyleData();
	Redraw();
}

void Editor::RefreshColourPalette(Palette &pal, bool want) {
	vs.RefreshColourPalette(pal, want);
}

void Editor::RefreshStyleData() {
	if (!stylesValid) {
		stylesValid = true;
		AutoSurface surface(this);
		if (surface) {
			vs.Refresh(*surface);
			RefreshColourPalette(palette, true);
			palette.Allocate(wMain);
			RefreshColourPalette(palette, false);
		}
		SetScrollBars();
	}
}

PRectangle Editor::GetClientRectangle() {
	return wMain.GetClientPosition();
}

PRectangle Editor::GetTextRectangle() {
	PRectangle rc = GetClientRectangle();
	rc.left += vs.fixedColumnWidth;
	rc.right -= vs.rightMarginWidth;
	return rc;
}

int Editor::LinesOnScreen() {
	PRectangle rcClient = GetClientRectangle();
	int htClient = rcClient.bottom - rcClient.top;
	//Platform::DebugPrintf("lines on screen = %d\n", htClient / lineHeight + 1);
	return htClient / vs.lineHeight;
}

int Editor::LinesToScroll() {
	int retVal = LinesOnScreen() - 1;
	if (retVal < 1)
		return 1;
	else
		return retVal;
}

int Editor::MaxScrollPos() {
	//Platform::DebugPrintf("Lines %d screen = %d maxScroll = %d\n",
	//LinesTotal(), LinesOnScreen(), LinesTotal() - LinesOnScreen() + 1);
	int retVal = cs.LinesDisplayed();
	if (endAtLastLine) {
		retVal -= LinesOnScreen();
	} else {
		retVal--;
	}
	if (retVal < 0) {
		return 0;
	} else {
		return retVal;
	}
}

static inline bool IsControlCharacter(char ch) {
	// iscntrl returns true for lots of chars > 127 which are displayable
	return ch >= 0 && ch < ' ';
}

const char *ControlCharacterString(unsigned char ch) {
	const char *reps[] = {
		"NUL", "SOH", "STX", "ETX", "EOT", "ENQ", "ACK", "BEL",
		"BS", "HT", "LF", "VT", "FF", "CR", "SO", "SI",
		"DLE", "DC1", "DC2", "DC3", "DC4", "NAK", "SYN", "ETB",
		"CAN", "EM", "SUB", "ESC", "FS", "GS", "RS", "US"
	};
	if (ch < (sizeof(reps) / sizeof(reps[0]))) {
		return reps[ch];
	} else {
		return "BAD";
	}
}

// Convenience class to ensure LineLayout objects are always disposed.
class AutoLineLayout {
	LineLayoutCache &llc;
	LineLayout *ll;
	AutoLineLayout &operator=(const AutoLineLayout &) { return * this; }
public:
	AutoLineLayout(LineLayoutCache &llc_, LineLayout *ll_) : llc(llc_), ll(ll_) {}
	~AutoLineLayout() {
		llc.Dispose(ll);
		ll = 0;
	}
	LineLayout *operator->() const {
		return ll;
	}
	operator LineLayout *() const {
		return ll;
	}
	void Set(LineLayout *ll_) {
		llc.Dispose(ll);
		ll = ll_;
	}

?? 快捷鍵說明

復(fù)制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號(hào) Ctrl + =
減小字號(hào) Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
精品亚洲aⅴ乱码一区二区三区| 自拍偷拍亚洲激情| 视频一区二区三区在线| 91麻豆国产香蕉久久精品| 国产精品久久久久久久久果冻传媒| 国产丶欧美丶日本不卡视频| 久久久99免费| 国产v日产∨综合v精品视频| 欧美国产精品专区| 99精品国产99久久久久久白柏| 国产精品久久影院| 色综合天天综合网天天看片| 亚洲一区在线观看免费 | 91麻豆精品视频| 亚洲蜜臀av乱码久久精品| 在线视频国内一区二区| 亚洲国产欧美在线人成| 欧美一区二区三区视频在线观看| 蜜臀久久99精品久久久久宅男| 精品国产百合女同互慰| 国产酒店精品激情| 亚洲欧美区自拍先锋| 欧美三级电影在线看| 日本va欧美va精品发布| 精品乱人伦一区二区三区| 成人三级伦理片| 亚洲精品高清视频在线观看| 337p亚洲精品色噜噜噜| 国产精品一二二区| 亚洲黄色片在线观看| 欧美一卡二卡三卡| 国产999精品久久久久久| 亚洲人成人一区二区在线观看 | 精品国产乱子伦一区| 成人黄色电影在线 | 亚洲h精品动漫在线观看| 欧美一区二区三区视频免费 | 亚洲成人精品一区| 久久综合色鬼综合色| 不卡av在线网| 日本亚洲三级在线| 国产三级一区二区| 欧美日韩亚洲综合一区 | 成人h版在线观看| 天堂蜜桃91精品| 久久精品人人爽人人爽| 精品视频色一区| 成人网男人的天堂| 免费在线视频一区| 亚洲欧美偷拍卡通变态| 精品久久国产老人久久综合| 91视频观看免费| 黑人巨大精品欧美黑白配亚洲| 中文字幕在线一区二区三区| 欧美一区二区三区播放老司机| www.爱久久.com| 美脚の诱脚舐め脚责91| 亚洲精品日韩专区silk| 久久久www免费人成精品| 欧美日韩成人激情| 99精品视频在线播放观看| 国模一区二区三区白浆| 天涯成人国产亚洲精品一区av| 国产精品福利一区| 亚洲精品在线电影| 日韩一级片网址| 欧美日韩欧美一区二区| 91亚洲永久精品| 国产综合一区二区| 免费人成精品欧美精品 | 亚洲区小说区图片区qvod| 久久久久久免费毛片精品| 欧美一区二区三区啪啪| 欧美日韩一区二区欧美激情| 99久久精品免费看| 成人免费视频一区| 国产精品资源站在线| 蜜臀av性久久久久蜜臀aⅴ流畅| 一区二区三区四区在线免费观看| 日本一二三四高清不卡| 国产日韩精品一区二区三区| 精品日韩一区二区三区 | 国产日韩欧美综合在线| 日韩免费在线观看| 欧美一级xxx| 欧美一级黄色录像| 日韩欧美高清dvd碟片| 欧美一区二区在线不卡| 欧美久久婷婷综合色| 欧美色综合久久| 在线影视一区二区三区| 91啦中文在线观看| 色哟哟在线观看一区二区三区| 成人av网站在线观看| 成人高清av在线| 成人精品免费网站| av欧美精品.com| 91丨九色丨黑人外教| 色就色 综合激情| 欧美揉bbbbb揉bbbbb| 欧美日韩久久一区| 欧美精品日韩一区| 91精品国产aⅴ一区二区| 777欧美精品| 精品久久久久99| 国产精品美女久久久久久久久久久 | 中文字幕 久热精品 视频在线| 91精品国产麻豆国产自产在线| 欧美精品v国产精品v日韩精品| 日韩一区二区精品在线观看| 精品国产一区二区三区久久久蜜月 | 欧美一卡在线观看| 678五月天丁香亚洲综合网| 欧美一区二区三区免费观看视频 | 精品国产乱码久久| 久久先锋影音av鲁色资源| 国产欧美精品区一区二区三区| 国产精品色哟哟| 亚洲一区二区在线观看视频| 日韩av高清在线观看| 国产剧情av麻豆香蕉精品| 99久久国产免费看| 欧美久久免费观看| 久久综合久久综合九色| ...av二区三区久久精品| 亚洲va国产va欧美va观看| 捆绑变态av一区二区三区| 国产成人av一区二区三区在线 | 欧美日本乱大交xxxxx| 精品国产一区二区亚洲人成毛片 | 日韩免费性生活视频播放| 中文字幕av一区 二区| 午夜激情久久久| 国产精品中文有码| 欧美色综合影院| 国产亚洲一区二区三区四区| 亚洲精品免费播放| 开心九九激情九九欧美日韩精美视频电影 | www久久精品| 一区二区三区在线播| 精品一区二区三区免费| 日本韩国欧美三级| 日韩精品资源二区在线| 亚洲少妇最新在线视频| 精品夜夜嗨av一区二区三区| 色综合久久中文综合久久97| 日韩精品在线一区| 亚洲国产精品麻豆| 成人h动漫精品一区二区| 日韩三级电影网址| 亚洲欧美区自拍先锋| 国产精品18久久久| 欧美一区二区三区四区高清| 亚洲精品中文字幕在线观看| 国精产品一区一区三区mba桃花| 欧美又粗又大又爽| 国产精品视频第一区| 九九九精品视频| 欧美日韩国产成人在线91| 亚洲青青青在线视频| 国产成都精品91一区二区三| 日韩欧美综合在线| 依依成人精品视频| 成人avav影音| 国产欧美一区二区三区鸳鸯浴| 毛片一区二区三区| 欧美性猛片aaaaaaa做受| 国产精品久久久久一区二区三区共| 久久爱www久久做| 91精品婷婷国产综合久久竹菊| 一区二区三区美女视频| 91麻豆国产福利在线观看| 国产精品美女久久福利网站| 黑人巨大精品欧美黑白配亚洲| 欧美一区永久视频免费观看| 偷拍自拍另类欧美| 欧洲激情一区二区| 亚洲精品国产视频| 99久久精品国产一区二区三区| 中文字幕欧美日本乱码一线二线| 国产综合久久久久久鬼色| 日韩女优电影在线观看| 蜜桃在线一区二区三区| 欧美成人一区二区三区在线观看| 天堂一区二区在线| 6080国产精品一区二区| 五月天视频一区| 欧美日韩精品欧美日韩精品| 亚洲成人动漫精品| 91精品国产综合久久福利软件| 日韩电影免费一区| 日韩一区二区麻豆国产| 男人的天堂亚洲一区| 欧美变态tickling挠脚心| 看国产成人h片视频| 久久综合视频网| 国产不卡在线播放| 亚洲欧洲www| 在线区一区二视频| 日韩精品亚洲一区|