Skip to content

Commit

Permalink
merge with master and resolve confilcts
Browse files Browse the repository at this point in the history
  • Loading branch information
chcg committed Jun 2, 2015
2 parents 6d654be + 7089022 commit d11cba6
Show file tree
Hide file tree
Showing 181 changed files with 784 additions and 586 deletions.
8 changes: 8 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,14 @@ PowerEditor/visual.net/Unicode Release/
PowerEditor/visual.net/notepadPlus.sln


# scintilla - generated files
scintilla/bin/SciLexer.*
scintilla/bin/Scintilla.*
scintilla/win32/*.lib
scintilla/win32/ScintRes.res
scintilla/boostregex/bin
scintilla/boostregex/boostpath.mak

#-------------------------------------------------------------------------------
# Windows

Expand Down
2 changes: 1 addition & 1 deletion PowerEditor/src/EncodingMapper.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
// Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.


#include "precompiledHeaders.h"
#include <string.h>
#include "EncodingMapper.h"
#include "Scintilla.h"

Expand Down
57 changes: 56 additions & 1 deletion PowerEditor/src/MISC/Common/Common.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,15 @@
// Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.


#include "precompiledHeaders.h"
#include <algorithm>
#include <shlwapi.h>
#include <Shlobj.h>
#include <uxtheme.h>
#include "StaticDialog.h"



#include "Common.h"
#include "../Utf8.h"

WcharMbcsConvertor * WcharMbcsConvertor::_pSelf = new WcharMbcsConvertor;
Expand Down Expand Up @@ -777,4 +785,51 @@ double stodLocale(const generic_string& str, _locale_t loc, size_t* idx)
if (idx != NULL)
*idx = (size_t)(eptr - ptr);
return ans;
}

bool str2Clipboard(const generic_string &str2cpy, HWND hwnd)
{
int len2Allocate = (str2cpy.size() + 1) * sizeof(TCHAR);
HGLOBAL hglbCopy = ::GlobalAlloc(GMEM_MOVEABLE, len2Allocate);
if (hglbCopy == NULL)
{
return false;
}
if (!::OpenClipboard(hwnd))
{
::GlobalFree(hglbCopy);
::CloseClipboard();
return false;
}
if (!::EmptyClipboard())
{
::GlobalFree(hglbCopy);
::CloseClipboard();
return false;
}
// Lock the handle and copy the text to the buffer.
TCHAR *pStr = (TCHAR *)::GlobalLock(hglbCopy);
if (pStr == NULL)
{
::GlobalUnlock(hglbCopy);
::GlobalFree(hglbCopy);
::CloseClipboard();
return false;
}
_tcscpy_s(pStr, len2Allocate / sizeof(TCHAR), str2cpy.c_str());
::GlobalUnlock(hglbCopy);
// Place the handle on the clipboard.
unsigned int clipBoardFormat = CF_UNICODETEXT;
if (::SetClipboardData(clipBoardFormat, hglbCopy) == NULL)
{
::GlobalUnlock(hglbCopy);
::GlobalFree(hglbCopy);
::CloseClipboard();
return false;
}
if (!::CloseClipboard())
{
return false;
}
return true;
}
7 changes: 7 additions & 0 deletions PowerEditor/src/MISC/Common/Common.h
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,11 @@
#ifndef M30_IDE_COMMUN_H
#define M30_IDE_COMMUN_H

#include <vector>
#include <string>

#include <windows.h>

const bool dirUp = true;
const bool dirDown = false;

Expand Down Expand Up @@ -193,4 +198,6 @@ generic_string stringJoin(const std::vector<generic_string>& strings, const gene
generic_string stringTakeWhileAdmissable(const generic_string& input, const generic_string& admissable);
double stodLocale(const generic_string& str, _locale_t loc, size_t* idx = NULL);

bool str2Clipboard(const generic_string &str2cpy, HWND hwnd);

#endif //M30_IDE_COMMUN_H
8 changes: 5 additions & 3 deletions PowerEditor/src/MISC/Common/Sorters.h
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,10 @@
// Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.


#ifndef M30_IDE_SORTERS_H
#define M30_IDE_SORTERS_H
#ifndef NPP_SORTERS_H
#define NPP_SORTERS_H

#include <algorithm>

// Base interface for line sorting.
class ISorter
Expand Down Expand Up @@ -259,4 +261,4 @@ class DecimalDotSorter : public NumericSorter<double>
}
};

#endif //M30_IDE_SORTERS_H
#endif //NPP_SORTERS_H
13 changes: 3 additions & 10 deletions PowerEditor/src/MISC/Common/precompiledHeaders.h
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,6 @@
// w/o precompiled headers file : 1 minute 55 sec

#define _WIN32_WINNT 0x0501
#define _CRT_NON_CONFORMING_WCSTOK

// C RunTime Header Files
#include <stdio.h>
Expand Down Expand Up @@ -60,24 +59,18 @@
// Windows Header Files
#include <windows.h>
#include <commctrl.h>
#include <Shlobj.h>
#include <shlwapi.h>
#include <Shlobj.h>
#include <uxtheme.h>
#include <Oleacc.h>

#pragma warning(push)
#pragma warning(disable: 4091) // 'keyword' : ignored on left of 'type' when no variable is declared
#include <dbghelp.h>
#pragma warning(pop)
#include <eh.h>

#ifdef UNICODE
#include <wchar.h>
#endif


// Notepad++
#include "Common.h"
#include "Window.h"
#include "StaticDialog.h"

#endif PRECOMPILEHEADER_H
#endif //PRECOMPILEHEADER_H
2 changes: 1 addition & 1 deletion PowerEditor/src/MISC/Exception/MiniDumper.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
// Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.


#include "precompiledHeaders.h"
#include <shlwapi.h>
#include "MiniDumper.h"

LPCTSTR msgTitle = TEXT("Notepad++ crash analysis");
Expand Down
3 changes: 3 additions & 0 deletions PowerEditor/src/MISC/Exception/MiniDumper.h
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,9 @@
#ifndef MDUMP_H
#define MDUMP_H

#include <windows.h>
#include <dbghelp.h>


// based on dbghelp.h
typedef BOOL (WINAPI *MINIDUMPWRITEDUMP)(HANDLE hProcess, DWORD dwPid, HANDLE hFile, MINIDUMP_TYPE DumpType,
Expand Down
1 change: 0 additions & 1 deletion PowerEditor/src/MISC/Exception/Win32Exception.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,6 @@
// Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.


#include "precompiledHeaders.h"
#include "Win32Exception.h"


Expand Down
7 changes: 7 additions & 0 deletions PowerEditor/src/MISC/Exception/Win32Exception.h
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,11 @@
// along with this program; if not, write to the Free Software
// Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.

#ifndef WIN32_EXCEPTION_H
#define WIN32_EXCEPTION_H

#include <exception>
#include <windows.h>

typedef const void* ExceptionAddress; // OK on Win32 platform

Expand Down Expand Up @@ -69,3 +74,5 @@ class Win32AccessViolation: public Win32Exception

friend void Win32Exception::translate(unsigned code, EXCEPTION_POINTERS* info);
};

#endif // WIN32_EXCEPTION_H
2 changes: 0 additions & 2 deletions PowerEditor/src/MISC/PluginsManager/IDAllocator.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,6 @@
// Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.


#include "precompiledHeaders.h"

#include "IDAllocator.h"

IDAllocator::IDAllocator(int start, int maximumID)
Expand Down
78 changes: 40 additions & 38 deletions PowerEditor/src/MISC/PluginsManager/Notepad_plus_msgs.h
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,8 @@
#ifndef NOTEPAD_PLUS_MSGS_H
#define NOTEPAD_PLUS_MSGS_H

#include <windows.h>
#include <tchar.h>

enum LangType {L_TEXT, L_PHP , L_C, L_CPP, L_CS, L_OBJC, L_JAVA, L_RC,\
L_HTML, L_XML, L_MAKEFILE, L_PASCAL, L_BATCH, L_INI, L_ASCII, L_USER,\
Expand Down Expand Up @@ -541,44 +543,44 @@ enum winVer{WV_UNKNOWN, WV_WIN32S, WV_95, WV_98, WV_ME, WV_NT, WV_W2K, WV_XP, WV
//scnNotification->nmhdr.hwndFrom = NULL;
//scnNotification->nmhdr.idFrom = BufferID;

#define NPPN_BEFORESHUTDOWN (NPPN_FIRST + 19) // To notify plugins that Npp shutdown has been triggered, files have not been closed yet
//scnNotification->nmhdr.code = NPPN_BEFORESHUTDOWN;
//scnNotification->nmhdr.hwndFrom = hwndNpp;
//scnNotification->nmhdr.idFrom = 0;

#define NPPN_CANCELSHUTDOWN (NPPN_FIRST + 20) // To notify plugins that Npp shutdown has been cancelled
//scnNotification->nmhdr.code = NPPN_CANCELSHUTDOWN;
//scnNotification->nmhdr.hwndFrom = hwndNpp;
//scnNotification->nmhdr.idFrom = 0;

#define NPPN_FILEBEFORERENAME (NPPN_FIRST + 21) // To notify plugins that file is to be renamed
//scnNotification->nmhdr.code = NPPN_FILEBEFORERENAME;
//scnNotification->nmhdr.hwndFrom = hwndNpp;
//scnNotification->nmhdr.idFrom = BufferID;

#define NPPN_FILERENAMECANCEL (NPPN_FIRST + 22) // To notify plugins that file rename has been cancelled
//scnNotification->nmhdr.code = NPPN_FILERENAMECANCEL;
//scnNotification->nmhdr.hwndFrom = hwndNpp;
//scnNotification->nmhdr.idFrom = BufferID;

#define NPPN_FILERENAMED (NPPN_FIRST + 23) // To notify plugins that file has been renamed
//scnNotification->nmhdr.code = NPPN_FILERENAMED;
//scnNotification->nmhdr.hwndFrom = hwndNpp;
//scnNotification->nmhdr.idFrom = BufferID;

#define NPPN_FILEBEFOREDELETE (NPPN_FIRST + 24) // To notify plugins that file is to be deleted
//scnNotification->nmhdr.code = NPPN_FILEBEFOREDELETE;
//scnNotification->nmhdr.hwndFrom = hwndNpp;
//scnNotification->nmhdr.idFrom = BufferID;

#define NPPN_FILEDELETEFAILED (NPPN_FIRST + 25) // To notify plugins that file deletion has failed
//scnNotification->nmhdr.code = NPPN_FILEDELETEFAILED;
//scnNotification->nmhdr.hwndFrom = hwndNpp;
//scnNotification->nmhdr.idFrom = BufferID;

#define NPPN_FILEDELETED (NPPN_FIRST + 26) // To notify plugins that file has been deleted
//scnNotification->nmhdr.code = NPPN_FILEDELETED;
//scnNotification->nmhdr.hwndFrom = hwndNpp;
#define NPPN_BEFORESHUTDOWN (NPPN_FIRST + 19) // To notify plugins that Npp shutdown has been triggered, files have not been closed yet
//scnNotification->nmhdr.code = NPPN_BEFORESHUTDOWN;
//scnNotification->nmhdr.hwndFrom = hwndNpp;
//scnNotification->nmhdr.idFrom = 0;

#define NPPN_CANCELSHUTDOWN (NPPN_FIRST + 20) // To notify plugins that Npp shutdown has been cancelled
//scnNotification->nmhdr.code = NPPN_CANCELSHUTDOWN;
//scnNotification->nmhdr.hwndFrom = hwndNpp;
//scnNotification->nmhdr.idFrom = 0;

#define NPPN_FILEBEFORERENAME (NPPN_FIRST + 21) // To notify plugins that file is to be renamed
//scnNotification->nmhdr.code = NPPN_FILEBEFORERENAME;
//scnNotification->nmhdr.hwndFrom = hwndNpp;
//scnNotification->nmhdr.idFrom = BufferID;

#define NPPN_FILERENAMECANCEL (NPPN_FIRST + 22) // To notify plugins that file rename has been cancelled
//scnNotification->nmhdr.code = NPPN_FILERENAMECANCEL;
//scnNotification->nmhdr.hwndFrom = hwndNpp;
//scnNotification->nmhdr.idFrom = BufferID;

#define NPPN_FILERENAMED (NPPN_FIRST + 23) // To notify plugins that file has been renamed
//scnNotification->nmhdr.code = NPPN_FILERENAMED;
//scnNotification->nmhdr.hwndFrom = hwndNpp;
//scnNotification->nmhdr.idFrom = BufferID;

#define NPPN_FILEBEFOREDELETE (NPPN_FIRST + 24) // To notify plugins that file is to be deleted
//scnNotification->nmhdr.code = NPPN_FILEBEFOREDELETE;
//scnNotification->nmhdr.hwndFrom = hwndNpp;
//scnNotification->nmhdr.idFrom = BufferID;

#define NPPN_FILEDELETEFAILED (NPPN_FIRST + 25) // To notify plugins that file deletion has failed
//scnNotification->nmhdr.code = NPPN_FILEDELETEFAILED;
//scnNotification->nmhdr.hwndFrom = hwndNpp;
//scnNotification->nmhdr.idFrom = BufferID;

#define NPPN_FILEDELETED (NPPN_FIRST + 26) // To notify plugins that file has been deleted
//scnNotification->nmhdr.code = NPPN_FILEDELETED;
//scnNotification->nmhdr.hwndFrom = hwndNpp;
//scnNotification->nmhdr.idFrom = BufferID;

#endif //NOTEPAD_PLUS_MSGS_H
4 changes: 2 additions & 2 deletions PowerEditor/src/MISC/PluginsManager/PluginInterface.h
Original file line number Diff line number Diff line change
Expand Up @@ -77,8 +77,8 @@ extern "C" __declspec(dllexport) FuncItem * getFuncsArray(int *);
extern "C" __declspec(dllexport) void beNotified(SCNotification *);
extern "C" __declspec(dllexport) LRESULT messageProc(UINT Message, WPARAM wParam, LPARAM lParam);

#ifdef UNICODE
// This API return always true now, since Notepad++ isn't compiled in ANSI mode anymore
extern "C" __declspec(dllexport) BOOL isUnicode();
#endif //UNICODE


#endif //PLUGININTERFACE_H
4 changes: 3 additions & 1 deletion PowerEditor/src/MISC/PluginsManager/PluginsManager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -26,10 +26,12 @@
// Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.


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

using namespace std;

const TCHAR * USERMSG = TEXT("This plugin is not compatible with current version of Notepad++.\n\n\
Do you want to remove this plugin from plugins directory to prevent this message from the next launch time?");

Expand Down
8 changes: 4 additions & 4 deletions PowerEditor/src/MISC/PluginsManager/PluginsManager.h
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ class PluginsManager {
_nppData = nppData;
};

int loadPlugin(const TCHAR *pluginFilePath, vector<generic_string> & dll2Remove);
int loadPlugin(const TCHAR *pluginFilePath, std::vector<generic_string> & dll2Remove);
bool loadPlugins(const TCHAR *dir = NULL);

bool unloadPlugin(int index, HWND nppHandle);
Expand Down Expand Up @@ -129,9 +129,9 @@ class PluginsManager {
NppData _nppData;
HMENU _hPluginsMenu;

vector<PluginInfo *> _pluginInfos;
vector<PluginCommand> _pluginsCommands;
vector<generic_string> _loadedDlls;
std::vector<PluginInfo *> _pluginInfos;
std::vector<PluginCommand> _pluginsCommands;
std::vector<generic_string> _loadedDlls;
bool _isDisabled;
IDAllocator _dynamicIDAlloc;
IDAllocator _markerAlloc;
Expand Down
1 change: 0 additions & 1 deletion PowerEditor/src/MISC/Process/Process.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,6 @@
// Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.


#include "precompiledHeaders.h"
#include "Parameters.h"
#include "process.h"

Expand Down
2 changes: 0 additions & 2 deletions PowerEditor/src/MISC/Process/Process.h
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,6 @@
#ifndef PROCESSUS_H
#define PROCESSUS_H

using namespace std;

enum progType {WIN32_PROG, CONSOLE_PROG};

class Process
Expand Down
3 changes: 1 addition & 2 deletions PowerEditor/src/MISC/RegExt/regExtDlg.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,7 @@
// along with this program; if not, write to the Free Software
// Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.


#include "precompiledHeaders.h"
#include "Common.h"
#include "regExtDlg.h"
#include "resource.h"

Expand Down
2 changes: 2 additions & 0 deletions PowerEditor/src/MISC/RegExt/regExtDlg.h
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,8 @@
#include "regExtDlgRc.h"
#endif //REGEXTDLGRC_H

#include "StaticDialog.h"

const int extNameLen = 32;

class RegExtDlg : public StaticDialog
Expand Down
Loading

0 comments on commit d11cba6

Please sign in to comment.