summaryrefslogtreecommitdiff
path: root/plugins/FloatingContacts
diff options
context:
space:
mode:
authorGeorge Hazan <george.hazan@gmail.com>2012-06-02 20:55:18 +0000
committerGeorge Hazan <george.hazan@gmail.com>2012-06-02 20:55:18 +0000
commit78c0815c4118fe24ab78cce2dc48a6232dcd824a (patch)
tree8512c50df70b8dd80c919e88ade3419207c95956 /plugins/FloatingContacts
parentce816d83a8c75808e0eb06832592bffefe4a8dc4 (diff)
- code cleaning
git-svn-id: http://svn.miranda-ng.org/main/trunk@270 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'plugins/FloatingContacts')
-rw-r--r--plugins/FloatingContacts/bitmap_funcs.cpp105
-rw-r--r--plugins/FloatingContacts/bitmap_funcs.h2
-rw-r--r--plugins/FloatingContacts/filedrop.cpp52
-rw-r--r--plugins/FloatingContacts/filedrop.h2
-rw-r--r--plugins/FloatingContacts/main.cpp629
-rw-r--r--plugins/FloatingContacts/options.cpp70
-rw-r--r--plugins/FloatingContacts/thumbs.cpp170
7 files changed, 500 insertions, 530 deletions
diff --git a/plugins/FloatingContacts/bitmap_funcs.cpp b/plugins/FloatingContacts/bitmap_funcs.cpp
index 3d92e7a9d8..a99b5c4afe 100644
--- a/plugins/FloatingContacts/bitmap_funcs.cpp
+++ b/plugins/FloatingContacts/bitmap_funcs.cpp
@@ -97,16 +97,12 @@ void MyBitmap::setAlphaRect(int x1, int y1, int x2, int y2, BYTE level)
GdiFlush();
for (int i = y1; i < y2; i++)
- for (int j = x1; j < x2; j++)
- {
+ for (int j = x1; j < x2; j++) {
int idx = i * width + j;
if (bits[idx] & 0xff000000)
- {
bits[idx] = rgba(getr(bits[idx])*level/255, getg(bits[idx])*level/255, getb(bits[idx])*level/255, geta(bits[idx])*level/255);
- } else
- {
+ else
bits[idx] = rgba(getr(bits[idx])*level/255, getg(bits[idx])*level/255, getb(bits[idx])*level/255, level);
- }
}
}
@@ -125,8 +121,7 @@ void MyBitmap::makeOpaqueRect(int x1, int y1, int x2, int y2)
GdiFlush();
for (int i = y1; i < y2; i++)
- for (int j = x1; j < x2; j++)
- {
+ for (int j = x1; j < x2; j++) {
int idx = i * width + j;
bits[idx] |= 0xff000000;
}
@@ -155,7 +150,7 @@ void MyBitmap::saveAlpha(int x, int y, int w, int h)
{
if (j+x < 0) continue;
if (j+x >= width) break;
- *p1++ = *p2++;
+ *p1++=*p2++;
}
}
}
@@ -636,8 +631,8 @@ void MyBitmap::DrawNoAlpha(MyBitmap *bmp, int x, int y, int w, int h)
static __forceinline int ReadP(long *p, int w, int h, int x, int y, int k)
{
- if (x<0) x=0; else if (x>=w) x=w-1;
- if (y<0) y=0; else if (y>=h) y=h-1;
+ if (x<0) x = 0; else if (x>=w) x = w-1;
+ if (y<0) y = 0; else if (y>=h) y = h-1;
return p[(x+y*w)*4+k];
}
@@ -682,9 +677,9 @@ void MyBitmap::Blur(int w, int h)
dst = buf_dst;
float mul = 1.f/((w*2+1)*(h*2+1));
- for (y=0;y<height;y++)
+ for (y = 0;y<height;y++)
{
- for (int x=0;x<width;x++)
+ for (int x = 0;x<width;x++)
{
for (int k = 0; k < 4; ++k)
{
@@ -805,23 +800,23 @@ void MyBitmap::DrawText(TCHAR *str, int x, int y, int blur, int strength)
sz.cx += (blur+2)*2; sz.cy += (blur+2)*2;
x -= blur+2; y -= blur+2;
- static BYTE pbGammaWeight[256]={0};
- static BOOL bGammaWeightFilled=FALSE;
+ static BYTE pbGammaWeight[256] = {0};
+ static BOOL bGammaWeightFilled = FALSE;
if (!bGammaWeightFilled)
{
int i;
- for(i=0;i<256;i++)
+ for(i = 0;i<256;i++)
{
double f;
- double gamma=(double)700/1000;
+ double gamma = (double)700/1000;
- f=(double)i/255;
- f=pow(f,(1/gamma));
+ f = (double)i/255;
+ f = pow(f,(1/gamma));
- pbGammaWeight[i]=(BYTE)(255*f);
+ pbGammaWeight[i] = (BYTE)(255*f);
}
- bGammaWeightFilled=1;
+ bGammaWeightFilled = 1;
}
MyBitmap tmp(sz.cx, sz.cy);
@@ -875,22 +870,22 @@ void MyBitmap::DrawText(TCHAR *str, int x, int y, int blur, int strength)
{
COLOR32 bx,rx,gx,mx;
{
- bx=pbGammaWeight[getb(row_src[j])];
- gx=pbGammaWeight[getg(row_src[j])];
- rx=pbGammaWeight[getr(row_src[j])];
+ bx = pbGammaWeight[getb(row_src[j])];
+ gx = pbGammaWeight[getg(row_src[j])];
+ rx = pbGammaWeight[getr(row_src[j])];
}
- bx=(pbGammaWeight[bx]*(255-b)+bx*(b))/255;
- gx=(pbGammaWeight[gx]*(255-g)+gx*(g))/255;
- rx=(pbGammaWeight[rx]*(255-r)+rx*(r))/255;
+ bx = (pbGammaWeight[bx]*(255-b)+bx*(b))/255;
+ gx = (pbGammaWeight[gx]*(255-g)+gx*(g))/255;
+ rx = (pbGammaWeight[rx]*(255-r)+rx*(r))/255;
- mx=(BYTE)(max(max(bx,rx),gx));
+ mx = (BYTE)(max(max(bx,rx),gx));
if (1)
{
- bx=(bx<mx)?(BYTE)(((WORD)bx*7+(WORD)mx)>>3):bx;
- rx=(rx<mx)?(BYTE)(((WORD)rx*7+(WORD)mx)>>3):rx;
- gx=(gx<mx)?(BYTE)(((WORD)gx*7+(WORD)mx)>>3):gx;
+ bx = (bx<mx)?(BYTE)(((WORD)bx*7+(WORD)mx)>>3):bx;
+ rx = (rx<mx)?(BYTE)(((WORD)rx*7+(WORD)mx)>>3):rx;
+ gx = (gx<mx)?(BYTE)(((WORD)gx*7+(WORD)mx)>>3):gx;
// reduce boldeness at white fonts
}
COLOR32 cl = row_dst[j];
@@ -898,24 +893,24 @@ void MyBitmap::DrawText(TCHAR *str, int x, int y, int blur, int strength)
{
COLOR32 rrx,grx,brx;
COLOR32 rlx,glx,blx;
- COLOR32 axx=geta(cl);
- COLOR32 mmx=(bx+gx+rx)/3;
- COLOR32 nx=mmx;;//pbGammaWeight[mx];//
+ COLOR32 axx = geta(cl);
+ COLOR32 mmx = (bx+gx+rx)/3;
+ COLOR32 nx = mmx;;//pbGammaWeight[mx];//
{
//Normalize components to alpha level
- bx=(nx*(255-axx)+bx*axx)/255;
- gx=(nx*(255-axx)+gx*axx)/255;
- rx=(nx*(255-axx)+rx*axx)/255;
- mx=(nx*(255-axx)+mmx*axx)/255;
+ bx = (nx*(255-axx)+bx*axx)/255;
+ gx = (nx*(255-axx)+gx*axx)/255;
+ rx = (nx*(255-axx)+rx*axx)/255;
+ mx = (nx*(255-axx)+mmx*axx)/255;
}
{
blx = getb(cl);
glx = getg(cl);
rlx = getr(cl);
- brx=(b-blx)*bx/255;
- grx=(g-glx)*gx/255;
- rrx=(r-rlx)*rx/255;
+ brx = (b-blx)*bx/255;
+ grx = (g-glx)*gx/255;
+ rrx = (r-rlx)*rx/255;
row_dst[j] = rgba(rlx+rrx, glx+grx, blx+brx, mx+(255-mx)*axx/255);
}
}
@@ -924,7 +919,7 @@ void MyBitmap::DrawText(TCHAR *str, int x, int y, int blur, int strength)
}
// based on code by Yuriy Zaporozhets from:
-// http://www.codeproject.com/gdi/coolrgn.asp?df=100&forumid=739&exp=0&select=6341
+// http://www.codeproject.com/gdi/coolrgn.asp?df = 100&forumid = 739&exp = 0&select = 6341
// slightly modified to integrate with MyBitmap class.
HRGN MyBitmap::buildOpaqueRgn(int level, bool opaque)
{
@@ -1008,7 +1003,7 @@ static int hex2dec(char hex)
bool MyBitmap::loadFromFile_pixel(const char *fn, const char *fnAlpha)
{
allocate(1,1);
- int r, g, b, a=255;
+ int r, g, b, a = 255;
const char *p = fn + lstrlenA("pixel:");
r = (hex2dec(p[0]) << 4) + hex2dec(p[1]);
g = (hex2dec(p[2]) << 4) + hex2dec(p[3]);
@@ -1024,7 +1019,7 @@ bool MyBitmap::loadFromFile_gradient(const char *fn, const char *fnAlpha)
if (*p == 'h') allocate(256,1);
else allocate(1,256);
- int r, g, b, a=255;
+ int r, g, b, a = 255;
p += 2;
r = (hex2dec(p[0]) << 4) + hex2dec(p[1]);
@@ -1082,8 +1077,8 @@ bool MyBitmap::loadFromFile_png(const char *fn, const char *fnAlpha)
if (!cbFileSize) return false;
- BITMAPINFO *bi=(BITMAPINFO*)pDib;
- BYTE *pt=(BYTE*)bi;
+ BITMAPINFO *bi = (BITMAPINFO*)pDib;
+ BYTE *pt = (BYTE*)bi;
pt+=bi->bmiHeader.biSize;
if (bi->bmiHeader.biBitCount != 32)
@@ -1099,16 +1094,16 @@ bool MyBitmap::loadFromFile_png(const char *fn, const char *fnAlpha)
} else
{
allocate(abs(bi->bmiHeader.biWidth), abs(bi->bmiHeader.biHeight));
- BYTE *p2=(BYTE *)pt;
- for (int y=0; y<bi->bmiHeader.biHeight; ++y)
+ BYTE *p2 = (BYTE *)pt;
+ for (int y = 0; y<bi->bmiHeader.biHeight; ++y)
{
- BYTE *p1=(BYTE *)bits + (bi->bmiHeader.biHeight-y-1)*bi->bmiHeader.biWidth*4;
- for (int x=0; x<bi->bmiHeader.biWidth; ++x)
+ BYTE *p1 = (BYTE *)bits + (bi->bmiHeader.biHeight-y-1)*bi->bmiHeader.biWidth*4;
+ for (int x = 0; x<bi->bmiHeader.biWidth; ++x)
{
- p1[0]= p2[0];
- p1[1]= p2[1];
- p1[2]= p2[2];
- p1[3]= p2[3];
+ p1[0] = p2[0];
+ p1[1] = p2[1];
+ p1[2] = p2[2];
+ p1[3] = p2[3];
p1 += 4;
p2 += 4;
}
@@ -1138,7 +1133,7 @@ bool MyBitmap::loadFromFile_default(const char *fn, const char *fnAlpha)
HDC dcTmp = CreateCompatibleDC(0);
GetBitmapDimensionEx(hBmpLoaded, &sz);
- HBITMAP hBmpDcSave = (HBITMAP)SelectObject(dcTmp, hBmpLoaded);
+ HBITMAP hBmpDcSave = (HBITMAP)SelectObject(dcTmp, hBmpLoaded);
allocate(sz.cx, sz.cy);
BitBlt(dcBmp, 0, 0, width, height, dcTmp, 0, 0, SRCCOPY);
diff --git a/plugins/FloatingContacts/bitmap_funcs.h b/plugins/FloatingContacts/bitmap_funcs.h
index b7f55a43d7..85bbee2004 100644
--- a/plugins/FloatingContacts/bitmap_funcs.h
+++ b/plugins/FloatingContacts/bitmap_funcs.h
@@ -94,7 +94,7 @@ public:
void IncreaseAlpha(float q);
void DrawIcon(HICON hic, int x, int y, int w = 0, int h = 0);
- void DrawText(TCHAR *str, int x, int y, int blur=0, int strength = 0);
+ void DrawText(TCHAR *str, int x, int y, int blur = 0, int strength = 0);
__forceinline COLOR32 *getBits() { return bits; }
__forceinline COLOR32 *getRow(int row) { return bits + row * width; }
diff --git a/plugins/FloatingContacts/filedrop.cpp b/plugins/FloatingContacts/filedrop.cpp
index 09fe2dace2..caf87577c4 100644
--- a/plugins/FloatingContacts/filedrop.cpp
+++ b/plugins/FloatingContacts/filedrop.cpp
@@ -13,7 +13,7 @@ HRESULT STDMETHODCALLTYPE CDropTarget::QueryInterface(REFIID riid,LPVOID *ppvObj
return S_OK;
}
- *ppvObj=NULL;
+ *ppvObj = NULL;
return ( E_NOINTERFACE );
}
@@ -35,7 +35,7 @@ HRESULT STDMETHODCALLTYPE CDropTarget::DragOver( DWORD fKeyState, POINTL pt, DWO
{
*pdwEffect = 0;
- if( hwndCurDrag == NULL )
+ if ( hwndCurDrag == NULL )
{
*pdwEffect = DROPEFFECT_NONE;
}
@@ -49,17 +49,17 @@ HRESULT STDMETHODCALLTYPE CDropTarget::DragOver( DWORD fKeyState, POINTL pt, DWO
HRESULT STDMETHODCALLTYPE CDropTarget::DragEnter( IDataObject *pData, DWORD fKeyState, POINTL pt, DWORD *pdwEffect)
{
- HWND hwnd = NULL;
+ HWND hwnd = NULL;
POINT shortPt;
- FORMATETC feFile = { CF_HDROP, NULL, DVASPECT_CONTENT, -1, TYMED_HGLOBAL };
- FORMATETC feText = { CF_TEXT, NULL, DVASPECT_CONTENT, -1, TYMED_HGLOBAL };
+ FORMATETC feFile = { CF_HDROP, NULL, DVASPECT_CONTENT, -1, TYMED_HGLOBAL };
+ FORMATETC feText = { CF_TEXT, NULL, DVASPECT_CONTENT, -1, TYMED_HGLOBAL };
ThumbInfo *pThumb;
if ( S_OK == pData->QueryGetData( &feFile ) ||
S_OK == pData->QueryGetData( &feText ) )
{
- shortPt.x = pt.x;
- shortPt.y = pt.y;
+ shortPt.x = pt.x;
+ shortPt.y = pt.y;
hwnd = WindowFromPoint( shortPt );
@@ -91,19 +91,19 @@ HRESULT STDMETHODCALLTYPE CDropTarget::DragLeave( )
HRESULT STDMETHODCALLTYPE CDropTarget::Drop( IDataObject *pData,DWORD fKeyState,POINTL pt,DWORD *pdwEffect)
{
- FORMATETC fe = { CF_HDROP, NULL, DVASPECT_CONTENT, -1, TYMED_HGLOBAL };
+ FORMATETC fe = { CF_HDROP, NULL, DVASPECT_CONTENT, -1, TYMED_HGLOBAL };
STGMEDIUM stg;
- HDROP hDrop = NULL;
- ThumbInfo *pThumb = NULL;
- char *pText = NULL;
+ HDROP hDrop = NULL;
+ ThumbInfo *pThumb = NULL;
+ char *pText = NULL;
BOOL bFormatText = FALSE;
*pdwEffect = DROPEFFECT_NONE;
- if( hwndCurDrag == NULL ) return( S_OK );
+ if ( hwndCurDrag == NULL ) return( S_OK );
- pThumb = (ThumbInfo*)GetWindowLong( hwndCurDrag, GWL_USERDATA );
+ pThumb = (ThumbInfo*)GetWindowLong( hwndCurDrag, GWLP_USERDATA );
if ( pThumb == NULL ) return( S_OK );
if ( S_OK != pData->GetData( &fe,&stg ) )
@@ -124,7 +124,7 @@ HRESULT STDMETHODCALLTYPE CDropTarget::Drop( IDataObject *pData,DWORD fKeyState,
if ( !bFormatText )
{
- hDrop = (HDROP)stg.hGlobal;
+ hDrop = (HDROP)stg.hGlobal;
if ( hDrop != NULL )
{
@@ -142,7 +142,7 @@ HRESULT STDMETHODCALLTYPE CDropTarget::Drop( IDataObject *pData,DWORD fKeyState,
}
}
- if( stg.pUnkForRelease != NULL )
+ if ( stg.pUnkForRelease != NULL )
{
stg.pUnkForRelease->Release( );
}
@@ -161,12 +161,12 @@ HRESULT STDMETHODCALLTYPE CDropTarget::Drop( IDataObject *pData,DWORD fKeyState,
BOOL OnDropFiles( HDROP hDrop, ThumbInfo *pThumb )
{
- BOOL bSuccess = FALSE;
- UINT nFilesCount = 0;
- UINT iItem = 0;
- char **ppFiles = NULL;
- char **ppDroppedItems = NULL;
- UINT nDroppedItemsCount = 0;
+ BOOL bSuccess = FALSE;
+ UINT nFilesCount = 0;
+ UINT iItem = 0;
+ char **ppFiles = NULL;
+ char **ppDroppedItems = NULL;
+ UINT nDroppedItemsCount = 0;
char szFilename[ MAX_PATH ];
@@ -181,7 +181,7 @@ BOOL OnDropFiles( HDROP hDrop, ThumbInfo *pThumb )
ppDroppedItems[ nDroppedItemsCount ] = NULL;
- for( iItem = 0; iItem < nDroppedItemsCount; ++iItem )
+ for ( iItem = 0; iItem < nDroppedItemsCount; ++iItem )
{
DragQueryFileA( hDrop, iItem, szFilename, sizeof( szFilename ) );
ppDroppedItems[ iItem ] = _strdup( szFilename );
@@ -203,14 +203,14 @@ BOOL OnDropFiles( HDROP hDrop, ThumbInfo *pThumb )
bSuccess = (BOOL)CallService( MS_CLIST_CONTACTFILESDROPPED, (WPARAM)pThumb->hContact, (LPARAM)ppFiles );
// Cleanup
- for( iItem = 0; ppDroppedItems[ iItem ]; ++iItem )
+ for ( iItem = 0; ppDroppedItems[ iItem ]; ++iItem )
{
free( ppDroppedItems[ iItem ] );
}
free( ppDroppedItems );
- for( iItem = 0; iItem < nFilesCount ; ++iItem )
+ for ( iItem = 0; iItem < nFilesCount ; ++iItem )
{
free( ppFiles[ iItem ] );
}
@@ -324,7 +324,7 @@ static void ProcessDroppedItems( char **ppDroppedItems, int nCount, char **ppFil
int i;
int fileCount = 0;
- for( i = 0; i < nCount; ++i )
+ for ( i = 0; i < nCount; ++i )
{
SaveFiles( ppDroppedItems[ i ], ppFiles, &fileCount );
}
@@ -336,7 +336,7 @@ static int CountDroppedFiles( char **ppDroppedItems, int nCount )
int fileCount = 0;
int i;
- for( i = 0; i < nCount; ++i )
+ for ( i = 0; i < nCount; ++i )
{
fileCount += CountFiles( ppDroppedItems[ i ] );
}
diff --git a/plugins/FloatingContacts/filedrop.h b/plugins/FloatingContacts/filedrop.h
index ed03cdbf68..b5c7f803aa 100644
--- a/plugins/FloatingContacts/filedrop.h
+++ b/plugins/FloatingContacts/filedrop.h
@@ -1,7 +1,7 @@
/* This file is a modification of clcfiledrop.h originally
written by Richard Hughes*/
-static HWND hwndCurDrag = NULL;
+static HWND hwndCurDrag = NULL;
class CDropTarget: public IDropTarget
{
diff --git a/plugins/FloatingContacts/main.cpp b/plugins/FloatingContacts/main.cpp
index 3abca83658..8c572e210d 100644
--- a/plugins/FloatingContacts/main.cpp
+++ b/plugins/FloatingContacts/main.cpp
@@ -28,9 +28,9 @@ No warranty for any misbehaviour.
//#define DB_POS_GETY(pos) HIWORD(pos)
//#define DB_POS_MAKE_XY(x, y) MAKELONG(x, y)
-BOOL (WINAPI *pSetLayeredWindowAttributes)(HWND,COLORREF,BYTE,DWORD);
+BOOL (WINAPI *pSetLayeredWindowAttributes)(HWND, COLORREF, BYTE, DWORD);
BOOL (WINAPI *pUpdateLayeredWindow)
- (HWND hwnd, HDC hdcDST, POINT *pptDst, SIZE *psize, HDC hdcSrc, POINT *pptSrc,
+ (HWND hwnd, HDC hdcDST, POINT *pptDst, SIZE *psize, HDC hdcSrc, POINT *pptSrc,
COLORREF crKey, BLENDFUNCTION *pblend, DWORD dwFlags);
// Globals
@@ -58,7 +58,7 @@ static int ClcStatusToPf2 ( int status );
static LRESULT __stdcall CommWndProc( HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam );
static LRESULT __stdcall newMirandaWndProc( HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam );
-static int OnContactDeleted ( WPARAM wParam,LPARAM lParam );
+static int OnContactDeleted ( WPARAM wParam, LPARAM lParam );
static int OnContactIconChanged ( WPARAM wParam, LPARAM lParam );
static int OnContactDrag ( WPARAM wParam, LPARAM lParam );
static int OnContactDrop ( WPARAM wParam, LPARAM lParam );
@@ -69,94 +69,93 @@ static int OnStatusModeChange ( WPARAM wParam, LPARAM lParam );
static int OnModulesLoded ( WPARAM wParam, LPARAM lParam );
static int OnPrebuildContactMenu ( WPARAM wParam, LPARAM lParam );
-static int OnContactMenu_Remove ( WPARAM wParam,LPARAM lParam );
-//static int OnContactMenu_HideAll ( WPARAM wParam,LPARAM lParam );
-static int OnMainMenu_HideAll ( WPARAM wParam,LPARAM lParam );
-static int OnHotKey_HideWhenCListShow( WPARAM wParam,LPARAM lParam );
+static INT_PTR OnContactMenu_Remove ( WPARAM wParam, LPARAM lParam );
+static INT_PTR OnMainMenu_HideAll ( WPARAM wParam, LPARAM lParam );
+static INT_PTR OnHotKey_HideWhenCListShow( WPARAM wParam, LPARAM lParam );
static VOID CALLBACK ToTopTimerProc ( HWND hwnd, UINT uMsg, UINT_PTR idEvent, DWORD dwTime);
WNDPROC oldMirandaWndProc;
-HINSTANCE hInst = NULL;
-HMODULE hUserDll = NULL;
-PLUGINLINK *pluginLink = NULL;
-LIST_INTERFACE li = {0};
-HFONT hFont[FLT_FONTIDS] = {NULL};
-COLORREF tColor[FLT_FONTIDS] = {0};
-HIMAGELIST himl = NULL;
-HANDLE hevContactIcon = NULL;
-HANDLE hevContactDrop = NULL;
-HANDLE hevContactDragStop = NULL;
-HANDLE hevSkinIcons = NULL;
-HANDLE hevContactDrag = NULL;
-HANDLE hevContactSetting = NULL;
-HANDLE hevContactDeleted = NULL;
-HANDLE hevOptionsInit = NULL;
-HANDLE hevStatusMode = NULL;
-HANDLE hevModules = NULL;
-HANDLE hevPrebuildMenu = NULL;
-HANDLE hNewContact = NULL;
-
-HPEN hLTEdgesPen = NULL;
-HPEN hRBEdgesPen = NULL;
-HBRUSH hBkBrush = NULL;
-DWORD bkColor = 0;
-HBITMAP hBmpBackground = NULL;
-WORD nBackgroundBmpUse = CLB_STRETCH;
-
-HWND hwndMiranda = NULL;
-BOOL bVersionOK = FALSE;
-BOOL bNT = FALSE;
-BOOL bDockHorz = TRUE;
-//UINT nStatus = 0;
-HMENU hContactMenu = NULL;
-HANDLE hMenuItemRemove = NULL;
-HANDLE hMenuItemHideAll = NULL;
-HANDLE hMainMenuItemHideAll = NULL;
+HINSTANCE hInst = NULL;
+HMODULE hUserDll = NULL;
+PLUGINLINK *pluginLink = NULL;
+LIST_INTERFACE li = {0};
+HFONT hFont[FLT_FONTIDS] = {NULL};
+COLORREF tColor[FLT_FONTIDS] = {0};
+HIMAGELIST himl = NULL;
+HANDLE hevContactIcon = NULL;
+HANDLE hevContactDrop = NULL;
+HANDLE hevContactDragStop = NULL;
+HANDLE hevSkinIcons = NULL;
+HANDLE hevContactDrag = NULL;
+HANDLE hevContactSetting = NULL;
+HANDLE hevContactDeleted = NULL;
+HANDLE hevOptionsInit = NULL;
+HANDLE hevStatusMode = NULL;
+HANDLE hevModules = NULL;
+HANDLE hevPrebuildMenu = NULL;
+HANDLE hNewContact = NULL;
+
+HPEN hLTEdgesPen = NULL;
+HPEN hRBEdgesPen = NULL;
+HBRUSH hBkBrush = NULL;
+DWORD bkColor = 0;
+HBITMAP hBmpBackground = NULL;
+WORD nBackgroundBmpUse = CLB_STRETCH;
+
+HWND hwndMiranda = NULL;
+BOOL bVersionOK = FALSE;
+BOOL bNT = FALSE;
+BOOL bDockHorz = TRUE;
+//UINT nStatus = 0;
+HMENU hContactMenu = NULL;
+HANDLE hMenuItemRemove = NULL;
+HANDLE hMenuItemHideAll = NULL;
+HANDLE hMainMenuItemHideAll = NULL;
RECT rcScreen;
-DWORD dwOfflineModes = 0;
-BOOL bEnableTip = FALSE;
-UINT_PTR ToTopTimerID = 0;
-BOOL bIsCListShow = TRUE;
-
-HANDLE hRemoveThumb = NULL;
-HANDLE hMainHideAllThumbs = NULL;
-HANDLE hHideWhenCListShow = NULL;
+DWORD dwOfflineModes = 0;
+BOOL bEnableTip = FALSE;
+UINT_PTR ToTopTimerID = 0;
+BOOL bIsCListShow = TRUE;
+
+HANDLE hRemoveThumb = NULL;
+HANDLE hMainHideAllThumbs = NULL;
+HANDLE hHideWhenCListShow = NULL;
int hLangpack;
//Options
FCOptions fcOpt = {0};
-static void InitOptions(){
- fcOpt.thumbAlpha = 255;
- fcOpt.bHideOffline = FALSE;
- fcOpt.bHideAll = FALSE;
- fcOpt.bHideWhenFullscreen = FALSE;
- fcOpt.bMoveTogether = FALSE;
- fcOpt.bFixedWidth = FALSE;
- fcOpt.nThumbWidth = 0;
- fcOpt.bShowTip = TRUE;
- fcOpt.TimeIn = 0;
- fcOpt.bToTop = TRUE;
- fcOpt.ToTopTime = TOTOPTIME_DEF;
- fcOpt.bHideWhenCListShow = FALSE;
- fcOpt.bUseSingleClick = FALSE;
- fcOpt.bShowIdle = TRUE;
+static void InitOptions() {
+ fcOpt.thumbAlpha = 255;
+ fcOpt.bHideOffline = FALSE;
+ fcOpt.bHideAll = FALSE;
+ fcOpt.bHideWhenFullscreen = FALSE;
+ fcOpt.bMoveTogether = FALSE;
+ fcOpt.bFixedWidth = FALSE;
+ fcOpt.nThumbWidth = 0;
+ fcOpt.bShowTip = TRUE;
+ fcOpt.TimeIn = 0;
+ fcOpt.bToTop = TRUE;
+ fcOpt.ToTopTime = TOTOPTIME_DEF;
+ fcOpt.bHideWhenCListShow = FALSE;
+ fcOpt.bUseSingleClick = FALSE;
+ fcOpt.bShowIdle = TRUE;
}
-PLUGININFO pluginInfo ={
- sizeof(PLUGININFO),
- __PLUGIN_NAME,
- 0,
- __DESC,
- __AUTHOR,
- __AUTHOREMAIL,
- __COPYRIGHT,
- __AUTHORWEB,
- UNICODE_AWARE,
+PLUGININFO pluginInfo = {
+ sizeof(PLUGININFO),
+ __PLUGIN_NAME,
+ 0,
+ __DESC,
+ __AUTHOR,
+ __AUTHOREMAIL,
+ __COPYRIGHT,
+ __AUTHORWEB,
+ UNICODE_AWARE,
0
};
@@ -170,29 +169,29 @@ extern "C" __declspec(dllexport) const MUUID * MirandaPluginInterfaces(void)
return interfaces;
}
-PLUGININFOEX pluginInfoEx ={
- sizeof(PLUGININFOEX),
- __PLUGIN_NAME,
- 0,
- __DESC,
- __AUTHOR,
- __AUTHOREMAIL,
- __COPYRIGHT,
- __AUTHORWEB,
- UNICODE_AWARE,
- 0,
+PLUGININFOEX pluginInfoEx = {
+ sizeof(PLUGININFOEX),
+ __PLUGIN_NAME,
+ 0,
+ __DESC,
+ __AUTHOR,
+ __AUTHOREMAIL,
+ __COPYRIGHT,
+ __AUTHORWEB,
+ UNICODE_AWARE,
+ 0,
MIID_FLTCONT
};
-_inline unsigned int MakeVer(int a,int b,int c,int d)
+_inline unsigned int MakeVer(int a, int b, int c, int d)
{
- return PLUGIN_MAKE_VERSION(a,b,c,d);
+ return PLUGIN_MAKE_VERSION(a, b, c, d);
}
extern "C" __declspec(dllexport) PLUGININFOEX* MirandaPluginInfoEx(DWORD mirandaVersion) {
- if( mirandaVersion < MakeVer(MINIMAL_COREVERSION) ) return NULL;
- pluginInfoEx.version=MakeVer(PRODUCT_VERSION);
+ if ( mirandaVersion < MakeVer(MINIMAL_COREVERSION) ) return NULL;
+ pluginInfoEx.version = MakeVer(PRODUCT_VERSION);
return &pluginInfoEx;
}
@@ -219,8 +218,8 @@ BOOL WINAPI DllMain( HINSTANCE hinstDLL, DWORD fdwReason, LPVOID lpvReserved )
extern "C" __declspec(dllexport) PLUGININFO* MirandaPluginInfo( DWORD mirandaVersion )
{
- if( mirandaVersion < MakeVer(MINIMAL_COREVERSION) ) return NULL;
- pluginInfo.version=MakeVer(PRODUCT_VERSION);
+ if ( mirandaVersion < MakeVer(MINIMAL_COREVERSION) ) return NULL;
+ pluginInfo.version = MakeVer(PRODUCT_VERSION);
return &pluginInfo;
}
@@ -230,24 +229,23 @@ extern "C" int __declspec(dllexport) Load( PLUGINLINK *link )
{
SetLastError( 0 );
InitOptions();
- pluginLink = link;
+ pluginLink = link;
mir_getLI(&li);
mir_getLP(&pluginInfoEx);
- hevModules = HookEvent( ME_SYSTEM_MODULESLOADED, OnModulesLoded );
- bNT = GetOSPlatform();
+ hevModules = HookEvent( ME_SYSTEM_MODULESLOADED, OnModulesLoded );
+ bNT = GetOSPlatform();
- if (hUserDll = LoadLibrary(_T("user32.dll")))
- {
- pSetLayeredWindowAttributes =
- (BOOL (WINAPI *)(HWND,COLORREF,BYTE,DWORD))
+ if (hUserDll = LoadLibrary(_T("user32.dll"))) {
+ pSetLayeredWindowAttributes =
+ (BOOL (WINAPI *)(HWND, COLORREF, BYTE, DWORD))
GetProcAddress(hUserDll, "SetLayeredWindowAttributes");
- pUpdateLayeredWindow =
+ pUpdateLayeredWindow =
(BOOL (WINAPI *)(HWND, HDC, POINT *, SIZE *, HDC, POINT *, COLORREF, BLENDFUNCTION *, DWORD))
GetProcAddress(hUserDll, "UpdateLayeredWindow");
- } else
- {
+ }
+ else {
pSetLayeredWindowAttributes = NULL;
pUpdateLayeredWindow = NULL;
}
@@ -281,17 +279,14 @@ static void CleanUp()
UnhookEvent( hevModules );
UnhookEvent( hevPrebuildMenu );
- if(hRemoveThumb)
+ if (hRemoveThumb)
DestroyServiceFunction(hRemoveThumb);
- if(hMainHideAllThumbs)
+ if (hMainHideAllThumbs)
DestroyServiceFunction(hMainHideAllThumbs);
- if(hHideWhenCListShow)
+ if (hHideWhenCListShow)
DestroyServiceFunction(hHideWhenCListShow);
-// while( pThumbsList != NULL )
-// RemoveThumb( pThumbsList );
-
- if(ServiceExists(MS_HOTKEY_UNREGISTER)){
+ if (ServiceExists(MS_HOTKEY_UNREGISTER)) {
CallService(MS_HOTKEY_UNREGISTER, 0, (LPARAM)(sModule "/MainHideAllThumbs"));
CallService(MS_HOTKEY_UNREGISTER, 0, (LPARAM)(sModule "/HideWhenCListShow"));
}
@@ -302,11 +297,10 @@ static void CleanUp()
DeleteObject(hRBEdgesPen);
if (NULL != hBmpBackground)
DeleteObject(hBmpBackground);
- if (NULL != hBkBrush)
- {
- SetClassLong((HWND)WND_CLASS, GCL_HBRBACKGROUND, (LONG)NULL);
+ if (NULL != hBkBrush) {
+ SetClassLong((HWND)WND_CLASS, GCLP_HBRBACKGROUND, (LONG)NULL);
DeleteObject(hBkBrush);
- hBkBrush=NULL;
+ hBkBrush = NULL;
}
for (nFontId = 0; nFontId < FLT_FONTIDS; nFontId++)
@@ -318,9 +312,7 @@ static void CleanUp()
FreeFileDropping();
if ( hUserDll != NULL )
- {
FreeLibrary( hUserDll );
- }
}
@@ -329,24 +321,24 @@ static void CleanUp()
// Hooked events
static int OnModulesLoded( WPARAM wParam, LPARAM lParam )
{
- hevContactIcon = HookEvent( ME_CLIST_CONTACTICONCHANGED, OnContactIconChanged );
- hevSkinIcons = HookEvent( ME_SKIN_ICONSCHANGED, OnSkinIconsChanged );
- hevContactDrag = HookEvent( ME_CLUI_CONTACTDRAGGING, OnContactDrag );
- hevContactDrop = HookEvent( ME_CLUI_CONTACTDROPPED, OnContactDrop );
- hevContactDragStop = HookEvent( ME_CLUI_CONTACTDRAGSTOP, OnContactDragStop );
- hevContactSetting = HookEvent( ME_DB_CONTACT_SETTINGCHANGED, OnContactSettingChanged );
- hevContactDeleted = HookEvent( ME_DB_CONTACT_DELETED, OnContactDeleted );
- hevOptionsInit = HookEvent( ME_OPT_INITIALISE, OnOptionsInitialize );
- hevStatusMode = HookEvent( ME_CLIST_STATUSMODECHANGE, OnStatusModeChange );
- hevPrebuildMenu = HookEvent( ME_CLIST_PREBUILDCONTACTMENU, OnPrebuildContactMenu );
- hwndMiranda = (HWND)CallService( MS_CLUI_GETHWND, 0, 0 );
-
- oldMirandaWndProc = (WNDPROC)SetWindowLong( hwndMiranda, GWLP_WNDPROC, (LONG)newMirandaWndProc);
+ hevContactIcon = HookEvent( ME_CLIST_CONTACTICONCHANGED, OnContactIconChanged );
+ hevSkinIcons = HookEvent( ME_SKIN_ICONSCHANGED, OnSkinIconsChanged );
+ hevContactDrag = HookEvent( ME_CLUI_CONTACTDRAGGING, OnContactDrag );
+ hevContactDrop = HookEvent( ME_CLUI_CONTACTDROPPED, OnContactDrop );
+ hevContactDragStop = HookEvent( ME_CLUI_CONTACTDRAGSTOP, OnContactDragStop );
+ hevContactSetting = HookEvent( ME_DB_CONTACT_SETTINGCHANGED, OnContactSettingChanged );
+ hevContactDeleted = HookEvent( ME_DB_CONTACT_DELETED, OnContactDeleted );
+ hevOptionsInit = HookEvent( ME_OPT_INITIALISE, OnOptionsInitialize );
+ hevStatusMode = HookEvent( ME_CLIST_STATUSMODECHANGE, OnStatusModeChange );
+ hevPrebuildMenu = HookEvent( ME_CLIST_PREBUILDCONTACTMENU, OnPrebuildContactMenu );
+ hwndMiranda = (HWND)CallService( MS_CLUI_GETHWND, 0, 0 );
+
+ oldMirandaWndProc = (WNDPROC)SetWindowLong( hwndMiranda, GWLP_WNDPROC, (LONG)newMirandaWndProc);
// No thumbs yet
-// pThumbsList = NULL;
+// pThumbsList = NULL;
bEnableTip = ServiceExists("mToolTip/ShowTip");
RegisterWindowClass();
@@ -358,10 +350,10 @@ static int OnModulesLoded( WPARAM wParam, LPARAM lParam )
LoadContacts();
LoadMenus();
- if(fcOpt.bToTop){
+ if (fcOpt.bToTop){
fcOpt.ToTopTime = (fcOpt.ToTopTime<1)?1:fcOpt.ToTopTime;
fcOpt.ToTopTime = (fcOpt.ToTopTime>TOTOPTIME_MAX)?TOTOPTIME_MAX:fcOpt.ToTopTime;
- ToTopTimerID=SetTimer(NULL, 0, fcOpt.ToTopTime*TOTOPTIME_P, ToTopTimerProc);
+ ToTopTimerID = SetTimer(NULL, 0, fcOpt.ToTopTime*TOTOPTIME_P, ToTopTimerProc);
}
return( 0 );
}
@@ -369,8 +361,8 @@ static int OnModulesLoded( WPARAM wParam, LPARAM lParam )
static int OnContactDeleted( WPARAM wParam, LPARAM lParam )
{
- HANDLE hContact = ( HANDLE )wParam;
- ThumbInfo *pThumb = thumbList.FindThumbByContact( hContact );
+ HANDLE hContact = ( HANDLE )wParam;
+ ThumbInfo *pThumb = thumbList.FindThumbByContact( hContact );
if (!pThumb) return 0;
pThumb->DeleteContactPos();
@@ -382,8 +374,8 @@ static int OnContactDeleted( WPARAM wParam, LPARAM lParam )
static int OnContactIconChanged( WPARAM wParam, LPARAM lParam )
{
- HANDLE hContact = ( HANDLE )wParam;
- ThumbInfo *pThumb = thumbList.FindThumbByContact( hContact );
+ HANDLE hContact = ( HANDLE )wParam;
+ ThumbInfo *pThumb = thumbList.FindThumbByContact( hContact );
if ( pThumb )
{
@@ -398,21 +390,18 @@ static int OnContactIconChanged( WPARAM wParam, LPARAM lParam )
static int OnContactDrag( WPARAM wParam, LPARAM lParam )
{
- ThumbInfo *pNewThumb = NULL;
- HANDLE hContact = ( HANDLE )wParam;
- ThumbInfo *pThumb = thumbList.FindThumbByContact( hContact );
- TCHAR *ptName = (TCHAR*)CallService( MS_CLIST_GETCONTACTDISPLAYNAME, wParam, (LPARAM)GCDNF_TCHAR );
- int idStatus = ID_STATUS_OFFLINE;
+ ThumbInfo *pNewThumb = NULL;
+ HANDLE hContact = ( HANDLE )wParam;
+ ThumbInfo *pThumb = thumbList.FindThumbByContact( hContact );
+ TCHAR *ptName = (TCHAR*)CallService( MS_CLIST_GETCONTACTDISPLAYNAME, wParam, (LPARAM)GCDNF_TCHAR );
+ int idStatus = ID_STATUS_OFFLINE;
POINT pt;
GetCursorPos(&pt);
- if ( pThumb == NULL )
- {
+ if ( pThumb == NULL ) {
idStatus = GetContactStatus( hContact );
- if ( !fcOpt.bHideAll && !HideOnFullScreen() && ( !fcOpt.bHideOffline || IsStatusVisible( idStatus ) ) && (!fcOpt.bHideWhenCListShow || !bIsCListShow) )
- {
-// CreateThumbWnd( pName, hContact, LOWORD( lParam ), HIWORD( lParam ) );
+ if ( !fcOpt.bHideAll && !HideOnFullScreen() && ( !fcOpt.bHideOffline || IsStatusVisible( idStatus ) ) && (!fcOpt.bHideWhenCListShow || !bIsCListShow)) {
CreateThumbWnd( ptName, hContact, pt.x, pt.y );
pNewThumb = thumbList.FindThumbByContact( hContact );
ShowWindow( pNewThumb->hwnd, SW_SHOWNA );
@@ -422,10 +411,7 @@ static int OnContactDrag( WPARAM wParam, LPARAM lParam )
}
}
else if ( hContact == hNewContact )
- {
-// PositionThumb( pThumb, (short)( LOWORD( lParam ) - 5 ), (short)( HIWORD( lParam ) - 5 ) );
pThumb->PositionThumb( (short)( pt.x - 5 ), (short)( pt.y - 5 ) );
- }
return( hNewContact != NULL ? 1 : 0 );
}
@@ -438,8 +424,8 @@ static int OnContactDrop( WPARAM wParam, LPARAM lParam )
RECT rcThumb;
// RECT rcOverlap;
- HANDLE hContact = ( HANDLE )wParam;
- ThumbInfo *pThumb = thumbList.FindThumbByContact( hContact );
+ HANDLE hContact = ( HANDLE )wParam;
+ ThumbInfo *pThumb = thumbList.FindThumbByContact( hContact );
if ( ( hNewContact == hContact ) && ( pThumb != NULL ) )
{
@@ -491,16 +477,16 @@ static int OnSkinIconsChanged( WPARAM wParam, LPARAM lParam )
static int OnContactSettingChanged( WPARAM wParam, LPARAM lParam )
{
- HANDLE hContact = ( HANDLE )wParam;
- ThumbInfo *pThumb = thumbList.FindThumbByContact( hContact );
- int idStatus = ID_STATUS_OFFLINE;
- BOOL bRefresh = TRUE;
+ HANDLE hContact = ( HANDLE )wParam;
+ ThumbInfo *pThumb = thumbList.FindThumbByContact( hContact );
+ int idStatus = ID_STATUS_OFFLINE;
+ BOOL bRefresh = TRUE;
DBCONTACTWRITESETTING* pdbcws = ( DBCONTACTWRITESETTING* )lParam;
if ( hContact == NULL )
{
- if(( 0 == stricmp( pdbcws->szModule, "CLC" ) ) || ( 0 == stricmp( pdbcws->szModule, sModule ) ) ){
+ if (( 0 == stricmp( pdbcws->szModule, "CLC" ) ) || ( 0 == stricmp( pdbcws->szModule, sModule ) ) ) {
LoadDBSettings();
ApplyOptionsChanges();
}
@@ -511,7 +497,7 @@ static int OnContactSettingChanged( WPARAM wParam, LPARAM lParam )
if ( pThumb == NULL ) return( 0 );
// Only on these 2 events we need to refresh
- if( 0 == stricmp( pdbcws->szSetting, "Status" ) )
+ if ( 0 == stricmp( pdbcws->szSetting, "Status" ) )
{
idStatus = pdbcws->value.wVal;
}
@@ -588,26 +574,26 @@ static int OnPrebuildContactMenu( WPARAM wParam, LPARAM lParam )
static void LoadDBSettings()
{
- fcOpt.thumbAlpha = (BYTE)((double)DBGetContactSettingByte( NULL, sModule, "Opacity", 100 ) * 2.55 );
- fcOpt.bHideOffline = (BOOL)DBGetContactSettingByte( NULL, sModule, "HideOffline", 0 );
- fcOpt.bHideAll = (BOOL)DBGetContactSettingByte( NULL, sModule, "HideAll", 0 );
- fcOpt.bHideWhenFullscreen = (BOOL)DBGetContactSettingByte( NULL, sModule, "HideWhenFullscreen", 0 );
- fcOpt.bMoveTogether = (BOOL)DBGetContactSettingByte( NULL, sModule, "MoveTogether", 0 );
- fcOpt.bFixedWidth = (BOOL)DBGetContactSettingByte( NULL, sModule, "FixedWidth", 0 );
- fcOpt.nThumbWidth = (DWORD)DBGetContactSettingDword( NULL, sModule, "Width", 0 );
- dwOfflineModes = DBGetContactSettingDword( NULL, "CLC","OfflineModes", CLCDEFAULT_OFFLINEMODES );
- fcOpt.bShowTip = (BOOL)DBGetContactSettingByte( NULL, sModule, "ShowTip", 1 );
- fcOpt.TimeIn = (WORD)DBGetContactSettingWord( NULL, sModule, "TimeIn", 0 );
- fcOpt.bToTop = (BOOL)DBGetContactSettingByte( NULL, sModule, "ToTop", 0 );
- fcOpt.ToTopTime = (WORD)DBGetContactSettingWord( NULL, sModule, "ToTopTime", TOTOPTIME_DEF );
- fcOpt.bHideWhenCListShow = (BOOL)DBGetContactSettingByte( NULL, sModule, "HideWhenCListShow", 0 );
- fcOpt.bUseSingleClick = (BOOL)DBGetContactSettingByte( NULL, sModule, "UseSingleClick", 0 );
- fcOpt.bShowIdle = (BOOL)DBGetContactSettingByte( NULL, sModule, "ShowIdle", 0 );
-
- if(DBGetContactSettingByte(NULL, "ModernData", "HideBehind", 0))
- bIsCListShow = (DBGetContactSettingByte(NULL, "ModernData", "BehindEdge", 0)==0);
+ fcOpt.thumbAlpha = (BYTE)((double)DBGetContactSettingByte( NULL, sModule, "Opacity", 100 ) * 2.55 );
+ fcOpt.bHideOffline = (BOOL)DBGetContactSettingByte( NULL, sModule, "HideOffline", 0 );
+ fcOpt.bHideAll = (BOOL)DBGetContactSettingByte( NULL, sModule, "HideAll", 0 );
+ fcOpt.bHideWhenFullscreen = (BOOL)DBGetContactSettingByte( NULL, sModule, "HideWhenFullscreen", 0 );
+ fcOpt.bMoveTogether = (BOOL)DBGetContactSettingByte( NULL, sModule, "MoveTogether", 0 );
+ fcOpt.bFixedWidth = (BOOL)DBGetContactSettingByte( NULL, sModule, "FixedWidth", 0 );
+ fcOpt.nThumbWidth = (DWORD)DBGetContactSettingDword( NULL, sModule, "Width", 0 );
+ dwOfflineModes = DBGetContactSettingDword( NULL, "CLC", "OfflineModes", CLCDEFAULT_OFFLINEMODES );
+ fcOpt.bShowTip = (BOOL)DBGetContactSettingByte( NULL, sModule, "ShowTip", 1 );
+ fcOpt.TimeIn = (WORD)DBGetContactSettingWord( NULL, sModule, "TimeIn", 0 );
+ fcOpt.bToTop = (BOOL)DBGetContactSettingByte( NULL, sModule, "ToTop", 0 );
+ fcOpt.ToTopTime = (WORD)DBGetContactSettingWord( NULL, sModule, "ToTopTime", TOTOPTIME_DEF );
+ fcOpt.bHideWhenCListShow = (BOOL)DBGetContactSettingByte( NULL, sModule, "HideWhenCListShow", 0 );
+ fcOpt.bUseSingleClick = (BOOL)DBGetContactSettingByte( NULL, sModule, "UseSingleClick", 0 );
+ fcOpt.bShowIdle = (BOOL)DBGetContactSettingByte( NULL, sModule, "ShowIdle", 0 );
+
+ if (DBGetContactSettingByte(NULL, "ModernData", "HideBehind", 0))
+ bIsCListShow = (DBGetContactSettingByte(NULL, "ModernData", "BehindEdge", 0) == 0);
else
- bIsCListShow = (DBGetContactSettingByte(NULL,"CList","State",0)==2);
+ bIsCListShow = (DBGetContactSettingByte(NULL, "CList", "State", 0) == 2);
}
void SendMsgDialog( HWND hwnd, char *pText )
@@ -621,8 +607,8 @@ void SendMsgDialog( HWND hwnd, char *pText )
static void ShowContactMenu( HWND hwnd, POINT pt )
{
- ThumbInfo *pThumb = thumbList.FindThumb( hwnd );
- int idCommand = 0;
+ ThumbInfo *pThumb = thumbList.FindThumb( hwnd );
+ int idCommand = 0;
if ( pThumb != NULL )
{
@@ -631,7 +617,7 @@ static void ShowContactMenu( HWND hwnd, POINT pt )
if ( hContactMenu == NULL ) return;
idCommand = TrackPopupMenu( hContactMenu, TPM_RIGHTALIGN | TPM_TOPALIGN | TPM_RETURNCMD, pt.x, pt.y, 0 , hwnd, NULL );
- CallService( MS_CLIST_MENUPROCESSCOMMAND, MAKEWPARAM( idCommand ,MPCF_CONTACTMENU), (LPARAM)pThumb->hContact );
+ CallService( MS_CLIST_MENUPROCESSCOMMAND, MAKEWPARAM( idCommand , MPCF_CONTACTMENU), (LPARAM)pThumb->hContact );
}
}
@@ -640,8 +626,8 @@ static LRESULT __stdcall CommWndProc( HWND hwnd,
WPARAM wParam,
LPARAM lParam )
{
- LRESULT lResult = 0;
- ThumbInfo *pThumb = thumbList.FindThumb( hwnd );
+ LRESULT lResult = 0;
+ ThumbInfo *pThumb = thumbList.FindThumb( hwnd );
switch( uMsg )
{
@@ -653,7 +639,7 @@ static LRESULT __stdcall CommWndProc( HWND hwnd,
if (pThumb) pThumb->ThumbDeselect( TRUE );
- ClientToScreen(hwnd,&pt);
+ ClientToScreen(hwnd, &pt);
ShowContactMenu( hwnd, pt );
}
@@ -661,7 +647,7 @@ static LRESULT __stdcall CommWndProc( HWND hwnd,
//#if 0
case WM_NCPAINT:
- if(pThumb){
+ if (pThumb){
HDC hdc = GetWindowDC( hwnd );
BitBlt(hdc, 0, 0, pThumb->bmpContent.getWidth(), pThumb->bmpContent.getHeight(), pThumb->bmpContent.getDC(), 0, 0, SRCCOPY);
//RepaintWindow( hwnd, hdc );
@@ -671,7 +657,7 @@ static LRESULT __stdcall CommWndProc( HWND hwnd,
}
case WM_PAINT:
- if(pThumb){
+ if (pThumb){
PAINTSTRUCT ps;
HDC hdc = BeginPaint(hwnd, &ps);
BitBlt(hdc, 0, 0, pThumb->bmpContent.getWidth(), pThumb->bmpContent.getHeight(), pThumb->bmpContent.getDC(), 0, 0, SRCCOPY);
@@ -682,7 +668,7 @@ static LRESULT __stdcall CommWndProc( HWND hwnd,
case WM_PRINT:
case WM_PRINTCLIENT:
- if(pThumb){
+ if (pThumb){
BitBlt((HDC)wParam, 0, 0, pThumb->bmpContent.getWidth(), pThumb->bmpContent.getHeight(), pThumb->bmpContent.getDC(), 0, 0, SRCCOPY);
//RepaintWindow(hwnd, (HDC)wParam);
break;
@@ -690,11 +676,11 @@ static LRESULT __stdcall CommWndProc( HWND hwnd,
//#endif
case WM_MEASUREITEM:
- lResult = CallService( MS_CLIST_MENUMEASUREITEM,wParam,lParam );
+ lResult = CallService( MS_CLIST_MENUMEASUREITEM, wParam, lParam );
break;
case WM_DRAWITEM:
- lResult = CallService( MS_CLIST_MENUDRAWITEM,wParam,lParam );
+ lResult = CallService( MS_CLIST_MENUDRAWITEM, wParam, lParam );
break;
case WM_LBUTTONDOWN:
@@ -714,12 +700,12 @@ static LRESULT __stdcall CommWndProc( HWND hwnd,
case WM_LBUTTONDBLCLK:
// Popup message dialog
//if (pThumb) pThumb->ThumbDeselect( TRUE );
- if(!fcOpt.bUseSingleClick && pThumb)
+ if (!fcOpt.bUseSingleClick && pThumb)
pThumb->PopUpMessageDialog();
break;
case WM_RBUTTONDOWN:
- if(bEnableTip && fcOpt.bShowTip && pThumb) pThumb->KillTip();
+ if (bEnableTip && fcOpt.bShowTip && pThumb) pThumb->KillTip();
break;
case WM_REFRESH_CONTACT:
if (pThumb)
@@ -731,7 +717,7 @@ static LRESULT __stdcall CommWndProc( HWND hwnd,
break;
case WM_TIMER:
- if(pThumb)pThumb->OnTimer(wParam);
+ if (pThumb)pThumb->OnTimer(wParam);
break;
case WM_HOTKEY:
@@ -762,17 +748,17 @@ extern void SetThumbsOpacity( BYTE btAlpha )
static void GetScreenRect()
{
- rcScreen.left = GetSystemMetrics( SM_XVIRTUALSCREEN );
- rcScreen.top = GetSystemMetrics( SM_YVIRTUALSCREEN );
- rcScreen.right = GetSystemMetrics( SM_CXVIRTUALSCREEN ) + rcScreen.left;
- rcScreen.bottom = GetSystemMetrics( SM_CYVIRTUALSCREEN ) + rcScreen.top;
+ rcScreen.left = GetSystemMetrics( SM_XVIRTUALSCREEN );
+ rcScreen.top = GetSystemMetrics( SM_YVIRTUALSCREEN );
+ rcScreen.right = GetSystemMetrics( SM_CXVIRTUALSCREEN ) + rcScreen.left;
+ rcScreen.bottom = GetSystemMetrics( SM_CYVIRTUALSCREEN ) + rcScreen.top;
}
void OnStatusChanged()
{
- int idStatus = ID_STATUS_OFFLINE;
+ int idStatus = ID_STATUS_OFFLINE;
for (int i = 0; i < thumbList.getCount(); ++i)
{
@@ -788,12 +774,12 @@ void ApplyOptionsChanges()
CreateThumbsFont();
CreateBackgroundBrush();
-// dwOfflineModes = DBGetContactSettingDword( NULL, "CLC","OfflineModes", CLCDEFAULT_OFFLINEMODES );
- if(!fcOpt.bToTop && ToTopTimerID){
+// dwOfflineModes = DBGetContactSettingDword( NULL, "CLC", "OfflineModes", CLCDEFAULT_OFFLINEMODES );
+ if (!fcOpt.bToTop && ToTopTimerID){
KillTimer(NULL, ToTopTimerID);
ToTopTimerID = 0;
}
- if(fcOpt.bToTop){
+ if (fcOpt.bToTop){
if (ToTopTimerID) KillTimer(NULL, ToTopTimerID);
fcOpt.ToTopTime = (fcOpt.ToTopTime<1)?1:fcOpt.ToTopTime;
fcOpt.ToTopTime = (fcOpt.ToTopTime>TOTOPTIME_MAX)?TOTOPTIME_MAX:fcOpt.ToTopTime;
@@ -815,18 +801,18 @@ static void RegisterWindowClass()
WNDCLASSEX wcx;
ZeroMemory( &wcx, sizeof( wcx ) );
- wcx.cbSize = sizeof( WNDCLASSEX );
- wcx.style = CS_VREDRAW | CS_HREDRAW | CS_DBLCLKS;
- wcx.lpfnWndProc = CommWndProc;
- wcx.cbClsExtra = 0;
- wcx.cbWndExtra = 0;
- wcx.hInstance = hInst;
- wcx.hIcon = NULL;
- wcx.hCursor = NULL;
- wcx.hbrBackground = GetSysColorBrush(COLOR_3DFACE);
- wcx.lpszMenuName = NULL;
- wcx.lpszClassName = WND_CLASS;
- wcx.hIconSm = NULL;
+ wcx.cbSize = sizeof( WNDCLASSEX );
+ wcx.style = CS_VREDRAW | CS_HREDRAW | CS_DBLCLKS;
+ wcx.lpfnWndProc = CommWndProc;
+ wcx.cbClsExtra = 0;
+ wcx.cbWndExtra = 0;
+ wcx.hInstance = hInst;
+ wcx.hIcon = NULL;
+ wcx.hCursor = NULL;
+ wcx.hbrBackground = GetSysColorBrush(COLOR_3DFACE);
+ wcx.lpszMenuName = NULL;
+ wcx.lpszClassName = WND_CLASS;
+ wcx.hIconSm = NULL;
SetLastError( 0 );
@@ -844,30 +830,30 @@ static void UnregisterWindowClass()
static void CreateThumbWnd( TCHAR *ptszName, HANDLE hContact, int nX, int nY )
{
- HWND hwnd = NULL;
- ThumbInfo *pThumb = thumbList.FindThumbByContact( hContact );
+ HWND hwnd = NULL;
+ ThumbInfo *pThumb = thumbList.FindThumbByContact( hContact );
// Prepare for window creation
if ( pThumb == NULL )
{
- hwnd = CreateWindowEx( WS_EX_TOOLWINDOW | WS_EX_TOPMOST,
- WND_CLASS,
- ptszName,
- WS_POPUP,
- nX,
- nY,
- 50,
- 20,
- NULL /*hwndMiranda*/,
- NULL,
- hInst,
+ hwnd = CreateWindowEx( WS_EX_TOOLWINDOW | WS_EX_TOPMOST,
+ WND_CLASS,
+ ptszName,
+ WS_POPUP,
+ nX,
+ nY,
+ 50,
+ 20,
+ NULL /*hwndMiranda*/,
+ NULL,
+ hInst,
NULL
);
if ( hwnd != NULL )
{
pThumb = thumbList.AddThumb( hwnd, ptszName, hContact );
- SetWindowLong( hwnd, GWL_USERDATA, (long)pThumb );
+ SetWindowLong( hwnd, GWLP_USERDATA, (long)pThumb );
pThumb->ResizeThumb();
pThumb->SetThumbOpacity( fcOpt.thumbAlpha );
@@ -911,14 +897,14 @@ static void CreateThumbsFont()
GetFontSetting(TRUE, nFontId, &lf, &tColor[nFontId]);
{
LONG height;
- HDC hdc=GetDC(NULL);
- height=lf.lfHeight;
- lf.lfHeight=-MulDiv(lf.lfHeight, GetDeviceCaps(hdc, LOGPIXELSY), 72);
- ReleaseDC(NULL,hdc);
+ HDC hdc = GetDC(NULL);
+ height = lf.lfHeight;
+ lf.lfHeight = -MulDiv(lf.lfHeight, GetDeviceCaps(hdc, LOGPIXELSY), 72);
+ ReleaseDC(NULL, hdc);
hFont[nFontId] = CreateFontIndirectA(&lf);
- lf.lfHeight=height;
+ lf.lfHeight = height;
}
}
}
@@ -948,7 +934,7 @@ static void CreateBackgroundBrush()
}
if (NULL != hBkBrush)
{
- SetClassLong((HWND)WND_CLASS, GCL_HBRBACKGROUND, (LONG)NULL);
+ SetClassLong((HWND)WND_CLASS, GCLP_HBRBACKGROUND, (LONG)NULL);
DeleteObject( hBkBrush );
hBkBrush = NULL;
}
@@ -975,17 +961,17 @@ static void CreateBackgroundBrush()
nBackgroundBmpUse = (WORD)DBGetContactSettingWord(NULL, sModule, "BkBitmapOpt", FLT_DEFAULT_BKGNDBITMAPOPT);
// Create brush
- hBkBrush = CreateSolidBrush(bkColor);
+ hBkBrush = CreateSolidBrush(bkColor);
// Attach brush to the window
- SetClassLong((HWND)WND_CLASS, GCL_HBRBACKGROUND, (LONG)hBkBrush);
+ SetClassLong((HWND)WND_CLASS, GCLP_HBRBACKGROUND, (LONG)hBkBrush);
}
static int GetContactStatus( HANDLE hContact )
{
- char *szProto = NULL;
- int idStatus = ID_STATUS_OFFLINE;
+ char *szProto = NULL;
+ int idStatus = ID_STATUS_OFFLINE;
if ( hContact == NULL )
{
@@ -993,11 +979,11 @@ static int GetContactStatus( HANDLE hContact )
return( 0 );
}
- szProto = ( char* )CallService( "Proto/GetContactBaseProto", (WPARAM)hContact, 0 );
+ szProto = ( char* )CallService( "Proto/GetContactBaseProto", (WPARAM)hContact, 0 );
if ( NULL != szProto )
{
- idStatus = DBGetContactSettingWord( hContact, szProto, "Status", ID_STATUS_OFFLINE );
+ idStatus = DBGetContactSettingWord( hContact, szProto, "Status", ID_STATUS_OFFLINE );
}
@@ -1031,39 +1017,39 @@ BOOL IsStatusVisible( int status )
void RegHotkey( HANDLE hContact, HWND hwnd )
{
- char szBuf[ MAX_PATH ]= {0};
-/* char szPath[ MAX_PATH ]= {0};
+ char szBuf[ MAX_PATH ] = {0};
+/* char szPath[ MAX_PATH ] = {0};
GetModuleFileName( NULL, szPath, MAX_PATH );
PathRemoveFileSpec( szPath );
strcat( szPath, "\\Thumbs.ini" );
GetPrivateProfileString( "Hotkeys", szName, "", szBuf, MAX_PATH - 1, szPath );*/
DBVARIANT dbv;
- if(DBGetContactSettingString ( hContact, sModule, "Hotkey", &dbv)) return;
+ if (DBGetContactSettingString ( hContact, sModule, "Hotkey", &dbv)) return;
strncpy(szBuf, dbv.pszVal, MAX_PATH - 1);
DBFreeVariant( &dbv );
if ( 0 != strlen( szBuf ) )
{
- UINT nModifiers = 0;
- char chKey = 0;
- char szMod[ 2 ][ 20 ] = {0};
- char szKey[ 20 ] = {0};
+ UINT nModifiers = 0;
+ char chKey = 0;
+ char szMod[ 2 ][ 20 ] = {0};
+ char szKey[ 20 ] = {0};
int i = 0;
sscanf( szBuf, "%[^'+']+%[^'+']+%[^'+']", szMod[ 0 ], szMod[ 1 ], szKey );
for ( i = 0; i < 2; ++i )
{
- if( 0 == strncmp( szMod[ i ], "ALT", 19 ) )
+ if ( 0 == strncmp( szMod[ i ], "ALT", 19 ) )
{
nModifiers = nModifiers | MOD_ALT;
}
- else if( 0 == strncmp( szMod[ i ], "CTRL", 19 ) )
+ else if ( 0 == strncmp( szMod[ i ], "CTRL", 19 ) )
{
nModifiers = nModifiers | MOD_CONTROL;
}
- else if( 0 == strncmp( szMod[ i ], "SHIFT", 19 ) )
+ else if ( 0 == strncmp( szMod[ i ], "SHIFT", 19 ) )
{
nModifiers = nModifiers | MOD_SHIFT;
}
@@ -1090,20 +1076,17 @@ void SaveContactsPos()
thumbList[i]->GetThumbRect( &rc );
- if( 0 == GetLastError() )
- DBWriteContactSettingDword( thumbList[i]->hContact, sModule, "ThumbsPos", DB_POS_MAKE_XY(rc.left,rc.top) );
+ if ( 0 == GetLastError() )
+ DBWriteContactSettingDword( thumbList[i]->hContact, sModule, "ThumbsPos", DB_POS_MAKE_XY(rc.left, rc.top) );
}
}
static void LoadContacts()
{
- HANDLE hContact = (HANDLE)CallService( MS_DB_CONTACT_FINDFIRST, 0, 0) ;
-
- while( hContact != NULL )
- {
+ HANDLE hContact = (HANDLE)CallService( MS_DB_CONTACT_FINDFIRST, 0, 0) ;
+ while( hContact != NULL ) {
LoadContact( hContact );
-
hContact = (HANDLE)CallService( MS_DB_CONTACT_FINDNEXT, ( WPARAM ) hContact, 0 );
}
}
@@ -1113,57 +1096,54 @@ static void LoadContacts()
static void LoadMenus()
{
- CLISTMENUITEM mi;
-
- // Remove thumb menu item
- hRemoveThumb = CreateServiceFunction( sModule "/RemoveThumb",OnContactMenu_Remove );
- ZeroMemory( &mi,sizeof( mi ) );
+ // Remove thumb menu item
+ hRemoveThumb = CreateServiceFunction( sModule "/RemoveThumb", OnContactMenu_Remove );
- mi.cbSize = sizeof( mi );
- mi.position = 0xFFFFF;
- mi.flags = CMIF_TCHAR;
- mi.hIcon = LoadIcon( hInst, MAKEINTRESOURCE( IDI_HIDE ) );
- mi.ptszName = _T("Remove thumb");
- mi.pszService = sModule "/RemoveThumb";
- hMenuItemRemove = (HANDLE)CallService( MS_CLIST_ADDCONTACTMENUITEM,0, ( LPARAM )&mi );
-
- // Hide all thumbs main menu item
- hMainHideAllThumbs = CreateServiceFunction( sModule "/MainHideAllThumbs",OnMainMenu_HideAll );
- ZeroMemory( &mi,sizeof( mi ) );
+ CLISTMENUITEM mi = { 0 };
+ mi.cbSize = sizeof( mi );
+ mi.position = 0xFFFFF;
+ mi.flags = CMIF_TCHAR;
+ mi.hIcon = LoadIcon( hInst, MAKEINTRESOURCE( IDI_HIDE ) );
+ mi.ptszName = _T("Remove thumb");
+ mi.pszService = sModule "/RemoveThumb";
+ hMenuItemRemove = (HANDLE)CallService( MS_CLIST_ADDCONTACTMENUITEM, 0, ( LPARAM )&mi );
+
+ // Hide all thumbs main menu item
+ hMainHideAllThumbs = CreateServiceFunction( sModule "/MainHideAllThumbs", OnMainMenu_HideAll );
+ ZeroMemory( &mi, sizeof( mi ) );
- mi.cbSize = sizeof( mi );
- mi.position = 0xFFFFF;
- mi.flags = CMIF_TCHAR;
- mi.hIcon = LoadIcon( hInst, MAKEINTRESOURCE( fcOpt.bHideAll ? IDI_SHOW : IDI_HIDE ) );
- mi.ptszName = fcOpt.bHideAll ? _T("Show all thumbs") : _T("Hide all thumbs");
- mi.pszService = sModule "/MainHideAllThumbs";
- hMainMenuItemHideAll = (HANDLE)CallService( MS_CLIST_ADDMAINMENUITEM,0, ( LPARAM )&mi );
-
- if(ServiceExists(MS_HOTKEY_REGISTER)){
- HOTKEYDESC hkd={0};
-
- hkd.cbSize = sizeof(hkd);
- hkd.pszSection = "Floating Contacts";
+ mi.cbSize = sizeof( mi );
+ mi.position = 0xFFFFF;
+ mi.flags = CMIF_TCHAR;
+ mi.hIcon = LoadIcon( hInst, MAKEINTRESOURCE( fcOpt.bHideAll ? IDI_SHOW : IDI_HIDE ) );
+ mi.ptszName = fcOpt.bHideAll ? _T("Show all thumbs") : _T("Hide all thumbs");
+ mi.pszService = sModule "/MainHideAllThumbs";
+ hMainMenuItemHideAll = (HANDLE)CallService( MS_CLIST_ADDMAINMENUITEM, 0, ( LPARAM )&mi );
+
+ if (ServiceExists(MS_HOTKEY_REGISTER)) {
+ HOTKEYDESC hkd = {0};
+ hkd.cbSize = sizeof(hkd);
+ hkd.pszSection = "Floating Contacts";
- hkd.pszName = sModule "/MainHideAllThumbs";
- hkd.pszDescription = "Show/Hide all thumbs";
- hkd.pszService = sModule "/MainHideAllThumbs";
- CallService(MS_HOTKEY_REGISTER, 0, (LPARAM)&hkd);
-
- hHideWhenCListShow = CreateServiceFunction( sModule "/HideWhenCListShow",OnHotKey_HideWhenCListShow );
- hkd.pszName = sModule "/HideWhenCListShow";
- hkd.pszDescription = "Hide when contact list is shown";
- hkd.pszService = sModule "/HideWhenCListShow";
- CallService(MS_HOTKEY_REGISTER, 0, (LPARAM)&hkd);
- }
+ hkd.pszName = sModule "/MainHideAllThumbs";
+ hkd.pszDescription = "Show/Hide all thumbs";
+ hkd.pszService = sModule "/MainHideAllThumbs";
+ CallService(MS_HOTKEY_REGISTER, 0, (LPARAM)&hkd);
+
+ hHideWhenCListShow = CreateServiceFunction( sModule "/HideWhenCListShow", OnHotKey_HideWhenCListShow );
+ hkd.pszName = sModule "/HideWhenCListShow";
+ hkd.pszDescription = "Hide when contact list is shown";
+ hkd.pszService = sModule "/HideWhenCListShow";
+ CallService(MS_HOTKEY_REGISTER, 0, (LPARAM)&hkd);
+ }
}
static void LoadContact( HANDLE hContact )
{
- DWORD dwPos = (DWORD)-1;
- TCHAR *ptName = NULL;
- ThumbInfo *pThumb = thumbList.FindThumbByContact( hContact );
+ DWORD dwPos = (DWORD)-1;
+ TCHAR *ptName = NULL;
+ ThumbInfo *pThumb = thumbList.FindThumbByContact( hContact );
int nX, nY;
@@ -1219,32 +1199,30 @@ BOOL HideOnFullScreen()
}
-static int OnContactMenu_Remove( WPARAM wParam,LPARAM lParam )
+static INT_PTR OnContactMenu_Remove( WPARAM wParam, LPARAM lParam )
{
- HANDLE hContact = ( HANDLE )wParam;
- ThumbInfo *pThumb = thumbList.FindThumbByContact( hContact );
+ HANDLE hContact = ( HANDLE )wParam;
+ ThumbInfo *pThumb = thumbList.FindThumbByContact( hContact );
- if (pThumb)
- {
+ if (pThumb) {
pThumb->DeleteContactPos();
thumbList.RemoveThumb(pThumb);
}
DestroyMenu( hContactMenu );
-
return 0;
}
-static int OnHotKey_HideWhenCListShow( WPARAM wParam,LPARAM lParam )
+static INT_PTR OnHotKey_HideWhenCListShow( WPARAM wParam, LPARAM lParam )
{
- fcOpt.bHideWhenCListShow=!fcOpt.bHideWhenCListShow;
+ fcOpt.bHideWhenCListShow = !fcOpt.bHideWhenCListShow;
DBWriteContactSettingByte(NULL, sModule, "HideWhenCListShow", (BYTE)fcOpt.bHideWhenCListShow);
OnStatusChanged();
return 0;
}
-static int OnMainMenu_HideAll( WPARAM wParam,LPARAM lParam )
+static INT_PTR OnMainMenu_HideAll( WPARAM wParam, LPARAM lParam )
{
CLISTMENUITEM clmi = {0};
int b;
@@ -1253,10 +1231,10 @@ static int OnMainMenu_HideAll( WPARAM wParam,LPARAM lParam )
DBWriteContactSettingByte(NULL, sModule, "HideAll", (BYTE)fcOpt.bHideAll);
OnStatusChanged();
- clmi.cbSize = sizeof( clmi );
- clmi.flags = CMIM_NAME | CMIM_ICON|CMIF_TCHAR;
- clmi.hIcon = LoadIcon( hInst, MAKEINTRESOURCE( fcOpt.bHideAll ? IDI_SHOW : IDI_HIDE ) );
- clmi.ptszName = fcOpt.bHideAll ? _T("Show all thumbs") : _T("Hide all thumbs");
+ clmi.cbSize = sizeof( clmi );
+ clmi.flags = CMIM_NAME | CMIM_ICON|CMIF_TCHAR;
+ clmi.hIcon = LoadIcon( hInst, MAKEINTRESOURCE( fcOpt.bHideAll ? IDI_SHOW : IDI_HIDE ) );
+ clmi.ptszName = fcOpt.bHideAll ? _T("Show all thumbs") : _T("Hide all thumbs");
b = CallService( MS_CLIST_MODIFYMENUITEM, ( WPARAM )hMainMenuItemHideAll, ( LPARAM )&clmi );
return 0;
}
@@ -1270,59 +1248,56 @@ static VOID CALLBACK ToTopTimerProc ( HWND hwnd, UINT uMsg, UINT_PTR idEvent, DW
0,
0,
0,
- 0,
+ 0,
SWP_NOSIZE | SWP_NOMOVE | /*SWP_NOZORDER |*/ SWP_NOACTIVATE);
}
}
void ShowThumbsOnHideCList()
{
- if(!fcOpt.bHideWhenCListShow || fcOpt.bHideAll || HideOnFullScreen())return;
+ if (!fcOpt.bHideWhenCListShow || fcOpt.bHideAll || HideOnFullScreen())
+ return;
+
for (int i = 0; i < thumbList.getCount(); ++i)
- {
- if ( !fcOpt.bHideOffline || IsStatusVisible( GetContactStatus(thumbList[i]->hContact) ) )
- {
+ if ( !fcOpt.bHideOffline || IsStatusVisible( GetContactStatus(thumbList[i]->hContact) ))
ShowWindow( thumbList[i]->hwnd, SW_SHOWNA );
- }
- }
}
void HideThumbsOnShowCList()
{
- if(!fcOpt.bHideWhenCListShow || fcOpt.bHideAll || HideOnFullScreen())return;
+ if (!fcOpt.bHideWhenCListShow || fcOpt.bHideAll || HideOnFullScreen())return;
for (int i = 0; i < thumbList.getCount(); ++i)
ShowWindow( thumbList[i]->hwnd, SW_HIDE );
}
static LRESULT __stdcall newMirandaWndProc( HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam )
{
- if( uMsg == WM_WINDOWPOSCHANGED)
- {
+ if ( uMsg == WM_WINDOWPOSCHANGED) {
WINDOWPOS *wp = (WINDOWPOS *)lParam;
- if(wp->flags&SWP_HIDEWINDOW) {
+ if (wp->flags&SWP_HIDEWINDOW) {
bIsCListShow = FALSE;
ShowThumbsOnHideCList();
}
- else if(wp->flags&SWP_SHOWWINDOW){
+ else if (wp->flags&SWP_SHOWWINDOW){
bIsCListShow = TRUE;
HideThumbsOnShowCList();
}
- else if(!(wp->flags&SWP_NOMOVE)){
- BYTE method=DBGetContactSettingByte(NULL, "ModernData", "HideBehind", 0);
- if(method) {
- WORD wBehindEdgeBorderSize=DBGetContactSettingWord(NULL, "ModernData", "HideBehindBorderSize", 0);
+ else if (!(wp->flags&SWP_NOMOVE)) {
+ BYTE method = DBGetContactSettingByte(NULL, "ModernData", "HideBehind", 0);
+ if (method) {
+ WORD wBehindEdgeBorderSize = DBGetContactSettingWord(NULL, "ModernData", "HideBehindBorderSize", 0);
RECT rc = {wp->x, wp->y, wp->x+wp->cx, wp->y+wp->cy};
RECT rcScreen = {wBehindEdgeBorderSize*(2-method), 0, GetSystemMetrics(SM_CXSCREEN)-wBehindEdgeBorderSize*(method-1), GetSystemMetrics(SM_CYSCREEN)};
RECT rcOverlap;
BOOL isIntersect;
isIntersect = IntersectRect( &rcOverlap, &rc, &rcScreen );
- if ( !isIntersect && bIsCListShow ){
+ if ( !isIntersect && bIsCListShow ) {
bIsCListShow = FALSE;
ShowThumbsOnHideCList();
}
- else if ( isIntersect && !bIsCListShow ){
+ else if ( isIntersect && !bIsCListShow ) {
bIsCListShow = TRUE;
HideThumbsOnShowCList();
}
diff --git a/plugins/FloatingContacts/options.cpp b/plugins/FloatingContacts/options.cpp
index be257e7456..f4c2c6371c 100644
--- a/plugins/FloatingContacts/options.cpp
+++ b/plugins/FloatingContacts/options.cpp
@@ -28,9 +28,9 @@ static SFontSettings s_rgFontSettingsMiranda[FLT_FONTIDS];
#define FLT_SAME_AS_NONE ((BYTE)0xFF)
#define FLT_SAME_AS_MIRANDA ((BYTE)0xFE)
-static char* s_rgszFontSizes[]={"8","10","14","16","18","20","24","28"};
+static char* s_rgszFontSizes[] = {"8","10","14","16","18","20","24","28"};
-static const TCHAR* s_rgszFontIdDescr[FLT_FONTIDS] =
+static const TCHAR* s_rgszFontIdDescr[FLT_FONTIDS] =
{
_T("Standard contacts"),
_T("Online contacts to whom you have a different visibility"),
@@ -39,7 +39,7 @@ static const TCHAR* s_rgszFontIdDescr[FLT_FONTIDS] =
_T("Contacts which are 'not on list'"),
};
-static WORD s_rgwFontSameAsDefault[FLT_FONTIDS] =
+static WORD s_rgwFontSameAsDefault[FLT_FONTIDS] =
{
MAKEWORD(FLT_SAME_AS_MIRANDA, 0x0F),
MAKEWORD(FLT_SAME_AS_MIRANDA, 0x0F),
@@ -48,7 +48,7 @@ static WORD s_rgwFontSameAsDefault[FLT_FONTIDS] =
MAKEWORD(FLT_SAME_AS_MIRANDA, 0x0F),
};
-static int s_rgnMirandaFontId[FLT_FONTIDS] =
+static int s_rgnMirandaFontId[FLT_FONTIDS] =
{
FONTID_CONTACTS,
FONTID_INVIS,
@@ -106,25 +106,25 @@ OnOptionsInitialize
OPTIONSDIALOGPAGE odp;
ZeroMemory(&odp, sizeof(odp));
- odp.cbSize = sizeof(odp);
- odp.hInstance = hInst;
- odp.pszTemplate = MAKEINTRESOURCEA(IDD_OPT_FLTCONT);
- odp.ptszTitle = _T("Floating Contacts");
- odp.ptszGroup = _T("Plugins");
- odp.ptszTab = _T("Main Features");
- odp.flags = ODPF_BOLDGROUPS|ODPF_TCHAR;
- odp.pfnDlgProc = (DLGPROC)OptWndProc;
+ odp.cbSize = sizeof(odp);
+ odp.hInstance = hInst;
+ odp.pszTemplate = MAKEINTRESOURCEA(IDD_OPT_FLTCONT);
+ odp.ptszTitle = _T("Floating Contacts");
+ odp.ptszGroup = _T("Plugins");
+ odp.ptszTab = _T("Main Features");
+ odp.flags = ODPF_BOLDGROUPS|ODPF_TCHAR;
+ odp.pfnDlgProc = (DLGPROC)OptWndProc;
CallService(MS_OPT_ADDPAGE, wParam, (LPARAM)&odp);
ZeroMemory(&odp, sizeof(odp));
- odp.cbSize = sizeof(odp);
- odp.hInstance = hInst;
- odp.pszTemplate = MAKEINTRESOURCEA(IDD_OPT_SKIN);
- odp.ptszTitle = _T("Floating Contacts");
- odp.ptszGroup = _T("Plugins");
- odp.ptszTab = _T("Appearance");
- odp.flags = ODPF_BOLDGROUPS|ODPF_TCHAR;
- odp.pfnDlgProc = (DLGPROC)OptSknWndProc;
+ odp.cbSize = sizeof(odp);
+ odp.hInstance = hInst;
+ odp.pszTemplate = MAKEINTRESOURCEA(IDD_OPT_SKIN);
+ odp.ptszTitle = _T("Floating Contacts");
+ odp.ptszGroup = _T("Plugins");
+ odp.ptszTab = _T("Appearance");
+ odp.flags = ODPF_BOLDGROUPS|ODPF_TCHAR;
+ odp.pfnDlgProc = (DLGPROC)OptSknWndProc;
CallService(MS_OPT_ADDPAGE, wParam, (LPARAM)&odp);
return 0;
@@ -157,9 +157,9 @@ FillFontListThread
LOGFONTA lf = {0};
HDC hdc = GetDC(hwndDlg);
- lf.lfCharSet = DEFAULT_CHARSET;
- lf.lfFaceName[0] = 0;
- lf.lfPitchAndFamily = 0;
+ lf.lfCharSet = DEFAULT_CHARSET;
+ lf.lfFaceName[0] = 0;
+ lf.lfPitchAndFamily = 0;
EnumFontFamiliesExA(hdc, &lf, (FONTENUMPROCA)EnumFontsProc, (LPARAM)GetDlgItem(hwndDlg,IDC_TYPEFACE), 0);
ReleaseDC(hwndDlg, hdc);
return;
@@ -280,8 +280,8 @@ GetFontSetting
wsprintfA(idstr, "Font%dAs", nFontId);
wSameAs = (WORD)DBGetContactSettingWord(NULL, sModule, idstr, s_rgwFontSameAsDefault[nFontId]);
- bySameAs=LOBYTE(wSameAs);
- bySameAsFlags=HIBYTE(wSameAs);
+ bySameAs = LOBYTE(wSameAs);
+ bySameAsFlags = HIBYTE(wSameAs);
if (FLT_SAME_AS_MIRANDA == bySameAs)
{
@@ -454,20 +454,20 @@ OptWndProc
fcOpt.bFixedWidth = (BOOL)IsDlgButtonChecked(hwndDlg, IDC_CHK_WIDTH);
DBWriteContactSettingByte(NULL, sModule, "FixedWidth", (BYTE)fcOpt.bFixedWidth);
- fcOpt.nThumbWidth = GetDlgItemInt(hwndDlg, IDC_TXT_WIDTH, &bSuccess, FALSE);
+ fcOpt.nThumbWidth = GetDlgItemInt(hwndDlg, IDC_TXT_WIDTH, &bSuccess, FALSE);
DBWriteContactSettingDword(NULL, sModule, "Width", fcOpt.nThumbWidth );
- if(bEnableTip)
+ if (bEnableTip)
{
fcOpt.bShowTip = (BOOL)IsDlgButtonChecked(hwndDlg, IDC_CHK_TIP);
DBWriteContactSettingByte(NULL, sModule, "ShowTip", (BYTE)fcOpt.bShowTip);
- fcOpt.TimeIn = GetDlgItemInt(hwndDlg, IDC_TXT_TIMEIN, &bSuccess, FALSE);
+ fcOpt.TimeIn = GetDlgItemInt(hwndDlg, IDC_TXT_TIMEIN, &bSuccess, FALSE);
DBWriteContactSettingWord(NULL, sModule, "TimeIn", fcOpt.TimeIn );
}
fcOpt.bToTop = (BOOL)IsDlgButtonChecked(hwndDlg, IDC_CHK_TOTOP);
DBWriteContactSettingByte(NULL, sModule, "ToTop", (BYTE)fcOpt.bToTop);
- fcOpt.ToTopTime = GetDlgItemInt(hwndDlg, IDC_TXT_TOTOPTIME, &bSuccess, FALSE);
+ fcOpt.ToTopTime = GetDlgItemInt(hwndDlg, IDC_TXT_TOTOPTIME, &bSuccess, FALSE);
DBWriteContactSettingWord(NULL, sModule, "ToTopTime", fcOpt.ToTopTime );
fcOpt.bHideWhenCListShow = (BOOL)IsDlgButtonChecked(hwndDlg, IDC_CHK_HIDE_WHEN_CLISTSHOW);
@@ -605,7 +605,7 @@ OptSknWndProc
SIZE size;
HFONT hFont = CreateFontIndirectA(&lf);
- hdc=GetDC(hwndDlg);
+ hdc = GetDC(hwndDlg);
SelectObject(hdc, hFont);
GetTextExtentPoint32A(hdc, "x", 1, &size);
ReleaseDC(hwndDlg, hdc);
@@ -790,8 +790,8 @@ OptSknWndProc
}
lf.lfHeight = GetDlgItemInt(hwndDlg, IDC_FONTSIZE, NULL, FALSE);
{
- HDC hdc=GetDC(NULL);
- lf.lfHeight=-MulDiv(lf.lfHeight, GetDeviceCaps(hdc, LOGPIXELSY), 72);
+ HDC hdc = GetDC(NULL);
+ lf.lfHeight = -MulDiv(lf.lfHeight, GetDeviceCaps(hdc, LOGPIXELSY), 72);
ReleaseDC(NULL,hdc);
}
lf.lfWidth = 0;
@@ -895,7 +895,7 @@ OptSknWndProc
, 0
);
s_rgFontSettings[wParam].size = (char)GetDlgItemInt(hwndDlg, IDC_FONTSIZE, NULL, FALSE);
- s_rgFontSettings[wParam].style= (IsDlgButtonChecked(hwndDlg, IDC_BOLD) ? DBFONTF_BOLD : 0)
+ s_rgFontSettings[wParam].style = (IsDlgButtonChecked(hwndDlg, IDC_BOLD) ? DBFONTF_BOLD : 0)
| (IsDlgButtonChecked(hwndDlg, IDC_ITALIC) ? DBFONTF_ITALIC : 0)
| (IsDlgButtonChecked(hwndDlg, IDC_UNDERLINE) ? DBFONTF_UNDERLINE : 0);
s_rgFontSettings[wParam].colour = SendDlgItemMessage(hwndDlg, IDC_COLOUR, CPM_GETCOLOUR, 0, 0);
@@ -959,7 +959,7 @@ OptSknWndProc
char szPercent[20];
nPos = (BYTE)SendDlgItemMessage(hwndDlg, IDC_SLIDER_OPACITY, TBM_GETPOS, 0, 0);
- fcOpt.thumbAlpha = (BYTE)(( nPos * 255 ) / 100 );
+ fcOpt.thumbAlpha = (BYTE)(( nPos * 255 ) / 100 );
SetThumbsOpacity(fcOpt.thumbAlpha);
wsprintfA(szPercent, "%d%%", nPos);
@@ -985,7 +985,7 @@ OptSknWndProc
case IDC_BROWSE:
{
char str[MAX_PATH];
- OPENFILENAMEA ofn={0};
+ OPENFILENAMEA ofn = {0};
char filter[512];
GetDlgItemTextA(hwndDlg, IDC_FILENAME, str, sizeof(str));
diff --git a/plugins/FloatingContacts/thumbs.cpp b/plugins/FloatingContacts/thumbs.cpp
index ad08865f01..34501bfd57 100644
--- a/plugins/FloatingContacts/thumbs.cpp
+++ b/plugins/FloatingContacts/thumbs.cpp
@@ -6,13 +6,13 @@ ThumbList thumbList;
/////////////////////////////////////////////////////////////////////////////
// ThumbInfo
static POINT ptOld;
-static BOOL bMouseDown = FALSE;
-static BOOL bMouseIn = FALSE;
-static BOOL bMouseMoved = FALSE;
-static short nLeft = 0;
-static short nTop = 0;
-static int nOffs = 5;
-static ThumbInfo *pThumbMouseIn = NULL;
+static BOOL bMouseDown = FALSE;
+static BOOL bMouseIn = FALSE;
+static BOOL bMouseMoved = FALSE;
+static short nLeft = 0;
+static short nTop = 0;
+static int nOffs = 5;
+static ThumbInfo *pThumbMouseIn = NULL;
static void SnapToScreen( RECT rcThumb, int nX, int nY, int *pX, int *pY )
{
@@ -22,7 +22,7 @@ static void SnapToScreen( RECT rcThumb, int nX, int nY, int *pX, int *pY )
assert( NULL != pX );
assert( NULL != pY );
- nWidth = rcThumb.right - rcThumb.left;
+ nWidth = rcThumb.right - rcThumb.left;
nHeight = rcThumb.bottom - rcThumb.top;
*pX = nX < ( nOffs + rcScreen.left ) ? rcScreen.left : nX;
@@ -40,8 +40,8 @@ ThumbInfo::ThumbInfo()
ThumbInfo::~ThumbInfo()
{
- if(pThumbMouseIn==this){
- pThumbMouseIn=NULL;
+ if (pThumbMouseIn == this){
+ pThumbMouseIn = NULL;
KillTimer(hwnd, TIMERID_LEAVE_T);
}
dropTarget->Release();
@@ -105,7 +105,7 @@ void ThumbInfo::PositionThumbWorker(short nX, short nY, POINT *newPos)
// Get thumb dimnsions
GetThumbRect( &rcThumb );
- nWidth = rcThumb.right - rcThumb.left;
+ nWidth = rcThumb.right - rcThumb.left;
nHeight = rcThumb.bottom - rcThumb.top;
// Docking and screen boundaries check
@@ -121,7 +121,7 @@ void ThumbInfo::PositionThumbWorker(short nX, short nY, POINT *newPos)
for (int i = 0; i < thumbList.getCount(); ++i)
{
- ThumbInfo *pCurThumb = thumbList[i];
+ ThumbInfo *pCurThumb = thumbList[i];
if ( pCurThumb != this )
{
@@ -132,38 +132,38 @@ void ThumbInfo::PositionThumbWorker(short nX, short nY, POINT *newPos)
// These are rects we will dock into
- rcLeft.left = rc.left - nOffs;
- rcLeft.top = rc.top - nOffs;
- rcLeft.right = rc.left + nOffs;
- rcLeft.bottom = rc.bottom + nOffs;
+ rcLeft.left = rc.left - nOffs;
+ rcLeft.top = rc.top - nOffs;
+ rcLeft.right = rc.left + nOffs;
+ rcLeft.bottom = rc.bottom + nOffs;
- rcTop.left = rc.left - nOffs;
- rcTop.top = rc.top - nOffs;
- rcTop.right = rc.right + nOffs;
- rcTop.bottom = rc.top + nOffs;
-
- rcRight.left = rc.right - nOffs;
- rcRight.top = rc.top - nOffs;
- rcRight.right = rc.right + nOffs;
- rcRight.bottom = rc.bottom + nOffs;
-
- rcBottom.left = rc.left - nOffs;
- rcBottom.top = rc.bottom - nOffs;
- rcBottom.right = rc.right + nOffs;
+ rcTop.left = rc.left - nOffs;
+ rcTop.top = rc.top - nOffs;
+ rcTop.right = rc.right + nOffs;
+ rcTop.bottom = rc.top + nOffs;
+
+ rcRight.left = rc.right - nOffs;
+ rcRight.top = rc.top - nOffs;
+ rcRight.right = rc.right + nOffs;
+ rcRight.bottom = rc.bottom + nOffs;
+
+ rcBottom.left = rc.left - nOffs;
+ rcBottom.top = rc.bottom - nOffs;
+ rcBottom.right = rc.right + nOffs;
rcBottom.bottom = rc.bottom + nOffs;
- bDockedLeft = FALSE;
- bDockedRight = FALSE;
+ bDockedLeft = FALSE;
+ bDockedRight = FALSE;
// Upper-left
- pt.x = rcThumb.left;
- pt.y = rcThumb.top;
- bDocked = FALSE;
+ pt.x = rcThumb.left;
+ pt.y = rcThumb.top;
+ bDocked = FALSE;
if ( PtInRect( &rcRight, pt ) )
{
- nNewX = rc.right;
+ nNewX = rc.right;
bDocked = TRUE;
}
@@ -179,21 +179,21 @@ void ThumbInfo::PositionThumbWorker(short nX, short nY, POINT *newPos)
if ( PtInRect( &rcTop, pt ) )
{
- nNewY = rc.top;
- bDockedLeft = bDocked;
+ nNewY = rc.top;
+ bDockedLeft = bDocked;
}
// Upper-right
- pt.x = rcThumb.right;
- pt.y = rcThumb.top;
- bDocked = FALSE;
+ pt.x = rcThumb.right;
+ pt.y = rcThumb.top;
+ bDocked = FALSE;
if ( !bLeading && PtInRect( &rcLeft, pt ) )
{
if ( !bDockedLeft )
{
- nNewX = rc.left - nWidth;
- bDocked = TRUE;
+ nNewX = rc.left - nWidth;
+ bDocked = TRUE;
}
else if ( rc.right == rcThumb.left )
{
@@ -214,8 +214,8 @@ void ThumbInfo::PositionThumbWorker(short nX, short nY, POINT *newPos)
if ( !bLeading && PtInRect( &rcTop, pt ) )
{
- nNewY = rc.top;
- bDockedRight = bDocked;
+ nNewY = rc.top;
+ bDockedRight = bDocked;
}
if ( fcOpt.bMoveTogether )
@@ -281,13 +281,13 @@ void ThumbInfo::PositionThumbWorker(short nX, short nY, POINT *newPos)
void ThumbInfo::ResizeThumb()
{
- HDC hdc = NULL;
- HFONT hOldFont = NULL;
+ HDC hdc = NULL;
+ HFONT hOldFont = NULL;
POINT ptText;
SIZEL sizeIcon;
SIZEL sizeText;
RECT rcThumb;
- int index = FLT_FONTID_NOTONLIST;
+ int index = FLT_FONTID_NOTONLIST;
ThumbInfo *pNextThumb = NULL;
@@ -324,7 +324,7 @@ void ThumbInfo::ResizeThumb()
}
else
{
- index = FLT_FONTID_INVIS;
+ index = FLT_FONTID_INVIS;
}
}
else if (ID_STATUS_OFFLINE == nContactStatus)
@@ -416,7 +416,7 @@ void ThumbInfo::OnLButtonDown(short nX, short nY)
{
RECT rc;
- if(bEnableTip && fcOpt.bShowTip) KillTip();
+ if (bEnableTip && fcOpt.bShowTip) KillTip();
// ptOld.x = nX;
// ptOld.y = nY;
@@ -426,12 +426,12 @@ void ThumbInfo::OnLButtonDown(short nX, short nY)
GetCursorPos(&ptOld);
GetThumbRect(&rc);
- nLeft = (short)rc.left;
- nTop = (short)rc.top;
+ nLeft = (short)rc.left;
+ nTop = (short)rc.top;
- //bMouseIn = FALSE;
- bMouseDown = TRUE;
- bMouseMoved = FALSE;
+ //bMouseIn = FALSE;
+ bMouseDown = TRUE;
+ bMouseMoved = FALSE;
// SetCapture(hwnd);
}
@@ -459,7 +459,7 @@ void ThumbInfo::OnLButtonUp()
if ( IntersectRect( &rcOverlap, &rcMiranda, &rcThumb ) )
{
- if( IsWindowVisible( hwndMiranda ) )
+ if ( IsWindowVisible( hwndMiranda ) )
{
DeleteContactPos( );
thumbList.RemoveThumb( this );
@@ -480,7 +480,7 @@ void ThumbInfo::OnMouseMove(short nX, short nY, WPARAM wParam)
// Position thumb
- if( bMouseDown )
+ if ( bMouseDown )
{
ptNew.x = nX;
@@ -491,8 +491,8 @@ void ThumbInfo::OnMouseMove(short nX, short nY, WPARAM wParam)
dX = ptNew.x - ptOld.x;
dY = ptNew.y - ptOld.y;
- if(dX || dY){
- bMouseMoved = TRUE;
+ if (dX || dY){
+ bMouseMoved = TRUE;
nLeft += (short)dX;
nTop += (short)dY;
@@ -511,25 +511,25 @@ void ThumbInfo::OnMouseMove(short nX, short nY, WPARAM wParam)
if ( !pThumbMouseIn )//
{
SetTimer( hwnd, TIMERID_LEAVE_T, 10, NULL );
- pThumbMouseIn=this;
+ pThumbMouseIn = this;
ThumbSelect( TRUE );
}
- if(bEnableTip && fcOpt.bShowTip && !bMouseDown){
+ if (bEnableTip && fcOpt.bShowTip && !bMouseDown){
WORD tmpTimeIn;
POINT pt;
RECT rc;
GetCursorPos(&pt);
GetThumbRect(&rc);
- if(!PtInRect(&rc,pt)){
+ if (!PtInRect(&rc,pt)) {
KillTip();
return;
}
- if(fTipTimerActive && abs(pt.x-ptTipSt.x)<5 && abs(pt.y-ptTipSt.x)<5){
+ if (fTipTimerActive && abs(pt.x-ptTipSt.x)<5 && abs(pt.y-ptTipSt.x)<5){
return;
}
- ptTipSt=pt;
+ ptTipSt = pt;
if (fTipTimerActive) {
KillTimer(hwnd, TIMERID_HOVER_T);
@@ -602,7 +602,7 @@ void ThumbInfo::UpdateContent()
int oldBkMode, index = 0;// nStatus;
UINT fStyle = ILD_NORMAL;
- HDC hdcDraw = bmpContent.getDC();
+ HDC hdcDraw = bmpContent.getDC();
SetRect(&rc, 0, 0, szSize.cx, szSize.cy);
if ( NULL != hBmpBackground )
@@ -624,7 +624,7 @@ void ThumbInfo::UpdateContent()
height = rcBkgnd.bottom - rcBkgnd.top;
GetObject(hBmpBackground, sizeof(bmp), &bmp);
- hdcBmp = CreateCompatibleDC( hdcDraw );
+ hdcBmp = CreateCompatibleDC( hdcDraw );
hbmTmp = (HBITMAP)SelectObject( hdcBmp, hBmpBackground );
maxx = (0 != (nBackgroundBmpUse & CLBF_TILEH) ? rcBkgnd.right : rcBkgnd.left + 1);
@@ -715,7 +715,7 @@ void ThumbInfo::UpdateContent()
ImageList_GetIconSize_my( himl, size );
- oldBkMode = SetBkMode( hdcDraw, TRANSPARENT );
+ oldBkMode = SetBkMode( hdcDraw, TRANSPARENT );
if (!DBGetContactSettingByte(hContact, "CList", "NotOnList", 0))
{
@@ -729,9 +729,9 @@ void ThumbInfo::UpdateContent()
if ( NULL != szProto )
{
- nStatus = CallProtoService(szProto, PS_GETSTATUS, 0, 0);
- nContactStatus = DBGetContactSettingWord(hContact, szProto, "Status", ID_STATUS_OFFLINE);
- nApparentMode = DBGetContactSettingWord(hContact, szProto, "ApparentMode", 0);
+ nStatus = CallProtoService(szProto, PS_GETSTATUS, 0, 0);
+ nContactStatus = DBGetContactSettingWord(hContact, szProto, "Status", ID_STATUS_OFFLINE);
+ nApparentMode = DBGetContactSettingWord(hContact, szProto, "ApparentMode", 0);
if ( (nStatus == ID_STATUS_INVISIBLE && nApparentMode == ID_STATUS_ONLINE) ||
(nStatus != ID_STATUS_INVISIBLE && nApparentMode == ID_STATUS_OFFLINE) )
@@ -742,8 +742,8 @@ void ThumbInfo::UpdateContent()
}
else
{
- index = FLT_FONTID_INVIS;
- if(fcOpt.bShowIdle && DBGetContactSettingDword(hContact, szProto, "IdleTS", 0)){
+ index = FLT_FONTID_INVIS;
+ if (fcOpt.bShowIdle && DBGetContactSettingDword(hContact, szProto, "IdleTS", 0)) {
fStyle|=ILD_BLEND50;
}
}
@@ -755,7 +755,7 @@ void ThumbInfo::UpdateContent()
else
{
index = FLT_FONTID_CONTACTS;
- if(fcOpt.bShowIdle && DBGetContactSettingDword(hContact, szProto, "IdleTS", 0)){
+ if (fcOpt.bShowIdle && DBGetContactSettingDword(hContact, szProto, "IdleTS", 0)) {
fStyle|=ILD_BLEND50;
}
}
@@ -849,23 +849,23 @@ void ThumbInfo::PopUpMessageDialog( )
void ThumbInfo::OnTimer(BYTE idTimer)
{
- if(idTimer == TIMERID_SELECT_T){
+ if (idTimer == TIMERID_SELECT_T){
KillTimer( hwnd, TIMERID_SELECT_T );
ThumbDeselect( FALSE );
}
- if(idTimer == TIMERID_LEAVE_T && !bMouseDown){
+ if (idTimer == TIMERID_LEAVE_T && !bMouseDown){
POINT pt;
RECT rc;
GetCursorPos(&pt);
GetThumbRect(&rc);
- if(!PtInRect(&rc, pt)){
+ if (!PtInRect(&rc, pt)) {
KillTimer( hwnd, TIMERID_LEAVE_T );
- pThumbMouseIn = NULL;
+ pThumbMouseIn = NULL;
ThumbDeselect( TRUE );
}
}
- if(bEnableTip && fcOpt.bShowTip && idTimer == TIMERID_HOVER_T){
+ if (bEnableTip && fcOpt.bShowTip && idTimer == TIMERID_HOVER_T){
POINT pt;
CLCINFOTIP ti = {0};
ti.cbSize = sizeof(ti);
@@ -873,7 +873,7 @@ void ThumbInfo::OnTimer(BYTE idTimer)
KillTimer(hwnd, TIMERID_HOVER_T);
fTipTimerActive = FALSE;
GetCursorPos(&pt);
- if(abs(pt.x-ptTipSt.x)<5 && abs(pt.y-ptTipSt.y)<5){
+ if (abs(pt.x-ptTipSt.x)<5 && abs(pt.y-ptTipSt.y)<5){
ti.ptCursor = pt;
fTipActive = TRUE;
@@ -889,8 +889,8 @@ void DockThumbs( ThumbInfo *pThumbLeft, ThumbInfo *pThumbRight, BOOL bMoveLeft )
{
if ( ( pThumbRight->dockOpt.hwndLeft == NULL ) && ( pThumbLeft->dockOpt.hwndRight == NULL ) )
{
- pThumbRight->dockOpt.hwndLeft = pThumbLeft->hwnd;
- pThumbLeft->dockOpt.hwndRight = pThumbRight->hwnd;
+ pThumbRight->dockOpt.hwndLeft = pThumbLeft->hwnd;
+ pThumbLeft->dockOpt.hwndRight = pThumbRight->hwnd;
}
}
@@ -938,7 +938,7 @@ ThumbList::~ThumbList()
ThumbInfo *ThumbList::AddThumb(HWND hwnd, TCHAR *ptszName, HANDLE hContact)
{
- ThumbInfo *pThumb = NULL;
+ ThumbInfo *pThumb = NULL;
if ( ptszName == NULL ) return( NULL );
if ( hContact == NULL ) return( NULL );
@@ -949,11 +949,11 @@ ThumbInfo *ThumbList::AddThumb(HWND hwnd, TCHAR *ptszName, HANDLE hContact)
if ( pThumb != NULL )
{
_tcsncpy( pThumb->ptszName, ptszName, USERNAME_LEN - 1 );
- pThumb->hContact = hContact;
- pThumb->hwnd = hwnd;
+ pThumb->hContact = hContact;
+ pThumb->hwnd = hwnd;
- pThumb->dockOpt.hwndLeft = NULL;
- pThumb->dockOpt.hwndRight = NULL;
+ pThumb->dockOpt.hwndLeft = NULL;
+ pThumb->dockOpt.hwndRight = NULL;
pThumb->fTipActive = FALSE;