summaryrefslogtreecommitdiff
path: root/src/mir_app
diff options
context:
space:
mode:
authorGeorge Hazan <ghazan@miranda.im>2020-06-29 18:50:53 +0300
committerGeorge Hazan <ghazan@miranda.im>2020-06-29 18:50:53 +0300
commit61884f90293ee814791f0594d4388a8244b3511e (patch)
tree45e9cc5b99fb9331040e490656104b0de54e3781 /src/mir_app
parent8b654ebcea0e70b228513b45bedfda08042cfb7b (diff)
PROTO_INTERFACE::GetMenuItem - unified access to all protocol menu items
Diffstat (limited to 'src/mir_app')
-rw-r--r--src/mir_app/src/mir_app.def1
-rw-r--r--src/mir_app/src/mir_app64.def1
-rw-r--r--src/mir_app/src/proto_interface.cpp16
3 files changed, 14 insertions, 4 deletions
diff --git a/src/mir_app/src/mir_app.def b/src/mir_app/src/mir_app.def
index 81f35ed7c4..608dd1e07b 100644
--- a/src/mir_app/src/mir_app.def
+++ b/src/mir_app/src/mir_app.def
@@ -739,3 +739,4 @@ Chat_CreateMenu @824 NONAME
?Proto_GetInstance@@YGPAUPROTO_INTERFACE@@PBD@Z @827 NONAME
?OnEventEdited@PROTO_INTERFACE@@UAEXII@Z @828 NONAME
?GetChecker@MDatabaseCommon@@UAGPAUMIDatabaseChecker@@XZ @829 NONAME
+?GetMenuItem@PROTO_INTERFACE@@QAEPAUTMO_IntMenuItem@@W4ProtoMenuItemType@@@Z @830 NONAME
diff --git a/src/mir_app/src/mir_app64.def b/src/mir_app/src/mir_app64.def
index 1d5ffc95a3..2e123cd123 100644
--- a/src/mir_app/src/mir_app64.def
+++ b/src/mir_app/src/mir_app64.def
@@ -739,3 +739,4 @@ Chat_CreateMenu @824 NONAME
?Proto_GetInstance@@YAPEAUPROTO_INTERFACE@@PEBD@Z @827 NONAME
?OnEventEdited@PROTO_INTERFACE@@UEAAXII@Z @828 NONAME
?GetChecker@MDatabaseCommon@@UEAAPEAUMIDatabaseChecker@@XZ @829 NONAME
+?GetMenuItem@PROTO_INTERFACE@@QEAAPEAUTMO_IntMenuItem@@W4ProtoMenuItemType@@@Z @830 NONAME
diff --git a/src/mir_app/src/proto_interface.cpp b/src/mir_app/src/proto_interface.cpp
index d72b71fb4c..1cc874c05f 100644
--- a/src/mir_app/src/proto_interface.cpp
+++ b/src/mir_app/src/proto_interface.cpp
@@ -35,10 +35,6 @@ PROTO_INTERFACE::PROTO_INTERFACE(const char *pszModuleName, const wchar_t *ptszU
m_szModuleName = mir_strdup(pszModuleName);
m_tszUserName = mir_wstrdup(ptszUserName);
db_set_resident(m_szModuleName, "Status");
-
- m_hmiReqAuth = hReqAuth;
- m_hmiGrantAuth = hGrantAuth;
- m_hmiRevokeAuth = hRevokeAuth;
}
PROTO_INTERFACE::~PROTO_INTERFACE()
@@ -52,6 +48,18 @@ PROTO_INTERFACE::~PROTO_INTERFACE()
WindowList_Destroy(m_hWindowList);
}
+HGENMENU PROTO_INTERFACE::GetMenuItem(ProtoMenuItemType aType)
+{
+ switch (aType) {
+ case PROTO_MENU_REQ_AUTH: return hReqAuth;
+ case PROTO_MENU_GRANT_AUTH: return hGrantAuth;
+ case PROTO_MENU_REVOKE_AUTH: return hRevokeAuth;
+ case PROTO_MENU_LOAD_HISTORY: return hServerHist;
+ }
+
+ return nullptr;
+}
+
void PROTO_INTERFACE::OnBuildProtoMenu()
{}