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

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

?? pluginsmanager.cpp

?? 一個功能強大的代碼編輯器源代碼
?? CPP
字號:
//this file is part of notepad++
//Copyright (C)2003 Don HO ( donho@altern.org )
//
//This program is free software; you can redistribute it and/or
//modify it under the terms of the GNU General Public License
//as published by the Free Software Foundation; either
//version 2 of the License, or (at your option) any later version.
//
//This program is distributed in the hope that it will be useful,
//but WITHOUT ANY WARRANTY; without even the implied warranty of
//MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
//GNU General Public License for more details.
//
//You should have received a copy of the GNU General Public License
//along with this program; if not, write to the Free Software
//Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.

#include <shlwapi.h>
#include "PluginsManager.h"

#define USERMSG "This plugin is not compatible with current version of Notepad++.\n\
Remove this plugin from plugins directory if you don't want to see this message on the next launch time."

bool PluginsManager::loadPlugins(const char *dir)
{
	if (_isDisabled)
		return false;

	vector<string> dllNames;
	const char *pNppPath = (NppParameters::getInstance())->getNppPath();

	string pluginsFullPathFilter = (dir && dir[0])?dir:pNppPath;

	pluginsFullPathFilter += "\\plugins\\*.dll";

	WIN32_FIND_DATA foundData;
	HANDLE hFindFile = ::FindFirstFile(pluginsFullPathFilter.c_str(), &foundData);
	if (hFindFile != INVALID_HANDLE_VALUE)
	{
		string plugins1stFullPath = (dir && dir[0])?dir:pNppPath;
		plugins1stFullPath += "\\plugins\\";
		plugins1stFullPath += foundData.cFileName;
		dllNames.push_back(plugins1stFullPath);

		while (::FindNextFile(hFindFile, &foundData))
		{
			string fullPath = (dir && dir[0])?dir:pNppPath;
			fullPath += "\\plugins\\";
			fullPath += foundData.cFileName;
			dllNames.push_back(fullPath);
		}
		::FindClose(hFindFile);

		size_t i = 0;

		for ( ; i < dllNames.size() ; i++)
		{
			PluginInfo *pi = new PluginInfo;
			try {
				char tmpStr[MAX_PATH];
				strcpy(tmpStr, dllNames[i].c_str());
				strcpy(pi->_moduleName, PathFindFileName(tmpStr));
				
				pi->_hLib = ::LoadLibrary(dllNames[i].c_str());
				if (!pi->_hLib)
					throw string("Load Library is failed.\nMake \"Runtime Library\" setting of this project as \"Multi-threaded(/MT)\" may cure this problem.");

				pi->_pFuncSetInfo = (PFUNCSETINFO)GetProcAddress(pi->_hLib, "setInfo");
							
				if (!pi->_pFuncSetInfo)
					throw string("Missing \"setInfo\" function");

				pi->_pFuncGetName = (PFUNCGETNAME)GetProcAddress(pi->_hLib, "getName");
				if (!pi->_pFuncGetName)
					throw string("Missing \"getName\" function");

				pi->_pBeNotified = (PBENOTIFIED)GetProcAddress(pi->_hLib, "beNotified");
				if (!pi->_pBeNotified)
					throw string("Missing \"beNotified\" function");

				pi->_pMessageProc = (PMESSAGEPROC)GetProcAddress(pi->_hLib, "messageProc");
				if (!pi->_pMessageProc)
					throw string("Missing \"messageProc\" function");

				pi->_pFuncGetFuncsArray = (PFUNCGETFUNCSARRAY)GetProcAddress(pi->_hLib, "getFuncsArray");
				if (!pi->_pFuncGetFuncsArray) 
					throw string("Missing \"getFuncsArray\" function");

				pi->_funcItems = pi->_pFuncGetFuncsArray(&pi->_nbFuncItem);

				if ((!pi->_funcItems) || (pi->_nbFuncItem <= 0))
					throw string("Missing \"FuncItems\" array, or the nb of Function Item is not set correctly");

				for (int c = 0 ; c < pi->_nbFuncItem ; c++)
					if (!pi->_funcItems[c]._pFunc)
						throw string("\"FuncItems\" array is not set correctly");

				pi->_pluginMenu = ::CreateMenu();
				
				pi->_pFuncSetInfo(_nppData);

 
				GetLexerCountFn GetLexerCount = (GetLexerCountFn)::GetProcAddress(pi->_hLib, "GetLexerCount");
				// it's a lexer plugin
				if (GetLexerCount)
				{
					GetLexerNameFn GetLexerName = (GetLexerNameFn)::GetProcAddress(pi->_hLib, "GetLexerName");
					if (!GetLexerName)
						throw string("Loading GetLexerName function failed.");

					GetLexerStatusTextFn GetLexerStatusText = (GetLexerStatusTextFn)::GetProcAddress(pi->_hLib, "GetLexerStatusText");

					if (!GetLexerStatusText)
						throw string("Loading GetLexerStatusText function failed.");

					// Assign a buffer for the lexer name.
					char lexName[MAX_EXTERNAL_LEXER_NAME_LEN];
					strcpy(lexName, "");
					char lexDesc[MAX_EXTERNAL_LEXER_DESC_LEN];
					strcpy(lexDesc, "");

					int numLexers = GetLexerCount();

					NppParameters * nppParams = NppParameters::getInstance();

					ExternalLangContainer *containers[30];
					for (int x = 0; x < numLexers; x++)
					{
						GetLexerName(x, lexName, MAX_EXTERNAL_LEXER_NAME_LEN);
						GetLexerStatusText(x, lexDesc, MAX_EXTERNAL_LEXER_DESC_LEN);
						
						if (!nppParams->isExistingExternalLangName(lexName) && nppParams->ExternalLangHasRoom())
							containers[x] = new ExternalLangContainer(lexName, lexDesc);
						else
							containers[x] = NULL;
					}

					char xmlPath[MAX_PATH];
					strcpy(xmlPath, nppParams->getNppPath());
					PathAppend(xmlPath, "plugins\\Config");
					PathAppend(xmlPath, pi->_moduleName);
					PathRemoveExtension(xmlPath);
					PathAddExtension(xmlPath, ".xml");

					if (!PathFileExists(xmlPath))
					{
						throw string(string(xmlPath) + " is missing.");
					}

					TiXmlDocument *_pXmlDoc = new TiXmlDocument(xmlPath);

					if (!_pXmlDoc->LoadFile())
					{
						delete _pXmlDoc;
						_pXmlDoc = NULL;
						throw string(string(xmlPath) + " failed to load.");
					}
					
					for (int x = 0; x < numLexers; x++) // postpone adding in case the xml is missing/corrupt
						if (containers[x] != NULL)
							nppParams->addExternalLangToEnd(containers[x]);

					nppParams->getExternalLexerFromXmlTree(_pXmlDoc);
					nppParams->getExternalLexerDoc()->push_back(_pXmlDoc);

					::SendMessage(_nppData._scintillaMainHandle, SCI_LOADLEXERLIBRARY, 0, (LPARAM)dllNames[i].c_str());
				}
				_pluginInfos.push_back(pi);
			}
			catch(string s)
			{
				s += "\n\n";
				s += USERMSG;
				::MessageBox(NULL, s.c_str(), dllNames[i].c_str(), MB_OK);
				delete pi;
			}
			catch(...)
			{
				string msg = "Fail loaded";
				msg += "\n\n";
				msg += USERMSG;
				::MessageBox(NULL, msg.c_str(), dllNames[i].c_str(), MB_OK);
				delete pi;
			}
		}
	}

	return true;
}

