Skip to content

Commit

Permalink
Update project to VS2022 and add CI
Browse files Browse the repository at this point in the history
- add github CI action
- update to VS2022
- added arm64
- use gitignore from plugintemplate
- avoid compiler warnings about hidden global vars
- enabled multithreaded builds in vcxproj
- enabled sdl checks in vcxproj
- corrected platform toolset for x64 release build
- corrected copy action of readme.txt

Close #1
  • Loading branch information
chcg authored and donho committed Oct 15, 2023
1 parent 8ec97a1 commit 3df1db5
Show file tree
Hide file tree
Showing 10 changed files with 641 additions and 83 deletions.
13 changes: 13 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
# To get started with Dependabot version updates, you'll need to specify which
# package ecosystems to update and where the package manifests are located.
# Please see the documentation for all configuration options:
# https://help.github.com/github/administering-a-repository/configuration-options-for-dependency-updates

version: 2
updates:

# Maintain dependencies for GitHub Actions
- package-ecosystem: "github-actions"
directory: "/"
schedule:
interval: "monthly"
75 changes: 75 additions & 0 deletions .github/workflows/CI_build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,75 @@
name: CI_build

on: [push, pull_request]

jobs:
build:

runs-on: windows-latest
strategy:
matrix:
build_configuration: [Release, Debug]
build_platform: [x64, Win32, ARM64]

steps:
- name: Checkout repo
uses: actions/checkout@v4

- name: Add msbuild to PATH
uses: microsoft/setup-msbuild@v1

- name: MSBuild of plugin dll
working-directory: vs.proj\
run: msbuild SelectNLaunch.vcxproj /m /p:configuration="${{ matrix.build_configuration }}" /p:platform="${{ matrix.build_platform }}"

- uses: olegtarasov/[email protected]
id: tagName

- name: zip artifacts for x64
if: matrix.build_platform == 'x64' && matrix.build_configuration == 'Release'
run: |
Remove-Item bin64\*.ipdb
Remove-Item bin64\*.iobj
7z a selectNLaunch_${{ steps.tagName.outputs.tag }}_${{ matrix.build_platform }}.zip .\bin64\*
- name: Archive artifacts for x64
if: matrix.build_platform == 'x64' && matrix.build_configuration == 'Release'
uses: actions/upload-artifact@v3
with:
name: selectNLaunch_${{ steps.tagName.outputs.tag }}_${{ matrix.build_platform }}.zip
path: selectNLaunch_${{ steps.tagName.outputs.tag }}_${{ matrix.build_platform }}.zip

- name: zip artifacts for Win32
if: matrix.build_platform == 'Win32' && matrix.build_configuration == 'Release'
run: |
Remove-Item bin\*.ipdb
Remove-Item bin\*.iobj
7z a selectNLaunch_${{ steps.tagName.outputs.tag }}_${{ matrix.build_platform }}.zip .\bin\*
- name: Archive artifacts for Win32
if: matrix.build_platform == 'Win32' && matrix.build_configuration == 'Release'
uses: actions/upload-artifact@v3
with:
name: selectNLaunch_${{ steps.tagName.outputs.tag }}_${{ matrix.build_platform }}.zip
path: selectNLaunch_${{ steps.tagName.outputs.tag }}_${{ matrix.build_platform }}.zip

- name: zip artifacts for ARM64
if: matrix.build_platform == 'ARM64' && matrix.build_configuration == 'Release'
run: |
Remove-Item arm64\*.ipdb
Remove-Item arm64\*.iobj
7z a selectNLaunch_${{ steps.tagName.outputs.tag }}_${{ matrix.build_platform }}.zip .\arm64\*
- name: Archive artifacts for ARM64
if: matrix.build_platform == 'ARM64' && matrix.build_configuration == 'Release'
uses: actions/upload-artifact@v3
with:
name: selectNLaunch_${{ steps.tagName.outputs.tag }}_${{ matrix.build_platform }}.zip
path: selectNLaunch_${{ steps.tagName.outputs.tag }}_${{ matrix.build_platform }}.zip

- name: Create release on tagging
uses: softprops/action-gh-release@v1
if: startsWith(github.ref, 'refs/tags/')
with:
files: selectNLaunch_${{ steps.tagName.outputs.tag }}_${{ matrix.build_platform }}.zip

