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

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

?? platwin.cxx

?? 最強(qiáng)源代碼編輯控件
?? CXX
?? 第 1 頁(yè) / 共 5 頁(yè)
字號(hào):
// Scintilla source code edit control
/** @file PlatWin.cxx
 ** Implementation of platform facilities on Windows.
 **/
// 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 <ctype.h>
#include <stdarg.h>
#include <stdio.h>
#include <time.h>

#define _WIN32_WINNT  0x0400
#include <windows.h>
#include <commctrl.h>
#include <richedit.h>
#include <windowsx.h>

#include "Platform.h"
#include "PlatformRes.h"
#include "UniConversion.h"
#include "XPM.h"

#ifndef IDC_HAND
#define IDC_HAND MAKEINTRESOURCE(32649)
#endif

// Take care of 32/64 bit pointers
#ifdef GetWindowLongPtr
static void *PointerFromWindow(HWND hWnd) {
	return reinterpret_cast<void *>(::GetWindowLongPtr(hWnd, 0));
}
static void SetWindowPointer(HWND hWnd, void *ptr) {
	::SetWindowLongPtr(hWnd, 0, reinterpret_cast<LONG_PTR>(ptr));
}
#else
static void *PointerFromWindow(HWND hWnd) {
	return reinterpret_cast<void *>(::GetWindowLong(hWnd, 0));
}
static void SetWindowPointer(HWND hWnd, void *ptr) {
	::SetWindowLong(hWnd, 0, reinterpret_cast<LONG>(ptr));
}

#ifndef GWLP_USERDATA
#define GWLP_USERDATA GWL_USERDATA
#endif

#ifndef GWLP_WNDPROC
#define GWLP_WNDPROC GWL_WNDPROC
#endif

#ifndef LONG_PTR
#define LONG_PTR LONG
#endif

static LONG_PTR SetWindowLongPtr(HWND hWnd, int nIndex, LONG_PTR dwNewLong) {
	return ::SetWindowLong(hWnd, nIndex, dwNewLong);
}

static LONG_PTR GetWindowLongPtr(HWND hWnd, int nIndex) {
	return ::GetWindowLong(hWnd, nIndex);
}
#endif

typedef BOOL (WINAPI *AlphaBlendSig)(HDC, int, int, int, int, HDC, int, int, int, int, BLENDFUNCTION);

static CRITICAL_SECTION crPlatformLock;
static HINSTANCE hinstPlatformRes = 0;
static bool onNT = false;
static HMODULE hDLLImage = 0;
static AlphaBlendSig AlphaBlendFn = 0;


bool IsNT() {
	return onNT;
}

Point Point::FromLong(long lpoint) {
	return Point(static_cast<short>(LOWORD(lpoint)), static_cast<short>(HIWORD(lpoint)));
}

static RECT RectFromPRectangle(PRectangle prc) {
	RECT rc = {prc.left, prc.top, prc.right, prc.bottom};
	return rc;
}

Palette::Palette() {
	used = 0;
	allowRealization = false;
	hpal = 0;
	size = 100;
	entries = new ColourPair[size];
}

Palette::~Palette() {
	Release();
	delete []entries;
	entries = 0;
}

void Palette::Release() {
	used = 0;
	if (hpal)
		::DeleteObject(hpal);
	hpal = 0;
	delete []entries;
	size = 100;
	entries = new ColourPair[size];
}

/**
 * This method either adds a colour to the list of wanted colours (want==true)
 * or retrieves the allocated colour back to the ColourPair.
 * This is one method to make it easier to keep the code for wanting and retrieving in sync.
 */
void Palette::WantFind(ColourPair &cp, bool want) {
	if (want) {
		for (int i=0; i < used; i++) {
			if (entries[i].desired == cp.desired)
				return;
		}

		if (used >= size) {
			int sizeNew = size * 2;
			ColourPair *entriesNew = new ColourPair[sizeNew];
			for (int j=0; j<size; j++) {
				entriesNew[j] = entries[j];
			}
			delete []entries;
			entries = entriesNew;
			size = sizeNew;
		}

		entries[used].desired = cp.desired;
		entries[used].allocated.Set(cp.desired.AsLong());
		used++;
	} else {
		for (int i=0; i < used; i++) {
			if (entries[i].desired == cp.desired) {
				cp.allocated = entries[i].allocated;
				return;
			}
		}
		cp.allocated.Set(cp.desired.AsLong());
	}
}

