Skip to content

Commit

Permalink
Notepad++ Converter 4.5 release
Browse files Browse the repository at this point in the history
1. Update header files.
2. Support +2GB files correctly.
3. Remove Scintilla deprecated symbols for Notepad++.
  • Loading branch information
donho committed Nov 6, 2022
1 parent 43667bd commit 7a4d382
Show file tree
Hide file tree
Showing 17 changed files with 379 additions and 88 deletions.
2 changes: 1 addition & 1 deletion source/DockingFeature/Docking.h
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// This file is part of Notepad++ project
// Copyright (C)2021 Don HO <don.h@free.fr>
// Copyright (C)2022 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
Expand Down
2 changes: 1 addition & 1 deletion source/DockingFeature/DockingDlgInterface.h
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// This file is part of Notepad++ project
// Copyright (C)2021 Don HO <don.h@free.fr>
// Copyright (C)2022 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
Expand Down
2 changes: 1 addition & 1 deletion source/DockingFeature/StaticDialog.h
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// This file is part of Notepad++ project
// Copyright (C)2021 Don HO <don.h@free.fr>
// Copyright (C)2022 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
Expand Down
2 changes: 1 addition & 1 deletion source/DockingFeature/Window.h
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// This file is part of Notepad++ project
// Copyright (C)2021 Don HO <don.h@free.fr>
// Copyright (C)2022 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
Expand Down
153 changes: 131 additions & 22 deletions source/Notepad_plus_msgs.h
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// This file is part of Notepad++ project
// Copyright (C)2021 Don HO <don.h@free.fr>
// Copyright (C)2022 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
Expand Down Expand Up @@ -36,8 +36,10 @@ enum LangType {L_TEXT, L_PHP , L_C, L_CPP, L_CS, L_OBJC, L_JAVA, L_RC,\
// Don't use L_JS, use L_JAVASCRIPT instead
// The end of enumated language type, so it should be always at the end
L_EXTERNAL};
enum class ExternalLexerAutoIndentMode { Standard, C_Like, Custom };
enum class MacroStatus { Idle, RecordInProgress, RecordingStopped, PlayingBack };

enum winVer{ WV_UNKNOWN, WV_WIN32S, WV_95, WV_98, WV_ME, WV_NT, WV_W2K, WV_XP, WV_S2003, WV_XPX64, WV_VISTA, WV_WIN7, WV_WIN8, WV_WIN81, WV_WIN10 };
enum winVer { WV_UNKNOWN, WV_WIN32S, WV_95, WV_98, WV_ME, WV_NT, WV_W2K, WV_XP, WV_S2003, WV_XPX64, WV_VISTA, WV_WIN7, WV_WIN8, WV_WIN81, WV_WIN10, WV_WIN11 };
enum Platform { PF_UNKNOWN, PF_X86, PF_X64, PF_IA64, PF_ARM64 };


Expand Down Expand Up @@ -195,11 +197,31 @@ enum Platform { PF_UNKNOWN, PF_X86, PF_X64, PF_IA64, PF_ARM64 };
//void NPPM_TRIGGERTABBARCONTEXTMENU(int view, int index2Activate)

#define NPPM_GETNPPVERSION (NPPMSG + 50)
// int NPPM_GETNPPVERSION(0, 0)
// return version
// ex : v4.6
// HIWORD(version) == 4
// LOWORD(version) == 6
// int NPPM_GETNPPVERSION(BOOL ADD_ZERO_PADDING, 0)
// Get Notepad++ version
// HIWORD(returned_value) is major part of version: the 1st number
// LOWORD(returned_value) is minor part of version: the 3 last numbers
//
// ADD_ZERO_PADDING == TRUE
//
// version | HIWORD | LOWORD
//------------------------------
// 8.9.6.4 | 8 | 964
// 9 | 9 | 0
// 6.9 | 6 | 900
// 6.6.6 | 6 | 660
// 13.6.6.6 | 13 | 666
//
//
// ADD_ZERO_PADDING == FALSE
//
// version | HIWORD | LOWORD
//------------------------------
// 8.9.6.4 | 8 | 964
// 9 | 9 | 0
// 6.9 | 6 | 9
// 6.6.6 | 6 | 66
// 13.6.6.6 | 13 | 666

#define NPPM_HIDETABBAR (NPPMSG + 51)
// BOOL NPPM_HIDETABBAR(0, BOOL hideOrNot)
Expand Down Expand Up @@ -454,20 +476,97 @@ enum Platform { PF_UNKNOWN, PF_X86, PF_X64, PF_IA64, PF_ARM64 };
HICON hToolbarIconDarkMode;
};

#define VAR_NOT_RECOGNIZED 0
#define FULL_CURRENT_PATH 1
#define CURRENT_DIRECTORY 2
#define FILE_NAME 3
#define NAME_PART 4
#define EXT_PART 5
#define CURRENT_WORD 6
#define NPP_DIRECTORY 7
#define CURRENT_LINE 8
#define CURRENT_COLUMN 9
#define NPP_FULL_FILE_PATH 10
#define GETFILENAMEATCURSOR 11

