summaryrefslogtreecommitdiff
path: root/plugins/FavContacts
diff options
context:
space:
mode:
authorGeorge Hazan <george.hazan@gmail.com>2014-02-10 08:04:30 +0000
committerGeorge Hazan <george.hazan@gmail.com>2014-02-10 08:04:30 +0000
commitddba4ede6b451d0cfcd0d32b5180fbd0689966bf (patch)
tree5d74f37a7013d13b92c182628d6b68a58e148ae4 /plugins/FavContacts
parentc39340bf493a1745a41317bbf937fc7eb6cbb26a (diff)
- HANDLE hContact => HCONTACT
- GCF_* prefix was added to chat constants to avoid name conflicts git-svn-id: http://svn.miranda-ng.org/main/trunk@8078 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'plugins/FavContacts')
-rw-r--r--plugins/FavContacts/src/contact_cache.cpp8
-rw-r--r--plugins/FavContacts/src/contact_cache.h4
-rw-r--r--plugins/FavContacts/src/favlist.h12
-rw-r--r--plugins/FavContacts/src/http_api.cpp2
-rw-r--r--plugins/FavContacts/src/main.cpp26
5 files changed, 26 insertions, 26 deletions
diff --git a/plugins/FavContacts/src/contact_cache.cpp b/plugins/FavContacts/src/contact_cache.cpp
index 0cfc3b4757..b61fc00f95 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)
{
- HANDLE hContact = (HANDLE)wParam;
+ HCONTACT hContact = (HCONTACT)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 (HANDLE hContact = db_find_first(); hContact; hContact = db_find_next(hContact)) {
+ for (HCONTACT 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()
}
}
-HANDLE CContactCache::get(int rate)
+HCONTACT 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, HANDLE hContact, int info)
+static bool AppendInfo(TCHAR *buf, int size, HCONTACT 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 d4a47ba477..15c3b2c81a 100644
--- a/plugins/FavContacts/src/contact_cache.h
+++ b/plugins/FavContacts/src/contact_cache.h
@@ -10,7 +10,7 @@ private:
struct TContactInfo
{
- HANDLE hContact;
+ HCONTACT hContact;
float rate;
TCHAR info[INFOSIZE];
bool infoLoaded;
@@ -52,7 +52,7 @@ public:
void Unlock() { LeaveCriticalSection(&m_cs); }
void Rebuild();
- HANDLE get(int rate);
+ HCONTACT 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 04ed0d20e2..c0ebd6e2d0 100644
--- a/plugins/FavContacts/src/favlist.h
+++ b/plugins/FavContacts/src/favlist.h
@@ -4,7 +4,7 @@
struct TContactInfo
{
private:
- HANDLE hContact;
+ HCONTACT hContact;
DWORD status;
TCHAR *name;
TCHAR *group;
@@ -12,7 +12,7 @@ private:
float fRate;
public:
- TContactInfo(HANDLE hContact, bool bManual, float fRate = 0)
+ TContactInfo(HCONTACT hContact, bool bManual, float fRate = 0)
{
DBVARIANT dbv = {0};
@@ -41,7 +41,7 @@ public:
mir_free(group);
}
- HANDLE getHandle() const
+ HCONTACT getHandle() const
{
return hContact;
}
@@ -89,7 +89,7 @@ public:
return nGroups;
}
- TContactInfo *addContact(HANDLE hContact, bool bManual)
+ TContactInfo *addContact(HCONTACT hContact, bool bManual)
{
TContactInfo *info = new TContactInfo(hContact, bManual);
this->insert(info);
@@ -102,7 +102,7 @@ public:
nGroups = 1;
- for (HANDLE hContact = db_find_first(); hContact; hContact = db_find_next(hContact))
+ for (HCONTACT 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) {
- HANDLE hContact = g_contactCache->get(i);
+ HCONTACT 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 da0f9ee01c..bce57b0a7a 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)
{
- HANDLE hContact = favList[i]->getHandle();
+ HCONTACT 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 5bb306246c..b83dc2aeba 100644
--- a/plugins/FavContacts/src/main.cpp
+++ b/plugins/FavContacts/src/main.cpp
@@ -248,7 +248,7 @@ int ProcessModulesLoaded(WPARAM wParam, LPARAM lParam)
Hotkey_Register(&hotkey);
if (ServiceExists(MS_AV_GETAVATARBITMAP)) {
- for (HANDLE hContact = db_find_first(); hContact; hContact = db_find_next(hContact))
+ for (HCONTACT 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)
{
- HANDLE hContact = (HANDLE)lpmis->itemData;
+ HCONTACT hContact = (HCONTACT)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)
{
- HANDLE hContact = (HANDLE)lpdis->itemData;
+ HCONTACT hContact = (HCONTACT)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 HANDLE hContact = NULL;
+ static HCONTACT 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) {
- HANDLE hContact = g_contactCache->get(i);
+ HCONTACT 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);
- HANDLE hContact = (HANDLE)mii.dwItemData;
+ HCONTACT hContact = (HCONTACT)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;
- HANDLE hContact;
+ HCONTACT 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 = (HANDLE)mii.dwItemData;
+ hContact = (HCONTACT)mii.dwItemData;
}
SetForegroundWindow(hwndSave);
DestroyMenu(hMenu);
@@ -940,7 +940,7 @@ int ProcessSrmmIconClick( WPARAM wParam, LPARAM lParam )
StatusIconClickData *sicd = (StatusIconClickData *)lParam;
if (lstrcmpA(sicd->szModule, "FavContacts")) return 0;
- HANDLE hContact = (HANDLE)wParam;
+ HCONTACT hContact = (HCONTACT)wParam;
if (!hContact)
return 0;
@@ -1005,7 +1005,7 @@ static INT_PTR CALLBACK OptionsDlgProc(HWND hwnd, UINT msg, WPARAM wParam, LPARA
hSelectedContact = db_find_first();
{
- for (HANDLE hContact = db_find_first(); hContact; hContact = db_find_next(hContact))
+ for (HCONTACT 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 (HANDLE hContact = db_find_first(); hContact; hContact = db_find_next(hContact)) {
+ for (HCONTACT 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 (HANDLE hContact = db_find_first(); hContact; hContact = db_find_next(hContact)) {
+ for (HCONTACT 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 (HANDLE hContact = db_find_first(); hContact; hContact = db_find_next(hContact)) {
+ for (HCONTACT 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);