summaryrefslogtreecommitdiff
path: root/plugins
diff options
context:
space:
mode:
authorGeorge Hazan <george.hazan@gmail.com>2023-11-24 19:04:55 +0300
committerGeorge Hazan <george.hazan@gmail.com>2023-11-24 19:27:56 +0300
commit255b8133ea30d765428eb8188d75db91558bcd27 (patch)
treefea7c0557d007a15462b45d77c81dd707e6f4c46 /plugins
parent955e8047a7e312f93fb2b0611df017ac8acb59ab (diff)
NewStory control messages made public
Diffstat (limited to 'plugins')
-rw-r--r--plugins/ExternalAPI/m_NewStory.h30
-rw-r--r--plugins/NewStory/src/history_control.cpp4
-rw-r--r--plugins/NewStory/src/history_control.h18
-rw-r--r--plugins/NewStory/src/history_svc.cpp4
4 files changed, 30 insertions, 26 deletions
diff --git a/plugins/ExternalAPI/m_NewStory.h b/plugins/ExternalAPI/m_NewStory.h
index ad6c7583a9..9350672f62 100644
--- a/plugins/ExternalAPI/m_NewStory.h
+++ b/plugins/ExternalAPI/m_NewStory.h
@@ -2,25 +2,43 @@
#include <vector>
+enum
+{
+ NSM_FIRST = WM_USER + 100,
+
+ // wParam = fist item
+ // lParam = iLast item
+ // result = number of total selected items
+ NSM_SELECTITEMS = NSM_FIRST,
+
+ // wParam = (MCONTACT)hContact = database contact
+ // lParam = (MEVENT)hDbEvent = database event
+ NSM_ADDEVENT,
+
+ //
+ NSM_SEEKTIME,
+
+ //
+ NSM_SET_OPTIONS, // options were changed
+
+ NSM_LAST
+};
+
/////////////////////////////////////////////////////////////////////////////////////////
// NS get current event
-#define MS_NEWSTORY_GETCURRENT "NewStory/GetCurrent"
-
__forceinline MEVENT NS_GetCurrent(HANDLE hwnd)
{
- return (MEVENT)CallService(MS_NEWSTORY_GETCURRENT, WPARAM(hwnd), 0);
+ return (MEVENT)CallService("NewStory/GetCurrent", WPARAM(hwnd), 0);
}
/////////////////////////////////////////////////////////////////////////////////////////
// NS get selection
-#define MS_NEWSTORY_GETSELECTION "NewStory/GetSelection"
-
__forceinline std::vector<MEVENT> NS_GetSelection(HANDLE hwnd)
{
std::vector<MEVENT> ret;
- CallService(MS_NEWSTORY_GETSELECTION, WPARAM(hwnd), LPARAM(&ret));
+ CallService("NewStory/GetSelection", WPARAM(hwnd), LPARAM(&ret));
return ret;
}
diff --git a/plugins/NewStory/src/history_control.cpp b/plugins/NewStory/src/history_control.cpp
index a208d62312..c698e436c4 100644
--- a/plugins/NewStory/src/history_control.cpp
+++ b/plugins/NewStory/src/history_control.cpp
@@ -919,6 +919,10 @@ LRESULT CALLBACK NewstoryListWndProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM
}
return TRUE;
+ case NSM_ADDEVENT:
+ data->AddEvent(wParam, lParam, 1);
+ break;
+
case NSM_SET_OPTIONS:
data->bSortAscending = g_plugin.bSortAscending;
data->scrollTopPixel = 0;
diff --git a/plugins/NewStory/src/history_control.h b/plugins/NewStory/src/history_control.h
index e11b74db5d..2cbe46309c 100644
--- a/plugins/NewStory/src/history_control.h
+++ b/plugins/NewStory/src/history_control.h
@@ -3,24 +3,6 @@
#define NEWSTORYLIST_CLASS "NewstoryList"
-enum
-{
- NSM_FIRST = WM_USER + 100,
-
- // wParam = fist item
- // lParam = iLast item
- // result = number of total selected items
- NSM_SELECTITEMS = NSM_FIRST,
-
- //
- NSM_SEEKTIME,
-
- //
- NSM_SET_OPTIONS, // options were changed
-
- NSM_LAST
-};
-
struct NewstoryListData : public MZeroedObject
{
NewstoryListData(HWND);
diff --git a/plugins/NewStory/src/history_svc.cpp b/plugins/NewStory/src/history_svc.cpp
index 0ba3cbf426..9043ed95fe 100644
--- a/plugins/NewStory/src/history_svc.cpp
+++ b/plugins/NewStory/src/history_svc.cpp
@@ -51,6 +51,6 @@ static INT_PTR SvcGetSelection(WPARAM wParam, LPARAM lParam)
void InitServices()
{
- CreateServiceFunction(MS_NEWSTORY_GETCURRENT, &SvcGetCurrent);
- CreateServiceFunction(MS_NEWSTORY_GETSELECTION, &SvcGetSelection);
+ CreateServiceFunction("NewStory/GetCurrent", &SvcGetCurrent);
+ CreateServiceFunction("NewStory/GetSelection", &SvcGetSelection);
}