void Palette::Allocate(Window &) {
	if (hpal)
		::DeleteObject(hpal);
	hpal = 0;

	if (allowRealization) {
		char *pal = new char[sizeof(LOGPALETTE) + (used-1) * sizeof(PALETTEENTRY)];
		LOGPALETTE *logpal = reinterpret_cast<LOGPALETTE *>(pal);
		logpal->palVersion = 0x300;
		logpal->palNumEntries = static_cast<WORD>(used);
		for (int iPal=0;iPal<used;iPal++) {
			ColourDesired desired = entries[iPal].desired;
			logpal->palPalEntry[iPal].peRed   = static_cast<BYTE>(desired.GetRed());
			logpal->palPalEntry[iPal].peGreen = static_cast<BYTE>(desired.GetGreen());
			logpal->palPalEntry[iPal].peBlue  = static_cast<BYTE>(desired.GetBlue());
			entries[iPal].allocated.Set(
				PALETTERGB(desired.GetRed(), desired.GetGreen(), desired.GetBlue()));
			// PC_NOCOLLAPSE means exact colours allocated even when in background this means other windows
			// are less likely to get their colours and also flashes more when switching windows
			logpal->palPalEntry[iPal].peFlags = PC_NOCOLLAPSE;
			// 0 allows approximate colours when in background, yielding moe colours to other windows
			//logpal->palPalEntry[iPal].peFlags = 0;
		}
		hpal = ::CreatePalette(logpal);
		delete []pal;
	}
}

static void SetLogFont(LOGFONT &lf, const char *faceName, int characterSet, int size, bool bold, bool italic) {
	memset(&lf, 0, sizeof(lf));
	// The negative is to allow for leading
	lf.lfHeight = -(abs(size));
	lf.lfWeight = bold ? FW_BOLD : FW_NORMAL;
	lf.lfItalic = static_cast<BYTE>(italic ? 1 : 0);
	lf.lfCharSet = static_cast<BYTE>(characterSet);
	strncpy(lf.lfFaceName, faceName, sizeof(lf.lfFaceName));
}

/**
 * Create a hash from the parameters for a font to allow easy checking for identity.
 * If one font is the same as another, its hash will be the same, but if the hash is the
 * same then they may still be different.
 */
static int HashFont(const char *faceName, int characterSet, int size, bool bold, bool italic) {
	return
		size ^
		(characterSet << 10) ^
		(bold ? 0x10000000 : 0) ^
		(italic ? 0x20000000 : 0) ^
		faceName[0];
}

class FontCached : Font {
	FontCached *next;
	int usage;
	LOGFONT lf;
	int hash;
	FontCached(const char *faceName_, int characterSet_, int size_, bool bold_, bool italic_);
	~FontCached() {}
	bool SameAs(const char *faceName_, int characterSet_, int size_, bool bold_, bool italic_);
	virtual void Release();

	static FontCached *first;
public:
	static FontID FindOrCreate(const char *faceName_, int characterSet_, int size_, bool bold_, bool italic_);
	static void ReleaseId(FontID id_);
};

FontCached *FontCached::first = 0;

FontCached::FontCached(const char *faceName_, int characterSet_, int size_, bool bold_, bool italic_) :
	next(0), usage(0), hash(0) {
	::SetLogFont(lf, faceName_, characterSet_, size_, bold_, italic_);
	hash = HashFont(faceName_, characterSet_, size_, bold_, italic_);
	id = ::CreateFontIndirect(&lf);
	usage = 1;
}

bool FontCached::SameAs(const char *faceName_, int characterSet_, int size_, bool bold_, bool italic_) {
	return
		(lf.lfHeight == -(abs(size_))) &&
		(lf.lfWeight == (bold_ ? FW_BOLD : FW_NORMAL)) &&
		(lf.lfItalic == static_cast<BYTE>(italic_ ? 1 : 0)) &&
		(lf.lfCharSet == characterSet_) &&
		0 == strcmp(lf.lfFaceName,faceName_);
}

void FontCached::Release() {
	if (id)
		::DeleteObject(id);
	id = 0;
}

FontID FontCached::FindOrCreate(const char *faceName_, int characterSet_, int size_, bool bold_, bool italic_) {
	FontID ret = 0;
	::EnterCriticalSection(&crPlatformLock);
	int hashFind = HashFont(faceName_, characterSet_, size_, bold_, italic_);
	for (FontCached *cur=first; cur; cur=cur->next) {
		if ((cur->hash == hashFind) &&
			cur->SameAs(faceName_, characterSet_, size_, bold_, italic_)) {
			cur->usage++;
			ret = cur->id;
		}
	}
	if (ret == 0) {
		FontCached *fc = new FontCached(faceName_, characterSet_, size_, bold_, italic_);
		if (fc) {
			fc->next = first;
			first = fc;
			ret = fc->id;
		}
	}
	::LeaveCriticalSection(&crPlatformLock);
	return ret;
}

