Merge branch 'master' into DlgProc
This commit is contained in:
commit
def5952213
@ -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"
|
||||
|
||||
|
@ -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;
|
||||
@ -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;
|
||||
}
|
@ -198,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
|
||||
|
@ -1,81 +0,0 @@
|
||||
// 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.
|
||||
|
||||
|
||||
#ifndef PRECOMPILEHEADER_H
|
||||
#define PRECOMPILEHEADER_H
|
||||
|
||||
// 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>
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
#include <stdarg.h>
|
||||
#include <assert.h>
|
||||
#include <ctype.h>
|
||||
#include <functional>
|
||||
#include <time.h>
|
||||
#include <sys/types.h>
|
||||
#include <sys/stat.h>
|
||||
|
||||
// STL Headers
|
||||
#include <iostream>
|
||||
#include <sstream>
|
||||
#include <string>
|
||||
#include <vector>
|
||||
#include <deque>
|
||||
#include <map>
|
||||
#include <memory>
|
||||
#include <algorithm>
|
||||
#include <exception>
|
||||
|
||||
// Windows Header Files
|
||||
#include <windows.h>
|
||||
#include <commctrl.h>
|
||||
#include <Shlobj.h>
|
||||
#include <shlwapi.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>
|
||||
#include <wchar.h>
|
||||
|
||||
|
||||
// Notepad++
|
||||
#include "Common.h"
|
||||
#include "Window.h"
|
||||
#include "StaticDialog.h"
|
||||
|
||||
#endif //PRECOMPILEHEADER_H
|
@ -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");
|
||||
|
@ -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,
|
||||
|
@ -32,7 +32,6 @@
|
||||
// Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
||||
|
||||
|
||||
#include "precompiledHeaders.h"
|
||||
#include "Win32Exception.h"
|
||||
|
||||
|
||||
|
@ -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
|
||||
|
||||
@ -69,3 +74,5 @@ private:
|
||||
|
||||
friend void Win32Exception::translate(unsigned code, EXCEPTION_POINTERS* info);
|
||||
};
|
||||
|
||||
#endif // WIN32_EXCEPTION_H
|
@ -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)
|
||||
|
@ -26,7 +26,7 @@
|
||||
// Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
||||
|
||||
|
||||
#include "precompiledHeaders.h"
|
||||
#include <shlwapi.h>
|
||||
#include "PluginsManager.h"
|
||||
#include "resource.h"
|
||||
|
||||
|
@ -26,7 +26,6 @@
|
||||
// Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
||||
|
||||
|
||||
#include "precompiledHeaders.h"
|
||||
#include "Parameters.h"
|
||||
#include "process.h"
|
||||
|
||||
|
@ -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"
|
||||
|
||||
|
@ -33,6 +33,8 @@
|
||||
#include "regExtDlgRc.h"
|
||||
#endif //REGEXTDLGRC_H
|
||||
|
||||
#include "StaticDialog.h"
|
||||
|
||||
const int extNameLen = 32;
|
||||
|
||||
class RegExtDlg : public StaticDialog
|
||||
|
@ -25,8 +25,8 @@
|
||||
// along with this program; if not, write to the Free Software
|
||||
// Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
||||
|
||||
|
||||
#include "precompiledHeaders.h"
|
||||
#include <time.h>
|
||||
#include <shlwapi.h>
|
||||
#include "Notepad_plus.h"
|
||||
#include "Notepad_plus_Window.h"
|
||||
#include "FileDialog.h"
|
||||
@ -1933,7 +1933,7 @@ void Notepad_plus::copyMarkedLines()
|
||||
globalStr = currentStr;
|
||||
}
|
||||
}
|
||||
str2Cliboard(globalStr.c_str());
|
||||
str2Cliboard(globalStr);
|
||||
}
|
||||
|
||||
void Notepad_plus::cutMarkedLines()
|
||||
@ -1953,7 +1953,7 @@ void Notepad_plus::cutMarkedLines()
|
||||
}
|
||||
}
|
||||
_pEditView->execute(SCI_ENDUNDOACTION);
|
||||
str2Cliboard(globalStr.c_str());
|
||||
str2Cliboard(globalStr);
|
||||
}
|
||||
|
||||
void Notepad_plus::deleteMarkedLines(bool isMarked)
|
||||
@ -4555,37 +4555,9 @@ void Notepad_plus::getCurrentOpenedFiles(Session & session, bool includUntitledD
|
||||
_invisibleEditView.execute(SCI_SETDOCPOINTER, 0, oldDoc);
|
||||
}
|
||||
|
||||
bool Notepad_plus::str2Cliboard(const TCHAR *str2cpy)
|
||||
bool Notepad_plus::str2Cliboard(const generic_string & str2cpy)
|
||||
{
|
||||
if (!str2cpy)
|
||||
return false;
|
||||
|
||||
int len2Allocate = lstrlen(str2cpy) + 1;
|
||||
len2Allocate *= sizeof(TCHAR);
|
||||
unsigned int cilpboardFormat = CF_TEXT;
|
||||
|
||||
cilpboardFormat = CF_UNICODETEXT;
|
||||
|
||||
HGLOBAL hglbCopy = ::GlobalAlloc(GMEM_MOVEABLE, len2Allocate);
|
||||
if (hglbCopy == NULL)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
if (!::OpenClipboard(_pPublicInterface->getHSelf()))
|
||||
return false;
|
||||
|
||||
::EmptyClipboard();
|
||||
|
||||
// Lock the handle and copy the text to the buffer.
|
||||
TCHAR *pStr = (TCHAR *)::GlobalLock(hglbCopy);
|
||||
lstrcpy(pStr, str2cpy);
|
||||
::GlobalUnlock(hglbCopy);
|
||||
|
||||
// Place the handle on the clipboard.
|
||||
::SetClipboardData(cilpboardFormat, hglbCopy);
|
||||
::CloseClipboard();
|
||||
return true;
|
||||
return str2Clipboard(str2cpy, _pPublicInterface->getHSelf());
|
||||
}
|
||||
|
||||
//ONLY CALL IN CASE OF EMERGENCY: EXCEPTION
|
||||
|
@ -599,7 +599,7 @@ private:
|
||||
|
||||
void doSynScorll(HWND hW);
|
||||
void setWorkingDir(const TCHAR *dir);
|
||||
bool str2Cliboard(const TCHAR *str2cpy);
|
||||
bool str2Cliboard(const generic_string & str2cpy);
|
||||
bool bin2Cliboard(const UCHAR *uchar2cpy, size_t length);
|
||||
|
||||
bool getIntegralDockingData(tTbData & dockData, int & iCont, bool & isVisible);
|
||||
|
@ -26,7 +26,8 @@
|
||||
// Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
||||
|
||||
|
||||
#include "precompiledHeaders.h"
|
||||
#include <time.h>
|
||||
#include <shlwapi.h>
|
||||
#include "Notepad_plus_Window.h"
|
||||
|
||||
const TCHAR Notepad_plus_Window::_className[32] = TEXT("Notepad++");
|
||||
|
@ -26,7 +26,8 @@
|
||||
// Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
||||
|
||||
|
||||
#include "precompiledHeaders.h"
|
||||
#include <algorithm>
|
||||
#include <shlwapi.h>
|
||||
#include "Notepad_plus_Window.h"
|
||||
#include "TaskListDlg.h"
|
||||
#include "ImageListSet.h"
|
||||
|
@ -25,8 +25,8 @@
|
||||
// along with this program; if not, write to the Free Software
|
||||
// Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
||||
|
||||
|
||||
#include "precompiledHeaders.h"
|
||||
#include <memory>
|
||||
#include <shlwapi.h>
|
||||
#include "Notepad_plus_Window.h"
|
||||
#include "EncodingMapper.h"
|
||||
#include "ShortcutMapper.h"
|
||||
@ -676,7 +676,7 @@ void Notepad_plus::command(int id)
|
||||
{
|
||||
generic_string dir(buf->getFullPathName());
|
||||
PathRemoveFileSpec(dir);
|
||||
str2Cliboard(dir.c_str());
|
||||
str2Cliboard(dir);
|
||||
}
|
||||
else if (id == IDM_EDIT_FILENAMETOCLIP)
|
||||
{
|
||||
|
@ -26,7 +26,8 @@
|
||||
// Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
||||
|
||||
|
||||
#include "precompiledHeaders.h"
|
||||
#include <time.h>
|
||||
#include <shlwapi.h>
|
||||
#include "Notepad_plus_Window.h"
|
||||
#include "FileDialog.h"
|
||||
#include "EncodingMapper.h"
|
||||
|
@ -26,7 +26,7 @@
|
||||
// Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
||||
|
||||
|
||||
#include "precompiledHeaders.h"
|
||||
|
||||
#include "Notepad_plus_Window.h"
|
||||
#include "xmlMatchedTagsHighlighter.h"
|
||||
#include "VerticalFileSwitcher.h"
|
||||
|
@ -25,8 +25,9 @@
|
||||
// along with this program; if not, write to the Free Software
|
||||
// Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
||||
|
||||
|
||||
#include "precompiledHeaders.h"
|
||||
#include <time.h>
|
||||
#include <shlwapi.h>
|
||||
#include <Shlobj.h>
|
||||
#include "Parameters.h"
|
||||
#include "FileDialog.h"
|
||||
#include "ScintillaEditView.h"
|
||||
@ -3386,28 +3387,28 @@ bool NppParameters::writeProjectPanelsSettings() const
|
||||
TiXmlNode *nppRoot = _pXmlUserDoc->FirstChild(TEXT("NotepadPlus"));
|
||||
if (!nppRoot) return false;
|
||||
|
||||
TiXmlNode *projPanelRootNode = nppRoot->FirstChildElement(TEXT("ProjectPanels"));
|
||||
if (projPanelRootNode)
|
||||
TiXmlNode *oldProjPanelRootNode = nppRoot->FirstChildElement(TEXT("ProjectPanels"));
|
||||
if (nullptr != oldProjPanelRootNode)
|
||||
{
|
||||
// Erase the Project Panel root
|
||||
nppRoot->RemoveChild(projPanelRootNode);
|
||||
nppRoot->RemoveChild(oldProjPanelRootNode);
|
||||
}
|
||||
|
||||
// Create the Project Panel root
|
||||
projPanelRootNode = new TiXmlElement(TEXT("ProjectPanels"));
|
||||
TiXmlElement projPanelRootNode{TEXT("ProjectPanels")};
|
||||
|
||||
// Add 3 Project Panel parameters
|
||||
for (int i = 0 ; i < 3 ; ++i)
|
||||
{
|
||||
TiXmlElement projPanelNode(TEXT("ProjectPanel"));
|
||||
TiXmlElement projPanelNode{TEXT("ProjectPanel")};
|
||||
(projPanelNode.ToElement())->SetAttribute(TEXT("id"), i);
|
||||
(projPanelNode.ToElement())->SetAttribute(TEXT("workSpaceFile"), _workSpaceFilePathes[i]);
|
||||
|
||||
(projPanelRootNode->ToElement())->InsertEndChild(projPanelNode);
|
||||
(projPanelRootNode.ToElement())->InsertEndChild(projPanelNode);
|
||||
}
|
||||
|
||||
// (Re)Insert the Project Panel root
|
||||
(nppRoot->ToElement())->InsertEndChild(*projPanelRootNode);
|
||||
(nppRoot->ToElement())->InsertEndChild(projPanelRootNode);
|
||||
return true;
|
||||
}
|
||||
|
||||
|
@ -39,13 +39,18 @@
|
||||
|
||||
FileManager * FileManager::_pSelf = new FileManager();
|
||||
|
||||
const int blockSize = 128 * 1024 + 4;
|
||||
static const int blockSize = 128 * 1024 + 4;
|
||||
|
||||
// Ordre important!! Ne le changes pas!
|
||||
//SC_EOL_CRLF (0), SC_EOL_CR (1), or SC_EOL_LF (2).
|
||||
|
||||
const int CR = 0x0D;
|
||||
const int LF = 0x0A;
|
||||
static const int CR = 0x0D;
|
||||
static const int LF = 0x0A;
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
Buffer::Buffer(FileManager * pManager, BufferID id, Document doc, DocFileStatus type, const TCHAR *fileName) //type must be either DOC_REGULAR or DOC_UNNAMED
|
||||
: _pManager(pManager), _id(id), _isDirty(false), _doc(doc), _isFileReadOnly(false), _isUserReadOnly(false), _recentTag(-1), _references(0),
|
||||
@ -481,8 +486,9 @@ BufferID FileManager::loadFile(const TCHAR * filename, Document doc, int encodin
|
||||
|
||||
Utf8_16_Read UnicodeConvertor; //declare here so we can get information after loading is done
|
||||
|
||||
char data[blockSize + 8]; // +8 for incomplete multibyte char
|
||||
formatType format;
|
||||
bool res = loadFileData(doc, backupFileName?backupFileName:fullpath, &UnicodeConvertor, L_TEXT, encoding, &format);
|
||||
bool res = loadFileData(doc, backupFileName?backupFileName:fullpath, data, &UnicodeConvertor, L_TEXT, encoding, &format);
|
||||
if (res)
|
||||
{
|
||||
Buffer * newBuf = new Buffer(this, _nextBufferID, doc, DOC_REGULAR, fullpath);
|
||||
@ -509,11 +515,10 @@ BufferID FileManager::loadFile(const TCHAR * filename, Document doc, int encodin
|
||||
if (encoding == -1)
|
||||
{
|
||||
// 3 formats : WIN_FORMAT, UNIX_FORMAT and MAC_FORMAT
|
||||
if (UnicodeConvertor.getNewBuf())
|
||||
if (nullptr != UnicodeConvertor.getNewBuf())
|
||||
{
|
||||
int format = getEOLFormatForm(UnicodeConvertor.getNewBuf());
|
||||
int format = getEOLFormatForm(UnicodeConvertor.getNewBuf(), UnicodeConvertor.getNewSize());
|
||||
buf->setFormat(format == -1?WIN_FORMAT:(formatType)format);
|
||||
|
||||
}
|
||||
else
|
||||
{
|
||||
@ -561,16 +566,17 @@ bool FileManager::reloadBuffer(BufferID id)
|
||||
Utf8_16_Read UnicodeConvertor;
|
||||
buf->_canNotify = false; //disable notify during file load, we dont want dirty to be triggered
|
||||
int encoding = buf->getEncoding();
|
||||
char data[blockSize + 8]; // +8 for incomplete multibyte char
|
||||
formatType format;
|
||||
bool res = loadFileData(doc, buf->getFullPathName(), &UnicodeConvertor, buf->getLangType(), encoding, &format);
|
||||
bool res = loadFileData(doc, buf->getFullPathName(), data, &UnicodeConvertor, buf->getLangType(), encoding, &format);
|
||||
buf->_canNotify = true;
|
||||
if (res)
|
||||
{
|
||||
if (encoding == -1)
|
||||
{
|
||||
if (UnicodeConvertor.getNewBuf())
|
||||
if (nullptr != UnicodeConvertor.getNewBuf())
|
||||
{
|
||||
int format = getEOLFormatForm(UnicodeConvertor.getNewBuf());
|
||||
int format = getEOLFormatForm(UnicodeConvertor.getNewBuf(), UnicodeConvertor.getNewSize());
|
||||
buf->setFormat(format == -1?WIN_FORMAT:(formatType)format);
|
||||
}
|
||||
else
|
||||
@ -1135,10 +1141,9 @@ int FileManager::detectCodepage(char* buf, size_t len)
|
||||
return codepage;
|
||||
}
|
||||
|
||||
bool FileManager::loadFileData(Document doc, const TCHAR * filename, Utf8_16_Read * UnicodeConvertor, LangType language, int & encoding, formatType *pFormat)
|
||||
inline bool FileManager::loadFileData(Document doc, const TCHAR * filename, char* data, Utf8_16_Read * UnicodeConvertor,
|
||||
LangType language, int & encoding, formatType *pFormat)
|
||||
{
|
||||
const int blockSize = 128 * 1024; //128 kB
|
||||
char data[blockSize+8];
|
||||
FILE *fp = generic_fopen(filename, TEXT("rb"));
|
||||
if (!fp)
|
||||
return false;
|
||||
@ -1242,7 +1247,7 @@ bool FileManager::loadFileData(Document doc, const TCHAR * filename, Utf8_16_Rea
|
||||
}
|
||||
|
||||
if (format == -1)
|
||||
format = getEOLFormatForm(data);
|
||||
format = getEOLFormatForm(data, lenFile);
|
||||
}
|
||||
else
|
||||
{
|
||||
@ -1324,14 +1329,15 @@ int FileManager::docLength(Buffer * buffer) const
|
||||
return docLen;
|
||||
}
|
||||
|
||||
int FileManager::getEOLFormatForm(const char *data) const
|
||||
int FileManager::getEOLFormatForm(const char* const data, size_t length) const
|
||||
{
|
||||
size_t len = strlen(data);
|
||||
for (size_t i = 0 ; i < len ; i++)
|
||||
assert(data != nullptr && "invalid buffer for getEOLFormatForm()");
|
||||
|
||||
for (size_t i = 0; i != length; ++i)
|
||||
{
|
||||
if (data[i] == CR)
|
||||
{
|
||||
if (i+1 < len && data[i+1] == LF)
|
||||
if (i+1 < length && data[i+1] == LF)
|
||||
{
|
||||
return int(WIN_FORMAT);
|
||||
}
|
||||
|
@ -104,7 +104,7 @@ public:
|
||||
void destroyInstance() { delete _pSelf; };
|
||||
int getFileNameFromBuffer(BufferID id, TCHAR * fn2copy);
|
||||
int docLength(Buffer * buffer) const;
|
||||
int getEOLFormatForm(const char *data) const;
|
||||
int getEOLFormatForm(const char* const data, size_t length) const;
|
||||
size_t nextUntitledNewNumber() const;
|
||||
|
||||
private:
|
||||
@ -120,7 +120,7 @@ private:
|
||||
size_t _nrBufs;
|
||||
int detectCodepage(char* buf, size_t len);
|
||||
|
||||
bool loadFileData(Document doc, const TCHAR * filename, Utf8_16_Read * UnicodeConvertor, LangType language, int & encoding, formatType *pFormat = NULL);
|
||||
bool loadFileData(Document doc, const TCHAR * filename, char* buffer, Utf8_16_Read * UnicodeConvertor, LangType language, int & encoding, formatType *pFormat = NULL);
|
||||
};
|
||||
|
||||
#define MainFileManager FileManager::getInstance()
|
||||
@ -384,6 +384,9 @@ private :
|
||||
if (_canNotify)
|
||||
_pManager->beNotifiedOfBufferChange(this, mask);
|
||||
};
|
||||
|
||||
Buffer(const Buffer&) { assert(false); }
|
||||
Buffer& operator = (const Buffer&) { assert(false); return *this; }
|
||||
};
|
||||
|
||||
#endif //BUFFER_H
|
||||
|
@ -26,7 +26,7 @@
|
||||
// Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
||||
|
||||
|
||||
#include "precompiledHeaders.h"
|
||||
|
||||
#include "DocTabView.h"
|
||||
#include "ScintillaEditView.h"
|
||||
|
||||
|
@ -25,8 +25,8 @@
|
||||
// along with this program; if not, write to the Free Software
|
||||
// Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
||||
|
||||
|
||||
#include "precompiledHeaders.h"
|
||||
#include <Shlobj.h>
|
||||
#include <uxtheme.h>
|
||||
#include "FindReplaceDlg.h"
|
||||
#include "ScintillaEditView.h"
|
||||
#include "Notepad_plus_msgs.h"
|
||||
@ -2505,6 +2505,75 @@ void Finder::openAll()
|
||||
}
|
||||
}
|
||||
|
||||
bool Finder::isLineActualSearchResult(int line) const
|
||||
{
|
||||
const int foldLevel = _scintView.execute(SCI_GETFOLDLEVEL, line) & SC_FOLDLEVELNUMBERMASK;
|
||||
return foldLevel == SC_FOLDLEVELBASE + 3;
|
||||
}
|
||||
|
||||
generic_string Finder::prepareStringForClipboard(generic_string s) const
|
||||
{
|
||||
// Input: a string like "\tLine 3: search result".
|
||||
// Output: "search result"
|
||||
s = stringReplace(s, TEXT("\r"), TEXT(""));
|
||||
s = stringReplace(s, TEXT("\n"), TEXT(""));
|
||||
const unsigned int firstColon = s.find(TEXT(':'));
|
||||
if (firstColon == std::string::npos)
|
||||
{
|
||||
// Should never happen.
|
||||
assert(false);
|
||||
return s;
|
||||
}
|
||||
else
|
||||
{
|
||||
// Plus 2 in order to deal with ": ".
|
||||
return s.substr(2 + firstColon);
|
||||
}
|
||||
}
|
||||
|
||||
void Finder::copy()
|
||||
{
|
||||
size_t fromLine, toLine;
|
||||
{
|
||||
const int selStart = _scintView.execute(SCI_GETSELECTIONSTART);
|
||||
const int selEnd = _scintView.execute(SCI_GETSELECTIONEND);
|
||||
const bool hasSelection = selStart != selEnd;
|
||||
const pair<int, int> lineRange = _scintView.getSelectionLinesRange();
|
||||
if (hasSelection && lineRange.first != lineRange.second)
|
||||
{
|
||||
fromLine = lineRange.first;
|
||||
toLine = lineRange.second;
|
||||
}
|
||||
else
|
||||
{
|
||||
// Abuse fold levels to find out which lines to copy to clipboard.
|
||||
// We get the current line and then the next line which has a smaller fold level (SCI_GETLASTCHILD).
|
||||
// Then we loop all lines between them and determine which actually contain search results.
|
||||
fromLine = _scintView.getCurrentLineNumber();
|
||||
const int selectedLineFoldLevel = _scintView.execute(SCI_GETFOLDLEVEL, fromLine) & SC_FOLDLEVELNUMBERMASK;
|
||||
toLine = _scintView.execute(SCI_GETLASTCHILD, fromLine, selectedLineFoldLevel);
|
||||
}
|
||||
}
|
||||
|
||||
std::vector<generic_string> lines;
|
||||
for (size_t line = fromLine; line <= toLine; ++line)
|
||||
{
|
||||
if (isLineActualSearchResult(line))
|
||||
{
|
||||
lines.push_back(prepareStringForClipboard(_scintView.getLine(line)));
|
||||
}
|
||||
}
|
||||
const generic_string toClipboard = stringJoin(lines, TEXT("\r\n"));
|
||||
if (!toClipboard.empty())
|
||||
{
|
||||
if (!str2Clipboard(toClipboard.c_str(), _hSelf))
|
||||
{
|
||||
assert(false);
|
||||
::MessageBox(NULL, TEXT("Error placing text in clipboard."), TEXT("Notepad++"), MB_ICONINFORMATION);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void Finder::beginNewFilesSearch()
|
||||
{
|
||||
//_scintView.execute(SCI_SETLEXER, SCLEX_NULL);
|
||||
@ -2617,7 +2686,7 @@ INT_PTR CALLBACK Finder::run_dlgProc(UINT message, WPARAM wParam, LPARAM lParam)
|
||||
|
||||
case NPPM_INTERNAL_SCINTILLAFINFERCOPY :
|
||||
{
|
||||
_scintView.execute(SCI_COPY);
|
||||
copy();
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
@ -2658,10 +2727,10 @@ INT_PTR CALLBACK Finder::run_dlgProc(UINT message, WPARAM wParam, LPARAM lParam)
|
||||
tmp.push_back(MenuItemUnit(NPPM_INTERNAL_SCINTILLAFINFERUNCOLLAPSE, TEXT("Uncollapse all")));
|
||||
tmp.push_back(MenuItemUnit(0, TEXT("Separator")));
|
||||
tmp.push_back(MenuItemUnit(NPPM_INTERNAL_SCINTILLAFINFERCOPY, TEXT("Copy")));
|
||||
tmp.push_back(MenuItemUnit(NPPM_INTERNAL_SCINTILLAFINFERSELECTALL, TEXT("Select All")));
|
||||
tmp.push_back(MenuItemUnit(NPPM_INTERNAL_SCINTILLAFINFERCLEARALL, TEXT("Clear All")));
|
||||
tmp.push_back(MenuItemUnit(NPPM_INTERNAL_SCINTILLAFINFERSELECTALL, TEXT("Select all")));
|
||||
tmp.push_back(MenuItemUnit(NPPM_INTERNAL_SCINTILLAFINFERCLEARALL, TEXT("Clear all")));
|
||||
tmp.push_back(MenuItemUnit(0, TEXT("Separator")));
|
||||
tmp.push_back(MenuItemUnit(NPPM_INTERNAL_SCINTILLAFINFEROPENALL, TEXT("Open All")));
|
||||
tmp.push_back(MenuItemUnit(NPPM_INTERNAL_SCINTILLAFINFEROPENALL, TEXT("Open all")));
|
||||
|
||||
scintillaContextmenu.create(_hSelf, tmp);
|
||||
|
||||
|
@ -144,6 +144,7 @@ public:
|
||||
void setFinderStyle();
|
||||
void removeAll();
|
||||
void openAll();
|
||||
void copy();
|
||||
void beginNewFilesSearch();
|
||||
void finishFilesSearch(int count);
|
||||
void gotoNextFoundResult(int direction);
|
||||
@ -177,6 +178,9 @@ private:
|
||||
_scintView.execute(SCI_SETREADONLY, isReadOnly);
|
||||
};
|
||||
|
||||
bool isLineActualSearchResult(int line) const;
|
||||
generic_string prepareStringForClipboard(generic_string s) const;
|
||||
|
||||
static FoundInfo EmptyFoundInfo;
|
||||
static SearchResultMarking EmptySearchResultMarking;
|
||||
};
|
||||
|
@ -26,7 +26,6 @@
|
||||
// Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
||||
|
||||
|
||||
#include "precompiledHeaders.h"
|
||||
#include "FunctionCallTip.h"
|
||||
|
||||
|
||||
|
@ -26,7 +26,6 @@
|
||||
// Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
||||
|
||||
|
||||
#include "precompiledHeaders.h"
|
||||
#include "GoToLineDlg.h"
|
||||
|
||||
|
||||
|
@ -26,7 +26,6 @@
|
||||
// Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
||||
|
||||
|
||||
#include "precompiledHeaders.h"
|
||||
#include "Printer.h"
|
||||
#include "RunDlg.h"
|
||||
//#include "Parameters.h"
|
||||
|
@ -31,6 +31,7 @@
|
||||
#include "Parameters.h"
|
||||
#include "Sorters.h"
|
||||
#include "TCHAR.h"
|
||||
#include <memory>
|
||||
|
||||
using namespace std;
|
||||
|
||||
@ -1913,11 +1914,22 @@ void ScintillaEditView::showCallTip(int startPos, const TCHAR * def)
|
||||
execute(SCI_CALLTIPSHOW, startPos, LPARAM(defA));
|
||||
}
|
||||
|
||||
generic_string ScintillaEditView::getLine(int lineNumber)
|
||||
{
|
||||
int lineLen = execute(SCI_LINELENGTH, lineNumber);
|
||||
const int bufSize = lineLen + 1;
|
||||
std::unique_ptr<TCHAR[]> buf = std::make_unique<TCHAR[]>(bufSize);
|
||||
getLine(lineNumber, buf.get(), bufSize);
|
||||
return buf.get();
|
||||
}
|
||||
|
||||
void ScintillaEditView::getLine(int lineNumber, TCHAR * line, int lineBufferLen)
|
||||
{
|
||||
WcharMbcsConvertor *wmc = WcharMbcsConvertor::getInstance();
|
||||
unsigned int cp = execute(SCI_GETCODEPAGE);
|
||||
char *lineA = new char[lineBufferLen];
|
||||
// From Scintilla documentation for SCI_GETLINE: "The buffer is not terminated by a 0 character."
|
||||
memset(lineA, '\0', sizeof(char) * lineBufferLen);
|
||||
execute(SCI_GETLINE, lineNumber, (LPARAM)lineA);
|
||||
const TCHAR *lineW = wmc->char2wchar(lineA, cp);
|
||||
lstrcpyn(line, lineW, lineBufferLen);
|
||||
|
@ -272,6 +272,7 @@ public:
|
||||
int replaceTargetRegExMode(const TCHAR * re, int fromTargetPos = -1, int toTargetPos = -1) const;
|
||||
void showAutoComletion(int lenEntered, const TCHAR * list);
|
||||
void showCallTip(int startPos, const TCHAR * def);
|
||||
generic_string getLine(int lineNumber);
|
||||
void getLine(int lineNumber, TCHAR * line, int lineBufferLen);
|
||||
void addText(int length, const char *buf);
|
||||
|
||||
|
@ -26,8 +26,6 @@
|
||||
// Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
||||
|
||||
|
||||
#include "precompiledHeaders.h"
|
||||
|
||||
#include "localization.h"
|
||||
#include "UserDefineDialog.h"
|
||||
#include "ScintillaEditView.h"
|
||||
|
@ -29,9 +29,7 @@
|
||||
#ifndef USER_DEFINE_LANG_REFERENCE_H
|
||||
#define USER_DEFINE_LANG_REFERENCE_H
|
||||
|
||||
#ifndef SCILEXER_H
|
||||
#include "scilexer.h"
|
||||
#endif //SCILEXER_H
|
||||
|
||||
const int langNameLenMax = 33;
|
||||
const int extsLenMax = 256;
|
||||
|
@ -22,7 +22,6 @@ must not be misrepresented as being the original software.
|
||||
distribution.
|
||||
*/
|
||||
|
||||
#include "precompiledHeaders.h"
|
||||
#include "tinyxmlA.h"
|
||||
|
||||
#ifndef TIXMLA_USE_STL
|
||||
|
@ -22,7 +22,7 @@ must not be misrepresented as being the original software.
|
||||
distribution.
|
||||
*/
|
||||
|
||||
#include "precompiledHeaders.h"
|
||||
#include "Common.h"
|
||||
#include "tinyxmlA.h"
|
||||
|
||||
#ifdef TIXMLA_USE_STL
|
||||
|
@ -22,7 +22,7 @@ must not be misrepresented as being the original software.
|
||||
distribution.
|
||||
*/
|
||||
|
||||
#include "precompiledHeaders.h"
|
||||
|
||||
#include "tinyxmlA.h"
|
||||
|
||||
// The goal of the seperate error file is to make the first
|
||||
|
@ -22,7 +22,7 @@ must not be misrepresented as being the original software.
|
||||
distribution.
|
||||
*/
|
||||
|
||||
#include "precompiledHeaders.h"
|
||||
|
||||
#include "tinyxmlA.h"
|
||||
|
||||
//#define DEBUG_PARSER
|
||||
|
@ -22,7 +22,6 @@ must not be misrepresented as being the original software.
|
||||
distribution.
|
||||
*/
|
||||
|
||||
#include "precompiledHeaders.h"
|
||||
|
||||
#ifndef TIXML_USE_STL
|
||||
|
||||
|
@ -22,7 +22,7 @@ must not be misrepresented as being the original software.
|
||||
distribution.
|
||||
*/
|
||||
|
||||
#include "precompiledHeaders.h"
|
||||
#include <sstream>
|
||||
#include "tinyxml.h"
|
||||
|
||||
bool TiXmlBase::condenseWhiteSpace = true;
|
||||
|
@ -22,7 +22,7 @@ must not be misrepresented as being the original software.
|
||||
distribution.
|
||||
*/
|
||||
|
||||
#include "precompiledHeaders.h"
|
||||
|
||||
#include "tinyxml.h"
|
||||
|
||||
// The goal of the seperate error file is to make the first
|
||||
|
@ -22,7 +22,7 @@ must not be misrepresented as being the original software.
|
||||
distribution.
|
||||
*/
|
||||
|
||||
#include "precompiledHeaders.h"
|
||||
|
||||
#include "tinyxml.h"
|
||||
|
||||
//#define DEBUG_PARSER
|
||||
|
@ -5,7 +5,7 @@
|
||||
// Copyright 1998-2001 by Neil Hodgson <neilh@scintilla.org>
|
||||
// The License.txt file describes the conditions under which this software may be distributed.
|
||||
|
||||
#include "precompiledHeaders.h"
|
||||
#include <windows.h>
|
||||
#include "UniConversion.h"
|
||||
|
||||
unsigned int UTF8Length(const wchar_t *uptr, unsigned int tlen) {
|
||||
|
@ -5,9 +5,14 @@
|
||||
// Copyright 1998-2001 by Neil Hodgson <neilh@scintilla.org>
|
||||
// The License.txt file describes the conditions under which this software may be distributed.
|
||||
|
||||
#ifndef UNICONVERSION_H
|
||||
#define UNICONVERSION_H
|
||||
|
||||
unsigned int UTF8Length(const wchar_t * uptr, unsigned int tlen);
|
||||
void UTF8FromUCS2(const wchar_t * uptr, unsigned int tlen, char * putf, unsigned int len);
|
||||
unsigned int UCS2Length(const char * s, unsigned int len);
|
||||
unsigned int UCS2FromUTF8(const char * s, unsigned int len, wchar_t * tbuf, unsigned int tlen);
|
||||
unsigned int ascii_to_utf8(const char * pszASCII, unsigned int lenASCII, char * pszUTF8);
|
||||
int utf8_to_ascii(const char * pszUTF8, unsigned int lenUTF8, char * pszASCII);
|
||||
|
||||
#endif //UNICONVERSION_H
|
||||
|
@ -16,7 +16,6 @@
|
||||
// - Add convert function in Utf8_16_Write
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#include "precompiledHeaders.h"
|
||||
#include "Utf8_16.h"
|
||||
|
||||
const Utf8_16::utf8 Utf8_16::k_Boms[][3] = {
|
||||
@ -31,7 +30,8 @@ const Utf8_16::utf8 Utf8_16::k_Boms[][3] = {
|
||||
|
||||
Utf8_16_Read::Utf8_16_Read() {
|
||||
m_eEncoding = uni8Bit;
|
||||
m_nBufSize = 0;
|
||||
m_nAllocatedBufSize = 0;
|
||||
m_nNewBufSize = 0;
|
||||
m_pNewBuf = NULL;
|
||||
m_bFirstRead = true;
|
||||
}
|
||||
@ -113,10 +113,9 @@ size_t Utf8_16_Read::convert(char* buf, size_t len)
|
||||
// bugfix by Jens Lorenz
|
||||
static size_t nSkip = 0;
|
||||
|
||||
size_t ret = 0;
|
||||
|
||||
m_pBuf = (ubyte*)buf;
|
||||
m_nLen = len;
|
||||
m_nNewBufSize = 0;
|
||||
|
||||
if (m_bFirstRead == true)
|
||||
{
|
||||
@ -131,16 +130,16 @@ size_t Utf8_16_Read::convert(char* buf, size_t len)
|
||||
case uni8Bit:
|
||||
case uniCookie: {
|
||||
// Do nothing, pass through
|
||||
m_nBufSize = 0;
|
||||
m_nAllocatedBufSize = 0;
|
||||
m_pNewBuf = m_pBuf;
|
||||
ret = len;
|
||||
m_nNewBufSize = len;
|
||||
break;
|
||||
}
|
||||
case uniUTF8: {
|
||||
// Pass through after BOM
|
||||
m_nBufSize = 0;
|
||||
m_nAllocatedBufSize = 0;
|
||||
m_pNewBuf = m_pBuf + nSkip;
|
||||
ret = len - nSkip;
|
||||
m_nNewBufSize = len - nSkip;
|
||||
break;
|
||||
}
|
||||
case uni16BE_NoBOM:
|
||||
@ -149,13 +148,13 @@ size_t Utf8_16_Read::convert(char* buf, size_t len)
|
||||
case uni16LE: {
|
||||
size_t newSize = len + len / 2 + 1;
|
||||
|
||||
if (m_nBufSize != newSize)
|
||||
if (m_nAllocatedBufSize != newSize)
|
||||
{
|
||||
if (m_pNewBuf)
|
||||
delete [] m_pNewBuf;
|
||||
m_pNewBuf = NULL;
|
||||
m_pNewBuf = new ubyte[newSize];
|
||||
m_nBufSize = newSize;
|
||||
m_nAllocatedBufSize = newSize;
|
||||
}
|
||||
|
||||
ubyte* pCur = m_pNewBuf;
|
||||
@ -166,7 +165,7 @@ size_t Utf8_16_Read::convert(char* buf, size_t len)
|
||||
{
|
||||
*pCur++ = m_Iter16.get();
|
||||
}
|
||||
ret = pCur - m_pNewBuf;
|
||||
m_nNewBufSize = pCur - m_pNewBuf;
|
||||
break;
|
||||
}
|
||||
default:
|
||||
@ -176,7 +175,7 @@ size_t Utf8_16_Read::convert(char* buf, size_t len)
|
||||
// necessary for second calls and more
|
||||
nSkip = 0;
|
||||
|
||||
return ret;
|
||||
return m_nNewBufSize;
|
||||
}
|
||||
|
||||
|
||||
|
@ -112,7 +112,8 @@ public:
|
||||
~Utf8_16_Read();
|
||||
|
||||
size_t convert(char* buf, size_t len);
|
||||
char* getNewBuf() { return reinterpret_cast<char *>(m_pNewBuf); }
|
||||
const char* getNewBuf() const { return (const char*) m_pNewBuf; }
|
||||
size_t getNewSize() const { return m_nNewBufSize; }
|
||||
|
||||
UniMode getEncoding() const { return m_eEncoding; }
|
||||
size_t calcCurPos(size_t pos);
|
||||
@ -126,7 +127,10 @@ private:
|
||||
UniMode m_eEncoding;
|
||||
ubyte* m_pBuf;
|
||||
ubyte* m_pNewBuf;
|
||||
size_t m_nBufSize;
|
||||
// size of the new buffer
|
||||
size_t m_nNewBufSize;
|
||||
// size of the previously allocated buffer (if != 0)
|
||||
size_t m_nAllocatedBufSize;
|
||||
size_t m_nSkip;
|
||||
bool m_bFirstRead;
|
||||
size_t m_nLen;
|
||||
|
@ -26,7 +26,6 @@
|
||||
// Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
||||
|
||||
|
||||
#include "precompiledHeaders.h"
|
||||
#include "URLCtrl.h"
|
||||
|
||||
static BYTE XORMask[128] =
|
||||
|
@ -26,7 +26,7 @@
|
||||
// Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
||||
|
||||
|
||||
#include "precompiledHeaders.h"
|
||||
|
||||
#include "ListView.h"
|
||||
#include "Parameters.h"
|
||||
#include "localization.h"
|
||||
|
@ -30,6 +30,7 @@
|
||||
#define LISTVIEW_H
|
||||
|
||||
#include "window.h"
|
||||
#include "Common.h"
|
||||
|
||||
class ListView : public Window
|
||||
{
|
||||
|
@ -29,17 +29,10 @@
|
||||
#ifndef WORD_STYLE_H
|
||||
#define WORD_STYLE_H
|
||||
|
||||
#ifndef COLOUR_PICKER_H
|
||||
#include "ColourPicker.h"
|
||||
#endif //COLOUR_PICKER_H
|
||||
|
||||
#ifndef WORD_STYLE_DLG_RES_H
|
||||
#include "WordStyleDlgRes.h"
|
||||
#endif //WORD_STYLE_DLG_RES_H
|
||||
|
||||
#ifndef PARAMETERS_H
|
||||
#include "Parameters.h"
|
||||
#endif //PARAMETERS_H
|
||||
|
||||
|
||||
#define WM_UPDATESCINTILLAS (WORDSTYLE_USER + 1) //GlobalStyleDlg's msg 2 send 2 its parent
|
||||
|
||||
|
@ -26,7 +26,7 @@
|
||||
// Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
||||
|
||||
|
||||
#include "precompiledHeaders.h"
|
||||
|
||||
#include "DockingManager.h"
|
||||
#include "DockingSplitter.h"
|
||||
#include "DockingCont.h"
|
||||
@ -44,18 +44,24 @@ static HHOOK gWinCallHook = NULL;
|
||||
LRESULT CALLBACK FocusWndProc(int nCode, WPARAM wParam, LPARAM lParam);
|
||||
|
||||
// Callback function that handles messages (to test focus)
|
||||
LRESULT CALLBACK FocusWndProc(int nCode, WPARAM wParam, LPARAM lParam) {
|
||||
if (nCode == HC_ACTION && hWndServer) {
|
||||
LRESULT CALLBACK FocusWndProc(int nCode, WPARAM wParam, LPARAM lParam)
|
||||
{
|
||||
if (nCode == HC_ACTION && hWndServer)
|
||||
{
|
||||
DockingManager *pDockingManager = (DockingManager *)::GetWindowLongPtr(hWndServer, GWL_USERDATA);
|
||||
if (pDockingManager) {
|
||||
if (pDockingManager)
|
||||
{
|
||||
vector<DockingCont*> & vcontainer = pDockingManager->getContainerInfo();
|
||||
CWPSTRUCT * pCwp = (CWPSTRUCT*)lParam;
|
||||
if (pCwp->message == WM_KILLFOCUS) {
|
||||
if (pCwp->message == WM_KILLFOCUS)
|
||||
{
|
||||
for (int i = 0; i < DOCKCONT_MAX; ++i)
|
||||
{
|
||||
vcontainer[i]->SetActive(FALSE); //deactivate all containers
|
||||
}
|
||||
} else if (pCwp->message == WM_SETFOCUS) {
|
||||
}
|
||||
else if (pCwp->message == WM_SETFOCUS)
|
||||
{
|
||||
for (int i = 0; i < DOCKCONT_MAX; ++i)
|
||||
{
|
||||
vcontainer[i]->SetActive(IsChild(vcontainer[i]->getHSelf(), pCwp->hwnd)); //activate the container that contains the window with focus, this can be none
|
||||
|
@ -29,6 +29,11 @@
|
||||
#ifndef DOCKINGMANAGER_H
|
||||
#define DOCKINGMANAGER_H
|
||||
|
||||
#include <vector>
|
||||
#include <windows.h>
|
||||
#include <commctrl.h>
|
||||
#include "Window.h"
|
||||
|
||||
#ifndef DOCKINGCONT
|
||||
#include "DockingCont.h"
|
||||
#endif //DOCKINGCONT
|
||||
@ -39,6 +44,7 @@ class DockingSplitter;
|
||||
#include "SplitterContainer.h"
|
||||
#endif //SPLITTER_CONTAINER_H
|
||||
|
||||
|
||||
#define DSPC_CLASS_NAME TEXT("dockingManager")
|
||||
#define CONT_MAP_MAX 50
|
||||
|
||||
|
@ -26,7 +26,7 @@
|
||||
// Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
||||
|
||||
|
||||
#include "precompiledHeaders.h"
|
||||
|
||||
#include "DockingSplitter.h"
|
||||
#include "Notepad_plus_msgs.h"
|
||||
#include "Parameters.h"
|
||||
|
@ -29,6 +29,8 @@
|
||||
#ifndef DOCKINGSPLITTER_H
|
||||
#define DOCKINGSPLITTER_H
|
||||
|
||||
#include "Window.h"
|
||||
|
||||
#ifndef DOCKING_H
|
||||
#include "Docking.h"
|
||||
#endif //DOCKING_H
|
||||
|
@ -29,7 +29,6 @@
|
||||
// speed and consistency of the drag-rectangle - August 2010, Joern Gruel (jg)
|
||||
|
||||
|
||||
#include "precompiledHeaders.h"
|
||||
#include "Gripper.h"
|
||||
#include "DockingManager.h"
|
||||
#include "Parameters.h"
|
||||
|
@ -29,6 +29,10 @@
|
||||
#ifndef GRIPPER_H
|
||||
#define GRIPPER_H
|
||||
|
||||
#include <windows.h>
|
||||
#include <commctrl.h>
|
||||
#include "Common.h"
|
||||
|
||||
#ifndef DOCKING_H
|
||||
#include "Docking.h"
|
||||
#endif //DOCKING_H
|
||||
|
@ -26,7 +26,6 @@
|
||||
// Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
||||
|
||||
|
||||
#include "precompiledHeaders.h"
|
||||
#include "documentMap.h"
|
||||
#include "ScintillaEditView.h"
|
||||
|
||||
|
@ -26,7 +26,6 @@
|
||||
// Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
||||
|
||||
|
||||
#include "precompiledHeaders.h"
|
||||
#include "FindCharsInRange.h"
|
||||
#include "FindCharsInRange_rc.h"
|
||||
|
||||
|
@ -26,7 +26,6 @@
|
||||
// Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
||||
|
||||
|
||||
#include "precompiledHeaders.h"
|
||||
#include "functionListPanel.h"
|
||||
#include "ScintillaEditView.h"
|
||||
#include "localization.h"
|
||||
|
@ -25,7 +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 <shlwapi.h>
|
||||
#include "ScintillaEditView.h"
|
||||
#include "functionParser.h"
|
||||
#include "boostregexsearch.h"
|
||||
|
@ -26,7 +26,6 @@
|
||||
// Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
||||
|
||||
|
||||
#include "precompiledHeaders.h"
|
||||
#include "ImageListSet.h"
|
||||
|
||||
void IconList::create(HINSTANCE hInst, int iconSize)
|
||||
|
@ -29,6 +29,8 @@
|
||||
#ifndef IMAGE_LIST_H
|
||||
#define IMAGE_LIST_H
|
||||
|
||||
#include <vector>
|
||||
#include <windows.h>
|
||||
#include <commctrl.h>
|
||||
|
||||
const int nbMax = 45;
|
||||
|
@ -25,8 +25,9 @@
|
||||
// along with this program; if not, write to the Free Software
|
||||
// Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
||||
|
||||
|
||||
#include "precompiledHeaders.h"
|
||||
#include <shlwapi.h>
|
||||
#include <Shlobj.h>
|
||||
#include <uxtheme.h>
|
||||
#include "preferenceDlg.h"
|
||||
#include "lesDlgs.h"
|
||||
#include "EncodingMapper.h"
|
||||
|
@ -26,7 +26,6 @@
|
||||
// Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
||||
|
||||
|
||||
#include "precompiledHeaders.h"
|
||||
#include "ProjectPanel.h"
|
||||
#include "resource.h"
|
||||
#include "tinyxml.h"
|
||||
|
@ -26,7 +26,7 @@
|
||||
// Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
||||
|
||||
|
||||
#include "precompiledHeaders.h"
|
||||
|
||||
#include "TreeView.h"
|
||||
|
||||
#define CY_ITEMHEIGHT 18
|
||||
|
@ -28,7 +28,10 @@
|
||||
#ifndef TREE_VIEW_H
|
||||
#define TREE_VIEW_H
|
||||
|
||||
#include <windows.h>
|
||||
#include <commctrl.h>
|
||||
#include "window.h"
|
||||
#include "Common.h"
|
||||
|
||||
struct TreeStateNode {
|
||||
generic_string _label;
|
||||
|
@ -15,7 +15,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 "StaticDialog.h"
|
||||
#include "RunDlg.h"
|
||||
#include "FileDialog.h"
|
||||
#include "Notepad_plus_msgs.h"
|
||||
|
@ -18,6 +18,9 @@
|
||||
#ifndef RUN_DLG_H
|
||||
#define RUN_DLG_H
|
||||
|
||||
#include <Oleacc.h>
|
||||
#include "Common.h"
|
||||
|
||||
#ifndef RUN_DLG_RC_H
|
||||
#include "RunDlg_rc.h"
|
||||
#endif //RUN_DLG_RC_H
|
||||
|
@ -29,10 +29,7 @@
|
||||
#ifndef STATIC_DIALOG_H
|
||||
#define STATIC_DIALOG_H
|
||||
|
||||
#ifndef NOTEPAD_PLUS_MSGS_H
|
||||
#include "Notepad_plus_msgs.h"
|
||||
#endif //NOTEPAD_PLUS_MSGS_H
|
||||
|
||||
#include "Window.h"
|
||||
|
||||
typedef HRESULT (WINAPI * ETDTProc) (HWND, DWORD);
|
||||
|
@ -26,7 +26,7 @@
|
||||
// Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
||||
|
||||
|
||||
#include "precompiledHeaders.h"
|
||||
|
||||
#include "TabBar.h"
|
||||
#include "Parameters.h"
|
||||
|
||||
|
@ -26,7 +26,7 @@
|
||||
// Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
||||
|
||||
|
||||
#include "precompiledHeaders.h"
|
||||
|
||||
#include "TaskList.h"
|
||||
#include "TaskListDlg_rc.h"
|
||||
#include "colors.h"
|
||||
|
@ -29,6 +29,10 @@
|
||||
#ifndef TASKLIST_H
|
||||
#define TASKLIST_H
|
||||
|
||||
#include <windows.h>
|
||||
#include <commctrl.h>
|
||||
#include "Window.h"
|
||||
|
||||
#ifndef WM_MOUSEWHEEL
|
||||
#define WM_MOUSEWHEEL 0x020A
|
||||
#endif //WM_MOUSEWHEEL
|
||||
|
@ -26,7 +26,7 @@
|
||||
// Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
||||
|
||||
|
||||
#include "precompiledHeaders.h"
|
||||
|
||||
#include "TaskListDlg.h"
|
||||
#include "Parameters.h"
|
||||
#include "resource.h"
|
||||
|
@ -29,6 +29,9 @@
|
||||
#ifndef TASKLISTDLG_H
|
||||
#define TASKLISTDLG_H
|
||||
|
||||
#include "Common.h"
|
||||
#include "StaticDialog.h"
|
||||
|
||||
#ifndef TASKLISTDLGRC_H
|
||||
#include "TaskListDlg_rc.h"
|
||||
#endif //TASKLISTDLGRC_H
|
||||
|
@ -26,7 +26,7 @@
|
||||
// Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
||||
|
||||
|
||||
#include "precompiledHeaders.h"
|
||||
|
||||
#include "ToolBar.h"
|
||||
#include "Shortcut.h"
|
||||
#include "Parameters.h"
|
||||
|
@ -29,11 +29,9 @@
|
||||
#ifndef TOOL_BAR_H
|
||||
#define TOOL_BAR_H
|
||||
|
||||
#ifndef NOTEPAD_PLUS_MSGS_H
|
||||
#include "Notepad_plus_msgs.h"
|
||||
#endif //NOTEPAD_PLUS_MSGS_H
|
||||
|
||||
#include "Common.h"
|
||||
#include "Window.h"
|
||||
#include "Notepad_plus_msgs.h"
|
||||
#include "ImageListSet.h"
|
||||
|
||||
#define REBAR_BAR_TOOLBAR 0
|
||||
|
@ -26,14 +26,11 @@
|
||||
// Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
||||
|
||||
|
||||
#include "precompiledHeaders.h"
|
||||
#include <iostream>
|
||||
#include "ToolTip.h"
|
||||
|
||||
|
||||
|
||||
INT_PTR CALLBACK dlgProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam);
|
||||
|
||||
|
||||
void ToolTip::init(HINSTANCE hInst, HWND hParent)
|
||||
{
|
||||
if (_hSelf == NULL)
|
||||
|
@ -29,7 +29,9 @@
|
||||
#ifndef __TOOLTIP_H__
|
||||
#define __TOOLTIP_H__
|
||||
|
||||
#include <windows.h>
|
||||
#include <commctrl.h>
|
||||
#include "Window.h"
|
||||
|
||||
class ToolTip : public Window
|
||||
{
|
||||
|
@ -26,7 +26,6 @@
|
||||
// Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
||||
|
||||
|
||||
#include "precompiledHeaders.h"
|
||||
#include "trayIconControler.h"
|
||||
|
||||
trayIconControler::trayIconControler(HWND hwnd, UINT uID, UINT uCBMsg, HICON hicon, TCHAR *tip)
|
||||
|
@ -29,6 +29,8 @@
|
||||
#ifndef TRAY_ICON_CONTROLER_H
|
||||
#define TRAY_ICON_CONTROLER_H
|
||||
|
||||
#include <windows.h>
|
||||
|
||||
#define ADD NIM_ADD
|
||||
#define REMOVE NIM_DELETE
|
||||
|
||||
|
@ -26,7 +26,7 @@
|
||||
// Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
||||
|
||||
|
||||
#include "precompiledHeaders.h"
|
||||
|
||||
#include "VerticalFileSwitcher.h"
|
||||
#include "menuCmdID.h"
|
||||
#include "Parameters.h"
|
||||
|
@ -29,11 +29,7 @@
|
||||
#ifndef VERTICALFILESWITCHER_H
|
||||
#define VERTICALFILESWITCHER_H
|
||||
|
||||
//#include <windows.h>
|
||||
#ifndef DOCKINGDLGINTERFACE_H
|
||||
#include "DockingDlgInterface.h"
|
||||
#endif //DOCKINGDLGINTERFACE_H
|
||||
|
||||
#include "VerticalFileSwitcher_rc.h"
|
||||
#include "VerticalFileSwitcherListView.h"
|
||||
|
||||
|
@ -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 <shlwapi.h>
|
||||
#include "VerticalFileSwitcherListView.h"
|
||||
#include "Buffer.h"
|
||||
#include "localization.h"
|
||||
|
@ -26,8 +26,6 @@
|
||||
// Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
||||
|
||||
|
||||
#include "precompiledHeaders.h"
|
||||
|
||||
#include "WindowsDlg.h"
|
||||
#include "WindowsDlgRc.h"
|
||||
|
||||
|
@ -8,7 +8,7 @@
|
||||
// Theo - Heavily modified to remove MFC dependencies.
|
||||
// Replaced CWnd*/HWND, CRect/RECT, CSize/SIZE, CPoint/POINT
|
||||
|
||||
#include "precompiledHeaders.h"
|
||||
|
||||
#include "WinMgr.h"
|
||||
|
||||
// Theo - Style Helpers
|
||||
|
@ -7,7 +7,6 @@
|
||||
//
|
||||
|
||||
|
||||
#include "precompiledHeaders.h"
|
||||
#include "WinMgr.h"
|
||||
|
||||
//////////////////
|
||||
|
@ -29,10 +29,7 @@
|
||||
#ifndef WINDOWS_DLG_H
|
||||
#define WINDOWS_DLG_H
|
||||
|
||||
#ifndef SIZABLE_DLG_H
|
||||
#include "SizeableDlg.h"
|
||||
#endif //SIZABLE_DLG_H
|
||||
|
||||
#include "Common.h"
|
||||
|
||||
class DocTabView;
|
||||
|
@ -26,7 +26,7 @@
|
||||
// Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
||||
|
||||
|
||||
#include "precompiledHeaders.h"
|
||||
|
||||
#include "lastRecentFileList.h"
|
||||
#include "menuCmdID.h"
|
||||
#include "localization.h"
|
||||
|
@ -26,7 +26,7 @@
|
||||
// Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
||||
|
||||
|
||||
#include "precompiledHeaders.h"
|
||||
|
||||
#include "lesDlgs.h"
|
||||
#include "resource.h"
|
||||
#include "menuCmdID.h"
|
||||
|
@ -29,6 +29,9 @@
|
||||
#ifndef SIZE_DLG_H
|
||||
#define SIZE_DLG_H
|
||||
|
||||
#include "StaticDialog.h"
|
||||
#include "Common.h"
|
||||
|
||||
const int DEFAULT_NB_NUMBER = 2;
|
||||
class ValueDlg : public StaticDialog
|
||||
{
|
||||
|
@ -26,7 +26,6 @@
|
||||
// Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
||||
|
||||
|
||||
#include "precompiledHeaders.h"
|
||||
#include "Notepad_plus.h"
|
||||
#include "ShortcutMapper.h"
|
||||
#include "EncodingMapper.h"
|
||||
|
@ -29,9 +29,9 @@
|
||||
#ifndef LOCALIZATION_H
|
||||
#define LOCALIZATION_H
|
||||
|
||||
#ifndef TINYXMLA_INCLUDED
|
||||
#include "Common.h"
|
||||
#include "tinyxmlA.h"
|
||||
#endif //TINYXMLA_INCLUDED
|
||||
|
||||
|
||||
class FindReplaceDlg;
|
||||
class PreferenceDlg;
|
||||
|
@ -34,7 +34,7 @@
|
||||
* the terms of any one of the MPL, the GPL or the LGPL.
|
||||
*
|
||||
* ***** END LICENSE BLOCK ***** */
|
||||
#include "precompiledHeaders.h"
|
||||
|
||||
#include "nscore.h"
|
||||
#include "JpCntx.h"
|
||||
|
||||
|
@ -34,7 +34,7 @@
|
||||
* the terms of any one of the MPL, the GPL or the LGPL.
|
||||
*
|
||||
* ***** END LICENSE BLOCK ***** */
|
||||
#include "precompiledHeaders.h"
|
||||
|
||||
#include "nsSBCharSetProber.h"
|
||||
/****************************************************************
|
||||
255: Control characters that usually does not exist in any text
|
||||
|
@ -34,7 +34,7 @@
|
||||
* the terms of any one of the MPL, the GPL or the LGPL.
|
||||
*
|
||||
* ***** END LICENSE BLOCK ***** */
|
||||
#include "precompiledHeaders.h"
|
||||
|
||||
#include "nsSBCharSetProber.h"
|
||||
|
||||
|
||||
|
@ -34,7 +34,7 @@
|
||||
* the terms of any one of the MPL, the GPL or the LGPL.
|
||||
*
|
||||
* ***** END LICENSE BLOCK ***** */
|
||||
#include "precompiledHeaders.h"
|
||||
|
||||
#include "nsSBCharSetProber.h"
|
||||
/****************************************************************
|
||||
255: Control characters that usually does not exist in any text
|
||||
|
@ -36,7 +36,7 @@
|
||||
* the terms of any one of the MPL, the GPL or the LGPL.
|
||||
*
|
||||
* ***** END LICENSE BLOCK ***** */
|
||||
#include "precompiledHeaders.h"
|
||||
|
||||
#include "nsSBCharSetProber.h"
|
||||
|
||||
|
||||
|
@ -34,7 +34,7 @@
|
||||
* the terms of any one of the MPL, the GPL or the LGPL.
|
||||
*
|
||||
* ***** END LICENSE BLOCK ***** */
|
||||
#include "precompiledHeaders.h"
|
||||
|
||||
#include "nsSBCharSetProber.h"
|
||||
/****************************************************************
|
||||
255: Control characters that usually does not exist in any text
|
||||
|
@ -34,7 +34,7 @@
|
||||
* the terms of any one of the MPL, the GPL or the LGPL.
|
||||
*
|
||||
* ***** END LICENSE BLOCK ***** */
|
||||
#include "precompiledHeaders.h"
|
||||
|
||||
#include "nsSBCharSetProber.h"
|
||||
|
||||
|
||||
|
@ -34,7 +34,7 @@
|
||||
* the terms of any one of the MPL, the GPL or the LGPL.
|
||||
*
|
||||
* ***** END LICENSE BLOCK ***** */
|
||||
#include "precompiledHeaders.h"
|
||||
|
||||
#include "nsBig5Prober.h"
|
||||
|
||||
void nsBig5Prober::Reset(void)
|
||||
|
@ -35,7 +35,7 @@
|
||||
* the terms of any one of the MPL, the GPL or the LGPL.
|
||||
*
|
||||
* ***** END LICENSE BLOCK ***** */
|
||||
#include "precompiledHeaders.h"
|
||||
|
||||
#include "nsCharSetProber.h"
|
||||
#include "prmem.h"
|
||||
|
||||
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue
Block a user