diff options
author | dartraiden <wowemuh@gmail.com> | 2024-02-19 20:13:12 +0300 |
---|---|---|
committer | dartraiden <wowemuh@gmail.com> | 2024-02-19 20:16:52 +0300 |
commit | 2f47988d1ef6672929762fba39fa69ef1b4dfa7a (patch) | |
tree | baa3433b11b1c44ab5a12c919ab004a24d645043 /plugins/NewStory/src/history_svc.cpp | |
parent | f50885f33f7d1e129d719f06a43cc73518e0ffb1 (diff) |
NewStory:
- add [cX] tag to variables help
- convert sources to CR+LF
Diffstat (limited to 'plugins/NewStory/src/history_svc.cpp')
-rw-r--r-- | plugins/NewStory/src/history_svc.cpp | 124 |
1 files changed, 62 insertions, 62 deletions
diff --git a/plugins/NewStory/src/history_svc.cpp b/plugins/NewStory/src/history_svc.cpp index 48e9936d7b..db05f3da04 100644 --- a/plugins/NewStory/src/history_svc.cpp +++ b/plugins/NewStory/src/history_svc.cpp @@ -1,62 +1,62 @@ -/* -Copyright (c) 2005 Victor Pavlychko (nullbyte@sotline.net.ua) -Copyright (C) 2012-24 Miranda NG team (https://miranda-ng.org) - -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 the Free Software Foundation version 2 -of the License. - -This program is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with this program. If not, see <http://www.gnu.org/licenses/>. -*/ - -#include "stdafx.h" - -static INT_PTR SvcGetCurrent(WPARAM wParam, LPARAM) -{ - if (auto *pData = (NewstoryListData *)wParam) - if (auto *p = pData->GetItem(pData->caret)) - return p->hEvent; - - return 0; -} - -static INT_PTR SvcGetSrmm(WPARAM wParam, LPARAM) -{ - auto *pData = (NewstoryListData *)wParam; - return (pData) ? INT_PTR(pData->pMsgDlg) : 0; -} - -static INT_PTR SvcGetSelection(WPARAM wParam, LPARAM lParam) -{ - auto *pData = (NewstoryListData *)wParam; - auto *pRet = (std::vector<MEVENT>*)lParam; - if (pData && pRet) { - for (int i = pData->totalCount; i >= 0; i--) - if (auto *p = pData->items.get(i)) - if (p->m_bSelected) - pRet->push_back(p->hEvent); - - if (pRet->empty() && pData->caret != -1) - if (auto *p = pData->GetItem(pData->caret)) - pRet->push_back(p->hEvent); - } - - return 0; -} - -///////////////////////////////////////////////////////////////////////////////////////// -// Module entry point - -void InitServices() -{ - CreateServiceFunction("NewStory/GetSrmm", &SvcGetSrmm); - CreateServiceFunction("NewStory/GetCurrent", &SvcGetCurrent); - CreateServiceFunction("NewStory/GetSelection", &SvcGetSelection); -} +/*
+Copyright (c) 2005 Victor Pavlychko (nullbyte@sotline.net.ua)
+Copyright (C) 2012-24 Miranda NG team (https://miranda-ng.org)
+
+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 the Free Software Foundation version 2
+of the License.
+
+This program is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+GNU General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with this program. If not, see <http://www.gnu.org/licenses/>.
+*/
+
+#include "stdafx.h"
+
+static INT_PTR SvcGetCurrent(WPARAM wParam, LPARAM)
+{
+ if (auto *pData = (NewstoryListData *)wParam)
+ if (auto *p = pData->GetItem(pData->caret))
+ return p->hEvent;
+
+ return 0;
+}
+
+static INT_PTR SvcGetSrmm(WPARAM wParam, LPARAM)
+{
+ auto *pData = (NewstoryListData *)wParam;
+ return (pData) ? INT_PTR(pData->pMsgDlg) : 0;
+}
+
+static INT_PTR SvcGetSelection(WPARAM wParam, LPARAM lParam)
+{
+ auto *pData = (NewstoryListData *)wParam;
+ auto *pRet = (std::vector<MEVENT>*)lParam;
+ if (pData && pRet) {
+ for (int i = pData->totalCount; i >= 0; i--)
+ if (auto *p = pData->items.get(i))
+ if (p->m_bSelected)
+ pRet->push_back(p->hEvent);
+
+ if (pRet->empty() && pData->caret != -1)
+ if (auto *p = pData->GetItem(pData->caret))
+ pRet->push_back(p->hEvent);
+ }
+
+ return 0;
+}
+
+/////////////////////////////////////////////////////////////////////////////////////////
+// Module entry point
+
+void InitServices()
+{
+ CreateServiceFunction("NewStory/GetSrmm", &SvcGetSrmm);
+ CreateServiceFunction("NewStory/GetCurrent", &SvcGetCurrent);
+ CreateServiceFunction("NewStory/GetSelection", &SvcGetSelection);
+}
|