void FontCached::ReleaseId(FontID id_) {
	::EnterCriticalSection(&crPlatformLock);
	FontCached **pcur=&first;
	for (FontCached *cur=first; cur; cur=cur->next) {
		if (cur->id == id_) {
			cur->usage--;
			if (cur->usage == 0) {
				*pcur = cur->next;
				cur->Release();
				cur->next = 0;
				delete cur;
			}
			break;
		}
		pcur=&cur->next;
	}
	::LeaveCriticalSection(&crPlatformLock);
}

Font::Font() {
	id = 0;
}

Font::~Font() {
}

#define FONTS_CACHED

void Font::Create(const char *faceName, int characterSet, int size,
	bool bold, bool italic, bool) {
	Release();
#ifndef FONTS_CACHED
	LOGFONT lf;
	::SetLogFont(lf, faceName, characterSet, size, bold, italic);
	id = ::CreateFontIndirect(&lf);
#else
	id = FontCached::FindOrCreate(faceName, characterSet, size, bold, italic);
#endif
}

void Font::Release() {
#ifndef FONTS_CACHED
	if (id)
		::DeleteObject(id);
#else
	if (id)
		FontCached::ReleaseId(id);
#endif
	id = 0;
}

class SurfaceImpl : public Surface {
	bool unicodeMode;
	HDC hdc;
	bool hdcOwned;
	HPEN pen;
	HPEN penOld;
	HBRUSH brush;
	HBRUSH brushOld;
	HFONT font;
	HFONT fontOld;
	HBITMAP bitmap;
	HBITMAP bitmapOld;
	HPALETTE paletteOld;
	int maxWidthMeasure;
	int maxLenText;

	int codePage;
	// If 9x OS and current code page is same as ANSI code page.
	bool win9xACPSame;

	void BrushColor(ColourAllocated back);
	void SetFont(Font &font_);

	// Private so SurfaceImpl objects can not be copied
	SurfaceImpl(const SurfaceImpl &) : Surface() {}
	SurfaceImpl &operator=(const SurfaceImpl &) { return *this; }
public:
	SurfaceImpl();
	virtual ~SurfaceImpl();

	void Init(WindowID wid);
	void Init(SurfaceID sid, WindowID wid);
	void InitPixMap(int width, int height, Surface *surface_, WindowID wid);

	void Release();
	bool Initialised();
	void PenColour(ColourAllocated fore);
	int LogPixelsY();
	int DeviceHeightFont(int points);
	void MoveTo(int x_, int y_);
	void LineTo(int x_, int y_);
	void Polygon(Point *pts, int npts, ColourAllocated fore, ColourAllocated back);
	void RectangleDraw(PRectangle rc, ColourAllocated fore, ColourAllocated back);
	void FillRectangle(PRectangle rc, ColourAllocated back);
	void FillRectangle(PRectangle rc, Surface &surfacePattern);
	void RoundedRectangle(PRectangle rc, ColourAllocated fore, ColourAllocated back);
	void AlphaRectangle(PRectangle rc, int cornerSize, ColourAllocated fill, int alphaFill,
		ColourAllocated outline, int alphaOutline, int flags);
	void Ellipse(PRectangle rc, ColourAllocated fore, ColourAllocated back);
	void Copy(PRectangle rc, Point from, Surface &surfaceSource);

	void DrawTextCommon(PRectangle rc, Font &font_, int ybase, const char *s, int len, UINT fuOptions);
	void DrawTextNoClip(PRectangle rc, Font &font_, int ybase, const char *s, int len, ColourAllocated fore, ColourAllocated back);
	void DrawTextClipped(PRectangle rc, Font &font_, int ybase, const char *s, int len, ColourAllocated fore, ColourAllocated back);
	void DrawTextTransparent(PRectangle rc, Font &font_, int ybase, const char *s, int len, ColourAllocated fore);
	void MeasureWidths(Font &font_, const char *s, int len, int *positions);
	int WidthText(Font &font_, const char *s, int len);
	int WidthChar(Font &font_, char ch);
	int Ascent(Font &font_);
	int Descent(Font &font_);
	int InternalLeading(Font &font_);
	int ExternalLeading(Font &font_);
	int Height(Font &font_);
	int AverageCharWidth(Font &font_);

