summaryrefslogtreecommitdiff
path: root/protocols/MinecraftDynmap
diff options
context:
space:
mode:
authorGeorge Hazan <ghazan@miranda.im>2018-04-21 12:33:31 +0300
committerGeorge Hazan <ghazan@miranda.im>2018-04-21 12:33:31 +0300
commitca5001026a94f702c4012c5e8d2093ad3f51c1fa (patch)
tree554ad80633528d530057fc61035b15f901860ed2 /protocols/MinecraftDynmap
parente0799755b3966d1d6d8275ee5127242ec029a4e6 (diff)
code cleaning:
- in conformance to C++'11 rules, we don't declare a method as virtual if it's declared as override; - cause this code isn't visible in Pascal anymore, there's no need to use __cdecl calling convention for virtual methods; - since PROTO_INTERFACE is a regular C++ class, there's no need to use old style service declarations for virtual methods like OnModulesLoaded / OnShutdown
Diffstat (limited to 'protocols/MinecraftDynmap')
-rw-r--r--protocols/MinecraftDynmap/src/proto.cpp33
-rw-r--r--protocols/MinecraftDynmap/src/proto.h13
2 files changed, 10 insertions, 36 deletions
diff --git a/protocols/MinecraftDynmap/src/proto.cpp b/protocols/MinecraftDynmap/src/proto.cpp
index 0c64aba806..0ea1bb8f9c 100644
--- a/protocols/MinecraftDynmap/src/proto.cpp
+++ b/protocols/MinecraftDynmap/src/proto.cpp
@@ -79,7 +79,7 @@ MinecraftDynmapProto::~MinecraftDynmapProto()
//////////////////////////////////////////////////////////////////////////////
-DWORD_PTR MinecraftDynmapProto::GetCaps(int type, MCONTACT)
+INT_PTR MinecraftDynmapProto::GetCaps(int type, MCONTACT)
{
switch(type) {
case PFLAGNUM_1:
@@ -89,7 +89,7 @@ DWORD_PTR MinecraftDynmapProto::GetCaps(int type, MCONTACT)
case PFLAG_MAXLENOFMESSAGE:
return MINECRAFTDYNMAP_MESSAGE_LIMIT;
case PFLAG_UNIQUEIDTEXT:
- return (DWORD_PTR) Translate("Visible name");
+ return (INT_PTR) Translate("Visible name");
}
return 0;
}
@@ -132,12 +132,6 @@ int MinecraftDynmapProto::SetStatus(int new_status)
int MinecraftDynmapProto::OnEvent(PROTOEVENTTYPE event,WPARAM wParam,LPARAM lParam)
{
switch(event) {
- case EV_PROTO_ONLOAD:
- return OnModulesLoaded(wParam, lParam);
-
- case EV_PROTO_ONEXIT:
- return OnPreShutdown (wParam, lParam);
-
case EV_PROTO_ONCONTACTDELETED:
return OnContactDeleted(wParam, lParam);
}
@@ -153,7 +147,7 @@ INT_PTR MinecraftDynmapProto::SvcCreateAccMgrUI(WPARAM, LPARAM lParam)
return (INT_PTR)CreateDialogParam(g_plugin.getInst(),MAKEINTRESOURCE(IDD_MinecraftDynmapACCOUNT), (HWND)lParam, MinecraftDynmapAccountProc, (LPARAM)this);
}
-int MinecraftDynmapProto::OnModulesLoaded(WPARAM, LPARAM)
+void MinecraftDynmapProto::OnModulesLoaded()
{
// Register group chat
GCREGISTER gcr = {};
@@ -161,30 +155,11 @@ int MinecraftDynmapProto::OnModulesLoaded(WPARAM, LPARAM)
gcr.ptszDispName = m_tszUserName;
gcr.iMaxText = MINECRAFTDYNMAP_MESSAGE_LIMIT;
Chat_Register(&gcr);
- return 0;
}
-/*int MinecraftDynmapProto::OnOptionsInit(WPARAM wParam, LPARAM)
-{
- OPTIONSDIALOGPAGE odp = { 0 };
- odp.hInstance = g_plugin.getInst();
- odp.szTitle.w = m_tszUserName;
- odp.dwInitParam = LPARAM(this);
- odp.flags = ODPF_BOLDGROUPS | ODPF_UNICODE | ODPF_DONTTRANSLATE;
-
- odp.position = 271828;
- odp.szGroup.w = LPGENW("Network");
- odp.szTab.w = LPGENW("Account");
- odp.pszTemplate = MAKEINTRESOURCEA(IDD_OPTIONS);
- odp.pfnDlgProc = MinecraftDynmapOptionsProc;
- Options_AddPage(wParam, &odp);
- return 0;
-}*/
-
-int MinecraftDynmapProto::OnPreShutdown(WPARAM, LPARAM)
+void MinecraftDynmapProto::OnShutdown()
{
SetStatus(ID_STATUS_OFFLINE);
- return 0;
}
int MinecraftDynmapProto::OnContactDeleted(WPARAM, LPARAM)
diff --git a/protocols/MinecraftDynmap/src/proto.h b/protocols/MinecraftDynmap/src/proto.h
index 1a19f2eae4..71c59a6fc9 100644
--- a/protocols/MinecraftDynmap/src/proto.h
+++ b/protocols/MinecraftDynmap/src/proto.h
@@ -41,19 +41,18 @@ public:
}
// PROTO_INTERFACE
- virtual DWORD_PTR __cdecl GetCaps(int type, MCONTACT hContact = NULL);
- virtual int __cdecl SetStatus(int iNewStatus);
- virtual int __cdecl OnEvent(PROTOEVENTTYPE iEventType, WPARAM wParam, LPARAM lParam);
+ INT_PTR GetCaps(int type, MCONTACT hContact = NULL) override;
+ int SetStatus(int iNewStatus) override;
+
+ int OnEvent(PROTOEVENTTYPE iEventType, WPARAM wParam, LPARAM lParam) override;
+ void OnModulesLoaded() override;
+ void OnShutdown() override;
// Services
INT_PTR __cdecl SvcCreateAccMgrUI(WPARAM, LPARAM);
// Events
- int __cdecl OnModulesLoaded(WPARAM, LPARAM);
- // int __cdecl OnOptionsInit(WPARAM, LPARAM);
int __cdecl OnContactDeleted(WPARAM,LPARAM);
- int __cdecl OnPreShutdown(WPARAM,LPARAM);
- int __cdecl OnPrebuildContactMenu(WPARAM,LPARAM);
// Chat handling
int __cdecl OnChatEvent(WPARAM,LPARAM);