From 4398b312def51a7de4dba53bd300734a5d27d2ce Mon Sep 17 00:00:00 2001 From: donho Date: Thu, 20 Sep 2007 17:21:31 +0000 Subject: [PATCH] [NEW_FEATURE] Star up without plugins. git-svn-id: svn://svn.tuxfamily.org/svnroot/notepadplus/repository@40 f5eea248-9336-0410-98b8-ebc06183d4e3 --- PowerEditor/src/CMakeLists.txt | 32 +++++++++++++++++++------------- PowerEditor/src/Notepad_plus.cpp | 5 ++++- PowerEditor/src/Parameters.h | 4 ++++ PowerEditor/src/winmain.cpp | 5 ++++- 4 files changed, 31 insertions(+), 15 deletions(-) diff --git a/PowerEditor/src/CMakeLists.txt b/PowerEditor/src/CMakeLists.txt index 4d560c798..02acdb457 100644 --- a/PowerEditor/src/CMakeLists.txt +++ b/PowerEditor/src/CMakeLists.txt @@ -38,20 +38,29 @@ SET(projIncludDir ../../scintilla/include/ ./MISC/RegExt/ ./MISC/SysMsg/ ./TinyXml/) - + +set(parameters ./Parameters.h ./Parameters.cpp) + +set(scintilla ./ScitillaComponent/ScintillaEditView.h ./ScitillaComponent/ScintillaEditView.cpp) +set(buffer ./ScitillaComponent/ScintillaEditView.h ./ScitillaComponent/ScintillaEditView.cpp) + +set(tinystr ./TinyXml/tinystr.h ./TinyXml/tinystr.cpp) +set(tinyxml ./TinyXml/tinyxml.h ./TinyXml/tinyxml.cpp) +set(tinyxmlerror ./TinyXml/tinyxmlerror.cpp) +set(tinyxmlparser ./TinyXml/tinyxmlparser.cpp) +SET (tinyxmlObjs ${tinystr} ${tinyxml} ${tinyxmlerror} ${tinyxmlparser}) + SET(objs ./winmain.cpp ./Notepad_plus.cpp ./Notepad_plus.h - ./Parameters.cpp - ./Parameters.h + ./UniConversion.cpp ./UniConversion.h ./Utf8_16.cpp ./Utf8_16.h - ./ScitillaComponent/Buffer.cpp - ./ScitillaComponent/Buffer.h - ./ScitillaComponent/ScintillaEditView.cpp - ./ScitillaComponent/ScintillaEditView.h + + + ./ScitillaComponent/DocTabView.cpp ./ScitillaComponent/DocTabView.h ./ScitillaComponent/FindReplaceDlg.cpp @@ -135,14 +144,11 @@ SET(objs ./winmain.cpp ./MISC/RegExt/regExtDlg.h ./MISC/SysMsg/SysMsg.cpp ./MISC/SysMsg/SysMsg.h - ./TinyXml/tinystr.cpp - ./TinyXml/tinystr.h - ./TinyXml/tinyxml.cpp - ./TinyXml/tinyxml.h - ./TinyXml/tinyxmlerror.cpp - ./TinyXml/tinyxmlparser.cpp + ${tinyxmlObjs} + ) + SET(rcFiles ./Notepad_plus.rc ./ScitillaComponent/FindReplaceDlg.rc ./ScitillaComponent/UserDefineDialog.rc diff --git a/PowerEditor/src/Notepad_plus.cpp b/PowerEditor/src/Notepad_plus.cpp index 922453eea..29ed7cf12 100644 --- a/PowerEditor/src/Notepad_plus.cpp +++ b/PowerEditor/src/Notepad_plus.cpp @@ -5672,7 +5672,10 @@ LRESULT Notepad_plus::runProc(HWND hwnd, UINT Message, WPARAM wParam, LPARAM lPa nppData._scintillaSecondHandle = _subEditView.getHSelf(); _pluginsManager.init(nppData); - _pluginsManager.loadPlugins(); + + if (!pNppParam->isNoPlugin()) + _pluginsManager.loadPlugins(); + const char *appDataNpp = pNppParam->getAppDataNppDir(); if (appDataNpp[0]) _pluginsManager.loadPlugins(appDataNpp); diff --git a/PowerEditor/src/Parameters.h b/PowerEditor/src/Parameters.h index bbb1469d5..e0ae3af3b 100644 --- a/PowerEditor/src/Parameters.h +++ b/PowerEditor/src/Parameters.h @@ -885,6 +885,9 @@ public: void setLineNumber2go(int ln) {_lineNumber2Go = ln;}; int getLineNumber2go() const {return _lineNumber2Go;}; + void setIsNoPlugin(bool noPlugin) {_noPlugin = noPlugin;}; + bool isNoPlugin() const {return _noPlugin;}; + bool isRemappingShortcut() const {return _shortcuts.size() != 0;}; vector & getUserShortcuts() {return _shortcuts;}; @@ -958,6 +961,7 @@ private: LangType _defLangType; int _lineNumber2Go; + bool _noPlugin; // All Styles (colours & fonts) LexerStylerArray _lexerStylerArray; diff --git a/PowerEditor/src/winmain.cpp b/PowerEditor/src/winmain.cpp index 1a9b481bc..d0dcf4e0c 100644 --- a/PowerEditor/src/winmain.cpp +++ b/PowerEditor/src/winmain.cpp @@ -182,6 +182,7 @@ static int getLn2GoFromParam(char *list2Clean) { }; const char FLAG_MULTI_INSTANCE[] = "-multiInst"; +const char FLAG_NO_PLUGIN[] = "-noPlugin"; int WINAPI WinMain(HINSTANCE hInstance, HINSTANCE, LPSTR lpszCmdLine, int nCmdShow) { @@ -193,9 +194,10 @@ int WINAPI WinMain(HINSTANCE hInstance, HINSTANCE, LPSTR lpszCmdLine, int nCmdSh TheFirstOne = false; bool multiInstance = isInList(FLAG_MULTI_INSTANCE, lpszCmdLine); + bool noPlugin = isInList(FLAG_NO_PLUGIN, lpszCmdLine); LangType langType = getLangTypeFromParam(lpszCmdLine); int lineNumber = getLn2GoFromParam(lpszCmdLine); - + NppParameters *pNppParameters = NppParameters::getInstance(); if ((!multiInstance) && (!TheFirstOne)) @@ -264,6 +266,7 @@ int WINAPI WinMain(HINSTANCE hInstance, HINSTANCE, LPSTR lpszCmdLine, int nCmdSh } pNppParameters->setDefLang(langType); pNppParameters->setLineNumber2go(lineNumber); + pNppParameters->setIsNoPlugin(noPlugin); notepad_plus_plus.init(hInstance, NULL, pPathNames);