	int SetPalette(Palette *pal, bool inBackGround);
	void SetClip(PRectangle rc);
	void FlushCachedState();

	void SetUnicodeMode(bool unicodeMode_);
	void SetDBCSMode(int codePage_);
};

SurfaceImpl::SurfaceImpl() :
	unicodeMode(false),
	hdc(0), 	hdcOwned(false),
	pen(0), 	penOld(0),
	brush(0), brushOld(0),
	font(0), 	fontOld(0),
	bitmap(0), bitmapOld(0),
	paletteOld(0) {
	// Windows 9x has only a 16 bit coordinate system so break after 30000 pixels
	maxWidthMeasure = IsNT() ? 1000000 : 30000;
	// There appears to be a 16 bit string length limit in GDI on NT and a limit of
	// 8192 characters on Windows 95.
	maxLenText = IsNT() ? 65535 : 8192;

	codePage = 0;
	win9xACPSame = false;
}

SurfaceImpl::~SurfaceImpl() {
	Release();
}

void SurfaceImpl::Release() {
	if (penOld) {
		::SelectObject(reinterpret_cast<HDC>(hdc), penOld);
		::DeleteObject(pen);
		penOld = 0;
	}
	pen = 0;
	if (brushOld) {
		::SelectObject(reinterpret_cast<HDC>(hdc), brushOld);
		::DeleteObject(brush);
		brushOld = 0;
	}
	brush = 0;
	if (fontOld) {
		// Fonts are not deleted as they are owned by a Font object
		::SelectObject(reinterpret_cast<HDC>(hdc), fontOld);
		fontOld = 0;
	}
	font = 0;
	if (bitmapOld) {
		::SelectObject(reinterpret_cast<HDC>(hdc), bitmapOld);
		::DeleteObject(bitmap);
		bitmapOld = 0;
	}
	bitmap = 0;

?? 快捷鍵說(shuō)明

復(fù)制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號(hào) Ctrl + =
減小字號(hào) Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
久久麻豆一区二区| 亚洲国产精华液网站w| 国产不卡免费视频| 伊人开心综合网| 精品国产伦理网| 欧美日韩一级二级| av色综合久久天堂av综合| 日本成人在线电影网| 亚洲欧洲日韩一区二区三区| 日韩欧美国产不卡| 欧美日韩在线播放一区| 97久久精品人人爽人人爽蜜臀| 免费看精品久久片| 亚洲成人激情综合网| 国产精品久久久久影视| 亚洲精品一区二区三区香蕉| 在线电影院国产精品| 色婷婷狠狠综合| 成人午夜在线视频| 国产九九视频一区二区三区| 日本不卡123| 午夜欧美大尺度福利影院在线看| 国产精品久久久久久户外露出| 精品国产伦一区二区三区观看方式 | 欧美另类z0zxhd电影| 91老司机福利 在线| 成人av午夜电影| 国产成人精品影院| 国产伦精品一区二区三区免费迷| 日本不卡中文字幕| 全国精品久久少妇| 秋霞电影一区二区| 日韩精品一二区| 日韩高清在线一区| 日日摸夜夜添夜夜添精品视频 | 欧美日韩国产免费一区二区| 91小视频免费观看| 一本大道av伊人久久综合| 91丝袜国产在线播放| 91视频一区二区三区| 97久久超碰国产精品电影| 成人ar影院免费观看视频| 成+人+亚洲+综合天堂| 成人精品在线视频观看| 成人免费毛片app| 成人精品电影在线观看| jlzzjlzz亚洲女人18| av电影在线观看一区| 色综合色综合色综合色综合色综合 | 国产精品理论片在线观看| 日本一区二区动态图| 国产精品久久一级| 自拍av一区二区三区| 一区二区三区加勒比av| 一区二区三区四区不卡在线| 亚洲电影一级片| 日本不卡视频一二三区| 久久成人麻豆午夜电影| 国产高清不卡二三区| 不卡区在线中文字幕| 在线观看国产91| 欧美日本韩国一区| 久久综合视频网| 中文天堂在线一区| 亚洲综合一区二区| 蜜臀a∨国产成人精品| 国产高清无密码一区二区三区| 成人激情综合网站| 欧美日韩一区二区三区四区 | 欧美日韩国产一区二区三区地区| 欧美一二三在线| 国产女人aaa级久久久级 | 美腿丝袜一区二区三区| 国产一区二区三区久久悠悠色av| 成人看片黄a免费看在线| 欧美综合在线视频| 精品处破学生在线二十三| 国产精品青草综合久久久久99| 亚洲免费在线视频| 久久黄色级2电影| 99久久国产综合精品麻豆| 在线成人小视频| 国产日产欧美一区二区三区| 一区二区成人在线视频 | 国产精品一区二区在线看| 91丝袜呻吟高潮美腿白嫩在线观看| 欧美人狂配大交3d怪物一区| 久久先锋影音av| 亚洲一区二区三区视频在线| 国产综合久久久久久久久久久久| 91网上在线视频| 久久久久国产一区二区三区四区| 亚洲欧美成aⅴ人在线观看| 久久精品久久久精品美女| 99re亚洲国产精品| 精品噜噜噜噜久久久久久久久试看 | 久久99精品久久久久久国产越南| 99久久亚洲一区二区三区青草 | 精品国产一区久久| 亚洲精品视频免费观看| 国产乱码字幕精品高清av| 精品视频一区三区九区| 国产精品久久久久永久免费观看 | 国产成人一级电影| 欧美日本视频在线| 中文字幕综合网| 国产成人一区在线| 欧美一区二区女人| 亚洲国产综合在线| 91色婷婷久久久久合中文| 久久久久99精品国产片| 丝袜亚洲精品中文字幕一区| 91小视频在线观看| 国产精品色眯眯| 国产精品一区在线| 精品免费一区二区三区| 午夜精品久久一牛影视| 欧洲精品在线观看| 亚洲久草在线视频| av网站免费线看精品| 久久精品一区二区三区不卡| 国产一区二区不卡| 中文字幕日韩欧美一区二区三区| 久久精品国产久精国产爱| 欧美日韩国产在线播放网站| 亚洲精品国产无天堂网2021| 成人av在线一区二区| 日本一区二区三级电影在线观看 | 韩国女主播一区| 欧美丰满一区二区免费视频| 亚洲综合一区在线| 一本大道久久精品懂色aⅴ| 国产精品久久久久影视| 北岛玲一区二区三区四区| 国产精品色眯眯| 波多野结衣精品在线| 国产无遮挡一区二区三区毛片日本| 久久99精品国产91久久来源| 91精品久久久久久久久99蜜臂| 五月激情综合婷婷| 在线电影院国产精品| 免费观看在线综合色| 日韩精品一区二区三区在线播放| 久久精品国产99国产| 精品国产凹凸成av人导航| 国产一区二区看久久| 国产欧美日韩三区| 99免费精品在线| 夜夜嗨av一区二区三区| 欧美日韩中文国产| 青青草视频一区| 精品粉嫩aⅴ一区二区三区四区| 黄色日韩三级电影| 国产女主播视频一区二区| 99国内精品久久| 亚洲国产欧美另类丝袜| 日韩一级高清毛片| 国产激情精品久久久第一区二区 | 日韩免费福利电影在线观看| 九九国产精品视频| 欧美国产乱子伦| www.爱久久.com| 亚洲国产精品欧美一二99| 日韩欧美国产综合一区| 成人天堂资源www在线| 亚洲私人黄色宅男| 欧美伦理影视网| 国产综合色精品一区二区三区| 国产精品热久久久久夜色精品三区| 色婷婷av久久久久久久| 性做久久久久久免费观看欧美| 日韩欧美一区中文| 成人黄色免费短视频| 亚洲高清免费视频| 精品久久久久久久久久久久久久久久久 | 亚洲欧美综合色| 337p亚洲精品色噜噜噜| 国产成人综合在线观看| 亚洲黄色av一区| 欧美精品一区男女天堂| 色猫猫国产区一区二在线视频| 日韩成人av影视| 欧美国产成人精品| 337p亚洲精品色噜噜| 成人动漫在线一区| 日韩电影在线一区二区三区| 中文字幕精品在线不卡| 欧美日韩另类国产亚洲欧美一级| 国产麻豆日韩欧美久久| 午夜伊人狠狠久久| 国产精品热久久久久夜色精品三区| 欧美日韩国产片| 99精品在线观看视频| 久久成人羞羞网站| 一二三区精品视频| 国产精品美女视频| 欧美一级xxx| 欧美亚洲丝袜传媒另类| 粗大黑人巨茎大战欧美成人| 蜜乳av一区二区三区|