19 changes: 12 additions & 7 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,12 +1,17 @@
*.sdf
*.sln
*.suo
bin/
bin64/
arm64/
vs.proj/Debug
vs.proj/Release
vs.proj/x64
bin64
bin
*.suo
*.sln
*.sdf
vs.proj/ARM64
vs.proj/SelectNLaunch.opensdf
src/SelectNLaunch.aps
vs.proj/SelectNLaunch.exp
vs.proj/SelectNLaunch.lib
vs.proj/SelectNLaunch.exp
vs.proj/SelectNLaunch.vcxproj.user
vs.proj/.vs/
*.aps
*.zip
212 changes: 187 additions & 25 deletions src/Notepad_plus_msgs.h
Original file line number Diff line number Diff line change
Expand Up @@ -32,12 +32,15 @@ enum LangType {L_TEXT, L_PHP , L_C, L_CPP, L_CS, L_OBJC, L_JAVA, L_RC,\
L_ASN1, L_AVS, L_BLITZBASIC, L_PUREBASIC, L_FREEBASIC, \
L_CSOUND, L_ERLANG, L_ESCRIPT, L_FORTH, L_LATEX, \
L_MMIXAL, L_NIM, L_NNCRONTAB, L_OSCRIPT, L_REBOL, \
L_REGISTRY, L_RUST, L_SPICE, L_TXT2TAGS, L_VISUALPROLOG, L_TYPESCRIPT,\
L_REGISTRY, L_RUST, L_SPICE, L_TXT2TAGS, L_VISUALPROLOG,\
L_TYPESCRIPT, L_JSON5, L_MSSQL, L_GDSCRIPT, L_HOLLYWOOD,\
// 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 @@ -165,8 +168,8 @@ enum Platform { PF_UNKNOWN, PF_X86, PF_X64, PF_IA64, PF_ARM64 };
#define NPPM_MAKECURRENTBUFFERDIRTY (NPPMSG + 44)
//BOOL NPPM_MAKECURRENTBUFFERDIRTY(0, 0)

#define NPPM_GETENABLETHEMETEXTUREFUNC (NPPMSG + 45)
//BOOL NPPM_GETENABLETHEMETEXTUREFUNC(0, 0)
#define NPPM_GETENABLETHEMETEXTUREFUNC_DEPRECATED (NPPMSG + 45)
//BOOL NPPM_GETENABLETHEMETEXTUREFUNC(0, 0) -- DEPRECATED : use EnableThemeDialogTexture from uxtheme.h instead

#define NPPM_GETPLUGINSCONFIGDIR (NPPMSG + 46)
//INT NPPM_GETPLUGINSCONFIGDIR(int strLen, TCHAR *str)
Expand Down Expand Up @@ -195,11 +198,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 @@ -345,7 +368,7 @@ enum Platform { PF_UNKNOWN, PF_X86, PF_X64, PF_IA64, PF_ARM64 };

#define NPPM_ALLOCATEMARKER (NPPMSG + 82)
// BOOL NPPM_ALLOCATEMARKER(int numberRequested, int* startNumber)
// sets startNumber to the initial command ID if successful
// sets startNumber to the initial marker ID if successful
// Allocates a marker number to a plugin: if a plugin need to add a marker on Notepad++'s Scintilla marker margin,
// it has to use this message to get marker number, in order to prevent from the conflict with the other plugins.
// Returns: TRUE if successful, FALSE otherwise. startNumber will also be set to 0 if unsuccessful
Expand Down Expand Up @@ -454,20 +477,144 @@ 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* NPPM_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

#define NPPM_DARKMODESUBCLASSANDTHEME (NPPMSG + 112)
// ULONG NPPM_DARKMODESUBCLASSANDTHEME(ULONG dmFlags, HWND hwnd)
// Add support for generic dark mode.
//
// Docking panels don't need to call NPPM_DARKMODESUBCLASSANDTHEME for main hwnd.
// Subclassing is applied automatically unless DWS_USEOWNDARKMODE flag is used.
//
// Might not work properly in C# plugins.
//
// Returns succesful combinations of flags.
//

namespace NppDarkMode
{
// Standard flags for main parent after its children are initialized.
constexpr ULONG dmfInit = 0x0000000BUL;

// Standard flags for main parent usually used in NPPN_DARKMODECHANGED.
constexpr ULONG dmfHandleChange = 0x0000000CUL;
};

// Examples:
//
// - after controls initializations in WM_INITDIALOG, in WM_CREATE or after CreateWindow:
//
//auto success = static_cast<ULONG>(::SendMessage(nppData._nppHandle, NPPM_DARKMODESUBCLASSANDTHEME, static_cast<WPARAM>(NppDarkMode::dmfInit), reinterpret_cast<LPARAM>(mainHwnd)));
//
// - handling dark mode change:
//
//extern "C" __declspec(dllexport) void beNotified(SCNotification * notifyCode)
//{
// switch (notifyCode->nmhdr.code)
// {
// case NPPN_DARKMODECHANGED:
// {
// ::SendMessage(nppData._nppHandle, NPPM_DARKMODESUBCLASSANDTHEME, static_cast<WPARAM>(dmfHandleChange), reinterpret_cast<LPARAM>(mainHwnd));
// ::SetWindowPos(mainHwnd, nullptr, 0, 0, 0, 0, SWP_NOMOVE | SWP_NOSIZE | SWP_NOZORDER | SWP_FRAMECHANGED); // to redraw titlebar and window
// break;
// }
// }
//}

#define NPPM_ALLOCATEINDICATOR (NPPMSG + 113)
// BOOL NPPM_ALLOCATEINDICATOR(int numberRequested, int* startNumber)
// sets startNumber to the initial indicator ID if successful
// Allocates an indicator number to a plugin: if a plugin needs to add an indicator,
// it has to use this message to get the indicator number, in order to prevent a conflict with the other plugins.
// Returns: TRUE if successful, FALSE otherwise.

// 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 +623,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 +640,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 +783,18 @@ 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

#define NPPN_EXTERNALLEXERBUFFER (NPPN_FIRST + 29) // To notify lexer plugins that the buffer (in idFrom) is just applied to a external lexer
//scnNotification->nmhdr.code = NPPN_EXTERNALLEXERBUFFER;
//scnNotification->nmhdr.hwndFrom = hwndNpp;
//scnNotification->nmhdr.idFrom = BufferID; //where pluginMessage is pointer of type wchar_t
Loading

0 comments on commit 3df1db5

Please sign in to comment.