From 0558746230c69a040bb9423fbefe64ccfcfa0590 Mon Sep 17 00:00:00 2001 From: George Hazan Date: Sat, 10 Nov 2012 17:27:44 +0000 Subject: - unused icons removed; - spaces replaced with tabs git-svn-id: http://svn.miranda-ng.org/main/trunk@2276 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c --- plugins/Clist_modern/src/hdr/modern_callproc.h | 72 ++-- plugins/Clist_modern/src/hdr/modern_clcpaint.h | 124 +++--- plugins/Clist_modern/src/hdr/modern_cluiframes.h | 33 +- .../Clist_modern/src/hdr/modern_commonprototypes.h | 8 +- plugins/Clist_modern/src/hdr/modern_row.h | 33 +- plugins/Clist_modern/src/hdr/modern_skinengine.h | 98 +++-- plugins/Clist_modern/src/hdr/modern_skinselector.h | 49 ++- plugins/Clist_modern/src/hdr/modern_static_clui.h | 49 ++- .../src/hdr/modern_static_cluiframes_service.h | 171 ++++---- plugins/Clist_modern/src/modern_aniavatars.cpp | 3 +- plugins/Clist_modern/src/modern_cachefuncs.cpp | 7 +- plugins/Clist_modern/src/modern_clcidents.cpp | 6 +- plugins/Clist_modern/src/modern_clcmsgs.cpp | 6 +- plugins/Clist_modern/src/modern_clistevents.cpp | 433 ++++++++++----------- plugins/Clist_modern/src/modern_clistmod.cpp | 7 +- plugins/Clist_modern/src/modern_clistsettings.cpp | 14 +- plugins/Clist_modern/src/modern_clisttray.cpp | 29 +- plugins/Clist_modern/src/modern_clui.cpp | 2 +- plugins/Clist_modern/src/modern_cluiframes.cpp | 209 ++++------ plugins/Clist_modern/src/modern_framesmenu.cpp | 6 +- plugins/Clist_modern/src/modern_groupmenu.cpp | 6 +- plugins/Clist_modern/src/modern_skinengine.cpp | 8 +- plugins/Clist_modern/src/modern_viewmodebar.cpp | 2 +- plugins/Clist_modern/src/resource.h | 9 - 24 files changed, 651 insertions(+), 733 deletions(-) (limited to 'plugins/Clist_modern/src') diff --git a/plugins/Clist_modern/src/hdr/modern_callproc.h b/plugins/Clist_modern/src/hdr/modern_callproc.h index 19cfb883b6..4e3df47257 100644 --- a/plugins/Clist_modern/src/hdr/modern_callproc.h +++ b/plugins/Clist_modern/src/hdr/modern_callproc.h @@ -16,95 +16,95 @@ class __baseCall { public: virtual int __DoCallStorageProc() =0; virtual ~__bas template< class R > class _callParams0 : public __baseCall { public: - R(*_proc)(); - _callParams0( R (*proc)()) : _proc(proc){}; - int __DoCallStorageProc() { return (int)_proc(); } + R(*_proc)(); + _callParams0( R (*proc)()) : _proc(proc){}; + int __DoCallStorageProc() { return (int)_proc(); } }; template<> class _callParams0 : public __baseCall { public: - void(*_proc)(); - _callParams0( void (*proc)()) : _proc(proc){}; - int __DoCallStorageProc() { _proc(); return 0; } + void(*_proc)(); + _callParams0( void (*proc)()) : _proc(proc){}; + int __DoCallStorageProc() { _proc(); return 0; } }; template< class R, class A> class _callParams1 : public __baseCall { public: - R(*_proc)(A); A _a; - _callParams1( R(*proc)(A), A a) : _proc(proc), _a(a) {}; - int __DoCallStorageProc() { return (int)_proc(_a); } + R(*_proc)(A); A _a; + _callParams1( R(*proc)(A), A a) : _proc(proc), _a(a) {}; + int __DoCallStorageProc() { return (int)_proc(_a); } }; template class _callParams1 : public __baseCall { public: - void(*_proc)(A); A _a; - _callParams1( void(*proc)(A), A a) : _proc(proc), _a(a) {}; - int __DoCallStorageProc() { _proc(_a); return 0; } + void(*_proc)(A); A _a; + _callParams1( void(*proc)(A), A a) : _proc(proc), _a(a) {}; + int __DoCallStorageProc() { _proc(_a); return 0; } }; template< class R, class A, class B> class _callParams2 : public __baseCall { public: - R (*_proc)(A, B); A _a; B _b; - _callParams2( R (*proc)(A, B), A a, B b) : _proc(proc), _a(a), _b(b) {}; - int __DoCallStorageProc() { return (int)_proc(_a, _b); } + R (*_proc)(A, B); A _a; B _b; + _callParams2( R (*proc)(A, B), A a, B b) : _proc(proc), _a(a), _b(b) {}; + int __DoCallStorageProc() { return (int)_proc(_a, _b); } }; template< class A, class B> class _callParams2 : public __baseCall { public: - void (*_proc)(A, B); A _a; B _b; - _callParams2( void (*proc)(A, B), A a, B b) : _proc(proc), _a(a), _b(b) {}; - int __DoCallStorageProc() { _proc(_a, _b); return 0; } + void (*_proc)(A, B); A _a; B _b; + _callParams2( void (*proc)(A, B), A a, B b) : _proc(proc), _a(a), _b(b) {}; + int __DoCallStorageProc() { _proc(_a, _b); return 0; } }; template< class R, class A, class B, class C> class _callParams3 : public __baseCall { public: - R (*_proc)(A, B, C); A _a; B _b; C _c; - _callParams3( R (*proc)(A, B, C), A a, B b, C c ) : _proc(proc), _a(a), _b(b), _c(c) {}; - int __DoCallStorageProc() { return (int)_proc(_a,_b,_c); } + R (*_proc)(A, B, C); A _a; B _b; C _c; + _callParams3( R (*proc)(A, B, C), A a, B b, C c ) : _proc(proc), _a(a), _b(b), _c(c) {}; + int __DoCallStorageProc() { return (int)_proc(_a,_b,_c); } }; template< class A, class B, class C> class _callParams3 : public __baseCall { public: - void (*_proc)(A, B, C); A _a; B _b; C _c; - _callParams3( void (*proc)(A, B, C), A a, B b, C c ) : _proc(proc), _a(a), _b(b), _c(c) {}; - int __DoCallStorageProc() { _proc(_a,_b,_c); return 0;} + void (*_proc)(A, B, C); A _a; B _b; C _c; + _callParams3( void (*proc)(A, B, C), A a, B b, C c ) : _proc(proc), _a(a), _b(b), _c(c) {}; + int __DoCallStorageProc() { _proc(_a,_b,_c); return 0;} }; template < class R > R __DoCall( R(*__proc)(), ASYNC_T sync_mode ) { - typedef _callParams0< R > callClass; - callClass * storage = new callClass( __proc ); - return (R) call::__ProcessCall( storage, sync_mode ); + typedef _callParams0< R > callClass; + callClass * storage = new callClass( __proc ); + return (R) call::__ProcessCall( storage, sync_mode ); }; template < class R, class A > R __DoCall( R(*__proc)( A ), A a, ASYNC_T sync_mode ) { - typedef _callParams1< R, A > callClass; - callClass * storage = new callClass( __proc, a ); - return (R)__ProcessCall( storage, sync_mode ); + typedef _callParams1< R, A > callClass; + callClass * storage = new callClass( __proc, a ); + return (R)__ProcessCall( storage, sync_mode ); }; template < class R, class A, class B > R __DoCall( R(*__proc)( A, B ), A a, B b, ASYNC_T sync_mode ) { - typedef _callParams2< R, A, B > callClass; - callClass * storage = new callClass( __proc, a, b); - return (R)__ProcessCall( storage, sync_mode ); + typedef _callParams2< R, A, B > callClass; + callClass * storage = new callClass( __proc, a, b); + return (R)__ProcessCall( storage, sync_mode ); }; template < class R, class A, class B, class C > R __DoCall( R(*__proc)( A, B, C ), A a, B b, C c, ASYNC_T sync_mode ) { - typedef _callParams3< R, A, B, C > callClass; - callClass * storage = new callClass( __proc, a, b, c); - return (R)__ProcessCall( storage, sync_mode ); + typedef _callParams3< R, A, B, C > callClass; + callClass * storage = new callClass( __proc, a, b, c); + return (R)__ProcessCall( storage, sync_mode ); }; diff --git a/plugins/Clist_modern/src/hdr/modern_clcpaint.h b/plugins/Clist_modern/src/hdr/modern_clcpaint.h index 73c275fe56..6e1a5ceea4 100644 --- a/plugins/Clist_modern/src/hdr/modern_clcpaint.h +++ b/plugins/Clist_modern/src/hdr/modern_clcpaint.h @@ -119,72 +119,72 @@ private: void _GetBlendMode( IN struct ClcData *dat, IN ClcContact * Drawing, IN BOOL selected, IN BOOL hottrack, IN BOOL bFlag, OUT COLORREF * OutColourFg, OUT int * OutMode ); void _DrawContactItems( HWND hwnd, HDC hdcMem, struct ClcData *dat, ClcContact *Drawing, RECT *row_rc, RECT *free_row_rc, int left_pos, int right_pos, int selected, int hottrack, RECT *rcPaint ); void _PaintRowItems ( HWND hwnd, HDC hdcMem, struct ClcData *dat, ClcContact *Drawing, RECT row_rc, RECT free_row_rc, int left_pos, int right_pos, int selected, int hottrack, RECT *rcPaint ); - - void _DrawContactAvatar ( HDC hdcMem, struct ClcData *dat, ClcContact *Drawing, RECT *row_rc, int& selected, int& hottrack, RECT& text_rc, RECT * prcItem ); - void _DrawContactIcon ( HDC hdcMem, struct ClcData *dat, ClcContact *Drawing, int& selected, int& hottrack, RECT& text_rc, RECT * prcItem ); - void _DrawContactText ( HDC hdcMem, struct ClcData *dat, ClcContact *Drawing, int& selected, int& hottrack, RECT& text_rc, RECT * prcItem, UINT uTextFormat ); - void _DrawContactSubText ( HDC hdcMem, struct ClcData *dat, ClcContact *Drawing, int& selected, int& hottrack, RECT& text_rc, RECT * prcItem, UINT uTextFormat, BYTE itemType ); - void _DrawContactTime ( HDC hdcMem, struct ClcData *dat, ClcContact *Drawing, int& selected, int& hottrack, RECT& text_rc, RECT * prcItem ); - void _DrawContactExtraIcon ( HDC hdcMem, struct ClcData *dat, ClcContact *Drawing, int& selected, int& hottrack, RECT& text_rc, RECT * rc, int iImage ); - void _DrawContactSelection ( HDC hdcMem, struct ClcData *dat, ClcContact *Drawing, int& selected, int& hottrack, RECT *rcPaint, RECT * prcItem ); - void _DrawContactLine ( HDC hdcMem, struct ClcData *dat, ClcContact *Drawing, RECT *free_row_rc, RECT *rcPaint, RECT& text_rc ); - - int _rcWidth( RECT *rc ) { return rc->right-rc->left; } - int _rcHeight( RECT *rc ) { return rc->bottom-rc->top; } + + void _DrawContactAvatar ( HDC hdcMem, struct ClcData *dat, ClcContact *Drawing, RECT *row_rc, int& selected, int& hottrack, RECT& text_rc, RECT * prcItem ); + void _DrawContactIcon ( HDC hdcMem, struct ClcData *dat, ClcContact *Drawing, int& selected, int& hottrack, RECT& text_rc, RECT * prcItem ); + void _DrawContactText ( HDC hdcMem, struct ClcData *dat, ClcContact *Drawing, int& selected, int& hottrack, RECT& text_rc, RECT * prcItem, UINT uTextFormat ); + void _DrawContactSubText ( HDC hdcMem, struct ClcData *dat, ClcContact *Drawing, int& selected, int& hottrack, RECT& text_rc, RECT * prcItem, UINT uTextFormat, BYTE itemType ); + void _DrawContactTime ( HDC hdcMem, struct ClcData *dat, ClcContact *Drawing, int& selected, int& hottrack, RECT& text_rc, RECT * prcItem ); + void _DrawContactExtraIcon ( HDC hdcMem, struct ClcData *dat, ClcContact *Drawing, int& selected, int& hottrack, RECT& text_rc, RECT * rc, int iImage ); + void _DrawContactSelection ( HDC hdcMem, struct ClcData *dat, ClcContact *Drawing, int& selected, int& hottrack, RECT *rcPaint, RECT * prcItem ); + void _DrawContactLine ( HDC hdcMem, struct ClcData *dat, ClcContact *Drawing, RECT *free_row_rc, RECT *rcPaint, RECT& text_rc ); + + int _rcWidth( RECT *rc ) { return rc->right-rc->left; } + int _rcHeight( RECT *rc ) { return rc->bottom-rc->top; } private: - enum enDrawMode - { - DM_LAYERED = 1, // Draw normal skin on 32 bit with alpha layer - DM_NON_LAYERED = 2, // Draw skinnable, but does not take care about alpha - DM_CLASSIC = 4, // Old style draw for classic - DM_CONTROL = 8, // Draw as control according to windows color scheme - DM_FLOAT = 16, // Float mode - DM_GRAY = 32, // Grayed mode - DM_GREYALTERNATE = 64, // Gray odd lines + enum enDrawMode + { + DM_LAYERED = 1, // Draw normal skin on 32 bit with alpha layer + DM_NON_LAYERED = 2, // Draw skinnable, but does not take care about alpha + DM_CLASSIC = 4, // Old style draw for classic + DM_CONTROL = 8, // Draw as control according to windows color scheme + DM_FLOAT = 16, // Float mode + DM_GRAY = 32, // Grayed mode + DM_GREYALTERNATE = 64, // Gray odd lines DM_DRAW_OFFSCREEN = DM_FLOAT | DM_CONTROL | DM_NON_LAYERED | DM_CLASSIC, + }; - }; - - inline int _DetermineDrawMode( HWND hWnd, struct ClcData *dat ); - - struct _PaintContext - { - enum - { release_none = 0, - release_hdcmem2 = 1, - release_hdcmem = 2 - }; - HDC hdcMem; - HDC hdcMem2; - - HBITMAP hBmpOsb2; - HBITMAP oldbmp2; - - HBITMAP hBmpOsb; - HBITMAP oldbmp; - - HBRUSH hBrushAlternateGrey; - COLORREF tmpbkcolour; - COLORREF tmpforecolour; - - DWORD fRelease; - _PaintContext( HDC _hdcMem = NULL) : - hdcMem ( _hdcMem ), hdcMem2( NULL ), - hBmpOsb2( NULL ), oldbmp2( NULL ), - hBmpOsb( NULL ), oldbmp( NULL ), - hBrushAlternateGrey ( NULL ), - tmpbkcolour( 0 ), tmpforecolour( 0 ), - fRelease ( release_none ) {}; - }; - inline void _PreparePaintContext( HWND hWnd, struct ClcData * dat, HDC hdc, int paintMode, RECT& clRect, _PaintContext& pc ); - inline void _DrawBackground( HWND hWnd, struct ClcData * dat, HDC hdc, int paintMode, RECT* rcPaint, RECT& clRect, _PaintContext& pc ); - inline void _DrawLines( HWND hWnd, struct ClcData * dat, HDC hdc, int paintMode, RECT* rcPaint, RECT& clRect, _PaintContext& pc ); - inline void _DrawInsertionMark( struct ClcData * dat, RECT& clRect, _PaintContext& pc ); - inline void _CopyPaintToDest( HWND hWnd, struct ClcData * dat, HDC hdc, int paintMode, RECT* rcPaint, RECT& clRect, _PaintContext& pc ); - inline void _FreePaintContext( _PaintContext& pc ); - - // void _PaintClcOld( HWND hwnd, struct ClcData *dat, HDC hdc, RECT *rcPaint ); + inline int _DetermineDrawMode( HWND hWnd, struct ClcData *dat ); + + struct _PaintContext + { + enum + { release_none = 0, + release_hdcmem2 = 1, + release_hdcmem = 2 + }; + HDC hdcMem; + HDC hdcMem2; + + HBITMAP hBmpOsb2; + HBITMAP oldbmp2; + + HBITMAP hBmpOsb; + HBITMAP oldbmp; + + HBRUSH hBrushAlternateGrey; + COLORREF tmpbkcolour; + COLORREF tmpforecolour; + + DWORD fRelease; + _PaintContext( HDC _hdcMem = NULL) : + hdcMem ( _hdcMem ), hdcMem2( NULL ), + hBmpOsb2( NULL ), oldbmp2( NULL ), + hBmpOsb( NULL ), oldbmp( NULL ), + hBrushAlternateGrey ( NULL ), + tmpbkcolour( 0 ), tmpforecolour( 0 ), + fRelease ( release_none ) {}; + }; + + inline void _PreparePaintContext( HWND hWnd, struct ClcData * dat, HDC hdc, int paintMode, RECT& clRect, _PaintContext& pc ); + inline void _DrawBackground( HWND hWnd, struct ClcData * dat, HDC hdc, int paintMode, RECT* rcPaint, RECT& clRect, _PaintContext& pc ); + inline void _DrawLines( HWND hWnd, struct ClcData * dat, HDC hdc, int paintMode, RECT* rcPaint, RECT& clRect, _PaintContext& pc ); + inline void _DrawInsertionMark( struct ClcData * dat, RECT& clRect, _PaintContext& pc ); + inline void _CopyPaintToDest( HWND hWnd, struct ClcData * dat, HDC hdc, int paintMode, RECT* rcPaint, RECT& clRect, _PaintContext& pc ); + inline void _FreePaintContext( _PaintContext& pc ); + + // void _PaintClcOld( HWND hwnd, struct ClcData *dat, HDC hdc, RECT *rcPaint ); }; diff --git a/plugins/Clist_modern/src/hdr/modern_cluiframes.h b/plugins/Clist_modern/src/hdr/modern_cluiframes.h index e2c1aade78..d10b828a17 100644 --- a/plugins/Clist_modern/src/hdr/modern_cluiframes.h +++ b/plugins/Clist_modern/src/hdr/modern_cluiframes.h @@ -57,17 +57,18 @@ typedef struct #define CLUIFRAMESMOVEUP "CLUIFramesMoveUp" #define CLUIFRAMESMOVEDOWN "CLUIFramesMoveDown" -typedef struct tagMenuHandles +struct FrameMenuHandles { HANDLE MainMenuItem; HANDLE MIVisible,MITitle,MITBVisible,MILock,MIColl,MIFloating,MIAlignRoot; HANDLE MIAlignTop,MIAlignClient,MIAlignBottom; HANDLE MIBorder; HANDLE MIPosRoot; - HANDLE MIPosUp,MIPosDown; -} FrameMenuHandles; + HANDLE MIPosUp,MIPosDown; +}; -typedef struct tagFrameTitleBar{ +struct FrameTitleBar +{ HWND hwnd; HWND TitleBarbutt; HWND hwndTip; @@ -88,15 +89,16 @@ typedef struct tagFrameTitleBar{ int oldstyles; POINT oldpos; RECT wndSize; -} FrameTitleBar; +}; -typedef struct _DockOpt +struct DockOpt { HWND hwndLeft; HWND hwndRight; -} -DockOpt; -typedef struct _tagFrameWnd{ +}; + +struct FRAMEWND +{ int id; HWND hWnd ; RECT wndSize; @@ -122,13 +124,12 @@ typedef struct _tagFrameWnd{ BOOLEAN UseBorder; int order; DockOpt dockOpt; - HWND OwnerWindow; - tPaintCallbackProc PaintCallbackProc; - sPaintRequest * PaintData; - BOOLEAN bQueued; - HRGN UpdateRgn; - -} FRAMEWND; + HWND OwnerWindow; + tPaintCallbackProc PaintCallbackProc; + sPaintRequest * PaintData; + BOOLEAN bQueued; + HRGN UpdateRgn; +}; #define OFFSET_PROTOPOS 200 #define OFFSET_VISIBLE 400 diff --git a/plugins/Clist_modern/src/hdr/modern_commonprototypes.h b/plugins/Clist_modern/src/hdr/modern_commonprototypes.h index 2b63e85ecc..6e3631e3b0 100644 --- a/plugins/Clist_modern/src/hdr/modern_commonprototypes.h +++ b/plugins/Clist_modern/src/hdr/modern_commonprototypes.h @@ -328,10 +328,10 @@ extern BOOL (WINAPI *g_proc_SetLayeredWindowAttributesNew)(HWND,COLORREF,BYTE,DW #define DWM_BB_TRANSITIONONMAXIMIZED 0x00000004 struct DWM_BLURBEHIND { - DWORD dwFlags; - BOOL fEnable; - HRGN hRgnBlur; - BOOL fTransitionOnMaximized; + DWORD dwFlags; + BOOL fEnable; + HRGN hRgnBlur; + BOOL fTransitionOnMaximized; }; extern HRESULT (WINAPI *g_proc_DWMEnableBlurBehindWindow)(HWND hWnd, DWM_BLURBEHIND *pBlurBehind); diff --git a/plugins/Clist_modern/src/hdr/modern_row.h b/plugins/Clist_modern/src/hdr/modern_row.h index 47b9582c29..4148a692a5 100644 --- a/plugins/Clist_modern/src/hdr/modern_row.h +++ b/plugins/Clist_modern/src/hdr/modern_row.h @@ -52,28 +52,29 @@ // typedef struct tagRowCell { - int cont; // Тип контейнера - контакт, сторока, столбец - int type; // Тип элемента, содержащегося в контейнере, если 0 - пустой контейнер - int halign; // Горизонтальное выравнивание внутри контейнера - int valign; // Вертикальное выравнивание внутри контейнера + int cont; // Тип контейнера - контакт, сторока, столбец + int type; // Тип элемента, содержащегося в контейнере, если 0 - пустой контейнер + int halign; // Горизонтальное выравнивание внутри контейнера + int valign; // Вертикальное выравнивание внутри контейнера - int w; // Ширина элемента контакта, для текстовых полей игнорируется - int h; // Высота элемента котнакта + int w; // Ширина элемента контакта, для текстовых полей игнорируется + int h; // Высота элемента котнакта - BOOL sizing; // Параметр, показывающий наличие текстовых полей в дочерних контейнерах - BOOL layer; // Параметр, показывающий, что контейнер образует новый слой - - BOOL hasfixed; // Параметр показывающий что есть вложенные фиксированные элементы - BOOL fitwidth; // Параметр указывающий что последний элемент заполняет все оставшееся - // Пространство (расстягивает родителя.оверлей) + BOOL sizing; // Параметр, показывающий наличие текстовых полей в дочерних контейнерах + BOOL layer; // Параметр, показывающий, что контейнер образует новый слой + + BOOL hasfixed; // Параметр показывающий что есть вложенные фиксированные элементы + BOOL fitwidth; // Параметр указывающий что последний элемент заполняет все оставшееся + // Пространство (расстягивает родителя.оверлей) int fixed_width; int full_width; - RECT r; // Прямоугольник для рисования элемента - struct tagRowCell * next; // Поле связи - struct tagRowCell * child; // Поле связи см. файл описания -} ROWCELL, *pROWCELL; + RECT r; // Прямоугольник для рисования элемента + struct tagRowCell * next; // Поле связи + struct tagRowCell * child; // Поле связи см. файл описания +} + ROWCELL, *pROWCELL; // Структура для доступа к контейнерам элемента контакта внутри дерева опивания #ifndef _CPPCODE diff --git a/plugins/Clist_modern/src/hdr/modern_skinengine.h b/plugins/Clist_modern/src/hdr/modern_skinengine.h index a2b365b2ba..f9ff072e31 100644 --- a/plugins/Clist_modern/src/hdr/modern_skinengine.h +++ b/plugins/Clist_modern/src/hdr/modern_skinengine.h @@ -20,70 +20,69 @@ /* Structs */ -typedef struct tagSKINOBJECTSLIST +struct SKINOBJECTSLIST { - DWORD dwObjLPReserved; - DWORD dwObjLPAlocated; - char * szSkinPlace; - LISTMODERNMASK * pMaskList; - SKINOBJECTDESCRIPTOR * pObjects; - SortedList * pTextList; -} SKINOBJECTSLIST; - -typedef struct tagGLYPHIMAGE + DWORD dwObjLPReserved; + DWORD dwObjLPAlocated; + char *szSkinPlace; + LISTMODERNMASK *pMaskList; + SKINOBJECTDESCRIPTOR *pObjects; + SortedList *pTextList; +}; + +struct GLYPHIMAGE { - char * szFileName; - DWORD dwLoadedTimes; - HBITMAP hGlyph; - BYTE isSemiTransp; -} GLYPHIMAGE,*LPGLYPHIMAGE; + char * szFileName; + DWORD dwLoadedTimes; + HBITMAP hGlyph; + BYTE isSemiTransp; +}; -typedef struct tagCURRWNDIMAGEDATA +typedef GLYPHIMAGE *LPGLYPHIMAGE; + +struct CURRWNDIMAGEDATA { - HDC hImageDC; - HDC hBackDC; - HDC hScreenDC; - HBITMAP hImageDIB, hImageOld; - HBITMAP hBackDIB, hBackOld; - BYTE * hImageDIBByte; - BYTE * hBackDIBByte; - int Width,Height; - -}CURRWNDIMAGEDATA; - -typedef struct tagEFFECTSSTACKITEM + HDC hImageDC; + HDC hBackDC; + HDC hScreenDC; + HBITMAP hImageDIB, hImageOld; + HBITMAP hBackDIB, hBackOld; + BYTE * hImageDIBByte; + BYTE * hBackDIBByte; + int Width,Height; +}; + +struct EFFECTSSTACKITEM { - HDC hdc; - BYTE EffectID; - DWORD FirstColor; - DWORD SecondColor; -} EFFECTSSTACKITEM; + HDC hdc; + BYTE EffectID; + DWORD FirstColor; + DWORD SecondColor; +}; #pragma pack(push, 1) /* tga header */ -typedef struct +struct tga_header_t { - BYTE id_lenght; /* size of image id */ - BYTE colormap_type; /* 1 is has a colormap */ - BYTE image_type; /* compression type */ - - short cm_first_entry; /* colormap origin */ - short cm_length; /* colormap length */ - BYTE cm_size; /* colormap size */ + BYTE id_lenght; /* size of image id */ + BYTE colormap_type; /* 1 is has a colormap */ + BYTE image_type; /* compression type */ - short x_origin; /* bottom left x coord origin */ - short y_origin; /* bottom left y coord origin */ + short cm_first_entry; /* colormap origin */ + short cm_length; /* colormap length */ + BYTE cm_size; /* colormap size */ - short width; /* picture width (in pixels) */ - short height; /* picture height (in pixels) */ + short x_origin; /* bottom left x coord origin */ + short y_origin; /* bottom left y coord origin */ - BYTE pixel_depth; /* bits per pixel: 8, 16, 24 or 32 */ - BYTE image_descriptor; /* 24 bits = 0x00; 32 bits = 0x80 */ + short width; /* picture width (in pixels) */ + short height; /* picture height (in pixels) */ -} tga_header_t; + BYTE pixel_depth; /* bits per pixel: 8, 16, 24 or 32 */ + BYTE image_descriptor; /* 24 bits = 0x00; 32 bits = 0x80 */ +}; #pragma pack(pop) - class IniParser { public: @@ -106,7 +105,6 @@ public: static int GetSkinFolder( IN const TCHAR * szFileName, OUT TCHAR * pszFolderName ); private: - // common enum { MAX_LINE_LEN = 512 }; int _eType; diff --git a/plugins/Clist_modern/src/hdr/modern_skinselector.h b/plugins/Clist_modern/src/hdr/modern_skinselector.h index 9509695ad3..b6918b6638 100644 --- a/plugins/Clist_modern/src/hdr/modern_skinselector.h +++ b/plugins/Clist_modern/src/hdr/modern_skinselector.h @@ -35,34 +35,33 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. #define MPF_NOT_EQUAL ( MPF_DIFF|MPF_EQUAL ) #define MPF_HASHED 4 -typedef struct tagMASKPARAM +struct MASKPARAM { - DWORD dwId; - BYTE bMaskParamFlag; - char* szName; - DWORD dwValueHash; - char* szValue; -} MASKPARAM; - - -typedef struct tagMODERNMASK + DWORD dwId; + BYTE bMaskParamFlag; + char* szName; + DWORD dwValueHash; + char* szValue; +}; + +struct MODERNMASK { - MASKPARAM* pl_Params; - DWORD dwParamCnt; - union - { - void* pObject; - char* szObjectName; - }; - DWORD dwMaskId; - BOOL bObjectFound; -} MODERNMASK; - -typedef struct tagLISTMODERNMASK + MASKPARAM* pl_Params; + DWORD dwParamCnt; + union + { + void* pObject; + char* szObjectName; + }; + DWORD dwMaskId; + BOOL bObjectFound; +}; + +struct LISTMODERNMASK { - MODERNMASK* pl_Masks; - DWORD dwMaskCnt; -} LISTMODERNMASK; + MODERNMASK* pl_Masks; + DWORD dwMaskCnt; +}; /// PROTOTYPES int AddModernMaskToList(MODERNMASK * mm, LISTMODERNMASK * mmTemplateList); diff --git a/plugins/Clist_modern/src/hdr/modern_static_clui.h b/plugins/Clist_modern/src/hdr/modern_static_clui.h index 198706d21a..892a126680 100644 --- a/plugins/Clist_modern/src/hdr/modern_static_clui.h +++ b/plugins/Clist_modern/src/hdr/modern_static_clui.h @@ -198,15 +198,13 @@ static PROTOTICKS CycleStartTick[64]={0};//max 64 protocols static int nAnimatedIconStep=100; - - -int CheckFramesPos(RECT *wr); //cluiframes.c +int CheckFramesPos(RECT *wr); //cluiframes.c int CLUIFrames_ApplyNewSizes(int mode); //cluiframes.c -int CLUIFrames_GetTotalHeight(); //cluiframes.c +int CLUIFrames_GetTotalHeight(); //cluiframes.c int CLUIFrames_RepaintSubContainers(); //cluiframes.c int CLUIFramesGetMinHeight(); //cluiframes.c -int SizeFramesByWindowRect(RECT *r, HDWP * PosBatch, int mode); //cluiframes.c +int SizeFramesByWindowRect(RECT *r, HDWP * PosBatch, int mode); //cluiframes.c int InitSkinHotKeys(); BOOL amWakeThread(); @@ -217,27 +215,28 @@ HIMAGELIST hAvatarOverlays=NULL; OVERLAYICONINFO g_pAvatarOverlayIcons[ID_STATUS_OUTTOLUNCH - ID_STATUS_OFFLINE + 1] = { - { "AVATAR_OVERLAY_OFFLINE", LPGEN("Offline"), IDI_AVATAR_OVERLAY_OFFLINE, -1}, - { "AVATAR_OVERLAY_ONLINE", LPGEN("Online"), IDI_AVATAR_OVERLAY_ONLINE, -1}, - { "AVATAR_OVERLAY_AWAY", LPGEN("Away"), IDI_AVATAR_OVERLAY_AWAY, -1}, - { "AVATAR_OVERLAY_DND", LPGEN("DND"), IDI_AVATAR_OVERLAY_DND, -1}, - { "AVATAR_OVERLAY_NA", LPGEN("NA"), IDI_AVATAR_OVERLAY_NA, -1}, - { "AVATAR_OVERLAY_OCCUPIED", LPGEN("Occupied"), IDI_AVATAR_OVERLAY_OCCUPIED, -1}, - { "AVATAR_OVERLAY_CHAT", LPGEN("Free for chat"), IDI_AVATAR_OVERLAY_CHAT, -1}, - { "AVATAR_OVERLAY_INVISIBLE", LPGEN("Invisible"), IDI_AVATAR_OVERLAY_INVISIBLE, -1}, - { "AVATAR_OVERLAY_PHONE", LPGEN("On the phone"), IDI_AVATAR_OVERLAY_PHONE, -1}, - { "AVATAR_OVERLAY_LUNCH", LPGEN("Out to lunch"), IDI_AVATAR_OVERLAY_LUNCH, -1} + { "AVATAR_OVERLAY_OFFLINE", LPGEN("Offline"), IDI_AVATAR_OVERLAY_OFFLINE, -1}, + { "AVATAR_OVERLAY_ONLINE", LPGEN("Online"), IDI_AVATAR_OVERLAY_ONLINE, -1}, + { "AVATAR_OVERLAY_AWAY", LPGEN("Away"), IDI_AVATAR_OVERLAY_AWAY, -1}, + { "AVATAR_OVERLAY_DND", LPGEN("DND"), IDI_AVATAR_OVERLAY_DND, -1}, + { "AVATAR_OVERLAY_NA", LPGEN("NA"), IDI_AVATAR_OVERLAY_NA, -1}, + { "AVATAR_OVERLAY_OCCUPIED", LPGEN("Occupied"), IDI_AVATAR_OVERLAY_OCCUPIED, -1}, + { "AVATAR_OVERLAY_CHAT", LPGEN("Free for chat"), IDI_AVATAR_OVERLAY_CHAT, -1}, + { "AVATAR_OVERLAY_INVISIBLE", LPGEN("Invisible"), IDI_AVATAR_OVERLAY_INVISIBLE, -1}, + { "AVATAR_OVERLAY_PHONE", LPGEN("On the phone"), IDI_AVATAR_OVERLAY_PHONE, -1}, + { "AVATAR_OVERLAY_LUNCH", LPGEN("Out to lunch"), IDI_AVATAR_OVERLAY_LUNCH, -1} }; + OVERLAYICONINFO g_pStatusOverlayIcons[ID_STATUS_OUTTOLUNCH - ID_STATUS_OFFLINE + 1] = { - { "STATUS_OVERLAY_OFFLINE", LPGEN("Offline"), IDI_STATUS_OVERLAY_OFFLINE, -1}, - { "STATUS_OVERLAY_ONLINE", LPGEN("Online"), IDI_STATUS_OVERLAY_ONLINE, -1}, - { "STATUS_OVERLAY_AWAY", LPGEN("Away"), IDI_STATUS_OVERLAY_AWAY, -1}, - { "STATUS_OVERLAY_DND", LPGEN("DND"), IDI_STATUS_OVERLAY_DND, -1}, - { "STATUS_OVERLAY_NA", LPGEN("NA"), IDI_STATUS_OVERLAY_NA, -1}, - { "STATUS_OVERLAY_OCCUPIED", LPGEN("Occupied"), IDI_STATUS_OVERLAY_OCCUPIED, -1}, - { "STATUS_OVERLAY_CHAT", LPGEN("Free for chat"), IDI_STATUS_OVERLAY_CHAT, -1}, - { "STATUS_OVERLAY_INVISIBLE", LPGEN("Invisible"), IDI_STATUS_OVERLAY_INVISIBLE, -1}, - { "STATUS_OVERLAY_PHONE", LPGEN("On the phone"), IDI_STATUS_OVERLAY_PHONE, -1}, - { "STATUS_OVERLAY_LUNCH", LPGEN("Out to lunch"), IDI_STATUS_OVERLAY_LUNCH, -1} + { "STATUS_OVERLAY_OFFLINE", LPGEN("Offline"), IDI_STATUS_OVERLAY_OFFLINE, -1}, + { "STATUS_OVERLAY_ONLINE", LPGEN("Online"), IDI_STATUS_OVERLAY_ONLINE, -1}, + { "STATUS_OVERLAY_AWAY", LPGEN("Away"), IDI_STATUS_OVERLAY_AWAY, -1}, + { "STATUS_OVERLAY_DND", LPGEN("DND"), IDI_STATUS_OVERLAY_DND, -1}, + { "STATUS_OVERLAY_NA", LPGEN("NA"), IDI_STATUS_OVERLAY_NA, -1}, + { "STATUS_OVERLAY_OCCUPIED", LPGEN("Occupied"), IDI_STATUS_OVERLAY_OCCUPIED, -1}, + { "STATUS_OVERLAY_CHAT", LPGEN("Free for chat"), IDI_STATUS_OVERLAY_CHAT, -1}, + { "STATUS_OVERLAY_INVISIBLE", LPGEN("Invisible"), IDI_STATUS_OVERLAY_INVISIBLE, -1}, + { "STATUS_OVERLAY_PHONE", LPGEN("On the phone"), IDI_STATUS_OVERLAY_PHONE, -1}, + { "STATUS_OVERLAY_LUNCH", LPGEN("Out to lunch"), IDI_STATUS_OVERLAY_LUNCH, -1} }; diff --git a/plugins/Clist_modern/src/hdr/modern_static_cluiframes_service.h b/plugins/Clist_modern/src/hdr/modern_static_cluiframes_service.h index 34403ad8cd..46a2dfaed9 100644 --- a/plugins/Clist_modern/src/hdr/modern_static_cluiframes_service.h +++ b/plugins/Clist_modern/src/hdr/modern_static_cluiframes_service.h @@ -28,71 +28,70 @@ static int _us_DoAlignFrameBottom( WPARAM wParam,LPARAM lParam ); static int _us_DoSetFrameFloat( WPARAM wParam,LPARAM lParam ); enum { - CFM_FIRST_MGS= WM_USER + 0x2FF, - - CFM_SETFRAMEPAINTPROC, - CFM_ADDFRAME, - CFM_REMOVEFRAME, - CFM_SETFRAMEOPTIONS, - CFM_GETFRAMEOPTIONS, - CFM_UPDATEFRAME, - CFM_SHOWHIDEFRAMETITLE, - CFM_SHOWTITLES, - CFM_HIDETITLES, - CFM_SHOWHIDEFRAME, - CFM_SHOWALL, - CFM_LOCKFRAME, - CFM_COLLAPSEFRAME, - CFM_SETFRAMEBORDER, - CFM_SETFRAMEALIGN, - CFM_MOVEFRAME, - CFM_MOVEFRAMEUP, - CFM_MOVEFRAMEDOWN, - CFM_ALIGNFRAMETOP, - CFM_ALIGNFRAMEBOTTOM, - CFM_ALIGNFRAMECLIENT, - CFM_SETFRAMEFLOAT, - - CFM_LAST_MSG + CFM_FIRST_MGS= WM_USER + 0x2FF, + + CFM_SETFRAMEPAINTPROC, + CFM_ADDFRAME, + CFM_REMOVEFRAME, + CFM_SETFRAMEOPTIONS, + CFM_GETFRAMEOPTIONS, + CFM_UPDATEFRAME, + CFM_SHOWHIDEFRAMETITLE, + CFM_SHOWTITLES, + CFM_HIDETITLES, + CFM_SHOWHIDEFRAME, + CFM_SHOWALL, + CFM_LOCKFRAME, + CFM_COLLAPSEFRAME, + CFM_SETFRAMEBORDER, + CFM_SETFRAMEALIGN, + CFM_MOVEFRAME, + CFM_MOVEFRAMEUP, + CFM_MOVEFRAMEDOWN, + CFM_ALIGNFRAMETOP, + CFM_ALIGNFRAMEBOTTOM, + CFM_ALIGNFRAMECLIENT, + CFM_SETFRAMEFLOAT, + + CFM_LAST_MSG }; #define CLM_PROCESS( msg, proc ) case msg: result = proc( wParam, lParam); break; BOOL CALLBACK ProcessCLUIFrameInternalMsg(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam, LRESULT& result ) { - if ( msg <= CFM_FIRST_MGS || msg >= CFM_LAST_MSG ) return FALSE; - - switch ( msg ) - { - CLM_PROCESS( CFM_SETFRAMEPAINTPROC, _us_DoSetFramePaintProc ); - CLM_PROCESS( CFM_ADDFRAME, _us_DoAddFrame ); - CLM_PROCESS( CFM_REMOVEFRAME, _us_DoRemoveFrame ); - CLM_PROCESS( CFM_SETFRAMEOPTIONS, _us_DoSetFrameOptions ); - CLM_PROCESS( CFM_GETFRAMEOPTIONS, _us_DoGetFrameOptions ); - CLM_PROCESS( CFM_UPDATEFRAME, _us_DoUpdateFrame ); - CLM_PROCESS( CFM_SHOWHIDEFRAMETITLE, _us_DoShowHideFrameTitle ); - CLM_PROCESS( CFM_SHOWTITLES, _us_DoShowTitles ); - CLM_PROCESS( CFM_HIDETITLES, _us_DoHideTitles ); - CLM_PROCESS( CFM_SHOWHIDEFRAME, _us_DoShowHideFrame ); - CLM_PROCESS( CFM_SHOWALL, _us_DoShowAllFrames ); - CLM_PROCESS( CFM_LOCKFRAME, _us_DoLockFrame ); - CLM_PROCESS( CFM_COLLAPSEFRAME, _us_DoCollapseFrame ); - CLM_PROCESS( CFM_SETFRAMEBORDER, _us_DoSetFrameBorder ); - CLM_PROCESS( CFM_SETFRAMEALIGN, _us_DoSetFrameAlign ); - CLM_PROCESS( CFM_MOVEFRAME, _us_DoMoveFrame ); - CLM_PROCESS( CFM_MOVEFRAMEUP, _us_DoMoveFrameUp ); - CLM_PROCESS( CFM_MOVEFRAMEDOWN, _us_DoMoveFrameDown ); - CLM_PROCESS( CFM_ALIGNFRAMETOP, _us_DoAlignFrameTop ); - CLM_PROCESS( CFM_ALIGNFRAMEBOTTOM, _us_DoAlignFrameClient ); - CLM_PROCESS( CFM_ALIGNFRAMECLIENT, _us_DoAlignFrameBottom ); - CLM_PROCESS( CFM_SETFRAMEFLOAT, _us_DoSetFrameFloat ); - default: - return FALSE; // Not Handled - } - return TRUE; + if ( msg <= CFM_FIRST_MGS || msg >= CFM_LAST_MSG ) + return FALSE; + + switch ( msg ) { + CLM_PROCESS( CFM_SETFRAMEPAINTPROC, _us_DoSetFramePaintProc ); + CLM_PROCESS( CFM_ADDFRAME, _us_DoAddFrame ); + CLM_PROCESS( CFM_REMOVEFRAME, _us_DoRemoveFrame ); + CLM_PROCESS( CFM_SETFRAMEOPTIONS, _us_DoSetFrameOptions ); + CLM_PROCESS( CFM_GETFRAMEOPTIONS, _us_DoGetFrameOptions ); + CLM_PROCESS( CFM_UPDATEFRAME, _us_DoUpdateFrame ); + CLM_PROCESS( CFM_SHOWHIDEFRAMETITLE, _us_DoShowHideFrameTitle ); + CLM_PROCESS( CFM_SHOWTITLES, _us_DoShowTitles ); + CLM_PROCESS( CFM_HIDETITLES, _us_DoHideTitles ); + CLM_PROCESS( CFM_SHOWHIDEFRAME, _us_DoShowHideFrame ); + CLM_PROCESS( CFM_SHOWALL, _us_DoShowAllFrames ); + CLM_PROCESS( CFM_LOCKFRAME, _us_DoLockFrame ); + CLM_PROCESS( CFM_COLLAPSEFRAME, _us_DoCollapseFrame ); + CLM_PROCESS( CFM_SETFRAMEBORDER, _us_DoSetFrameBorder ); + CLM_PROCESS( CFM_SETFRAMEALIGN, _us_DoSetFrameAlign ); + CLM_PROCESS( CFM_MOVEFRAME, _us_DoMoveFrame ); + CLM_PROCESS( CFM_MOVEFRAMEUP, _us_DoMoveFrameUp ); + CLM_PROCESS( CFM_MOVEFRAMEDOWN, _us_DoMoveFrameDown ); + CLM_PROCESS( CFM_ALIGNFRAMETOP, _us_DoAlignFrameTop ); + CLM_PROCESS( CFM_ALIGNFRAMEBOTTOM, _us_DoAlignFrameClient ); + CLM_PROCESS( CFM_ALIGNFRAMECLIENT, _us_DoAlignFrameBottom ); + CLM_PROCESS( CFM_SETFRAMEFLOAT, _us_DoSetFrameFloat ); + default: + return FALSE; // Not Handled + } + return TRUE; } - static INT_PTR CLUIFrames_SetFramePaintProc( WPARAM wParam,LPARAM lParam ) { return ( pcli->hwndContactList ) ? SendMessage( pcli->hwndContactList, CFM_SETFRAMEPAINTPROC, wParam,lParam ) : 0; } @@ -161,32 +160,32 @@ static INT_PTR CLUIFrames_SetFrameFloat( WPARAM wParam,LPARAM lParam ) static void CreateCluiFramesServices() { - CreateServiceFunction( MS_SKINENG_REGISTERPAINTSUB, CLUIFrames_SetFramePaintProc ); - CreateServiceFunction( MS_CLIST_FRAMES_ADDFRAME, CLUIFrames_AddFrame ); - CreateServiceFunction( MS_CLIST_FRAMES_REMOVEFRAME, CLUIFrames_RemoveFrame ); - - CreateServiceFunction( MS_CLIST_FRAMES_SETFRAMEOPTIONS, CLUIFrames_SetFrameOptions ); - CreateServiceFunction( MS_CLIST_FRAMES_GETFRAMEOPTIONS, CLUIFrames_GetFrameOptions ); - CreateServiceFunction( MS_CLIST_FRAMES_UPDATEFRAME, CLUIFrames_UpdateFrame ); - - CreateServiceFunction( MS_CLIST_FRAMES_SHFRAMETITLEBAR, CLUIFrames_ShowHideFrameTitle ); - CreateServiceFunction( MS_CLIST_FRAMES_SHOWALLFRAMESTB, CLUIFrames_ShowTitles ); - CreateServiceFunction( MS_CLIST_FRAMES_HIDEALLFRAMESTB, CLUIFrames_HideTitles ); - CreateServiceFunction( MS_CLIST_FRAMES_SHFRAME, CLUIFrames_ShowHideFrame ); - CreateServiceFunction( MS_CLIST_FRAMES_SHOWALLFRAMES, CLUIFrames_ShowAllFrames ); - - CreateServiceFunction( MS_CLIST_FRAMES_ULFRAME, CLUIFrames_LockFrame ); - CreateServiceFunction( MS_CLIST_FRAMES_UCOLLFRAME, CLUIFrames_CollapseFrame ); - CreateServiceFunction( MS_CLIST_FRAMES_SETUNBORDER, CLUIFrames_SetFrameBorder ); - - CreateServiceFunction( CLUIFRAMESSETALIGN, CLUIFrames_SetFrameAlign ); - CreateServiceFunction( CLUIFRAMESMOVEUPDOWN, CLUIFrames_MoveFrame ); - CreateServiceFunction( CLUIFRAMESMOVEUP, CLUIFrames_MoveFrameUp ); - CreateServiceFunction( CLUIFRAMESMOVEDOWN, CLUIFrames_MoveFrameDown ); - - CreateServiceFunction( CLUIFRAMESSETALIGNALTOP, CLUIFrames_AlignFrameTop ); - CreateServiceFunction( CLUIFRAMESSETALIGNALCLIENT, CLUIFrames_AlignFrameClient ); - CreateServiceFunction( CLUIFRAMESSETALIGNALBOTTOM, CLUIFrames_AlignFrameBottom ); - - CreateServiceFunction( CLUIFRAMESSETFLOATING, CLUIFrames_SetFrameFloat ); -} \ No newline at end of file + CreateServiceFunction( MS_SKINENG_REGISTERPAINTSUB, CLUIFrames_SetFramePaintProc ); + CreateServiceFunction( MS_CLIST_FRAMES_ADDFRAME, CLUIFrames_AddFrame ); + CreateServiceFunction( MS_CLIST_FRAMES_REMOVEFRAME, CLUIFrames_RemoveFrame ); + + CreateServiceFunction( MS_CLIST_FRAMES_SETFRAMEOPTIONS, CLUIFrames_SetFrameOptions ); + CreateServiceFunction( MS_CLIST_FRAMES_GETFRAMEOPTIONS, CLUIFrames_GetFrameOptions ); + CreateServiceFunction( MS_CLIST_FRAMES_UPDATEFRAME, CLUIFrames_UpdateFrame ); + + CreateServiceFunction( MS_CLIST_FRAMES_SHFRAMETITLEBAR, CLUIFrames_ShowHideFrameTitle ); + CreateServiceFunction( MS_CLIST_FRAMES_SHOWALLFRAMESTB, CLUIFrames_ShowTitles ); + CreateServiceFunction( MS_CLIST_FRAMES_HIDEALLFRAMESTB, CLUIFrames_HideTitles ); + CreateServiceFunction( MS_CLIST_FRAMES_SHFRAME, CLUIFrames_ShowHideFrame ); + CreateServiceFunction( MS_CLIST_FRAMES_SHOWALLFRAMES, CLUIFrames_ShowAllFrames ); + + CreateServiceFunction( MS_CLIST_FRAMES_ULFRAME, CLUIFrames_LockFrame ); + CreateServiceFunction( MS_CLIST_FRAMES_UCOLLFRAME, CLUIFrames_CollapseFrame ); + CreateServiceFunction( MS_CLIST_FRAMES_SETUNBORDER, CLUIFrames_SetFrameBorder ); + + CreateServiceFunction( CLUIFRAMESSETALIGN, CLUIFrames_SetFrameAlign ); + CreateServiceFunction( CLUIFRAMESMOVEUPDOWN, CLUIFrames_MoveFrame ); + CreateServiceFunction( CLUIFRAMESMOVEUP, CLUIFrames_MoveFrameUp ); + CreateServiceFunction( CLUIFRAMESMOVEDOWN, CLUIFrames_MoveFrameDown ); + + CreateServiceFunction( CLUIFRAMESSETALIGNALTOP, CLUIFrames_AlignFrameTop ); + CreateServiceFunction( CLUIFRAMESSETALIGNALCLIENT, CLUIFrames_AlignFrameClient ); + CreateServiceFunction( CLUIFRAMESSETALIGNALBOTTOM, CLUIFrames_AlignFrameBottom ); + + CreateServiceFunction( CLUIFRAMESSETFLOATING, CLUIFrames_SetFrameFloat ); +} diff --git a/plugins/Clist_modern/src/modern_aniavatars.cpp b/plugins/Clist_modern/src/modern_aniavatars.cpp index 1f97082d4b..b626671b03 100644 --- a/plugins/Clist_modern/src/modern_aniavatars.cpp +++ b/plugins/Clist_modern/src/modern_aniavatars.cpp @@ -705,8 +705,7 @@ static int _AniAva_LoadAvatarFromImage(TCHAR * szFileName, int width, int height SelectObject(hTempDC,hOldBitmap); DeleteObject(hNewBmp); DeleteDC(hTempDC); - DeleteObject(hBitmap); - + DeleteObject(hBitmap); //delete old _AniAva_RemoveAniAvaDC(&AniAva); diff --git a/plugins/Clist_modern/src/modern_cachefuncs.cpp b/plugins/Clist_modern/src/modern_cachefuncs.cpp index bb6b5b6c5d..40c62b2d2d 100644 --- a/plugins/Clist_modern/src/modern_cachefuncs.cpp +++ b/plugins/Clist_modern/src/modern_cachefuncs.cpp @@ -415,9 +415,10 @@ int GetStatusMessage(TCHAR *text, int text_size, PDNCE pdnce, BOOL xstatus_has_ /* * Get the text for specified lines */ -int Cache_GetLineText(PDNCE pdnce, int type, LPTSTR text, int text_size, TCHAR *variable_text, BOOL xstatus_has_priority, - BOOL show_status_if_no_away, BOOL show_listening_if_no_away, BOOL use_name_and_message_for_xstatus, - BOOL pdnce_time_show_only_if_different) +int Cache_GetLineText( + PDNCE pdnce, int type, LPTSTR text, int text_size, TCHAR *variable_text, BOOL xstatus_has_priority, + BOOL show_status_if_no_away, BOOL show_listening_if_no_away, BOOL use_name_and_message_for_xstatus, + BOOL pdnce_time_show_only_if_different) { text[0] = '\0'; switch(type) { diff --git a/plugins/Clist_modern/src/modern_clcidents.cpp b/plugins/Clist_modern/src/modern_clcidents.cpp index dc030e2e7c..0117b2831a 100644 --- a/plugins/Clist_modern/src/modern_clcidents.cpp +++ b/plugins/Clist_modern/src/modern_clcidents.cpp @@ -48,9 +48,9 @@ exclusively externally int GetContactIndex(ClcGroup *group,ClcContact *contact) { - for (int i=0; i < group->cl.count; i++) - if (group->cl.items[i]->hContact == contact->hContact) return i; - return -1; + for (int i=0; i < group->cl.count; i++) + if (group->cl.items[i]->hContact == contact->hContact) return i; + return -1; } int cliGetRowsPriorTo(ClcGroup *group,ClcGroup *subgroup,int contactIndex) diff --git a/plugins/Clist_modern/src/modern_clcmsgs.cpp b/plugins/Clist_modern/src/modern_clcmsgs.cpp index d5845db2e8..0750060243 100644 --- a/plugins/Clist_modern/src/modern_clcmsgs.cpp +++ b/plugins/Clist_modern/src/modern_clcmsgs.cpp @@ -187,13 +187,11 @@ LRESULT cli_ProcessExternalMessages(HWND hwnd,struct ClcData *dat,UINT msg,WPARA for (tgroup = group; tgroup; tgroup = tgroup->parent) pcli->pfnSetGroupExpand(hwnd, dat, tgroup, 1); - if ( !contact->isSubcontact) - { + if ( !contact->isSubcontact) { index = List_IndexOf((SortedList*)&group->cl,contact); mainindex = index; } - else - { + else { index = List_IndexOf((SortedList*)&group->cl,contact->subcontacts); mainindex = index; index += contact->isSubcontact; diff --git a/plugins/Clist_modern/src/modern_clistevents.cpp b/plugins/Clist_modern/src/modern_clistevents.cpp index 6f07c154c1..55942cb862 100644 --- a/plugins/Clist_modern/src/modern_clistevents.cpp +++ b/plugins/Clist_modern/src/modern_clistevents.cpp @@ -178,13 +178,13 @@ struct CListEvent* cli_AddEvent(CLISTEVENT *cle) int cli_RemoveEvent(HANDLE hContact, HANDLE hDbEvent) { int i; - int res = 0; + int res = 0; // Find the event that should be removed for (i=0; i < pcli->events.count; i++) - { + { if ((pcli->events.items[i]->cle.hContact == hContact) && (pcli->events.items[i]->cle.hDbEvent == hDbEvent)) - { + { break; } } @@ -194,36 +194,29 @@ int cli_RemoveEvent(HANDLE hContact, HANDLE hDbEvent) return 1; // remove event from the notify menu - if (1) - { - if (pcli->events.items[i]->menuId > 0) - { - MENUITEMINFO mii = {0}; - mii.cbSize = sizeof(mii); - mii.fMask = MIIM_DATA; - if (GetMenuItemInfo(g_CluiData.hMenuNotify, pcli->events.items[i]->menuId, FALSE, &mii) != 0) - { - struct NotifyMenuItemExData *nmi = (struct NotifyMenuItemExData *) mii.dwItemData; - if (nmi && nmi->hContact == hContact && nmi->hDbEvent == hDbEvent) - { - free(nmi); - DeleteMenu(g_CluiData.hMenuNotify, pcli->events.items[i]->menuId, MF_BYCOMMAND); - } - } - } - } + if (pcli->events.items[i]->menuId > 0) { + MENUITEMINFO mii = {0}; + mii.cbSize = sizeof(mii); + mii.fMask = MIIM_DATA; + if (GetMenuItemInfo(g_CluiData.hMenuNotify, pcli->events.items[i]->menuId, FALSE, &mii) != 0) { + struct NotifyMenuItemExData *nmi = (struct NotifyMenuItemExData *) mii.dwItemData; + if (nmi && nmi->hContact == hContact && nmi->hDbEvent == hDbEvent) { + free(nmi); + DeleteMenu(g_CluiData.hMenuNotify, pcli->events.items[i]->menuId, MF_BYCOMMAND); + } + } + } res = corecli.pfnRemoveEvent(hContact, hDbEvent); - if (pcli->events.count == 0) - { + if (pcli->events.count == 0) { g_CluiData.bNotifyActive = FALSE; EventArea_HideShowNotifyFrame(); - } + } if (hContact == g_CluiData.hUpdateContact || (INT_PTR)hDbEvent == 1) g_CluiData.hUpdateContact = 0; - CLUI__cliInvalidateRect(g_CluiData.hwndEventFrame, NULL, FALSE); + CLUI__cliInvalidateRect(g_CluiData.hwndEventFrame, NULL, FALSE); return res; } @@ -300,15 +293,15 @@ static int ehhEventAreaBackgroundSettingsChanged(WPARAM wParam, LPARAM lParam) void EventArea_ConfigureEventArea() { int iCount = pcli->events.count; - - g_CluiData.dwFlags &= ~(CLUI_FRAME_AUTOHIDENOTIFY|CLUI_FRAME_SHOWALWAYS); - if (db_get_b(NULL,"CLUI","EventArea",SETTING_EVENTAREAMODE_DEFAULT) == 1) g_CluiData.dwFlags |= CLUI_FRAME_AUTOHIDENOTIFY; - if (db_get_b(NULL,"CLUI","EventArea",SETTING_EVENTAREAMODE_DEFAULT) == 2) g_CluiData.dwFlags |= CLUI_FRAME_SHOWALWAYS; + + g_CluiData.dwFlags &= ~(CLUI_FRAME_AUTOHIDENOTIFY|CLUI_FRAME_SHOWALWAYS); + if (db_get_b(NULL,"CLUI","EventArea",SETTING_EVENTAREAMODE_DEFAULT) == 1) g_CluiData.dwFlags |= CLUI_FRAME_AUTOHIDENOTIFY; + if (db_get_b(NULL,"CLUI","EventArea",SETTING_EVENTAREAMODE_DEFAULT) == 2) g_CluiData.dwFlags |= CLUI_FRAME_SHOWALWAYS; if (g_CluiData.dwFlags & CLUI_FRAME_SHOWALWAYS) g_CluiData.bNotifyActive = 1; - else if (g_CluiData.dwFlags & CLUI_FRAME_AUTOHIDENOTIFY) - g_CluiData.bNotifyActive = iCount > 0 ? 1 : 0; + else if (g_CluiData.dwFlags & CLUI_FRAME_AUTOHIDENOTIFY) + g_CluiData.bNotifyActive = iCount > 0 ? 1 : 0; else g_CluiData.bNotifyActive = 0; @@ -318,153 +311,139 @@ void EventArea_ConfigureEventArea() static int EventArea_PaintCallbackProc(HWND hWnd, HDC hDC, RECT * rcPaint, HRGN rgn, DWORD dFlags, void * CallBackData) { - return EventArea_Draw(hWnd,hDC); + return EventArea_Draw(hWnd,hDC); } static int EventArea_Draw(HWND hwnd, HDC hDC) { - if (hwnd == (HWND)-1) return 0; - if (GetParent(hwnd) == pcli->hwndContactList) - return EventArea_DrawWorker(hwnd,hDC); - else - CLUI__cliInvalidateRect(hwnd,NULL,FALSE); - return 0; + if (hwnd == (HWND)-1) return 0; + if (GetParent(hwnd) == pcli->hwndContactList) + return EventArea_DrawWorker(hwnd,hDC); + + CLUI__cliInvalidateRect(hwnd,NULL,FALSE); + return 0; } static int EventArea_DrawWorker(HWND hWnd, HDC hDC) { - RECT rc; - HFONT hOldFont; - GetClientRect(hWnd,&rc); + RECT rc; + HFONT hOldFont; + GetClientRect(hWnd,&rc); if ( g_CluiData.fDisableSkinEngine ) - { sttDrawEventAreaBackground( hWnd, hDC, &rc ); - } else - { SkinDrawGlyph(hDC,&rc,&rc,"Main,ID=EventArea"); - } - hOldFont = g_clcPainter.ChangeToFont(hDC,NULL,FONTID_EVENTAREA,NULL); + + hOldFont = g_clcPainter.ChangeToFont(hDC,NULL,FONTID_EVENTAREA,NULL); SetBkMode(hDC,TRANSPARENT); - //ske_DrawText(hDC,_T("DEBUG"),lstrlen(_T("DEBUG")),&rc,0); - { - int iCount = GetMenuItemCount(g_CluiData.hMenuNotify); - rc.left += 26; - if (g_CluiData.hUpdateContact != 0) - { - TCHAR *szName = pcli->pfnGetContactDisplayName(g_CluiData.hUpdateContact, 0); - int iIcon = CallService(MS_CLIST_GETCONTACTICON, (WPARAM) g_CluiData.hUpdateContact, 0); - - ske_ImageList_DrawEx(g_himlCListClc, iIcon, hDC, rc.left, (rc.bottom + rc.top - GetSystemMetrics(SM_CYSMICON)) / 2, GetSystemMetrics(SM_CXSMICON), GetSystemMetrics(SM_CYSMICON), CLR_NONE, CLR_NONE, ILD_NORMAL); - rc.left += 18; - ske_DrawText(hDC, szName, -1, &rc, DT_VCENTER | DT_SINGLELINE); - ske_ImageList_DrawEx(g_himlCListClc, (int)g_CluiData.iIconNotify, hDC, 4, (rc.bottom + rc.top - 16) / 2, 16, 16, CLR_NONE, CLR_NONE, ILD_NORMAL); - } - else if (iCount > 0) - { - MENUITEMINFO mii = {0}; - struct NotifyMenuItemExData *nmi; - TCHAR *szName; - int iIcon; - - mii.cbSize = sizeof(mii); - mii.fMask = MIIM_DATA; - GetMenuItemInfo(g_CluiData.hMenuNotify, iCount - 1, TRUE, &mii); - nmi = (struct NotifyMenuItemExData *) mii.dwItemData; - szName = pcli->pfnGetContactDisplayName(nmi->hContact, 0); - iIcon = CallService(MS_CLIST_GETCONTACTICON, (WPARAM) nmi->hContact, 0); - ske_ImageList_DrawEx(g_himlCListClc, iIcon, hDC, rc.left, (rc.bottom + rc.top - GetSystemMetrics(SM_CYSMICON)) / 2, GetSystemMetrics(SM_CXSMICON), GetSystemMetrics(SM_CYSMICON), CLR_NONE, CLR_NONE, ILD_NORMAL); - rc.left += 18; - ske_ImageList_DrawEx(g_himlCListClc, nmi->iIcon, hDC, 4, (rc.bottom + rc.top) / 2 - 8, 16, 16, CLR_NONE, CLR_NONE, ILD_NORMAL); - ske_DrawText(hDC, szName, -1, &rc, DT_VCENTER | DT_SINGLELINE); - } - else - { - HICON hIcon = (HICON)LoadImage(GetModuleHandle(NULL), MAKEINTRESOURCE(IDI_BLANK), IMAGE_ICON, 16, 16, 0); - ske_DrawText(hDC, g_CluiData.szNoEvents, lstrlen(g_CluiData.szNoEvents), &rc, DT_VCENTER | DT_SINGLELINE); - ske_DrawIconEx(hDC, 4, (rc.bottom + rc.top - 16) / 2, hIcon, 16, 16, 0, 0, DI_NORMAL | DI_COMPAT); - DestroyIcon(hIcon); - } - } + + int iCount = GetMenuItemCount(g_CluiData.hMenuNotify); + rc.left += 26; + if (g_CluiData.hUpdateContact != 0) { + TCHAR *szName = pcli->pfnGetContactDisplayName(g_CluiData.hUpdateContact, 0); + int iIcon = CallService(MS_CLIST_GETCONTACTICON, (WPARAM) g_CluiData.hUpdateContact, 0); + + ske_ImageList_DrawEx(g_himlCListClc, iIcon, hDC, rc.left, (rc.bottom + rc.top - GetSystemMetrics(SM_CYSMICON)) / 2, GetSystemMetrics(SM_CXSMICON), GetSystemMetrics(SM_CYSMICON), CLR_NONE, CLR_NONE, ILD_NORMAL); + rc.left += 18; + ske_DrawText(hDC, szName, -1, &rc, DT_VCENTER | DT_SINGLELINE); + ske_ImageList_DrawEx(g_himlCListClc, (int)g_CluiData.iIconNotify, hDC, 4, (rc.bottom + rc.top - 16) / 2, 16, 16, CLR_NONE, CLR_NONE, ILD_NORMAL); + } + else if (iCount > 0) { + MENUITEMINFO mii = {0}; + struct NotifyMenuItemExData *nmi; + TCHAR *szName; + int iIcon; + + mii.cbSize = sizeof(mii); + mii.fMask = MIIM_DATA; + GetMenuItemInfo(g_CluiData.hMenuNotify, iCount - 1, TRUE, &mii); + nmi = (struct NotifyMenuItemExData *) mii.dwItemData; + szName = pcli->pfnGetContactDisplayName(nmi->hContact, 0); + iIcon = CallService(MS_CLIST_GETCONTACTICON, (WPARAM) nmi->hContact, 0); + ske_ImageList_DrawEx(g_himlCListClc, iIcon, hDC, rc.left, (rc.bottom + rc.top - GetSystemMetrics(SM_CYSMICON)) / 2, GetSystemMetrics(SM_CXSMICON), GetSystemMetrics(SM_CYSMICON), CLR_NONE, CLR_NONE, ILD_NORMAL); + rc.left += 18; + ske_ImageList_DrawEx(g_himlCListClc, nmi->iIcon, hDC, 4, (rc.bottom + rc.top) / 2 - 8, 16, 16, CLR_NONE, CLR_NONE, ILD_NORMAL); + ske_DrawText(hDC, szName, -1, &rc, DT_VCENTER | DT_SINGLELINE); + } + else { + HICON hIcon = (HICON)LoadImage(GetModuleHandle(NULL), MAKEINTRESOURCE(IDI_BLANK), IMAGE_ICON, 16, 16, 0); + ske_DrawText(hDC, g_CluiData.szNoEvents, lstrlen(g_CluiData.szNoEvents), &rc, DT_VCENTER | DT_SINGLELINE); + ske_DrawIconEx(hDC, 4, (rc.bottom + rc.top - 16) / 2, hIcon, 16, 16, 0, 0, DI_NORMAL | DI_COMPAT); + DestroyIcon(hIcon); + } + ske_ResetTextEffect(hDC); - SelectObject(hDC,hOldFont); - return 0; + SelectObject(hDC,hOldFont); + return 0; } static void EventArea_HideShowNotifyFrame() { - int dwVisible = CallService(MS_CLIST_FRAMES_GETFRAMEOPTIONS, MAKEWPARAM(FO_FLAGS, hNotifyFrame), 0) & F_VISIBLE; - int desired; - - if (g_CluiData.dwFlags & CLUI_FRAME_SHOWALWAYS) - desired = TRUE; - else if (g_CluiData.dwFlags & CLUI_FRAME_AUTOHIDENOTIFY) - desired = g_CluiData.bNotifyActive ? TRUE : FALSE; - else - desired = FALSE; - - if (desired) - { + int dwVisible = CallService(MS_CLIST_FRAMES_GETFRAMEOPTIONS, MAKEWPARAM(FO_FLAGS, hNotifyFrame), 0) & F_VISIBLE; + int desired; + + if (g_CluiData.dwFlags & CLUI_FRAME_SHOWALWAYS) + desired = TRUE; + else if (g_CluiData.dwFlags & CLUI_FRAME_AUTOHIDENOTIFY) + desired = g_CluiData.bNotifyActive ? TRUE : FALSE; + else + desired = FALSE; + + if (desired) { if ( !dwVisible) CallService(MS_CLIST_FRAMES_SHFRAME, (WPARAM)hNotifyFrame, 0); } - else - { + else { if (dwVisible) CallService(MS_CLIST_FRAMES_SHFRAME, (WPARAM)hNotifyFrame, 0); } } - int EventArea_Create(HWND hCluiWnd) { - CallService(MS_BACKGROUNDCONFIG_REGISTER,(WPARAM)"Event Area Background/EventArea",0); - HookEvent(ME_BACKGROUNDCONFIG_CHANGED,ehhEventAreaBackgroundSettingsChanged); - ehhEventAreaBackgroundSettingsChanged(0,0); - - WNDCLASS wndclass = {0}; - TCHAR pluginname[] = _T("EventArea"); - int h = GetSystemMetrics(SM_CYSMICON)+2; - if (GetClassInfo(g_hInst,pluginname,&wndclass) == 0) - { - wndclass.style = 0; - wndclass.lpfnWndProc = EventArea_WndProc; - wndclass.cbClsExtra = 0; - wndclass.cbWndExtra = 0; - wndclass.hInstance = g_hInst; - wndclass.hIcon = NULL; - wndclass.hCursor = LoadCursor (NULL, IDC_ARROW); - wndclass.hbrBackground = GetSysColorBrush(COLOR_3DFACE); - wndclass.lpszMenuName = NULL; - wndclass.lpszClassName = pluginname; - RegisterClass(&wndclass); - } - g_CluiData.hwndEventFrame = CreateWindow(pluginname,pluginname,WS_CHILD|WS_VISIBLE|WS_CLIPCHILDREN, - 0,0,0,h,hCluiWnd,NULL,g_hInst,NULL); - // register frame - - { - CLISTFrame Frame; - memset(&Frame,0,sizeof(Frame)); - Frame.cbSize = sizeof(CLISTFrame); - Frame.hWnd = g_CluiData.hwndEventFrame; - Frame.align = alBottom; - Frame.hIcon = LoadSkinnedIcon(SKINICON_OTHER_MIRANDA); - Frame.Flags = (db_get_b(NULL,"CLUI","ShowEventArea",SETTING_SHOWEVENTAREAFRAME_DEFAULT)?F_VISIBLE:0)|F_LOCKED|F_NOBORDER|F_NO_SUBCONTAINER|F_TCHAR; - Frame.height = h; - Frame.tname = _T("EventArea"); //do not translate - Frame.TBtname = TranslateT("Event Area"); - hNotifyFrame = (HANDLE)CallService(MS_CLIST_FRAMES_ADDFRAME,(WPARAM)&Frame,0); - CallService(MS_SKINENG_REGISTERPAINTSUB,(WPARAM)Frame.hWnd,(LPARAM)EventArea_PaintCallbackProc); //$$$$$ register sub for frame - CallService(MS_CLIST_FRAMES_UPDATEFRAME,-1,0); - EventArea_HideShowNotifyFrame(); - } - g_CluiData.szNoEvents = TranslateT("No Events"); - g_CluiData.hMenuNotify = CreatePopupMenu(); - g_CluiData.wNextMenuID = 1; - EventArea_ConfigureEventArea(); - return 0; + CallService(MS_BACKGROUNDCONFIG_REGISTER,(WPARAM)"Event Area Background/EventArea",0); + HookEvent(ME_BACKGROUNDCONFIG_CHANGED,ehhEventAreaBackgroundSettingsChanged); + ehhEventAreaBackgroundSettingsChanged(0,0); + + WNDCLASS wndclass = {0}; + TCHAR pluginname[] = _T("EventArea"); + int h = GetSystemMetrics(SM_CYSMICON)+2; + if (GetClassInfo(g_hInst,pluginname,&wndclass) == 0) { + wndclass.style = 0; + wndclass.lpfnWndProc = EventArea_WndProc; + wndclass.cbClsExtra = 0; + wndclass.cbWndExtra = 0; + wndclass.hInstance = g_hInst; + wndclass.hIcon = NULL; + wndclass.hCursor = LoadCursor (NULL, IDC_ARROW); + wndclass.hbrBackground = GetSysColorBrush(COLOR_3DFACE); + wndclass.lpszMenuName = NULL; + wndclass.lpszClassName = pluginname; + RegisterClass(&wndclass); + } + g_CluiData.hwndEventFrame = CreateWindow(pluginname,pluginname,WS_CHILD|WS_VISIBLE|WS_CLIPCHILDREN, + 0,0,0,h,hCluiWnd,NULL,g_hInst,NULL); + + // register frame + CLISTFrame Frame = { sizeof(CLISTFrame) }; + Frame.hWnd = g_CluiData.hwndEventFrame; + Frame.align = alBottom; + Frame.hIcon = LoadSkinnedIcon(SKINICON_OTHER_MIRANDA); + Frame.Flags = (db_get_b(NULL,"CLUI","ShowEventArea",SETTING_SHOWEVENTAREAFRAME_DEFAULT)?F_VISIBLE:0)|F_LOCKED|F_NOBORDER|F_NO_SUBCONTAINER|F_TCHAR; + Frame.height = h; + Frame.tname = _T("EventArea"); //do not translate + Frame.TBtname = TranslateT("Event Area"); + hNotifyFrame = (HANDLE)CallService(MS_CLIST_FRAMES_ADDFRAME,(WPARAM)&Frame,0); + CallService(MS_SKINENG_REGISTERPAINTSUB,(WPARAM)Frame.hWnd,(LPARAM)EventArea_PaintCallbackProc); //$$$$$ register sub for frame + CallService(MS_CLIST_FRAMES_UPDATEFRAME,-1,0); + EventArea_HideShowNotifyFrame(); + + g_CluiData.szNoEvents = TranslateT("No Events"); + g_CluiData.hMenuNotify = CreatePopupMenu(); + g_CluiData.wNextMenuID = 1; + EventArea_ConfigureEventArea(); + return 0; } int EventArea_UnloadModule() @@ -478,8 +457,7 @@ int EventArea_UnloadModule() #define IDC_NOTIFYBUTTON 1900 static LRESULT CALLBACK EventArea_WndProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam) { - switch(msg) - { + switch(msg) { case WM_MEASUREITEM: { MEASUREITEMSTRUCT *lpi = (LPMEASUREITEMSTRUCT) lParam; @@ -488,45 +466,41 @@ static LRESULT CALLBACK EventArea_WndProc(HWND hwnd, UINT msg, WPARAM wParam, LP mii.cbSize = sizeof(mii); mii.fMask = MIIM_DATA | MIIM_ID; if (GetMenuItemInfoA(g_CluiData.hMenuNotify, lpi->itemID, FALSE, &mii) != 0) { - if (mii.dwItemData == lpi->itemData) - { + if (mii.dwItemData == lpi->itemData) { lpi->itemWidth = 8 + 16; lpi->itemHeight = 0; return TRUE; } } - break; } - case WM_DRAWITEM: + break; + + case WM_DRAWITEM: { LPDRAWITEMSTRUCT dis = (LPDRAWITEMSTRUCT) lParam; - if (dis->hwndItem == (HWND) g_CluiData.hMenuNotify) - { - MENUITEMINFOA mii = {0}; - - struct NotifyMenuItemExData *nmi = 0; - int iIcon; + if (dis->hwndItem == (HWND) g_CluiData.hMenuNotify) { + NotifyMenuItemExData *nmi = 0; + MENUITEMINFOA mii = {0}; mii.cbSize = sizeof(mii); mii.fMask = MIIM_DATA; - if (GetMenuItemInfoA(g_CluiData.hMenuNotify, (UINT) dis->itemID, FALSE, &mii) != 0) - { - nmi = (struct NotifyMenuItemExData *) mii.dwItemData; - if (nmi) - { - iIcon = CallService(MS_CLIST_GETCONTACTICON, (WPARAM) nmi->hContact, 0); - ske_ImageList_DrawEx(g_himlCListClc, nmi->iIcon, dis->hDC, 2, (dis->rcItem.bottom + dis->rcItem.top - GetSystemMetrics(SM_CYSMICON)) / 2, GetSystemMetrics(SM_CXSMICON), GetSystemMetrics(SM_CYSMICON), CLR_NONE, CLR_NONE, ILD_NORMAL); - ske_ImageList_DrawEx(g_himlCListClc, iIcon, dis->hDC, 2+GetSystemMetrics(SM_CXSMICON)+2, (dis->rcItem.bottom + dis->rcItem.top - GetSystemMetrics(SM_CYSMICON)) / 2, GetSystemMetrics(SM_CXSMICON), GetSystemMetrics(SM_CYSMICON), CLR_NONE, CLR_NONE, ILD_NORMAL); + if (GetMenuItemInfoA(g_CluiData.hMenuNotify, (UINT) dis->itemID, FALSE, &mii) != 0) { + nmi = (NotifyMenuItemExData *) mii.dwItemData; + if (nmi) { + int iIcon = CallService(MS_CLIST_GETCONTACTICON, (WPARAM) nmi->hContact, 0); + ske_ImageList_DrawEx(g_himlCListClc, nmi->iIcon, dis->hDC, 2, (dis->rcItem.bottom + dis->rcItem.top - GetSystemMetrics(SM_CYSMICON)) / 2, GetSystemMetrics(SM_CXSMICON), GetSystemMetrics(SM_CYSMICON), CLR_NONE, CLR_NONE, ILD_NORMAL); + ske_ImageList_DrawEx(g_himlCListClc, iIcon, dis->hDC, 2+GetSystemMetrics(SM_CXSMICON)+2, (dis->rcItem.bottom + dis->rcItem.top - GetSystemMetrics(SM_CYSMICON)) / 2, GetSystemMetrics(SM_CXSMICON), GetSystemMetrics(SM_CYSMICON), CLR_NONE, CLR_NONE, ILD_NORMAL); return TRUE; } } } break; } - case WM_LBUTTONUP: + case WM_LBUTTONUP: if (g_CluiData.bEventAreaEnabled) SendMessage(hwnd, WM_COMMAND, MAKEWPARAM(IDC_NOTIFYBUTTON, 0), 0); break; + case WM_COMMAND: if (LOWORD(wParam) == IDC_NOTIFYBUTTON) { int iSelection; @@ -562,63 +536,64 @@ static LRESULT CALLBACK EventArea_WndProc(HWND hwnd, UINT msg, WPARAM wParam, LP break; } break; - case WM_SIZE: - if ( !g_CluiData.fLayered)InvalidateRect(hwnd,NULL,FALSE); - return DefWindowProc(hwnd, msg, wParam, lParam); - case WM_ERASEBKGND: - return 1; - case WM_PAINT: - { - if (GetParent(hwnd) == pcli->hwndContactList && g_CluiData.fLayered) - CallService(MS_SKINENG_INVALIDATEFRAMEIMAGE,(WPARAM)hwnd,0); - else if (GetParent(hwnd) == pcli->hwndContactList && !g_CluiData.fLayered) - { - HDC hdc, hdc2; - HBITMAP hbmp,hbmpo; - RECT rc = {0}; - GetClientRect(hwnd,&rc); - rc.right++; - rc.bottom++; - hdc = GetDC(hwnd); - hdc2 = CreateCompatibleDC(hdc); - hbmp = ske_CreateDIB32(rc.right,rc.bottom); - hbmpo = (HBITMAP)SelectObject(hdc2,hbmp); - ske_BltBackImage(hwnd,hdc2,&rc); - EventArea_DrawWorker(hwnd,hdc2); - BitBlt(hdc,rc.left,rc.top,rc.right-rc.left,rc.bottom-rc.top, - hdc2,rc.left,rc.top,SRCCOPY); - SelectObject(hdc2,hbmpo); - DeleteObject(hbmp); - mod_DeleteDC(hdc2); - SelectObject(hdc,GetStockObject(DEFAULT_GUI_FONT)); - ReleaseDC(hwnd,hdc); - ValidateRect(hwnd,NULL); - } - else - { - HDC hdc, hdc2; - HBITMAP hbmp, hbmpo; - RECT rc; - PAINTSTRUCT ps; - HBRUSH br = GetSysColorBrush(COLOR_3DFACE); - GetClientRect(hwnd,&rc); - hdc = BeginPaint(hwnd,&ps); - hdc2 = CreateCompatibleDC(hdc); - hbmp = ske_CreateDIB32(rc.right,rc.bottom); - hbmpo = (HBITMAP)SelectObject(hdc2,hbmp); - FillRect(hdc2,&ps.rcPaint,br); - EventArea_DrawWorker(hwnd,hdc2); - BitBlt(hdc,ps.rcPaint.left,ps.rcPaint.top,ps.rcPaint.right-ps.rcPaint.left,ps.rcPaint.bottom-ps.rcPaint.top, - hdc2,ps.rcPaint.left,ps.rcPaint.top,SRCCOPY); - SelectObject(hdc2,hbmpo); - DeleteObject(hbmp); - mod_DeleteDC(hdc2); - ps.fErase = FALSE; - EndPaint(hwnd,&ps); - } - } - default: - return DefWindowProc(hwnd, msg, wParam, lParam); - } - return TRUE; + + case WM_SIZE: + if ( !g_CluiData.fLayered) + InvalidateRect(hwnd,NULL,FALSE); + return DefWindowProc(hwnd, msg, wParam, lParam); + + case WM_ERASEBKGND: + return 1; + + case WM_PAINT: + if (GetParent(hwnd) == pcli->hwndContactList && g_CluiData.fLayered) + CallService(MS_SKINENG_INVALIDATEFRAMEIMAGE,(WPARAM)hwnd,0); + else if (GetParent(hwnd) == pcli->hwndContactList && !g_CluiData.fLayered) { + HDC hdc, hdc2; + HBITMAP hbmp,hbmpo; + RECT rc = {0}; + GetClientRect(hwnd,&rc); + rc.right++; + rc.bottom++; + hdc = GetDC(hwnd); + hdc2 = CreateCompatibleDC(hdc); + hbmp = ske_CreateDIB32(rc.right,rc.bottom); + hbmpo = (HBITMAP)SelectObject(hdc2,hbmp); + ske_BltBackImage(hwnd,hdc2,&rc); + EventArea_DrawWorker(hwnd,hdc2); + BitBlt(hdc,rc.left,rc.top,rc.right-rc.left,rc.bottom-rc.top, + hdc2,rc.left,rc.top,SRCCOPY); + SelectObject(hdc2,hbmpo); + DeleteObject(hbmp); + mod_DeleteDC(hdc2); + SelectObject(hdc,GetStockObject(DEFAULT_GUI_FONT)); + ReleaseDC(hwnd,hdc); + ValidateRect(hwnd,NULL); + } + else { + HDC hdc, hdc2; + HBITMAP hbmp, hbmpo; + RECT rc; + PAINTSTRUCT ps; + HBRUSH br = GetSysColorBrush(COLOR_3DFACE); + GetClientRect(hwnd,&rc); + hdc = BeginPaint(hwnd,&ps); + hdc2 = CreateCompatibleDC(hdc); + hbmp = ske_CreateDIB32(rc.right,rc.bottom); + hbmpo = (HBITMAP)SelectObject(hdc2,hbmp); + FillRect(hdc2,&ps.rcPaint,br); + EventArea_DrawWorker(hwnd,hdc2); + BitBlt(hdc,ps.rcPaint.left,ps.rcPaint.top,ps.rcPaint.right-ps.rcPaint.left,ps.rcPaint.bottom-ps.rcPaint.top, + hdc2,ps.rcPaint.left,ps.rcPaint.top,SRCCOPY); + SelectObject(hdc2,hbmpo); + DeleteObject(hbmp); + mod_DeleteDC(hdc2); + ps.fErase = FALSE; + EndPaint(hwnd,&ps); + } + + default: + return DefWindowProc(hwnd, msg, wParam, lParam); + } + return TRUE; } diff --git a/plugins/Clist_modern/src/modern_clistmod.cpp b/plugins/Clist_modern/src/modern_clistmod.cpp index dfd87f3dc2..3598024215 100644 --- a/plugins/Clist_modern/src/modern_clistmod.cpp +++ b/plugins/Clist_modern/src/modern_clistmod.cpp @@ -296,12 +296,7 @@ int GetWindowVisibleState(HWND hWnd, int iStepX, int iStepY) RECT rc = { 0 }; POINT pt = { 0 }; - register int i=0, - j = 0, - width = 0, - height = 0, - iCountedDots = 0, - iNotCoveredDots = 0; + int i = 0, j = 0, width = 0, height = 0, iCountedDots = 0, iNotCoveredDots = 0; HWND hAux = 0; //Some defaults now. The routine is designed for thin and tall windows. diff --git a/plugins/Clist_modern/src/modern_clistsettings.cpp b/plugins/Clist_modern/src/modern_clistsettings.cpp index ed07d24236..fc91d4245c 100644 --- a/plugins/Clist_modern/src/modern_clistsettings.cpp +++ b/plugins/Clist_modern/src/modern_clistsettings.cpp @@ -192,15 +192,15 @@ int CListSettings_GetCopyFromCache(pClcCacheEntry pDest, DWORD flag) int CListSettings_SetToCache(pClcCacheEntry pSrc, DWORD flag) { - if ( !pSrc || !pSrc->hContact) - return -1; + if ( !pSrc || !pSrc->hContact) + return -1; - pClcCacheEntry pDst = (pClcCacheEntry)pcli->pfnGetCacheEntry(pSrc->hContact); - if ( !pDst) - return -1; + pClcCacheEntry pDst = (pClcCacheEntry)pcli->pfnGetCacheEntry(pSrc->hContact); + if ( !pDst) + return -1; - CListSettings_CopyCacheItems(pDst, pSrc, flag); - return 0; + CListSettings_CopyCacheItems(pDst, pSrc, flag); + return 0; } void cliFreeCacheItem( pClcCacheEntry p ) diff --git a/plugins/Clist_modern/src/modern_clisttray.cpp b/plugins/Clist_modern/src/modern_clisttray.cpp index 835dcbf101..4ac629d55b 100644 --- a/plugins/Clist_modern/src/modern_clisttray.cpp +++ b/plugins/Clist_modern/src/modern_clisttray.cpp @@ -383,14 +383,13 @@ INT_PTR TrayIconPauseAutoHide(WPARAM wParam,LPARAM lParam) void DestroyTrayMenu(HMENU hMenu) { - int cnt = GetMenuItemCount(hMenu); - for (int i=0; i < cnt; ++i) - { - HMENU hSubMenu = GetSubMenu(hMenu, i); - if (hSubMenu == hStatusMenu || hSubMenu == hMainMenu) - RemoveMenu(hMenu, i--, MF_BYPOSITION); - } - DestroyMenu(hMenu); + int cnt = GetMenuItemCount(hMenu); + for (int i=0; i < cnt; ++i) { + HMENU hSubMenu = GetSubMenu(hMenu, i); + if (hSubMenu == hStatusMenu || hSubMenu == hMainMenu) + RemoveMenu(hMenu, i--, MF_BYPOSITION); + } + DestroyMenu(hMenu); } INT_PTR cli_TrayIconProcessMessage(WPARAM wParam,LPARAM lParam) @@ -462,7 +461,7 @@ INT_PTR cli_TrayIconProcessMessage(WPARAM wParam,LPARAM lParam) GetCursorPos(&pt); pcli->bTrayMenuOnScreen = TRUE; TrackPopupMenu(hMenu, TPM_TOPALIGN | TPM_LEFTALIGN|TPM_LEFTBUTTON, pt.x, pt.y, 0, msg->hwnd, NULL); - DestroyTrayMenu(hMenu); + DestroyTrayMenu(hMenu); PostMessage(msg->hwnd, WM_NULL, 0, 0); } else break; @@ -599,7 +598,7 @@ INT_PTR FreeOwnerDataTrayMenu (WPARAM wParam,LPARAM lParam) FreeAndNil((void**)&mmep); } - return(0); + return 0; } void InitTrayMenus(void) @@ -716,15 +715,15 @@ void InitTrayMenus(void) DestroyIcon_protect(mi.hIcon); } - hMainMenu = (HMENU)CallService(MS_CLIST_MENUGETMAIN,0,0); - hStatusMenu = (HMENU)CallService(MS_CLIST_MENUGETSTATUS,0,0); + hMainMenu = (HMENU)CallService(MS_CLIST_MENUGETMAIN,0,0); + hStatusMenu = (HMENU)CallService(MS_CLIST_MENUGETSTATUS,0,0); } void UninitTrayMenu() { - if (hTrayMenuObject && ServiceExists(MO_REMOVEMENUOBJECT)) - CallService(MO_REMOVEMENUOBJECT,(WPARAM)hTrayMenuObject,0); - hTrayMenuObject = NULL; + if (hTrayMenuObject && ServiceExists(MO_REMOVEMENUOBJECT)) + CallService(MO_REMOVEMENUOBJECT,(WPARAM)hTrayMenuObject,0); + hTrayMenuObject = NULL; } void InitTray(void) diff --git a/plugins/Clist_modern/src/modern_clui.cpp b/plugins/Clist_modern/src/modern_clui.cpp index c0abf2a8b7..ea49a86059 100644 --- a/plugins/Clist_modern/src/modern_clui.cpp +++ b/plugins/Clist_modern/src/modern_clui.cpp @@ -2708,7 +2708,7 @@ LRESULT CLUI::OnContextMenu( UINT msg, WPARAM wParam, LPARAM lParam ) HMENU hMenu; hMenu = (HMENU)CallService(MS_CLIST_MENUBUILDGROUP,0,0); TrackPopupMenu(hMenu,TPM_TOPALIGN|TPM_LEFTALIGN|TPM_LEFTBUTTON,pt.x,pt.y,0,m_hWnd,NULL); - DestroyTrayMenu(hMenu); + DestroyTrayMenu(hMenu); } return FALSE; diff --git a/plugins/Clist_modern/src/modern_cluiframes.cpp b/plugins/Clist_modern/src/modern_cluiframes.cpp index 49ccd0ba06..942be6c26e 100644 --- a/plugins/Clist_modern/src/modern_cluiframes.cpp +++ b/plugins/Clist_modern/src/modern_cluiframes.cpp @@ -739,24 +739,21 @@ static int DBStoreFrameSettingsAtPos(int pos,int Frameid) static int LocateStorePosition(int Frameid,int maxstored) { + if (g_pfwFrames[Frameid].Name == NULL) + return -1; - if (g_pfwFrames[Frameid].Name == NULL) - return -1; - char settingname[255]; - for ( int i=0;i < maxstored;i++) - { - - mir_snprintf(settingname,SIZEOF(settingname),"Name%d",i); - DBVARIANT dbv = {0}; - if ( DBGetContactSettingTString( NULL, CLUIFrameModule, settingname, &dbv )) - continue; + char settingname[255]; + for (int i=0; i < maxstored; i++) { + mir_snprintf(settingname,SIZEOF(settingname),"Name%d",i); + DBVARIANT dbv = {0}; + if ( DBGetContactSettingTString( NULL, CLUIFrameModule, settingname, &dbv )) + continue; - if ( lstrcmpi( dbv.ptszVal, g_pfwFrames[Frameid].Name ) == 0 ) - { + if ( lstrcmpi(dbv.ptszVal, g_pfwFrames[Frameid].Name) == 0) { db_free( &dbv ); return i; } - db_free( &dbv ); + db_free( &dbv ); } return -1; } @@ -1402,7 +1399,7 @@ static int _us_DoSetFrameOptions(WPARAM wParam,LPARAM lParam) return -1; } fw.align = lParam; - return(0); + return 0; } CLUIFramesOnClistResize((WPARAM)pcli->hwndContactList,0); @@ -1451,32 +1448,27 @@ static int _us_DoHideTitles(WPARAM wParam,LPARAM lParam) //wparam = frameid static int _us_DoShowHideFrame(WPARAM wParam,LPARAM lParam) { - int pos; - - if (_fCluiFramesModuleNotStarted) return -1; + if (_fCluiFramesModuleNotStarted) + return -1; - if (wParam == 0) { - pos = lParam; - } else { - pos = id2pos(wParam); - } - if (pos >= 0 && (int)pos < g_nFramesCount) - { + int pos = (wParam == 0) ? lParam : id2pos(wParam); + if (pos >= 0 && (int)pos < g_nFramesCount) { g_pfwFrames[pos].visible = !g_pfwFrames[pos].visible; - if (g_pfwFrames[pos].OwnerWindow != (HWND)-2) - { + if (g_pfwFrames[pos].OwnerWindow != (HWND)-2) { if (g_pfwFrames[pos].OwnerWindow) CLUI_ShowWindowMod(g_pfwFrames[pos].OwnerWindow,(g_pfwFrames[pos].visible && g_pfwFrames[pos].collapsed && IsWindowVisible(pcli->hwndContactList))?SW_SHOW/*NOACTIVATE*/:SW_HIDE); - else if (g_pfwFrames[pos].visible) - { + else if (g_pfwFrames[pos].visible) { g_pfwFrames[pos].OwnerWindow = CreateSubContainerWindow(pcli->hwndContactList,g_pfwFrames[pos].FloatingPos.x,g_pfwFrames[pos].FloatingPos.y,10,10); SetParent(g_pfwFrames[pos].hWnd,g_pfwFrames[pos].OwnerWindow); CLUI_ShowWindowMod(g_pfwFrames[pos].OwnerWindow,(g_pfwFrames[pos].visible && g_pfwFrames[pos].collapsed && IsWindowVisible(pcli->hwndContactList))?SW_SHOW/*NOACTIVATE*/:SW_HIDE); } } - if (g_pfwFrames[pos].floating){CLUIFrameResizeFloatingFrame(pos);}; - if ( !g_pfwFrames[pos].floating) CLUIFramesOnClistResize((WPARAM)pcli->hwndContactList,0); + if (g_pfwFrames[pos].floating) + CLUIFrameResizeFloatingFrame(pos); + + if ( !g_pfwFrames[pos].floating) + CLUIFramesOnClistResize((WPARAM)pcli->hwndContactList, 0); } return 0; } @@ -1484,24 +1476,14 @@ static int _us_DoShowHideFrame(WPARAM wParam,LPARAM lParam) //wparam = frameid static int _us_DoShowHideFrameTitle(WPARAM wParam,LPARAM lParam) { - int pos; - - if (_fCluiFramesModuleNotStarted) return -1; + if (_fCluiFramesModuleNotStarted) + return -1; - if (wParam == 0) { - pos = lParam; - } else { - pos = id2pos(wParam); - } + int pos = (wParam == 0) ? lParam : id2pos(wParam); if (pos >= 0 && (int)pos < g_nFramesCount) g_pfwFrames[pos].TitleBar.ShowTitleBar = !g_pfwFrames[pos].TitleBar.ShowTitleBar; - //if (Frames[pos].height> - - CLUIFramesOnClistResize((WPARAM)pcli->hwndContactList,0); - - return 0; } @@ -1509,11 +1491,12 @@ static int _us_DoShowHideFrameTitle(WPARAM wParam,LPARAM lParam) //lparam = -1 up ,1 down static int _us_DoMoveFrame(WPARAM wParam,LPARAM lParam) { - int pos,i,curpos,curalign,v,tmpval; + int i,curpos,curalign,v,tmpval; - if (_fCluiFramesModuleNotStarted) return -1; + if (_fCluiFramesModuleNotStarted) + return -1; - pos = id2pos(wParam); + int pos = id2pos(wParam); if (pos >= 0 && (int)pos < g_nFramesCount) { SortData *sd; curpos = g_pfwFrames[pos].order; @@ -1529,54 +1512,49 @@ static int _us_DoMoveFrame(WPARAM wParam,LPARAM lParam) sd[v].realpos = i; v++; }; - if (v == 0){return(0);}; + if (v == 0){return 0;}; qsort(sd,v,sizeof(SortData),sortfunc); for (i=0;i < v;i++) g_pfwFrames[sd[i].realpos].order = i+1; //to be sure that order is incremental - for (i=0;i < v;i++) - { - if (sd[i].realpos == pos) - { - if (lParam == -1) - { + for (i=0;i < v;i++) { + if (sd[i].realpos == pos) { + if (lParam == -1) { if (i >= v-1) break; tmpval = g_pfwFrames[sd[i+1].realpos].order; g_pfwFrames[sd[i+1].realpos].order = g_pfwFrames[pos].order; g_pfwFrames[pos].order = tmpval; break; - }; - if (lParam == +1) - { + } + + if (lParam == 1) { if (i < 1) break; tmpval = g_pfwFrames[sd[i-1].realpos].order; g_pfwFrames[sd[i-1].realpos].order = g_pfwFrames[pos].order; g_pfwFrames[pos].order = tmpval; break; - }; - - - }; - }; + } + } + } - if (sd != NULL){free(sd);}; + if (sd != NULL) + free(sd); CLUIFramesStoreFrameSettings(pos); CLUIFramesOnClistResize((WPARAM)pcli->hwndContactList,0); - } - return(0); -}; - - + return 0; +} static int _us_DoMoveFrameUp(WPARAM wParam,LPARAM lParam) { return CLUIFrames_MoveFrame(wParam,(LPARAM)+1); } + static int _us_DoMoveFrameDown(WPARAM wParam,LPARAM lParam) { return CLUIFrames_MoveFrame(wParam,(LPARAM)-1); } + //wparam = frameid //lparam = alignment static int _us_DoSetFrameAlign(WPARAM wParam,LPARAM lParam) @@ -1585,20 +1563,23 @@ static int _us_DoSetFrameAlign(WPARAM wParam,LPARAM lParam) CLUIFrames_SetFrameOptions(MAKEWPARAM(FO_ALIGN,wParam),lParam); CLUIFramesOnClistResize((WPARAM)pcli->hwndContactList,0); - return(0); + return 0; } + static int _us_DoAlignFrameTop(WPARAM wParam,LPARAM lParam) { if (_fCluiFramesModuleNotStarted) return -1; return CLUIFrames_SetFrameAlign(wParam,alTop); } + static int _us_DoAlignFrameBottom(WPARAM wParam,LPARAM lParam) { if (_fCluiFramesModuleNotStarted) return -1; return CLUIFrames_SetFrameAlign(wParam,alBottom); } + static int _us_DoAlignFrameClient(WPARAM wParam,LPARAM lParam) { if (_fCluiFramesModuleNotStarted) return -1; @@ -1606,20 +1587,13 @@ static int _us_DoAlignFrameClient(WPARAM wParam,LPARAM lParam) return CLUIFrames_SetFrameAlign(wParam,alClient); } - //wparam = frameid static int _us_DoLockFrame(WPARAM wParam,LPARAM lParam) { - int pos; - if (_fCluiFramesModuleNotStarted) return -1; - if (wParam == 0) { - pos = lParam; - } else { - pos = id2pos(wParam); - } - if (pos >= 0 && (int)pos < g_nFramesCount) { + int pos = (wParam == 0) ? lParam : id2pos(wParam); + if (pos >= 0 && (int)pos < g_nFramesCount) { g_pfwFrames[pos].Locked = !g_pfwFrames[pos].Locked; CLUIFramesStoreFrameSettings(pos); } @@ -1631,38 +1605,28 @@ static int _us_DoLockFrame(WPARAM wParam,LPARAM lParam) static int _us_DoSetFrameBorder(WPARAM wParam,LPARAM lParam) { RECT rc; - int FrameId,oldflags; - HWND hw; - int flt; + int oldflags; if (_fCluiFramesModuleNotStarted) return -1; - if (wParam == 0) { - FrameId = lParam; - } else { - FrameId = id2pos(wParam); - } - if (FrameId == -1){return(-1);}; - flt = - oldflags = CallService(MS_CLIST_FRAMES_GETFRAMEOPTIONS,MAKEWPARAM(FO_FLAGS,wParam),0); - if (oldflags&F_NOBORDER) - { - oldflags &= (~F_NOBORDER); - } + int FrameId = (wParam == 0) ? lParam : id2pos(wParam); + if (FrameId == -1) + return -1; + + int flt = oldflags = CallService(MS_CLIST_FRAMES_GETFRAMEOPTIONS,MAKEWPARAM(FO_FLAGS,wParam),0); + if (oldflags & F_NOBORDER) + oldflags &= ~F_NOBORDER; else - { oldflags |= F_NOBORDER; - }; - hw = g_pfwFrames[FrameId].hWnd; - GetWindowRect(hw,&rc); + HWND hw = g_pfwFrames[FrameId].hWnd; + GetWindowRect(hw,&rc); CallService(MS_CLIST_FRAMES_SETFRAMEOPTIONS,MAKEWPARAM(FO_FLAGS,wParam),oldflags); - { - SetWindowPos(hw,0,0,0,0,0,SWP_NOSIZE|SWP_NOZORDER|SWP_NOMOVE|SWP_NOACTIVATE|SWP_DRAWFRAME); - }; - return(0); -}; + SetWindowPos(hw,0,0,0,0,0,SWP_NOSIZE|SWP_NOZORDER|SWP_NOMOVE|SWP_NOACTIVATE|SWP_DRAWFRAME); + return 0; +} + //wparam = frameid static int _us_DoCollapseFrame(WPARAM wParam,LPARAM lParam) { @@ -1788,7 +1752,7 @@ static int _us_DoCollapseFrame(WPARAM wParam,LPARAM lParam) SetWindowPos(g_pfwFrames[FrameId].ContainerWnd,HWND_TOP,0,0,contwnd.left,contwnd.top,SWP_SHOWWINDOW|SWP_NOACTIVATE|SWP_NOMOVE); }; CLUIFramesStoreAllFrames(); - return(0); + return 0; } else return -1; @@ -2082,7 +2046,7 @@ static int _us_DoRemoveFrame(WPARAM wParam,LPARAM lParam) CLUIFramesOnClistResize((WPARAM)pcli->hwndContactList,0); CLUI__cliInvalidateRect(pcli->hwndContactList,NULL,TRUE); - return(0); + return 0; }; @@ -2126,7 +2090,7 @@ static int CLUIFrameMoveResize(const FRAMEWND *Frame) } CLUI_ShowWindowMod(Frame->hWnd,SW_HIDE); CLUI_ShowWindowMod(Frame->TitleBar.hwnd,SW_HIDE); - return(0); + return 0; } if (Frame->OwnerWindow && Frame->OwnerWindow != (HWND)-2 ) @@ -3273,7 +3237,7 @@ static LRESULT CALLBACK CLUIFrameTitleBarProc(HWND hwnd, UINT msg, WPARAM wParam g_pfwFrames[pos].TitleBar.oldpos = curpt; - return(0); + return 0; }; } @@ -3324,12 +3288,12 @@ static LRESULT CALLBACK CLUIFrameTitleBarProc(HWND hwnd, UINT msg, WPARAM wParam g_pfwFrames[pos].TitleBar.oldpos = curpt; - return(0); + return 0; }; }; - //return(0); + //return 0; }; if (wParam&MK_LBUTTON) { @@ -3390,9 +3354,8 @@ static LRESULT CALLBACK CLUIFrameTitleBarProc(HWND hwnd, UINT msg, WPARAM wParam }; //break; - return(0); - }; - + return 0; + } if (g_pfwFrames[pos].prevvisframe != -1) { GetCursorPos(&pt); @@ -3490,8 +3453,8 @@ static int CLUIFrameResizeFloatingFrame(int framepos) int width,height; RECT rect; - if ( !g_pfwFrames[framepos].floating){return(0);}; - if (g_pfwFrames[framepos].ContainerWnd == 0){return(0);}; + if ( !g_pfwFrames[framepos].floating){return 0;}; + if (g_pfwFrames[framepos].ContainerWnd == 0){return 0;}; GetClientRect(g_pfwFrames[framepos].ContainerWnd,&rect); width = rect.right-rect.left; @@ -3504,7 +3467,7 @@ static int CLUIFrameResizeFloatingFrame(int framepos) if (g_pfwFrames[framepos].TitleBar.ShowTitleBar) { CLUI_ShowWindowMod(g_pfwFrames[framepos].TitleBar.hwnd,SW_SHOW/*NOACTIVATE*/); - //if (Frames[framepos].Locked){return(0);}; + //if (Frames[framepos].Locked){return 0;}; g_pfwFrames[framepos].height = height-DEFAULT_TITLEBAR_HEIGHT; SetWindowPos(g_pfwFrames[framepos].TitleBar.hwnd,HWND_TOP,0,0,width,DEFAULT_TITLEBAR_HEIGHT,SWP_SHOWWINDOW|SWP_NOACTIVATE|SWP_DRAWFRAME); @@ -3514,7 +3477,7 @@ static int CLUIFrameResizeFloatingFrame(int framepos) else { //SetWindowPos(Frames[framepos].TitleBar.hwnd,HWND_TOP,0,0,width,DEFAULT_TITLEBAR_HEIGHT,SWP_SHOWWINDOW|SWP_NOMOVE); - //if (Frames[framepos].Locked){return(0);}; + //if (Frames[framepos].Locked){return 0;}; g_pfwFrames[framepos].height = height; CLUI_ShowWindowMod(g_pfwFrames[framepos].TitleBar.hwnd,SW_HIDE); SetWindowPos(g_pfwFrames[framepos].hWnd,HWND_TOP,0,0,width,height,SWP_SHOWWINDOW|SWP_NOACTIVATE); @@ -3527,7 +3490,7 @@ static int CLUIFrameResizeFloatingFrame(int framepos) //Frames[framepos].height = Frames[framepos].wndSize.bottom-Frames[framepos].wndSize.top; //GetClientRect(Frames[framepos].hWnd,&Frames[framepos].wndSize); //Frames[framepos].height = Frames[framepos].wndSize.bottom-Frames[framepos].wndSize.top; - return(0); + return 0; }; static int CLUIFrameOnMainMenuBuild(WPARAM wParam,LPARAM lParam) @@ -3671,7 +3634,7 @@ static LRESULT CALLBACK CLUIFrameContainerWndProc(HWND hwnd, UINT msg, WPARAM wP framepos = id2pos(Frameid); //SetWindowPos(Frames[framepos].TitleBar.hwndTip, HWND_TOPMOST,0, 0, 0, 0,SWP_NOMOVE | SWP_NOSIZE ); - return(0); + return 0; }; case WM_GETMINMAXINFO: //DefWindowProc(hwnd,msg,wParam,lParam); @@ -3695,7 +3658,7 @@ static LRESULT CALLBACK CLUIFrameContainerWndProc(HWND hwnd, UINT msg, WPARAM wP ((LPMINMAXINFO)lParam)->ptMaxTrackSize.x = rct.right-rct.left; ((LPMINMAXINFO)lParam)->ptMaxTrackSize.y = rct.bottom-rct.top; // - //return(0); + //return 0; }; @@ -3734,7 +3697,7 @@ static LRESULT CALLBACK CLUIFrameContainerWndProc(HWND hwnd, UINT msg, WPARAM wP framepos = id2pos(Frameid); if (framepos < 0 || framepos >= g_nFramesCount){break;}; - if (g_pfwFrames[framepos].ContainerWnd == 0){return(0);}; + if (g_pfwFrames[framepos].ContainerWnd == 0){return 0;}; GetWindowRect(g_pfwFrames[framepos].ContainerWnd,&rect); g_pfwFrames[framepos].FloatingPos.x = rect.left; @@ -3792,13 +3755,13 @@ static LRESULT CALLBACK CLUIFrameContainerWndProc(HWND hwnd, UINT msg, WPARAM wP g_pfwFrames[framepos].TitleBar.oldpos = curpt; - return(0); + return 0; }; }; - return(0); + return 0; }; case WM_SIZE: @@ -3811,7 +3774,7 @@ static LRESULT CALLBACK CLUIFrameContainerWndProc(HWND hwnd, UINT msg, WPARAM wP framepos = id2pos(Frameid); if (framepos < 0 || framepos >= g_nFramesCount){break;}; - if (g_pfwFrames[framepos].ContainerWnd == 0){return(0);}; + if (g_pfwFrames[framepos].ContainerWnd == 0){return 0;}; CLUIFrameResizeFloatingFrame(framepos); GetWindowRect(g_pfwFrames[framepos].ContainerWnd,&rect); @@ -3823,7 +3786,7 @@ static LRESULT CALLBACK CLUIFrameContainerWndProc(HWND hwnd, UINT msg, WPARAM wP CLUIFramesStoreFrameSettings(framepos); - return(0); + return 0; }; case WM_LBUTTONDOWN: { @@ -3843,7 +3806,7 @@ static LRESULT CALLBACK CLUIFrameContainerWndProc(HWND hwnd, UINT msg, WPARAM wP case WM_DESTROY: { //{ CLUIFramesStoreAllFrames();}; - return(0); + return 0; }; /* case WM_COMMAND: diff --git a/plugins/Clist_modern/src/modern_framesmenu.cpp b/plugins/Clist_modern/src/modern_framesmenu.cpp index b63532c4cb..dba4a3eb30 100644 --- a/plugins/Clist_modern/src/modern_framesmenu.cpp +++ b/plugins/Clist_modern/src/modern_framesmenu.cpp @@ -68,7 +68,7 @@ INT_PTR FrameMenuExecService(WPARAM wParam,LPARAM lParam) { if (fmep == NULL){return(-1);}; CallService(fmep->szServiceName,lParam,fmep->param1); - return(0); + return 0; }; //true - ok,false ignore @@ -95,7 +95,7 @@ INT_PTR FrameMenuCheckService(WPARAM wParam,LPARAM lParam) { static INT_PTR ContextFrameMenuNotify(WPARAM wParam,LPARAM lParam) { NotifyEventHooks(g_CluiData.hEventPreBuildFrameMenu,wParam,lParam); - return(0); + return 0; }; static INT_PTR BuildContextFrameMenu(WPARAM wParam,LPARAM lParam) @@ -210,5 +210,5 @@ int UnitFramesMenu() if (InternalGenMenuModule){UnitGenMenu();}; }; */ - return(0); + return 0; }; diff --git a/plugins/Clist_modern/src/modern_groupmenu.cpp b/plugins/Clist_modern/src/modern_groupmenu.cpp index b1de089fbb..d11337f3ed 100644 --- a/plugins/Clist_modern/src/modern_groupmenu.cpp +++ b/plugins/Clist_modern/src/modern_groupmenu.cpp @@ -112,7 +112,7 @@ static INT_PTR AddGroupMenuItem(WPARAM wParam,LPARAM lParam) int GroupMenuCheckService(WPARAM wParam,LPARAM lParam) { //not used - return(0); + return 0; }; INT_PTR GroupMenuonAddService(WPARAM wParam,LPARAM lParam) { @@ -174,7 +174,7 @@ INT_PTR FreeOwnerDataGroupMenu (WPARAM wParam,LPARAM lParam) FreeAndNil((void **)&mmep); } -return(0); +return 0; }; INT_PTR HideGroupsHelper(WPARAM wParam,LPARAM lParam) @@ -634,7 +634,7 @@ INT_PTR FreeOwnerDataSubGroupMenu (WPARAM wParam,LPARAM lParam) FreeAndNil((void **)&mmep); } -return(0); +return 0; }; //wparam menu handle to pass to clc.c diff --git a/plugins/Clist_modern/src/modern_skinengine.cpp b/plugins/Clist_modern/src/modern_skinengine.cpp index 7e915d2054..5cf65ac541 100644 --- a/plugins/Clist_modern/src/modern_skinengine.cpp +++ b/plugins/Clist_modern/src/modern_skinengine.cpp @@ -2426,11 +2426,11 @@ int ske_LoadSkinFromIniFile(TCHAR * szFileName, BOOL bOnlyObjects) static int ske_enumdb_SkinSectionDeletionProc (const char *szSetting,LPARAM lParam) { - if (szSetting == NULL){return(0);}; + if (szSetting == NULL){return 0;}; nArrayLen++; pszSettingName = (char **)realloc(pszSettingName,nArrayLen*sizeof(char *)); pszSettingName[nArrayLen-1] = _strdup(szSetting); - return(0); + return 0; }; static int ske_DeleteAllSettingInSection(char * SectionName) { @@ -2444,7 +2444,7 @@ static int ske_DeleteAllSettingInSection(char * SectionName) CallService(MS_DB_CONTACT_ENUMSETTINGS,0,(LPARAM)&dbces); //delete all settings - if (nArrayLen == 0){return(0);}; + if (nArrayLen == 0){return 0;}; { int i; for (i=0;i < nArrayLen;i++) @@ -2456,7 +2456,7 @@ static int ske_DeleteAllSettingInSection(char * SectionName) pszSettingName = NULL; nArrayLen = 0; }; - return(0); + return 0; }; diff --git a/plugins/Clist_modern/src/modern_viewmodebar.cpp b/plugins/Clist_modern/src/modern_viewmodebar.cpp index 38f05eafa2..c4ce59712d 100644 --- a/plugins/Clist_modern/src/modern_viewmodebar.cpp +++ b/plugins/Clist_modern/src/modern_viewmodebar.cpp @@ -99,7 +99,7 @@ int CLVM_EnumProc(const char *szSetting, LPARAM lParam) pfnEnumCallback EnumCallback = (pfnEnumCallback)lParam; if (szSetting != NULL) EnumCallback((char *)szSetting); - return(0); + return 0; } void CLVM_EnumModes(pfnEnumCallback EnumCallback) diff --git a/plugins/Clist_modern/src/resource.h b/plugins/Clist_modern/src/resource.h index 29a9f73c9b..da1f1f507e 100644 --- a/plugins/Clist_modern/src/resource.h +++ b/plugins/Clist_modern/src/resource.h @@ -80,7 +80,6 @@ #define IDI_NEWGROUP 282 #define IDI_NEWGROUP2 283 #define IDD_MODERNOPTS 288 -#define IDI_ICON1 290 #define IDC_DEFAULTSUB 293 #define IDC_DROPMETA 295 #define IDC_CURSOR1 296 @@ -92,12 +91,10 @@ #define IDI_AVATAR_OVERLAY_OFFLINE 359 #define IDI_AVATAR_OVERLAY_ONLINE 360 #define IDI_AVATAR_OVERLAY_PHONE 361 -#define IDI_ICON9 362 #define IDI_AVATAR_OVERLAY_AWAY 362 #define IDI_AVATAR_OVERLAY_DND 363 #define IDI_AVATAR_OVERLAY_INVISIBLE 364 #define IDI_AVATAR_OVERLAY_LUNCH 365 -#define IDI_ICON4 366 #define IDI_AVATAR_OVERLAY_CHAT 366 #define IDI_ICQC1 367 #define IDI_ICQC2 368 @@ -114,8 +111,6 @@ #define IDD_OPT_ITEM_TEXT 389 #define IDD_OPT_ITEM_SECOND_LINE 390 #define IDD_OPT_ITEM_THIRD_LINE 391 -#define IDI_ICON2 396 -#define IDI_ICON3 397 #define IDD_OPT_SKINEDITOR 398 #define IDI_STATUS_OVERLAY_NA 400 #define IDI_STATUS_OVERLAY_OCCUPIED 401 @@ -135,11 +130,7 @@ #define IDI_ROWCONT3 418 #define IDD_TAB 450 #define IDD_OPT_CLUI_2 451 -#define IDI_ALWAYSVIS 453 #define IDI_ICON6 454 -#define IDI_NEVERVIS 454 -#define IDI_ICON5 455 -#define IDI_CHAT 455 #define IDI_LISTENING_TO 456 #define IDD_OPT_CLCBKG 462 #define IDI_FAVORITE_0 500 -- cgit v1.2.3