| 95 | } |
| 96 | |
| 97 | void 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 | |
| 140 | LRESULT messageProc(UINT /*Message*/, WPARAM /*wParam*/, LPARAM /*lParam*/) { |
| 141 | return TRUE; |
nothing calls this directly
no test coverage detected