diff options
author | George Hazan <george.hazan@gmail.com> | 2013-02-11 12:15:06 +0000 |
---|---|---|
committer | George Hazan <george.hazan@gmail.com> | 2013-02-11 12:15:06 +0000 |
commit | b93e076795f7998aef8a63f7602998cdc6632a80 (patch) | |
tree | 117b7d8cbbb83f34328c4469d4f1f64cf825e44e /src/core/stdmsg | |
parent | 433cefc1e5c20517728904a925f0f45381e86939 (diff) |
core: copyright update to year 2013
git-svn-id: http://svn.miranda-ng.org/main/trunk@3549 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'src/core/stdmsg')
-rw-r--r-- | src/core/stdmsg/src/cmdlist.cpp | 28 | ||||
-rw-r--r-- | src/core/stdmsg/src/cmdlist.h | 16 | ||||
-rw-r--r-- | src/core/stdmsg/src/commonheaders.h | 5 | ||||
-rw-r--r-- | src/core/stdmsg/src/globals.cpp | 25 | ||||
-rw-r--r-- | src/core/stdmsg/src/globals.h | 6 | ||||
-rw-r--r-- | src/core/stdmsg/src/msgdialog.cpp | 83 | ||||
-rw-r--r-- | src/core/stdmsg/src/msglog.cpp | 40 | ||||
-rw-r--r-- | src/core/stdmsg/src/msgoptions.cpp | 8 | ||||
-rw-r--r-- | src/core/stdmsg/src/msgs.cpp | 34 | ||||
-rw-r--r-- | src/core/stdmsg/src/msgs.h | 6 | ||||
-rw-r--r-- | src/core/stdmsg/src/msgtimedout.cpp | 16 | ||||
-rw-r--r-- | src/core/stdmsg/src/richutil.cpp | 60 | ||||
-rw-r--r-- | src/core/stdmsg/src/richutil.h | 6 | ||||
-rw-r--r-- | src/core/stdmsg/src/srmm.cpp | 3 | ||||
-rw-r--r-- | src/core/stdmsg/src/statusicon.cpp | 8 | ||||
-rw-r--r-- | src/core/stdmsg/src/stdafx.cpp | 3 |
16 files changed, 185 insertions, 162 deletions
diff --git a/src/core/stdmsg/src/cmdlist.cpp b/src/core/stdmsg/src/cmdlist.cpp index 91d082fc74..f394a30e57 100644 --- a/src/core/stdmsg/src/cmdlist.cpp +++ b/src/core/stdmsg/src/cmdlist.cpp @@ -1,6 +1,7 @@ /*
-Copyright 2000-2010 Miranda IM project,
-all portions of this codebase are copyrighted to the people
+
+Copyright 2000-12 Miranda IM, 2012-13 Miranda NG project,
+all portions of this codebase are copyrighted to the people
listed in contributors.txt.
This program is free software; you can redistribute it and/or
@@ -17,12 +18,13 @@ You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/
+
#include "commonheaders.h"
int tcmdlist_append(SortedList *list, TCHAR *data)
{
TCmdList *new_list;
-
+
if (!data)
return list->realCount - 1;
@@ -42,12 +44,12 @@ int tcmdlist_append(SortedList *list, TCHAR *data) return list->realCount - 1;
}
-void tcmdlist_free(SortedList *list)
+void tcmdlist_free(SortedList *list)
{
int i;
TCmdList** n = (TCmdList**)list->items;
- for (i = 0; i < list->realCount; ++i)
+ for (i = 0; i < list->realCount; ++i)
{
mir_free(n[i]->szCmd);
mir_free(n[i]);
@@ -66,10 +68,10 @@ static VOID CALLBACK MsgTimer(HWND hwnd, UINT uMsg, UINT_PTR idEvent, DWORD dwTi {
int i, ntl = 0;
TMsgQueue **tmlst = NULL;
-
+
EnterCriticalSection(&csMsgQueue);
- for (i = 0; i < msgQueue.realCount; ++i)
+ for (i = 0; i < msgQueue.realCount; ++i)
{
TMsgQueue *item = (TMsgQueue*)msgQueue.items[i];
if (dwTime - item->ts > g_dat->msgTimeout)
@@ -83,7 +85,7 @@ static VOID CALLBACK MsgTimer(HWND hwnd, UINT uMsg, UINT_PTR idEvent, DWORD dwTi }
LeaveCriticalSection(&csMsgQueue);
- for (i = 0; i < ntl; ++i)
+ for (i = 0; i < ntl; ++i)
MessageFailureProcess(tmlst[i], LPGEN("The message send timed out."));
}
@@ -108,10 +110,10 @@ void msgQueue_processack(HANDLE hContact, HANDLE id, BOOL success, const char* s {
int i;
TMsgQueue* item = NULL;;
-
+
EnterCriticalSection(&csMsgQueue);
- for (i = 0; i < msgQueue.realCount; ++i)
+ for (i = 0; i < msgQueue.realCount; ++i)
{
item = (TMsgQueue*)msgQueue.items[i];
if (item->hContact == hContact && item->id == id)
@@ -128,7 +130,7 @@ void msgQueue_processack(HANDLE hContact, HANDLE id, BOOL success, const char* s item = NULL;
}
LeaveCriticalSection(&csMsgQueue);
-
+
if (item)
{
if (success)
@@ -149,10 +151,10 @@ void msgQueue_init(void) void msgQueue_destroy(void)
{
int i;
-
+
EnterCriticalSection(&csMsgQueue);
- for (i = 0; i < msgQueue.realCount; ++i)
+ for (i = 0; i < msgQueue.realCount; ++i)
{
TMsgQueue* item = (TMsgQueue*)msgQueue.items[i];
mir_free(item->szMsg);
diff --git a/src/core/stdmsg/src/cmdlist.h b/src/core/stdmsg/src/cmdlist.h index add3d4987b..5311ebd13c 100644 --- a/src/core/stdmsg/src/cmdlist.h +++ b/src/core/stdmsg/src/cmdlist.h @@ -1,6 +1,7 @@ /*
-Copyright 2000-2010 Miranda IM project,
-all portions of this codebase are copyrighted to the people
+
+Copyright 2000-12 Miranda IM, 2012-13 Miranda NG project,
+all portions of this codebase are copyrighted to the people
listed in contributors.txt.
This program is free software; you can redistribute it and/or
@@ -17,30 +18,31 @@ You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/
+
#ifndef SRMM_CMDLIST_H
#define SRMM_CMDLIST_H
-typedef struct _TCmdList
+typedef struct _TCmdList
{
TCHAR *szCmd;
-}
+}
TCmdList;
int tcmdlist_append(SortedList *list, TCHAR *data);
void tcmdlist_free(SortedList *list);
-__inline TCHAR* tcmdlist_getitem(SortedList *list, int ind)
+__inline TCHAR* tcmdlist_getitem(SortedList *list, int ind)
{ return ((TCmdList*)list->items[ind])->szCmd; }
-typedef struct _TMsgQueue
+typedef struct _TMsgQueue
{
HANDLE id;
HANDLE hContact;
TCHAR* szMsg;
HANDLE hDbEvent;
unsigned ts;
-}
+}
TMsgQueue;
void msgQueue_add(HANDLE hContact, HANDLE id, const TCHAR* szMsg, HANDLE hDbEvent);
diff --git a/src/core/stdmsg/src/commonheaders.h b/src/core/stdmsg/src/commonheaders.h index 5ab3a6985d..31e72d7ff1 100644 --- a/src/core/stdmsg/src/commonheaders.h +++ b/src/core/stdmsg/src/commonheaders.h @@ -1,5 +1,6 @@ /*
-Copyright 2000-2012 Miranda IM project,
+
+Copyright 2000-12 Miranda IM, 2012-13 Miranda NG project,
all portions of this codebase are copyrighted to the people
listed in contributors.txt.
@@ -18,8 +19,6 @@ along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/
-#define MIRANDA_VER 0x0A00
-
#define _WIN32_WINNT 0x0501
#define _WIN32_IE 0x0501
diff --git a/src/core/stdmsg/src/globals.cpp b/src/core/stdmsg/src/globals.cpp index 52e69a8860..6d32aedc08 100644 --- a/src/core/stdmsg/src/globals.cpp +++ b/src/core/stdmsg/src/globals.cpp @@ -1,6 +1,7 @@ /*
-Copyright 2000-2012 Miranda /IM project,
-all portions of this codebase are copyrighted to the people
+
+Copyright 2000-12 Miranda IM, 2012-13 Miranda NG project,
+all portions of this codebase are copyrighted to the people
listed in contributors.txt.
This program is free software; you can redistribute it and/or
@@ -17,6 +18,7 @@ You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/
+
#include "commonheaders.h"
struct GlobalMessageData *g_dat;
@@ -26,7 +28,7 @@ static int dbaddedevent(WPARAM wParam, LPARAM lParam); static int ackevent(WPARAM wParam, LPARAM lParam);
static int AvatarChanged(WPARAM wParam, LPARAM lParam);
-IconItem iconList[] =
+IconItem iconList[] =
{
{ LPGEN("Incoming message (10x10)"), "INCOMING", IDI_INCOMING, 10 },
{ LPGEN("Outgoing message (10x10)"), "OUTGOING", IDI_OUTGOING, 10 },
@@ -42,7 +44,7 @@ static int IconsChanged(WPARAM wParam, LPARAM lParam) {
FreeMsgLogIcons();
LoadMsgLogIcons();
-
+
return 0;
}
@@ -64,7 +66,7 @@ void FreeGlobals() int i;
mir_free(g_dat);
- for (i=0; i < SIZEOF(g_hooks); ++i)
+ for (i=0; i < SIZEOF(g_hooks); ++i)
if (g_hooks[i])
UnhookEvent(g_hooks[i]);
}
@@ -100,9 +102,9 @@ void ReloadGlobals() g_dat->flags |= SMF_HIDENAMES;
if (db_get_b(NULL, SRMMMOD, SRMSGSET_CHARCOUNT, SRMSGDEFSET_CHARCOUNT))
g_dat->flags |= SMF_SHOWREADCHAR;
- if (db_get_b(NULL, SRMMMOD, SRMSGSET_SENDONENTER, SRMSGDEFSET_SENDONENTER))
+ if (db_get_b(NULL, SRMMMOD, SRMSGSET_SENDONENTER, SRMSGDEFSET_SENDONENTER))
g_dat->flags |= SMF_SENDONENTER;
- if (db_get_b(NULL, SRMMMOD, SRMSGSET_SENDONDBLENTER, SRMSGDEFSET_SENDONDBLENTER))
+ if (db_get_b(NULL, SRMMMOD, SRMSGSET_SENDONDBLENTER, SRMSGDEFSET_SENDONDBLENTER))
g_dat->flags |= SMF_SENDONDBLENTER;
if (db_get_b(NULL, SRMMMOD, SRMSGSET_AUTOCLOSE, SRMSGDEFSET_AUTOCLOSE))
g_dat->flags |= SMF_AUTOCLOSE;
@@ -125,7 +127,7 @@ void ReloadGlobals() static int dbaddedevent(WPARAM wParam, LPARAM lParam)
{
HANDLE hContact = (HANDLE)wParam;
- if (hContact)
+ if (hContact)
{
HWND h = WindowList_Find(g_dat->hMessageWindowList, hContact);
if (h) SendMessage(h, HM_DBEVENTADDED, (WPARAM)hContact, lParam);
@@ -136,13 +138,13 @@ static int dbaddedevent(WPARAM wParam, LPARAM lParam) static int ackevent(WPARAM wParam, LPARAM lParam)
{
ACKDATA *pAck = (ACKDATA *)lParam;
-
+
if (!pAck) return 0;
- if (pAck->type == ACKTYPE_MESSAGE)
+ if (pAck->type == ACKTYPE_MESSAGE)
{
msgQueue_processack(pAck->hContact, pAck->hProcess, pAck->result == ACKRESULT_SUCCESS, (char*)pAck->lParam);
- if (pAck->result == ACKRESULT_SUCCESS)
+ if (pAck->result == ACKRESULT_SUCCESS)
SkinPlaySound("SendMsg");
}
return 0;
@@ -155,4 +157,3 @@ int AvatarChanged(WPARAM wParam, LPARAM lParam) if (h) SendMessage(h, HM_AVATARACK, wParam, lParam);
return 0;
}
-
diff --git a/src/core/stdmsg/src/globals.h b/src/core/stdmsg/src/globals.h index 05ae138f7d..03574f1ed3 100644 --- a/src/core/stdmsg/src/globals.h +++ b/src/core/stdmsg/src/globals.h @@ -1,6 +1,7 @@ /*
-Copyright 2000-2012 Miranda IM project,
-all portions of this codebase are copyrighted to the people
+
+Copyright 2000-12 Miranda IM, 2012-13 Miranda NG project,
+all portions of this codebase are copyrighted to the people
listed in contributors.txt.
This program is free software; you can redistribute it and/or
@@ -17,6 +18,7 @@ You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/
+
#ifndef SRMM_GLOBALS_H
#define SRMM_GLOBALS_H
diff --git a/src/core/stdmsg/src/msgdialog.cpp b/src/core/stdmsg/src/msgdialog.cpp index 22bd5b46e8..dcb83e9f35 100644 --- a/src/core/stdmsg/src/msgdialog.cpp +++ b/src/core/stdmsg/src/msgdialog.cpp @@ -1,5 +1,6 @@ /*
-Copyright 2000-2012 Miranda IM project,
+
+Copyright 2000-12 Miranda IM, 2012-13 Miranda NG project,
all portions of this codebase are copyrighted to the people
listed in contributors.txt.
@@ -168,7 +169,7 @@ static void AddToFileList(TCHAR ***pppFiles,int *totalCount,const TCHAR* szFilen if ( !_tcscmp(fd.cFileName,_T(".")) || !_tcscmp(fd.cFileName,_T(".."))) continue;
mir_sntprintf(szPath, SIZEOF(szPath), _T("%s\\%s"), szFilename, fd.cFileName);
AddToFileList(pppFiles,totalCount,szPath);
- }
+ }
while( FindNextFile( hFind,&fd ));
FindClose( hFind );
} } }
@@ -187,7 +188,7 @@ static void UpdateReadChars(HWND hwndDlg, HWND hwndStatus) mir_sntprintf(buf, SIZEOF(buf), _T("%d"), len);
SendMessage(hwndStatus, SB_SETTEXT, 1, (LPARAM) buf);
- }
+ }
}
static void ShowTime(struct SrmmWindowData *dat)
@@ -197,13 +198,13 @@ static void ShowTime(struct SrmmWindowData *dat) GetSystemTime(&st);
if (dat->wMinute != st.wMinute) {
TCHAR buf[32];
- unsigned i = (g_dat->flags & SMF_SHOWREADCHAR) ? 2 : 1;
+ unsigned i = (g_dat->flags & SMF_SHOWREADCHAR) ? 2 : 1;
tmi.printDateTime(dat->hTimeZone, _T("t"), buf, SIZEOF(buf), 0);
SendMessage(dat->hwndStatus, SB_SETTEXT, i, (LPARAM) buf);
dat->wMinute = st.wMinute;
}
- }
+ }
}
static void SetupStatusBar(HWND hwndDlg, struct SrmmWindowData *dat)
@@ -216,11 +217,11 @@ static void SetupStatusBar(HWND hwndDlg, struct SrmmWindowData *dat) cx = rc.right - rc.left;
if (dat->hTimeZone) {
- if (g_dat->flags & SMF_SHOWREADCHAR)
+ if (g_dat->flags & SMF_SHOWREADCHAR)
statwidths[i++] = cx - SB_TIME_WIDTH - SB_CHAR_WIDTH - icons_width;
statwidths[i++] = cx - SB_TIME_WIDTH - icons_width;
}
- else if (g_dat->flags & SMF_SHOWREADCHAR)
+ else if (g_dat->flags & SMF_SHOWREADCHAR)
statwidths[i++] = cx - SB_CHAR_WIDTH - icons_width;
statwidths[i++] = cx - icons_width;
@@ -314,7 +315,7 @@ static LRESULT CALLBACK MessageEditSubclassProc(HWND hwnd, UINT msg, WPARAM wPar case WM_KEYDOWN:
if (wParam == VK_RETURN) {
- if ( !(GetKeyState(VK_SHIFT) & 0x8000) &&
+ if ( !(GetKeyState(VK_SHIFT) & 0x8000) &&
((GetKeyState(VK_CONTROL) & 0x8000) != 0) != ((g_dat->flags & SMF_SENDONENTER) != 0)) {
PostMessage(GetParent(hwnd), WM_COMMAND, IDOK, 0);
return 0;
@@ -330,7 +331,7 @@ static LRESULT CALLBACK MessageEditSubclassProc(HWND hwnd, UINT msg, WPARAM wPar }
}
}
- else dat->lastEnterTime = 0;
+ else dat->lastEnterTime = 0;
if (((wParam == VK_INSERT && (GetKeyState(VK_SHIFT) & 0x8000)) || (wParam == 'V' && (GetKeyState(VK_CONTROL) & 0x8000))) &&
!(GetKeyState(VK_MENU) & 0x8000)) { // ctrl-v (paste clean text)
@@ -338,7 +339,7 @@ static LRESULT CALLBACK MessageEditSubclassProc(HWND hwnd, UINT msg, WPARAM wPar return 0;
}
- if (wParam == VK_UP && (GetKeyState(VK_CONTROL) & 0x8000) &&
+ if (wParam == VK_UP && (GetKeyState(VK_CONTROL) & 0x8000) &&
((g_dat->flags & (SMF_AUTOCLOSE | SMF_CTRLSUPPORT)) == SMF_CTRLSUPPORT)) {
if (pdat->cmdList->realCount) {
if (pdat->cmdListInd < 0) {
@@ -353,8 +354,8 @@ static LRESULT CALLBACK MessageEditSubclassProc(HWND hwnd, UINT msg, WPARAM wPar UpdateReadChars(GetParent(hwnd), pdat->hwndStatus);
return 0;
}
-
- if (wParam == VK_DOWN && (GetKeyState(VK_CONTROL) & 0x8000) &&
+
+ if (wParam == VK_DOWN && (GetKeyState(VK_CONTROL) & 0x8000) &&
((g_dat->flags & (SMF_AUTOCLOSE | SMF_CTRLSUPPORT)) == SMF_CTRLSUPPORT)) {
if (pdat->cmdList->realCount && pdat->cmdListInd >= 0) {
if (pdat->cmdListInd < (pdat->cmdList->realCount - 1))
@@ -362,7 +363,7 @@ static LRESULT CALLBACK MessageEditSubclassProc(HWND hwnd, UINT msg, WPARAM wPar else {
pdat->cmdListInd = -1;
SetEditorText(hwnd, tcmdlist_getitem(pdat->cmdList, pdat->cmdList->realCount - 1));
- }
+ }
}
EnableWindow(GetDlgItem(GetParent(hwnd), IDOK), GetWindowTextLength(hwnd) != 0);
@@ -386,7 +387,7 @@ static LRESULT CALLBACK MessageEditSubclassProc(HWND hwnd, UINT msg, WPARAM wPar }
break;
- case WM_CONTEXTMENU:
+ case WM_CONTEXTMENU:
{
HMENU hMenu;
CHARRANGE sel;
@@ -410,7 +411,7 @@ static LRESULT CALLBACK MessageEditSubclassProc(HWND hwnd, UINT msg, WPARAM wPar EnableMenuItem(mwpd.hMenu, IDM_COPY, MF_BYCOMMAND | MF_GRAYED);
EnableMenuItem(mwpd.hMenu, IDM_DELETE, MF_BYCOMMAND | MF_GRAYED);
}
- if ( !SendMessage(hwnd, EM_CANUNDO, 0, 0))
+ if ( !SendMessage(hwnd, EM_CANUNDO, 0, 0))
EnableMenuItem(mwpd.hMenu, IDM_UNDO, MF_BYCOMMAND | MF_GRAYED);
if ( !SendMessage(hwnd, EM_CANREDO, 0, 0))
@@ -820,7 +821,7 @@ INT_PTR CALLBACK DlgProcMessage(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lP else
CallService(MS_DB_EVENT_GET, (WPARAM) dat->hDbEventFirst, (LPARAM) & dbei);
firstTime = dbei.timestamp - 60 * DBGetContactSettingWord(NULL, SRMMMOD, SRMSGSET_LOADTIME, SRMSGDEFSET_LOADTIME);
- for (;;)
+ for (;;)
{
if (dat->hDbEventFirst == NULL)
hPrevEvent = (HANDLE) CallService(MS_DB_EVENT_FINDLAST, (WPARAM) dat->hContact, 0);
@@ -835,8 +836,8 @@ INT_PTR CALLBACK DlgProcMessage(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lP dat->hDbEventFirst = hPrevEvent;
}
break;
- }
- }
+ }
+ }
}
{
@@ -845,7 +846,7 @@ INT_PTR CALLBACK DlgProcMessage(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lP dbei.cbSize = sizeof(dbei);
hdbEvent = (HANDLE) CallService(MS_DB_EVENT_FINDLAST, (WPARAM) dat->hContact, 0);
- if (hdbEvent)
+ if (hdbEvent)
{
do {
ZeroMemory(&dbei, sizeof(dbei));
@@ -858,7 +859,7 @@ INT_PTR CALLBACK DlgProcMessage(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lP }
}
while (hdbEvent = (HANDLE) CallService(MS_DB_EVENT_FINDPREV, (WPARAM) hdbEvent, 0));
- }
+ }
}
SendMessage(hwndDlg, DM_OPTIONSAPPLIED, 1, 0);
@@ -1094,9 +1095,9 @@ INT_PTR CALLBACK DlgProcMessage(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lP { // avatar stuff
dat->avatarPic = NULL;
dat->limitAvatarH = 0;
- if (CallProtoService(dat->szProto, PS_GETCAPS, PFLAGNUM_4, 0) & PF4_AVATARS)
+ if (CallProtoService(dat->szProto, PS_GETCAPS, PFLAGNUM_4, 0) & PF4_AVATARS)
{
- dat->limitAvatarH = db_get_b(NULL, SRMMMOD, SRMSGSET_LIMITAVHEIGHT, SRMSGDEFSET_LIMITAVHEIGHT) ?
+ dat->limitAvatarH = db_get_b(NULL, SRMMMOD, SRMSGSET_LIMITAVHEIGHT, SRMSGDEFSET_LIMITAVHEIGHT) ?
DBGetContactSettingDword(NULL, SRMMMOD, SRMSGSET_AVHEIGHT, SRMSGDEFSET_AVHEIGHT) : 0;
}
if ( !wParam) SendMessage(hwndDlg, DM_GETAVATAR, 0, 0);
@@ -1105,7 +1106,7 @@ INT_PTR CALLBACK DlgProcMessage(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lP {
HFONT hFont;
LOGFONT lf;
- CHARFORMAT cf = {0};
+ CHARFORMAT cf = {0};
hFont = (HFONT) SendDlgItemMessage(hwndDlg, IDC_MESSAGE, WM_GETFONT, 0, 0);
if (hFont != NULL && hFont != (HFONT) SendDlgItemMessage(hwndDlg, IDOK, WM_GETFONT, 0, 0))
DeleteObject(hFont);
@@ -1169,7 +1170,7 @@ INT_PTR CALLBACK DlgProcMessage(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lP case CNFT_DWORD:
mir_sntprintf(buf, SIZEOF(buf), _T("%u"), ci.dVal);
break;
- }
+ }
}
}
if (buf[0])
@@ -1190,7 +1191,7 @@ INT_PTR CALLBACK DlgProcMessage(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lP }
// log
- if ((dat->wStatus != dat->wOldStatus || lParam != 0) &&
+ if ((dat->wStatus != dat->wOldStatus || lParam != 0) &&
db_get_b(NULL, SRMMMOD, SRMSGSET_SHOWSTATUSCH, SRMSGDEFSET_SHOWSTATUSCH)) {
DBEVENTINFO dbei;
TCHAR buffer[200];
@@ -1408,7 +1409,7 @@ INT_PTR CALLBACK DlgProcMessage(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lP if ((dbei.eventType == EVENTTYPE_MESSAGE || DbEventIsForMsgWindow(&dbei)) && !(dbei.flags & DBEF_SENT)) {
if (GetForegroundWindow() == hwndDlg)
SkinPlaySound("RecvMsgActive");
- else
+ else
SkinPlaySound("RecvMsgInactive");
}
if (( dbei.eventType == EVENTTYPE_MESSAGE || DbEventIsForMsgWindow(&dbei)) && dat->hwndStatus && !(dbei.flags & DBEF_SENT)) {
@@ -1434,7 +1435,7 @@ INT_PTR CALLBACK DlgProcMessage(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lP }
else SetTimer(hwndDlg, TIMERID_FLASHWND, TIMEOUT_FLASHWND, NULL);
}
- }
+ }
}
break;
@@ -1488,8 +1489,8 @@ INT_PTR CALLBACK DlgProcMessage(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lP Skin_ReleaseIcon(hIcon);
}
dat->showTyping = 1;
- }
- }
+ }
+ }
}
break;
@@ -1530,7 +1531,7 @@ INT_PTR CALLBACK DlgProcMessage(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lP Skin_ReleaseIcon(hIcon);
return TRUE;
- }
+ }
}
}
else if (dis->CtlID == IDC_AVATAR && dat->avatarPic && (g_dat->flags & SMF_AVATAR)) {
@@ -1547,7 +1548,7 @@ INT_PTR CALLBACK DlgProcMessage(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lP HBITMAP hbmMem = (HBITMAP)SelectObject(hdcMem, dat->avatarPic);
SetStretchBltMode(dis->hDC, HALFTONE);
- StretchBlt(dis->hDC, 1, 1, dat->avatarWidth-2, dat->avatarHeight-2, hdcMem, 0, 0,
+ StretchBlt(dis->hDC, 1, 1, dat->avatarWidth-2, dat->avatarHeight-2, hdcMem, 0, 0,
bminfo.bmWidth, bminfo.bmHeight, SRCCOPY);
SelectObject(hdcMem,hbmMem);
@@ -1651,7 +1652,7 @@ INT_PTR CALLBACK DlgProcMessage(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lP }
else if (dat->nTypeMode == PROTOTYPE_SELFTYPING_ON)
NotifyTyping(dat, PROTOTYPE_SELFTYPING_OFF);
- }
+ }
}
break;
}
@@ -1667,7 +1668,7 @@ INT_PTR CALLBACK DlgProcMessage(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lP if (nm->pt.x >= rc.left)
CheckIconClick(dat->hContact, dat->hwndStatus, nm->pt, rc, 2, ((LPNMHDR) lParam)->code == NM_RCLICK ? MBCF_RIGHTBUTTON : 0);
return TRUE;
- }
+ }
}
switch (((LPNMHDR) lParam)->idFrom) {
@@ -1731,7 +1732,7 @@ INT_PTR CALLBACK DlgProcMessage(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lP DestroyMenu(hMenu);
SetWindowLongPtr(hwndDlg, DWLP_MSGRESULT, TRUE);
return TRUE;
- }
+ }
}
break;
@@ -1770,7 +1771,7 @@ INT_PTR CALLBACK DlgProcMessage(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lP memmove(tr.lpstrText + 7, tr.lpstrText, (tr.chrg.cpMax - tr.chrg.cpMin + 1) * sizeof(TCHAR));
memcpy(tr.lpstrText, _T("mailto:"), 7 * sizeof(TCHAR));
}
- if (((ENLINK *) lParam)->msg == WM_RBUTTONDOWN)
+ if (((ENLINK *) lParam)->msg == WM_RBUTTONDOWN)
{
HMENU hMenu, hSubMenu;
POINT pt;
@@ -1809,9 +1810,9 @@ INT_PTR CALLBACK DlgProcMessage(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lP SetFocus(GetDlgItem(hwndDlg, IDC_MESSAGE));
}
break;
- }
- }
- }
+ }
+ }
+ }
}
break;
@@ -1827,15 +1828,15 @@ INT_PTR CALLBACK DlgProcMessage(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lP if ( !dat) return 0;
NotifyLocalWinEvent(dat->hContact, hwndDlg, MSG_WINDOW_EVT_CLOSING);
//save string from the editor
- if(dat->hContact)
+ if(dat->hContact)
{
TCHAR* msg;
int len = GetWindowTextLength(GetDlgItem(hwndDlg, IDC_MESSAGE)) + 1;
msg = (TCHAR*)alloca(sizeof(TCHAR) * len);
GetDlgItemText(hwndDlg, IDC_MESSAGE, msg, len);
- if (msg[0])
+ if (msg[0])
DBWriteContactSettingTString(dat->hContact, SRMSGMOD, DBSAVEDMSG, msg);
- else
+ else
DBDeleteContactSetting(dat->hContact, SRMSGMOD, DBSAVEDMSG);
}
KillTimer(hwndDlg, TIMERID_TYPE);
diff --git a/src/core/stdmsg/src/msglog.cpp b/src/core/stdmsg/src/msglog.cpp index 89647cd226..96941ff722 100644 --- a/src/core/stdmsg/src/msglog.cpp +++ b/src/core/stdmsg/src/msglog.cpp @@ -1,6 +1,7 @@ /*
-Copyright 2000-2010 Miranda IM project,
-all portions of this codebase are copyrighted to the people
+
+Copyright 2000-12 Miranda IM, 2012-13 Miranda NG project,
+all portions of this codebase are copyrighted to the people
listed in contributors.txt.
This program is free software; you can redistribute it and/or
@@ -17,6 +18,7 @@ You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/
+
#include "commonheaders.h"
extern IconItem iconList[];
@@ -76,7 +78,7 @@ static int AppendToBufferWithRTF(char **buffer, int *cbBufferEnd, int *cbBufferA return 0;
lineLen = (int)_tcslen(line) * 9 + 8;
- if (*cbBufferEnd + lineLen > *cbBufferAlloced)
+ if (*cbBufferEnd + lineLen > *cbBufferAlloced)
{
cbBufferAlloced[0] += (lineLen + 1024 - lineLen % 1024);
*buffer = (char *) mir_realloc(*buffer, *cbBufferAlloced);
@@ -86,9 +88,9 @@ static int AppendToBufferWithRTF(char **buffer, int *cbBufferEnd, int *cbBufferA strcpy(d, "{\\uc1 ");
d += 6;
- for (; *line; line++, textCharsCount++)
+ for (; *line; line++, textCharsCount++)
{
- if (*line == '\r' && line[1] == '\n')
+ if (*line == '\r' && line[1] == '\n')
{
memcpy(d, "\\par ", 5);
line++;
@@ -98,12 +100,12 @@ static int AppendToBufferWithRTF(char **buffer, int *cbBufferEnd, int *cbBufferA memcpy(d, "\\par ", 5);
d += 5;
}
- else if (*line == '\t')
+ else if (*line == '\t')
{
memcpy(d, "\\tab ", 5);
d += 5;
}
- else if (*line == '\\' || *line == '{' || *line == '}')
+ else if (*line == '\\' || *line == '{' || *line == '}')
{
*d++ = '\\';
*d++ = (char) *line;
@@ -342,12 +344,12 @@ static char *CreateRTFFromDbEvent(struct SrmmWindowData *dat, HANDLE hContact, H CopyMemory(buffer + bufferEnd, pLogIconBmpBits[i], logIconBmpSize[i]);
bufferEnd += logIconBmpSize[i];
}
- if (g_dat->flags & SMF_SHOWTIME)
+ if (g_dat->flags & SMF_SHOWTIME)
{
- const TCHAR* szFormat;
+ const TCHAR* szFormat;
TCHAR str[64];
-
- if (g_dat->flags & SMF_SHOWSECS)
+
+ if (g_dat->flags & SMF_SHOWSECS)
szFormat = g_dat->flags & SMF_SHOWDATE ? _T("d s") : _T("s");
else
szFormat = g_dat->flags & SMF_SHOWDATE ? _T("d t") : _T("t");
@@ -386,7 +388,7 @@ static char *CreateRTFFromDbEvent(struct SrmmWindowData *dat, HANDLE hContact, H switch (dbei.eventType) {
default:
case EVENTTYPE_MESSAGE:
- {
+ {
TCHAR* msg = DbGetEventTextT( &dbei, CP_ACP );
AppendToBuffer(&buffer, &bufferEnd, &bufferAlloced, " %s ", SetToStyle(dbei.flags & DBEF_SENT ? MSGFONTID_MYMSG : MSGFONTID_YOURMSG));
AppendToBufferWithRTF(&buffer, &bufferEnd, &bufferAlloced, msg);
@@ -460,10 +462,10 @@ static DWORD CALLBACK LogStreamInEvents(DWORD_PTR dwCookie, LPBYTE pbBuff, LONG {
struct LogStreamData *dat = (struct LogStreamData *) dwCookie;
- if (dat->buffer == NULL)
+ if (dat->buffer == NULL)
{
dat->bufferOffset = 0;
- switch (dat->stage)
+ switch (dat->stage)
{
case STREAMSTAGE_HEADER:
dat->buffer = CreateRTFHeader(dat->dlgDat);
@@ -471,9 +473,9 @@ static DWORD CALLBACK LogStreamInEvents(DWORD_PTR dwCookie, LPBYTE pbBuff, LONG break;
case STREAMSTAGE_EVENTS:
- if (dat->eventsToInsert)
+ if (dat->eventsToInsert)
{
- do
+ do
{
dat->buffer = CreateRTFFromDbEvent(dat->dlgDat, dat->hContact, dat->hDbEvent, dat);
if (dat->buffer)
@@ -482,7 +484,7 @@ static DWORD CALLBACK LogStreamInEvents(DWORD_PTR dwCookie, LPBYTE pbBuff, LONG if (--dat->eventsToInsert == 0)
break;
} while (dat->buffer == NULL && dat->hDbEvent);
- if (dat->buffer)
+ if (dat->buffer)
{
dat->isEmpty = 0;
break;
@@ -503,7 +505,7 @@ static DWORD CALLBACK LogStreamInEvents(DWORD_PTR dwCookie, LPBYTE pbBuff, LONG *pcb = min(cb, dat->bufferLen - dat->bufferOffset);
CopyMemory(pbBuff, dat->buffer + dat->bufferOffset, *pcb);
dat->bufferOffset += *pcb;
- if (dat->bufferOffset == dat->bufferLen)
+ if (dat->bufferOffset == dat->bufferLen)
{
mir_free(dat->buffer);
dat->buffer = NULL;
@@ -546,7 +548,7 @@ void StreamInEvents(HWND hwndDlg, HANDLE hDbEventFirst, int count, int fAppend) if (!bottomScroll)
SendMessage(hwndLog, EM_GETSCROLLPOS, 0, (LPARAM) & scrollPos);
}
- if (fAppend)
+ if (fAppend)
{
sel.cpMin = sel.cpMax = -1;
SendMessage(hwndLog, EM_EXSETSEL, 0, (LPARAM) & sel);
diff --git a/src/core/stdmsg/src/msgoptions.cpp b/src/core/stdmsg/src/msgoptions.cpp index a0bcb29172..5d729ed3a9 100644 --- a/src/core/stdmsg/src/msgoptions.cpp +++ b/src/core/stdmsg/src/msgoptions.cpp @@ -1,5 +1,6 @@ /*
-Copyright 2000-2010 Miranda IM project,
+
+Copyright 2000-12 Miranda IM, 2012-13 Miranda NG project,
all portions of this codebase are copyrighted to the people
listed in contributors.txt.
@@ -17,6 +18,7 @@ You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/
+
#include "commonheaders.h"
#include "m_fontservice.h"
@@ -32,7 +34,7 @@ struct FontOptionsList BYTE defStyle;
char defSize;
}
-static const fontOptionsList[] =
+static const fontOptionsList[] =
{
{ LPGENT("Outgoing messages"), RGB(106, 106, 106), _T("Arial"), 0, -12},
{ LPGENT("Incoming messages"), RGB(0, 0, 0), _T("Arial"), 0, -12},
@@ -648,7 +650,7 @@ void InitOptions(void) void UnloadOptions(void)
{
int i;
- for (i=0; i < SIZEOF(oHooks); ++i)
+ for (i=0; i < SIZEOF(oHooks); ++i)
if (oHooks[i])
UnhookEvent(oHooks[i]);
}
diff --git a/src/core/stdmsg/src/msgs.cpp b/src/core/stdmsg/src/msgs.cpp index 66dbc0b8e0..249a60c6ca 100644 --- a/src/core/stdmsg/src/msgs.cpp +++ b/src/core/stdmsg/src/msgs.cpp @@ -1,5 +1,6 @@ /*
-Copyright 2000-2012 Miranda IM project,
+
+Copyright 2000-12 Miranda IM, 2012-13 Miranda NG project,
all portions of this codebase are copyrighted to the people
listed in contributors.txt.
@@ -17,6 +18,7 @@ You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/
+
#include "commonheaders.h"
#include "statusicon.h"
@@ -62,7 +64,7 @@ static int MessageEventAdded(WPARAM wParam, LPARAM lParam) CallServiceSync(MS_CLIST_REMOVEEVENT, wParam, (LPARAM) 1);
/* does a window for the contact exist? */
hwnd = WindowList_Find(g_dat->hMessageWindowList, (HANDLE) wParam);
- if (hwnd)
+ if (hwnd)
{
if (!db_get_b(NULL, SRMMMOD, SRMSGSET_DONOTSTEALFOCUS, SRMSGDEFSET_DONOTSTEALFOCUS))
{
@@ -75,7 +77,7 @@ static int MessageEventAdded(WPARAM wParam, LPARAM lParam) {
if (GetForegroundWindow() == hwnd)
SkinPlaySound("RecvMsgActive");
- else
+ else
SkinPlaySound("RecvMsgInactive");
}
return 0;
@@ -120,9 +122,9 @@ INT_PTR SendMessageCmd(HANDLE hContact, char* msg, int isWchar) if (!szProto || (!CallProtoService(szProto, PS_GETCAPS, PFLAGNUM_1, 0) & PF1_IMSEND))
return 1;
- if (hwnd = WindowList_Find(g_dat->hMessageWindowList, hContact))
+ if (hwnd = WindowList_Find(g_dat->hMessageWindowList, hContact))
{
- if (msg)
+ if (msg)
{
HWND hEdit;
hEdit = GetDlgItem(hwnd, IDC_MESSAGE);
@@ -136,7 +138,7 @@ INT_PTR SendMessageCmd(HANDLE hContact, char* msg, int isWchar) SetWindowPos(hwnd, HWND_TOP, 0, 0, 0, 0, SWP_NOMOVE | SWP_NOSIZE | SWP_SHOWWINDOW);
SetForegroundWindow(hwnd);
}
- else
+ else
{
struct NewMessageWindowLParam newData = { 0 };
newData.hContact = hContact;
@@ -259,22 +261,22 @@ static void RestoreUnreadMessageAlerts(void) cle.ptszTooltip = toolTip;
hContact = db_find_first();
- while (hContact)
+ while (hContact)
{
hDbEvent = (HANDLE) CallService(MS_DB_EVENT_FINDFIRSTUNREAD, (WPARAM) hContact, 0);
- while (hDbEvent)
+ while (hDbEvent)
{
autoPopup = 0;
dbei.cbBlob = 0;
CallService(MS_DB_EVENT_GET, (WPARAM) hDbEvent, (LPARAM) & dbei);
- if (!(dbei.flags & (DBEF_SENT | DBEF_READ)) && ( dbei.eventType == EVENTTYPE_MESSAGE || DbEventIsForMsgWindow(&dbei)))
+ if (!(dbei.flags & (DBEF_SENT | DBEF_READ)) && ( dbei.eventType == EVENTTYPE_MESSAGE || DbEventIsForMsgWindow(&dbei)))
{
windowAlreadyExists = WindowList_Find(g_dat->hMessageWindowList, hContact) != NULL;
if (windowAlreadyExists)
continue;
{
char *szProto = GetContactProto(hContact);
- if (szProto && (g_dat->openFlags & SRMMStatusToPf2(CallProtoService(szProto, PS_GETSTATUS, 0, 0))))
+ if (szProto && (g_dat->openFlags & SRMMStatusToPf2(CallProtoService(szProto, PS_GETSTATUS, 0, 0))))
{
autoPopup = 1;
}
@@ -286,7 +288,7 @@ static void RestoreUnreadMessageAlerts(void) newData.noActivate = db_get_b(NULL, SRMMMOD, SRMSGSET_DONOTSTEALFOCUS, SRMSGDEFSET_DONOTSTEALFOCUS);
CreateDialogParam(g_hInst, MAKEINTRESOURCE(IDD_MSG), NULL, DlgProcMessage, (LPARAM) & newData);
}
- else
+ else
{
cle.hContact = hContact;
cle.hDbEvent = hDbEvent;
@@ -341,8 +343,8 @@ int SplitmsgShutdown(void) DestroyCursor(hCurSplitNS);
DestroyCursor(hCurHyperlinkHand);
DestroyCursor(hCurSplitWE);
-
- for (i=0; i < SIZEOF(hHooks); ++i)
+
+ for (i=0; i < SIZEOF(hHooks); ++i)
if (hHooks[i])
UnhookEvent(hHooks[i]);
@@ -424,7 +426,7 @@ static INT_PTR GetWindowData(WPARAM wParam, LPARAM lParam) int LoadSendRecvMessageModule(void)
{
if (LoadLibraryA("riched20.dll") == NULL) {
- if (IDYES !=
+ if (IDYES !=
MessageBox(0,
TranslateT
("Miranda could not load the built-in message module, riched20.dll is missing. If you are using Windows 95 or WINE please make sure you have riched20.dll installed. Press 'Yes' to continue loading Miranda."),
@@ -457,13 +459,13 @@ int LoadSendRecvMessageModule(void) hHookWinEvt = CreateHookableEvent(ME_MSG_WINDOWEVENT);
hHookWinPopup = CreateHookableEvent(ME_MSG_WINDOWPOPUP);
-
+
SkinAddNewSoundEx("RecvMsgActive", LPGEN("Instant messages"), LPGEN("Incoming (Focused Window)"));
SkinAddNewSoundEx("RecvMsgInactive", LPGEN("Instant messages"), LPGEN("Incoming (Unfocused Window)"));
SkinAddNewSoundEx("AlertMsg", LPGEN("Instant messages"), LPGEN("Incoming (New Session)"));
SkinAddNewSoundEx("SendMsg", LPGEN("Instant messages"), LPGEN("Outgoing"));
SkinAddNewSoundEx("SendError", LPGEN("Instant messages"), LPGEN("Message send error"));
-
+
hCurSplitNS = LoadCursor(NULL, IDC_SIZENS);
hCurSplitWE = LoadCursor(NULL, IDC_SIZEWE);
hCurHyperlinkHand = LoadCursor(NULL, IDC_HAND);
diff --git a/src/core/stdmsg/src/msgs.h b/src/core/stdmsg/src/msgs.h index 4a02e67a32..1403172b2a 100644 --- a/src/core/stdmsg/src/msgs.h +++ b/src/core/stdmsg/src/msgs.h @@ -1,6 +1,7 @@ /*
-Copyright 2000-2012 Miranda IM project,
-all portions of this codebase are copyrighted to the people
+
+Copyright 2000-12 Miranda IM, 2012-13 Miranda NG project,
+all portions of this codebase are copyrighted to the people
listed in contributors.txt.
This program is free software; you can redistribute it and/or
@@ -17,6 +18,7 @@ You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/
+
#ifndef SRMM_MSGS_H
#define SRMM_MSGS_H
diff --git a/src/core/stdmsg/src/msgtimedout.cpp b/src/core/stdmsg/src/msgtimedout.cpp index b956faaf2a..86585c511a 100644 --- a/src/core/stdmsg/src/msgtimedout.cpp +++ b/src/core/stdmsg/src/msgtimedout.cpp @@ -1,6 +1,7 @@ /*
-Copyright 2000-2010 Miranda IM project,
-all portions of this codebase are copyrighted to the people
+
+Copyright 2000-12 Miranda IM, 2012-13 Miranda NG project,
+all portions of this codebase are copyrighted to the people
listed in contributors.txt.
This program is free software; you can redistribute it and/or
@@ -33,7 +34,7 @@ INT_PTR CALLBACK ErrorDlgProc(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lPar {
TMsgQueue *item = (TMsgQueue*)GetWindowLongPtr(hwndDlg, GWLP_USERDATA);
- switch (msg)
+ switch (msg)
{
case WM_INITDIALOG:
{
@@ -47,7 +48,7 @@ INT_PTR CALLBACK ErrorDlgProc(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lPar if (!param->szMsg || !param->szMsg[0])
SetDlgItemText(hwndDlg, IDC_ERRORTEXT, TranslateT("An unknown error has occured."));
- else
+ else
{
TCHAR* ptszError = (TCHAR*)CallService(MS_LANGPACK_PCHARTOTCHAR, 0, (LPARAM)param->szMsg);
SetDlgItemText(hwndDlg, IDC_ERRORTEXT, ptszError);
@@ -58,8 +59,8 @@ INT_PTR CALLBACK ErrorDlgProc(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lPar GetWindowRect(hwndDlg, &rc);
GetWindowRect(GetParent(hwndDlg), &rcParent);
- SetWindowPos(hwndDlg, 0, (rcParent.left + rcParent.right - (rc.right - rc.left)) / 2,
- (rcParent.top + rcParent.bottom - (rc.bottom - rc.top)) / 2,
+ SetWindowPos(hwndDlg, 0, (rcParent.left + rcParent.right - (rc.right - rc.left)) / 2,
+ (rcParent.top + rcParent.bottom - (rc.bottom - rc.top)) / 2,
0, 0, SWP_NOZORDER | SWP_NOSIZE);
}
return TRUE;
@@ -91,7 +92,7 @@ void MessageFailureProcess(TMsgQueue *item, const char* err) ErrorDlgParam param = { err, item };
CallService(MS_DB_EVENT_DELETE, (WPARAM)item->hContact, (LPARAM)item->hDbEvent);
-
+
hwnd = WindowList_Find(g_dat->hMessageWindowList, (HANDLE)item->hContact);
if (hwnd == NULL)
{
@@ -104,4 +105,3 @@ void MessageFailureProcess(TMsgQueue *item, const char* err) SkinPlaySound("SendError");
CreateDialogParam(g_hInst, MAKEINTRESOURCE(IDD_MSGSENDERROR), hwnd, ErrorDlgProc, (LPARAM) ¶m);
}
-
diff --git a/src/core/stdmsg/src/richutil.cpp b/src/core/stdmsg/src/richutil.cpp index 7f77c98fa8..c863395cd0 100644 --- a/src/core/stdmsg/src/richutil.cpp +++ b/src/core/stdmsg/src/richutil.cpp @@ -1,6 +1,7 @@ /*
-Copyright 2000-2010 Miranda IM project,
-all portions of this codebase are copyrighted to the people
+
+Copyright 2000-12 Miranda IM, 2012-13 Miranda NG project,
+all portions of this codebase are copyrighted to the people
listed in contributors.txt.
This program is free software; you can redistribute it and/or
@@ -17,6 +18,7 @@ You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/
+
#include "commonheaders.h"
#include "richutil.h"
@@ -25,12 +27,12 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. RichUtil_Load();
Before the application exits, call:
RichUtil_Unload();
-
+
Then to use the library (it draws the xp border around it), you need
- to make sure you control has the WS_EX_CLIENTEDGE flag. Then you just
+ to make sure you control has the WS_EX_CLIENTEDGE flag. Then you just
subclass it with:
RichUtil_SubClass(hwndEdit);
-
+
If no xptheme is present, the window isn't subclassed the SubClass function
just returns. And if WS_EX_CLIENTEDGE isn't present, the subclass does nothing.
Otherwise it removes the border and draws it by itself.
@@ -38,7 +40,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. static SortedList sListInt;
-static int RichUtil_CmpVal(void *p1, void *p2)
+static int RichUtil_CmpVal(void *p1, void *p2)
{
TRichUtil *tp1 = (TRichUtil*)p1;
TRichUtil *tp2 = (TRichUtil*)p2;
@@ -61,7 +63,7 @@ static CRITICAL_SECTION csRich; static LRESULT CALLBACK RichUtil_Proc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam);
static void RichUtil_ClearUglyBorder(TRichUtil *ru);
-void RichUtil_Load(void)
+void RichUtil_Load(void)
{
sListInt.increment = 10;
sListInt.sortFunc = RichUtil_CmpVal;
@@ -79,20 +81,20 @@ void RichUtil_Load(void) MyDrawThemeParentBackground = (HRESULT (WINAPI *)(HWND, HDC, RECT*))GetProcAddress(mTheme, "DrawThemeParentBackground");
MyIsThemeBackgroundPartiallyTransparent = (BOOL (WINAPI *)(HANDLE, int, int))GetProcAddress(mTheme, "IsThemeBackgroundPartiallyTransparent");
- if (!MyOpenThemeData ||
- !MyCloseThemeData ||
- !MyIsThemeActive ||
- !MyDrawThemeBackground ||
- !MyGetThemeBackgroundContentRect ||
- !MyDrawThemeParentBackground ||
- !MyIsThemeBackgroundPartiallyTransparent)
+ if (!MyOpenThemeData ||
+ !MyCloseThemeData ||
+ !MyIsThemeActive ||
+ !MyDrawThemeBackground ||
+ !MyGetThemeBackgroundContentRect ||
+ !MyDrawThemeParentBackground ||
+ !MyIsThemeBackgroundPartiallyTransparent)
{
FreeLibrary(mTheme);
mTheme = NULL;
}
}
-void RichUtil_Unload(void)
+void RichUtil_Unload(void)
{
List_Destroy(&sListInt);
DeleteCriticalSection(&csRich);
@@ -100,14 +102,14 @@ void RichUtil_Unload(void) FreeLibrary(mTheme);
}
-int RichUtil_SubClass(HWND hwndEdit)
+int RichUtil_SubClass(HWND hwndEdit)
{
- if (IsWindow(hwndEdit))
+ if (IsWindow(hwndEdit))
{
int idx;
TRichUtil *ru = (TRichUtil*)mir_calloc(sizeof(TRichUtil));
-
+
ru->hwnd = hwndEdit;
ru->hasUglyBorder = 0;
@@ -133,7 +135,7 @@ static LRESULT CALLBACK RichUtil_Proc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM if (ru == NULL) return 0;
- switch(msg)
+ switch(msg)
{
case WM_CHAR:
{
@@ -145,7 +147,7 @@ static LRESULT CALLBACK RichUtil_Proc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM }
break;
}
-
+
case WM_THEMECHANGED:
case WM_STYLECHANGED:
{
@@ -156,10 +158,10 @@ static LRESULT CALLBACK RichUtil_Proc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM case WM_NCPAINT:
{
LRESULT ret = CallWindowProc(ru->origProc, hwnd, msg, wParam, lParam);
- if (ru->hasUglyBorder && MyIsThemeActive())
+ if (ru->hasUglyBorder && MyIsThemeActive())
{
HANDLE hTheme = MyOpenThemeData(ru->hwnd, L"EDIT");
- if (hTheme)
+ if (hTheme)
{
RECT rcBorder;
RECT rcClient;
@@ -184,7 +186,7 @@ static LRESULT CALLBACK RichUtil_Proc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM nState = ETS_DISABLED;
else if (style & ES_READONLY)
nState = ETS_READONLY;
- else
+ else
nState = ETS_NORMAL;
MyDrawThemeBackground(hTheme, hdc, EP_EDITTEXT, nState, &rcBorder, NULL);
@@ -199,17 +201,17 @@ static LRESULT CALLBACK RichUtil_Proc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM {
LRESULT ret = CallWindowProc(ru->origProc, hwnd, msg, wParam, lParam);
NCCALCSIZE_PARAMS *ncsParam = (NCCALCSIZE_PARAMS*)lParam;
-
- if (ru->hasUglyBorder && MyIsThemeActive())
+
+ if (ru->hasUglyBorder && MyIsThemeActive())
{
HANDLE hTheme = MyOpenThemeData(hwnd, L"EDIT");
- if (hTheme)
+ if (hTheme)
{
- RECT rcClient ={0};
+ RECT rcClient ={0};
HDC hdc = GetDC(GetParent(hwnd));
- if (MyGetThemeBackgroundContentRect(hTheme, hdc, EP_EDITTEXT, ETS_NORMAL, &ncsParam->rgrc[0], &rcClient) == S_OK)
+ if (MyGetThemeBackgroundContentRect(hTheme, hdc, EP_EDITTEXT, ETS_NORMAL, &ncsParam->rgrc[0], &rcClient) == S_OK)
{
ru->rect.left = rcClient.left-ncsParam->rgrc[0].left;
ru->rect.top = rcClient.top-ncsParam->rgrc[0].top;
@@ -239,7 +241,7 @@ static LRESULT CALLBACK RichUtil_Proc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM {
LRESULT ret = CallWindowProc(ru->origProc, hwnd, msg, wParam, lParam);
- if (IsWindow(hwnd))
+ if (IsWindow(hwnd))
{
if ((WNDPROC)GetWindowLongPtr(hwnd, GWLP_WNDPROC) == &RichUtil_Proc)
SetWindowLongPtr(hwnd, GWLP_WNDPROC, (LONG_PTR)ru->origProc);
diff --git a/src/core/stdmsg/src/richutil.h b/src/core/stdmsg/src/richutil.h index 68e9f37c5b..ff90e14691 100644 --- a/src/core/stdmsg/src/richutil.h +++ b/src/core/stdmsg/src/richutil.h @@ -1,6 +1,7 @@ /*
-Copyright 2000-2010 Miranda IM project,
-all portions of this codebase are copyrighted to the people
+
+Copyright 2000-12 Miranda IM, 2012-13 Miranda NG project,
+all portions of this codebase are copyrighted to the people
listed in contributors.txt.
This program is free software; you can redistribute it and/or
@@ -17,6 +18,7 @@ You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/
+
#ifndef SRMM_RICHUTIL_H
#define SRMM_RICHUTIL_H
diff --git a/src/core/stdmsg/src/srmm.cpp b/src/core/stdmsg/src/srmm.cpp index 731231fad7..e1b6bc6ab5 100644 --- a/src/core/stdmsg/src/srmm.cpp +++ b/src/core/stdmsg/src/srmm.cpp @@ -1,5 +1,6 @@ /*
-Copyright 2000-2012 Miranda IM project,
+
+Copyright 2000-12 Miranda IM, 2012-13 Miranda NG project,
all portions of this codebase are copyrighted to the people
listed in contributors.txt.
diff --git a/src/core/stdmsg/src/statusicon.cpp b/src/core/stdmsg/src/statusicon.cpp index 0cb5a2b96e..59fe583c5e 100644 --- a/src/core/stdmsg/src/statusicon.cpp +++ b/src/core/stdmsg/src/statusicon.cpp @@ -1,6 +1,7 @@ /*
-Copyright 2000-2010 Miranda IM project,
-all portions of this codebase are copyrighted to the people
+
+Copyright 2000-12 Miranda IM, 2012-13 Miranda NG project,
+all portions of this codebase are copyrighted to the people
listed in contributors.txt.
This program is free software; you can redistribute it and/or
@@ -17,6 +18,7 @@ You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/
+
#include "commonheaders.h"
#include "statusicon.h"
@@ -170,7 +172,7 @@ void CheckIconClick(HANDLE hContact, HWND hwndFrom, POINT pt, RECT r, int gap, i sprintf(buff, "SRMMStatusIconFlags%d", current->sid.dwId);
flags = db_get_b(hContact, current->sid.szModule, buff, current->sid.flags);
if (!(flags & MBF_HIDDEN)) iconNum--;
- if(iconNum >= 0)
+ if(iconNum >= 0)
current = current->next;
}
diff --git a/src/core/stdmsg/src/stdafx.cpp b/src/core/stdmsg/src/stdafx.cpp index b985a910cd..838b101bd3 100644 --- a/src/core/stdmsg/src/stdafx.cpp +++ b/src/core/stdmsg/src/stdafx.cpp @@ -1,5 +1,6 @@ /*
-Copyright (C) 2012 Miranda NG team (http://miranda-ng.org)
+
+Copyright (C) 2012-13 Miranda NG team (http://miranda-ng.org)
This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License
|