From 0f8566dd046d34ea0ff6b747f7383ffb17f6761e Mon Sep 17 00:00:00 2001 From: George Hazan Date: Sun, 14 Jun 2015 21:33:38 +0000 Subject: WindowList_* functions are not services anymore; unneeded helpers removed git-svn-id: http://svn.miranda-ng.org/main/trunk@14168 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c --- plugins/ContactsPlus/src/main.cpp | 24 ++++++++++++------------ plugins/ContactsPlus/src/receive.cpp | 4 ++-- plugins/ContactsPlus/src/receive.h | 2 +- plugins/ContactsPlus/src/send.cpp | 16 ++++++++-------- plugins/ContactsPlus/src/send.h | 4 ++-- 5 files changed, 25 insertions(+), 25 deletions(-) (limited to 'plugins/ContactsPlus') diff --git a/plugins/ContactsPlus/src/main.cpp b/plugins/ContactsPlus/src/main.cpp index 77a50dc048..12d7923f76 100644 --- a/plugins/ContactsPlus/src/main.cpp +++ b/plugins/ContactsPlus/src/main.cpp @@ -31,9 +31,9 @@ int hLangpack; int g_Utf8EventsSupported = TRUE; -HANDLE ghSendWindowList; -HANDLE ghRecvWindowList; -gAckList gaAckData; +MWindowList g_hSendWindowList; +MWindowList g_hRecvWindowList; +gAckList g_aAckData; HGENMENU hContactMenuItem; @@ -155,20 +155,20 @@ static int HookContactSettingChanged(WPARAM hContact, LPARAM lParam) if (strcmpnull(cws->szModule, "CList") && strcmpnull(cws->szModule, szProto)) return 0; - WindowList_Broadcast(ghSendWindowList, DM_UPDATETITLE, 0, 0); - WindowList_Broadcast(ghRecvWindowList, DM_UPDATETITLE, 0, 0); + WindowList_Broadcast(g_hSendWindowList, DM_UPDATETITLE, 0, 0); + WindowList_Broadcast(g_hRecvWindowList, DM_UPDATETITLE, 0, 0); return 0; } static int HookContactDeleted(WPARAM wParam, LPARAM) { // if our contact gets deleted close his window - HWND h = WindowList_Find(ghSendWindowList, wParam); + HWND h = WindowList_Find(g_hSendWindowList, wParam); if (h) SendMessage(h, WM_CLOSE, 0, 0); // since we hack the window list - more windows for one contact, we need to close them all - while (h = WindowList_Find(ghRecvWindowList, wParam)) + while (h = WindowList_Find(g_hRecvWindowList, wParam)) SendMessage(h, WM_CLOSE, 0, 0); return 0; } @@ -176,7 +176,7 @@ static int HookContactDeleted(WPARAM wParam, LPARAM) static INT_PTR ServiceSendCommand(WPARAM wParam, LPARAM) { //find window for hContact - HWND hWnd = WindowList_Find(ghSendWindowList, wParam); + HWND hWnd = WindowList_Find(g_hSendWindowList, wParam); if (!hWnd) CreateDialogParam(hInst, MAKEINTRESOURCE(IDD_SEND), NULL, SendDlgProc, wParam); else { @@ -204,8 +204,8 @@ extern "C" __declspec(dllexport) int Load(void) InitCommonControls(); - ghSendWindowList = WindowList_Create(); - ghRecvWindowList = WindowList_Create(); + g_hSendWindowList = WindowList_Create(); + g_hRecvWindowList = WindowList_Create(); //init hooks HookEvent(ME_SYSTEM_MODULESLOADED, HookModulesLoaded); @@ -225,7 +225,7 @@ extern "C" __declspec(dllexport) int Load(void) extern "C" __declspec(dllexport) int Unload(void) { - WindowList_Destroy(ghSendWindowList); - WindowList_Destroy(ghRecvWindowList); + WindowList_Destroy(g_hSendWindowList); + WindowList_Destroy(g_hRecvWindowList); return 0; } diff --git a/plugins/ContactsPlus/src/receive.cpp b/plugins/ContactsPlus/src/receive.cpp index 10aa4e70c5..84331201a3 100644 --- a/plugins/ContactsPlus/src/receive.cpp +++ b/plugins/ContactsPlus/src/receive.cpp @@ -169,7 +169,7 @@ INT_PTR CALLBACK RecvDlgProc(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lPara TranslateDialogDefault(hwndDlg); { CLISTEVENT *pcle = (CLISTEVENT*)lParam; - WindowList_Add(ghRecvWindowList, hwndDlg, pcle->hContact); + WindowList_Add(g_hRecvWindowList, hwndDlg, pcle->hContact); SendMessage(hwndDlg, WM_SETICON, ICON_SMALL, (LPARAM)LoadIcon(hInst, MAKEINTRESOURCE(IDI_CONTACTS))); EnableDlgItem(hwndDlg, IDOK, FALSE); EnableDlgItem(hwndDlg, IDDETAILS, FALSE); @@ -448,7 +448,7 @@ INT_PTR CALLBACK RecvDlgProc(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lPara break; case WM_CLOSE: // user closed window, so destroy it - WindowList_Remove(ghRecvWindowList, hwndDlg); + WindowList_Remove(g_hRecvWindowList, hwndDlg); DestroyWindow(hwndDlg); break; diff --git a/plugins/ContactsPlus/src/receive.h b/plugins/ContactsPlus/src/receive.h index 73ee03cb1e..52db60a171 100644 --- a/plugins/ContactsPlus/src/receive.h +++ b/plugins/ContactsPlus/src/receive.h @@ -60,7 +60,7 @@ struct TRecvContactsData HICON hIcons[4]; // icons for dialog }; -extern HANDLE ghRecvWindowList; +extern MWindowList g_hRecvWindowList; INT_PTR CALLBACK RecvDlgProc( HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam); diff --git a/plugins/ContactsPlus/src/send.cpp b/plugins/ContactsPlus/src/send.cpp index ae074322ea..2e0217c9e0 100644 --- a/plugins/ContactsPlus/src/send.cpp +++ b/plugins/ContactsPlus/src/send.cpp @@ -121,7 +121,7 @@ int TSendContactsData::SendContactsPacket(HWND hwndDlg, MCONTACT *phContacts, in return FALSE; // Failure } - TAckData *ackData = gaAckData.Add(hProcc, new TAckData(hContact)); + TAckData *ackData = g_aAckData.Add(hProcc, new TAckData(hContact)); uacklist.Add(hProcc); ackData->nContacts = nContacts; ackData->aContacts = (MCONTACT*)mir_alloc(nContacts*sizeof(MCONTACT)); @@ -230,7 +230,7 @@ INT_PTR CALLBACK SendDlgProc(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lPara TranslateDialogDefault(hwndDlg); SendMessage(hwndDlg, WM_SETICON, ICON_SMALL, (LPARAM)LoadIcon(hInst, MAKEINTRESOURCE(IDI_CONTACTS))); SetAllContactChecks(GetDlgItem(hwndDlg, IDC_LIST), lParam); - WindowList_Add(ghSendWindowList, hwndDlg, lParam); + WindowList_Add(g_hSendWindowList, hwndDlg, lParam); wndData = new TSendContactsData(lParam); SetWindowLongPtr(hwndDlg, DWLP_USER, (LONG_PTR)wndData); // new dlg init @@ -272,7 +272,7 @@ INT_PTR CALLBACK SendDlgProc(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lPara wndData->UnhookProtoAck(); if (wndData->uacklist.Count) { for (int i = 0; i < wndData->uacklist.Count; i++) - delete gaAckData.Remove(wndData->uacklist.Items[i]); // remove our ackdata & release structure + delete g_aAckData.Remove(wndData->uacklist.Items[i]); // remove our ackdata & release structure mir_free(wndData->uacklist.Items); wndData->uacklist.Items = NULL; @@ -292,7 +292,7 @@ INT_PTR CALLBACK SendDlgProc(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lPara case MSGERROR_RETRY:// resend timeouted packets for (int i = 0; i < wndData->uacklist.Count; i++) { - TAckData *lla = gaAckData.Remove(wndData->uacklist.Items[i]); + TAckData *lla = g_aAckData.Remove(wndData->uacklist.Items[i]); HANDLE hProcc = (HANDLE)CallContactService(wndData->hContact, PSS_CONTACTS, MAKEWPARAM(0, lla->nContacts), (LPARAM)lla->aContacts); if (!hProcc) { // if fatal do not include @@ -303,7 +303,7 @@ INT_PTR CALLBACK SendDlgProc(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lPara else { // update process code wndData->uacklist.Items[i] = hProcc; - gaAckData.Add(hProcc, lla); + g_aAckData.Add(hProcc, lla); } }// collect TAckData for our window, resend break; @@ -384,7 +384,7 @@ INT_PTR CALLBACK SendDlgProc(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lPara if (ack->type != ACKTYPE_CONTACTS) break; - TAckData *ackData = gaAckData.Get(ack->hProcess); + TAckData *ackData = g_aAckData.Get(ack->hProcess); if (ackData == NULL) break; // on unknown hprocc go away @@ -424,7 +424,7 @@ INT_PTR CALLBACK SendDlgProc(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lPara pBlob += strlennull(pBlob) + 1; } db_event_add(ackData->hContact, &dbei); - gaAckData.Remove(ack->hProcess); // do not release here, still needed + g_aAckData.Remove(ack->hProcess); // do not release here, still needed wndData->uacklist.Remove(ack->hProcess); // packet confirmed for (i = 0; i < ackData->nContacts; i++) { mir_free(maSend[i].mcaUIN); @@ -464,7 +464,7 @@ INT_PTR CALLBACK SendDlgProc(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lPara case WM_DESTROY: for (int i = 0; i < SIZEOF(wndData->hIcons); i++) DestroyIcon(wndData->hIcons[i]); - WindowList_Remove(ghSendWindowList, hwndDlg); + WindowList_Remove(g_hSendWindowList, hwndDlg); delete wndData; break; } diff --git a/plugins/ContactsPlus/src/send.h b/plugins/ContactsPlus/src/send.h index a9240ddef1..eada2a7da7 100644 --- a/plugins/ContactsPlus/src/send.h +++ b/plugins/ContactsPlus/src/send.h @@ -101,8 +101,8 @@ struct gAckList { ~gAckList() { if (Count) { for (int i=0; i