MCPcopy Create free account
hub / github.com/ashkulz/NppFTP / beNotified

Function beNotified

src/PluginInterface.cpp:97–138  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

95}
96
97void beNotified(SCNotification * scNotification) {
98 switch(scNotification->nmhdr.code) {
99 case NPPN_TBMODIFICATION: {
100 SendMessage(nppData._nppHandle, NPPM_ADDTOOLBARICON_DEPRECATED, (WPARAM)funcItems[0]._cmdID, (LPARAM)&tbiFtp);
101 break; }
102 case NPPN_READY: {
103 TCHAR configStore[MAX_PATH]{};
104 configStore[0] = 0;
105 SendMessage(nppData._nppHandle, NPPM_GETPLUGINSCONFIGDIR, (WPARAM)MAX_PATH, (LPARAM)configStore);
106 int res = nppFTP.Start(nppData, configStore, 0, funcItems[0]);
107 if (res == -1) {
108 break;
109 }
110 isStarted = true;
111 if (show)
112 nppFTP.ShowFTPWindow();
113 break; }
114 case NPPN_SHUTDOWN: {
115 nppFTP.Stop();
116 break; }
117 case NPPN_FILESAVED: {
118 BufferID buf = (BufferID)scNotification->nmhdr.idFrom;
119 int size = ::SendMessage(nppData._nppHandle, NPPM_GETFULLPATHFROMBUFFERID, (WPARAM)buf, (LPARAM)NULL);
120 if (size == -1)
121 break;
122 TCHAR * path = new TCHAR[size+1];
123 ::SendMessage(nppData._nppHandle, NPPM_GETFULLPATHFROMBUFFERID, (WPARAM)buf, (LPARAM)path);
124 nppFTP.OnSave(path);
125 delete [] path;
126 break; }
127 case NPPN_BUFFERACTIVATED: {
128 BufferID buf = (BufferID)scNotification->nmhdr.idFrom;
129 int size = ::SendMessage(nppData._nppHandle, NPPM_GETFULLPATHFROMBUFFERID, (WPARAM)buf, (LPARAM)NULL);
130 if (size == -1)
131 break;
132 TCHAR * path = new TCHAR[size+1];
133 ::SendMessage(nppData._nppHandle, NPPM_GETFULLPATHFROMBUFFERID, (WPARAM)buf, (LPARAM)path);
134 nppFTP.OnActivateLocalFile(path);
135 delete [] path;
136 break; }
137 }
138}
139
140LRESULT messageProc(UINT /*Message*/, WPARAM /*wParam*/, LPARAM /*lParam*/) {
141 return TRUE;

Callers

nothing calls this directly

Calls 5

StartMethod · 0.80
ShowFTPWindowMethod · 0.80
StopMethod · 0.80
OnSaveMethod · 0.80
OnActivateLocalFileMethod · 0.45

Tested by

no test coverage detected