From e3ffab889d900847fa6fb9807bc5f818da28c358 Mon Sep 17 00:00:00 2001 From: George Hazan Date: Sat, 14 Jul 2012 19:06:59 +0000 Subject: much less crazy way to organize clist data git-svn-id: http://svn.miranda-ng.org/main/trunk@973 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c --- plugins/Clist_nicer/INCLUDE/clc.h | 70 ++++------------------------- plugins/Clist_nicer/INCLUDE/commonheaders.h | 1 - plugins/Clist_nicer/SRC/clc.cpp | 16 +++---- plugins/Clist_nicer/SRC/cluiopts.cpp | 8 ++-- plugins/Clist_nicer/SRC/extBackg.cpp | 2 +- plugins/Clist_nicer/SRC/rowheight_funcs.cpp | 4 +- 6 files changed, 23 insertions(+), 78 deletions(-) (limited to 'plugins/Clist_nicer') diff --git a/plugins/Clist_nicer/INCLUDE/clc.h b/plugins/Clist_nicer/INCLUDE/clc.h index eedb76fc43..879fc52553 100644 --- a/plugins/Clist_nicer/INCLUDE/clc.h +++ b/plugins/Clist_nicer/INCLUDE/clc.h @@ -127,7 +127,8 @@ typedef struct _OrderTreeData BOOL fReserved; } *PORDERTREEDATA, ORDERTREEDATA; -struct DisplayProfile { +struct DisplayProfile +{ DWORD dwFlags; DWORD dwExtraImageMask; int exIconScale; @@ -159,7 +160,8 @@ typedef struct DisplayProfileSet DISPLAYPROFILESET; #define DSP_PROFILES_MODULE "CLN_DspProfiles" // db module for display profiles -struct TExtraCache { +struct TExtraCache +{ BYTE iExtraImage[MAXEXTRACOLUMNS]; HANDLE hContact; HANDLE hTimeZone; @@ -177,29 +179,12 @@ struct TExtraCache { BOOL isChatRoom; }; -struct ClcContact { - BYTE type; - BYTE flags; - union { - struct { - WORD iImage; - HANDLE hContact; - }; - struct { - WORD groupId; - struct ClcGroup *group; - }; - }; - BYTE iExtraImage[MAXEXTRACOLUMNS]; - TCHAR szText[120 - MAXEXTRACOLUMNS]; - char * proto; // MS_PROTO_GETBASEPROTO - - // inherited from standard +struct ClcContact : public ClcContactBase +{ BOOL bIsMeta; HANDLE hSubContact; BYTE xStatus; char *metaProto; - //int clientId; DWORD codePage; struct avatarCacheEntry *ace; WORD wStatus; @@ -208,7 +193,6 @@ struct ClcContact { int isRtl; DWORD cFlags; BYTE bSecondLine; - //int iRowHeight; // index into the row height table (for caching) }; #define DRAGSTAGE_NOTMOVED 0 @@ -231,46 +215,8 @@ struct ClcContact { #define FONTID_TIMESTAMP 11 #define FONTID_LAST FONTID_TIMESTAMP -struct ClcData { - struct ClcGroup list; - int max_row_height; - int yScroll; - int selection; - struct ClcFontInfo fontInfo[FONTID_MAX + 1]; - int scrollTime; - HIMAGELIST himlHighlight; - int groupIndent; - TCHAR szQuickSearch[128]; - int iconXSpace; - HWND hwndRenameEdit; - COLORREF bkColour, selBkColour, selTextColour, hotTextColour, quickSearchColour; - int iDragItem, iInsertionMark; - int dragStage; - POINT ptDragStart; - int dragAutoScrolling; - int dragAutoScrollHeight; - int leftMargin; - int insertionMarkHitHeight; - HBITMAP hBmpBackground; - int backgroundBmpUse, bkChanged; - int iHotTrack; - int gammaCorrection; - DWORD greyoutFlags; //see m_clc.h - DWORD offlineModes; - DWORD exStyle; - POINT ptInfoTip; - int infoTipTimeout; - HANDLE hInfoTipItem; - HIMAGELIST himlExtraColumns; - int extraColumnsCount; - int extraColumnSpacing; - int checkboxSize; - int showSelAlways; - int showIdle; - int noVScrollbar; - int useWindowsColours; - BOOL bNeedSort; - +struct ClcData : public ClcDataBase +{ int *row_heights; int row_heights_size; int row_heights_allocated; diff --git a/plugins/Clist_nicer/INCLUDE/commonheaders.h b/plugins/Clist_nicer/INCLUDE/commonheaders.h index 6a2e363544..91de256f0a 100644 --- a/plugins/Clist_nicer/INCLUDE/commonheaders.h +++ b/plugins/Clist_nicer/INCLUDE/commonheaders.h @@ -62,7 +62,6 @@ #include #include #include -#include #include #include #include diff --git a/plugins/Clist_nicer/SRC/clc.cpp b/plugins/Clist_nicer/SRC/clc.cpp index b63a77a7bb..98348ca0e0 100644 --- a/plugins/Clist_nicer/SRC/clc.cpp +++ b/plugins/Clist_nicer/SRC/clc.cpp @@ -288,7 +288,7 @@ LRESULT CALLBACK ContactListControlWndProc(HWND hwnd, UINT msg, WPARAM wParam, L dat->himlExtraColumns = himlExtraImages; dat->hwndParent = GetParent(hwnd); dat->lastSort = GetTickCount(); - dat->bNeedSort = FALSE; + dat->needsResort = FALSE; { CREATESTRUCT *cs = (CREATESTRUCT *)lParam; if (cs->lpCreateParams == (LPVOID)0xff00ff00) { @@ -344,7 +344,7 @@ LBL_Def: nm.hItem = (HANDLE) wParam; SendMessage(GetParent(hwnd), WM_NOTIFY, 0, (LPARAM) &nm); } - dat->bNeedSort = TRUE; + dat->needsResort = TRUE; PostMessage(hwnd, INTM_SORTCLC, 0, 1); goto LBL_Def; } @@ -404,7 +404,7 @@ LBL_Def: else dat->selection = -1; } - dat->bNeedSort = TRUE; + dat->needsResort = TRUE; PostMessage(hwnd, INTM_SORTCLC, 0, recalcScrollBar); PostMessage(hwnd, INTM_INVALIDATE, 0, (LPARAM)(contactRemoved ? 0 : wParam)); if (recalcScrollBar) @@ -448,7 +448,7 @@ LBL_Def: RTL_DetectAndSet(contact, 0); - dat->bNeedSort = TRUE; + dat->needsResort = TRUE; PostMessage(hwnd, INTM_SORTCLC, 0, 0); goto LBL_Def; } @@ -536,7 +536,7 @@ LBL_Def: RTL_DetectAndSet(contact, 0); - dat->bNeedSort = TRUE; + dat->needsResort = TRUE; PostMessage(hwnd, INTM_SORTCLC, 0, 0); goto LBL_Def; } @@ -574,12 +574,12 @@ LBL_Def: goto LBL_Def; } case INTM_FORCESORT: - dat->bNeedSort = TRUE; + dat->needsResort = TRUE; return SendMessage(hwnd, INTM_SORTCLC, wParam, lParam); case INTM_SORTCLC: - if (dat->bNeedSort) { + if (dat->needsResort) { pcli->pfnSortCLC(hwnd, dat, TRUE); - dat->bNeedSort = FALSE; + dat->needsResort = FALSE; } if (lParam) pcli->pfnRecalcScrollBar(hwnd, dat); diff --git a/plugins/Clist_nicer/SRC/cluiopts.cpp b/plugins/Clist_nicer/SRC/cluiopts.cpp index 843925d5dd..f836995f68 100644 --- a/plugins/Clist_nicer/SRC/cluiopts.cpp +++ b/plugins/Clist_nicer/SRC/cluiopts.cpp @@ -41,7 +41,7 @@ INT_PTR CALLBACK DlgProcCluiOpts(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM l switch (msg) { case WM_INITDIALOG: { - opt_clui_changed = 0; + opt_clui_changed = 0; TranslateDialogDefault(hwndDlg); CheckDlgButton(hwndDlg, IDC_BRINGTOFRONT, cfg::getByte("CList", "BringToFront", SETTING_BRINGTOFRONT_DEFAULT) ? BST_CHECKED : BST_UNCHECKED); CheckDlgButton(hwndDlg, IDC_ALWAYSHIDEONTASKBAR, cfg::getByte("CList", "AlwaysHideOnTB", 1) ? BST_CHECKED : BST_UNCHECKED); @@ -164,9 +164,9 @@ INT_PTR CALLBACK DlgProcCluiOpts(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM l SetDlgItemTextA(hwndDlg, IDC_ACTIVEPERC, str); } if (wParam != 0x12345678) { - SendMessage(GetParent(hwndDlg), PSM_CHANGED, 0, 0); - opt_clui_changed = 1; - } + SendMessage(GetParent(hwndDlg), PSM_CHANGED, 0, 0); + opt_clui_changed = 1; + } break; case WM_NOTIFY: switch (((LPNMHDR) lParam)->code) { diff --git a/plugins/Clist_nicer/SRC/extBackg.cpp b/plugins/Clist_nicer/SRC/extBackg.cpp index 9cc8f0fd44..972ba79b1f 100644 --- a/plugins/Clist_nicer/SRC/extBackg.cpp +++ b/plugins/Clist_nicer/SRC/extBackg.cpp @@ -1843,7 +1843,7 @@ int CoolSB_SetupScrollBar() !StatusItems[ID_EXTBKSCROLLBUTTONHOVER - ID_STATUS_OFFLINE].imageItem || !StatusItems[ID_EXTBKSCROLLBUTTONPRESSED - ID_STATUS_OFFLINE].imageItem) - cfg::dat.bSkinnedScrollbar = FALSE; + cfg::dat.bSkinnedScrollbar = FALSE; if(cfg::getByte("CLC", "NoVScrollBar", 0)) { UninitializeCoolSB(pcli->hwndContactTree); diff --git a/plugins/Clist_nicer/SRC/rowheight_funcs.cpp b/plugins/Clist_nicer/SRC/rowheight_funcs.cpp index 8328d3f7bb..25a7b6b68d 100644 --- a/plugins/Clist_nicer/SRC/rowheight_funcs.cpp +++ b/plugins/Clist_nicer/SRC/rowheight_funcs.cpp @@ -35,7 +35,7 @@ BOOL RowHeight::Init(ClcData *dat) { - dat->max_row_height = 0; + dat->rowHeight = 0; dat->row_heights_size = 0; dat->row_heights_allocated = 0; dat->row_heights = NULL; @@ -133,7 +133,7 @@ int RowHeight::getMaxRowHeight(ClcData *dat, const HWND hwnd) max_height = max(max_height, dat->min_row_heigh); max_height += cfg::dat.bRowSpacing; - dat->max_row_height = max_height; + dat->rowHeight = max_height; return max_height; } -- cgit v1.2.3