summaryrefslogtreecommitdiff
path: root/plugins/Clist_modern/src/hdr/modern_clcpaint.h
diff options
context:
space:
mode:
authorGeorge Hazan <george.hazan@gmail.com>2012-11-15 17:29:58 +0000
committerGeorge Hazan <george.hazan@gmail.com>2012-11-15 17:29:58 +0000
commite311fc5f472c169ec0f25729fa5070fdd4a6c805 (patch)
treeb63a187d53fc6a061422a851ae3dbd8123be909a /plugins/Clist_modern/src/hdr/modern_clcpaint.h
parent6cd8cc0b3461df48269fac24aad474154fb040b2 (diff)
clist_modern: code cleaning
git-svn-id: http://svn.miranda-ng.org/main/trunk@2318 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'plugins/Clist_modern/src/hdr/modern_clcpaint.h')
-rw-r--r--plugins/Clist_modern/src/hdr/modern_clcpaint.h123
1 files changed, 60 insertions, 63 deletions
diff --git a/plugins/Clist_modern/src/hdr/modern_clcpaint.h b/plugins/Clist_modern/src/hdr/modern_clcpaint.h
index 6e1a5ceea4..97c299fdbe 100644
--- a/plugins/Clist_modern/src/hdr/modern_clcpaint.h
+++ b/plugins/Clist_modern/src/hdr/modern_clcpaint.h
@@ -9,15 +9,15 @@ public:
CLCPaint();
~CLCPaint() {};
- CLINTERFACE void cliPaintClc( HWND hwnd, struct ClcData *dat, HDC hdc, RECT *rcPaint );
- CLINTERFACE tPaintCallbackProc PaintCallbackProc( HWND hWnd, HDC hDC, RECT * rcPaint, HRGN rgn, DWORD dFlags, void * CallBackData );
+ CLINTERFACE void cliPaintClc(HWND hwnd, ClcData *dat, HDC hdc, RECT *rcPaint);
+ CLINTERFACE tPaintCallbackProc PaintCallbackProc(HWND hWnd, HDC hDC, RECT *rcPaint, HRGN rgn, DWORD dFlags, void * CallBackData);
- BOOL IsForegroundWindow( HWND hWnd );
- HFONT ChangeToFont( HDC hdc, struct ClcData *dat, int id, int *fontHeight );
- int GetBasicFontID( ClcContact * contact );
- void GetTextSize( SIZE *text_size, HDC hdcMem, RECT free_row_rc, TCHAR *szText, SortedList *plText, UINT uTextFormat, int smiley_height );
- void AddParam( MODERNMASK * mpModernMask, DWORD dwParamHash, const char* szValue, DWORD dwValueHash );
- BOOL CheckMiniMode( struct ClcData *dat, BOOL selected, BOOL hot );
+ BOOL IsForegroundWindow(HWND hWnd);
+ HFONT ChangeToFont(HDC hdc, ClcData *dat, int id, int *fontHeight);
+ int GetBasicFontID(ClcContact *contact);
+ void GetTextSize(SIZE *text_size, HDC hdcMem, RECT free_row_rc, TCHAR *szText, SortedList *plText, UINT uTextFormat, int smiley_height);
+ void AddParam(MODERNMASK *mpModernMask, DWORD dwParamHash, const char* szValue, DWORD dwValueHash);
+ BOOL CheckMiniMode(ClcData *dat, BOOL selected, BOOL hot);
private:
static const int HORIZONTAL_SPACE;
@@ -95,42 +95,40 @@ private:
static const char * HASHTEXT[hi_LastItem];
static DWORD HASH[hi_LastItem];
-
-
- void _FillQuickHash();
- void _SetHotTrackColour( HDC hdc, struct ClcData *dat );
- int _GetStatusOnlineness( int status );
- int _GetGeneralisedStatus();
- int _GetRealStatus( ClcContact * pContact, int nStatus );
- RECT _GetRectangle( struct ClcData *dat, RECT *row_rc, RECT *free_row_rc, int *left_pos, int *right_pos, BOOL left, int real_width, int width, int height, int horizontal_space );
- void _DrawTextSmiley( HDC hdcMem, RECT * free_rc, SIZE * text_size, TCHAR *szText, int start, int len, SortedList *plText, UINT uTextFormat, BOOL ResizeSizeSmiley );
- void _AddParameter( MODERNMASK * mpModernMask, MASKPARAM * lpParam );
- void _AddParamShort( MODERNMASK * mpModernMask, DWORD dwParamIndex, DWORD dwValueIndex );
- void _FillParam( MASKPARAM * lpParam, DWORD dwParamHash, const char* szValue, DWORD dwValueHash );
- MODERNMASK * _GetCLCContactRowBackModernMask( ClcGroup * group, ClcContact * Drawing, int indent, int index, BOOL selected, BOOL hottrack, struct ClcData * dat );
- void _RTLRect( RECT *rect, int width, int offset );
- void _PaintRowItemsEx( 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 _DrawStatusIcon( ClcContact * Drawing, struct ClcData *dat, int iImage, HDC hdcMem, int x, int y, int cx, int cy, DWORD colorbg, DWORD colorfg, int mode );
- BOOL _DrawNonEnginedBackground( HWND hwnd, HDC hdcMem, RECT * rcPaint, RECT clRect, struct ClcData * dat );
- void _PaintClc( HWND hwnd, struct ClcData *dat, HDC hdc, RECT *rcPaint );
- void _StoreItemPos( ClcContact *contact, int ItemType, RECT * rc );
- void _CalcItemsPos( HWND hwnd, HDC hdcMem, struct ClcData *dat, ClcContact *Drawing, RECT *in_row_rc, RECT *in_free_row_rc, int left_pos, int right_pos, int selected, int hottrack );
- BOOL __IsVisible( RECT * firtRect, RECT * secondRect );
- 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 _FillQuickHash();
+ void _SetHotTrackColour(HDC hdc, ClcData *dat);
+ int _GetStatusOnlineness(int status);
+ int _GetGeneralisedStatus();
+ int _GetRealStatus(ClcContact *pContact, int nStatus);
+ RECT _GetRectangle(ClcData *dat, RECT *row_rc, RECT *free_row_rc, int *left_pos, int *right_pos, BOOL left, int real_width, int width, int height, int horizontal_space);
+ void _DrawTextSmiley(HDC hdcMem, RECT *free_rc, SIZE * text_size, TCHAR *szText, int start, int len, SortedList *plText, UINT uTextFormat, BOOL ResizeSizeSmiley);
+ void _AddParameter(MODERNMASK *mpModernMask, MASKPARAM * lpParam);
+ void _AddParamShort(MODERNMASK *mpModernMask, DWORD dwParamIndex, DWORD dwValueIndex);
+ void _FillParam(MASKPARAM * lpParam, DWORD dwParamHash, const char* szValue, DWORD dwValueHash);
+ MODERNMASK* _GetCLCContactRowBackModernMask(ClcGroup *group, ClcContact *Drawing, int indent, int index, BOOL selected, BOOL hottrack, ClcData *dat);
+ void _RTLRect(RECT *rect, int width, int offset);
+ void _PaintRowItemsEx(HWND hwnd, HDC hdcMem, ClcData *dat, ClcContact *Drawing, RECT row_rc, RECT free_row_rc, int left_pos, int right_pos, int selected, int hottrack, RECT *rcPaint);
+ void _DrawStatusIcon(ClcContact *Drawing, ClcData *dat, int iImage, HDC hdcMem, int x, int y, int cx, int cy, DWORD colorbg, DWORD colorfg, int mode);
+ BOOL _DrawNonEnginedBackground(HWND hwnd, HDC hdcMem, RECT *rcPaint, RECT clRect, ClcData *dat);
+ void _PaintClc(HWND hwnd, ClcData *dat, HDC hdc, RECT *rcPaint);
+ void _StoreItemPos(ClcContact *contact, int ItemType, RECT *rc);
+ void _CalcItemsPos(HWND hwnd, HDC hdcMem, ClcData *dat, ClcContact *Drawing, RECT *in_row_rc, RECT *in_free_row_rc, int left_pos, int right_pos, int selected, int hottrack);
+ BOOL __IsVisible(RECT *firtRect, RECT *secondRect);
+ void _GetBlendMode(IN 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, 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, 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, ClcData *dat, ClcContact *Drawing, RECT *row_rc, int& selected, int& hottrack, RECT& text_rc, RECT *prcItem);
+ void _DrawContactIcon (HDC hdcMem, ClcData *dat, ClcContact *Drawing, int& selected, int& hottrack, RECT& text_rc, RECT *prcItem);
+ void _DrawContactText (HDC hdcMem, ClcData *dat, ClcContact *Drawing, int& selected, int& hottrack, RECT& text_rc, RECT *prcItem, UINT uTextFormat);
+ void _DrawContactSubText (HDC hdcMem, ClcData *dat, ClcContact *Drawing, int& selected, int& hottrack, RECT& text_rc, RECT *prcItem, UINT uTextFormat, BYTE itemType);
+ void _DrawContactTime (HDC hdcMem, ClcData *dat, ClcContact *Drawing, int& selected, int& hottrack, RECT& text_rc, RECT *prcItem);
+ void _DrawContactExtraIcon (HDC hdcMem, ClcData *dat, ClcContact *Drawing, int& selected, int& hottrack, RECT& text_rc, RECT *rc, int iImage);
+ void _DrawContactSelection (HDC hdcMem, ClcData *dat, ClcContact *Drawing, int& selected, int& hottrack, RECT *rcPaint, RECT *prcItem);
+ void _DrawContactLine (HDC hdcMem, 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
@@ -145,14 +143,15 @@ private:
DM_DRAW_OFFSCREEN = DM_FLOAT | DM_CONTROL | DM_NON_LAYERED | DM_CLASSIC,
};
- inline int _DetermineDrawMode( HWND hWnd, struct ClcData *dat );
+ inline int _DetermineDrawMode(HWND hWnd, ClcData *dat);
struct _PaintContext
{
enum
- { release_none = 0,
- release_hdcmem2 = 1,
- release_hdcmem = 2
+ {
+ release_none = 0,
+ release_hdcmem2 = 1,
+ release_hdcmem = 2
};
HDC hdcMem;
HDC hdcMem2;
@@ -168,23 +167,21 @@ private:
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 ) {};
+ _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 void _PreparePaintContext(HWND hWnd, ClcData *dat, HDC hdc, int paintMode, RECT& clRect, _PaintContext& pc);
+ inline void _DrawBackground(HWND hWnd, ClcData *dat, HDC hdc, int paintMode, RECT* rcPaint, RECT& clRect, _PaintContext& pc);
+ inline void _DrawLines(HWND hWnd, ClcData *dat, HDC hdc, int paintMode, RECT* rcPaint, RECT& clRect, _PaintContext& pc);
+ inline void _DrawInsertionMark(ClcData *dat, RECT& clRect, _PaintContext& pc);
+ inline void _CopyPaintToDest(HWND hWnd, ClcData *dat, HDC hdc, int paintMode, RECT* rcPaint, RECT& clRect, _PaintContext& pc);
+ inline void _FreePaintContext(_PaintContext& pc);
};