From 68d3fd47bb9b75e65859d14199ffee01f16ac9a7 Mon Sep 17 00:00:00 2001 From: George Hazan Date: Mon, 10 Feb 2014 20:47:51 +0000 Subject: HCONTACT is not needed anymore git-svn-id: http://svn.miranda-ng.org/main/trunk@8086 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c --- plugins/FavContacts/src/contact_cache.cpp | 8 ++++---- plugins/FavContacts/src/contact_cache.h | 4 ++-- plugins/FavContacts/src/favlist.h | 12 ++++++------ plugins/FavContacts/src/http_api.cpp | 2 +- plugins/FavContacts/src/main.cpp | 32 +++++++++++++++---------------- 5 files changed, 29 insertions(+), 29 deletions(-) (limited to 'plugins/FavContacts/src') diff --git a/plugins/FavContacts/src/contact_cache.cpp b/plugins/FavContacts/src/contact_cache.cpp index b61fc00f95..f934015eb2 100644 --- a/plugins/FavContacts/src/contact_cache.cpp +++ b/plugins/FavContacts/src/contact_cache.cpp @@ -2,7 +2,7 @@ int __cdecl CContactCache::OnDbEventAdded(WPARAM wParam, LPARAM lParam) { - HCONTACT hContact = (HCONTACT)wParam; + MCONTACT hContact = (MCONTACT)wParam; HANDLE hEvent = (HANDLE)lParam; DBEVENTINFO dbei = {0}; @@ -81,7 +81,7 @@ void CContactCache::Rebuild() unsigned long timestamp = time(NULL); m_lastUpdate = time(NULL); - for (HCONTACT hContact = db_find_first(); hContact; hContact = db_find_next(hContact)) { + for (MCONTACT hContact = db_find_first(); hContact; hContact = db_find_next(hContact)) { TContactInfo *info = new TContactInfo; info->hContact = hContact; info->rate = 0; @@ -102,7 +102,7 @@ void CContactCache::Rebuild() } } -HCONTACT CContactCache::get(int rate) +MCONTACT CContactCache::get(int rate) { if (rate >= 0 && rate < m_cache.getCount()) return m_cache[rate].hContact; @@ -116,7 +116,7 @@ float CContactCache::getWeight(int rate) return -1; } -static bool AppendInfo(TCHAR *buf, int size, HCONTACT hContact, int info) +static bool AppendInfo(TCHAR *buf, int size, MCONTACT hContact, int info) { CONTACTINFO ci = {0}; ci.cbSize = sizeof(ci); diff --git a/plugins/FavContacts/src/contact_cache.h b/plugins/FavContacts/src/contact_cache.h index 15c3b2c81a..b3ad95e027 100644 --- a/plugins/FavContacts/src/contact_cache.h +++ b/plugins/FavContacts/src/contact_cache.h @@ -10,7 +10,7 @@ private: struct TContactInfo { - HCONTACT hContact; + MCONTACT hContact; float rate; TCHAR info[INFOSIZE]; bool infoLoaded; @@ -52,7 +52,7 @@ public: void Unlock() { LeaveCriticalSection(&m_cs); } void Rebuild(); - HCONTACT get(int rate); + MCONTACT get(int rate); float getWeight(int rate); bool filter(int rate, TCHAR *str); }; diff --git a/plugins/FavContacts/src/favlist.h b/plugins/FavContacts/src/favlist.h index c0ebd6e2d0..0f16ef8fb6 100644 --- a/plugins/FavContacts/src/favlist.h +++ b/plugins/FavContacts/src/favlist.h @@ -4,7 +4,7 @@ struct TContactInfo { private: - HCONTACT hContact; + MCONTACT hContact; DWORD status; TCHAR *name; TCHAR *group; @@ -12,7 +12,7 @@ private: float fRate; public: - TContactInfo(HCONTACT hContact, bool bManual, float fRate = 0) + TContactInfo(MCONTACT hContact, bool bManual, float fRate = 0) { DBVARIANT dbv = {0}; @@ -41,7 +41,7 @@ public: mir_free(group); } - HCONTACT getHandle() const + MCONTACT getHandle() const { return hContact; } @@ -89,7 +89,7 @@ public: return nGroups; } - TContactInfo *addContact(HCONTACT hContact, bool bManual) + TContactInfo *addContact(MCONTACT hContact, bool bManual) { TContactInfo *info = new TContactInfo(hContact, bManual); this->insert(info); @@ -102,7 +102,7 @@ public: nGroups = 1; - for (HCONTACT hContact = db_find_first(); hContact; hContact = db_find_next(hContact)) + for (MCONTACT hContact = db_find_first(); hContact; hContact = db_find_next(hContact)) if (db_get_b(hContact, "FavContacts", "IsFavourite", 0)) { TCHAR *group = addContact(hContact, true)->getGroup(); @@ -113,7 +113,7 @@ public: int nRecent = 0; for (int i = 0; nRecent < g_Options.wMaxRecent; ++i) { - HCONTACT hContact = g_contactCache->get(i); + MCONTACT hContact = g_contactCache->get(i); if (!hContact) break; if (!db_get_b(hContact, "FavContacts", "IsFavourite", 0)) { diff --git a/plugins/FavContacts/src/http_api.cpp b/plugins/FavContacts/src/http_api.cpp index bce57b0a7a..693ba4cd28 100644 --- a/plugins/FavContacts/src/http_api.cpp +++ b/plugins/FavContacts/src/http_api.cpp @@ -67,7 +67,7 @@ public: for (int i = 0; i < favList.getCount(); ++i) { - HCONTACT hContact = favList[i]->getHandle(); + MCONTACT hContact = favList[i]->getHandle(); TCHAR *name = (TCHAR *)CallService(MS_CLIST_GETCONTACTDISPLAYNAME, (WPARAM)hContact, GCDNF_TCHAR); AVATARCACHEENTRY *avatar = (AVATARCACHEENTRY *)CallService(MS_AV_GETAVATARBITMAP, (WPARAM)hContact, 0); int status = db_get_w(hContact, GetContactProto(hContact), "Status", ID_STATUS_OFFLINE); diff --git a/plugins/FavContacts/src/main.cpp b/plugins/FavContacts/src/main.cpp index 4982a7fcb9..ee53ee1b06 100644 --- a/plugins/FavContacts/src/main.cpp +++ b/plugins/FavContacts/src/main.cpp @@ -75,7 +75,7 @@ TCHAR g_filter[1024] = {0}; Options g_Options = {0}; static HANDLE hDialogsList = NULL; -static HCONTACT hContactToActivate = NULL; +static MCONTACT hContactToActivate = NULL; BOOL WINAPI DllMain(HINSTANCE hinstDLL, DWORD fdwReason, LPVOID lpvReserved) { @@ -248,7 +248,7 @@ int ProcessModulesLoaded(WPARAM wParam, LPARAM lParam) Hotkey_Register(&hotkey); if (ServiceExists(MS_AV_GETAVATARBITMAP)) { - for (HCONTACT hContact = db_find_first(); hContact; hContact = db_find_next(hContact)) + for (MCONTACT hContact = db_find_first(); hContact; hContact = db_find_next(hContact)) if (db_get_b(hContact, "FavContacts", "IsFavourite", 0)) CallService(MS_AV_GETAVATARBITMAP, (WPARAM)hContact, 0); } @@ -387,7 +387,7 @@ static BOOL sttMeasureItem_Group(LPMEASUREITEMSTRUCT lpmis, Options *options) static BOOL sttMeasureItem_Contact(LPMEASUREITEMSTRUCT lpmis, Options *options) { - HCONTACT hContact = (HCONTACT)lpmis->itemData; + MCONTACT hContact = (MCONTACT)lpmis->itemData; lpmis->itemHeight = 4; lpmis->itemWidth = 8+10; @@ -525,7 +525,7 @@ void ImageList_DrawDimmed(HIMAGELIST himl, int i, HDC hdc, int left, int top, UI static BOOL sttDrawItem_Contact(LPDRAWITEMSTRUCT lpdis, Options *options = NULL) { - HCONTACT hContact = (HCONTACT)lpdis->itemData; + MCONTACT hContact = (MCONTACT)lpdis->itemData; HDC hdcTemp = CreateCompatibleDC(lpdis->hDC); HBITMAP hbmTemp = CreateCompatibleBitmap(lpdis->hDC, lpdis->rcItem.right-lpdis->rcItem.left, lpdis->rcItem.bottom-lpdis->rcItem.top); @@ -703,7 +703,7 @@ static BOOL sttDrawItem(LPDRAWITEMSTRUCT lpdis, Options *options=NULL) static LRESULT CALLBACK MenuHostWndProc(HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam) { - static HCONTACT hContact = NULL; + static MCONTACT hContact = NULL; switch (message) { case WM_MEASUREITEM: @@ -749,7 +749,7 @@ static LRESULT CALLBACK MenuHostWndProc(HWND hwnd, UINT message, WPARAM wParam, int nRecent = 0; int maxRecent = g_Options.wMaxRecent ? g_Options.wMaxRecent : 10; for (int i = 0; nRecent < maxRecent; ++i) { - HCONTACT hContact = g_contactCache->get(i); + MCONTACT hContact = g_contactCache->get(i); if (!hContact) break; if (!g_contactCache->filter(i, g_filter)) continue; @@ -764,7 +764,7 @@ static LRESULT CALLBACK MenuHostWndProc(HWND hwnd, UINT message, WPARAM wParam, MENUITEMINFO mii = { sizeof(mii) }; mii.fMask = MIIM_DATA; GetMenuItemInfo((HMENU)lParam, wParam, TRUE, &mii); - HCONTACT hContact = (HCONTACT)mii.dwItemData; + MCONTACT hContact = (MCONTACT)mii.dwItemData; if (!CallService(MS_DB_CONTACT_IS, mii.dwItemData, 0)) return FALSE; HMENU hMenu = (HMENU)CallService(MS_CLIST_MENUBUILDCONTACT, (WPARAM)hContact, 0); @@ -793,7 +793,7 @@ int sttShowMenu(bool centered) SIZE szColumn = {0}; TCHAR *prevGroup = NULL; int i, idItem = 100; - HCONTACT hContact; + MCONTACT hContact; favList.build(); @@ -867,7 +867,7 @@ int sttShowMenu(bool centered) mii.cbSize = sizeof(mii); mii.fMask = MIIM_DATA; GetMenuItemInfo(hMenu, res, FALSE, &mii); - hContact = (HCONTACT)mii.dwItemData; + hContact = (MCONTACT)mii.dwItemData; } SetForegroundWindow(hwndSave); DestroyMenu(hMenu); @@ -892,7 +892,7 @@ INT_PTR svcShowMenuCentered(WPARAM wParam, LPARAM lParam) INT_PTR svcOpenContact(WPARAM wParam, LPARAM lParam) { - hContactToActivate = (HCONTACT)wParam; + hContactToActivate = (MCONTACT)wParam; CallService(MS_CLIST_CONTACTDOUBLECLICKED, (WPARAM)hContactToActivate, 0); return 0; } @@ -940,7 +940,7 @@ int ProcessSrmmIconClick( WPARAM wParam, LPARAM lParam ) StatusIconClickData *sicd = (StatusIconClickData *)lParam; if (lstrcmpA(sicd->szModule, "FavContacts")) return 0; - HCONTACT hContact = (HCONTACT)wParam; + MCONTACT hContact = (MCONTACT)wParam; if (!hContact) return 0; @@ -977,7 +977,7 @@ static void sttResetListOptions(HWND hwndList) static INT_PTR CALLBACK OptionsDlgProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam) { static bool bInitialized = false; - static HCONTACT hSelectedContact = 0; + static MCONTACT hSelectedContact = 0; switch (msg) { case WM_INITDIALOG: @@ -1005,7 +1005,7 @@ static INT_PTR CALLBACK OptionsDlgProc(HWND hwnd, UINT msg, WPARAM wParam, LPARA hSelectedContact = db_find_first(); { - for (HCONTACT hContact = db_find_first(); hContact; hContact = db_find_next(hContact)) + for (MCONTACT hContact = db_find_first(); hContact; hContact = db_find_next(hContact)) SendDlgItemMessage(hwnd, IDC_CLIST, CLM_SETCHECKMARK, SendDlgItemMessage(hwnd, IDC_CLIST, CLM_FINDCONTACT, (WPARAM)hContact, 0), db_get_b(hContact, "FavContacts", "IsFavourite", 0)); @@ -1127,7 +1127,7 @@ static INT_PTR CALLBACK OptionsDlgProc(HWND hwnd, UINT msg, WPARAM wParam, LPARA sttSaveOptions(); - for (HCONTACT hContact = db_find_first(); hContact; hContact = db_find_next(hContact)) { + for (MCONTACT hContact = db_find_first(); hContact; hContact = db_find_next(hContact)) { BYTE fav = SendDlgItemMessage(hwnd, IDC_CLIST, CLM_GETCHECKMARK, SendDlgItemMessage(hwnd, IDC_CLIST, CLM_FINDCONTACT, (WPARAM)hContact, 0), 0); if (fav != db_get_b(hContact, "FavContacts", "IsFavourite", 0)) @@ -1145,7 +1145,7 @@ static INT_PTR CALLBACK OptionsDlgProc(HWND hwnd, UINT msg, WPARAM wParam, LPARA case CLN_NEWCONTACT: iSelection = (int)((NMCLISTCONTROL *)lParam)->hItem; - for (HCONTACT hContact = db_find_first(); hContact; hContact = db_find_next(hContact)) { + for (MCONTACT hContact = db_find_first(); hContact; hContact = db_find_next(hContact)) { if (SendDlgItemMessage(hwnd, IDC_CLIST, CLM_FINDCONTACT, (WPARAM)hContact, 0) == iSelection) { SendDlgItemMessage(hwnd, IDC_CLIST, CLM_SETCHECKMARK, iSelection, db_get_b(hContact, "FavContacts", "IsFavourite", 0)); @@ -1156,7 +1156,7 @@ static INT_PTR CALLBACK OptionsDlgProc(HWND hwnd, UINT msg, WPARAM wParam, LPARA case CLN_CHECKCHANGED: iSelection = (int)((NMCLISTCONTROL *)lParam)->hItem; - for (HCONTACT hContact = db_find_first(); hContact; hContact = db_find_next(hContact)) { + for (MCONTACT hContact = db_find_first(); hContact; hContact = db_find_next(hContact)) { if (SendDlgItemMessage(hwnd, IDC_CLIST, CLM_FINDCONTACT, (WPARAM)hContact, 0) == iSelection) { hSelectedContact = hContact; RedrawWindow(GetDlgItem(hwnd, IDC_CANVAS), NULL, NULL, RDW_INVALIDATE); -- cgit v1.2.3