diff options
-rw-r--r-- | protocols/Dummy/res/aim.ico | bin | 0 -> 1150 bytes | |||
-rw-r--r-- | protocols/Dummy/res/icq.ico | bin | 0 -> 1150 bytes | |||
-rw-r--r-- | protocols/Dummy/res/mra.ico | bin | 0 -> 1150 bytes | |||
-rw-r--r-- | protocols/Dummy/res/msn.ico | bin | 0 -> 1150 bytes | |||
-rw-r--r-- | protocols/Dummy/res/omegle.ico | bin | 0 -> 1150 bytes | |||
-rw-r--r-- | protocols/Dummy/res/resource.rc | 29 | ||||
-rw-r--r-- | protocols/Dummy/res/tlen.ico | bin | 0 -> 1150 bytes | |||
-rw-r--r-- | protocols/Dummy/res/xfire.ico | bin | 0 -> 1150 bytes | |||
-rw-r--r-- | protocols/Dummy/res/yahoo.ico | bin | 0 -> 1150 bytes | |||
-rw-r--r-- | protocols/Dummy/src/dummy.h | 1 | ||||
-rw-r--r-- | protocols/Dummy/src/dummy_proto.cpp | 112 | ||||
-rw-r--r-- | protocols/Dummy/src/main.cpp | 2 | ||||
-rw-r--r-- | protocols/Dummy/src/resource.h | 24 | ||||
-rw-r--r-- | protocols/Dummy/src/stdafx.h | 1 |
14 files changed, 124 insertions, 45 deletions
diff --git a/protocols/Dummy/res/aim.ico b/protocols/Dummy/res/aim.ico Binary files differnew file mode 100644 index 0000000000..93b13ab7a4 --- /dev/null +++ b/protocols/Dummy/res/aim.ico diff --git a/protocols/Dummy/res/icq.ico b/protocols/Dummy/res/icq.ico Binary files differnew file mode 100644 index 0000000000..e7abd2a10e --- /dev/null +++ b/protocols/Dummy/res/icq.ico diff --git a/protocols/Dummy/res/mra.ico b/protocols/Dummy/res/mra.ico Binary files differnew file mode 100644 index 0000000000..ed716416e9 --- /dev/null +++ b/protocols/Dummy/res/mra.ico diff --git a/protocols/Dummy/res/msn.ico b/protocols/Dummy/res/msn.ico Binary files differnew file mode 100644 index 0000000000..fa5b98963c --- /dev/null +++ b/protocols/Dummy/res/msn.ico diff --git a/protocols/Dummy/res/omegle.ico b/protocols/Dummy/res/omegle.ico Binary files differnew file mode 100644 index 0000000000..1e665ceac0 --- /dev/null +++ b/protocols/Dummy/res/omegle.ico diff --git a/protocols/Dummy/res/resource.rc b/protocols/Dummy/res/resource.rc index 7d7ef55679..d8a8331724 100644 --- a/protocols/Dummy/res/resource.rc +++ b/protocols/Dummy/res/resource.rc @@ -67,6 +67,35 @@ END #endif // APSTUDIO_INVOKED
+/////////////////////////////////////////////////////////////////////////////
+//
+// Icon
+//
+
+IDI_AIM ICON "aim.ico"
+IDI_ICQ ICON "icq.ico"
+IDI_MRA ICON "mra.ico"
+IDI_MSN ICON "msn.ico"
+IDI_OMEGLE ICON "omegle.ico"
+IDI_TLEN ICON "tlen.ico"
+IDI_XFIRE ICON "xfire.ico"
+IDI_YAHOO ICON "yahoo.ico"
+IDI_DUMMY ICON "..\\proto_dummy\\res\\Offline.ico"
+IDI_DISCORD ICON "..\\..\\Discord\\res\\discord.ico"
+IDI_EMLAN ICON "..\\..\\EmLanProto\\res\\icon_onl.ico"
+IDI_FACEBOOK ICON "..\\..\\Facebook\\res\\facebook.ico"
+IDI_GG ICON "..\\..\\Gadu-Gadu\\res\\gg.ico"
+IDI_IRC ICON "..\\..\\IRCG\\res\\irc.ico"
+IDI_JABBER ICON "..\\..\\JabberG\\res\\jabber.ico"
+IDI_MINECRAFT ICON "..\\..\\MinecraftDynmap\\res\\proto.ico"
+IDI_SAMETIME ICON "..\\..\\Sametime\\res\\online.ico"
+IDI_SKYPE ICON "..\\..\\SkypeWeb\\res\\Icons\\skype.ico"
+IDI_STEAM ICON "..\\..\\Steam\\res\\steam.ico"
+IDI_TELEGRAM ICON "..\\..\\Telegram\\res\\telegram.ico"
+IDI_TOX ICON "..\\..\\Tox\\res\\tox.ico"
+IDI_TWITTER ICON "..\\..\\Twitter\\res\\twitter.ico"
+IDI_VK ICON "..\\..\\VKontakte\\proto_vkontakte\\res\\Online.ico"
+IDI_WHATSAPP ICON "..\\..\\WhatsApp\\res\\whatsapp.ico"
/////////////////////////////////////////////////////////////////////////////
//
diff --git a/protocols/Dummy/res/tlen.ico b/protocols/Dummy/res/tlen.ico Binary files differnew file mode 100644 index 0000000000..0019bb2ae4 --- /dev/null +++ b/protocols/Dummy/res/tlen.ico diff --git a/protocols/Dummy/res/xfire.ico b/protocols/Dummy/res/xfire.ico Binary files differnew file mode 100644 index 0000000000..b93f1bef0c --- /dev/null +++ b/protocols/Dummy/res/xfire.ico diff --git a/protocols/Dummy/res/yahoo.ico b/protocols/Dummy/res/yahoo.ico Binary files differnew file mode 100644 index 0000000000..739271d91d --- /dev/null +++ b/protocols/Dummy/res/yahoo.ico diff --git a/protocols/Dummy/src/dummy.h b/protocols/Dummy/src/dummy.h index 0fcc10eaa8..e06e8d81ac 100644 --- a/protocols/Dummy/src/dummy.h +++ b/protocols/Dummy/src/dummy.h @@ -29,6 +29,7 @@ struct ttemplate const char *name;
const char *setting;
const char *text;
+ int iconId;
};
extern const ttemplate templates[];
diff --git a/protocols/Dummy/src/dummy_proto.cpp b/protocols/Dummy/src/dummy_proto.cpp index 55b4e9f224..295872252a 100644 --- a/protocols/Dummy/src/dummy_proto.cpp +++ b/protocols/Dummy/src/dummy_proto.cpp @@ -19,33 +19,33 @@ along with this program. If not, see <http://www.gnu.org/licenses/>. const ttemplate templates[] =
{
- { LPGEN("Custom"), "", "" },
- { "AIM", "SN", LPGEN("Screen name") },
- { "Discord", "id", LPGEN("Discord ID") },
- { "EmLAN", "Nick", LPGEN("User name") },
- { "Facebook", "ID", LPGEN("Facebook ID") },
- { "GG", "UIN", LPGEN("Gadu-Gadu number") },
- { "ICQ", "aimId", LPGEN("User ID") },
- { "ICQCorp", "UIN", LPGEN("ICQ number") },
- { "IRC", "Nick", LPGEN("Nickname") },
- { "Jabber", "jid", LPGEN("JID") },
- { "MinecraftDynmap", "Nick", LPGEN("Visible name") },
- { "MRA", "e-mail", LPGEN("E-mail address") },
- { "MSN", "wlid", LPGEN("Live ID") },
- { "Omegle", "nick", LPGEN("Visible name") },
- { "Sametime", "stid", LPGEN("ID") },
- { "Skype (SkypeKit)", "sid", LPGEN("Skype name") },
- { "Skype (Classic)", "Username", LPGEN("Skype name") },
- { "Skype (Web)", "Username", LPGEN("Skype name") },
- { "Steam", "SteamID", LPGEN("Steam ID") },
- { "Telegram", "id", LPGEN("Telegram ID") },
- { "Tlen", "jid", LPGEN("Tlen login") },
- { "Tox", "ToxID", LPGEN("Tox ID") },
- { "Twitter", "Username", LPGEN("Username") },
- { "VK", "ID", LPGEN("VKontakte ID") },
- { "WhatsApp", "ID", LPGEN("WhatsApp ID") },
- { "XFire", "Username", LPGEN("Username") },
- { "Yahoo", "yahoo_id", LPGEN("ID") },
+ { LPGEN("Custom"), "", "", IDI_DUMMY },
+ { "AIM", "SN", LPGEN("Screen name"), IDI_AIM },
+ { "Discord", "id", LPGEN("Discord ID"), IDI_DISCORD },
+ { "EmLAN", "Nick", LPGEN("User name"), IDI_EMLAN },
+ { "Facebook", "ID", LPGEN("Facebook ID"), IDI_FACEBOOK },
+ { "GG", "UIN", LPGEN("Gadu-Gadu number"), IDI_GG },
+ { "ICQ", "aimId", LPGEN("User ID"), IDI_ICQ },
+ { "ICQCorp", "UIN", LPGEN("ICQ number"), IDI_ICQ },
+ { "IRC", "Nick", LPGEN("Nickname"), IDI_IRC },
+ { "Jabber", "jid", LPGEN("JID"), IDI_JABBER },
+ { "MinecraftDynmap", "Nick", LPGEN("Visible name"), IDI_MINECRAFT },
+ { "MRA", "e-mail", LPGEN("E-mail address"), IDI_MRA },
+ { "MSN", "wlid", LPGEN("Live ID"), IDI_MSN },
+ { "Omegle", "nick", LPGEN("Visible name"), IDI_OMEGLE },
+ { "Sametime", "stid", LPGEN("ID"), IDI_SAMETIME },
+ { "Skype (SkypeKit)", "sid", LPGEN("Skype name"), IDI_SKYPE },
+ { "Skype (Classic)", "Username", LPGEN("Skype name"), IDI_SKYPE },
+ { "Skype (Web)", "Username", LPGEN("Skype name"), IDI_SKYPE },
+ { "Steam", "SteamID", LPGEN("Steam ID"), IDI_STEAM },
+ { "Telegram", "id", LPGEN("Telegram ID"), IDI_TELEGRAM },
+ { "Tlen", "jid", LPGEN("Tlen login"), IDI_TLEN },
+ { "Tox", "ToxID", LPGEN("Tox ID"), IDI_TOX },
+ { "Twitter", "Username", LPGEN("Username"), IDI_TWITTER },
+ { "VK", "ID", LPGEN("VKontakte ID"), IDI_VK },
+ { "WhatsApp", "ID", LPGEN("WhatsApp ID"), IDI_WHATSAPP },
+ { "XFire", "Username", LPGEN("Username"), IDI_XFIRE },
+ { "Yahoo", "yahoo_id", LPGEN("ID"), IDI_YAHOO },
};
void FillTemplateCombo(HWND hwndDlg, int iCtrlId)
@@ -56,17 +56,21 @@ void FillTemplateCombo(HWND hwndDlg, int iCtrlId) }
}
-void CDummyProto::SearchIdAckThread(void *targ)
+void InitIcons()
{
- PROTOSEARCHRESULT psr = { 0 };
- psr.cbSize = sizeof(psr);
- psr.flags = PSR_UNICODE;
- psr.id.w = (wchar_t*)targ;
- ProtoBroadcastAck(NULL, ACKTYPE_SEARCH, ACKRESULT_DATA, targ, (LPARAM)&psr);
-
- ProtoBroadcastAck(NULL, ACKTYPE_SEARCH, ACKRESULT_SUCCESS, targ, 0);
+ wchar_t wszDllName[MAX_PATH];
+ GetModuleFileNameW(g_plugin.getInst(), wszDllName, _countof(wszDllName));
- mir_free(targ);
+ SKINICONDESC sid = {};
+ sid.flags = SIDF_PATH_UNICODE;
+ sid.defaultFile.w = wszDllName;
+ sid.section.a = "Protocols/Dummy";
+ for (auto &it : templates) {
+ sid.iDefaultIndex = -it.iconId;
+ sid.pszName = (char *)it.name;
+ sid.description.a = (char *)it.name;
+ g_plugin.addIcon(&sid);
+ }
}
/////////////////////////////////////////////////////////////////////////////////////////
@@ -90,6 +94,7 @@ CDummyProto::CDummyProto(const char *szModuleName, const wchar_t *ptszUserName) else uniqueIdText[0] = '\0';
uniqueIdSetting[0] = '\0';
+ m_hProtoIcon = g_plugin.getIconHandle(templates[id].iconId);
}
CDummyProto::~CDummyProto()
@@ -154,6 +159,31 @@ INT_PTR CDummyProto::GetCaps(int type, MCONTACT) return 0;
}
+/////////////////////////////////////////////////////////////////////////////////////////
+
+void CDummyProto::SearchIdAckThread(void *targ)
+{
+ PROTOSEARCHRESULT psr = { 0 };
+ psr.cbSize = sizeof(psr);
+ psr.flags = PSR_UNICODE;
+ psr.id.w = (wchar_t *)targ;
+ ProtoBroadcastAck(NULL, ACKTYPE_SEARCH, ACKRESULT_DATA, targ, (LPARAM)&psr);
+
+ ProtoBroadcastAck(NULL, ACKTYPE_SEARCH, ACKRESULT_SUCCESS, targ, 0);
+
+ mir_free(targ);
+}
+
+HANDLE CDummyProto::SearchBasic(const wchar_t *id)
+{
+ if (uniqueIdSetting[0] == '\0')
+ return nullptr;
+
+ wchar_t *tid = mir_wstrdup(id);
+ ForkThread(&CDummyProto::SearchIdAckThread, tid);
+ return tid;
+}
+
//////////////////////////////////////////////////////////////////////////////
int CDummyProto::SendMsg(MCONTACT hContact, MEVENT, const char *msg)
@@ -173,15 +203,7 @@ int CDummyProto::SetStatus(int) return 0;
}
-HANDLE CDummyProto::SearchBasic(const wchar_t* id)
-{
- if (uniqueIdSetting[0] == '\0')
- return nullptr;
-
- wchar_t *tid = mir_wstrdup(id);
- ForkThread(&CDummyProto::SearchIdAckThread, tid);
- return tid;
-}
+/////////////////////////////////////////////////////////////////////////////////////////
MCONTACT CDummyProto::AddToList(int flags, PROTOSEARCHRESULT* psr)
{
diff --git a/protocols/Dummy/src/main.cpp b/protocols/Dummy/src/main.cpp index a94754413a..3805214c02 100644 --- a/protocols/Dummy/src/main.cpp +++ b/protocols/Dummy/src/main.cpp @@ -64,6 +64,8 @@ static int OnDummyDoubleClicked(WPARAM hContact, LPARAM) int CMPlugin::Load()
{
+ InitIcons();
+
HookEvent(ME_CLIST_DOUBLECLICKED, OnDummyDoubleClicked);
return 0;
}
diff --git a/protocols/Dummy/src/resource.h b/protocols/Dummy/src/resource.h index f9405505ad..6f9537d8ba 100644 --- a/protocols/Dummy/src/resource.h +++ b/protocols/Dummy/src/resource.h @@ -3,6 +3,30 @@ // Used by D:\Development\Miranda\Miranda NG\protocols\Dummy\res\resource.rc
//
#define IDD_ACCMGRUI 101
+#define IDI_DUMMY 102
+#define IDI_AIM 103
+#define IDI_DISCORD 104
+#define IDI_EMLAN 105
+#define IDI_FACEBOOK 106
+#define IDI_GG 107
+#define IDI_ICQ 108
+#define IDI_IRC 109
+#define IDI_JABBER 110
+#define IDI_MINECRAFT 111
+#define IDI_MRA 112
+#define IDI_MSN 113
+#define IDI_OMEGLE 114
+#define IDI_SAMETIME 115
+#define IDI_SKYPE 116
+#define IDI_STEAM 117
+#define IDI_TELEGRAM 118
+#define IDI_TLEN 119
+#define IDI_TOX 120
+#define IDI_TWITTER 121
+#define IDI_VK 122
+#define IDI_WHATSAPP 123
+#define IDI_XFIRE 124
+#define IDI_YAHOO 125
#define IDC_ID_TEXT 1030
#define IDC_ID_SETTING 1031
#define IDC_TEMPLATE 1032
diff --git a/protocols/Dummy/src/stdafx.h b/protocols/Dummy/src/stdafx.h index bd6e73bda0..9ade7b5023 100644 --- a/protocols/Dummy/src/stdafx.h +++ b/protocols/Dummy/src/stdafx.h @@ -62,3 +62,4 @@ along with this program. If not, see <http://www.gnu.org/licenses/>. #include "dummy_proto.h"
void FillTemplateCombo(HWND hwndDlg, int iCtrlId);
+void InitIcons();
|