Skip to content
This repository was archived by the owner on Jan 13, 2024. It is now read-only.

Commit 69c482b

Browse files
committed
ScNotificationHeader.code -> ScNotificationHeader.Code
1 parent 1a067ae commit 69c482b

File tree

5 files changed

+25
-22
lines changed

5 files changed

+25
-22
lines changed

Demo Plugin/NppManagedPluginDemo/Demo.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ static internal void SetToolBarIcon()
3636

3737
public static void OnNotification(ScNotification notification)
3838
{
39-
if (notification.Header.code == (uint)SciMsg.SCN_CHARADDED)
39+
if (notification.Header.Code == (uint)SciMsg.SCN_CHARADDED)
4040
{
4141
Kbg.Demo.Namespace.Main.doInsertHtmlCloseTag((char)notification.Character);
4242
}

Visual Studio Project Template C#/PluginInfrastructure/Msgs_h.cs

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -418,67 +418,67 @@ public enum NppMsg : uint
418418
// Notification codes
419419
NPPN_FIRST = 1000,
420420
NPPN_READY = (NPPN_FIRST + 1), // To notify plugins that all the procedures of launchment of notepad++ are done.
421-
//scnNotification->nmhdr.code = NPPN_READY;
421+
//scnNotification->nmhdr.Code = NPPN_READY;
422422
//scnNotification->nmhdr.hwndFrom = hwndNpp;
423423
//scnNotification->nmhdr.IdFrom = 0;
424424

425425
NPPN_TBMODIFICATION = (NPPN_FIRST + 2), // To notify plugins that toolbar icons can be registered
426-
//scnNotification->nmhdr.code = NPPN_TB_MODIFICATION;
426+
//scnNotification->nmhdr.Code = NPPN_TB_MODIFICATION;
427427
//scnNotification->nmhdr.hwndFrom = hwndNpp;
428428
//scnNotification->nmhdr.IdFrom = 0;
429429

430430
NPPN_FILEBEFORECLOSE = (NPPN_FIRST + 3), // To notify plugins that the current file is about to be closed
431-
//scnNotification->nmhdr.code = NPPN_FILEBEFORECLOSE;
431+
//scnNotification->nmhdr.Code = NPPN_FILEBEFORECLOSE;
432432
//scnNotification->nmhdr.hwndFrom = hwndNpp;
433433
//scnNotification->nmhdr.IdFrom = BufferID;
434434

435435
NPPN_FILEOPENED = (NPPN_FIRST + 4), // To notify plugins that the current file is just opened
436-
//scnNotification->nmhdr.code = NPPN_FILEOPENED;
436+
//scnNotification->nmhdr.Code = NPPN_FILEOPENED;
437437
//scnNotification->nmhdr.hwndFrom = hwndNpp;
438438
//scnNotification->nmhdr.IdFrom = BufferID;
439439

440440
NPPN_FILECLOSED = (NPPN_FIRST + 5), // To notify plugins that the current file is just closed
441-
//scnNotification->nmhdr.code = NPPN_FILECLOSED;
441+
//scnNotification->nmhdr.Code = NPPN_FILECLOSED;
442442
//scnNotification->nmhdr.hwndFrom = hwndNpp;
443443
//scnNotification->nmhdr.IdFrom = BufferID;
444444

445445
NPPN_FILEBEFOREOPEN = (NPPN_FIRST + 6), // To notify plugins that the current file is about to be opened
446-
//scnNotification->nmhdr.code = NPPN_FILEBEFOREOPEN;
446+
//scnNotification->nmhdr.Code = NPPN_FILEBEFOREOPEN;
447447
//scnNotification->nmhdr.hwndFrom = hwndNpp;
448448
//scnNotification->nmhdr.IdFrom = BufferID;
449449

450450
NPPN_FILEBEFORESAVE = (NPPN_FIRST + 7), // To notify plugins that the current file is about to be saved
451-
//scnNotification->nmhdr.code = NPPN_FILEBEFOREOPEN;
451+
//scnNotification->nmhdr.Code = NPPN_FILEBEFOREOPEN;
452452
//scnNotification->nmhdr.hwndFrom = hwndNpp;
453453
//scnNotification->nmhdr.IdFrom = BufferID;
454454

455455
NPPN_FILESAVED = (NPPN_FIRST + 8), // To notify plugins that the current file is just saved
456-
//scnNotification->nmhdr.code = NPPN_FILESAVED;
456+
//scnNotification->nmhdr.Code = NPPN_FILESAVED;
457457
//scnNotification->nmhdr.hwndFrom = hwndNpp;
458458
//scnNotification->nmhdr.IdFrom = BufferID;
459459

460460
NPPN_SHUTDOWN = (NPPN_FIRST + 9), // To notify plugins that Notepad++ is about to be shutdowned.
461-
//scnNotification->nmhdr.code = NPPN_SHUTDOWN;
461+
//scnNotification->nmhdr.Code = NPPN_SHUTDOWN;
462462
//scnNotification->nmhdr.hwndFrom = hwndNpp;
463463
//scnNotification->nmhdr.IdFrom = 0;
464464

465465
NPPN_BUFFERACTIVATED = (NPPN_FIRST + 10), // To notify plugins that a buffer was activated (put to foreground).
466-
//scnNotification->nmhdr.code = NPPN_BUFFERACTIVATED;
466+
//scnNotification->nmhdr.Code = NPPN_BUFFERACTIVATED;
467467
//scnNotification->nmhdr.hwndFrom = hwndNpp;
468468
//scnNotification->nmhdr.IdFrom = activatedBufferID;
469469

470470
NPPN_LANGCHANGED = (NPPN_FIRST + 11), // To notify plugins that the language in the current doc is just changed.
471-
//scnNotification->nmhdr.code = NPPN_LANGCHANGED;
471+
//scnNotification->nmhdr.Code = NPPN_LANGCHANGED;
472472
//scnNotification->nmhdr.hwndFrom = hwndNpp;
473473
//scnNotification->nmhdr.IdFrom = currentBufferID;
474474

475475
NPPN_WORDSTYLESUPDATED = (NPPN_FIRST + 12), // To notify plugins that user initiated a WordStyleDlg change.
476-
//scnNotification->nmhdr.code = NPPN_WORDSTYLESUPDATED;
476+
//scnNotification->nmhdr.Code = NPPN_WORDSTYLESUPDATED;
477477
//scnNotification->nmhdr.hwndFrom = hwndNpp;
478478
//scnNotification->nmhdr.IdFrom = currentBufferID;
479479

480480
NPPN_SHORTCUTREMAPPED = (NPPN_FIRST + 13), // To notify plugins that plugin command shortcut is remapped.
481-
//scnNotification->nmhdr.code = NPPN_SHORTCUTSREMAPPED;
481+
//scnNotification->nmhdr.Code = NPPN_SHORTCUTSREMAPPED;
482482
//scnNotification->nmhdr.hwndFrom = ShortcutKeyStructurePointer;
483483
//scnNotification->nmhdr.IdFrom = cmdID;
484484
//where ShortcutKeyStructurePointer is pointer of struct ShortcutKey:
@@ -490,17 +490,17 @@ public enum NppMsg : uint
490490
//};
491491

492492
NPPN_FILEBEFORELOAD = (NPPN_FIRST + 14), // To notify plugins that the current file is about to be loaded
493-
//scnNotification->nmhdr.code = NPPN_FILEBEFOREOPEN;
493+
//scnNotification->nmhdr.Code = NPPN_FILEBEFOREOPEN;
494494
//scnNotification->nmhdr.hwndFrom = hwndNpp;
495495
//scnNotification->nmhdr.IdFrom = NULL;
496496

497497
NPPN_FILELOADFAILED = (NPPN_FIRST + 15), // To notify plugins that file open operation failed
498-
//scnNotification->nmhdr.code = NPPN_FILEOPENFAILED;
498+
//scnNotification->nmhdr.Code = NPPN_FILEOPENFAILED;
499499
//scnNotification->nmhdr.hwndFrom = hwndNpp;
500500
//scnNotification->nmhdr.IdFrom = BufferID;
501501

502502
NPPN_READONLYCHANGED = (NPPN_FIRST + 16), // To notify plugins that current document change the readonly status,
503-
//scnNotification->nmhdr.code = NPPN_READONLYCHANGED;
503+
//scnNotification->nmhdr.Code = NPPN_READONLYCHANGED;
504504
//scnNotification->nmhdr.hwndFrom = bufferID;
505505
//scnNotification->nmhdr.IdFrom = docStatus;
506506
// where bufferID is BufferID

Visual Studio Project Template C#/PluginInfrastructure/NppPluginNETHelper.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -171,13 +171,13 @@ public enum DockMgrMsg : uint
171171

172172
DMN_FIRST = 1050,
173173
DMN_CLOSE = (DMN_FIRST + 1),
174-
//nmhdr.code = DWORD(DMN_CLOSE, 0));
174+
//nmhdr.Code = DWORD(DMN_CLOSE, 0));
175175
//nmhdr.hwndFrom = hwndNpp;
176176
//nmhdr.IdFrom = ctrlIdNpp;
177177

178178
DMN_DOCK = (DMN_FIRST + 2),
179179
DMN_FLOAT = (DMN_FIRST + 3)
180-
//nmhdr.code = DWORD(DMN_XXX, int newContainer);
180+
//nmhdr.Code = DWORD(DMN_XXX, int newContainer);
181181
//nmhdr.hwndFrom = hwndNpp;
182182
//nmhdr.IdFrom = ctrlIdNpp;
183183
}

