From ddba4ede6b451d0cfcd0d32b5180fbd0689966bf Mon Sep 17 00:00:00 2001 From: George Hazan Date: Mon, 10 Feb 2014 08:04:30 +0000 Subject: - 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 --- plugins/SeenPlugin/src/file.cpp | 2 +- plugins/SeenPlugin/src/history.cpp | 12 ++++++------ plugins/SeenPlugin/src/menu.cpp | 8 ++++---- plugins/SeenPlugin/src/missed.cpp | 12 ++++++------ plugins/SeenPlugin/src/seen.h | 10 +++++----- plugins/SeenPlugin/src/userinfo.cpp | 6 +++--- plugins/SeenPlugin/src/utils.cpp | 26 +++++++++++++------------- 7 files changed, 38 insertions(+), 38 deletions(-) (limited to 'plugins/SeenPlugin') diff --git a/plugins/SeenPlugin/src/file.cpp b/plugins/SeenPlugin/src/file.cpp index 8aea65614b..d049fda7d3 100644 --- a/plugins/SeenPlugin/src/file.cpp +++ b/plugins/SeenPlugin/src/file.cpp @@ -59,7 +59,7 @@ int InitFileOutput(void) /* Writes a line into the log. */ -void FileWrite(HANDLE hcontact) +void FileWrite(HCONTACT hcontact) { TCHAR szout[1024]; diff --git a/plugins/SeenPlugin/src/history.cpp b/plugins/SeenPlugin/src/history.cpp index bb269830a7..1d935e4d7b 100644 --- a/plugins/SeenPlugin/src/history.cpp +++ b/plugins/SeenPlugin/src/history.cpp @@ -31,7 +31,7 @@ char* BuildSetting(int historyLast) { return setting; } -void HistoryWrite(HANDLE hContact) +void HistoryWrite(HCONTACT hContact) { int historyMax = db_get_w(NULL, S_MOD, "HistoryMax", 10); if (historyMax < 0) @@ -64,7 +64,7 @@ void HistoryWrite(HANDLE hContact) db_set_w(hContact, S_MOD, "HistoryFirst", (historyFirst+1) % historyMax); } -void LoadHistoryList(HANDLE hContact, HWND hwnd, int nList) +void LoadHistoryList(HCONTACT hContact, HWND hwnd, int nList) { SendDlgItemMessage(hwnd, nList, LB_RESETCONTENT, 0, 0); int historyMax = db_get_w(NULL,S_MOD,"HistoryMax",10); @@ -161,13 +161,13 @@ void MyResizeGetOffset (HWND hwndDlg, HWND hwndControl, int nWidth, int nHeight, INT_PTR CALLBACK HistoryDlgProc(HWND hwndDlg, UINT Message, WPARAM wparam, LPARAM lparam) { - HANDLE hContact; + HCONTACT hContact; TCHAR sztemp[1024]; switch(Message) { case WM_INITDIALOG: TranslateDialogDefault(hwndDlg); - hContact = (HANDLE)lparam; + hContact = (HCONTACT)lparam; SetWindowLongPtr(hwndDlg,GWLP_USERDATA,lparam); mir_sntprintf(sztemp, SIZEOF(sztemp), _T("%s: %s"), CallService(MS_CLIST_GETCONTACTDISPLAYNAME,(WPARAM)hContact,GCDNF_TCHAR), @@ -199,7 +199,7 @@ INT_PTR CALLBACK HistoryDlgProc(HWND hwndDlg, UINT Message, WPARAM wparam, LPARA return CallService(MS_CLIST_MENUDRAWITEM,wparam,lparam); case WM_COMMAND: - hContact=(HANDLE)GetWindowLongPtr(hwndDlg,GWLP_USERDATA); + hContact=(HCONTACT)GetWindowLongPtr(hwndDlg,GWLP_USERDATA); if (CallService(MS_CLIST_MENUPROCESSCOMMAND,MAKEWPARAM(LOWORD(wparam),MPCF_CONTACTMENU),(LPARAM)hContact)) break; @@ -278,7 +278,7 @@ INT_PTR CALLBACK HistoryDlgProc(HWND hwndDlg, UINT Message, WPARAM wparam, LPARA return FALSE; } -void ShowHistory(HANDLE hContact, BYTE isAlert) +void ShowHistory(HCONTACT hContact, BYTE isAlert) { HWND hHistoryDlg = WindowList_Find(hWindowList,hContact); if (hHistoryDlg == NULL) { diff --git a/plugins/SeenPlugin/src/menu.cpp b/plugins/SeenPlugin/src/menu.cpp index 6056971494..849c271dc6 100644 --- a/plugins/SeenPlugin/src/menu.cpp +++ b/plugins/SeenPlugin/src/menu.cpp @@ -30,14 +30,14 @@ Handles the messages sent by clicking the contact's menu item */ INT_PTR MenuitemClicked(WPARAM wparam,LPARAM) { - ShowHistory((HANDLE)wparam, 0); + ShowHistory((HCONTACT)wparam, 0); return 0; } int BuildContactMenu(WPARAM wparam,LPARAM) { int id = -1, isetting; - HANDLE hContact = (HANDLE)wparam; + HCONTACT hContact = (HCONTACT)wparam; char *szProto = GetContactProto(hContact); CLISTMENUITEM cmi = { sizeof(cmi) }; @@ -49,10 +49,10 @@ int BuildContactMenu(WPARAM wparam,LPARAM) DBVARIANT dbv; if ( !db_get_ts(NULL, S_MOD, "MenuStamp", &dbv)) { - cmi.ptszName = ParseString(dbv.ptszVal, (HANDLE)wparam, 0); + cmi.ptszName = ParseString(dbv.ptszVal, (HCONTACT)wparam, 0); db_free(&dbv); } - else cmi.ptszName = ParseString(DEFAULT_MENUSTAMP, (HANDLE)wparam, 0); + else cmi.ptszName = ParseString(DEFAULT_MENUSTAMP, (HCONTACT)wparam, 0); if ( !_tcscmp(cmi.ptszName, TranslateT(""))) { if ( IsWatchedProtocol(szProto)) diff --git a/plugins/SeenPlugin/src/missed.cpp b/plugins/SeenPlugin/src/missed.cpp index ae29690d72..5746d0b647 100644 --- a/plugins/SeenPlugin/src/missed.cpp +++ b/plugins/SeenPlugin/src/missed.cpp @@ -42,7 +42,7 @@ int RemoveUser(int pos) int ResetMissed(void) { - for (HANDLE hContact = db_find_first(); hContact; hContact = db_find_next(hContact)) + for (HCONTACT hContact = db_find_first(); hContact; hContact = db_find_next(hContact)) db_set_b(hContact, S_MOD, "Missed", 0); ZeroMemory(&mcs,sizeof(mcs)); @@ -51,7 +51,7 @@ int ResetMissed(void) int CheckIfOnline(void) { - 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 ( CallService(MS_CLIST_GETCONTACTICON, (WPARAM)hContact, 0) != ICON_OFFLINE) db_set_b(hContact, S_MOD, "Missed", 2); @@ -128,12 +128,12 @@ int Test(WPARAM wparam,LPARAM lparam) if (CallService(MS_IGNORE_ISIGNORED,wparam,IGNOREEVENT_USERONLINE)) return 0; - if ( db_get_b((HANDLE)wparam,S_MOD,"Missed",0)==2) + if ( db_get_b((HCONTACT)wparam,S_MOD,"Missed",0)==2) return 0; switch(lparam) { case ICON_OFFLINE: - if ( db_get_b((HANDLE)wparam,S_MOD,"Missed",0) == 1) { + if ( db_get_b((HCONTACT)wparam,S_MOD,"Missed",0) == 1) { WORD missed = IsUserMissed(wparam); if (!LOWORD(missed)) { mcs.times[mcs.count]=1; @@ -141,7 +141,7 @@ int Test(WPARAM wparam,LPARAM lparam) } else mcs.times[HIWORD(missed)]++; - db_set_b((HANDLE)wparam,S_MOD,"Missed",0); + db_set_b((HCONTACT)wparam,S_MOD,"Missed",0); } break; @@ -152,7 +152,7 @@ int Test(WPARAM wparam,LPARAM lparam) case ICON_DND: case ICON_FREE: case ICON_INVIS: - db_set_b((HANDLE)wparam,S_MOD,"Missed",1); + db_set_b((HCONTACT)wparam,S_MOD,"Missed",1); break; } diff --git a/plugins/SeenPlugin/src/seen.h b/plugins/SeenPlugin/src/seen.h index b716ead0a5..15b357ac1f 100644 --- a/plugins/SeenPlugin/src/seen.h +++ b/plugins/SeenPlugin/src/seen.h @@ -52,8 +52,8 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. #include "resource.h" #include "version.h" -WCHAR *any_to_IdleNotidleUnknown(HANDLE hContact, const char *module_name, const char *setting_name, WCHAR *buff, int bufflen); -WCHAR *any_to_Idle(HANDLE hContact, const char *module_name, const char *setting_name, WCHAR *buff, int bufflen); +WCHAR *any_to_IdleNotidleUnknown(HCONTACT hContact, const char *module_name, const char *setting_name, WCHAR *buff, int bufflen); +WCHAR *any_to_Idle(HCONTACT hContact, const char *module_name, const char *setting_name, WCHAR *buff, int bufflen); #define NUM100NANOSEC 116444736000000000 @@ -94,7 +94,7 @@ typedef struct{ } MISSEDCONTACTS; int IsWatchedProtocol(const char* szProto); -TCHAR *ParseString(TCHAR*, HANDLE, BYTE); +TCHAR *ParseString(TCHAR*, HCONTACT, BYTE); void GetColorsFromDWord(LPCOLORREF First, LPCOLORREF Second, DWORD colDword); DWORD GetDWordFromColors(COLORREF First, COLORREF Second); int OptionsInit(WPARAM,LPARAM); @@ -106,11 +106,11 @@ int ModeChange(WPARAM,LPARAM); void SetOffline(void); int ModeChange_mo(WPARAM,LPARAM); int CheckIfOnline(void); -void ShowHistory(HANDLE hContact, BYTE isAlert); +void ShowHistory(HCONTACT hContact, BYTE isAlert); struct logthread_info { - HANDLE hContact; + HCONTACT hContact; char sProtoName[MAXMODULELABELLENGTH]; WORD currStatus; }; diff --git a/plugins/SeenPlugin/src/userinfo.cpp b/plugins/SeenPlugin/src/userinfo.cpp index 6205dcaa1e..ddab491d6a 100644 --- a/plugins/SeenPlugin/src/userinfo.cpp +++ b/plugins/SeenPlugin/src/userinfo.cpp @@ -40,10 +40,10 @@ INT_PTR CALLBACK UserinfoDlgProc(HWND hdlg,UINT msg,WPARAM wparam,LPARAM lparam) { TCHAR *szout; if ( !db_get_ts(NULL, S_MOD, "UserStamp", &dbv)) { - szout = ParseString(dbv.ptszVal, (HANDLE)lparam, 0); + szout = ParseString(dbv.ptszVal, (HCONTACT)lparam, 0); db_free(&dbv); } - else szout = ParseString(DEFAULT_USERSTAMP, (HANDLE)lparam, 0); + else szout = ParseString(DEFAULT_USERSTAMP, (HCONTACT)lparam, 0); SetDlgItemText(hdlg, IDC_INFOTEXT, szout); if ( !lstrcmp(szout, TranslateT(""))) @@ -62,7 +62,7 @@ INT_PTR CALLBACK UserinfoDlgProc(HWND hdlg,UINT msg,WPARAM wparam,LPARAM lparam) int UserinfoInit(WPARAM wparam,LPARAM lparam) { - char *proto = GetContactProto((HANDLE)lparam); + char *proto = GetContactProto((HCONTACT)lparam); if ( IsWatchedProtocol(proto)) { OPTIONSDIALOGPAGE uip = { sizeof(uip) }; uip.hInstance = hInstance; diff --git a/plugins/SeenPlugin/src/utils.cpp b/plugins/SeenPlugin/src/utils.cpp index c7e0705a7d..9bcb42000b 100644 --- a/plugins/SeenPlugin/src/utils.cpp +++ b/plugins/SeenPlugin/src/utils.cpp @@ -20,8 +20,8 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. #include "seen.h" -void FileWrite(HANDLE); -void HistoryWrite(HANDLE hcontact); +void FileWrite(HCONTACT); +void HistoryWrite(HCONTACT hcontact); extern HANDLE g_hShutdownEvent; char * courProtoName = 0; @@ -96,7 +96,7 @@ BOOL isMSN(char *protoname) return FALSE; } -DWORD isSeen(HANDLE hcontact, SYSTEMTIME *st) +DWORD isSeen(HCONTACT hcontact, SYSTEMTIME *st) { FILETIME ft; ULONGLONG ll; @@ -142,7 +142,7 @@ TCHAR *wdays_short[] = { LPGENT("Sun."), LPGENT("Mon."), LPGENT("Tue."), LPGENT( TCHAR *monthnames[] = { LPGENT("January"), LPGENT("February"), LPGENT("March"), LPGENT("April"), LPGENT("May"), LPGENT("June"), LPGENT("July"), LPGENT("August"), LPGENT("September"), LPGENT("October"), LPGENT("November"), LPGENT("December") }; TCHAR *mnames_short[] = { LPGENT("Jan."), LPGENT("Feb."), LPGENT("Mar."), LPGENT("Apr."), LPGENT("May"), LPGENT("Jun."), LPGENT("Jul."), LPGENT("Aug."), LPGENT("Sep."), LPGENT("Oct."), LPGENT("Nov."), LPGENT("Dec.") }; -TCHAR *ParseString(TCHAR *szstring, HANDLE hcontact, BYTE isfile) +TCHAR *ParseString(TCHAR *szstring, HCONTACT hcontact, BYTE isfile) { #define MAXSIZE 1024 static TCHAR sztemp[MAXSIZE+1]; @@ -386,7 +386,7 @@ LBL_charPtr: return sztemp; } -void _DBWriteTime(SYSTEMTIME *st,HANDLE hcontact) +void _DBWriteTime(SYSTEMTIME *st, HCONTACT hcontact) { db_set_w(hcontact,S_MOD,"Day",st->wDay); db_set_w(hcontact,S_MOD,"Month",st->wMonth); @@ -398,7 +398,7 @@ void _DBWriteTime(SYSTEMTIME *st,HANDLE hcontact) } -void DBWriteTimeTS(DWORD t, HANDLE hcontact){ +void DBWriteTimeTS(DWORD t, HCONTACT hcontact){ SYSTEMTIME st; FILETIME ft; ULONGLONG ll = UInt32x32To64(CallService(MS_DB_TIME_TIMESTAMPTOLOCAL,t,0), 10000000) + NUM100NANOSEC; @@ -454,7 +454,7 @@ LRESULT CALLBACK PopupDlgProc(HWND hwnd, UINT message, WPARAM wParam, LPARAM lPa switch(message) { case WM_COMMAND: if (HIWORD(wParam) == STN_CLICKED){ - HANDLE hContact = PUGetContact(hwnd); + HCONTACT hContact = PUGetContact(hwnd); if (hContact > 0) CallService(MS_MSG_SENDMESSAGE,(WPARAM)hContact,0); } case WM_CONTEXTMENU: @@ -465,7 +465,7 @@ LRESULT CALLBACK PopupDlgProc(HWND hwnd, UINT message, WPARAM wParam, LPARAM lPa return DefWindowProc(hwnd, message, wParam, lParam); }; -void ShowPopup(HANDLE hcontact, const char * lpzProto, int newStatus) +void ShowPopup(HCONTACT hcontact, const char * lpzProto, int newStatus) { if ( CallService(MS_IGNORE_ISIGNORED, (WPARAM)hcontact, IGNOREEVENT_USERONLINE)) return; @@ -548,7 +548,7 @@ int UpdateValues(WPARAM wparam,LPARAM lparam) // to make this code faster if (!wparam) return 0; - HANDLE hContact = (HANDLE)wparam; + HCONTACT hContact = (HCONTACT)wparam; DBCONTACTWRITESETTING *cws=(DBCONTACTWRITESETTING *)lparam; //if (CallService(MS_IGNORE_ISIGNORED,(WPARAM)hContact,IGNOREEVENT_USERONLINE)) return 0; BOOL isIdleEvent = includeIdle?(strcmp(cws->szSetting,"IdleTS")==0):0; @@ -642,7 +642,7 @@ static void cleanThread(void *param) // I hope in 10 secons all logged-in contacts will be listed if ( WaitForSingleObject(g_hShutdownEvent, 10000) == WAIT_TIMEOUT) { - for (HANDLE hContact = db_find_first(szProto); hContact; hContact = db_find_next(hContact, szProto)) { + for (HCONTACT hContact = db_find_first(szProto); hContact; hContact = db_find_next(hContact, szProto)) { WORD oldStatus = db_get_w(hContact,S_MOD,"StatusTriger",ID_STATUS_OFFLINE) | 0x8000; if (oldStatus > ID_STATUS_OFFLINE) { if (db_get_w(hContact, szProto, "Status", ID_STATUS_OFFLINE)==ID_STATUS_OFFLINE){ @@ -711,7 +711,7 @@ int ModeChange(WPARAM wparam,LPARAM lparam) return 0; } -short int isDbZero(HANDLE hContact, const char *module_name, const char *setting_name) +short int isDbZero(HCONTACT hContact, const char *module_name, const char *setting_name) { DBVARIANT dbv; if ( !db_get(hContact, module_name, setting_name, &dbv)) { @@ -729,7 +729,7 @@ short int isDbZero(HANDLE hContact, const char *module_name, const char *setting return -1; } -TCHAR *any_to_IdleNotidleUnknown(HANDLE hContact, const char *module_name, const char *setting_name, TCHAR *buff, int bufflen) { +TCHAR *any_to_IdleNotidleUnknown(HCONTACT hContact, const char *module_name, const char *setting_name, TCHAR *buff, int bufflen) { short int r = isDbZero(hContact, module_name, setting_name); if (r==-1){ _tcsncpy(buff, TranslateT("Unknown"), bufflen); @@ -740,7 +740,7 @@ TCHAR *any_to_IdleNotidleUnknown(HANDLE hContact, const char *module_name, const return buff; } -TCHAR *any_to_Idle(HANDLE hContact, const char *module_name, const char *setting_name, TCHAR *buff, int bufflen) { +TCHAR *any_to_Idle(HCONTACT hContact, const char *module_name, const char *setting_name, TCHAR *buff, int bufflen) { if (isDbZero(hContact, module_name, setting_name)==0) { //DB setting is NOT zero and exists buff[0] = L'/'; _tcsncpy(&buff[1], TranslateT("Idle"), bufflen-1); -- cgit v1.2.3