#define RUNCOMMAND_USER (WM_USER + 3000)
#define NPPM_GETEXTERNALLEXERAUTOINDENTMODE (NPPMSG + 103)
// BOOL NPPM_GETEXTERNALLEXERAUTOINDENTMODE(const TCHAR *languageName, ExternalLexerAutoIndentMode &autoIndentMode)
// Get ExternalLexerAutoIndentMode for an installed external programming language.
// - Standard means Notepad++ will keep the same TAB indentation between lines;
// - C_Like means Notepad++ will perform a C-Language style indentation for the selected external language;
// - Custom means a Plugin will be controlling auto-indentation for the current language.
// returned values: TRUE for successful searches, otherwise FALSE.

#define NPPM_SETEXTERNALLEXERAUTOINDENTMODE (NPPMSG + 104)
// BOOL NPPM_SETEXTERNALLEXERAUTOINDENTMODE(const TCHAR *languageName, ExternalLexerAutoIndentMode autoIndentMode)
// Set ExternalLexerAutoIndentMode for an installed external programming language.
// - Standard means Notepad++ will keep the same TAB indentation between lines;
// - C_Like means Notepad++ will perform a C-Language style indentation for the selected external language;
// - Custom means a Plugin will be controlling auto-indentation for the current language.
// returned value: TRUE if function call was successful, otherwise FALSE.

#define NPPM_ISAUTOINDENTON (NPPMSG + 105)
// BOOL NPPM_ISAUTOINDENTON(0, 0)
// Returns the current Use Auto-Indentation setting in Notepad++ Preferences.

#define NPPM_GETCURRENTMACROSTATUS (NPPMSG + 106)
// MacroStatus NPPM_GETCURRENTMACROSTATUS(0, 0)
// Gets current enum class MacroStatus { Idle - means macro is not in use and it's empty, RecordInProgress, RecordingStopped, PlayingBack }

#define NPPM_ISDARKMODEENABLED (NPPMSG + 107)
// bool NPPM_ISDARKMODEENABLED(0, 0)
// Returns true when Notepad++ Dark Mode is enable, false when it is not.

#define NPPM_GETDARKMODECOLORS (NPPMSG + 108)
// bool NPPM_GETDARKMODECOLORS (size_t cbSize, NppDarkMode::Colors* returnColors)
// - cbSize must be filled with sizeof(NppDarkMode::Colors).
// - returnColors must be a pre-allocated NppDarkMode::Colors struct.
// Returns true when successful, false otherwise.
// You need to uncomment the following code to use NppDarkMode::Colors structure:
//
// namespace NppDarkMode
// {
// struct Colors
// {
// COLORREF background = 0;
// COLORREF softerBackground = 0;
// COLORREF hotBackground = 0;
// COLORREF pureBackground = 0;
// COLORREF errorBackground = 0;
// COLORREF text = 0;
// COLORREF darkerText = 0;
// COLORREF disabledText = 0;
// COLORREF linkText = 0;
// COLORREF edge = 0;
// COLORREF hotEdge = 0;
// COLORREF disabledEdge = 0;
// };
// }
//
// Note: in the case of calling failure ("false" is returned), you may need to change NppDarkMode::Colors structure to:
// https://github.com/notepad-plus-plus/notepad-plus-plus/blob/master/PowerEditor/src/NppDarkMode.h#L32

#define NPPM_GETCURRENTCMDLINE (NPPMSG + 109)
// INT NPPM_GETCURRENTCMDLINE(size_t strLen, TCHAR *commandLineStr)
// Get the Current Command Line string.
// Returns the number of TCHAR copied/to copy.
// Users should call it with commandLineStr as NULL to get the required number of TCHAR (not including the terminating nul character),
// allocate commandLineStr buffer with the return value + 1, then call it again to get the current command line string.

#define NPPM_CREATELEXER (NPPMSG + 110)
// void* NPPN_CREATELEXER(0, const TCHAR *lexer_name)
// Returns the ILexer pointer created by Lexilla

#define NPPM_GETBOOKMARKID (NPPMSG + 111)
// void* NPPM_GETBOOKMARKID(0, 0)
// Returns the bookmark ID



// For RUNCOMMAND_USER
#define VAR_NOT_RECOGNIZED 0
#define FULL_CURRENT_PATH 1
#define CURRENT_DIRECTORY 2
#define FILE_NAME 3
#define NAME_PART 4
#define EXT_PART 5
#define CURRENT_WORD 6
#define NPP_DIRECTORY 7
#define CURRENT_LINE 8
#define CURRENT_COLUMN 9
#define NPP_FULL_FILE_PATH 10
#define GETFILENAMEATCURSOR 11
#define CURRENT_LINESTR 12

#define RUNCOMMAND_USER (WM_USER + 3000)