void PluginsManager::setMenu(HMENU hMenu, const char *menuName)
{
	if (hasPlugins())
	{
		vector<PluginCmdShortcut> & pluginCmdSCList = (NppParameters::getInstance())->getPluginCommandList();
		const char *nom_menu = (menuName && menuName[0])?menuName:"Plugins";

		_hPluginsMenu = ::CreateMenu();
		::InsertMenu(hMenu, 9, MF_BYPOSITION | MF_POPUP, (UINT_PTR)_hPluginsMenu, nom_menu);

		for (size_t i = 0 ; i < _pluginInfos.size() ; i++)
		{
			::InsertMenu(_hPluginsMenu, i, MF_BYPOSITION | MF_POPUP, (UINT_PTR)_pluginInfos[i]->_pluginMenu, _pluginInfos[i]->_pFuncGetName());

			for (int j = 0 ; j < _pluginInfos[i]->_nbFuncItem ; j++)
			{
				_pluginsCommands.push_back(PluginCommand(_pluginInfos[i]->_moduleName, j, _pluginInfos[i]->_funcItems[j]._pFunc));
				int cmdID = ID_PLUGINS_CMD + (_pluginsCommands.size() - 1);
				_pluginInfos[i]->_funcItems[j]._cmdID = cmdID;
				string itemName = _pluginInfos[i]->_funcItems[j]._itemName;

				if (_pluginInfos[i]->_funcItems[j]._pShKey)
				{
					ShortcutKey & sKey = *(_pluginInfos[i]->_funcItems[j]._pShKey);
					PluginCmdShortcut pcs(Shortcut(itemName.c_str(), sKey._isCtrl, sKey._isAlt, sKey._isShift, sKey._key), cmdID, _pluginInfos[i]->_moduleName, j);
					pluginCmdSCList.push_back(pcs);
					itemName += "\t";
					itemName += pcs.toString();
				}
				else
				{	//no ShortcutKey is provided, add an disabled shortcut (so it can still be mapped, Paramaters class can still index any changes and the toolbar wont funk out
					PluginCmdShortcut pcs(Shortcut(itemName.c_str(), false, false, false, 0x00), cmdID, _pluginInfos[i]->_moduleName, j);	//VK_NULL and everything disabled, the menu name is left alone
					pluginCmdSCList.push_back(pcs);
				}
				::InsertMenu(_pluginInfos[i]->_pluginMenu, j, MF_BYPOSITION, cmdID, itemName.c_str());
				if (_pluginInfos[i]->_funcItems[j]._init2Check)
					::CheckMenuItem(_hPluginsMenu, cmdID, MF_BYCOMMAND | MF_CHECKED);
			}
		}
	}
}

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
国产成人精品网址| 欧美丰满少妇xxxxx高潮对白| 免费观看30秒视频久久| 亚洲在线视频网站| 久久亚洲影视婷婷| 国产亚洲va综合人人澡精品| zzijzzij亚洲日本少妇熟睡| 欧美日韩精品一区二区天天拍小说| 91精品久久久久久久久99蜜臂| 久久久久久夜精品精品免费| 亚洲欧美日韩成人高清在线一区| 亚洲综合一二区| 韩国欧美一区二区| 91免费看`日韩一区二区| 亚洲丝袜自拍清纯另类| 亚洲精品视频一区二区| 麻豆视频一区二区| 不卡欧美aaaaa| 欧美一区二区三区男人的天堂| 国产目拍亚洲精品99久久精品| 亚洲精品成人a在线观看| 久久国产精品一区二区| 成人ar影院免费观看视频| 欧美视频一区二区三区| 久久精品在线免费观看| 夜夜嗨av一区二区三区网页| 国产伦精一区二区三区| 在线观看成人免费视频| 国产亚洲va综合人人澡精品| 日韩黄色免费电影| av中文字幕不卡| 精品国产成人在线影院| 一区二区不卡在线视频 午夜欧美不卡在| 久久精品二区亚洲w码| 色综合久久88色综合天天 | 亚洲一区二区欧美| 国产高清久久久久| 欧美日本乱大交xxxxx| 国产精品久久久久久户外露出 | 在线不卡中文字幕播放| 中文文精品字幕一区二区| 七七婷婷婷婷精品国产| 色呦呦国产精品| 国产日韩高清在线| 男人的j进女人的j一区| 欧美性视频一区二区三区| 国产精品女上位| 毛片av一区二区| 欧美日韩国产综合视频在线观看| 亚洲欧洲韩国日本视频| 国产精品亚洲专一区二区三区 | 老色鬼精品视频在线观看播放| 91麻豆国产香蕉久久精品| 中文av一区特黄| 国产麻豆精品久久一二三| 日韩欧美中文字幕制服| 婷婷综合另类小说色区| 色视频一区二区| 国产精品三级av| 懂色av噜噜一区二区三区av| 久久精品在线观看| 狠狠色综合播放一区二区| 日韩欧美在线网站| 日本不卡一二三区黄网| 在线播放一区二区三区| 亚洲chinese男男1069| 91国偷自产一区二区开放时间| 亚洲欧美怡红院| 成人白浆超碰人人人人| 国产精品久久久久久妇女6080| 国产91丝袜在线观看| 久久久不卡网国产精品一区| 国产一区二区不卡| 久久精品人人做人人爽人人| 国产麻豆精品久久一二三| 久久久久一区二区三区四区| 国产精品一区二区三区四区| 26uuu国产在线精品一区二区| 狠狠色丁香婷婷综合久久片| 精品欧美一区二区久久| 狠狠久久亚洲欧美| 久久精品夜夜夜夜久久| 国产**成人网毛片九色 | 成人黄色小视频| 国产精品美女久久久久久久久| 国产不卡视频一区二区三区| 欧美激情一区二区三区不卡| 成人免费视频视频在线观看免费 | 国产成人在线电影| 亚洲国产精品国自产拍av| 成人黄色小视频| 亚洲视频一区二区在线| 在线视频国内一区二区| 亚洲午夜免费福利视频| 欧美一区二区精品在线| 国产一区二区调教| 日本一二三不卡| 91一区二区在线| 亚洲精品成人a在线观看| 欧美日韩精品一区二区三区蜜桃| 琪琪久久久久日韩精品| 久久久夜色精品亚洲| av高清久久久| 亚洲国产日韩在线一区模特| 欧美一区二区三区日韩视频| 韩国三级在线一区| 国产精品成人免费在线| 欧美性欧美巨大黑白大战| 男女性色大片免费观看一区二区| 久久天天做天天爱综合色| 不卡电影一区二区三区| 亚洲午夜一区二区三区| 久久影院午夜片一区| av毛片久久久久**hd| 日本色综合中文字幕| 久久精品一区八戒影视| 欧洲精品中文字幕| 经典三级视频一区| 一区二区三区精品久久久| 欧美一区二区三区成人| k8久久久一区二区三区 | 欧美一二三四在线| 成人av网址在线| 午夜婷婷国产麻豆精品| xfplay精品久久| 91成人免费在线| 蜜臀久久99精品久久久久宅男| 国产精品麻豆久久久| 69久久夜色精品国产69蝌蚪网| 国产99久久久久久免费看农村| 亚洲国产你懂的| 日本一区二区三区国色天香| 欧美日韩国产一区二区三区地区| 国产一区 二区 三区一级| 亚洲精品第1页| 久久久综合九色合综国产精品| 色香蕉久久蜜桃| 国产大片一区二区| 一区二区三区日韩| 国产午夜精品理论片a级大结局 | 久久精品国产一区二区三区免费看| 中文字幕巨乱亚洲| 日韩一区二区在线看| 色系网站成人免费| 国产精品系列在线观看| 日韩精品乱码免费| 亚洲欧美国产高清| 国产网红主播福利一区二区| 91精品国产综合久久久久久久久久| 成人18视频在线播放| 久久99精品网久久| 亚洲成av人片在www色猫咪| 日本一区二区三级电影在线观看| 7777精品久久久大香线蕉| 色悠悠久久综合| 成人中文字幕合集| 国产做a爰片久久毛片| 香蕉乱码成人久久天堂爱免费| 亚洲三级视频在线观看| 日本一区二区三区在线不卡 | 国产麻豆视频精品| 蜜桃av一区二区在线观看| 亚洲第一主播视频| 亚洲精品写真福利| 中文字幕亚洲精品在线观看| 久久精品亚洲精品国产欧美kt∨| 日韩欧美一级二级| 精品视频1区2区| 91国产视频在线观看| 色综合久久综合中文综合网| 成人h动漫精品一区二| 高清不卡在线观看| 国产高清不卡二三区| 国产乱码精品一区二区三区忘忧草| 免费在线观看一区| 日本亚洲欧美天堂免费| 日韩精品乱码免费| 日韩精品午夜视频| 日韩中文字幕麻豆| 三级久久三级久久久| 无吗不卡中文字幕| 婷婷开心激情综合| 丝袜脚交一区二区| 午夜精品久久久久久久久久 | 欧美一级高清片| 91精品国产欧美一区二区成人 | 青青草国产精品97视觉盛宴| 天堂精品中文字幕在线| 日日夜夜免费精品| 日韩中文字幕麻豆| 美女网站视频久久| 韩国av一区二区| 国产成人免费高清| 成人黄色网址在线观看| 99re视频这里只有精品| 在线亚洲免费视频| 欧美三级中文字幕在线观看| 欧美久久久久久蜜桃| 欧美一区二区成人| 久久综合五月天婷婷伊人|