diff options
-rw-r--r-- | plugins/ExternalAPI/m_NewStory.h | 30 | ||||
-rw-r--r-- | plugins/NewStory/src/history_control.cpp | 4 | ||||
-rw-r--r-- | plugins/NewStory/src/history_control.h | 18 | ||||
-rw-r--r-- | plugins/NewStory/src/history_svc.cpp | 4 | ||||
-rw-r--r-- | protocols/ICQ-WIM/src/menus.cpp | 3 |
5 files changed, 31 insertions, 28 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); } diff --git a/protocols/ICQ-WIM/src/menus.cpp b/protocols/ICQ-WIM/src/menus.cpp index 591089e24a..58a118bf36 100644 --- a/protocols/ICQ-WIM/src/menus.cpp +++ b/protocols/ICQ-WIM/src/menus.cpp @@ -21,11 +21,10 @@ along with this program. If not, see <http://www.gnu.org/licenses/>. void CIcqProto::InitMenus() { - if (!ServiceExists(MS_NEWSTORY_GETSELECTION)) + if (!HookProtoEvent(ME_NS_PREBUILDMENU, &CIcqProto::OnPrebuildMenu)) return; CreateProtoService(MenuExecService, &CIcqProto::SvcExecMenu); - HookProtoEvent(ME_NS_PREBUILDMENU, &CIcqProto::OnPrebuildMenu); CMStringA szServiceName(FORMAT, "%s%s", m_szModuleName, MenuExecService); CMenuItem mi(&g_plugin); |