Add Plugins Administrator (UI part, in progress)

This commit is contained in:
Don Ho 2016-11-11 18:11:19 +01:00
parent 8f2977a018
commit c235e17f7d
23 changed files with 1221 additions and 280 deletions

View File

@ -60,9 +60,13 @@ bool PluginsManager::unloadPlugin(int index, HWND nppHandle)
//_pluginInfos[index]->_pluginMenu = NULL; //_pluginInfos[index]->_pluginMenu = NULL;
if (::FreeLibrary(_pluginInfos[index]->_hLib)) if (::FreeLibrary(_pluginInfos[index]->_hLib))
{
_pluginInfos[index]->_hLib = nullptr; _pluginInfos[index]->_hLib = nullptr;
printStr(TEXT("we're good"));
}
else else
printStr(TEXT("not ok")); printStr(TEXT("not ok"));
//delete _pluginInfos[index]; //delete _pluginInfos[index];
// printInt(index); // printInt(index);
//vector<PluginInfo *>::iterator it = _pluginInfos.begin() + index; //vector<PluginInfo *>::iterator it = _pluginInfos.begin() + index;
@ -139,7 +143,7 @@ int PluginsManager::loadPlugin(const TCHAR *pluginFilePath, vector<generic_strin
PluginInfo *pi = new PluginInfo; PluginInfo *pi = new PluginInfo;
try try
{ {
pi->_moduleName = PathFindFileName(pluginFilePath); pi->_moduleName = pluginFileName;
if (GetBinaryArchitectureType(pluginFilePath) != ARCH_TYPE) if (GetBinaryArchitectureType(pluginFilePath) != ARCH_TYPE)
throw generic_string(ARCH_ERR_MSG); throw generic_string(ARCH_ERR_MSG);
@ -267,7 +271,7 @@ int PluginsManager::loadPlugin(const TCHAR *pluginFilePath, vector<generic_strin
::SendMessage(_nppData._scintillaMainHandle, SCI_LOADLEXERLIBRARY, 0, reinterpret_cast<LPARAM>(pDllName)); ::SendMessage(_nppData._scintillaMainHandle, SCI_LOADLEXERLIBRARY, 0, reinterpret_cast<LPARAM>(pDllName));
} }
addInLoadedDlls(pluginFileName); addInLoadedDlls(pluginFilePath, pluginFileName);
_pluginInfos.push_back(pi); _pluginInfos.push_back(pi);
return static_cast<int32_t>(_pluginInfos.size() - 1); return static_cast<int32_t>(_pluginInfos.size() - 1);
} }
@ -625,7 +629,7 @@ generic_string PluginsManager::getLoadedPluginNames() const
generic_string pluginPaths; generic_string pluginPaths;
for (size_t i = 0; i < _loadedDlls.size(); ++i) for (size_t i = 0; i < _loadedDlls.size(); ++i)
{ {
pluginPaths += _loadedDlls[i]; pluginPaths += _loadedDlls[i]._fileName;
pluginPaths += TEXT(" "); pluginPaths += TEXT(" ");
} }
return pluginPaths; return pluginPaths;

View File

@ -26,24 +26,12 @@
// Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. // Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
#ifndef PLUGINSMANAGER_H #pragma once
#define PLUGINSMANAGER_H
#ifndef RESOURCE_H
#include "resource.h" #include "resource.h"
#endif //RESOURCE_H
#ifndef PARAMETERS_H
#include "Parameters.h" #include "Parameters.h"
#endif //PARAMETERS_H
#ifndef PLUGININTERFACE_H
#include "PluginInterface.h" #include "PluginInterface.h"
#endif //PLUGININTERFACE_H
#ifndef IDALLOCATOR_H
#include "IDAllocator.h" #include "IDAllocator.h"
#endif // IDALLOCATOR_H
typedef BOOL (__cdecl * PFUNCISUNICODE)(); typedef BOOL (__cdecl * PFUNCISUNICODE)();
@ -83,8 +71,17 @@ struct PluginInfo
generic_string _funcName; generic_string _funcName;
}; };
struct LoadedDllInfo
{
generic_string _fullFilePath;
generic_string _fileName;
LoadedDllInfo(const generic_string & fullFilePath, const generic_string & fileName) : _fullFilePath(fullFilePath), _fileName(fileName) {};
};
class PluginsManager class PluginsManager
{ {
friend class PluginsAdminDlg;
public: public:
PluginsManager() : _dynamicIDAlloc(ID_PLUGINS_CMD_DYNAMIC, ID_PLUGINS_CMD_DYNAMIC_LIMIT), PluginsManager() : _dynamicIDAlloc(ID_PLUGINS_CMD_DYNAMIC, ID_PLUGINS_CMD_DYNAMIC_LIMIT),
_markerAlloc(MARKER_PLUGINS, MARKER_PLUGINS_LIMIT) {} _markerAlloc(MARKER_PLUGINS, MARKER_PLUGINS_LIMIT) {}
@ -135,7 +132,7 @@ private:
std::vector<PluginInfo *> _pluginInfos; std::vector<PluginInfo *> _pluginInfos;
std::vector<PluginCommand> _pluginsCommands; std::vector<PluginCommand> _pluginsCommands;
std::vector<generic_string> _loadedDlls; std::vector<LoadedDllInfo> _loadedDlls;
bool _isDisabled = false; bool _isDisabled = false;
IDAllocator _dynamicIDAlloc; IDAllocator _dynamicIDAlloc;
IDAllocator _markerAlloc; IDAllocator _markerAlloc;
@ -151,13 +148,13 @@ private:
bool isInLoadedDlls(const TCHAR *fn) const bool isInLoadedDlls(const TCHAR *fn) const
{ {
for (size_t i = 0; i < _loadedDlls.size(); ++i) for (size_t i = 0; i < _loadedDlls.size(); ++i)
if (generic_stricmp(fn, _loadedDlls[i].c_str()) == 0) if (generic_stricmp(fn, _loadedDlls[i]._fileName.c_str()) == 0)
return true; return true;
return false; return false;
} }
void addInLoadedDlls(const TCHAR *fn) { void addInLoadedDlls(const TCHAR *fullPath, const TCHAR *fn) {
_loadedDlls.push_back(fn); _loadedDlls.push_back(LoadedDllInfo(fullPath, fn));
} }
}; };
@ -167,5 +164,3 @@ private:
typedef int (EXT_LEXER_DECL *GetLexerCountFn)(); typedef int (EXT_LEXER_DECL *GetLexerCountFn)();
typedef void (EXT_LEXER_DECL *GetLexerNameFn)(unsigned int Index, char *name, int buflength); typedef void (EXT_LEXER_DECL *GetLexerNameFn)(unsigned int Index, char *name, int buflength);
typedef void (EXT_LEXER_DECL *GetLexerStatusTextFn)(unsigned int Index, TCHAR *desc, int buflength); typedef void (EXT_LEXER_DECL *GetLexerStatusTextFn)(unsigned int Index, TCHAR *desc, int buflength);
#endif //PLUGINSMANAGER_H

View File

@ -265,6 +265,7 @@ LRESULT Notepad_plus::init(HWND hwnd)
_configStyleDlg.init(_pPublicInterface->getHinst(), hwnd); _configStyleDlg.init(_pPublicInterface->getHinst(), hwnd);
_preference.init(_pPublicInterface->getHinst(), hwnd); _preference.init(_pPublicInterface->getHinst(), hwnd);
_pluginsAdminDlg.init(_pPublicInterface->getHinst(), hwnd);
//Marker Margin config //Marker Margin config
_mainEditView.setMakerStyle(svp1._folderStyle); _mainEditView.setMakerStyle(svp1._folderStyle);

View File

@ -25,105 +25,35 @@
// along with this program; if not, write to the Free Software // along with this program; if not, write to the Free Software
// Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. // Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
#ifndef NOTEPAD_PLUS_H #pragma once
#define NOTEPAD_PLUS_H
#ifndef SCINTILLA_EDIT_VIEW_H
#include "ScintillaEditView.h" #include "ScintillaEditView.h"
#endif //SCINTILLA_EDIT_VIEW_H
#ifndef DOCTABVIEW_H
#include "DocTabView.h" #include "DocTabView.h"
#endif //DOCTABVIEW_H
#ifndef SPLITTER_CONTAINER_H
#include "SplitterContainer.h" #include "SplitterContainer.h"
#endif //SPLITTER_CONTAINER_H
#ifndef FIND_REPLACE_DLG_H
#include "FindReplaceDlg.h" #include "FindReplaceDlg.h"
#endif //FIND_REPLACE_DLG_H
#ifndef ABOUT_DLG_H
#include "AboutDlg.h" #include "AboutDlg.h"
#endif //ABOUT_DLG_H
#ifndef RUN_DLG_H
#include "RunDlg.h" #include "RunDlg.h"
#endif //RUN_DLG_H
#ifndef STATUS_BAR_H
#include "StatusBar.h" #include "StatusBar.h"
#endif //STATUS_BAR_H
#ifndef LASTRECENTFILELIST_H
#include "lastRecentFileList.h" #include "lastRecentFileList.h"
#endif //LASTRECENTFILELIST_H
#ifndef GOTILINE_DLG_H
#include "GoToLineDlg.h" #include "GoToLineDlg.h"
#endif //GOTILINE_DLG_H
#ifndef FINDCHARSINRANGE_DLG_H
#include "FindCharsInRange.h" #include "FindCharsInRange.h"
#endif //FINDCHARSINRANGE_DLG_H
#ifndef COLUMNEDITOR_H
#include "columnEditor.h" #include "columnEditor.h"
#endif //COLUMNEDITOR_H
#ifndef WORD_STYLE_H
#include "WordStyleDlg.h" #include "WordStyleDlg.h"
#endif //WORD_STYLE_H
#ifndef TRAY_ICON_CONTROLER_H
#include "trayIconControler.h" #include "trayIconControler.h"
#endif //TRAY_ICON_CONTROLER_H
#ifndef PLUGINSMANAGER_H
#include "PluginsManager.h" #include "PluginsManager.h"
#endif //PLUGINSMANAGER_H
/* /*
#ifndef NOTEPAD_PLUS_MSGS_H
#include "Notepad_plus_msgs.h" #include "Notepad_plus_msgs.h"
#endif //NOTEPAD_PLUS_MSGS_H
*/ */
#ifndef PREFERENCE_DLG_H
#include "preferenceDlg.h" #include "preferenceDlg.h"
#endif //PREFERENCE_DLG_H
#ifndef WINDOWS_DLG_H
#include "WindowsDlg.h" #include "WindowsDlg.h"
#endif //WINDOWS_DLG_H
#ifndef RUN_MACRO_DLG_H
#include "RunMacroDlg.h" #include "RunMacroDlg.h"
#endif //RUN_MACRO_DLG_H
#ifndef DOCKINGMANAGER_H
#include "DockingManager.h" #include "DockingManager.h"
#endif //DOCKINGMANAGER_H
#ifndef PROCESSUS_H
#include "Processus.h" #include "Processus.h"
#endif //PROCESSUS_H
#ifndef AUTOCOMPLETION_H
#include "AutoCompletion.h" #include "AutoCompletion.h"
#endif //AUTOCOMPLETION_H
#ifndef SMARTHIGHLIGHTER_H
#include "SmartHighlighter.h" #include "SmartHighlighter.h"
#endif //SMARTHIGHLIGHTER_H
#ifndef SCINTILLACTRLS_H
#include "ScintillaCtrls.h" #include "ScintillaCtrls.h"
#endif //SCINTILLACTRLS_H
#ifndef SIZE_DLG_H
#include "lesDlgs.h" #include "lesDlgs.h"
#endif //SIZE_DLG_H #include "pluginsAdmin.h"
#include "localization.h" #include "localization.h"
#include "md5Dlgs.h" #include "md5Dlgs.h"
#include <vector> #include <vector>
@ -354,6 +284,7 @@ private:
WordStyleDlg _configStyleDlg; WordStyleDlg _configStyleDlg;
PreferenceDlg _preference; PreferenceDlg _preference;
FindCharsInRangeDlg _findCharsInRangeDlg; FindCharsInRangeDlg _findCharsInRangeDlg;
PluginsAdminDlg _pluginsAdminDlg;
// a handle list of all the Notepad++ dialogs // a handle list of all the Notepad++ dialogs
std::vector<HWND> _hModelessDlgs; std::vector<HWND> _hModelessDlgs;
@ -668,4 +599,3 @@ private:
}; };
#endif //NOTEPAD_PLUS_H

