diff options
Diffstat (limited to 'plugins/FloatingContacts/thumbs.cpp')
-rw-r--r-- | plugins/FloatingContacts/thumbs.cpp | 170 |
1 files changed, 85 insertions, 85 deletions
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;
|