summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKirill Volinsky <mataes2007@gmail.com>2012-06-23 21:06:11 +0000
committerKirill Volinsky <mataes2007@gmail.com>2012-06-23 21:06:11 +0000
commit5b3b0020dd6b3797a5808c7362e358df48bd4e49 (patch)
tree9ee3e4de8b8f04a8faf4186ae2e1f84c3ef21b17
parent449553a9543c7ecc601f74c4abccc07d13521b15 (diff)
Scriver:
plusified git-svn-id: http://svn.miranda-ng.org/main/trunk@591 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
-rw-r--r--plugins/Scriver/chat/clist.cpp2
-rw-r--r--plugins/Scriver/chat/colorchooser.cpp11
-rw-r--r--plugins/Scriver/chat/log.cpp6
-rw-r--r--plugins/Scriver/chat/main.cpp1
-rw-r--r--plugins/Scriver/chat/manager.cpp4
-rw-r--r--plugins/Scriver/chat/message.cpp2
-rw-r--r--plugins/Scriver/chat/options.cpp19
-rw-r--r--plugins/Scriver/chat/services.cpp3
-rw-r--r--plugins/Scriver/chat/tools.cpp7
-rw-r--r--plugins/Scriver/chat/window.cpp13
-rw-r--r--plugins/Scriver/cmdlist.cpp4
-rw-r--r--plugins/Scriver/commonheaders.h15
-rw-r--r--plugins/Scriver/globals.cpp3
-rw-r--r--plugins/Scriver/infobar.cpp11
-rw-r--r--plugins/Scriver/infobar.h4
-rw-r--r--plugins/Scriver/input.cpp5
-rw-r--r--plugins/Scriver/msgdialog.cpp51
-rw-r--r--plugins/Scriver/msglog.cpp21
-rw-r--r--plugins/Scriver/msgoptions.cpp3
-rw-r--r--plugins/Scriver/msgs.cpp197
-rw-r--r--plugins/Scriver/msgs.h23
-rw-r--r--plugins/Scriver/msgwindow.cpp13
-rw-r--r--plugins/Scriver/scriver_10.vcxproj50
-rw-r--r--plugins/Scriver/scriver_10.vcxproj.filters50
-rw-r--r--plugins/Scriver/sendqueue.cpp2
-rw-r--r--plugins/Scriver/srmm.cpp14
-rw-r--r--plugins/Scriver/utils.cpp7
-rw-r--r--plugins/Scriver/utils.h2
28 files changed, 232 insertions, 311 deletions
diff --git a/plugins/Scriver/chat/clist.cpp b/plugins/Scriver/chat/clist.cpp
index 971ddfbe03..6ccf34c252 100644
--- a/plugins/Scriver/chat/clist.cpp
+++ b/plugins/Scriver/chat/clist.cpp
@@ -22,8 +22,6 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
#include "../commonheaders.h"
#include "chat.h"
-extern HINSTANCE g_hInst;
-
extern HANDLE hJoinMenuItem, hLeaveMenuItem;
HANDLE CList_AddRoom(const char* pszModule, const TCHAR* pszRoom, const TCHAR* pszDisplayName, int iType)
diff --git a/plugins/Scriver/chat/colorchooser.cpp b/plugins/Scriver/chat/colorchooser.cpp
index c2c4d80bce..ad95d4cc89 100644
--- a/plugins/Scriver/chat/colorchooser.cpp
+++ b/plugins/Scriver/chat/colorchooser.cpp
@@ -25,12 +25,9 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
#include "chat.h"
#include <math.h>
-//globals, defined int main.cpp
-extern HINSTANCE g_hInst;
-
static int CalculateCoordinatesToButton(COLORCHOOSER * pCC, POINT pt)
{
- int iSquareRoot = (int)sqrt(pCC->pModule->nColorCount);
+ int iSquareRoot = (int)sqrt((double)pCC->pModule->nColorCount);
int nCols = iSquareRoot * iSquareRoot < pCC->pModule->nColorCount?iSquareRoot+1:iSquareRoot;
int col = pt.x / 25;
@@ -46,7 +43,7 @@ static int CalculateCoordinatesToButton(COLORCHOOSER * pCC, POINT pt)
static RECT CalculateButtonToCoordinates(COLORCHOOSER * pCC, int buttonPosition)
{
RECT pt;
- int iSquareRoot = (int)sqrt(pCC->pModule->nColorCount);
+ int iSquareRoot = (int)sqrt((double)pCC->pModule->nColorCount);
int nCols = iSquareRoot * iSquareRoot < pCC->pModule->nColorCount?iSquareRoot+1:iSquareRoot;
int row = buttonPosition / nCols;
@@ -83,7 +80,7 @@ INT_PTR CALLBACK DlgProcColorToolWindow(HWND hwndDlg, UINT msg, WPARAM wParam, L
iCurrentHotTrack = -2;
bChoosing = FALSE;
- iSquareRoot = (int)sqrt(pCC->pModule->nColorCount);
+ iSquareRoot = (int)sqrt((double)pCC->pModule->nColorCount);
iColumns = iSquareRoot * iSquareRoot == pCC->pModule->nColorCount?iSquareRoot:iSquareRoot+1;
iRows = iSquareRoot;
@@ -250,7 +247,7 @@ INT_PTR CALLBACK DlgProcColorToolWindow(HWND hwndDlg, UINT msg, WPARAM wParam, L
rc.bottom = iThisRow * 20- 3 + 20 ;
rc.right = iThisColumn * 25-3 ;
- FillRect(hdc, &rc, GetStockObject(BLACK_BRUSH));
+ FillRect(hdc, &rc, (HBRUSH)GetStockObject(BLACK_BRUSH));
hbr = CreateSolidBrush(pCC->pModule->crColors[i]);
diff --git a/plugins/Scriver/chat/log.cpp b/plugins/Scriver/chat/log.cpp
index 7fcae3f870..a7fc260fd1 100644
--- a/plugins/Scriver/chat/log.cpp
+++ b/plugins/Scriver/chat/log.cpp
@@ -950,7 +950,7 @@ void LoadMsgLogBitmaps(void)
for (i = 0; i < SIZEOF(pLogIconBmpBits); i++) {
hIcon = GetCachedIcon(logIconNames[i]);
pLogIconBmpBits[i] = (PBYTE) mir_alloc(RTFPICTHEADERMAXSIZE + (bih.biSize + widthBytes * bih.biHeight) * 2);
- rtfHeaderSize = sprintf(pLogIconBmpBits[i], "{\\pict\\dibitmap0\\wbmbitspixel%u\\wbmplanes1\\wbmwidthbytes%u\\picw%u\\pich%u ", bih.biBitCount, widthBytes, (unsigned int)bih.biWidth, (unsigned int)bih.biHeight);
+ rtfHeaderSize = sprintf((char *)pLogIconBmpBits[i], "{\\pict\\dibitmap0\\wbmbitspixel%u\\wbmplanes1\\wbmwidthbytes%u\\picw%u\\pich%u ", bih.biBitCount, widthBytes, (unsigned int)bih.biWidth, (unsigned int)bih.biHeight);
hoBmp = (HBITMAP) SelectObject(hdcMem, hBmp);
FillRect(hdcMem, &rc, hBkgBrush);
DrawIconEx(hdcMem, 0, 0, hIcon, bih.biWidth, bih.biHeight, 0, NULL, DI_NORMAL);
@@ -959,9 +959,9 @@ void LoadMsgLogBitmaps(void)
{
int n;
for (n = 0; n < sizeof(BITMAPINFOHEADER); n++)
- sprintf(pLogIconBmpBits[i] + rtfHeaderSize + n * 2, "%02X", ((PBYTE) & bih)[n]);
+ sprintf((char *)pLogIconBmpBits[i] + rtfHeaderSize + n * 2, "%02X", ((PBYTE) & bih)[n]);
for (n = 0; n < widthBytes * bih.biHeight; n += 4)
- sprintf(pLogIconBmpBits[i] + rtfHeaderSize + (bih.biSize + n) * 2, "%02X%02X%02X%02X", pBmpBits[n], pBmpBits[n + 1], pBmpBits[n + 2], pBmpBits[n + 3]);
+ sprintf((char *)pLogIconBmpBits[i] + rtfHeaderSize + (bih.biSize + n) * 2, "%02X%02X%02X%02X", pBmpBits[n], pBmpBits[n + 1], pBmpBits[n + 2], pBmpBits[n + 3]);
}
logIconBmpSize[i] = rtfHeaderSize + (bih.biSize + widthBytes * bih.biHeight) * 2 + 1;
pLogIconBmpBits[i][logIconBmpSize[i] - 1] = '}';
diff --git a/plugins/Scriver/chat/main.cpp b/plugins/Scriver/chat/main.cpp
index ff2d980427..4ff0eef47d 100644
--- a/plugins/Scriver/chat/main.cpp
+++ b/plugins/Scriver/chat/main.cpp
@@ -27,7 +27,6 @@ void RegisterChatFonts( void );
extern struct GlobalMessageData *g_dat;
extern CRITICAL_SECTION cs;
//globals
-HINSTANCE g_hInst;
HMENU g_hMenu = NULL;
HANDLE hJoinMenuItem, hLeaveMenuItem;
diff --git a/plugins/Scriver/chat/manager.cpp b/plugins/Scriver/chat/manager.cpp
index 061955af45..30bdfc80c7 100644
--- a/plugins/Scriver/chat/manager.cpp
+++ b/plugins/Scriver/chat/manager.cpp
@@ -767,7 +767,7 @@ char* SM_GetUsers(SESSION_INFO* si)
do {
int pLen = lstrlenA(p), nameLen = lstrlen(utemp->pszUID);
if ( pLen + nameLen + 2 > alloced )
- p = mir_realloc( p, alloced += 4096 );
+ p = (char *)mir_realloc( p, alloced += 4096 );
WideCharToMultiByte( CP_ACP, 0, utemp->pszUID, -1, p + pLen, nameLen+1, 0, 0 );
@@ -1230,7 +1230,7 @@ BOOL UM_SetStatusEx(USERINFO* pUserList, const TCHAR* pszText, int flags )
pTemp->iStatusEx = 0;
if ( pszText != NULL ) {
- TCHAR* s = _tcsstr( pszText, pTemp->pszUID );
+ TCHAR* s = (TCHAR *)_tcsstr( pszText, pTemp->pszUID );
if ( s ) {
pTemp->iStatusEx = 0;
if ( s == pszText || s[-1] == cDelimiter ) {
diff --git a/plugins/Scriver/chat/message.cpp b/plugins/Scriver/chat/message.cpp
index a6866941d2..7739e1acef 100644
--- a/plugins/Scriver/chat/message.cpp
+++ b/plugins/Scriver/chat/message.cpp
@@ -94,7 +94,7 @@ TCHAR* DoRtfToTags( char* pszText, SESSION_INFO* si)
// create an index of colors in the module and map them to
// corresponding colors in the RTF color table
- pIndex = mir_alloc(sizeof(int) * MM_FindModule(si->pszModule)->nColorCount);
+ pIndex = (int *)mir_alloc(sizeof(int) * MM_FindModule(si->pszModule)->nColorCount);
for(i = 0; i < MM_FindModule(si->pszModule)->nColorCount ; i++)
pIndex[i] = -1;
diff --git a/plugins/Scriver/chat/options.cpp b/plugins/Scriver/chat/options.cpp
index f030359ee6..29bb385db0 100644
--- a/plugins/Scriver/chat/options.cpp
+++ b/plugins/Scriver/chat/options.cpp
@@ -26,7 +26,6 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
#define UM_CHECKSTATECHANGE (WM_USER+100)
-extern HANDLE g_hInst;
extern HBRUSH hListBkgBrush;
extern HBRUSH hListSelectedBkgBrush;
extern FONTINFO aFonts[OPTIONS_FONTCOUNT];
@@ -340,7 +339,7 @@ INT_PTR CALLBACK DlgProcOptions1(HWND hwndDlg,UINT uMsg,WPARAM wParam,LPARAM lPa
iLen = GetWindowTextLength(GetDlgItem(hwndDlg, IDC_CHAT_GROUP));
if(iLen > 0)
{
- pszText = mir_realloc(pszText, iLen+1);
+ pszText = (char *)mir_realloc(pszText, iLen+1);
GetDlgItemTextA(hwndDlg, IDC_CHAT_GROUP, pszText,iLen+1);
DBWriteContactSettingString(NULL, "Chat", "AddToGroup", pszText);
}
@@ -499,8 +498,8 @@ BOOL CALLBACK DlgProcOptions2(HWND hwndDlg,UINT uMsg,WPARAM wParam,LPARAM lParam
CallService(MS_UTILS_PATHTORELATIVET, (WPARAM)tszDirectory, (LPARAM)tszTemp );
SetWindowText(GetDlgItem(hwndDlg, IDC_CHAT_LOGDIRECTORY), lstrlen(tszTemp) > 1?tszTemp:DEFLOGFILENAME);
}
- psMalloc->lpVtbl->Free(psMalloc,idList);
- psMalloc->lpVtbl->Release(psMalloc);
+ psMalloc->Free(idList);
+ psMalloc->Release();
}
break;
}
@@ -553,7 +552,7 @@ BOOL CALLBACK DlgProcOptions2(HWND hwndDlg,UINT uMsg,WPARAM wParam,LPARAM lParam
iLen = GetWindowTextLength(GetDlgItem(hwndDlg, IDC_CHAT_HIGHLIGHTWORDS));
if ( iLen > 0 ) {
- TCHAR *ptszText = mir_alloc((iLen+2) * sizeof(TCHAR));
+ TCHAR *ptszText = (TCHAR *)mir_alloc((iLen+2) * sizeof(TCHAR));
TCHAR *p2 = NULL;
if(ptszText) {
@@ -571,7 +570,7 @@ BOOL CALLBACK DlgProcOptions2(HWND hwndDlg,UINT uMsg,WPARAM wParam,LPARAM lParam
iLen = GetWindowTextLength(GetDlgItem(hwndDlg, IDC_CHAT_LOGDIRECTORY));
if ( iLen > 0 ) {
- TCHAR *pszText1 = malloc(iLen*sizeof(TCHAR) + 2);
+ TCHAR *pszText1 = (TCHAR *)malloc(iLen*sizeof(TCHAR) + 2);
GetDlgItemText(hwndDlg, IDC_CHAT_LOGDIRECTORY, pszText1, iLen + 1);
DBWriteContactSettingTString(NULL, "Chat", "LogDirectory", pszText1);
CallService(MS_UTILS_PATHTOABSOLUTET, (WPARAM)pszText1, (LPARAM)g_Settings.pszLogDir);
@@ -584,7 +583,7 @@ BOOL CALLBACK DlgProcOptions2(HWND hwndDlg,UINT uMsg,WPARAM wParam,LPARAM lParam
iLen = GetWindowTextLength(GetDlgItem(hwndDlg, IDC_CHAT_LOGTIMESTAMP));
if ( iLen > 0 ) {
- pszText = mir_realloc(pszText, iLen+1);
+ pszText = (char *)mir_realloc(pszText, iLen+1);
GetDlgItemTextA(hwndDlg, IDC_CHAT_LOGTIMESTAMP, pszText,iLen+1);
DBWriteContactSettingString(NULL, "Chat", "LogTimestamp", pszText);
}
@@ -592,7 +591,7 @@ BOOL CALLBACK DlgProcOptions2(HWND hwndDlg,UINT uMsg,WPARAM wParam,LPARAM lParam
iLen = GetWindowTextLength(GetDlgItem(hwndDlg, IDC_CHAT_TIMESTAMP));
if ( iLen > 0 ) {
- pszText = mir_realloc(pszText, iLen+1);
+ pszText = (char *)mir_realloc(pszText, iLen+1);
GetDlgItemTextA(hwndDlg, IDC_CHAT_TIMESTAMP, pszText,iLen+1);
DBWriteContactSettingString(NULL, "Chat", "HeaderTime", pszText);
}
@@ -600,7 +599,7 @@ BOOL CALLBACK DlgProcOptions2(HWND hwndDlg,UINT uMsg,WPARAM wParam,LPARAM lParam
iLen = GetWindowTextLength(GetDlgItem(hwndDlg, IDC_CHAT_INSTAMP));
if ( iLen > 0 ) {
- pszText = mir_realloc(pszText, iLen+1);
+ pszText = (char *)mir_realloc(pszText, iLen+1);
GetDlgItemTextA(hwndDlg, IDC_CHAT_INSTAMP, pszText,iLen+1);
DBWriteContactSettingString(NULL, "Chat", "HeaderIncoming", pszText);
}
@@ -608,7 +607,7 @@ BOOL CALLBACK DlgProcOptions2(HWND hwndDlg,UINT uMsg,WPARAM wParam,LPARAM lParam
iLen = GetWindowTextLength(GetDlgItem(hwndDlg, IDC_CHAT_OUTSTAMP));
if ( iLen > 0 ) {
- pszText = mir_realloc(pszText, iLen+1);
+ pszText = (char *)mir_realloc(pszText, iLen+1);
GetDlgItemTextA(hwndDlg, IDC_CHAT_OUTSTAMP, pszText,iLen+1);
DBWriteContactSettingString(NULL, "Chat", "HeaderOutgoing", pszText);
}
diff --git a/plugins/Scriver/chat/services.cpp b/plugins/Scriver/chat/services.cpp
index eb72218e7a..24aec8e9cc 100644
--- a/plugins/Scriver/chat/services.cpp
+++ b/plugins/Scriver/chat/services.cpp
@@ -23,7 +23,6 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
#include "chat.h"
#include "../msgwindow.h"
-extern HANDLE g_hInst;
extern HICON hIcons[30];
HANDLE hSendEvent;
@@ -179,7 +178,7 @@ static INT_PTR Service_Register(WPARAM wParam, LPARAM lParam)
mi->iMaxText= gcr->iMaxText;
mi->nColorCount = gcr->nColors;
if ( gcr->nColors > 0) {
- mi->crColors = mir_alloc(sizeof(COLORREF) * gcr->nColors);
+ mi->crColors = (COLORREF *)mir_alloc(sizeof(COLORREF) * gcr->nColors);
memcpy(mi->crColors, gcr->pColors, sizeof(COLORREF) * gcr->nColors);
}
diff --git a/plugins/Scriver/chat/tools.cpp b/plugins/Scriver/chat/tools.cpp
index d18115dfae..b448ca9aa4 100644
--- a/plugins/Scriver/chat/tools.cpp
+++ b/plugins/Scriver/chat/tools.cpp
@@ -24,7 +24,6 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
#include <string.h>
#include <shlwapi.h>
-extern HINSTANCE g_hInst;
extern FONTINFO aFonts[OPTIONS_FONTCOUNT];
extern HMENU g_hMenu;
extern HANDLE hBuildMenuEvent ;
@@ -150,7 +149,7 @@ static int ShowPopup (HANDLE hContact, SESSION_INFO* si, HICON hIcon, char* psz
pd.colorText = crBkg;
}
- pd.PluginWindowProc = PopupDlgProc;
+ pd.PluginWindowProc = (WNDPROC)PopupDlgProc;
pd.PluginData = si;
return PUAddPopUpT(&pd);
}
@@ -465,9 +464,9 @@ BOOL IsHighlighted(SESSION_INFO* si, const TCHAR* pszText)
p3 += 1;
//find the end of the word
- p2 = _tcschr(p3, ' ');
+ p2 = (TCHAR *)_tcschr(p3, ' ');
if (!p2)
- p2 = _tcschr(p3, '\0');
+ p2 = (TCHAR *)_tcschr(p3, '\0');
if (p3 != p2) {
diff --git a/plugins/Scriver/chat/window.cpp b/plugins/Scriver/chat/window.cpp
index 2acd5aed25..0962503cd3 100644
--- a/plugins/Scriver/chat/window.cpp
+++ b/plugins/Scriver/chat/window.cpp
@@ -31,8 +31,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
extern HBRUSH hListBkgBrush;
extern HBRUSH hListSelectedBkgBrush;
extern HANDLE hSendEvent;
-extern HINSTANCE g_hInst;
-extern struct CREOleCallback reOleCallback;
+extern CREOleCallback reOleCallback;
extern HMENU g_hMenu;
extern TABLIST * g_TabList;
extern HANDLE hHookWinPopup;
@@ -341,7 +340,7 @@ static LRESULT CALLBACK MessageSubclassProc(HWND hwnd, UINT msg, WPARAM wParam,
iLen = GetRichTextLength(hwnd, gt.codepage, TRUE);
if (iLen >0) {
TCHAR *pszName = NULL;
- pszText = mir_alloc(iLen + 100 * sizeof(TCHAR));
+ pszText = (TCHAR *)mir_alloc(iLen + 100 * sizeof(TCHAR));
gt.cb = iLen + 99 * sizeof(TCHAR);
gt.flags = GT_DEFAULT;
@@ -364,7 +363,7 @@ static LRESULT CALLBACK MessageSubclassProc(HWND hwnd, UINT msg, WPARAM wParam,
}
}
if ( dat->szSearchQuery == NULL) {
- dat->szSearchQuery = mir_alloc( sizeof(TCHAR)*( end-start+1 ));
+ dat->szSearchQuery = (TCHAR *)mir_alloc( sizeof(TCHAR)*( end-start+1 ));
lstrcpyn( dat->szSearchQuery, pszText+start, end-start+1);
dat->szSearchResult = mir_tstrdup(dat->szSearchQuery);
dat->lastSession = NULL;
@@ -394,7 +393,7 @@ static LRESULT CALLBACK MessageSubclassProc(HWND hwnd, UINT msg, WPARAM wParam,
dat->szSearchResult = mir_tstrdup(pszName);
if (end !=start) {
if (!isRoom && !isTopic && g_Settings.AddColonToAutoComplete && start == 0) {
- pszText = mir_alloc((_tcslen(pszName) + 4) * sizeof(TCHAR));
+ pszText = (TCHAR *)mir_alloc((_tcslen(pszName) + 4) * sizeof(TCHAR));
_tcscpy(pszText, pszName);
_tcscat(pszText, _T(": "));
pszName = pszText;
@@ -1098,7 +1097,7 @@ int GetTextPixelSize( TCHAR* pszText, HFONT hFont, BOOL bWidth)
return 0;
hdc = GetDC(NULL);
- hOldFont = SelectObject(hdc, hFont);
+ hOldFont = (HFONT)SelectObject(hdc, hFont);
i = DrawText(hdc, pszText , -1, &rc, DT_CALCRECT);
SelectObject(hdc, hOldFont);
ReleaseDC(NULL,hdc);
@@ -1703,7 +1702,7 @@ LABEL_SHOWWINDOW:
HWND ColorWindow;
RECT rc;
BOOL bFG = lParam == IDC_CHAT_COLOR?TRUE:FALSE;
- COLORCHOOSER * pCC = mir_alloc(sizeof(COLORCHOOSER));
+ COLORCHOOSER * pCC = (COLORCHOOSER *)mir_alloc(sizeof(COLORCHOOSER));
GetWindowRect(GetDlgItem(hwndDlg, bFG?IDC_CHAT_COLOR:IDC_CHAT_BKGCOLOR), &rc);
pCC->hWndTarget = GetDlgItem(hwndDlg, IDC_CHAT_MESSAGE);
diff --git a/plugins/Scriver/cmdlist.cpp b/plugins/Scriver/cmdlist.cpp
index e6fffda347..8f8d5b1524 100644
--- a/plugins/Scriver/cmdlist.cpp
+++ b/plugins/Scriver/cmdlist.cpp
@@ -27,7 +27,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
TCmdList *tcmdlist_append(TCmdList *list, const char *data, int maxSize, BOOL temporary) {
TCmdList *n;
- TCmdList *new_list = mir_alloc(sizeof(TCmdList));
+ TCmdList *new_list = (TCmdList *)mir_alloc(sizeof(TCmdList));
TCmdList *attach_to = NULL;
if (!data) {
@@ -74,7 +74,7 @@ TCmdList *tcmdlist_remove(TCmdList *list, TCmdList *n) {
TCmdList *tcmdlist_append2(TCmdList *list, HANDLE hContact, const char *data) {
TCmdList *n;
- TCmdList *new_list = mir_alloc(sizeof(TCmdList));
+ TCmdList *new_list = (TCmdList *)mir_alloc(sizeof(TCmdList));
TCmdList *attach_to = NULL;
if (!data) {
diff --git a/plugins/Scriver/commonheaders.h b/plugins/Scriver/commonheaders.h
index ce5def75e0..ff28919984 100644
--- a/plugins/Scriver/commonheaders.h
+++ b/plugins/Scriver/commonheaders.h
@@ -103,11 +103,8 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
#define CFM_WEIGHT 0x00400000
#endif
-#if _MSC_VER >= 1500
- #define wEffects wReserved
-#endif
-
extern HWND SM_FindWindowByContact(HANDLE hContact);
+extern HINSTANCE g_hInst;
#define SPLITTER_HEIGHT 4
#define TOOLBAR_HEIGHT 24
@@ -117,5 +114,15 @@ extern HWND SM_FindWindowByContact(HANDLE hContact);
#define BOTTOM_RIGHT_AVATAR_HEIGHT 64
#define INFO_BAR_COLOR COLOR_INACTIVEBORDER
+int Chat_Load();
+int Chat_Unload();
+int Chat_ModulesLoaded(WPARAM wParam,LPARAM lParam);
+int Chat_FontsChanged(WPARAM wParam,LPARAM lParam);
+int Chat_SmileyOptionsChanged(WPARAM wParam,LPARAM lParam);
+int Chat_PreShutdown(WPARAM wParam,LPARAM lParam);
+int Chat_IconsChanged(WPARAM wParam,LPARAM lParam);
+int OptInitialise(WPARAM wParam, LPARAM lParam);
+int FontServiceFontsChanged(WPARAM wParam, LPARAM lParam);
+int StatusIconPressed(WPARAM wParam, LPARAM lParam);
#endif
diff --git a/plugins/Scriver/globals.cpp b/plugins/Scriver/globals.cpp
index d92ca958f4..a9cfb0bf47 100644
--- a/plugins/Scriver/globals.cpp
+++ b/plugins/Scriver/globals.cpp
@@ -24,7 +24,6 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
#include "m_ieview.h"
struct GlobalMessageData *g_dat=NULL;
-extern HINSTANCE g_hInst;
extern PSLWA pSetLayeredWindowAttributes;
HANDLE hEventSkin2IconsChanged;
@@ -228,7 +227,7 @@ void LoadGlobalIcons() {
overlayIcon = ImageList_AddIcon(g_dat->hHelperIconList, GetCachedIcon("scriver_OVERLAY"));
ImageList_SetOverlayImage(g_dat->hHelperIconList, overlayIcon, 1);
for (i=0; i<IDI_FOODNETWORK - IDI_GOOGLE + 1; i++) {
- HICON hIcon = LoadImage(g_hInst, MAKEINTRESOURCE(IDI_GOOGLE + i), IMAGE_ICON, 0, 0, 0);
+ HICON hIcon = (HICON)LoadImage(g_hInst, MAKEINTRESOURCE(IDI_GOOGLE + i), IMAGE_ICON, 0, 0, 0);
ImageList_AddIcon(g_dat->hSearchEngineIconList, hIcon);
DestroyIcon(hIcon);
}
diff --git a/plugins/Scriver/infobar.cpp b/plugins/Scriver/infobar.cpp
index 4387c4979a..a540606996 100644
--- a/plugins/Scriver/infobar.cpp
+++ b/plugins/Scriver/infobar.cpp
@@ -24,11 +24,10 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
#include "infobar.h"
#include "richutil.h"
-extern HINSTANCE g_hInst;
-
void SetupInfobar(InfobarWindowData* idat) {
HWND hwnd = idat->hWnd;
- CHARFORMAT2 cf2 = {0};
+ CHARFORMAT2 cf2;
+ memset(&cf2, 0, sizeof(cf2));
LOGFONT lf;
DWORD colour = DBGetContactSettingDword(NULL, SRMMMOD, SRMSGSET_INFOBARBKGCOLOUR, SRMSGDEFSET_INFOBARBKGCOLOUR);
SendDlgItemMessage(hwnd, IDC_INFOBAR_NAME, EM_SETBKGNDCOLOR, 0, colour);
@@ -70,7 +69,7 @@ static HICON GetExtraStatusIcon(InfobarWindowData* idat) {
void RefreshInfobar(InfobarWindowData* idat) {
HWND hwnd = idat->hWnd;
- struct MessageWindowData *dat = idat->mwd;
+ struct SrmmWindowData *dat = idat->mwd;
TCHAR *szContactName = GetNickname(dat->windowData.hContact, dat->szProto);
TCHAR *szContactStatusMsg = DBGetStringT(dat->windowData.hContact, "CList", "StatusMsg");
TCHAR *szXStatusName = DBGetStringT(idat->mwd->windowData.hContact, idat->mwd->szProto, "XStatusName");
@@ -283,11 +282,11 @@ static LRESULT CALLBACK InfobarWndProc(HWND hwnd, UINT msg, WPARAM wParam, LPARA
return FALSE;
}
-InfobarWindowData *CreateInfobar(HWND hParent, struct MessageWindowData *dat)
+InfobarWindowData *CreateInfobar(HWND hParent, struct SrmmWindowData *dat)
{
InfobarWindowData *idat = (InfobarWindowData *) mir_alloc(sizeof(InfobarWindowData));
idat->mwd = dat;
- idat->hWnd = CreateDialogParam(g_hInst, MAKEINTRESOURCE(IDD_INFOBAR), hParent, InfobarWndProc, (LPARAM)idat);
+ idat->hWnd = CreateDialogParam(g_hInst, MAKEINTRESOURCE(IDD_INFOBAR), hParent, (DLGPROC)InfobarWndProc, (LPARAM)idat);
RichUtil_SubClass(idat->hWnd);
SetWindowPos(idat->hWnd, HWND_TOP, 0, 0, 0, 0, SWP_HIDEWINDOW | SWP_NOSIZE | SWP_NOREPOSITION);
return idat;
diff --git a/plugins/Scriver/infobar.h b/plugins/Scriver/infobar.h
index ef7f3c8bdd..42580093f0 100644
--- a/plugins/Scriver/infobar.h
+++ b/plugins/Scriver/infobar.h
@@ -25,12 +25,12 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
typedef struct InfobarWindowDataStruct
{
- struct MessageWindowData *mwd;
+ struct SrmmWindowData *mwd;
HWND hWnd;
HWND hXStatusTip;
} InfobarWindowData;
-InfobarWindowData *CreateInfobar(HWND hParent, struct MessageWindowData *dat);
+InfobarWindowData *CreateInfobar(HWND hParent, struct SrmmWindowData *dat);
void SetupInfobar(InfobarWindowData* idat);
void RefreshInfobar(InfobarWindowData* idat);
diff --git a/plugins/Scriver/input.cpp b/plugins/Scriver/input.cpp
index 57480d0a3c..79dce58fdc 100644
--- a/plugins/Scriver/input.cpp
+++ b/plugins/Scriver/input.cpp
@@ -22,7 +22,6 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/
#include "commonheaders.h"
-extern HINSTANCE g_hInst;
extern HANDLE hHookWinPopup;
enum KB_ACTIONS {KB_PREV_TAB = 1, KB_NEXT_TAB, KB_SWITCHTOOLBAR,
@@ -396,7 +395,7 @@ BOOL HandleLinkClick(HINSTANCE hInstance, HWND hwndDlg, HWND hwndFocus, ENLINK *
if (sel.cpMin != sel.cpMax)
return FALSE;
tr.chrg = lParam->chrg;
- tr.lpstrText = mir_alloc(sizeof(TCHAR)*(tr.chrg.cpMax - tr.chrg.cpMin + 8));
+ tr.lpstrText = (LPWSTR)mir_alloc(sizeof(TCHAR)*(tr.chrg.cpMax - tr.chrg.cpMin + 8));
SendMessage(lParam->nmhdr.hwndFrom, EM_GETTEXTRANGE, 0, (LPARAM) & tr);
if (_tcschr(tr.lpstrText, _T('@')) != NULL && _tcschr(tr.lpstrText, _T(':')) == NULL && _tcschr(tr.lpstrText, _T('/')) == NULL) {
MoveMemory(tr.lpstrText + sizeof(TCHAR) * 7, tr.lpstrText, sizeof(TCHAR)*(tr.chrg.cpMax - tr.chrg.cpMin + 1));
@@ -424,7 +423,7 @@ BOOL HandleLinkClick(HINSTANCE hInstance, HWND hwndDlg, HWND hwndFocus, ENLINK *
break;
EmptyClipboard();
hData = GlobalAlloc(GMEM_MOVEABLE, sizeof(TCHAR)*(lstrlen(tr.lpstrText) + 1));
- lstrcpy(GlobalLock(hData), tr.lpstrText);
+ lstrcpy((LPWSTR)GlobalLock(hData), tr.lpstrText);
GlobalUnlock(hData);
SetClipboardData(CF_UNICODETEXT, hData);
CloseClipboard();
diff --git a/plugins/Scriver/msgdialog.cpp b/plugins/Scriver/msgdialog.cpp
index de3410ae91..a2939826da 100644
--- a/plugins/Scriver/msgdialog.cpp
+++ b/plugins/Scriver/msgdialog.cpp
@@ -37,10 +37,9 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
extern HCURSOR hCurSplitNS, hCurSplitWE, hCurHyperlinkHand, hDragCursor;
extern HANDLE hHookWinEvt;
extern HANDLE hHookWinPopup;
-extern struct CREOleCallback reOleCallback, reOleCallback2;
-extern HINSTANCE g_hInst;
+extern CREOleCallback reOleCallback, reOleCallback2;
-static void UpdateReadChars(HWND hwndDlg, struct MessageWindowData * dat);
+static void UpdateReadChars(HWND hwndDlg, struct SrmmWindowData * dat);
static WNDPROC OldMessageEditProc, OldLogEditProc;
static ToolbarButton toolbarButtons[] = {
@@ -64,7 +63,7 @@ static DWORD CALLBACK StreamOutCallback(DWORD_PTR dwCookie, LPBYTE pbBuff, LONG
return 0;
}
-static TCHAR *GetIEViewSelection(struct MessageWindowData *dat) {
+static TCHAR *GetIEViewSelection(struct SrmmWindowData *dat) {
IEVIEWEVENT event;
ZeroMemory(&event, sizeof(event));
event.cbSize = sizeof(event);
@@ -223,7 +222,7 @@ static void AddToFileList(TCHAR ***pppFiles,int *totalCount,const TCHAR* szFilen
static void SetDialogToType(HWND hwndDlg)
{
BOOL showToolbar = SendMessage(GetParent(hwndDlg), CM_GETTOOLBARSTATUS, 0, 0);
- struct MessageWindowData *dat = (struct MessageWindowData *) GetWindowLongPtr(hwndDlg, GWLP_USERDATA);
+ struct SrmmWindowData *dat = (struct SrmmWindowData *) GetWindowLongPtr(hwndDlg, GWLP_USERDATA);
ParentWindowData *pdat = dat->parent;
if (pdat->flags2 & SMF2_SHOWINFOBAR) {
@@ -256,7 +255,7 @@ static void SetDialogToType(HWND hwndDlg)
}
-void SetStatusIcon(struct MessageWindowData *dat) {
+void SetStatusIcon(struct SrmmWindowData *dat) {
if (dat->szProto != NULL) {
char *szProto = dat->szProto;
HANDLE hContact = dat->windowData.hContact;
@@ -288,7 +287,7 @@ void SetStatusIcon(struct MessageWindowData *dat) {
}
}
-void GetTitlebarIcon(struct MessageWindowData *dat, TitleBarData *tbd) {
+void GetTitlebarIcon(struct SrmmWindowData *dat, TitleBarData *tbd) {
if (dat->showTyping && (g_dat->flags2 & SMF2_SHOWTYPINGWIN)) {
tbd->hIconNot = tbd->hIcon = GetCachedIcon("scriver_TYPING");
} else if (dat->showUnread && (GetActiveWindow() != dat->hwndParent || GetForegroundWindow() != dat->hwndParent)) {
@@ -301,7 +300,7 @@ void GetTitlebarIcon(struct MessageWindowData *dat, TitleBarData *tbd) {
tbd->hIconBig = (g_dat->flags & SMF_STATUSICON) ? dat->statusIconBig : g_dat->hMsgIconBig;
}
-HICON GetTabIcon(struct MessageWindowData *dat) {
+HICON GetTabIcon(struct SrmmWindowData *dat) {
if (dat->showTyping) {
return GetCachedIcon("scriver_TYPING");
} else if (dat->showUnread != 0) {
@@ -405,12 +404,12 @@ static LRESULT CALLBACK MessageEditSubclassProc(HWND hwnd, UINT msg, WPARAM wPar
{
int result = -1;
struct MsgEditSubclassData *dat;
- struct MessageWindowData *pdat;
+ struct SrmmWindowData *pdat;
CommonWindowData *windowData;
BOOL isCtrl = GetKeyState(VK_CONTROL) & 0x8000;
BOOL isAlt = GetKeyState(VK_MENU) & 0x8000;
dat = (struct MsgEditSubclassData *) GetWindowLongPtr(hwnd, GWLP_USERDATA);
- pdat=(struct MessageWindowData *)GetWindowLongPtr(GetParent(hwnd),GWLP_USERDATA);
+ pdat=(struct SrmmWindowData *)GetWindowLongPtr(GetParent(hwnd),GWLP_USERDATA);
windowData = &pdat->windowData;
result = InputAreaShortcuts(hwnd, msg, wParam, lParam, windowData);
@@ -520,7 +519,7 @@ static void UnsubclassLogEdit(HWND hwnd) {
SetWindowLongPtr(hwnd, GWLP_WNDPROC, (LONG_PTR) OldLogEditProc);
}
-static void MessageDialogResize(HWND hwndDlg, struct MessageWindowData *dat, int w, int h) {
+static void MessageDialogResize(HWND hwndDlg, struct SrmmWindowData *dat, int w, int h) {
HDWP hdwp;
ParentWindowData *pdat = dat->parent;
int hSplitterPos = dat->splitterPos, toolbarHeight = pdat->flags2&SMF2_SHOWTOOLBAR ? IsToolbarVisible(SIZEOF(toolbarButtons), g_dat->buttonVisibility) ? dat->toolbarSize.cy : dat->toolbarSize.cy / 3 : 0;
@@ -620,7 +619,7 @@ static void MessageDialogResize(HWND hwndDlg, struct MessageWindowData *dat, int
RedrawWindow(GetDlgItem(hwndDlg, IDC_AVATAR), NULL, NULL, RDW_INVALIDATE);
}
-static void UpdateReadChars(HWND hwndDlg, struct MessageWindowData * dat)
+static void UpdateReadChars(HWND hwndDlg, struct SrmmWindowData * dat)
{
if (dat->parent->hwndActive == hwndDlg) {
TCHAR szText[256];
@@ -635,7 +634,7 @@ static void UpdateReadChars(HWND hwndDlg, struct MessageWindowData * dat)
}
}
-void ShowAvatar(HWND hwndDlg, struct MessageWindowData *dat)
+void ShowAvatar(HWND hwndDlg, struct SrmmWindowData *dat)
{
INT_PTR res = CallService(MS_AV_GETAVATARBITMAP, (WPARAM)dat->windowData.hContact, 0);
dat->ace = res != CALLSERVICE_NOTFOUND ? (AVATARCACHEENTRY*)res : NULL;
@@ -647,7 +646,7 @@ void ShowAvatar(HWND hwndDlg, struct MessageWindowData *dat)
RedrawWindow(GetDlgItem(hwndDlg, IDC_AVATAR), NULL, NULL, RDW_INVALIDATE);
}
-static BOOL IsTypingNotificationSupported(struct MessageWindowData *dat) {
+static BOOL IsTypingNotificationSupported(struct SrmmWindowData *dat) {
DWORD typeCaps;
if (!dat->windowData.hContact)
return FALSE;
@@ -659,7 +658,7 @@ static BOOL IsTypingNotificationSupported(struct MessageWindowData *dat) {
return TRUE;
}
-static BOOL IsTypingNotificationEnabled(struct MessageWindowData *dat) {
+static BOOL IsTypingNotificationEnabled(struct SrmmWindowData *dat) {
DWORD protoStatus;
DWORD protoCaps;
if (!DBGetContactSettingByte(dat->windowData.hContact, SRMMMOD, SRMSGSET_TYPING, DBGetContactSettingByte(NULL, SRMMMOD, SRMSGSET_TYPINGNEW, SRMSGDEFSET_TYPINGNEW)))
@@ -683,7 +682,7 @@ static BOOL IsTypingNotificationEnabled(struct MessageWindowData *dat) {
// Don't send to protocols that are offline
// Don't send to users who are not visible and
// Don't send to users who are not on the visible list when you are in invisible mode.
-static void NotifyTyping(struct MessageWindowData *dat, int mode) {
+static void NotifyTyping(struct SrmmWindowData *dat, int mode) {
if (!IsTypingNotificationSupported(dat)) {
return;
}
@@ -737,8 +736,8 @@ static INT_PTR CALLBACK ConfirmSendAllDlgProc(HWND hwndDlg, UINT msg, WPARAM wPa
INT_PTR CALLBACK DlgProcMessage(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lParam)
{
static HMENU hToolbarMenu;
- struct MessageWindowData *dat;
- dat = (struct MessageWindowData *) GetWindowLongPtr(hwndDlg, GWLP_USERDATA);
+ struct SrmmWindowData *dat;
+ dat = (struct SrmmWindowData *) GetWindowLongPtr(hwndDlg, GWLP_USERDATA);
if (!dat && msg!=WM_INITDIALOG) return FALSE;
switch (msg) {
case WM_INITDIALOG:
@@ -748,8 +747,8 @@ INT_PTR CALLBACK DlgProcMessage(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lP
RECT minEditInit;
NewMessageWindowLParam *newData = (NewMessageWindowLParam *) lParam;
//TranslateDialogDefault(hwndDlg);
- dat = (struct MessageWindowData *) mir_alloc(sizeof(struct MessageWindowData));
- ZeroMemory(dat, sizeof(struct MessageWindowData));
+ dat = (struct SrmmWindowData *) mir_alloc(sizeof(struct SrmmWindowData));
+ ZeroMemory(dat, sizeof(struct SrmmWindowData));
SetWindowLongPtr(hwndDlg, GWLP_USERDATA, (LONG_PTR) dat);
dat->windowData.hContact = newData->hContact;
NotifyLocalWinEvent(dat->windowData.hContact, hwndDlg, MSG_WINDOW_EVT_OPENING);
@@ -1109,7 +1108,7 @@ INT_PTR CALLBACK DlgProcMessage(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lP
TabControlData tcd;
tcd.iFlags = TCDF_TEXT | TCDF_ICON;
tcd.hIcon = GetTabIcon(dat);
- tcd.pszText = GetTabName(dat->windowData.hContact);
+ tcd.pszText = GetTabName((HANDLE *)dat->windowData.hContact);
SendMessage(dat->hwndParent, CM_UPDATETABCONTROL, (WPARAM)&tcd, (LPARAM)hwndDlg);
mir_free(tcd.pszText);
}
@@ -1119,7 +1118,7 @@ INT_PTR CALLBACK DlgProcMessage(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lP
TitleBarData tbd = {0};
tbd.iFlags = TBDF_TEXT | TBDF_ICON;
GetTitlebarIcon(dat, &tbd);
- tbd.pszText = GetWindowTitle(dat->windowData.hContact, dat->szProto);
+ tbd.pszText = GetWindowTitle((HANDLE *)dat->windowData.hContact, dat->szProto);
SendMessage(dat->hwndParent, CM_UPDATETITLEBAR, (WPARAM)&tbd, (LPARAM)hwndDlg);
mir_free(tbd.pszText);
}
@@ -1195,8 +1194,10 @@ INT_PTR CALLBACK DlgProcMessage(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lP
}
case DM_OPTIONSAPPLIED:
{
- PARAFORMAT2 pf2 = {0};
- CHARFORMAT2 cf2 = {0};
+ PARAFORMAT2 pf2;
+ memset(&pf2, 0, sizeof(pf2));
+ CHARFORMAT2 cf2;
+ memset(&cf2, 0, sizeof(cf2));
LOGFONT lf;
COLORREF colour;
dat->flags &= ~SMF_USEIEVIEW;
@@ -1274,7 +1275,7 @@ INT_PTR CALLBACK DlgProcMessage(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lP
if (!OpenClipboard(hwndDlg) || !lstrlenA(buf)) break;
EmptyClipboard();
hData = GlobalAlloc(GMEM_MOVEABLE, lstrlenA(buf) + 1);
- lstrcpyA(GlobalLock(hData), buf);
+ lstrcpyA((LPSTR)GlobalLock(hData), buf);
GlobalUnlock(hData);
SetClipboardData(CF_TEXT, hData);
CloseClipboard();
diff --git a/plugins/Scriver/msglog.cpp b/plugins/Scriver/msglog.cpp
index ba264a14d4..ae04d5e11e 100644
--- a/plugins/Scriver/msglog.cpp
+++ b/plugins/Scriver/msglog.cpp
@@ -29,7 +29,6 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
#define LOGICON_MSG_NOTICE 2
extern int RTL_Detect(WCHAR *pszwText);
-extern HINSTANCE g_hInst;
static int logPixelSY;
static PBYTE pLogIconBmpBits[3];
static int logIconBmpSize[SIZEOF(pLogIconBmpBits)];
@@ -78,7 +77,7 @@ struct LogStreamData {
int bufferOffset, bufferLen;
int eventsToInsert;
int isFirst;
- struct MessageWindowData *dlgDat;
+ struct SrmmWindowData *dlgDat;
struct GlobalMessageData *gdat;
EventData *events;
};
@@ -142,7 +141,7 @@ int DbEventIsMessageOrCustom(DBEVENTINFO* dbei)
return dbei->eventType == EVENTTYPE_MESSAGE || DbEventIsCustomForMsgWindow(dbei);
}
-int DbEventIsShown(DBEVENTINFO * dbei, struct MessageWindowData *dat)
+int DbEventIsShown(DBEVENTINFO * dbei, struct SrmmWindowData *dat)
{
int heFlags;
@@ -169,7 +168,7 @@ int DbEventIsShown(DBEVENTINFO * dbei, struct MessageWindowData *dat)
return DbEventIsCustomForMsgWindow(dbei);
}
-EventData *getEventFromDB(struct MessageWindowData *dat, HANDLE hContact, HANDLE hDbEvent) {
+EventData *getEventFromDB(struct SrmmWindowData *dat, HANDLE hContact, HANDLE hDbEvent) {
DBEVENTINFO dbei = { 0 };
EventData *event;
dbei.cbSize = sizeof(dbei);
@@ -363,7 +362,7 @@ static int AppendTToBuffer(char **buffer, int *cbBufferEnd, int *cbBufferAlloced
}
//mir_free() the return value
-static char *CreateRTFHeader(struct MessageWindowData *dat, struct GlobalMessageData *gdat)
+static char *CreateRTFHeader(struct SrmmWindowData *dat, struct GlobalMessageData *gdat)
{
char *buffer;
int bufferAlloced, bufferEnd;
@@ -594,7 +593,7 @@ static void AppendWithCustomLinks(EventData *event, int style, char **buffer, in
}
//mir_free() the return value
-static char *CreateRTFFromEvent(struct MessageWindowData *dat, EventData *event, struct GlobalMessageData *gdat, struct LogStreamData *streamData)
+static char *CreateRTFFromEvent(struct SrmmWindowData *dat, EventData *event, struct GlobalMessageData *gdat, struct LogStreamData *streamData)
{
char *buffer;
int bufferAlloced, bufferEnd;
@@ -999,7 +998,7 @@ void StreamInTestEvents(HWND hEditWnd, struct GlobalMessageData *gdat)
{
EDITSTREAM stream = { 0 };
struct LogStreamData streamData = { 0 };
- struct MessageWindowData dat = { 0 };
+ struct SrmmWindowData dat = { 0 };
streamData.isFirst = TRUE;
streamData.events = GetTestEvents();
streamData.dlgDat = &dat;
@@ -1014,7 +1013,7 @@ void StreamInEvents(HWND hwndDlg, HANDLE hDbEventFirst, int count, int fAppend)
FINDTEXTEXA fi;
EDITSTREAM stream = { 0 };
struct LogStreamData streamData = { 0 };
- struct MessageWindowData *dat = (struct MessageWindowData *) GetWindowLongPtr(hwndDlg, GWLP_USERDATA);
+ struct SrmmWindowData *dat = (struct SrmmWindowData *) GetWindowLongPtr(hwndDlg, GWLP_USERDATA);
CHARRANGE oldSel, sel;
// IEVIew MOD Begin
@@ -1173,7 +1172,7 @@ void LoadMsgLogIcons(void)
}
pLogIconBmpBits[i] = (PBYTE) mir_alloc(RTFPICTHEADERMAXSIZE + (bih.biSize + widthBytes * bih.biHeight) * 2);
//I can't seem to get binary mode working. No matter.
- rtfHeaderSize = sprintf(pLogIconBmpBits[i], "{\\pict\\dibitmap0\\wbmbitspixel%u\\wbmplanes1\\wbmwidthbytes%u\\picw%u\\pich%u ", bih.biBitCount, widthBytes, (UINT) bih.biWidth, (UINT)bih.biHeight);
+ rtfHeaderSize = sprintf((char *)pLogIconBmpBits[i], "{\\pict\\dibitmap0\\wbmbitspixel%u\\wbmplanes1\\wbmwidthbytes%u\\picw%u\\pich%u ", bih.biBitCount, widthBytes, (UINT) bih.biWidth, (UINT)bih.biHeight);
hoBmp = (HBITMAP) SelectObject(hdcMem, hBmp);
FillRect(hdcMem, &rc, hBrush);
DrawIconEx(hdcMem, 0, 0, hIcon, bih.biWidth, bih.biHeight, 0, NULL, DI_NORMAL);
@@ -1183,9 +1182,9 @@ void LoadMsgLogIcons(void)
{
int n;
for (n = 0; n < sizeof(BITMAPINFOHEADER); n++)
- sprintf(pLogIconBmpBits[i] + rtfHeaderSize + n * 2, "%02X", ((PBYTE) & bih)[n]);
+ sprintf((char *)pLogIconBmpBits[i] + rtfHeaderSize + n * 2, "%02X", ((PBYTE) & bih)[n]);
for (n = 0; n < widthBytes * bih.biHeight; n += 4)
- sprintf(pLogIconBmpBits[i] + rtfHeaderSize + (bih.biSize + n) * 2, "%02X%02X%02X%02X", pBmpBits[n], pBmpBits[n + 1], pBmpBits[n + 2], pBmpBits[n + 3]);
+ sprintf((char *)pLogIconBmpBits[i] + rtfHeaderSize + (bih.biSize + n) * 2, "%02X%02X%02X%02X", pBmpBits[n], pBmpBits[n + 1], pBmpBits[n + 2], pBmpBits[n + 3]);
}
logIconBmpSize[i] = rtfHeaderSize + (bih.biSize + widthBytes * bih.biHeight) * 2 + 1;
pLogIconBmpBits[i][logIconBmpSize[i] - 1] = '}';
diff --git a/plugins/Scriver/msgoptions.cpp b/plugins/Scriver/msgoptions.cpp
index 9dd1624540..cfbde8c141 100644
--- a/plugins/Scriver/msgoptions.cpp
+++ b/plugins/Scriver/msgoptions.cpp
@@ -22,8 +22,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/
#include "commonheaders.h"
#include "chat/chat.h"
-extern HINSTANCE g_hInst;
-extern struct CREOleCallback reOleCallback;
+extern CREOleCallback reOleCallback;
extern void ChangeStatusIcons();
extern void LoadInfobarFonts();
diff --git a/plugins/Scriver/msgs.cpp b/plugins/Scriver/msgs.cpp
index 486887e84e..0971cfa0eb 100644
--- a/plugins/Scriver/msgs.cpp
+++ b/plugins/Scriver/msgs.cpp
@@ -23,43 +23,14 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
#include "commonheaders.h"
#include "statusicon.h"
-extern void Chat_Load();
-extern void Chat_Unload();
-extern int Chat_ModulesLoaded(WPARAM wParam,LPARAM lParam);
-extern int Chat_FontsChanged(WPARAM wParam,LPARAM lParam);
-extern int Chat_SmileyOptionsChanged(WPARAM wParam,LPARAM lParam);
-extern int Chat_PreShutdown(WPARAM wParam,LPARAM lParam);
-extern int Chat_IconsChanged(WPARAM wParam,LPARAM lParam);
-
-extern int OptInitialise(WPARAM wParam, LPARAM lParam);
-extern int FontServiceFontsChanged(WPARAM wParam, LPARAM lParam);
-int StatusIconPressed(WPARAM wParam, LPARAM lParam);
-
-static void InitREOleCallback(void);
-
HCURSOR hCurSplitNS, hCurSplitWE, hCurHyperlinkHand, hDragCursor;
HANDLE hMsgMenuItem, hHookWinEvt=NULL, hHookWinPopup=NULL;;
-extern HINSTANCE g_hInst;
extern HWND GetParentWindow(HANDLE hContact, BOOL bChat);
PSLWA pSetLayeredWindowAttributes;
-#ifdef __MINGW32__
-// RichEdit interface GUIDs
-const CLSID IID_IRichEditOle=
-{ 0x00020D00, 0x00, 0x00,
- { 0xC0, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x46 } };
-
-const CLSID IID_IRichEditOleCallback=
-{ 0x00020D03, 0x00, 0x00,
- { 0xC0, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x46 } };
-
-#endif
-
#define EVENTTYPE_SCRIVER 2010
#define SCRIVER_DB_GETEVENTTEXT "Scriver/GetText"
@@ -399,18 +370,18 @@ static INT_PTR GetWindowData(WPARAM wParam, LPARAM lParam)
MessageWindowData *mwd = (MessageWindowData*)lParam;
HWND hwnd;
- if (mwid==NULL||mwd==NULL) return 1;
- if (mwid->cbSize!=sizeof(MessageWindowInputData)||mwd->cbSize!=sizeof(MessageWindowData)) return 1;
- if (mwid->hContact==NULL) return 1;
- if (mwid->uFlags!=MSG_WINDOW_UFLAG_MSG_BOTH) return 1;
- hwnd = WindowList_Find(g_dat->hMessageWindowList, mwid->hContact);
- if (hwnd == NULL)
- hwnd = SM_FindWindowByContact(mwid->hContact);
- mwd->uFlags = MSG_WINDOW_UFLAG_MSG_BOTH;
- mwd->hwndWindow = hwnd;
- mwd->local = 0;
- mwd->uState = SendMessage(hwnd, DM_GETWINDOWSTATE, 0, 0);
- return 0;
+ if (mwid == NULL || mwd == NULL) return 1;
+ if (mwid->cbSize != sizeof(MessageWindowInputData) || mwd->cbSize != sizeof(SrmmWindowData)) return 1;
+ if (mwid->hContact == NULL) return 1;
+ if (mwid->uFlags != MSG_WINDOW_UFLAG_MSG_BOTH) return 1;
+ hwnd = WindowList_Find(g_dat->hMessageWindowList, mwid->hContact);
+ if (hwnd == NULL)
+ hwnd = SM_FindWindowByContact(mwid->hContact);
+ mwd->uFlags = MSG_WINDOW_UFLAG_MSG_BOTH;
+ mwd->hwndWindow = hwnd;
+ mwd->local = 0;
+ mwd->uState = SendMessage(hwnd, DM_GETWINDOWSTATE, 0, 0);
+ return 0;
}
static int PrebuildContactMenu(WPARAM wParam, LPARAM lParam) {
@@ -597,7 +568,6 @@ int OnLoadModule(void) {
InitGlobals();
RichUtil_Load();
OleInitialize(NULL);
- InitREOleCallback();
InitStatusIcons();
HookEvent_Ex(ME_OPT_INITIALISE, OptInitialise);
@@ -636,137 +606,92 @@ int OnLoadModule(void) {
return 0;
}
-static IRichEditOleCallbackVtbl reOleCallbackVtbl;
-struct CREOleCallback reOleCallback;
-static IRichEditOleCallbackVtbl reOleCallbackVtbl2;
-struct CREOleCallback reOleCallback2;
+///////////////////////////////////////////////////////////////////////////////////////////////////////
-static STDMETHODIMP_(ULONG) CREOleCallback_QueryInterface(struct CREOleCallback *lpThis, REFIID riid, LPVOID * ppvObj)
-{
- if (IsEqualIID(riid, &IID_IRichEditOleCallback)) {
- *ppvObj = lpThis;
- lpThis->lpVtbl->AddRef((IRichEditOleCallback *) lpThis);
- return S_OK;
+CREOleCallback reOleCallback, reOleCallback2;
+
+STDMETHODIMP CREOleCallback::QueryInterface(REFIID riid, LPVOID * ppvObj)
+{
+ if (IsEqualIID(riid, IID_IRichEditOleCallback)) {
+ *ppvObj = this;
+ AddRef();
+ return S_OK;
}
*ppvObj = NULL;
return E_NOINTERFACE;
}
-static STDMETHODIMP_(ULONG) CREOleCallback_AddRef(struct CREOleCallback *lpThis)
-{
- if (lpThis->refCount == 0) {
- if (S_OK != StgCreateDocfile(NULL, STGM_READWRITE | STGM_SHARE_EXCLUSIVE | STGM_CREATE | STGM_DELETEONRELEASE, 0, &lpThis->pictStg))
- lpThis->pictStg = NULL;
- lpThis->nextStgId = 0;
- }
- return ++lpThis->refCount;
-}
-
-static STDMETHODIMP_(ULONG) CREOleCallback_Release(struct CREOleCallback *lpThis)
+STDMETHODIMP_(ULONG) CREOleCallback::AddRef()
{
- if (--lpThis->refCount == 0) {
- if (lpThis->pictStg)
- lpThis->pictStg->lpVtbl->Release(lpThis->pictStg);
- }
- return lpThis->refCount;
-}
-
-static STDMETHODIMP_(HRESULT) CREOleCallback_ContextSensitiveHelp(struct CREOleCallback *lpThis, BOOL fEnterMode)
-{
- return S_OK;
+ if (refCount == 0) {
+ if (S_OK != StgCreateDocfile(NULL, STGM_READWRITE | STGM_SHARE_EXCLUSIVE | STGM_CREATE | STGM_DELETEONRELEASE, 0, &pictStg))
+ pictStg = NULL;
+ nextStgId = 0;
+ }
+ return ++refCount;
}
-static STDMETHODIMP_(HRESULT) CREOleCallback_DeleteObject(struct CREOleCallback *lpThis, LPOLEOBJECT lpoleobj)
+STDMETHODIMP_(ULONG) CREOleCallback::Release()
{
- return S_OK;
+ if (--refCount == 0) {
+ if (pictStg)
+ pictStg->Release();
+ }
+ return refCount;
}
-static STDMETHODIMP_(HRESULT) CREOleCallback_GetClipboardData(struct CREOleCallback *lpThis, CHARRANGE * lpchrg, DWORD reco, LPDATAOBJECT * lplpdataobj)
+STDMETHODIMP CREOleCallback::ContextSensitiveHelp(BOOL fEnterMode)
{
- return E_NOTIMPL;
+ return S_OK;
}
-static STDMETHODIMP_(HRESULT) CREOleCallback_GetContextMenu(struct CREOleCallback *lpThis, WORD seltype, LPOLEOBJECT lpoleobj, CHARRANGE * lpchrg, HMENU * lphmenu)
+STDMETHODIMP CREOleCallback::DeleteObject(LPOLEOBJECT lpoleobj)
{
- return E_INVALIDARG;
+ return S_OK;
}
-static STDMETHODIMP_(HRESULT) CREOleCallback_GetDragDropEffect(struct CREOleCallback *lpThis, BOOL fDrag, DWORD grfKeyState, LPDWORD pdwEffect)
+STDMETHODIMP CREOleCallback::GetClipboardData(CHARRANGE * lpchrg, DWORD reco, LPDATAOBJECT * lplpdataobj)
{
- return S_OK;
+ return E_NOTIMPL;
}
-static STDMETHODIMP_(HRESULT) CREOleCallback_GetInPlaceContext(struct CREOleCallback *lpThis, LPOLEINPLACEFRAME * lplpFrame, LPOLEINPLACEUIWINDOW * lplpDoc, LPOLEINPLACEFRAMEINFO lpFrameInfo)
+STDMETHODIMP CREOleCallback::GetContextMenu(WORD seltype, LPOLEOBJECT lpoleobj, CHARRANGE * lpchrg, HMENU * lphmenu)
{
- return E_INVALIDARG;
+ return E_INVALIDARG;
}
-static STDMETHODIMP_(HRESULT) CREOleCallback_GetNewStorage(struct CREOleCallback *lpThis, LPSTORAGE * lplpstg)
+STDMETHODIMP CREOleCallback::GetDragDropEffect(BOOL fDrag, DWORD grfKeyState, LPDWORD pdwEffect)
{
- WCHAR szwName[64];
- char szName[64];
- wsprintfA(szName, "s%u", lpThis->nextStgId++);
- MultiByteToWideChar(CP_ACP, 0, szName, -1, szwName, sizeof(szwName) / sizeof(szwName[0]));
- if (lpThis->pictStg == NULL)
- return STG_E_MEDIUMFULL;
- return lpThis->pictStg->lpVtbl->CreateStorage(lpThis->pictStg, szwName, STGM_READWRITE | STGM_SHARE_EXCLUSIVE | STGM_CREATE, 0, 0, lplpstg);
+ return S_OK;
}
-static STDMETHODIMP_(HRESULT) CREOleCallback_QueryAcceptData(struct CREOleCallback *lpThis, LPDATAOBJECT lpdataobj, CLIPFORMAT * lpcfFormat, DWORD reco, BOOL fReally, HGLOBAL hMetaPict)
+STDMETHODIMP CREOleCallback::GetInPlaceContext(LPOLEINPLACEFRAME * lplpFrame, LPOLEINPLACEUIWINDOW * lplpDoc, LPOLEINPLACEFRAMEINFO lpFrameInfo)
{
- return S_OK;
+ return E_INVALIDARG;
}
-static STDMETHODIMP_(HRESULT) CREOleCallback_QueryInsertObject(struct CREOleCallback *lpThis, LPCLSID lpclsid, LPSTORAGE lpstg, LONG cp)
+STDMETHODIMP CREOleCallback::GetNewStorage(LPSTORAGE * lplpstg)
{
- return S_OK;
+ WCHAR szwName[64];
+ char szName[64];
+ wsprintfA(szName, "s%u", nextStgId++);
+ MultiByteToWideChar(CP_ACP, 0, szName, -1, szwName, SIZEOF(szwName));
+ if (pictStg == NULL)
+ return STG_E_MEDIUMFULL;
+ return pictStg->CreateStorage(szwName, STGM_READWRITE | STGM_SHARE_EXCLUSIVE | STGM_CREATE, 0, 0, lplpstg);
}
-static STDMETHODIMP_(HRESULT) CREOleCallback_ShowContainerUI(struct CREOleCallback *lpThis, BOOL fShow)
+STDMETHODIMP CREOleCallback::QueryAcceptData(LPDATAOBJECT lpdataobj, CLIPFORMAT * lpcfFormat, DWORD reco, BOOL fReally, HGLOBAL hMetaPict)
{
- return S_OK;
+ return S_OK;
}
-static STDMETHODIMP_(HRESULT) CREOleCallback_QueryAcceptData2(struct CREOleCallback *lpThis, LPDATAOBJECT lpdataobj, CLIPFORMAT * lpcfFormat, DWORD reco, BOOL fReally, HGLOBAL hMetaPict)
+STDMETHODIMP CREOleCallback::QueryInsertObject(LPCLSID lpclsid, LPSTORAGE lpstg, LONG cp)
{
- *lpcfFormat = CF_TEXT;
- return S_OK;
+ return S_OK;
}
-
-static void InitREOleCallback(void)
+STDMETHODIMP CREOleCallback::ShowContainerUI(BOOL fShow)
{
- reOleCallback.lpVtbl = &reOleCallbackVtbl;
- reOleCallback.lpVtbl->AddRef = (ULONG(__stdcall *) (IRichEditOleCallback *)) CREOleCallback_AddRef;
- reOleCallback.lpVtbl->Release = (ULONG(__stdcall *) (IRichEditOleCallback *)) CREOleCallback_Release;
- reOleCallback.lpVtbl->QueryInterface = (HRESULT(__stdcall *) (IRichEditOleCallback *, REFIID, PVOID *)) CREOleCallback_QueryInterface;
- reOleCallback.lpVtbl->ContextSensitiveHelp = (HRESULT(__stdcall *) (IRichEditOleCallback *, BOOL)) CREOleCallback_ContextSensitiveHelp;
- reOleCallback.lpVtbl->DeleteObject = (HRESULT(__stdcall *) (IRichEditOleCallback *, LPOLEOBJECT)) CREOleCallback_DeleteObject;
- reOleCallback.lpVtbl->GetClipboardData = (HRESULT(__stdcall *) (IRichEditOleCallback *, CHARRANGE *, DWORD, LPDATAOBJECT *)) CREOleCallback_GetClipboardData;
- reOleCallback.lpVtbl->GetContextMenu = (HRESULT(__stdcall *) (IRichEditOleCallback *, WORD, LPOLEOBJECT, CHARRANGE *, HMENU *)) CREOleCallback_GetContextMenu;
- reOleCallback.lpVtbl->GetDragDropEffect = (HRESULT(__stdcall *) (IRichEditOleCallback *, BOOL, DWORD, LPDWORD)) CREOleCallback_GetDragDropEffect;
- reOleCallback.lpVtbl->GetInPlaceContext = (HRESULT(__stdcall *) (IRichEditOleCallback *, LPOLEINPLACEFRAME *, LPOLEINPLACEUIWINDOW *, LPOLEINPLACEFRAMEINFO))
- CREOleCallback_GetInPlaceContext;
- reOleCallback.lpVtbl->GetNewStorage = (HRESULT(__stdcall *) (IRichEditOleCallback *, LPSTORAGE *)) CREOleCallback_GetNewStorage;
- reOleCallback.lpVtbl->QueryAcceptData = (HRESULT(__stdcall *) (IRichEditOleCallback *, LPDATAOBJECT, CLIPFORMAT *, DWORD, BOOL, HGLOBAL)) CREOleCallback_QueryAcceptData;
- reOleCallback.lpVtbl->QueryInsertObject = (HRESULT(__stdcall *) (IRichEditOleCallback *, LPCLSID, LPSTORAGE, LONG)) CREOleCallback_QueryInsertObject;
- reOleCallback.lpVtbl->ShowContainerUI = (HRESULT(__stdcall *) (IRichEditOleCallback *, BOOL)) CREOleCallback_ShowContainerUI;
- reOleCallback.refCount = 0;
-
- reOleCallback2.lpVtbl = &reOleCallbackVtbl2;
- reOleCallback2.lpVtbl->AddRef = (ULONG(__stdcall *) (IRichEditOleCallback *)) CREOleCallback_AddRef;
- reOleCallback2.lpVtbl->Release = (ULONG(__stdcall *) (IRichEditOleCallback *)) CREOleCallback_Release;
- reOleCallback2.lpVtbl->QueryInterface = (HRESULT(__stdcall *) (IRichEditOleCallback *, REFIID, PVOID *)) CREOleCallback_QueryInterface;
- reOleCallback2.lpVtbl->ContextSensitiveHelp = (HRESULT(__stdcall *) (IRichEditOleCallback *, BOOL)) CREOleCallback_ContextSensitiveHelp;
- reOleCallback2.lpVtbl->DeleteObject = (HRESULT(__stdcall *) (IRichEditOleCallback *, LPOLEOBJECT)) CREOleCallback_DeleteObject;
- reOleCallback2.lpVtbl->GetClipboardData = (HRESULT(__stdcall *) (IRichEditOleCallback *, CHARRANGE *, DWORD, LPDATAOBJECT *)) CREOleCallback_GetClipboardData;
- reOleCallback2.lpVtbl->GetContextMenu = (HRESULT(__stdcall *) (IRichEditOleCallback *, WORD, LPOLEOBJECT, CHARRANGE *, HMENU *)) CREOleCallback_GetContextMenu;
- reOleCallback2.lpVtbl->GetDragDropEffect = (HRESULT(__stdcall *) (IRichEditOleCallback *, BOOL, DWORD, LPDWORD)) CREOleCallback_GetDragDropEffect;
- reOleCallback2.lpVtbl->GetInPlaceContext = (HRESULT(__stdcall *) (IRichEditOleCallback *, LPOLEINPLACEFRAME *, LPOLEINPLACEUIWINDOW *, LPOLEINPLACEFRAMEINFO))
- CREOleCallback_GetInPlaceContext;
- reOleCallback2.lpVtbl->GetNewStorage = (HRESULT(__stdcall *) (IRichEditOleCallback *, LPSTORAGE *)) CREOleCallback_GetNewStorage;
- reOleCallback2.lpVtbl->QueryAcceptData = (HRESULT(__stdcall *) (IRichEditOleCallback *, LPDATAOBJECT, CLIPFORMAT *, DWORD, BOOL, HGLOBAL)) CREOleCallback_QueryAcceptData2;
- reOleCallback2.lpVtbl->QueryInsertObject = (HRESULT(__stdcall *) (IRichEditOleCallback *, LPCLSID, LPSTORAGE, LONG)) CREOleCallback_QueryInsertObject;
- reOleCallback2.lpVtbl->ShowContainerUI = (HRESULT(__stdcall *) (IRichEditOleCallback *, BOOL)) CREOleCallback_ShowContainerUI;
- reOleCallback2.refCount = 0;
-}
+ return S_OK;
+} \ No newline at end of file
diff --git a/plugins/Scriver/msgs.h b/plugins/Scriver/msgs.h
index a020ca929b..e17c63897d 100644
--- a/plugins/Scriver/msgs.h
+++ b/plugins/Scriver/msgs.h
@@ -122,7 +122,7 @@ typedef struct CommonWindowDataStruct {
int minEditBoxHeight;
}CommonWindowData;
-struct MessageWindowData
+struct SrmmWindowData
{
HWND hwnd;
int tabId;
@@ -202,18 +202,33 @@ struct MessageWindowData
#define EVENTTYPE_JABBER_PRESENCE 2001
#define EVENTTYPE_STATUSCHANGE 25368
-struct CREOleCallback
+struct CREOleCallback : public IRichEditOleCallback
{
- IRichEditOleCallbackVtbl *lpVtbl;
+ CREOleCallback() : refCount(0) {}
unsigned refCount;
IStorage *pictStg;
int nextStgId;
+
+ STDMETHOD(QueryInterface)(REFIID riid, LPVOID FAR * lplpObj);
+ STDMETHOD_(ULONG,AddRef) (THIS);
+ STDMETHOD_(ULONG,Release) (THIS);
+
+ STDMETHOD(ContextSensitiveHelp)(BOOL fEnterMode);
+ STDMETHOD(GetNewStorage) (LPSTORAGE FAR * lplpstg);
+ STDMETHOD(GetInPlaceContext) (LPOLEINPLACEFRAME FAR * lplpFrame, LPOLEINPLACEUIWINDOW FAR * lplpDoc, LPOLEINPLACEFRAMEINFO lpFrameInfo);
+ STDMETHOD(ShowContainerUI) (BOOL fShow);
+ STDMETHOD(QueryInsertObject) (LPCLSID lpclsid, LPSTORAGE lpstg, LONG cp);
+ STDMETHOD(DeleteObject) (LPOLEOBJECT lpoleobj);
+ STDMETHOD(QueryAcceptData) (LPDATAOBJECT lpdataobj, CLIPFORMAT FAR * lpcfFormat, DWORD reco, BOOL fReally, HGLOBAL hMetaPict);
+ STDMETHOD(GetClipboardData) (CHARRANGE FAR * lpchrg, DWORD reco, LPDATAOBJECT FAR * lplpdataobj);
+ STDMETHOD(GetDragDropEffect) (BOOL fDrag, DWORD grfKeyState, LPDWORD pdwEffect);
+ STDMETHOD(GetContextMenu) (WORD seltype, LPOLEOBJECT lpoleobj, CHARRANGE FAR * lpchrg, HMENU FAR * lphmenu) ;
};
INT_PTR CALLBACK DlgProcParentWindow(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lParam);
INT_PTR CALLBACK DlgProcMessage(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lParam);
INT_PTR CALLBACK ErrorDlgProc(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lParam);
-int DbEventIsShown(DBEVENTINFO * dbei, struct MessageWindowData *dat);
+int DbEventIsShown(DBEVENTINFO * dbei, struct SrmmWindowData *dat);
int DbEventIsCustomForMsgWindow(DBEVENTINFO *dbei);
int DbEventIsMessageOrCustom(DBEVENTINFO *dbei);
int safe_wcslen(wchar_t *msg, int maxLen);
diff --git a/plugins/Scriver/msgwindow.cpp b/plugins/Scriver/msgwindow.cpp
index 1bda12f9db..37a1bd6c3d 100644
--- a/plugins/Scriver/msgwindow.cpp
+++ b/plugins/Scriver/msgwindow.cpp
@@ -25,13 +25,6 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
#include "statusicon.h"
#include "chat/chat.h"
-#ifndef __MINGW32__
-#if (_MSC_VER < 1300)
-#include "multimon.h"
-#endif
-#endif
-
-extern HINSTANCE g_hInst;
extern HCURSOR hDragCursor;
extern ITaskbarList3 * pTaskbarInterface;
@@ -1055,7 +1048,7 @@ INT_PTR CALLBACK DlgProcParentWindow(HWND hwndDlg, UINT msg, WPARAM wParam, LPAR
SendMessage(hwndDlg, WM_SETICON, ICON_BIG, (LPARAM) tbd->hIconBig);
}
if (pTaskbarInterface)
- pTaskbarInterface->lpVtbl->SetOverlayIcon(pTaskbarInterface, hwndDlg, tbd->hIconNot, L"");
+ pTaskbarInterface->SetOverlayIcon(hwndDlg, tbd->hIconNot, L"");
}
}
break;
@@ -1490,7 +1483,7 @@ BOOL CALLBACK TabCtrlProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam)
pt.x -= rect.left;
pt.y -= rect.top;
hBmp = CreateCompatibleBitmap(hdc, info.rcImage.right - info.rcImage.left + 1, info.rcImage.bottom - info.rcImage.top + 1);
- hOldBitmap = SelectObject(hdcMem, hBmp);
+ hOldBitmap = (HBITMAP)SelectObject(hdcMem, hBmp);
SetPixel(hdcMem, pt.x, pt.y, 0x000000);
ImageList_DrawEx(g_dat->hButtonIconList, 0, hdcMem, 0, 0, 0, 0, CLR_NONE, CLR_NONE, ILD_NORMAL);
color1 = GetPixel(hdcMem, pt.x, pt.y);
@@ -1546,7 +1539,7 @@ BOOL CALLBACK TabCtrlProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam)
hDC = GetDC(hwnd);
hMemDC = CreateCompatibleDC(hDC);
hBitmap = CreateCompatibleBitmap(hDC, rect.right, rect.bottom);
- hOldBitmap = SelectObject(hMemDC, hBitmap);
+ hOldBitmap = (HBITMAP)SelectObject(hMemDC, hBitmap);
FillRect(hMemDC, &rect2, hBrush);
SetWindowOrgEx (hMemDC, rect.left, rect.top, NULL);
SendMessage(hwnd, WM_PRINTCLIENT, (WPARAM)hMemDC, PRF_CLIENT);
diff --git a/plugins/Scriver/scriver_10.vcxproj b/plugins/Scriver/scriver_10.vcxproj
index 605ab77242..3ee45fed0c 100644
--- a/plugins/Scriver/scriver_10.vcxproj
+++ b/plugins/Scriver/scriver_10.vcxproj
@@ -189,51 +189,51 @@
</Link>
</ItemDefinitionGroup>
<ItemGroup>
- <ClCompile Include="cmdlist.c" />
- <ClCompile Include="globals.c" />
- <ClCompile Include="infobar.c" />
- <ClCompile Include="input.c" />
- <ClCompile Include="msgdialog.c" />
- <ClCompile Include="msglog.c" />
- <ClCompile Include="msgoptions.c" />
- <ClCompile Include="msgs.c" />
- <ClCompile Include="msgtimedout.c" />
- <ClCompile Include="msgwindow.c" />
- <ClCompile Include="richutil.c" />
- <ClCompile Include="sendqueue.c" />
- <ClCompile Include="srmm.c">
+ <ClCompile Include="cmdlist.cpp" />
+ <ClCompile Include="globals.cpp" />
+ <ClCompile Include="infobar.cpp" />
+ <ClCompile Include="input.cpp" />
+ <ClCompile Include="msgdialog.cpp" />
+ <ClCompile Include="msglog.cpp" />
+ <ClCompile Include="msgoptions.cpp" />
+ <ClCompile Include="msgs.cpp" />
+ <ClCompile Include="msgtimedout.cpp" />
+ <ClCompile Include="msgwindow.cpp" />
+ <ClCompile Include="richutil.cpp" />
+ <ClCompile Include="sendqueue.cpp" />
+ <ClCompile Include="srmm.cpp">
<PrecompiledHeader>Create</PrecompiledHeader>
</ClCompile>
- <ClCompile Include="statusicon.c" />
- <ClCompile Include="utils.c" />
- <ClCompile Include="chat\clist.c">
+ <ClCompile Include="statusicon.cpp" />
+ <ClCompile Include="utils.cpp" />
+ <ClCompile Include="chat\clist.cpp">
<PrecompiledHeaderFile>..\commonheaders.h</PrecompiledHeaderFile>
</ClCompile>
- <ClCompile Include="chat\colorchooser.c">
+ <ClCompile Include="chat\colorchooser.cpp">
<PrecompiledHeaderFile>..\commonheaders.h</PrecompiledHeaderFile>
</ClCompile>
- <ClCompile Include="chat\log.c">
+ <ClCompile Include="chat\log.cpp">
<PrecompiledHeaderFile>..\commonheaders.h</PrecompiledHeaderFile>
</ClCompile>
- <ClCompile Include="chat\main.c">
+ <ClCompile Include="chat\main.cpp">
<PrecompiledHeaderFile>..\commonheaders.h</PrecompiledHeaderFile>
</ClCompile>
- <ClCompile Include="chat\manager.c">
+ <ClCompile Include="chat\manager.cpp">
<PrecompiledHeaderFile>..\commonheaders.h</PrecompiledHeaderFile>
</ClCompile>
- <ClCompile Include="chat\message.c">
+ <ClCompile Include="chat\message.cpp">
<PrecompiledHeaderFile>..\commonheaders.h</PrecompiledHeaderFile>
</ClCompile>
- <ClCompile Include="chat\options.c">
+ <ClCompile Include="chat\options.cpp">
<PrecompiledHeaderFile>..\commonheaders.h</PrecompiledHeaderFile>
</ClCompile>
- <ClCompile Include="chat\services.c">
+ <ClCompile Include="chat\services.cpp">
<PrecompiledHeaderFile>..\commonheaders.h</PrecompiledHeaderFile>
</ClCompile>
- <ClCompile Include="chat\tools.c">
+ <ClCompile Include="chat\tools.cpp">
<PrecompiledHeaderFile>..\commonheaders.h</PrecompiledHeaderFile>
</ClCompile>
- <ClCompile Include="chat\window.c">
+ <ClCompile Include="chat\window.cpp">
<PrecompiledHeaderFile>..\commonheaders.h</PrecompiledHeaderFile>
</ClCompile>
</ItemGroup>
diff --git a/plugins/Scriver/scriver_10.vcxproj.filters b/plugins/Scriver/scriver_10.vcxproj.filters
index 1c59b4ccab..a2c076fb13 100644
--- a/plugins/Scriver/scriver_10.vcxproj.filters
+++ b/plugins/Scriver/scriver_10.vcxproj.filters
@@ -21,79 +21,79 @@
</Filter>
</ItemGroup>
<ItemGroup>
- <ClCompile Include="cmdlist.c">
+ <ClCompile Include="cmdlist.cpp">
<Filter>Source Files</Filter>
</ClCompile>
- <ClCompile Include="globals.c">
+ <ClCompile Include="globals.cpp">
<Filter>Source Files</Filter>
</ClCompile>
- <ClCompile Include="infobar.c">
+ <ClCompile Include="infobar.cpp">
<Filter>Source Files</Filter>
</ClCompile>
- <ClCompile Include="input.c">
+ <ClCompile Include="input.cpp">
<Filter>Source Files</Filter>
</ClCompile>
- <ClCompile Include="msgdialog.c">
+ <ClCompile Include="msgdialog.cpp">
<Filter>Source Files</Filter>
</ClCompile>
- <ClCompile Include="msglog.c">
+ <ClCompile Include="msglog.cpp">
<Filter>Source Files</Filter>
</ClCompile>
- <ClCompile Include="msgoptions.c">
+ <ClCompile Include="msgoptions.cpp">
<Filter>Source Files</Filter>
</ClCompile>
- <ClCompile Include="msgs.c">
+ <ClCompile Include="msgs.cpp">
<Filter>Source Files</Filter>
</ClCompile>
- <ClCompile Include="msgtimedout.c">
+ <ClCompile Include="msgtimedout.cpp">
<Filter>Source Files</Filter>
</ClCompile>
- <ClCompile Include="msgwindow.c">
+ <ClCompile Include="msgwindow.cpp">
<Filter>Source Files</Filter>
</ClCompile>
- <ClCompile Include="richutil.c">
+ <ClCompile Include="richutil.cpp">
<Filter>Source Files</Filter>
</ClCompile>
- <ClCompile Include="sendqueue.c">
+ <ClCompile Include="sendqueue.cpp">
<Filter>Source Files</Filter>
</ClCompile>
- <ClCompile Include="srmm.c">
+ <ClCompile Include="srmm.cpp">
<Filter>Source Files</Filter>
</ClCompile>
- <ClCompile Include="statusicon.c">
+ <ClCompile Include="statusicon.cpp">
<Filter>Source Files</Filter>
</ClCompile>
- <ClCompile Include="utils.c">
+ <ClCompile Include="utils.cpp">
<Filter>Source Files</Filter>
</ClCompile>
- <ClCompile Include="chat\clist.c">
+ <ClCompile Include="chat\clist.cpp">
<Filter>Source Files\chat</Filter>
</ClCompile>
- <ClCompile Include="chat\colorchooser.c">
+ <ClCompile Include="chat\colorchooser.cpp">
<Filter>Source Files\chat</Filter>
</ClCompile>
- <ClCompile Include="chat\log.c">
+ <ClCompile Include="chat\log.cpp">
<Filter>Source Files\chat</Filter>
</ClCompile>
- <ClCompile Include="chat\main.c">
+ <ClCompile Include="chat\main.cpp">
<Filter>Source Files\chat</Filter>
</ClCompile>
- <ClCompile Include="chat\manager.c">
+ <ClCompile Include="chat\manager.cpp">
<Filter>Source Files\chat</Filter>
</ClCompile>
- <ClCompile Include="chat\message.c">
+ <ClCompile Include="chat\message.cpp">
<Filter>Source Files\chat</Filter>
</ClCompile>
- <ClCompile Include="chat\options.c">
+ <ClCompile Include="chat\options.cpp">
<Filter>Source Files\chat</Filter>
</ClCompile>
- <ClCompile Include="chat\services.c">
+ <ClCompile Include="chat\services.cpp">
<Filter>Source Files\chat</Filter>
</ClCompile>
- <ClCompile Include="chat\tools.c">
+ <ClCompile Include="chat\tools.cpp">
<Filter>Source Files\chat</Filter>
</ClCompile>
- <ClCompile Include="chat\window.c">
+ <ClCompile Include="chat\window.cpp">
<Filter>Source Files\chat</Filter>
</ClCompile>
</ItemGroup>
diff --git a/plugins/Scriver/sendqueue.cpp b/plugins/Scriver/sendqueue.cpp
index 33517507dc..1a85d67d4f 100644
--- a/plugins/Scriver/sendqueue.cpp
+++ b/plugins/Scriver/sendqueue.cpp
@@ -22,8 +22,6 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/
#include "commonheaders.h"
-extern HINSTANCE g_hInst;
-
static MessageSendQueueItem *global_sendQueue = NULL;
static CRITICAL_SECTION queueMutex;
static char *MsgServiceName(HANDLE hContact)
diff --git a/plugins/Scriver/srmm.cpp b/plugins/Scriver/srmm.cpp
index d635fe47c5..41f4ceb009 100644
--- a/plugins/Scriver/srmm.cpp
+++ b/plugins/Scriver/srmm.cpp
@@ -56,20 +56,18 @@ BOOL WINAPI DllMain(HINSTANCE hinstDLL, DWORD fdwReason, LPVOID lpvReserved)
return TRUE;
}
-__declspec(dllexport)
- PLUGININFOEX *MirandaPluginInfoEx(DWORD mirandaVersion)
+extern "C" __declspec(dllexport) PLUGININFOEX *MirandaPluginInfoEx(DWORD mirandaVersion)
{
return &pluginInfo;
}
static const MUUID interfaces[] = {MIID_SRMM, MIID_CHAT, MIID_LAST};
-__declspec(dllexport)
- const MUUID* MirandaPluginInterfaces(void)
+extern "C" __declspec(dllexport) const MUUID* MirandaPluginInterfaces(void)
{
return interfaces;
}
-int __declspec(dllexport) Load(PLUGINLINK * link)
+extern "C" __declspec(dllexport) int Load(PLUGINLINK * link)
{
pluginLink = link;
@@ -81,16 +79,16 @@ int __declspec(dllexport) Load(PLUGINLINK * link)
mir_getLP( &pluginInfo );
if (IsWinVer7Plus())
- CoCreateInstance(&CLSID_TaskbarList, NULL, CLSCTX_ALL, &IID_ITaskbarList3, (void**)&pTaskbarInterface);
+ CoCreateInstance(CLSID_TaskbarList, NULL, CLSCTX_ALL, IID_ITaskbarList3, (void**)&pTaskbarInterface);
InitSendQueue();
return OnLoadModule();
}
-int __declspec(dllexport) Unload(void)
+extern "C" __declspec(dllexport) int Unload(void)
{
DestroySendQueue();
if (pTaskbarInterface)
- pTaskbarInterface->lpVtbl->Release(pTaskbarInterface);
+ pTaskbarInterface->Release();
return OnUnloadModule();
}
diff --git a/plugins/Scriver/utils.cpp b/plugins/Scriver/utils.cpp
index 8a87b5a5cb..c2227ec745 100644
--- a/plugins/Scriver/utils.cpp
+++ b/plugins/Scriver/utils.cpp
@@ -25,7 +25,6 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
#ifndef TTI_NONE
#define TTI_NONE 0
#endif
-extern HANDLE g_hInst;
static unsigned hookNum = 0;
static unsigned serviceNum = 0;
@@ -247,14 +246,14 @@ static DWORD CALLBACK RichTextStreamCallback(DWORD_PTR dwCookie, LPBYTE pbBuff,
char ** ppText = (char **) dwCookie;
if (*ppText == NULL) {
- *ppText = mir_alloc(cb + 1);
+ *ppText = (char *)mir_alloc(cb + 1);
memcpy(*ppText, pbBuff, cb);
(*ppText)[cb] = 0;
*pcb = cb;
dwRead = cb;
}
else {
- char *p = mir_alloc(dwRead + cb + 1);
+ char *p = (char *)mir_alloc(dwRead + cb + 1);
memcpy(p, *ppText, dwRead);
memcpy(p+dwRead, pbBuff, cb);
p[dwRead + cb] = 0;
@@ -534,7 +533,7 @@ void SetSearchEngineIcons(HMENU hMenu, HIMAGELIST hImageList) {
}
}
-void GetContactUniqueId(struct MessageWindowData *dat, char *buf, int maxlen) {
+void GetContactUniqueId(struct SrmmWindowData *dat, char *buf, int maxlen) {
CONTACTINFO ci;
ZeroMemory(&ci, sizeof(ci));
ci.cbSize = sizeof(ci);
diff --git a/plugins/Scriver/utils.h b/plugins/Scriver/utils.h
index f92375f161..0d3b3ab4e1 100644
--- a/plugins/Scriver/utils.h
+++ b/plugins/Scriver/utils.h
@@ -63,7 +63,7 @@ extern void AppendToBuffer(char **buffer, int *cbBufferEnd, int *cbBufferAlloced
extern int MeasureMenuItem(WPARAM wParam, LPARAM lParam);
extern int DrawMenuItem(WPARAM wParam, LPARAM lParam);
extern void SetSearchEngineIcons(HMENU hMenu, HIMAGELIST hImageList);
-extern void GetContactUniqueId(struct MessageWindowData *dat, char *buf, int maxlen);
+extern void GetContactUniqueId(struct SrmmWindowData *dat, char *buf, int maxlen);
HWND CreateToolTip(HWND hwndParent, LPTSTR ptszText, LPTSTR ptszTitle, RECT *rect);
void SetToolTipText(HWND hwndParent, HWND hwndTT, LPTSTR ptszText, LPTSTR ptszTitle);
void SetToolTipRect(HWND hwndParent, HWND hwndTT, RECT* rect);