View File

@ -61,6 +61,8 @@ void Notepad_plus::macroPlayback(Macro macro)
_playingBackMacro = false; _playingBackMacro = false;
} }
void Notepad_plus::command(int id) void Notepad_plus::command(int id)
{ {
switch (id) switch (id)
@ -68,6 +70,18 @@ void Notepad_plus::command(int id)
case IDM_FILE_NEW: case IDM_FILE_NEW:
{ {
fileNew(); fileNew();
/*
bool isFirstTime = not _pluginsAdminDlg.isCreated();
_pluginsAdminDlg.setPluginsManager(&_pluginsManager);
_pluginsAdminDlg.doDialog(_nativeLangSpeaker.isRTL());
if (isFirstTime)
{
_nativeLangSpeaker.changeConfigLang(_pluginsAdminDlg.getHSelf());
_pluginsAdminDlg.getPluginList();
_pluginsAdminDlg.loadFomList();
}
*/
} }
break; break;

View File

@ -2516,7 +2516,6 @@ void FindInFinderDlg::doDialog(Finder *launcher, bool isRTL)
} }
void FindReplaceDlg::doDialog(DIALOG_TYPE whichType, bool isRTL, bool toShow) void FindReplaceDlg::doDialog(DIALOG_TYPE whichType, bool isRTL, bool toShow)
{ {
if (!isCreated()) if (!isCreated())

View File

@ -49,7 +49,7 @@ void ListView::init(HINSTANCE hInst, HWND parent)
_hSelf = ::CreateWindow(WC_LISTVIEW, _hSelf = ::CreateWindow(WC_LISTVIEW,
TEXT(""), TEXT(""),
WS_CHILD | listViewStyles, WS_CHILD | WS_BORDER | listViewStyles,
0, 0,
0, 0,
0, 0,
@ -67,158 +67,68 @@ void ListView::init(HINSTANCE hInst, HWND parent)
_defaultProc = reinterpret_cast<WNDPROC>(::SetWindowLongPtr(_hSelf, GWLP_WNDPROC, reinterpret_cast<LONG_PTR>(staticProc))); _defaultProc = reinterpret_cast<WNDPROC>(::SetWindowLongPtr(_hSelf, GWLP_WNDPROC, reinterpret_cast<LONG_PTR>(staticProc)));
DWORD exStyle = ListView_GetExtendedListViewStyle(_hSelf); DWORD exStyle = ListView_GetExtendedListViewStyle(_hSelf);
exStyle |= LVS_EX_FULLROWSELECT | LVS_EX_BORDERSELECT ; exStyle |= LVS_EX_FULLROWSELECT | LVS_EX_BORDERSELECT | _extraStyle;
ListView_SetExtendedListViewStyle(_hSelf, exStyle); ListView_SetExtendedListViewStyle(_hSelf, exStyle);
if (_columnInfos.size())
{
LVCOLUMN lvColumn; LVCOLUMN lvColumn;
lvColumn.mask = LVCF_TEXT|LVCF_WIDTH; lvColumn.mask = LVCF_TEXT | LVCF_WIDTH;
NativeLangSpeaker *pNativeSpeaker = (NppParameters::getInstance())->getNativeLangSpeaker(); short i = 0;
generic_string valStr = pNativeSpeaker->getAttrNameStr(TEXT("Value"), "AsciiInsertion", "ColumnVal"); for (auto it = _columnInfos.begin(); it != _columnInfos.end(); ++it)
generic_string hexStr = pNativeSpeaker->getAttrNameStr(TEXT("Hex"), "AsciiInsertion", "ColumnHex");
generic_string charStr = pNativeSpeaker->getAttrNameStr(TEXT("Character"), "AsciiInsertion", "ColumnChar");
lvColumn.cx = NppParameters::getInstance()->_dpiManager.scaleX(45);
lvColumn.pszText = const_cast<TCHAR *>(valStr.c_str());
ListView_InsertColumn(_hSelf, 0, &lvColumn);
lvColumn.cx = NppParameters::getInstance()->_dpiManager.scaleY(45);;
lvColumn.pszText = const_cast<TCHAR *>(hexStr.c_str());
ListView_InsertColumn(_hSelf, 1, &lvColumn);
lvColumn.cx = NppParameters::getInstance()->_dpiManager.scaleY(70);;
lvColumn.pszText = const_cast<TCHAR *>(charStr.c_str());
ListView_InsertColumn(_hSelf, 2, &lvColumn);
}
void ListView::resetValues(int codepage)
{
if (codepage == -1)
codepage = 0;
if (_codepage == codepage)
return;
ListView_DeleteAllItems(_hSelf);
setValues(codepage);
}
generic_string ListView::getAscii(unsigned char value)
{
switch (value)
{ {
case 0: lvColumn.cx = static_cast<int>(it->_width);
return TEXT("NULL"); lvColumn.pszText = const_cast<TCHAR *>(it->_label.c_str());
case 1: ListView_InsertColumn(_hSelf, ++i, &lvColumn);
return TEXT("SOH");
case 2:
return TEXT("STX");
case 3:
return TEXT("ETX");
case 4:
return TEXT("EOT");
case 5:
return TEXT("ENQ");
case 6:
return TEXT("ACK");
case 7:
return TEXT("BEL");
case 8:
return TEXT("BS");
case 9:
return TEXT("TAB");
case 10:
return TEXT("LF");
case 11:
return TEXT("VT");
case 12:
return TEXT("FF");
case 13:
return TEXT("CR");
case 14:
return TEXT("SO");
case 15:
return TEXT("SI");
case 16:
return TEXT("DLE");
case 17:
return TEXT("DC1");
case 18:
return TEXT("DC2");
case 19:
return TEXT("DC3");
case 20:
return TEXT("DC4");
case 21:
return TEXT("NAK");
case 22:
return TEXT("SYN");
case 23:
return TEXT("ETB");
case 24:
return TEXT("CAN");
case 25:
return TEXT("EM");
case 26:
return TEXT("SUB");
case 27:
return TEXT("ESC");
case 28:
return TEXT("FS");
case 29:
return TEXT("GS");
case 30:
return TEXT("RS");
case 31:
return TEXT("US");
case 32:
return TEXT("Space");
case 127:
return TEXT("DEL");
default:
{
TCHAR charStr[10];
char ascii[2];
ascii[0] = value;
ascii[1] = '\0';
MultiByteToWideChar(_codepage, 0, ascii, -1, charStr, sizeof(charStr));
return charStr;
} }
} }
} }
void ListView::setValues(int codepage)
{
_codepage = codepage;
for (int i = 0 ; i < 256 ; ++i)
{
LVITEM item;
item.mask = LVIF_TEXT;
TCHAR dec[8];
TCHAR hex[8];
generic_sprintf(dec, TEXT("%d"), i);
generic_sprintf(hex, TEXT("%02X"), i);
item.pszText = dec;
item.iItem = i;
item.iSubItem = 0;
ListView_InsertItem(_hSelf, &item);
ListView_SetItemText(_hSelf, i, 1, hex);
generic_string s = getAscii(static_cast<unsigned char>(i));
ListView_SetItemText(_hSelf, i, 2, const_cast<LPTSTR>(s.c_str()));
}
}
void ListView::destroy() void ListView::destroy()
{ {
::DestroyWindow(_hSelf); ::DestroyWindow(_hSelf);
_hSelf = NULL; _hSelf = NULL;
} }
void ListView::addLine(const std::vector<generic_string> & values2Add, LPARAM lParam, int pos2insert)
{
if (not values2Add.size())
return;
if (pos2insert == -1)
pos2insert = static_cast<int>(nbItem());
auto it = values2Add.begin();
LVITEM item;
item.mask = LVIF_TEXT | LVIF_PARAM;
item.pszText = const_cast<TCHAR *>(it->c_str());
item.iItem = pos2insert;
item.iSubItem = 0;
item.lParam = lParam;
ListView_InsertItem(_hSelf, &item);
++it;
int j = 0;
for (; it != values2Add.end(); ++it)
{
ListView_SetItemText(_hSelf, pos2insert, ++j, const_cast<TCHAR *>(it->c_str()));
}
}
LPARAM ListView::getLParamFromIndex(int itemIndex) const
{
LVITEM item;
item.mask = LVIF_PARAM;
item.iItem = itemIndex;
ListView_GetItem(_hSelf, &item);
return item.lParam;
}
LRESULT ListView::runProc(HWND hwnd, UINT Message, WPARAM wParam, LPARAM lParam) LRESULT ListView::runProc(HWND hwnd, UINT Message, WPARAM wParam, LPARAM lParam)
{ {

View File

@ -26,29 +26,63 @@
// Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. // Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
#ifndef LISTVIEW_H #pragma once
#define LISTVIEW_H
#include "Window.h" #include "Window.h"
#include "Common.h" #include "Common.h"
#include <Commctrl.h>
struct columnInfo {
size_t _width;
generic_string _label;
columnInfo(const generic_string & label, size_t width) : _width(width), _label(label) {};
};
class ListView : public Window class ListView : public Window
{ {
public: public:
ListView() : Window() {}; ListView() : Window() {};
virtual ~ListView() {}; virtual ~ListView() {};
// addColumn() should be called before init()
void addColumn(const columnInfo & column2Add) {
_columnInfos.push_back(column2Add);
};
// setStyleOption() should be called before init()
void setStyleOption(int32_t extraStyle) {
_extraStyle = extraStyle;
};
void addLine(const std::vector<generic_string> & values2Add, LPARAM lParam = 0, int pos2insert = -1);
size_t nbItem() const {
return ListView_GetItemCount(_hSelf);
};
long getSelectedIndex() const {
return ListView_GetSelectionMark(_hSelf);
};
void setSelection(int itemIndex) const {
ListView_SetItemState(_hSelf, itemIndex, LVIS_SELECTED | LVIS_FOCUSED, LVIS_SELECTED | LVIS_FOCUSED);
ListView_EnsureVisible(_hSelf, itemIndex, false);
ListView_SetSelectionMark(_hSelf, itemIndex);
};
LPARAM getLParamFromIndex(int itemIndex) const;
virtual void init(HINSTANCE hInst, HWND hwnd); virtual void init(HINSTANCE hInst, HWND hwnd);
virtual void destroy(); virtual void destroy();
void setValues(int codepage = 0);
void resetValues(int codepage);
generic_string getAscii(unsigned char value);
protected: protected:
int _codepage = -1; WNDPROC _defaultProc = nullptr;
WNDPROC _defaultProc; int32_t _extraStyle = 0;
std::vector<columnInfo> _columnInfos;
LRESULT runProc(HWND hwnd, UINT Message, WPARAM wParam, LPARAM lParam); LRESULT runProc(HWND hwnd, UINT Message, WPARAM wParam, LPARAM lParam);
static LRESULT CALLBACK staticProc(HWND hwnd, UINT Message, WPARAM wParam, LPARAM lParam) { static LRESULT CALLBACK staticProc(HWND hwnd, UINT Message, WPARAM wParam, LPARAM lParam) {
@ -56,5 +90,3 @@ protected:
}; };
}; };
#endif // LISTVIEW_H

View File

@ -28,6 +28,7 @@
#include "ansiCharPanel.h" #include "ansiCharPanel.h"
#include "ScintillaEditView.h" #include "ScintillaEditView.h"
#include "localization.h"
void AnsiCharPanel::switchEncoding() void AnsiCharPanel::switchEncoding()
{ {
@ -41,6 +42,16 @@ INT_PTR CALLBACK AnsiCharPanel::run_dlgProc(UINT message, WPARAM wParam, LPARAM
{ {
case WM_INITDIALOG : case WM_INITDIALOG :
{ {
NppParameters *nppParam = NppParameters::getInstance();
NativeLangSpeaker *pNativeSpeaker = nppParam->getNativeLangSpeaker();
generic_string valStr = pNativeSpeaker->getAttrNameStr(TEXT("Value"), "AsciiInsertion", "ColumnVal");
generic_string hexStr = pNativeSpeaker->getAttrNameStr(TEXT("Hex"), "AsciiInsertion", "ColumnHex");
generic_string charStr = pNativeSpeaker->getAttrNameStr(TEXT("Character"), "AsciiInsertion", "ColumnChar");
_listView.addColumn(columnInfo(valStr, nppParam->_dpiManager.scaleX(45)));
_listView.addColumn(columnInfo(hexStr, nppParam->_dpiManager.scaleX(45)));
_listView.addColumn(columnInfo(charStr, nppParam->_dpiManager.scaleX(70)));
_listView.init(_hInst, _hSelf); _listView.init(_hInst, _hSelf);
int codepage = (*_ppEditView)->getCurrentBuffer()->getEncoding(); int codepage = (*_ppEditView)->getCurrentBuffer()->getEncoding();
_listView.setValues(codepage==-1?0:codepage); _listView.setValues(codepage==-1?0:codepage);
@ -71,7 +82,7 @@ INT_PTR CALLBACK AnsiCharPanel::run_dlgProc(UINT message, WPARAM wParam, LPARAM
{ {
case VK_RETURN: case VK_RETURN:
{ {
int i = ListView_GetSelectionMark(_listView.getHSelf()); int i = _listView.getSelectedIndex();
if (i == -1) if (i == -1)
return TRUE; return TRUE;

View File

@ -26,18 +26,15 @@
// Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. // Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
#ifndef ANSICHARPANEL_H #pragma once
#define ANSICHARPANEL_H
#include <windows.h> #include <windows.h>
#include <commctrl.h> #include <commctrl.h>
#ifndef DOCKINGDLGINTERFACE_H
#include "DockingDlgInterface.h" #include "DockingDlgInterface.h"
#endif //DOCKINGDLGINTERFACE_H
#include "ansiCharPanel_rc.h" #include "ansiCharPanel_rc.h"
#include "ListView.h" #include "ListView.h"
#include "asciiListView.h"
#define AI_PROJECTPANELTITLE TEXT("ASCII Insertion Panel") #define AI_PROJECTPANELTITLE TEXT("ASCII Insertion Panel")
@ -78,6 +75,6 @@ protected:
private: private:
ScintillaEditView **_ppEditView = nullptr; ScintillaEditView **_ppEditView = nullptr;
ListView _listView; AsciiListView _listView;
}; };
#endif // ANSICHARPANEL_H

View File

@ -0,0 +1,149 @@
// This file is part of Notepad++ project
// Copyright (C)2016 Don HO <don.h@free.fr>
//
// 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.
//
// Note that the GPL places important restrictions on "derived works", yet
// it does not provide a detailed definition of that term. To avoid
// misunderstandings, we consider an application to constitute a
// "derivative work" for the purpose of this license if it does any of the
// following:
// 1. Integrates source code from Notepad++.
// 2. Integrates/includes/aggregates Notepad++ into a proprietary executable
// installer, such as those produced by InstallShield.
// 3. Links to a library or executes a program that does any of the above.
//
// 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 "asciiListView.h"
#include "Parameters.h"
void AsciiListView::resetValues(int codepage)
{
if (codepage == -1)
codepage = 0;
if (_codepage == codepage)
return;
ListView_DeleteAllItems(_hSelf);
setValues(codepage);
}
generic_string AsciiListView::getAscii(unsigned char value)
{
switch (value)
{
case 0:
return TEXT("NULL");
case 1:
return TEXT("SOH");
case 2:
return TEXT("STX");
case 3:
return TEXT("ETX");
case 4:
return TEXT("EOT");
case 5:
return TEXT("ENQ");
case 6:
return TEXT("ACK");
case 7:
return TEXT("BEL");
case 8:
return TEXT("BS");
case 9:
return TEXT("TAB");
case 10:
return TEXT("LF");
case 11:
return TEXT("VT");
case 12:
return TEXT("FF");
case 13:
return TEXT("CR");
case 14:
return TEXT("SO");
case 15:
return TEXT("SI");
case 16:
return TEXT("DLE");
case 17:
return TEXT("DC1");
case 18:
return TEXT("DC2");
case 19:
return TEXT("DC3");
case 20:
return TEXT("DC4");
case 21:
return TEXT("NAK");
case 22:
return TEXT("SYN");
case 23:
return TEXT("ETB");
case 24:
return TEXT("CAN");
case 25:
return TEXT("EM");
case 26:
return TEXT("SUB");
case 27:
return TEXT("ESC");
case 28:
return TEXT("FS");
case 29:
return TEXT("GS");
case 30:
return TEXT("RS");
case 31:
return TEXT("US");
case 32:
return TEXT("Space");
case 127:
return TEXT("DEL");
default:
{
TCHAR charStr[10];
char ascii[2];
ascii[0] = value;
ascii[1] = '\0';
MultiByteToWideChar(_codepage, 0, ascii, -1, charStr, sizeof(charStr));
return charStr;
}
}
}
void AsciiListView::setValues(int codepage)
{
_codepage = codepage;
for (int i = 0 ; i < 256 ; ++i)
{
TCHAR dec[8];
TCHAR hex[8];
generic_sprintf(dec, TEXT("%d"), i);
generic_sprintf(hex, TEXT("%02X"), i);
generic_string s = getAscii(static_cast<unsigned char>(i));
std::vector<generic_string> values2Add;
values2Add.push_back(dec);
values2Add.push_back(hex);
values2Add.push_back(s);
addLine(values2Add);
}
}

View File

@ -0,0 +1,42 @@
// This file is part of Notepad++ project
// Copyright (C)2016 Don HO <don.h@free.fr>
//
// 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.
//
// Note that the GPL places important restrictions on "derived works", yet
// it does not provide a detailed definition of that term. To avoid
// misunderstandings, we consider an application to constitute a
// "derivative work" for the purpose of this license if it does any of the
// following:
// 1. Integrates source code from Notepad++.
// 2. Integrates/includes/aggregates Notepad++ into a proprietary executable
// installer, such as those produced by InstallShield.
// 3. Links to a library or executes a program that does any of the above.
//
// 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.
#pragma once
#include "ListView.h"
class AsciiListView : public ListView
{
public:
void setValues(int codepage = 0);
void resetValues(int codepage);
generic_string getAscii(unsigned char value);
private:
int _codepage = -1;
};

View File

@ -26,8 +26,7 @@
// Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. // Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
#ifndef COLOUR_PICKER_H #pragma once
#define COLOUR_PICKER_H
#include "Window.h" #include "Window.h"
@ -64,4 +63,3 @@ private :
void drawBackground(HDC hDC); void drawBackground(HDC hDC);
}; };
#endif // COLOUR_PICKER_H

View File

@ -24,6 +24,8 @@
// You should have received a copy of the GNU General Public License // You should have received a copy of the GNU General Public License
// along with this program; if not, write to the Free Software // along with this program; if not, write to the Free Software
// Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. // Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
#pragma once #pragma once
#include "ColourPopupResource.h" #include "ColourPopupResource.h"
#include "resource.h" #include "resource.h"
@ -33,7 +35,6 @@
#define WM_PICKUP_CANCEL (COLOURPOPUP_USER + 2) #define WM_PICKUP_CANCEL (COLOURPOPUP_USER + 2)
class ColourPopup : public Window class ColourPopup : public Window
{ {
public : public :

View File

@ -26,8 +26,7 @@
// Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. // Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
#ifndef WORD_STYLE_H #pragma once
#define WORD_STYLE_H
#include "ColourPicker.h" #include "ColourPicker.h"
#include "WordStyleDlgRes.h" #include "WordStyleDlgRes.h"
@ -238,5 +237,3 @@ private :
_isShownGOCtrls = show; _isShownGOCtrls = show;
}; };
}; };
#endif //WORD_STYLE_H

View File

@ -0,0 +1,618 @@
// This file is part of Notepad++ project
// Copyright (C)2017 Don HO <don.h@free.fr>
//
// 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.
//
// Note that the GPL places important restrictions on "derived works", yet
// it does not provide a detailed definition of that term. To avoid
// misunderstandings, we consider an application to constitute a
// "derivative work" for the purpose of this license if it does any of the
// following:
// 1. Integrates source code from Notepad++.
// 2. Integrates/includes/aggregates Notepad++ into a proprietary executable
// installer, such as those produced by InstallShield.
// 3. Links to a library or executes a program that does any of the above.
//
// 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 <algorithm>
#include <string>
#include <cctype>
#include <shlobj.h>
#include <shlwapi.h>
#include <uxtheme.h>
#include "pluginsAdmin.h"
#include "ScintillaEditView.h"
#include "localization.h"
#include "PluginsManager.h"
#include "md5.h"
using namespace std;
void Version::setVersionFrom(generic_string filePath)
{
if (not filePath.empty() && ::PathFileExists(filePath.c_str()))
{
DWORD handle;
DWORD bufferSize = ::GetFileVersionInfoSize(filePath.c_str(), &handle);
if (bufferSize <= 0)
return;
unsigned char* buffer = new unsigned char[bufferSize];
::GetFileVersionInfo(filePath.c_str(), handle, bufferSize, buffer);
VS_FIXEDFILEINFO* lpFileInfo;
UINT cbFileInfo = 0;
VerQueryValue(buffer, TEXT("\\"), (LPVOID*)&lpFileInfo, &cbFileInfo);
if (cbFileInfo)
{
_major = (lpFileInfo->dwFileVersionMS & 0xFFFF0000) >> 16;
_minor = lpFileInfo->dwFileVersionMS & 0x0000FFFF;
_patch = (lpFileInfo->dwFileVersionLS & 0xFFFF0000) >> 16;
_build = lpFileInfo->dwFileVersionLS & 0x0000FFFF;
}
}
}
generic_string Version::toString()
{
std::wstring v = std::to_wstring(_major);
v += TEXT(".");
v += std::to_wstring(_minor);
v += TEXT(".");
v += std::to_wstring(_patch);
v += TEXT(".");
v += std::to_wstring(_build);
return v;
}
generic_string PluginUpdateInfo::describe()
{
generic_string desc;
const TCHAR *EOL = TEXT("\r\n");
if (not description.empty())
{
desc = description;
desc += EOL;
}
if (not author.empty())
{
desc += TEXT("Author: ");
desc += author;
desc += EOL;
}
if (not homepage.empty())
{
desc += TEXT("Homepage: ");
desc += homepage;
desc += EOL;
}
return desc;
}
/// Try to find in the Haystack the Needle - ignore case
bool findStrNoCase(const generic_string & strHaystack, const generic_string & strNeedle)
{
auto it = std::search(
strHaystack.begin(), strHaystack.end(),
strNeedle.begin(), strNeedle.end(),
[](char ch1, char ch2){return std::toupper(ch1) == std::toupper(ch2); }
);
return (it != strHaystack.end());
}
LoadedPluginInfo::LoadedPluginInfo(const generic_string & fullFilePath, const generic_string & filename)
{
if (not::PathFileExists(fullFilePath.c_str()))
return;
_fullFilePath = fullFilePath;
_name = filename;
WcharMbcsConvertor *wmc = WcharMbcsConvertor::getInstance();
const char *path = wmc->wchar2char(fullFilePath.c_str(), CP_ACP);
MD5 md5;
_id = wmc->char2wchar(md5.digestFile(path), CP_ACP);
_version.setVersionFrom(fullFilePath);
}
long PluginsAdminDlg::searchFromCurrentSel(generic_string str2search, bool inWhichPart, bool isNextMode) const
{
// search from curent selected item or from the beginning
long currentIndex = _availableListView.getSelectedIndex();
int nbItem = static_cast<int>(_availableListView.nbItem());
if (currentIndex == -1)
{
// no selection, let's search from 0 to the end
for (int i = 0; i < nbItem; ++i)
{
size_t j = _availableListView.getLParamFromIndex(i);
generic_string searchIn;
if (inWhichPart == inNames)
searchIn = _availablePluginList[j].name;
else //(inWhichPart == inDescs)
searchIn = _availablePluginList[j].description;
if (findStrNoCase(searchIn, str2search))
return i;
}
}
else
{
// with selection, let's search from currentIndex
// from current position to the end
for (int i = currentIndex + (isNextMode ? 1 : 0); i < nbItem; ++i)
{
size_t j = _availableListView.getLParamFromIndex(i);
generic_string searchIn;
if (inWhichPart == inNames)
searchIn = _availablePluginList[j].name;
else //(inWhichPart == inDescs)
searchIn = _availablePluginList[j].description;
if (findStrNoCase(searchIn, str2search))
return i;
}
// from to begining to current position
for (int i = 0; i < currentIndex + (isNextMode ? 1 : 0); ++i)
{
size_t j = _availableListView.getLParamFromIndex(i);
generic_string searchIn;
if (inWhichPart == inNames)
searchIn = _availablePluginList[j].name;
else //(inWhichPart == inDescs)
searchIn = _availablePluginList[j].description;
if (findStrNoCase(searchIn, str2search))
return i;
}
}
return -1;
}
/*
// Search only in the list of current panel
// return -1 if not found
long PluginsAdminDlg::searchPlugin(generic_string str2search, bool isNextMode)
{
// search in the names of plugins
long i = searchInNamesFromCurrentSel(str2search, isNextMode);
// if not found, search in description
if (i == -1)
i = searchInDescsFromCurrentSel(str2search, isNextMode);
return i;
}
*/
void PluginsAdminDlg::create(int dialogID, bool isRTL)
{
StaticDialog::create(dialogID, isRTL);
RECT rect;
getClientRect(rect);
_tab.init(_hInst, _hSelf, false, false, true);
int tabDpiDynamicalHeight = NppParameters::getInstance()->_dpiManager.scaleY(13);
_tab.setFont(TEXT("Tahoma"), tabDpiDynamicalHeight);
const TCHAR *available = TEXT("Available");
const TCHAR *updates = TEXT("Updates");
const TCHAR *installed = TEXT("Installed");
_tab.insertAtEnd(available);
_tab.insertAtEnd(updates);
_tab.insertAtEnd(installed);
rect.bottom -= 100;;
_tab.reSizeTo(rect);
_tab.display();
const long marge = 10;
const int topMarge = 42;
HWND hResearchLabel = ::GetDlgItem(_hSelf, IDC_PLUGINADM_RESEARCH_STATIC);
RECT researchLabelRect;
::GetClientRect(hResearchLabel, &researchLabelRect);
researchLabelRect.left = rect.left;
researchLabelRect.top = topMarge + 2;
::MoveWindow(hResearchLabel, researchLabelRect.left, researchLabelRect.top, researchLabelRect.right, researchLabelRect.bottom, TRUE);
::InvalidateRect(hResearchLabel, nullptr, TRUE);
HWND hResearchEdit = ::GetDlgItem(_hSelf, IDC_PLUGINADM_RESEARCH_EDIT);
RECT researchEditRect;
::GetClientRect(hResearchEdit, &researchEditRect);
researchEditRect.left = researchLabelRect.right + marge;
researchEditRect.top = topMarge;
::MoveWindow(hResearchEdit, researchEditRect.left, researchEditRect.top, researchEditRect.right, researchEditRect.bottom, TRUE);
::InvalidateRect(hResearchEdit, nullptr, TRUE);
HWND hNextButton = ::GetDlgItem(_hSelf, IDC_PLUGINADM_RESEARCH_NEXT);
RECT researchNextRect;
::GetClientRect(hNextButton, &researchNextRect);
researchNextRect.left = researchEditRect.left + researchEditRect.right + marge;
researchNextRect.top = topMarge;
::MoveWindow(hNextButton, researchNextRect.left, researchNextRect.top, researchNextRect.right, researchNextRect.bottom, TRUE);
::InvalidateRect(hNextButton, nullptr, TRUE);
HWND hActionButton = ::GetDlgItem(_hSelf, IDC_PLUGINADM_INSTALL);
RECT actionRect;
::GetClientRect(hActionButton, &actionRect);
long w = actionRect.right - actionRect.left;
actionRect.left = rect.right - w - marge;
actionRect.top = topMarge;
::MoveWindow(hActionButton, actionRect.left, actionRect.top, actionRect.right, actionRect.bottom, TRUE);
::InvalidateRect(hActionButton, nullptr, TRUE);
hActionButton = ::GetDlgItem(_hSelf, IDC_PLUGINADM_UPDATE);
::MoveWindow(hActionButton, actionRect.left, actionRect.top, actionRect.right, actionRect.bottom, TRUE);
::InvalidateRect(hActionButton, nullptr, TRUE);
hActionButton = ::GetDlgItem(_hSelf, IDC_PLUGINADM_REMOVE);
::MoveWindow(hActionButton, actionRect.left, actionRect.top, actionRect.right, actionRect.bottom, TRUE);
::InvalidateRect(hActionButton, nullptr, TRUE);
long actionZoneHeight = 50;
rect.top += actionZoneHeight;
rect.bottom -= actionZoneHeight;
RECT listRect = rect;
RECT descRect = rect;
long descHeight = rect.bottom / 3 - marge * 2;
long listHeight = (rect.bottom / 3) * 2 - marge * 3;
listRect.top += marge;
listRect.bottom = listHeight;
listRect.left += marge;
listRect.right -= marge * 2;
descRect.top += listHeight + marge * 3;
descRect.bottom = descHeight;
descRect.left += marge;
descRect.right -= marge * 2;
NppParameters *nppParam = NppParameters::getInstance();
NativeLangSpeaker *pNativeSpeaker = nppParam->getNativeLangSpeaker();
generic_string pluginStr = pNativeSpeaker->getAttrNameStr(TEXT("Plugin"), "PluginAdmin", "Plugin");
generic_string vesionStr = pNativeSpeaker->getAttrNameStr(TEXT("Version"), "PluginAdmin", "Version");
generic_string stabilityStr = pNativeSpeaker->getAttrNameStr(TEXT("Stability"), "PluginAdmin", "Stability");
_availableListView.addColumn(columnInfo(pluginStr, nppParam->_dpiManager.scaleX(200)));
_availableListView.addColumn(columnInfo(vesionStr, nppParam->_dpiManager.scaleX(100)));
_availableListView.addColumn(columnInfo(stabilityStr, nppParam->_dpiManager.scaleX(70)));
_availableListView.setStyleOption(LVS_EX_CHECKBOXES);
_availableListView.init(_hInst, _hSelf);
_availableListView.reSizeTo(listRect);
//_availableListView.display();
_updateListView.addColumn(columnInfo(pluginStr, nppParam->_dpiManager.scaleX(200)));
_updateListView.addColumn(columnInfo(vesionStr, nppParam->_dpiManager.scaleX(100)));
_updateListView.addColumn(columnInfo(stabilityStr, nppParam->_dpiManager.scaleX(70)));
_updateListView.setStyleOption(LVS_EX_CHECKBOXES);
_updateListView.init(_hInst, _hSelf);
_updateListView.reSizeTo(listRect);
//_updateListView.display(false);
_installedListView.addColumn(columnInfo(pluginStr, nppParam->_dpiManager.scaleX(200)));
_installedListView.addColumn(columnInfo(vesionStr, nppParam->_dpiManager.scaleX(100)));
_installedListView.addColumn(columnInfo(stabilityStr, nppParam->_dpiManager.scaleX(70)));
_installedListView.setStyleOption(LVS_EX_CHECKBOXES);
_installedListView.init(_hInst, _hSelf);
_installedListView.reSizeTo(listRect);
//_installedListView.display(false);
HWND hDesc = ::GetDlgItem(_hSelf, IDC_PLUGINADM_EDIT);
::MoveWindow(hDesc, descRect.left, descRect.top, descRect.right, descRect.bottom, TRUE);
::InvalidateRect(hDesc, nullptr, TRUE);
switchDialog(0);
ETDTProc enableDlgTheme = (ETDTProc)::SendMessage(_hParent, NPPM_GETENABLETHEMETEXTUREFUNC, 0, 0);
if (enableDlgTheme)
enableDlgTheme(_hSelf, ETDT_ENABLETAB);
goToCenter();
}
bool PluginsAdminDlg::getPluginList()
{
generic_string pluginListXmlPath(TEXT("c:\\tmp\\pl.xml"));
_pPluginsXmlDoc = new TiXmlDocument(pluginListXmlPath);
if (not _pPluginsXmlDoc->LoadFile())
return false;
return true;
}
bool PluginsAdminDlg::readFromXml()
{
TiXmlNode *root = _pPluginsXmlDoc->FirstChild(TEXT("NotepadPlus"));
if (not root)
return false;
_availablePluginList.clear();
for (TiXmlNode *childNode = root->FirstChildElement(TEXT("plugin"));
childNode;
childNode = childNode->NextSibling(TEXT("plugin")))
{
PluginUpdateInfo pui;
const TCHAR *name = (childNode->ToElement())->Attribute(TEXT("name"));
if (name)
{
pui.name = name;
}
else
{
continue;
}
const TCHAR *version = (childNode->ToElement())->Attribute(TEXT("version"));
if (version)
{
pui.version = version;
}
else
{
continue;
}
const TCHAR *homepage = (childNode->ToElement())->Attribute(TEXT("homepage"));
if (homepage)
{
pui.homepage = homepage;
}
const TCHAR *sourceUrl = (childNode->ToElement())->Attribute(TEXT("sourceUrl"));
if (sourceUrl)
{
pui.sourceUrl = sourceUrl;
}
const TCHAR *description = (childNode->ToElement())->Attribute(TEXT("description"));
if (description)
{
pui.description = description;
}
const TCHAR *author = (childNode->ToElement())->Attribute(TEXT("author"));
if (author)
{
pui.author = author;
}
else
{
continue;
}
const TCHAR *md5 = (childNode->ToElement())->Attribute(TEXT("md5"));
if (md5)
{
pui.md5 = md5;
}
else
{
continue;
}
const TCHAR *alias = (childNode->ToElement())->Attribute(TEXT("alias"));
if (alias)
{
pui.alias = alias;
}
const TCHAR *download = (childNode->ToElement())->Attribute(TEXT("download"));
if (download)
{
pui.download = download;
}
else
{
continue;
}
_availablePluginList.push_back(pui);
}
return true;
}
bool PluginsAdminDlg::loadFomList()
{
if (not _pPluginsXmlDoc)
return false;
if (not readFromXml())
return false;
size_t i = 0;
// all - installed = available
for (auto it = _availablePluginList.begin(); it != _availablePluginList.end(); ++it)
{
vector<generic_string> values2Add;
values2Add.push_back(it->name);
values2Add.push_back(it->version);
values2Add.push_back(TEXT("Yes"));
_availableListView.addLine(values2Add, i++);
}
getLoadedPluginInfos();
return true;
}
bool PluginsAdminDlg::getLoadedPluginInfos()
{
if (not _pPluginsManager)
return false;
for (auto it = _pPluginsManager->_loadedDlls.begin(); it != _pPluginsManager->_loadedDlls.end(); ++it)
{
LoadedPluginInfo lpi(it->_fullFilePath, it->_fileName);
_loadedPluginInfos.push_back(lpi);
}
return true;
}
// begin insentive-case search from the second key-in character
bool PluginsAdminDlg::searchInPlugins(bool isNextMode) const
{
const int maxLen = 256;
TCHAR txt2search[maxLen];
::GetDlgItemText(_hSelf, IDC_PLUGINADM_RESEARCH_EDIT, txt2search, maxLen);
if (lstrlen(txt2search) < 2)
return false;
long foundIndex = searchInNamesFromCurrentSel(txt2search, isNextMode);
if (foundIndex == -1)
foundIndex = searchInDescsFromCurrentSel(txt2search, isNextMode);
if (foundIndex == -1)
return false;
_availableListView.setSelection(foundIndex);
return true;
}
void PluginsAdminDlg::switchDialog(int indexToSwitch)
{
bool showAvailable, showUpdate, showInstalled;
switch (indexToSwitch)
{
case 0: // available plugins
showAvailable = true;
showUpdate = false;
showInstalled = false;
break;
case 1: // to be updated plugins
showAvailable = false;
showUpdate = true;
showInstalled = false;
break;
case 2: // installed plugin
showAvailable = false;
showUpdate = false;
showInstalled = true;
break;
default:
return;
}
HWND hInstallButton = ::GetDlgItem(_hSelf, IDC_PLUGINADM_INSTALL);
HWND hUpdateButton = ::GetDlgItem(_hSelf, IDC_PLUGINADM_UPDATE);
HWND hRemoveButton = ::GetDlgItem(_hSelf, IDC_PLUGINADM_REMOVE);
::ShowWindow(hInstallButton, showAvailable ? SW_SHOW : SW_HIDE);
::EnableWindow(hInstallButton, showAvailable);
::ShowWindow(hUpdateButton, showUpdate ? SW_SHOW : SW_HIDE);
::EnableWindow(hUpdateButton, showUpdate);
::ShowWindow(hRemoveButton, showInstalled ? SW_SHOW : SW_HIDE);
::EnableWindow(hRemoveButton, showInstalled);
_availableListView.display(showAvailable);
_updateListView.display(showUpdate);
_installedListView.display(showInstalled);
}
INT_PTR CALLBACK PluginsAdminDlg::run_dlgProc(UINT message, WPARAM wParam, LPARAM lParam)
{
switch (message)
{
case WM_INITDIALOG :
{
return TRUE;
}
case WM_COMMAND :
{
if (HIWORD(wParam) == EN_CHANGE)
{
switch (LOWORD(wParam))
{
case IDC_PLUGINADM_RESEARCH_EDIT:
{
searchInPlugins(false);
return TRUE;
}
}
}
switch (wParam)
{
case IDCANCEL :
case IDOK :
display(false);
return TRUE;
case IDC_PLUGINADM_RESEARCH_NEXT:
searchInPlugins(true);
return true;
default :
break;
}
return FALSE;
}
case WM_NOTIFY :
{
LPNMHDR pnmh = reinterpret_cast<LPNMHDR>(lParam);
if (pnmh->code == TCN_SELCHANGE)
{
HWND tabHandle = _tab.getHSelf();
if (pnmh->hwndFrom == tabHandle)
{
int indexClicked = int(::SendMessage(tabHandle, TCM_GETCURSEL, 0, 0));
switchDialog(indexClicked);
}
}
else if (pnmh->hwndFrom == _availableListView.getHSelf() && pnmh->code == LVN_ITEMCHANGED)
{
LPNMLISTVIEW pnmv = (LPNMLISTVIEW)lParam;
if (pnmv->uChanged & LVIF_STATE)
{
if (pnmv->uNewState & LVIS_SELECTED)
{
size_t infoIndex = _availableListView.getLParamFromIndex(pnmv->iItem);
generic_string desc = _availablePluginList[infoIndex].describe();
::SetDlgItemText(_hSelf, IDC_PLUGINADM_EDIT, desc.c_str());
}
}
}
return TRUE;
}
case WM_DESTROY :
{
return TRUE;
}
}
return FALSE;
}

View File

@ -0,0 +1,143 @@
// This file is part of Notepad++ project
// Copyright (C)2017 Don HO <don.h@free.fr>
//
// 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.
//
// Note that the GPL places important restrictions on "derived works", yet
// it does not provide a detailed definition of that term. To avoid
// misunderstandings, we consider an application to constitute a
// "derivative work" for the purpose of this license if it does any of the
// following:
// 1. Integrates source code from Notepad++.
// 2. Integrates/includes/aggregates Notepad++ into a proprietary executable
// installer, such as those produced by InstallShield.
// 3. Links to a library or executes a program that does any of the above.
//
// 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.
#pragma once
#include "StaticDialog.h"
#include "pluginsAdminRes.h"
#include "TabBar.h"
#include "ListView.h"
#include "tinyxml.h"
class PluginsManager;
struct PluginUpdateInfo
{
generic_string name;
generic_string version;
generic_string homepage;
generic_string sourceUrl;
generic_string description;
generic_string author;
generic_string md5;
generic_string alias;
generic_string download;
generic_string describe();
};
struct Version
{
unsigned long _major = 0;
unsigned long _minor = 0;
unsigned long _patch = 0;
unsigned long _build = 0;
void setVersionFrom(generic_string filePath);
generic_string toString();
};
struct LoadedPluginInfo
{
generic_string _fullFilePath;
generic_string _id;
generic_string _name; // found from id/hash (or product name - retrieved from binary) or file name
Version _version;
LoadedPluginInfo(const generic_string & fullFilePath, const generic_string & filename);
};
class PluginsAdminDlg final : public StaticDialog
{
public :
PluginsAdminDlg() {};
~PluginsAdminDlg() {
_availableListView.destroy();
_updateListView.destroy();
_installedListView.destroy();
if (_pPluginsXmlDoc) delete _pPluginsXmlDoc;
}
void init(HINSTANCE hInst, HWND parent) {
Window::init(hInst, parent);
};
virtual void create(int dialogID, bool isRTL = false);
void doDialog(bool isRTL = false) {
if (!isCreated())
{
create(IDD_PLUGINSADMIN_DLG, isRTL);
}
if (!::IsWindowVisible(_hSelf))
{
}
display();
};
void switchDialog(int indexToSwitch);
bool getPluginList(); // call WinGup fo the 1st time
bool loadFomList();
void setPluginsManager(PluginsManager *pluginsManager) { _pPluginsManager = pluginsManager; };
//long searchPlugin(generic_string str2search, bool isNextMode);
protected:
virtual INT_PTR CALLBACK run_dlgProc(UINT message, WPARAM wParam, LPARAM lParam);
private :
TabBar _tab;
ListView _availableListView;
ListView _updateListView;
ListView _installedListView;
std::vector<PluginUpdateInfo> _availablePluginList;
std::vector<PluginUpdateInfo> _updatePluginList;
std::vector<PluginUpdateInfo> _installedPluginList;
TiXmlDocument *_pPluginsXmlDoc = nullptr;
PluginsManager *_pPluginsManager = nullptr;
std::vector<LoadedPluginInfo> _loadedPluginInfos;
bool readFromXml();
bool searchInPlugins(bool isNextMode) const;
const bool inNames = true;
const bool inDescs = false;
long searchFromCurrentSel(generic_string str2search, bool inWhichPart, bool isNextMode) const;
long searchInNamesFromCurrentSel(generic_string str2search, bool isNextMode) const {
return searchFromCurrentSel(str2search, inNames, isNextMode);
};
long searchInDescsFromCurrentSel(generic_string str2search, bool isNextMode) const {
return searchFromCurrentSel(str2search, inDescs, isNextMode);
};
bool getLoadedPluginInfos();
};

View File

@ -0,0 +1,53 @@
// This file is part of Notepad++ project
// Copyright (C)2003 Don HO <don.h@free.fr>
//
// 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.
//
// Note that the GPL places important restrictions on "derived works", yet
// it does not provide a detailed definition of that term. To avoid
// misunderstandings, we consider an application to constitute a
// "derivative work" for the purpose of this license if it does any of the
// following:
// 1. Integrates source code from Notepad++.
// 2. Integrates/includes/aggregates Notepad++ into a proprietary executable
// installer, such as those produced by InstallShield.
// 3. Links to a library or executes a program that does any of the above.
//
// 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 "windows.h"
#include "pluginsAdminRes.h"
#ifndef IDC_STATIC
#define IDC_STATIC -1
#endif
IDD_PLUGINSADMIN_DLG DIALOGEX 36, 44, 500, 300
STYLE DS_SETFONT | DS_3DLOOK | DS_FIXEDSYS | WS_POPUP | WS_CAPTION | WS_SYSMENU
EXSTYLE WS_EX_TOOLWINDOW
CAPTION "Plugins Manager"
FONT 8, "MS Shell Dlg", 0, 0, 0x0
BEGIN
RTEXT "Research: ",IDC_PLUGINADM_RESEARCH_STATIC,50,38,50,8
EDITTEXT IDC_PLUGINADM_RESEARCH_EDIT,160,35,150,14,ES_AUTOHSCROLL
PUSHBUTTON "Next", IDC_PLUGINADM_RESEARCH_NEXT,332,35,57,14
PUSHBUTTON "Install", IDC_PLUGINADM_INSTALL,432,35,57,14
PUSHBUTTON "Update", IDC_PLUGINADM_UPDATE,432,35,57,14
PUSHBUTTON "Remove", IDC_PLUGINADM_REMOVE,432,35,57,14
//LISTBOX IDC_PLUGINADM_LISTVIEW,30,20,78,120,LBS_NOINTEGRALHEIGHT | WS_VSCROLL | WS_TABSTOP
EDITTEXT IDC_PLUGINADM_EDIT,30,160,220,80,ES_MULTILINE | ES_AUTOVSCROLL | ES_READONLY | WS_BORDER | WS_VSCROLL
PUSHBUTTON "Close", IDCANCEL,332,270,57,14
PUSHBUTTON "Settings",IDC_PLUGINADM_SETTINGS_BUTTON,255,270,69,14
END

View File

@ -0,0 +1,40 @@
// This file is part of Notepad++ project
// Copyright (C)2003 Don HO <don.h@free.fr>
//
// 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.
//
// Note that the GPL places important restrictions on "derived works", yet
// it does not provide a detailed definition of that term. To avoid
// misunderstandings, we consider an application to constitute a
// "derivative work" for the purpose of this license if it does any of the
// following:
// 1. Integrates source code from Notepad++.
// 2. Integrates/includes/aggregates Notepad++ into a proprietary executable
// installer, such as those produced by InstallShield.
// 3. Links to a library or executes a program that does any of the above.
//
// 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.
#define IDD_PLUGINSADMIN_DLG 5500
#define IDC_PLUGINADM_RESEARCH_STATIC (IDD_PLUGINSADMIN_DLG + 1)
#define IDC_PLUGINADM_RESEARCH_EDIT (IDD_PLUGINSADMIN_DLG + 2)
#define IDC_PLUGINADM_INSTALL (IDD_PLUGINSADMIN_DLG + 3)
#define IDC_PLUGINADM_UPDATE (IDD_PLUGINSADMIN_DLG + 4)
#define IDC_PLUGINADM_REMOVE (IDD_PLUGINSADMIN_DLG + 5)
#define IDC_PLUGINADM_LISTVIEW (IDD_PLUGINSADMIN_DLG + 6)
#define IDC_PLUGINADM_EDIT (IDD_PLUGINSADMIN_DLG + 7)
#define IDC_PLUGINADM_RESEARCH_NEXT (IDD_PLUGINSADMIN_DLG + 8)
#define IDC_PLUGINADM_SETTINGS_BUTTON (IDD_PLUGINSADMIN_DLG + 9)

View File

@ -24,12 +24,11 @@
// You should have received a copy of the GNU General Public License // You should have received a copy of the GNU General Public License
// along with this program; if not, write to the Free Software // along with this program; if not, write to the Free Software
// Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. // Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
#pragma once #pragma once
#include <windows.h> #include <windows.h>
class Window class Window
{ {
public: public:

View File

@ -274,12 +274,11 @@ INT_PTR CALLBACK WindowsDlg::run_dlgProc(UINT message, WPARAM wParam, LPARAM lPa
{ {
if (wParam == IDC_WINDOWS_LIST) if (wParam == IDC_WINDOWS_LIST)
{ {
NMHDR* pNMHDR = (NMHDR*)lParam; NMHDR* pNMHDR = reinterpret_cast<NMHDR*>(lParam);
if (pNMHDR->code == LVN_GETDISPINFO) if (pNMHDR->code == LVN_GETDISPINFO)
{ {
NMLVDISPINFO *pLvdi = (NMLVDISPINFO *)pNMHDR; NMLVDISPINFO *pLvdi = (NMLVDISPINFO *)pNMHDR;
//if(pLvdi->item.mask & LVIF_IMAGE)
// ;
if(pLvdi->item.mask & LVIF_TEXT) if(pLvdi->item.mask & LVIF_TEXT)
{ {
pLvdi->item.pszText[0] = 0; pLvdi->item.pszText[0] = 0;

View File

@ -362,6 +362,9 @@
// See shortcutRc.h // See shortcutRc.h
//#define IDD_SHORTCUT_DLG 5000 //#define IDD_SHORTCUT_DLG 5000
// See pluginsAdminRes.h
//#define IDD_PLUGINSADMIN_DLG 5500
// See preference.rc // See preference.rc
//#define IDD_PREFERENCE_BOX 6000 //#define IDD_PREFERENCE_BOX 6000

View File

@ -94,7 +94,7 @@
<ClCompile> <ClCompile>
<Optimization>Disabled</Optimization> <Optimization>Disabled</Optimization>
<FavorSizeOrSpeed>Neither</FavorSizeOrSpeed> <FavorSizeOrSpeed>Neither</FavorSizeOrSpeed>
<AdditionalIncludeDirectories>..\src\WinControls\AboutDlg;..\..\scintilla\include;..\include;..\src\WinControls;..\src\WinControls\ImageListSet;..\src\WinControls\OpenSaveFileDialog;..\src\WinControls\SplitterContainer;..\src\WinControls\StaticDialog;..\src\WinControls\TabBar;..\src\WinControls\ToolBar;..\src\MISC\Process;..\src\ScitillaComponent;..\src\MISC;..\src\MISC\SysMsg;..\src\WinControls\StatusBar;..\src;..\src\WinControls\StaticDialog\RunDlg;..\src\tinyxml;..\src\WinControls\ColourPicker;..\src\Win32Explr;..\src\MISC\RegExt;..\src\WinControls\TrayIcon;..\src\WinControls\shortcut;..\src\WinControls\Grid;..\src\WinControls\ContextMenu;..\src\MISC\PluginsManager;..\src\WinControls\Preference;..\src\WinControls\WindowsDlg;..\src\WinControls\TaskList;..\src\WinControls\DockingWnd;..\src\WinControls\ToolTip;..\src\MISC\Exception;..\src\MISC\Common;..\src\tinyxml\tinyXmlA;..\src\WinControls\AnsiCharPanel;..\src\WinControls\ClipboardHistory;..\src\WinControls\FindCharsInRange;..\src\WinControls\VerticalFileSwitcher;..\src\WinControls\ProjectPanel;..\src\WinControls\DocumentMap;..\src\WinControls\FunctionList;..\src\uchardet;..\src\WinControls\FileBrowser;..\src\WinControls\ReadDirectoryChanges;..\src\MISC\md5;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories> <AdditionalIncludeDirectories>..\src\WinControls\AboutDlg;..\..\scintilla\include;..\include;..\src\WinControls;..\src\WinControls\ImageListSet;..\src\WinControls\OpenSaveFileDialog;..\src\WinControls\SplitterContainer;..\src\WinControls\StaticDialog;..\src\WinControls\TabBar;..\src\WinControls\ToolBar;..\src\MISC\Process;..\src\ScitillaComponent;..\src\MISC;..\src\MISC\SysMsg;..\src\WinControls\StatusBar;..\src;..\src\WinControls\StaticDialog\RunDlg;..\src\tinyxml;..\src\WinControls\ColourPicker;..\src\Win32Explr;..\src\MISC\RegExt;..\src\WinControls\TrayIcon;..\src\WinControls\shortcut;..\src\WinControls\Grid;..\src\WinControls\ContextMenu;..\src\MISC\PluginsManager;..\src\WinControls\Preference;..\src\WinControls\WindowsDlg;..\src\WinControls\TaskList;..\src\WinControls\DockingWnd;..\src\WinControls\ToolTip;..\src\MISC\Exception;..\src\MISC\Common;..\src\tinyxml\tinyXmlA;..\src\WinControls\AnsiCharPanel;..\src\WinControls\ClipboardHistory;..\src\WinControls\FindCharsInRange;..\src\WinControls\VerticalFileSwitcher;..\src\WinControls\ProjectPanel;..\src\WinControls\DocumentMap;..\src\WinControls\FunctionList;..\src\uchardet;..\src\WinControls\FileBrowser;..\src\WinControls\ReadDirectoryChanges;..\src\MISC\md5;..\src\WinControls\pluginsAdmin;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<PreprocessorDefinitions>WIN32;_WIN32_WINNT=0x0501;_WINDOWS;_USE_64BIT_TIME_T;TIXML_USE_STL;TIXMLA_USE_STL;_CRT_NONSTDC_NO_DEPRECATE;_CRT_SECURE_NO_WARNINGS;_CRT_NON_CONFORMING_SWPRINTFS=1;%(PreprocessorDefinitions)</PreprocessorDefinitions> <PreprocessorDefinitions>WIN32;_WIN32_WINNT=0x0501;_WINDOWS;_USE_64BIT_TIME_T;TIXML_USE_STL;TIXMLA_USE_STL;_CRT_NONSTDC_NO_DEPRECATE;_CRT_SECURE_NO_WARNINGS;_CRT_NON_CONFORMING_SWPRINTFS=1;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<ExceptionHandling>Async</ExceptionHandling> <ExceptionHandling>Async</ExceptionHandling>
<BasicRuntimeChecks>UninitializedLocalUsageCheck</BasicRuntimeChecks> <BasicRuntimeChecks>UninitializedLocalUsageCheck</BasicRuntimeChecks>
@ -107,7 +107,7 @@
</ClCompile> </ClCompile>
<Link> <Link>
<AdditionalOptions>/fixed:no %(AdditionalOptions)</AdditionalOptions> <AdditionalOptions>/fixed:no %(AdditionalOptions)</AdditionalOptions>
<AdditionalDependencies>comctl32.lib;shlwapi.lib;shell32.lib;Oleacc.lib;Dbghelp.lib;%(AdditionalDependencies)</AdditionalDependencies> <AdditionalDependencies>comctl32.lib;shlwapi.lib;shell32.lib;Oleacc.lib;Dbghelp.lib;version.lib;%(AdditionalDependencies)</AdditionalDependencies>
<ShowProgress>LinkVerboseLib</ShowProgress> <ShowProgress>LinkVerboseLib</ShowProgress>
<OutputFile>$(OutDir)notepad++.exe</OutputFile> <OutputFile>$(OutDir)notepad++.exe</OutputFile>
<Version>1.0</Version> <Version>1.0</Version>
@ -129,7 +129,7 @@
<ClCompile> <ClCompile>
<Optimization>Disabled</Optimization> <Optimization>Disabled</Optimization>
<FavorSizeOrSpeed>Neither</FavorSizeOrSpeed> <FavorSizeOrSpeed>Neither</FavorSizeOrSpeed>
<AdditionalIncludeDirectories>..\src\WinControls\AboutDlg;..\..\scintilla\include;..\include;..\src\WinControls;..\src\WinControls\ImageListSet;..\src\WinControls\OpenSaveFileDialog;..\src\WinControls\SplitterContainer;..\src\WinControls\StaticDialog;..\src\WinControls\TabBar;..\src\WinControls\ToolBar;..\src\MISC\Process;..\src\ScitillaComponent;..\src\MISC;..\src\MISC\SysMsg;..\src\WinControls\StatusBar;..\src;..\src\WinControls\StaticDialog\RunDlg;..\src\tinyxml;..\src\WinControls\ColourPicker;..\src\Win32Explr;..\src\MISC\RegExt;..\src\WinControls\TrayIcon;..\src\WinControls\shortcut;..\src\WinControls\Grid;..\src\WinControls\ContextMenu;..\src\MISC\PluginsManager;..\src\WinControls\Preference;..\src\WinControls\WindowsDlg;..\src\WinControls\TaskList;..\src\WinControls\DockingWnd;..\src\WinControls\ToolTip;..\src\MISC\Exception;..\src\MISC\Common;..\src\tinyxml\tinyXmlA;..\src\WinControls\AnsiCharPanel;..\src\WinControls\ClipboardHistory;..\src\WinControls\FindCharsInRange;..\src\WinControls\VerticalFileSwitcher;..\src\WinControls\ProjectPanel;..\src\WinControls\DocumentMap;..\src\WinControls\FunctionList;..\src\uchardet;..\src\WinControls\FileBrowser;..\src\WinControls\ReadDirectoryChanges;..\src\MISC\md5;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories> <AdditionalIncludeDirectories>..\src\WinControls\AboutDlg;..\..\scintilla\include;..\include;..\src\WinControls;..\src\WinControls\ImageListSet;..\src\WinControls\OpenSaveFileDialog;..\src\WinControls\SplitterContainer;..\src\WinControls\StaticDialog;..\src\WinControls\TabBar;..\src\WinControls\ToolBar;..\src\MISC\Process;..\src\ScitillaComponent;..\src\MISC;..\src\MISC\SysMsg;..\src\WinControls\StatusBar;..\src;..\src\WinControls\StaticDialog\RunDlg;..\src\tinyxml;..\src\WinControls\ColourPicker;..\src\Win32Explr;..\src\MISC\RegExt;..\src\WinControls\TrayIcon;..\src\WinControls\shortcut;..\src\WinControls\Grid;..\src\WinControls\ContextMenu;..\src\MISC\PluginsManager;..\src\WinControls\Preference;..\src\WinControls\WindowsDlg;..\src\WinControls\TaskList;..\src\WinControls\DockingWnd;..\src\WinControls\ToolTip;..\src\MISC\Exception;..\src\MISC\Common;..\src\tinyxml\tinyXmlA;..\src\WinControls\AnsiCharPanel;..\src\WinControls\ClipboardHistory;..\src\WinControls\FindCharsInRange;..\src\WinControls\VerticalFileSwitcher;..\src\WinControls\ProjectPanel;..\src\WinControls\DocumentMap;..\src\WinControls\FunctionList;..\src\uchardet;..\src\WinControls\FileBrowser;..\src\WinControls\ReadDirectoryChanges;..\src\MISC\md5;..\src\WinControls\pluginsAdmin;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<PreprocessorDefinitions>WIN32;_WIN32_WINNT=0x0501;_WINDOWS;_USE_64BIT_TIME_T;TIXML_USE_STL;TIXMLA_USE_STL;_CRT_NONSTDC_NO_DEPRECATE;_CRT_SECURE_NO_WARNINGS;_CRT_NON_CONFORMING_SWPRINTFS=1;%(PreprocessorDefinitions)</PreprocessorDefinitions> <PreprocessorDefinitions>WIN32;_WIN32_WINNT=0x0501;_WINDOWS;_USE_64BIT_TIME_T;TIXML_USE_STL;TIXMLA_USE_STL;_CRT_NONSTDC_NO_DEPRECATE;_CRT_SECURE_NO_WARNINGS;_CRT_NON_CONFORMING_SWPRINTFS=1;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<ExceptionHandling>Async</ExceptionHandling> <ExceptionHandling>Async</ExceptionHandling>
<BasicRuntimeChecks>UninitializedLocalUsageCheck</BasicRuntimeChecks> <BasicRuntimeChecks>UninitializedLocalUsageCheck</BasicRuntimeChecks>
@ -142,7 +142,7 @@
</ClCompile> </ClCompile>
<Link> <Link>
<AdditionalOptions>/fixed:no %(AdditionalOptions)</AdditionalOptions> <AdditionalOptions>/fixed:no %(AdditionalOptions)</AdditionalOptions>
<AdditionalDependencies>comctl32.lib;shlwapi.lib;shell32.lib;Oleacc.lib;Dbghelp.lib;%(AdditionalDependencies)</AdditionalDependencies> <AdditionalDependencies>comctl32.lib;shlwapi.lib;shell32.lib;Oleacc.lib;Dbghelp.lib;version.lib;%(AdditionalDependencies)</AdditionalDependencies>
<ShowProgress>LinkVerboseLib</ShowProgress> <ShowProgress>LinkVerboseLib</ShowProgress>
<OutputFile>$(OutDir)notepad++.exe</OutputFile> <OutputFile>$(OutDir)notepad++.exe</OutputFile>
<Version>1.0</Version> <Version>1.0</Version>
@ -167,7 +167,7 @@
<FavorSizeOrSpeed>Speed</FavorSizeOrSpeed> <FavorSizeOrSpeed>Speed</FavorSizeOrSpeed>
<OmitFramePointers>false</OmitFramePointers> <OmitFramePointers>false</OmitFramePointers>
<WholeProgramOptimization>false</WholeProgramOptimization> <WholeProgramOptimization>false</WholeProgramOptimization>
<AdditionalIncludeDirectories>..\src\WinControls\AboutDlg;..\..\scintilla\include;..\include;..\src\WinControls;..\src\WinControls\ImageListSet;..\src\WinControls\OpenSaveFileDialog;..\src\WinControls\SplitterContainer;..\src\WinControls\StaticDialog;..\src\WinControls\TabBar;..\src\WinControls\ToolBar;..\src\MISC\Process;..\src\ScitillaComponent;..\src\MISC;..\src\MISC\SysMsg;..\src\WinControls\StatusBar;..\src;..\src\WinControls\StaticDialog\RunDlg;..\src\tinyxml;..\src\WinControls\ColourPicker;..\src\Win32Explr;..\src\MISC\RegExt;..\src\WinControls\TrayIcon;..\src\WinControls\shortcut;..\src\WinControls\Grid;..\src\WinControls\ContextMenu;..\src\MISC\PluginsManager;..\src\WinControls\Preference;..\src\WinControls\WindowsDlg;..\src\WinControls\TaskList;..\src\WinControls\DockingWnd;..\src\WinControls\ToolTip;..\src\MISC\Exception;..\src\MISC\Common;..\src\tinyxml\tinyXmlA;..\src\WinControls\AnsiCharPanel;..\src\WinControls\ClipboardHistory;..\src\WinControls\FindCharsInRange;..\src\WinControls\VerticalFileSwitcher;..\src\WinControls\ProjectPanel;..\src\WinControls\DocumentMap;..\src\WinControls\FunctionList;..\src\uchardet;..\src\WinControls\FileBrowser;..\src\WinControls\ReadDirectoryChanges;..\src\MISC\md5;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories> <AdditionalIncludeDirectories>..\src\WinControls\AboutDlg;..\..\scintilla\include;..\include;..\src\WinControls;..\src\WinControls\ImageListSet;..\src\WinControls\OpenSaveFileDialog;..\src\WinControls\SplitterContainer;..\src\WinControls\StaticDialog;..\src\WinControls\TabBar;..\src\WinControls\ToolBar;..\src\MISC\Process;..\src\ScitillaComponent;..\src\MISC;..\src\MISC\SysMsg;..\src\WinControls\StatusBar;..\src;..\src\WinControls\StaticDialog\RunDlg;..\src\tinyxml;..\src\WinControls\ColourPicker;..\src\Win32Explr;..\src\MISC\RegExt;..\src\WinControls\TrayIcon;..\src\WinControls\shortcut;..\src\WinControls\Grid;..\src\WinControls\ContextMenu;..\src\MISC\PluginsManager;..\src\WinControls\Preference;..\src\WinControls\WindowsDlg;..\src\WinControls\TaskList;..\src\WinControls\DockingWnd;..\src\WinControls\ToolTip;..\src\MISC\Exception;..\src\MISC\Common;..\src\tinyxml\tinyXmlA;..\src\WinControls\AnsiCharPanel;..\src\WinControls\ClipboardHistory;..\src\WinControls\FindCharsInRange;..\src\WinControls\VerticalFileSwitcher;..\src\WinControls\ProjectPanel;..\src\WinControls\DocumentMap;..\src\WinControls\FunctionList;..\src\uchardet;..\src\WinControls\FileBrowser;..\src\WinControls\ReadDirectoryChanges;..\src\MISC\md5;..\src\WinControls\pluginsAdmin;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<PreprocessorDefinitions>WIN32;_WIN32_WINNT=0x0501;NDEBUG;_WINDOWS;_USE_64BIT_TIME_T;TIXML_USE_STL;TIXMLA_USE_STL;_CRT_NONSTDC_NO_DEPRECATE;_CRT_SECURE_NO_WARNINGS;_CRT_NON_CONFORMING_SWPRINTFS=1;%(PreprocessorDefinitions)</PreprocessorDefinitions> <PreprocessorDefinitions>WIN32;_WIN32_WINNT=0x0501;NDEBUG;_WINDOWS;_USE_64BIT_TIME_T;TIXML_USE_STL;TIXMLA_USE_STL;_CRT_NONSTDC_NO_DEPRECATE;_CRT_SECURE_NO_WARNINGS;_CRT_NON_CONFORMING_SWPRINTFS=1;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<PreprocessToFile>false</PreprocessToFile> <PreprocessToFile>false</PreprocessToFile>
<PreprocessSuppressLineNumbers>false</PreprocessSuppressLineNumbers> <PreprocessSuppressLineNumbers>false</PreprocessSuppressLineNumbers>
@ -182,7 +182,7 @@
<MultiProcessorCompilation>true</MultiProcessorCompilation> <MultiProcessorCompilation>true</MultiProcessorCompilation>
</ClCompile> </ClCompile>
<Link> <Link>
<AdditionalDependencies>comctl32.lib;shlwapi.lib;shell32.lib;Oleacc.lib;Dbghelp.lib;%(AdditionalDependencies)</AdditionalDependencies> <AdditionalDependencies>comctl32.lib;shlwapi.lib;shell32.lib;Oleacc.lib;Dbghelp.lib;version.lib;%(AdditionalDependencies)</AdditionalDependencies>
<ShowProgress>LinkVerboseLib</ShowProgress> <ShowProgress>LinkVerboseLib</ShowProgress>
<OutputFile>$(OutDir)notepad++.exe</OutputFile> <OutputFile>$(OutDir)notepad++.exe</OutputFile>
<Version>1.0</Version> <Version>1.0</Version>
@ -215,7 +215,7 @@ copy ..\src\contextMenu.xml ..\bin\contextMenu.xml
<FavorSizeOrSpeed>Speed</FavorSizeOrSpeed> <FavorSizeOrSpeed>Speed</FavorSizeOrSpeed>
<OmitFramePointers>false</OmitFramePointers> <OmitFramePointers>false</OmitFramePointers>
<WholeProgramOptimization>false</WholeProgramOptimization> <WholeProgramOptimization>false</WholeProgramOptimization>
<AdditionalIncludeDirectories>..\src\WinControls\AboutDlg;..\..\scintilla\include;..\include;..\src\WinControls;..\src\WinControls\ImageListSet;..\src\WinControls\OpenSaveFileDialog;..\src\WinControls\SplitterContainer;..\src\WinControls\StaticDialog;..\src\WinControls\TabBar;..\src\WinControls\ToolBar;..\src\MISC\Process;..\src\ScitillaComponent;..\src\MISC;..\src\MISC\SysMsg;..\src\WinControls\StatusBar;..\src;..\src\WinControls\StaticDialog\RunDlg;..\src\tinyxml;..\src\WinControls\ColourPicker;..\src\Win32Explr;..\src\MISC\RegExt;..\src\WinControls\TrayIcon;..\src\WinControls\shortcut;..\src\WinControls\Grid;..\src\WinControls\ContextMenu;..\src\MISC\PluginsManager;..\src\WinControls\Preference;..\src\WinControls\WindowsDlg;..\src\WinControls\TaskList;..\src\WinControls\DockingWnd;..\src\WinControls\ToolTip;..\src\MISC\Exception;..\src\MISC\Common;..\src\tinyxml\tinyXmlA;..\src\WinControls\AnsiCharPanel;..\src\WinControls\ClipboardHistory;..\src\WinControls\FindCharsInRange;..\src\WinControls\VerticalFileSwitcher;..\src\WinControls\ProjectPanel;..\src\WinControls\DocumentMap;..\src\WinControls\FunctionList;..\src\uchardet;..\src\WinControls\FileBrowser;..\src\WinControls\ReadDirectoryChanges;..\src\MISC\md5;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories> <AdditionalIncludeDirectories>..\src\WinControls\AboutDlg;..\..\scintilla\include;..\include;..\src\WinControls;..\src\WinControls\ImageListSet;..\src\WinControls\OpenSaveFileDialog;..\src\WinControls\SplitterContainer;..\src\WinControls\StaticDialog;..\src\WinControls\TabBar;..\src\WinControls\ToolBar;..\src\MISC\Process;..\src\ScitillaComponent;..\src\MISC;..\src\MISC\SysMsg;..\src\WinControls\StatusBar;..\src;..\src\WinControls\StaticDialog\RunDlg;..\src\tinyxml;..\src\WinControls\ColourPicker;..\src\Win32Explr;..\src\MISC\RegExt;..\src\WinControls\TrayIcon;..\src\WinControls\shortcut;..\src\WinControls\Grid;..\src\WinControls\ContextMenu;..\src\MISC\PluginsManager;..\src\WinControls\Preference;..\src\WinControls\WindowsDlg;..\src\WinControls\TaskList;..\src\WinControls\DockingWnd;..\src\WinControls\ToolTip;..\src\MISC\Exception;..\src\MISC\Common;..\src\tinyxml\tinyXmlA;..\src\WinControls\AnsiCharPanel;..\src\WinControls\ClipboardHistory;..\src\WinControls\FindCharsInRange;..\src\WinControls\VerticalFileSwitcher;..\src\WinControls\ProjectPanel;..\src\WinControls\DocumentMap;..\src\WinControls\FunctionList;..\src\uchardet;..\src\WinControls\FileBrowser;..\src\WinControls\ReadDirectoryChanges;..\src\MISC\md5;..\src\WinControls\pluginsAdmin;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<PreprocessorDefinitions>WIN32;_WIN32_WINNT=0x0501;NDEBUG;_WINDOWS;_USE_64BIT_TIME_T;TIXML_USE_STL;TIXMLA_USE_STL;_CRT_NONSTDC_NO_DEPRECATE;_CRT_SECURE_NO_WARNINGS;_CRT_NON_CONFORMING_SWPRINTFS=1;%(PreprocessorDefinitions)</PreprocessorDefinitions> <PreprocessorDefinitions>WIN32;_WIN32_WINNT=0x0501;NDEBUG;_WINDOWS;_USE_64BIT_TIME_T;TIXML_USE_STL;TIXMLA_USE_STL;_CRT_NONSTDC_NO_DEPRECATE;_CRT_SECURE_NO_WARNINGS;_CRT_NON_CONFORMING_SWPRINTFS=1;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<PreprocessToFile>false</PreprocessToFile> <PreprocessToFile>false</PreprocessToFile>
<PreprocessSuppressLineNumbers>false</PreprocessSuppressLineNumbers> <PreprocessSuppressLineNumbers>false</PreprocessSuppressLineNumbers>
@ -230,7 +230,7 @@ copy ..\src\contextMenu.xml ..\bin\contextMenu.xml
<MultiProcessorCompilation>true</MultiProcessorCompilation> <MultiProcessorCompilation>true</MultiProcessorCompilation>
</ClCompile> </ClCompile>
<Link> <Link>
<AdditionalDependencies>comctl32.lib;shlwapi.lib;shell32.lib;Oleacc.lib;Dbghelp.lib;%(AdditionalDependencies)</AdditionalDependencies> <AdditionalDependencies>comctl32.lib;shlwapi.lib;shell32.lib;Oleacc.lib;Dbghelp.lib;version.lib;%(AdditionalDependencies)</AdditionalDependencies>
<ShowProgress>LinkVerboseLib</ShowProgress> <ShowProgress>LinkVerboseLib</ShowProgress>
<OutputFile>$(OutDir)notepad++.exe</OutputFile> <OutputFile>$(OutDir)notepad++.exe</OutputFile>
<Version>1.0</Version> <Version>1.0</Version>
@ -264,6 +264,7 @@ copy ..\src\contextMenu.xml ..\bin64\contextMenu.xml
<ClCompile Include="..\src\WinControls\AboutDlg\AboutDlg.cpp" /> <ClCompile Include="..\src\WinControls\AboutDlg\AboutDlg.cpp" />
<ClCompile Include="..\src\WinControls\AnsiCharPanel\ansiCharPanel.cpp" /> <ClCompile Include="..\src\WinControls\AnsiCharPanel\ansiCharPanel.cpp" />
<ClCompile Include="..\src\ScitillaComponent\AutoCompletion.cpp" /> <ClCompile Include="..\src\ScitillaComponent\AutoCompletion.cpp" />
<ClCompile Include="..\src\WinControls\AnsiCharPanel\asciiListView.cpp" />
<ClCompile Include="..\src\WinControls\FileBrowser\fileBrowser.cpp" /> <ClCompile Include="..\src\WinControls\FileBrowser\fileBrowser.cpp" />
<ClCompile Include="..\src\WinControls\Grid\BabyGrid.cpp" /> <ClCompile Include="..\src\WinControls\Grid\BabyGrid.cpp" />
<ClCompile Include="..\src\WinControls\Grid\BabyGridWrapper.cpp" /> <ClCompile Include="..\src\WinControls\Grid\BabyGridWrapper.cpp" />
@ -275,6 +276,7 @@ copy ..\src\contextMenu.xml ..\bin64\contextMenu.xml
<ClCompile Include="..\src\ScitillaComponent\columnEditor.cpp" /> <ClCompile Include="..\src\ScitillaComponent\columnEditor.cpp" />
<ClCompile Include="..\src\MISC\Common\Common.cpp" /> <ClCompile Include="..\src\MISC\Common\Common.cpp" />
<ClCompile Include="..\src\WinControls\ContextMenu\ContextMenu.cpp" /> <ClCompile Include="..\src\WinControls\ContextMenu\ContextMenu.cpp" />
<ClCompile Include="..\src\WinControls\PluginsAdmin\pluginsAdmin.cpp" />
<ClCompile Include="..\src\WinControls\ReadDirectoryChanges\ReadDirectoryChanges.cpp" /> <ClCompile Include="..\src\WinControls\ReadDirectoryChanges\ReadDirectoryChanges.cpp" />
<ClCompile Include="..\src\WinControls\ReadDirectoryChanges\ReadDirectoryChangesPrivate.cpp" /> <ClCompile Include="..\src\WinControls\ReadDirectoryChanges\ReadDirectoryChangesPrivate.cpp" />
<ClCompile Include="..\src\WinControls\TabBar\ControlsTab.cpp" /> <ClCompile Include="..\src\WinControls\TabBar\ControlsTab.cpp" />
@ -497,6 +499,7 @@ copy ..\src\contextMenu.xml ..\bin64\contextMenu.xml
<ResourceCompile Include="..\src\ScitillaComponent\FindReplaceDlg.rc" /> <ResourceCompile Include="..\src\ScitillaComponent\FindReplaceDlg.rc" />
<ResourceCompile Include="..\src\WinControls\FunctionList\functionListPanel.rc" /> <ResourceCompile Include="..\src\WinControls\FunctionList\functionListPanel.rc" />
<ResourceCompile Include="..\src\Notepad_plus.rc" /> <ResourceCompile Include="..\src\Notepad_plus.rc" />
<ResourceCompile Include="..\src\WinControls\PluginsAdmin\pluginsAdmin.rc" />
<ResourceCompile Include="..\src\WinControls\Preference\preference.rc" /> <ResourceCompile Include="..\src\WinControls\Preference\preference.rc" />
<ResourceCompile Include="..\src\WinControls\ProjectPanel\ProjectPanel.rc" /> <ResourceCompile Include="..\src\WinControls\ProjectPanel\ProjectPanel.rc" />
<ResourceCompile Include="..\src\MISC\RegExt\regExtDlg.rc" /> <ResourceCompile Include="..\src\MISC\RegExt\regExtDlg.rc" />
@ -524,6 +527,7 @@ copy ..\src\contextMenu.xml ..\bin64\contextMenu.xml
<ClInclude Include="..\src\WinControls\AboutDlg\AboutDlg.h" /> <ClInclude Include="..\src\WinControls\AboutDlg\AboutDlg.h" />
<ClInclude Include="..\src\WinControls\AnsiCharPanel\ansiCharPanel.h" /> <ClInclude Include="..\src\WinControls\AnsiCharPanel\ansiCharPanel.h" />
<ClInclude Include="..\src\ScitillaComponent\AutoCompletion.h" /> <ClInclude Include="..\src\ScitillaComponent\AutoCompletion.h" />
<ClInclude Include="..\src\WinControls\AnsiCharPanel\asciiListView.h" />
<ClInclude Include="..\src\WinControls\FileBrowser\fileBrowser.h" /> <ClInclude Include="..\src\WinControls\FileBrowser\fileBrowser.h" />
<ClInclude Include="..\src\WinControls\FileBrowser\fileBrowser_rc.h" /> <ClInclude Include="..\src\WinControls\FileBrowser\fileBrowser_rc.h" />
<ClInclude Include="..\src\WinControls\Grid\BabyGrid.h" /> <ClInclude Include="..\src\WinControls\Grid\BabyGrid.h" />
@ -538,6 +542,8 @@ copy ..\src\contextMenu.xml ..\bin64\contextMenu.xml
<ClInclude Include="..\src\ScitillaComponent\columnEditor.h" /> <ClInclude Include="..\src\ScitillaComponent\columnEditor.h" />
<ClInclude Include="..\src\MISC\Common\Common.h" /> <ClInclude Include="..\src\MISC\Common\Common.h" />
<ClInclude Include="..\src\WinControls\ContextMenu\ContextMenu.h" /> <ClInclude Include="..\src\WinControls\ContextMenu\ContextMenu.h" />
<ClInclude Include="..\src\WinControls\PluginsAdmin\pluginsAdmin.h" />
<ClInclude Include="..\src\WinControls\PluginsAdmin\pluginsAdminRes.h" />
<ClInclude Include="..\src\WinControls\ReadDirectoryChanges\ReadDirectoryChanges.h" /> <ClInclude Include="..\src\WinControls\ReadDirectoryChanges\ReadDirectoryChanges.h" />
<ClInclude Include="..\src\WinControls\ReadDirectoryChanges\ReadDirectoryChangesPrivate.h" /> <ClInclude Include="..\src\WinControls\ReadDirectoryChanges\ReadDirectoryChangesPrivate.h" />
<ClInclude Include="..\src\WinControls\ReadDirectoryChanges\ThreadSafeQueue.h" /> <ClInclude Include="..\src\WinControls\ReadDirectoryChanges\ThreadSafeQueue.h" />