#define NPPM_GETFULLCURRENTPATH (RUNCOMMAND_USER + FULL_CURRENT_PATH)
#define NPPM_GETCURRENTDIRECTORY (RUNCOMMAND_USER + CURRENT_DIRECTORY)
#define NPPM_GETFILENAME (RUNCOMMAND_USER + FILE_NAME)
Expand All @@ -476,6 +575,7 @@ enum Platform { PF_UNKNOWN, PF_X86, PF_X64, PF_IA64, PF_ARM64 };
#define NPPM_GETCURRENTWORD (RUNCOMMAND_USER + CURRENT_WORD)
#define NPPM_GETNPPDIRECTORY (RUNCOMMAND_USER + NPP_DIRECTORY)
#define NPPM_GETFILENAMEATCURSOR (RUNCOMMAND_USER + GETFILENAMEATCURSOR)
#define NPPM_GETCURRENTLINESTR (RUNCOMMAND_USER + CURRENT_LINESTR)
// BOOL NPPM_GETXXXXXXXXXXXXXXXX(size_t strLen, TCHAR *str)
// where str is the allocated TCHAR array,
// strLen is the allocated array size
Expand All @@ -492,7 +592,6 @@ enum Platform { PF_UNKNOWN, PF_X86, PF_X64, PF_IA64, PF_ARM64 };
#define NPPM_GETNPPFULLFILEPATH (RUNCOMMAND_USER + NPP_FULL_FILE_PATH)



// Notification code
#define NPPN_FIRST 1000
#define NPPN_READY (NPPN_FIRST + 1) // To notify plugins that all the procedures of launchment of notepad++ are done.
Expand Down Expand Up @@ -636,3 +735,13 @@ enum Platform { PF_UNKNOWN, PF_X86, PF_X64, PF_IA64, PF_ARM64 };
//scnNotification->nmhdr.code = NPPN_FILEDELETED;
//scnNotification->nmhdr.hwndFrom = hwndNpp;
//scnNotification->nmhdr.idFrom = BufferID;

#define NPPN_DARKMODECHANGED (NPPN_FIRST + 27) // To notify plugins that Dark Mode was enabled/disabled
//scnNotification->nmhdr.code = NPPN_DARKMODECHANGED;
//scnNotification->nmhdr.hwndFrom = hwndNpp;
//scnNotification->nmhdr.idFrom = 0;

#define NPPN_CMDLINEPLUGINMSG (NPPN_FIRST + 28) // To notify plugins that the new argument for plugins (via '-pluginMessage="YOUR_PLUGIN_ARGUMENT"' in command line) is available
//scnNotification->nmhdr.code = NPPN_CMDLINEPLUGINMSG;
//scnNotification->nmhdr.hwndFrom = hwndNpp;
//scnNotification->nmhdr.idFrom = pluginMessage; //where pluginMessage is pointer of type wchar_t
2 changes: 1 addition & 1 deletion source/NppPluginDemo.cpp
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// This file is part of Notepad++ project
// Copyright (C)2021 Don HO <don.h@free.fr>
// Copyright (C)2022 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
Expand Down
6 changes: 3 additions & 3 deletions source/PluginDefinition.cpp
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// This file is part of Notepad++ project
// Copyright (C)2021 Don HO <don.h@free.fr>
// Copyright (C)2022 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
Expand Down Expand Up @@ -207,11 +207,11 @@ SelectedString::SelectedString(): _str(NULL), _selStartPos(0), _selEndPos(0)

_str = new char[textLen+1];

Sci_TextRange tr;
Sci_TextRangeFull tr;
tr.chrg.cpMin = static_cast<long>(start);
tr.chrg.cpMax = static_cast<long>(end);
tr.lpstrText = _str;
::SendMessage(hCurrScintilla, SCI_GETTEXTRANGE, 0, reinterpret_cast<LPARAM>(&tr));
::SendMessage(hCurrScintilla, SCI_GETTEXTRANGEFULL, 0, reinterpret_cast<LPARAM>(&tr));
}

enum hexStat{st_init, st_c, st_cc};
Expand Down
2 changes: 1 addition & 1 deletion source/PluginDefinition.h
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// This file is part of Notepad++ project
// Copyright (C)2021 Don HO <don.h@free.fr>
// Copyright (C)2022 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
Expand Down
2 changes: 1 addition & 1 deletion source/PluginInterface.h
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// This file is part of Notepad++ project
// Copyright (C)2021 Don HO <don.h@free.fr>
// Copyright (C)2022 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
Expand Down
7 changes: 3 additions & 4 deletions source/Sci_Position.h
Original file line number Diff line number Diff line change
Expand Up @@ -15,12 +15,11 @@
typedef ptrdiff_t Sci_Position;

// Unsigned variant used for ILexer::Lex and ILexer::Fold
// Definitions of common types
typedef size_t Sci_PositionU;


// For Sci_CharacterRange which is defined as long to be compatible with Win32 CHARRANGE
typedef intptr_t Sci_PositionCR;
// Deprecated by Notepad++ 2GB+ support via new scintilla interfaces from 5.2.3 (see https://www.scintilla.org/ScintillaHistory.html)
// Please use Sci_Position, SCI_GETTEXTRANGEFULL, SCI_FINDTEXTFULL, and SCI_FORMATRANGEFULL and corresponding defines/structs
// typedef long Sci_PositionCR;

#ifdef _WIN32
#define SCI_METHOD __stdcall
Expand Down
Loading

0 comments on commit 7a4d382

Please sign in to comment.