Visual Studio Project Template C#/PluginInfrastructure/Scintilla_iface.cs

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,6 @@ namespace Kbg.NppPluginNET.PluginInfrastructure
1818
[StructLayout(LayoutKind.Sequential)]
1919
public struct ScNotificationHeader
2020
{
21-
public uint code; //! The SCN_* notification code
2221
/// <summary>
2322
/// environment specific window handle/pointer
2423
/// </summary>
@@ -28,6 +27,10 @@ public struct ScNotificationHeader
2827
/// CtrlID of the window issuing the notification
2928
/// </summary>
3029
public uint IdFrom;
30+
/// <summary>
31+
/// The SCN_* notification Code
32+
/// </summary>
33+
public uint Code;
3134
}
3235

3336
[StructLayout(LayoutKind.Sequential)]

Visual Studio Project Template C#/PluginInfrastructure/UnmanagedExports.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -47,12 +47,12 @@ static IntPtr getName()
4747
static void beNotified(IntPtr notifyCode)
4848
{
4949
ScNotification notification = (ScNotification)Marshal.PtrToStructure(notifyCode, typeof(ScNotification));
50-
if (notification.Header.code == (uint)NppMsg.NPPN_TBMODIFICATION)
50+
if (notification.Header.Code == (uint)NppMsg.NPPN_TBMODIFICATION)
5151
{
5252
PluginBase._funcItems.RefreshItems();
5353
Main.SetToolBarIcon();
5454
}
55-
else if (notification.Header.code == (uint)NppMsg.NPPN_SHUTDOWN)
55+
else if (notification.Header.Code == (uint)NppMsg.NPPN_SHUTDOWN)
5656
{
5757
Main.PluginCleanUp();
5858
Marshal.FreeHGlobal(_ptrPluginName);

0 commit comments

Comments
 (0)