summaryrefslogtreecommitdiff
path: root/plugins/Clist_nicer/src
diff options
context:
space:
mode:
authorGeorge Hazan <george.hazan@gmail.com>2013-02-20 17:12:40 +0000
committerGeorge Hazan <george.hazan@gmail.com>2013-02-20 17:12:40 +0000
commit509f52fe07c0b035dfeea810b99edf92a9781380 (patch)
tree3a31ce4a6260801a9dfd47c2c50e2875171eab3c /plugins/Clist_nicer/src
parent646d843cd5b1b3498e488f99d812ad344f746f81 (diff)
nicer+ status items list made dynamic
git-svn-id: http://svn.miranda-ng.org/main/trunk@3654 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'plugins/Clist_nicer/src')
-rw-r--r--plugins/Clist_nicer/src/CLCButton.cpp2
-rw-r--r--plugins/Clist_nicer/src/CLUIFrames/cluiframes.cpp30
-rw-r--r--plugins/Clist_nicer/src/Include/commonheaders.h3
-rw-r--r--plugins/Clist_nicer/src/Include/m_cln_skinedit.h2
-rw-r--r--plugins/Clist_nicer/src/alphablend.cpp3
-rw-r--r--plugins/Clist_nicer/src/clc.cpp9
-rw-r--r--plugins/Clist_nicer/src/clcpaint.cpp35
-rw-r--r--plugins/Clist_nicer/src/clistevents.cpp6
-rw-r--r--plugins/Clist_nicer/src/clui.cpp9
-rw-r--r--plugins/Clist_nicer/src/extBackg.cpp379
-rw-r--r--plugins/Clist_nicer/src/statusbar.cpp5
-rw-r--r--plugins/Clist_nicer/src/statusfloater.cpp4
12 files changed, 202 insertions, 285 deletions
diff --git a/plugins/Clist_nicer/src/CLCButton.cpp b/plugins/Clist_nicer/src/CLCButton.cpp
index 93f1275bb7..9d4afe9b5b 100644
--- a/plugins/Clist_nicer/src/CLCButton.cpp
+++ b/plugins/Clist_nicer/src/CLCButton.cpp
@@ -220,7 +220,7 @@ static void PaintWorker(MButtonExtension *ctl, HDC hdcPaint)
item_id = ctl->stateId == PBS_HOT ? ID_EXTBKTBBUTTONMOUSEOVER : (ctl->stateId == PBS_PRESSED ? ID_EXTBKTBBUTTONSPRESSED : ID_EXTBKTBBUTTONSNPRESSED);
else
item_id = ctl->stateId == PBS_HOT ? ID_EXTBKBUTTONSMOUSEOVER : (ctl->stateId == PBS_PRESSED ? ID_EXTBKBUTTONSPRESSED : ID_EXTBKBUTTONSNPRESSED);
- item = &StatusItems[item_id - ID_STATUS_OFFLINE];
+ item = arStatusItems[item_id - ID_STATUS_OFFLINE];
SetTextColor(hdcMem, item->TEXTCOLOR);
if (item->IGNORED) {
diff --git a/plugins/Clist_nicer/src/CLUIFrames/cluiframes.cpp b/plugins/Clist_nicer/src/CLUIFrames/cluiframes.cpp
index 8ad09efc9c..e8c41ab051 100644
--- a/plugins/Clist_nicer/src/CLUIFrames/cluiframes.cpp
+++ b/plugins/Clist_nicer/src/CLUIFrames/cluiframes.cpp
@@ -28,7 +28,6 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
HFONT __fastcall ChangeToFont(HDC hdc, struct ClcData *dat, int id, int *fontHeight);
extern HWND g_hwndViewModeFrame, g_hwndEventArea;
-extern StatusItems_t *StatusItems;
extern int mf_updatethread_running;
extern DWORD WINAPI MF_UpdateThread(LPVOID p);
@@ -1137,7 +1136,7 @@ INT_PTR CLUIFramesSetFrameOptions(WPARAM wParam, LPARAM lParam)
}
if (Frames[pos].Skinned) {
int uID = (Frames[pos].TitleBar.ShowTitleBar ? ID_EXTBKOWNEDFRAMEBORDERTB - ID_STATUS_OFFLINE : ID_EXTBKOWNEDFRAMEBORDER - ID_STATUS_OFFLINE);
- lParam += (StatusItems[uID].MARGIN_BOTTOM + StatusItems[uID].MARGIN_TOP);
+ lParam += (arStatusItems[uID]->MARGIN_BOTTOM + arStatusItems[uID]->MARGIN_TOP);
}
if (Frames[pos].collapsed) {
int oldHeight = Frames[pos].height;
@@ -1694,10 +1693,7 @@ int FrameNCPaint(HWND hwnd, WNDPROC oldWndProc, WPARAM wParam, LPARAM lParam, BO
if (pcli && pcli->hwndContactList && GetParent(hwnd) == pcli->hwndContactList) {
if (GetWindowLongPtr(hwnd, GWL_STYLE) & CLS_SKINNEDFRAME) {
- StatusItems_t *item = StatusItems ? (hasTitleBar ? &StatusItems[ID_EXTBKOWNEDFRAMEBORDERTB - ID_STATUS_OFFLINE] : &StatusItems[ID_EXTBKOWNEDFRAMEBORDER - ID_STATUS_OFFLINE]) : 0;
- HDC realDC;
- HBITMAP hbmDraw, hbmOld;
-
+ StatusItems_t *item = (arStatusItems.getCount() != 0) ? (hasTitleBar ? arStatusItems[ID_EXTBKOWNEDFRAMEBORDERTB - ID_STATUS_OFFLINE] : arStatusItems[ID_EXTBKOWNEDFRAMEBORDER - ID_STATUS_OFFLINE]) : 0;
if (item == 0)
return 0;
@@ -1706,7 +1702,8 @@ int FrameNCPaint(HWND hwnd, WNDPROC oldWndProc, WPARAM wParam, LPARAM lParam, BO
rc.right = rcWindow.right - rcWindow.left;
rc.bottom = rcWindow.bottom - rcWindow.top;
- hdc = realDC = GetWindowDC(hwnd);
+ HBITMAP hbmDraw, hbmOld;
+ HDC realDC = hdc = GetWindowDC(hwnd);
if (hwnd == pcli->hwndContactTree) {
realDC = CreateCompatibleDC(hdc);
hbmDraw = CreateCompatibleBitmap(hdc, rc.right, rc.bottom);
@@ -1717,8 +1714,8 @@ int FrameNCPaint(HWND hwnd, WNDPROC oldWndProc, WPARAM wParam, LPARAM lParam, BO
BitBlt(realDC, 0, 0, rc.right - rc.left, rc.bottom - rc.top, cfg::dat.hdcBg, rcWindow.left - cfg::dat.ptW.x, rcWindow.top - cfg::dat.ptW.y, SRCCOPY);
- DrawAlpha(realDC, &rc, item->COLOR, item->ALPHA, item->COLOR2, item->COLOR2_TRANSPARENT, item->GRADIENT,
- item->CORNER, item->BORDERSTYLE, item->imageItem);
+ DrawAlpha(realDC, &rc, item->COLOR, item->ALPHA, item->COLOR2, item->COLOR2_TRANSPARENT, item->GRADIENT, item->CORNER, item->BORDERSTYLE, item->imageItem);
+
if (hwnd == pcli->hwndContactTree) {
ExcludeClipRect(hdc, item->MARGIN_LEFT, item->MARGIN_TOP, rc.right - item->MARGIN_RIGHT, rc.bottom - item->MARGIN_BOTTOM);
BitBlt(hdc, 0, 0, rc.right, rc.bottom, realDC, 0, 0, SRCCOPY);
@@ -1728,17 +1725,16 @@ int FrameNCPaint(HWND hwnd, WNDPROC oldWndProc, WPARAM wParam, LPARAM lParam, BO
}
ReleaseDC(hwnd, hdc);
return 0;
- } else if (GetWindowLongPtr(hwnd, GWL_STYLE) & WS_BORDER) {
- HPEN hPenOld;
- HBRUSH brold;
-
+ }
+
+ if ( GetWindowLongPtr(hwnd, GWL_STYLE) & WS_BORDER) {
hdc = GetWindowDC(hwnd);
- hPenOld = reinterpret_cast<HPEN>(SelectObject(hdc, g_hPenCLUIFrames));
+ HPEN hPenOld = reinterpret_cast<HPEN>(SelectObject(hdc, g_hPenCLUIFrames));
GetWindowRect(hwnd, &rcWindow);
rc.left = rc.top = 0;
rc.right = rcWindow.right - rcWindow.left;
rc.bottom = rcWindow.bottom - rcWindow.top;
- brold = reinterpret_cast<HBRUSH>(SelectObject(hdc, GetStockObject(HOLLOW_BRUSH)));
+ HBRUSH brold = reinterpret_cast<HBRUSH>(SelectObject(hdc, GetStockObject(HOLLOW_BRUSH)));
Rectangle(hdc, 0, 0, rcWindow.right - rcWindow.left, rcWindow.bottom - rcWindow.top);
SelectObject(hdc, hPenOld);
SelectObject(hdc, brold);
@@ -1751,7 +1747,7 @@ int FrameNCPaint(HWND hwnd, WNDPROC oldWndProc, WPARAM wParam, LPARAM lParam, BO
int FrameNCCalcSize(HWND hwnd, WNDPROC oldWndProc, WPARAM wParam, LPARAM lParam, BOOL hasTitleBar)
{
- StatusItems_t *item = StatusItems ? (hasTitleBar ? &StatusItems[ID_EXTBKOWNEDFRAMEBORDERTB - ID_STATUS_OFFLINE] : &StatusItems[ID_EXTBKOWNEDFRAMEBORDER - ID_STATUS_OFFLINE]) : 0;
+ StatusItems_t *item = (arStatusItems.getCount() != 0) ? (hasTitleBar ? arStatusItems[ID_EXTBKOWNEDFRAMEBORDERTB - ID_STATUS_OFFLINE] : arStatusItems[ID_EXTBKOWNEDFRAMEBORDER - ID_STATUS_OFFLINE]) : 0;
LRESULT orig = oldWndProc ? CallWindowProc(oldWndProc, hwnd, WM_NCCALCSIZE, wParam, lParam) : 0;
NCCALCSIZE_PARAMS *nccp = (NCCALCSIZE_PARAMS *)lParam;
DWORD dwStyle = GetWindowLongPtr(hwnd, GWL_STYLE);
@@ -2497,7 +2493,7 @@ static int DrawTitleBar(HDC dc, RECT rect, int Frameid)
HBITMAP hBmpOsb, hoBmp;
HBRUSH hBack, hoBrush;
int pos;
- StatusItems_t *item = &StatusItems[ID_EXTBKFRAMETITLE - ID_STATUS_OFFLINE];
+ StatusItems_t *item = arStatusItems[ID_EXTBKFRAMETITLE - ID_STATUS_OFFLINE];
/*
* no need to redraw anything while shutting down
diff --git a/plugins/Clist_nicer/src/Include/commonheaders.h b/plugins/Clist_nicer/src/Include/commonheaders.h
index aa3d51c812..d92f07724b 100644
--- a/plugins/Clist_nicer/src/Include/commonheaders.h
+++ b/plugins/Clist_nicer/src/Include/commonheaders.h
@@ -52,6 +52,7 @@
#include <win2k.h>
#include <m_clistint.h>
#include <m_database.h>
+#include <m_system_cpp.h>
#include <m_langpack.h>
#include <m_avatars.h>
#include <m_button.h>
@@ -175,7 +176,7 @@
// shared vars
extern HINSTANCE g_hInst;
extern LONG g_cxsmIcon, g_cysmIcon;
-extern StatusItems_t *StatusItems;
+extern LIST<StatusItems_t> arStatusItems;
extern ImageItem *g_glyphItem;
/* most free()'s are invalid when the code is executed from a dll, so this changes
diff --git a/plugins/Clist_nicer/src/Include/m_cln_skinedit.h b/plugins/Clist_nicer/src/Include/m_cln_skinedit.h
index a1e69bb6e1..a643363d70 100644
--- a/plugins/Clist_nicer/src/Include/m_cln_skinedit.h
+++ b/plugins/Clist_nicer/src/Include/m_cln_skinedit.h
@@ -98,7 +98,7 @@ typedef struct {
typedef struct _tagSkinDescription {
DWORD cbSize;
- StatusItems_t *StatusItems;
+ StatusItems_t **StatusItems;
int lastItem;
int firstItem;
char szModule[100];
diff --git a/plugins/Clist_nicer/src/alphablend.cpp b/plugins/Clist_nicer/src/alphablend.cpp
index eb46d4c437..ddd40dbc3c 100644
--- a/plugins/Clist_nicer/src/alphablend.cpp
+++ b/plugins/Clist_nicer/src/alphablend.cpp
@@ -27,7 +27,6 @@ extern int g_hottrack, g_hottrack_done;
extern BOOL g_inCLCpaint;
extern BYTE saved_alpha;
extern DWORD savedCORNER;
-extern StatusItems_t *StatusItems;
extern ImageItem *g_glyphItem;
BYTE __forceinline percent_to_byte(UINT32 percent)
@@ -112,7 +111,7 @@ void DrawAlpha(HDC hdcwnd, PRECT rc, DWORD basecolor, int alpha, DWORD basecolor
LONG realHeightHalf = realHeight >> 1;
if (g_hottrack && g_inCLCpaint) {
- StatusItems_t *ht = &StatusItems[ID_EXTBKHOTTRACK - ID_STATUS_OFFLINE];
+ StatusItems_t *ht = arStatusItems[ID_EXTBKHOTTRACK - ID_STATUS_OFFLINE];
if (ht->IGNORED == 0) {
basecolor = ht->COLOR;
basecolor2 = ht->COLOR2;
diff --git a/plugins/Clist_nicer/src/clc.cpp b/plugins/Clist_nicer/src/clc.cpp
index 6d80e49cfd..99e1ff7668 100644
--- a/plugins/Clist_nicer/src/clc.cpp
+++ b/plugins/Clist_nicer/src/clc.cpp
@@ -43,7 +43,6 @@ extern wndFrame *wndFrameCLC;
extern ButtonItem *g_ButtonItems;
extern int during_sizing;
-extern StatusItems_t *StatusItems;
HIMAGELIST hCListImages;
@@ -219,21 +218,21 @@ int ClcShutdown(WPARAM wParam, LPARAM lParam)
free(cfg::eCache[i].statusMsg);
if (cfg::eCache[i].status_item) {
StatusItems_t *item = cfg::eCache[i].status_item;
- int j;
free(cfg::eCache[i].status_item);
cfg::eCache[i].status_item = 0;
- for (j = i; j < cfg::nextCacheEntry; j++) { // avoid duplicate free()'ing status item pointers (there are references from sub to master contacts, so compare the pointers...
+ for (int j = i; j < cfg::nextCacheEntry; j++) // avoid duplicate free()'ing status item pointers (there are references from sub to master contacts, so compare the pointers...
if (cfg::eCache[j].status_item == item)
cfg::eCache[j].status_item = 0;
- }
}
}
free(cfg::eCache);
cfg::eCache = NULL;
}
IMG_DeleteItems();
- free(StatusItems);
+ for (int i=0; i < arStatusItems.getCount(); i++)
+ mir_free(arStatusItems[i]);
+ arStatusItems.destroy();
DeleteCriticalSection(&cfg::cachecs);
return 0;
}
diff --git a/plugins/Clist_nicer/src/clcpaint.cpp b/plugins/Clist_nicer/src/clcpaint.cpp
index dddabc259a..0fd6cc0921 100644
--- a/plugins/Clist_nicer/src/clcpaint.cpp
+++ b/plugins/Clist_nicer/src/clcpaint.cpp
@@ -45,7 +45,6 @@ extern HICON overlayicons[];
extern TCHAR *statusNames[];
extern LONG g_cxsmIcon, g_cysmIcon;
-extern StatusItems_t *StatusItems;
int g_hottrack, g_center, g_ignoreselforgroups, g_selectiveIcon, g_hottrack_done;
HWND g_focusWnd;
@@ -266,7 +265,7 @@ static int __fastcall DrawAvatar(HDC hdcMem, RECT *rc, ClcContact *contact, int
HRGN rgn = 0;
int avatar_size = cfg::dat.avatarSize;
DWORD av_saved_left;
- StatusItems_t *item = contact->wStatus == ID_STATUS_OFFLINE ? &StatusItems[ID_EXTBKAVATARFRAMEOFFLINE - ID_STATUS_OFFLINE] : &StatusItems[ID_EXTBKAVATARFRAME - ID_STATUS_OFFLINE];
+ StatusItems_t *item = contact->wStatus == ID_STATUS_OFFLINE ? arStatusItems[ID_EXTBKAVATARFRAMEOFFLINE - ID_STATUS_OFFLINE] : arStatusItems[ID_EXTBKAVATARFRAME - ID_STATUS_OFFLINE];
int skinMarginX, skinMarginY;
BOOL fOverlay = (cfg::dat.dwFlags & CLUI_FRAME_OVERLAYICONS);
@@ -565,10 +564,10 @@ set_bg_l:
if (cstatus >= ID_STATUS_OFFLINE && cstatus <= ID_STATUS_OUTTOLUNCH) {
BYTE perstatus_ignored;
- if ((flags & CONTACTF_IDLE) && !StatusItems[ID_EXTBKIDLE - ID_STATUS_OFFLINE].IGNORED)
- sitem = &StatusItems[ID_EXTBKIDLE - ID_STATUS_OFFLINE];
+ if ((flags & CONTACTF_IDLE) && !arStatusItems[ID_EXTBKIDLE - ID_STATUS_OFFLINE]->IGNORED)
+ sitem = arStatusItems[ID_EXTBKIDLE - ID_STATUS_OFFLINE];
else
- sitem = &StatusItems[cstatus - ID_STATUS_OFFLINE];
+ sitem = arStatusItems[cstatus - ID_STATUS_OFFLINE];
if ( !dat->bisEmbedded) {
pp_item = cEntry->status_item ? cEntry->status_item : cEntry->proto_status_item;
@@ -585,15 +584,15 @@ set_bg_l:
else if ( !sitem->IGNORED)
SetTextColor(hdcMem, sitem->TEXTCOLOR);
- sevencontact_pos = &StatusItems[ID_EXTBKEVEN_CNTCTPOS - ID_STATUS_OFFLINE];
- soddcontact_pos = &StatusItems[ID_EXTBKODD_CNTCTPOS - ID_STATUS_OFFLINE];
- sfirstitem = &StatusItems[ID_EXTBKFIRSTITEM - ID_STATUS_OFFLINE];
- ssingleitem = &StatusItems[ID_EXTBKSINGLEITEM - ID_STATUS_OFFLINE];
- slastitem = &StatusItems[ID_EXTBKLASTITEM - ID_STATUS_OFFLINE];
+ sevencontact_pos = arStatusItems[ID_EXTBKEVEN_CNTCTPOS - ID_STATUS_OFFLINE];
+ soddcontact_pos = arStatusItems[ID_EXTBKODD_CNTCTPOS - ID_STATUS_OFFLINE];
+ sfirstitem = arStatusItems[ID_EXTBKFIRSTITEM - ID_STATUS_OFFLINE];
+ ssingleitem = arStatusItems[ID_EXTBKSINGLEITEM - ID_STATUS_OFFLINE];
+ slastitem = arStatusItems[ID_EXTBKLASTITEM - ID_STATUS_OFFLINE];
- sfirstitem_NG = &StatusItems[ID_EXTBKFIRSTITEM_NG - ID_STATUS_OFFLINE];
- ssingleitem_NG = &StatusItems[ID_EXTBKSINGLEITEM_NG - ID_STATUS_OFFLINE];
- slastitem_NG = &StatusItems[ID_EXTBKLASTITEM_NG - ID_STATUS_OFFLINE];
+ sfirstitem_NG = arStatusItems[ID_EXTBKFIRSTITEM_NG - ID_STATUS_OFFLINE];
+ ssingleitem_NG = arStatusItems[ID_EXTBKSINGLEITEM_NG - ID_STATUS_OFFLINE];
+ slastitem_NG = arStatusItems[ID_EXTBKLASTITEM_NG - ID_STATUS_OFFLINE];
rc.left = sitem->MARGIN_LEFT + bg_indent_l;
rc.top = y + sitem->MARGIN_TOP;
@@ -775,9 +774,9 @@ set_bg_l:
}
if (type == CLCIT_GROUP) {
- StatusItems_t *sempty = &StatusItems[ID_EXTBKEMPTYGROUPS - ID_STATUS_OFFLINE];
- StatusItems_t *sexpanded = &StatusItems[ID_EXTBKEXPANDEDGROUP - ID_STATUS_OFFLINE];
- StatusItems_t *scollapsed = &StatusItems[ID_EXTBKCOLLAPSEDDGROUP - ID_STATUS_OFFLINE];
+ StatusItems_t *sempty = arStatusItems[ID_EXTBKEMPTYGROUPS - ID_STATUS_OFFLINE];
+ StatusItems_t *sexpanded = arStatusItems[ID_EXTBKEXPANDEDGROUP - ID_STATUS_OFFLINE];
+ StatusItems_t *scollapsed = arStatusItems[ID_EXTBKCOLLAPSEDDGROUP - ID_STATUS_OFFLINE];
ChangeToFont(hdcMem, dat, FONTID_GROUPS, &fontHeight);
if (contact->group->cl.count == 0) {
@@ -814,7 +813,7 @@ set_bg_l:
}
}
if (selected) {
- StatusItems_t *sselected = &StatusItems[ID_EXTBKSELECTION - ID_STATUS_OFFLINE];
+ StatusItems_t *sselected = arStatusItems[ID_EXTBKSELECTION - ID_STATUS_OFFLINE];
if ( !g_ignoreselforgroups || type != CLCIT_GROUP) {
if ( !sselected->IGNORED) {
@@ -840,7 +839,7 @@ set_bg_l:
}
}
else if (g_hottrack) {
- StatusItems_t *ht = &StatusItems[ID_EXTBKHOTTRACK - ID_STATUS_OFFLINE];
+ StatusItems_t *ht = arStatusItems[ID_EXTBKHOTTRACK - ID_STATUS_OFFLINE];
SetHotTrackColour(hdcMem, dat);
if (ht->IGNORED == 0)
diff --git a/plugins/Clist_nicer/src/clistevents.cpp b/plugins/Clist_nicer/src/clistevents.cpp
index 12449d3adb..63cb6bb9d3 100644
--- a/plugins/Clist_nicer/src/clistevents.cpp
+++ b/plugins/Clist_nicer/src/clistevents.cpp
@@ -32,8 +32,6 @@ extern wndFrame *wndFrameEventArea;
extern HPEN g_hPenCLUIFrames;
-extern StatusItems_t *StatusItems;
-
HWND g_hwndEventArea = 0;
struct CListEvent {
@@ -215,7 +213,7 @@ LRESULT CALLBACK EventAreaWndProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lPa
if (cfg::dat.bWallpaperMode)
SkinDrawBg(hwnd, hdcMem);
- item = &StatusItems[ID_EXTBKEVTAREA - ID_STATUS_OFFLINE];
+ item = arStatusItems[ID_EXTBKEVTAREA - ID_STATUS_OFFLINE];
if (item->IGNORED) {
FillRect(hdcMem, &rc, GetSysColorBrush(COLOR_3DFACE));
}
@@ -299,7 +297,7 @@ struct CListEvent* AddEvent(CLISTEVENT *cle)
mii.dwItemData = (ULONG_PTR) nmi;
mii.wID = cfg::dat.wNextMenuID;
SetMenuItemInfo(cfg::dat.hMenuNotify, cfg::dat.wNextMenuID, FALSE, &mii);
- p-> menuId = cfg::dat.wNextMenuID;
+ p->menuId = cfg::dat.wNextMenuID;
cfg::dat.wNextMenuID++;
if (cfg::dat.wNextMenuID > 0x7fff)
cfg::dat.wNextMenuID = 1;
diff --git a/plugins/Clist_nicer/src/clui.cpp b/plugins/Clist_nicer/src/clui.cpp
index 5da598e932..e371b70a0a 100644
--- a/plugins/Clist_nicer/src/clui.cpp
+++ b/plugins/Clist_nicer/src/clui.cpp
@@ -61,7 +61,6 @@ extern HWND g_hwndViewModeFrame, g_hwndEventArea;
extern ImageItem *g_CLUIImageItem;
extern HBRUSH g_CLUISkinnedBkColor;
-extern StatusItems_t *StatusItems;
extern HWND g_hwndSFL;
extern ButtonItem *g_ButtonItems;
extern COLORREF g_CLUISkinnedBkColorRGB;
@@ -626,7 +625,7 @@ static void sttProcessResize(HWND hwnd, NMCLISTCONTROL *nmc)
if (winstyle & CLS_SKINNEDFRAME) {
BOOL hasTitleBar = wndFrameCLC ? wndFrameCLC->TitleBar.ShowTitleBar : 0;
- StatusItems_t *item = &StatusItems[(hasTitleBar ? ID_EXTBKOWNEDFRAMEBORDERTB : ID_EXTBKOWNEDFRAMEBORDER) - ID_STATUS_OFFLINE];
+ StatusItems_t *item = arStatusItems[(hasTitleBar ? ID_EXTBKOWNEDFRAMEBORDERTB : ID_EXTBKOWNEDFRAMEBORDER) - ID_STATUS_OFFLINE];
skinHeight = item->IGNORED ? 0 : item->MARGIN_BOTTOM + item->MARGIN_TOP;
}
@@ -704,7 +703,7 @@ int CustomDrawScrollBars(NMCSBCUSTOMDRAW *nmcsbcd)
}
uItemID -= ID_STATUS_OFFLINE;
- item = &StatusItems[uItemID];
+ item = arStatusItems[uItemID];
if ( !item->IGNORED) {
int alpha = nmcsbcd->uState == CDIS_DISABLED ? item->ALPHA - 50 : item->ALPHA;
DrawAlpha(hdcScroll, &nmcsbcd->rect, item->COLOR, alpha, item->COLOR2, item->COLOR2_TRANSPARENT,
@@ -715,9 +714,9 @@ int CustomDrawScrollBars(NMCSBCUSTOMDRAW *nmcsbcd)
(nmcsbcd->uState == CDIS_SELECTED ? DFCS_PUSHED : 0)));
if (nmcsbcd->uItem == HTSCROLL_UP)
- arrowItem = &StatusItems[ID_EXTBKSCROLLARROWUP - ID_STATUS_OFFLINE];
+ arrowItem = arStatusItems[ID_EXTBKSCROLLARROWUP - ID_STATUS_OFFLINE];
if (nmcsbcd->uItem == HTSCROLL_DOWN)
- arrowItem = &StatusItems[ID_EXTBKSCROLLARROWDOWN - ID_STATUS_OFFLINE];
+ arrowItem = arStatusItems[ID_EXTBKSCROLLARROWDOWN - ID_STATUS_OFFLINE];
if (arrowItem && !arrowItem->IGNORED)
DrawAlpha(hdcScroll, &nmcsbcd->rect, arrowItem->COLOR, arrowItem->ALPHA, arrowItem->COLOR2, arrowItem->COLOR2_TRANSPARENT,
arrowItem->GRADIENT, arrowItem->CORNER, arrowItem->BORDERSTYLE, arrowItem->imageItem);
diff --git a/plugins/Clist_nicer/src/extBackg.cpp b/plugins/Clist_nicer/src/extBackg.cpp
index 651995a52c..771e36bba0 100644
--- a/plugins/Clist_nicer/src/extBackg.cpp
+++ b/plugins/Clist_nicer/src/extBackg.cpp
@@ -28,7 +28,7 @@ extern int g_hottrack;
extern HWND g_hwndViewModeFrame;
-StatusItems_t *StatusItems = NULL;
+LIST<StatusItems_t> arStatusItems(10);
ImageItem *g_ImageItems = NULL, *g_glyphItem = NULL;
ButtonItem *g_ButtonItems = NULL;
ImageItem *g_CLUIImageItem = NULL;
@@ -243,8 +243,11 @@ static StatusItems_t _StatusItems[] = {
BOOL __forceinline GetItemByStatus(int status, StatusItems_t *retitem)
{
- status = (status >= ID_STATUS_OFFLINE && status <= ID_EXTBK_LAST) ? status : ID_STATUS_OFFLINE; // better check the index...
- *retitem = StatusItems[status - ID_STATUS_OFFLINE];
+ int idx = status - ID_STATUS_OFFLINE; // better check the index...
+ if ( idx < 0 || idx >= arStatusItems.getCount())
+ idx = 0;
+
+ *retitem = *arStatusItems[idx];
if (g_hottrack && status != ID_EXTBKHOTTRACK) // allow hottracking for ignored items, unless hottrack item itself should be ignored
retitem->IGNORED = FALSE;
return TRUE;
@@ -252,14 +255,13 @@ BOOL __forceinline GetItemByStatus(int status, StatusItems_t *retitem)
StatusItems_t *GetProtocolStatusItem(const char *szProto)
{
- int i;
-
if (szProto == NULL)
return NULL;
- for (i = ID_EXTBK_LAST_D - ID_STATUS_OFFLINE + 1; i <= ID_EXTBK_LAST - ID_STATUS_OFFLINE; i++) {
- if ( !strcmp(StatusItems[i].szName[0] == '{' ? &StatusItems[i].szName[3] : StatusItems[i].szName, szProto))
- return &StatusItems[i];
+ for (int i = SIZEOF(_StatusItems); i < arStatusItems.getCount(); i++) {
+ StatusItems_t *p = arStatusItems[i];
+ if ( !strcmp(p->szName[0] == '{' ? p->szName+3 : p->szName, szProto))
+ return p;
}
return NULL;
}
@@ -267,93 +269,61 @@ StatusItems_t *GetProtocolStatusItem(const char *szProto)
// fills the struct with the settings in the database
void LoadExtBkSettingsFromDB()
{
- DWORD ret;
- int n;
- char buffer[255];
- int protoCount = 0, i;
- PROTOACCOUNT **accs = 0;
- DBVARIANT dbv = {0};
+ int i, n;
+ for (i=0; i < SIZEOF(_StatusItems); i++) {
+ StatusItems_t *p = (StatusItems_t*)mir_alloc( sizeof(StatusItems_t));
+ *p = _StatusItems[i];
+ arStatusItems.insert(p);
+ }
+ int protoCount;
+ PROTOACCOUNT **accs;
ProtoEnumAccounts( &protoCount, &accs );
- StatusItems = (StatusItems_t *)malloc(sizeof(StatusItems_t) * ((ID_EXTBK_LAST - ID_STATUS_OFFLINE) + protoCount + 2));
- CopyMemory(StatusItems, _StatusItems, sizeof(_StatusItems));
-
for (i = 0; i < protoCount; i++) {
+ StatusItems_t *p = (StatusItems_t*)mir_alloc( sizeof(StatusItems_t));
+ *p = _StatusItems[0];
ID_EXTBK_LAST++;
- CopyMemory(&StatusItems[ID_EXTBK_LAST - ID_STATUS_OFFLINE], &StatusItems[0], sizeof(StatusItems_t));
- mir_snprintf(StatusItems[ID_EXTBK_LAST - ID_STATUS_OFFLINE].szDBname, 30, "EXBK_%s", accs[i]->szModuleName );
+
+ mir_snprintf(p->szDBname, 30, "EXBK_%s", accs[i]->szModuleName );
if (i == 0) {
- lstrcpynA(StatusItems[ID_EXTBK_LAST - ID_STATUS_OFFLINE].szName, "{-}", 30);
- strncat(StatusItems[ID_EXTBK_LAST - ID_STATUS_OFFLINE].szName, accs[i]->szModuleName, 30);
+ lstrcpynA(p->szName, "{-}", 30);
+ strncat(p->szName, accs[i]->szModuleName, 30);
}
- else
- lstrcpynA(StatusItems[ID_EXTBK_LAST - ID_STATUS_OFFLINE].szName, accs[i]->szModuleName, 30);
- StatusItems[ID_EXTBK_LAST - ID_STATUS_OFFLINE].statusID = ID_EXTBK_LAST;
+ else lstrcpynA(p->szName, accs[i]->szModuleName, 30);
+ p->statusID = ID_EXTBK_LAST;
+ arStatusItems.insert(p);
}
- for (n = 0; n <= ID_EXTBK_LAST - ID_STATUS_OFFLINE; n++) {
- if (StatusItems[n].statusID != ID_EXTBKSEPARATOR) {
- StatusItems[n].imageItem = 0;
- lstrcpyA(buffer, StatusItems[n].szDBname); lstrcatA(buffer, "_IGNORE");
- ret = cfg::getByte("CLCExt", buffer, StatusItems[n].IGNORED);
- StatusItems[n]. IGNORED = (BYTE) ret;
-
- lstrcpyA(buffer, StatusItems[n].szDBname); lstrcatA(buffer, "_GRADIENT");
- ret = cfg::getDword("CLCExt", buffer, StatusItems[n].GRADIENT);
- StatusItems[n]. GRADIENT = (BYTE) ret;
-
- lstrcpyA(buffer, StatusItems[n].szDBname); lstrcatA(buffer, "_CORNER");
- ret = cfg::getDword("CLCExt", buffer, StatusItems[n].CORNER);
- StatusItems[n]. CORNER = (BYTE) ret;
-
- lstrcpyA(buffer, StatusItems[n].szDBname); lstrcatA(buffer, "_COLOR");
- ret = cfg::getDword("CLCExt", buffer, StatusItems[n].COLOR);
- StatusItems[n]. COLOR = ret;
-
- lstrcpyA(buffer, StatusItems[n].szDBname); lstrcatA(buffer, "_COLOR2");
- ret = cfg::getDword(NULL, "CLCExt", buffer, StatusItems[n].COLOR2);
- StatusItems[n]. COLOR2 = ret;
-
- lstrcpyA(buffer, StatusItems[n].szDBname); lstrcatA(buffer, "_COLOR2_TRANSPARENT");
- ret = cfg::getByte("CLCExt", buffer, StatusItems[n].COLOR2_TRANSPARENT);
- StatusItems[n]. COLOR2_TRANSPARENT = (BYTE) ret;
-
- lstrcpyA(buffer, StatusItems[n].szDBname); lstrcatA(buffer, "_TEXTCOLOR");
- ret = cfg::getDword("CLCExt", buffer, StatusItems[n].TEXTCOLOR);
- StatusItems[n]. TEXTCOLOR = ret;
-
- lstrcpyA(buffer, StatusItems[n].szDBname); lstrcatA(buffer, "_ALPHA");
- ret = cfg::getByte("CLCExt", buffer, StatusItems[n].ALPHA);
- StatusItems[n]. ALPHA = ret;
-
- lstrcpyA(buffer, StatusItems[n].szDBname); lstrcatA(buffer, "_MRGN_LEFT");
- ret = cfg::getByte("CLCExt", buffer, StatusItems[n].MARGIN_LEFT);
- StatusItems[n]. MARGIN_LEFT = ret;
-
- lstrcpyA(buffer, StatusItems[n].szDBname); lstrcatA(buffer, "_MRGN_TOP");
- ret = cfg::getByte("CLCExt", buffer, StatusItems[n].MARGIN_TOP);
- StatusItems[n]. MARGIN_TOP = ret;
-
- lstrcpyA(buffer, StatusItems[n].szDBname); lstrcatA(buffer, "_MRGN_RIGHT");
- ret = cfg::getByte("CLCExt", buffer, StatusItems[n].MARGIN_RIGHT);
- StatusItems[n]. MARGIN_RIGHT = ret;
-
- lstrcpyA(buffer, StatusItems[n].szDBname); lstrcatA(buffer, "_MRGN_BOTTOM");
- ret = cfg::getByte("CLCExt", buffer, StatusItems[n].MARGIN_BOTTOM);
- StatusItems[n]. MARGIN_BOTTOM = ret;
-
- lstrcpyA(buffer, StatusItems[n].szDBname); lstrcatA(buffer, "_BDRSTYLE");
- ret = cfg::getDword("CLCExt", buffer, StatusItems[n].BORDERSTYLE);
- StatusItems[n]. BORDERSTYLE = ret;
- }
+
+ for (n = 0; n < arStatusItems.getCount(); n++) {
+ StatusItems_t *p = arStatusItems[n];
+ if (p->statusID == ID_EXTBKSEPARATOR)
+ continue;
+
+ p->imageItem = 0;
+ char buffer[255], *pszEnd = buffer + mir_snprintf(buffer, SIZEOF(buffer), "%s_", p->szDBname);
+ strcpy(pszEnd, "IGNORE"); p->IGNORED = (BYTE)cfg::getByte("CLCExt", buffer, p->IGNORED);
+ strcpy(pszEnd, "GRADIENT"); p->GRADIENT = (BYTE)cfg::getDword("CLCExt", buffer, p->GRADIENT);
+ strcpy(pszEnd, "CORNER"); p->CORNER = (BYTE)cfg::getDword("CLCExt", buffer, p->CORNER);
+ strcpy(pszEnd, "COLOR"); p->COLOR = cfg::getDword("CLCExt", buffer, p->COLOR);
+ strcpy(pszEnd, "COLOR2"); p->COLOR2 = cfg::getDword(NULL, "CLCExt", buffer, p->COLOR2);
+ strcpy(pszEnd, "COLOR2_TRANSPARENT"); p->COLOR2_TRANSPARENT = (BYTE)cfg::getByte("CLCExt", buffer, p->COLOR2_TRANSPARENT);
+ strcpy(pszEnd, "TEXTCOLOR"); p->TEXTCOLOR = cfg::getDword("CLCExt", buffer, p->TEXTCOLOR);
+ strcpy(pszEnd, "ALPHA"); p->ALPHA = cfg::getByte("CLCExt", buffer, p->ALPHA);
+ strcpy(pszEnd, "MRGN_LEFT"); p->MARGIN_LEFT = cfg::getByte("CLCExt", buffer, p->MARGIN_LEFT);
+ strcpy(pszEnd, "MRGN_TOP"); p->MARGIN_TOP = cfg::getByte("CLCExt", buffer, p->MARGIN_TOP);
+ strcpy(pszEnd, "MRGN_RIGHT"); p->MARGIN_RIGHT = cfg::getByte("CLCExt", buffer, p->MARGIN_RIGHT);
+ strcpy(pszEnd, "MRGN_BOTTOM"); p->MARGIN_BOTTOM = cfg::getByte("CLCExt", buffer, p->MARGIN_BOTTOM);
+ strcpy(pszEnd, "BDRSTYLE"); p->BORDERSTYLE = cfg::getDword("CLCExt", buffer, p->BORDERSTYLE);
}
+
if (cfg::dat.bFirstRun) {
- StatusItems_t *item = &StatusItems[ID_EXTBKBUTTONBAR - ID_STATUS_OFFLINE];
+ StatusItems_t *item = arStatusItems[ID_EXTBKBUTTONBAR - ID_STATUS_OFFLINE];
item->COLOR = GetSysColor(COLOR_3DFACE);
item->COLOR2 = GetSysColor(COLOR_3DFACE);
- item = &StatusItems[ID_EXTBKEVTAREA - ID_STATUS_OFFLINE];
+ item = arStatusItems[ID_EXTBKEVTAREA - ID_STATUS_OFFLINE];
item->COLOR = item->COLOR2 = GetSysColor(COLOR_WINDOW);
item->BORDERSTYLE = EDGE_ETCHED;
SaveCompleteStructToDB();
@@ -363,50 +333,27 @@ void LoadExtBkSettingsFromDB()
// writes whole struct to the database
static void SaveCompleteStructToDB(void)
{
- int n;
char buffer[255];
- for (n = 0; n <= ID_EXTBK_LAST - ID_STATUS_OFFLINE; n++) {
- if (StatusItems[n].statusID != ID_EXTBKSEPARATOR) {
- lstrcpyA(buffer, StatusItems[n].szDBname); lstrcatA(buffer, "_IGNORE");
- cfg::writeByte("CLCExt", buffer, StatusItems[n].IGNORED);
-
- lstrcpyA(buffer, StatusItems[n].szDBname); lstrcatA(buffer, "_GRADIENT");
- cfg::writeDword("CLCExt", buffer, StatusItems[n].GRADIENT);
-
- lstrcpyA(buffer, StatusItems[n].szDBname); lstrcatA(buffer, "_CORNER");
- cfg::writeDword("CLCExt", buffer, StatusItems[n].CORNER);
-
- lstrcpyA(buffer, StatusItems[n].szDBname); lstrcatA(buffer, "_COLOR");
- cfg::writeDword("CLCExt", buffer, StatusItems[n].COLOR);
-
- lstrcpyA(buffer, StatusItems[n].szDBname); lstrcatA(buffer, "_COLOR2");
- cfg::writeDword("CLCExt", buffer, StatusItems[n].COLOR2);
-
- lstrcpyA(buffer, StatusItems[n].szDBname); lstrcatA(buffer, "_COLOR2_TRANSPARENT");
- cfg::writeByte("CLCExt", buffer, StatusItems[n].COLOR2_TRANSPARENT);
-
- lstrcpyA(buffer, StatusItems[n].szDBname); lstrcatA(buffer, "_TEXTCOLOR");
- cfg::writeDword("CLCExt", buffer, StatusItems[n].TEXTCOLOR);
-
- lstrcpyA(buffer, StatusItems[n].szDBname); lstrcatA(buffer, "_ALPHA");
- cfg::writeByte("CLCExt", buffer, (BYTE)StatusItems[n].ALPHA);
-
- lstrcpyA(buffer, StatusItems[n].szDBname); lstrcatA(buffer, "_MRGN_LEFT");
- cfg::writeByte("CLCExt", buffer, (BYTE)StatusItems[n].MARGIN_LEFT);
-
- lstrcpyA(buffer, StatusItems[n].szDBname); lstrcatA(buffer, "_MRGN_TOP");
- cfg::writeByte("CLCExt", buffer, (BYTE)StatusItems[n].MARGIN_TOP);
-
- lstrcpyA(buffer, StatusItems[n].szDBname); lstrcatA(buffer, "_MRGN_RIGHT");
- cfg::writeByte("CLCExt", buffer, (BYTE)StatusItems[n].MARGIN_RIGHT);
-
- lstrcpyA(buffer, StatusItems[n].szDBname); lstrcatA(buffer, "_MRGN_BOTTOM");
- cfg::writeByte("CLCExt", buffer, (BYTE)StatusItems[n].MARGIN_BOTTOM);
+ for (int n = 0; n < arStatusItems.getCount(); n++) {
+ StatusItems_t *p = arStatusItems[n];
+ char *pszEnd = buffer + mir_snprintf(buffer, SIZEOF(buffer), "%s_", p->szDBname);
+ if (p->statusID == ID_EXTBKSEPARATOR)
+ continue;
- lstrcpyA(buffer, StatusItems[n].szDBname); lstrcatA(buffer, "_BDRSTYLE");
- cfg::writeDword("CLCExt", buffer, StatusItems[n].BORDERSTYLE);
- }
+ strcpy(pszEnd, "IGNORE"); cfg::writeByte("CLCExt", buffer, p->IGNORED);
+ strcpy(pszEnd, "GRADIENT"); cfg::writeDword("CLCExt", buffer, p->GRADIENT);
+ strcpy(pszEnd, "CORNER"); cfg::writeDword("CLCExt", buffer, p->CORNER);
+ strcpy(pszEnd, "COLOR"); cfg::writeDword("CLCExt", buffer, p->COLOR);
+ strcpy(pszEnd, "COLOR2"); cfg::writeDword("CLCExt", buffer, p->COLOR2);
+ strcpy(pszEnd, "COLOR2_TRANSPARENT"); cfg::writeByte("CLCExt", buffer, p->COLOR2_TRANSPARENT);
+ strcpy(pszEnd, "TEXTCOLOR"); cfg::writeDword("CLCExt", buffer, p->TEXTCOLOR);
+ strcpy(pszEnd, "ALPHA"); cfg::writeByte("CLCExt", buffer, (BYTE)p->ALPHA);
+ strcpy(pszEnd, "MRGN_LEFT"); cfg::writeByte("CLCExt", buffer, (BYTE)p->MARGIN_LEFT);
+ strcpy(pszEnd, "MRGN_TOP"); cfg::writeByte("CLCExt", buffer, (BYTE)p->MARGIN_TOP);
+ strcpy(pszEnd, "MRGN_RIGHT"); cfg::writeByte("CLCExt", buffer, (BYTE)p->MARGIN_RIGHT);
+ strcpy(pszEnd, "MRGN_BOTTOM"); cfg::writeByte("CLCExt", buffer, (BYTE)p->MARGIN_BOTTOM);
+ strcpy(pszEnd, "BDRSTYLE"); cfg::writeDword("CLCExt", buffer, p->BORDERSTYLE);
}
}
@@ -429,7 +376,7 @@ void Reload3dBevelColors()
cfg::dat.hPen3DDark = CreatePen(PS_SOLID, 1, cfg::getDword("CLCExt", "3ddark", GetSysColor(COLOR_3DSHADOW)));
}
-// Save Non-StatusItems Settings
+// Save Non-arStatusItems Settings
void SaveNonStatusItemsSettings(HWND hwndDlg)
{
BOOL translated;
@@ -491,7 +438,7 @@ struct {char *szModule; char *szSetting; unsigned int size; int defaultval;} _ta
void extbk_export(char *file)
{
- int n, i;
+ int i, n;
char buffer[255];
char szSection[255];
char szKey[255];
@@ -501,36 +448,27 @@ void extbk_export(char *file)
data = 3;
WritePrivateProfileStructA("Global", "Version", &data, 4, file);
- for (n = 0; n <= ID_EXTBK_LAST - ID_STATUS_OFFLINE; n++) {
- if (StatusItems[n].statusID != ID_EXTBKSEPARATOR) {
- lstrcpyA(buffer, StatusItems[n].szDBname); lstrcatA(buffer, "_ALPHA");
- WritePrivateProfileStructA("ExtBKSettings", buffer, &(StatusItems[n].ALPHA), sizeof(StatusItems[n].ALPHA), file);
- lstrcpyA(buffer, StatusItems[n].szDBname); lstrcatA(buffer, "_COLOR");
- WritePrivateProfileStructA("ExtBKSettings", buffer, &(StatusItems[n].COLOR), sizeof(StatusItems[n].COLOR), file);
- lstrcpyA(buffer, StatusItems[n].szDBname); lstrcatA(buffer, "_COLOR2");
- WritePrivateProfileStructA("ExtBKSettings", buffer, &(StatusItems[n].COLOR2), sizeof(StatusItems[n].COLOR2), file);
- lstrcpyA(buffer, StatusItems[n].szDBname); lstrcatA(buffer, "_COLOR2_TRANSPARENT");
- WritePrivateProfileStructA("ExtBKSettings", buffer, &(StatusItems[n].COLOR2_TRANSPARENT), sizeof(StatusItems[n].COLOR2_TRANSPARENT), file);
- lstrcpyA(buffer, StatusItems[n].szDBname); lstrcatA(buffer, "_TEXTCOLOR");
- WritePrivateProfileStructA("ExtBKSettings", buffer, &(StatusItems[n].TEXTCOLOR), sizeof(StatusItems[n].TEXTCOLOR), file);
- lstrcpyA(buffer, StatusItems[n].szDBname); lstrcatA(buffer, "_CORNER");
- WritePrivateProfileStructA("ExtBKSettings", buffer, &(StatusItems[n].CORNER), sizeof(StatusItems[n].CORNER), file);
- lstrcpyA(buffer, StatusItems[n].szDBname); lstrcatA(buffer, "_GRADIENT");
- WritePrivateProfileStructA("ExtBKSettings", buffer, &(StatusItems[n].GRADIENT), sizeof(StatusItems[n].GRADIENT), file);
- lstrcpyA(buffer, StatusItems[n].szDBname); lstrcatA(buffer, "_IGNORED");
- WritePrivateProfileStructA("ExtBKSettings", buffer, &(StatusItems[n].IGNORED), sizeof(StatusItems[n].IGNORED), file);
- lstrcpyA(buffer, StatusItems[n].szDBname); lstrcatA(buffer, "_MARGIN_BOTTOM");
- WritePrivateProfileStructA("ExtBKSettings", buffer, &(StatusItems[n].MARGIN_BOTTOM), sizeof(StatusItems[n].MARGIN_BOTTOM), file);
- lstrcpyA(buffer, StatusItems[n].szDBname); lstrcatA(buffer, "_MARGIN_LEFT");
- WritePrivateProfileStructA("ExtBKSettings", buffer, &(StatusItems[n].MARGIN_LEFT), sizeof(StatusItems[n].MARGIN_LEFT), file);
- lstrcpyA(buffer, StatusItems[n].szDBname); lstrcatA(buffer, "_MARGIN_RIGHT");
- WritePrivateProfileStructA("ExtBKSettings", buffer, &(StatusItems[n].MARGIN_RIGHT), sizeof(StatusItems[n].MARGIN_RIGHT), file);
- lstrcpyA(buffer, StatusItems[n].szDBname); lstrcatA(buffer, "_MARGIN_TOP");
- WritePrivateProfileStructA("ExtBKSettings", buffer, &(StatusItems[n].MARGIN_TOP), sizeof(StatusItems[n].MARGIN_TOP), file);
- lstrcpyA(buffer, StatusItems[n].szDBname); lstrcatA(buffer, "_BORDERSTYLE");
- WritePrivateProfileStructA("ExtBKSettings", buffer, &(StatusItems[n].BORDERSTYLE), sizeof(StatusItems[n].BORDERSTYLE), file);
- }
+ for (n = 0; n < arStatusItems.getCount(); n++) {
+ StatusItems_t *p = arStatusItems[n];
+ if (p->statusID == ID_EXTBKSEPARATOR)
+ continue;
+
+ char *pszEnd = buffer + mir_snprintf(buffer, SIZEOF(buffer), "%s_", p->szDBname);
+ strcpy(pszEnd, "ALPHA"); WritePrivateProfileStructA("ExtBKSettings", buffer, &(p->ALPHA), sizeof(p->ALPHA), file);
+ strcpy(pszEnd, "COLOR"); WritePrivateProfileStructA("ExtBKSettings", buffer, &(p->COLOR), sizeof(p->COLOR), file);
+ strcpy(pszEnd, "COLOR2"); WritePrivateProfileStructA("ExtBKSettings", buffer, &(p->COLOR2), sizeof(p->COLOR2), file);
+ strcpy(pszEnd, "COLOR2_TRANSPARENT"); WritePrivateProfileStructA("ExtBKSettings", buffer, &(p->COLOR2_TRANSPARENT), sizeof(p->COLOR2_TRANSPARENT), file);
+ strcpy(pszEnd, "TEXTCOLOR"); WritePrivateProfileStructA("ExtBKSettings", buffer, &(p->TEXTCOLOR), sizeof(p->TEXTCOLOR), file);
+ strcpy(pszEnd, "CORNER"); WritePrivateProfileStructA("ExtBKSettings", buffer, &(p->CORNER), sizeof(p->CORNER), file);
+ strcpy(pszEnd, "GRADIENT"); WritePrivateProfileStructA("ExtBKSettings", buffer, &(p->GRADIENT), sizeof(p->GRADIENT), file);
+ strcpy(pszEnd, "IGNORED"); WritePrivateProfileStructA("ExtBKSettings", buffer, &(p->IGNORED), sizeof(p->IGNORED), file);
+ strcpy(pszEnd, "MARGIN_BOTTOM"); WritePrivateProfileStructA("ExtBKSettings", buffer, &(p->MARGIN_BOTTOM), sizeof(p->MARGIN_BOTTOM), file);
+ strcpy(pszEnd, "MARGIN_LEFT"); WritePrivateProfileStructA("ExtBKSettings", buffer, &(p->MARGIN_LEFT), sizeof(p->MARGIN_LEFT), file);
+ strcpy(pszEnd, "MARGIN_RIGHT"); WritePrivateProfileStructA("ExtBKSettings", buffer, &(p->MARGIN_RIGHT), sizeof(p->MARGIN_RIGHT), file);
+ strcpy(pszEnd, "MARGIN_TOP"); WritePrivateProfileStructA("ExtBKSettings", buffer, &(p->MARGIN_TOP), sizeof(p->MARGIN_TOP), file);
+ strcpy(pszEnd, "BORDERSTYLE"); WritePrivateProfileStructA("ExtBKSettings", buffer, &(p->BORDERSTYLE), sizeof(p->BORDERSTYLE), file);
}
+
for (n = 0; n <= FONTID_LAST; n++) {
mir_snprintf(szSection, 255, "Font%d", n);
@@ -563,6 +501,7 @@ void extbk_export(char *file)
data = (DWORD)cfg::getWord("CLC", szKey, 8);
WritePrivateProfileStructA(szSection, "SameAs", &data, 2, file);
}
+
i = 0;
while(_tagSettings[i].szModule != NULL) {
data = 0;
@@ -580,6 +519,7 @@ void extbk_export(char *file)
WritePrivateProfileStructA("Global", _tagSettings[i].szSetting, &data, _tagSettings[i].size, file);
i++;
}
+
if ( !cfg::getString(NULL, "CLC", "BkBitmap", &dbv)) {
WritePrivateProfileStringA("Global", "BkBitmap", dbv.pszVal, file);
DBFreeVariant(&dbv);
@@ -603,7 +543,6 @@ static StatusItems_t default_item = {
CLCDEFAULT_MRGN_BOTTOM, CLCDEFAULT_IGNORE
};
-
static void PreMultiply(HBITMAP hBitmap, int mode)
{
BYTE *p = NULL;
@@ -752,15 +691,15 @@ static void ReadItem(StatusItems_t *this_item, char *szItem, char *file)
if (strcmp(buffer, "None")) {
- int i;
-
- for (i = 0; i <= ID_EXTBK_LAST - ID_STATUS_OFFLINE; i++) {
- if ( !_stricmp(StatusItems[i].szName[0] == '{' ? &StatusItems[i].szName[3] : StatusItems[i].szName, buffer)) {
- defaults = &StatusItems[i];
+ for (int i = 0; i < arStatusItems.getCount(); i++) {
+ StatusItems_t *p = arStatusItems[i];
+ if ( !_stricmp(p->szName[0] == '{' ? p->szName+3 : p->szName, buffer)) {
+ defaults = p;
break;
}
}
}
+
this_item->ALPHA = (int)GetPrivateProfileIntA(szItem, "Alpha", defaults->ALPHA, file);
this_item->ALPHA = min(this_item->ALPHA, 100);
@@ -945,8 +884,9 @@ done_with_glyph:
}
continue;
}
- for (i = 0; i <= ID_EXTBK_LAST - ID_STATUS_OFFLINE; i++) {
- if ( !_stricmp(StatusItems[i].szName[0] == '{' ? &StatusItems[i].szName[3] : StatusItems[i].szName, buffer)) {
+ for (i = 0; i < arStatusItems.getCount(); i++) {
+ StatusItems_t *p = arStatusItems[i];
+ if ( !_stricmp(p->szName[0] == '{' ? p->szName+3 : p->szName, buffer)) {
if ( !alloced) {
if ( !(tmpItem.dwFlags & IMAGE_GLYPH))
IMG_CreateItem(&tmpItem, szFinalName, hdc);
@@ -954,7 +894,7 @@ done_with_glyph:
newItem = reinterpret_cast<ImageItem *>(malloc(sizeof(ImageItem)));
ZeroMemory(newItem, sizeof(ImageItem));
*newItem = tmpItem;
- StatusItems[i].imageItem = newItem;
+ p->imageItem = newItem;
if (g_ImageItems == NULL)
g_ImageItems = newItem;
else {
@@ -968,7 +908,7 @@ done_with_glyph:
}
}
else if (newItem != NULL)
- StatusItems[i].imageItem = newItem;
+ p->imageItem = newItem;
}
}
}
@@ -1011,8 +951,8 @@ void IMG_DeleteItems()
}
g_glyphItem = NULL;
- for (i = 0; i <= ID_EXTBK_LAST - ID_STATUS_OFFLINE; i++)
- StatusItems[i].imageItem = NULL;
+ for (i = 0; i < arStatusItems.getCount(); i++)
+ arStatusItems[i]->imageItem = NULL;
}
static UINT nextButtonID = IDC_TBFIRSTUID;
@@ -1034,7 +974,7 @@ static void BTN_ReadItem(char *itemName, char *file)
GetPrivateProfileStringA(itemName, "Pressed", "None", szBuffer, 1000, file);
if ( !_stricmp(szBuffer, "default"))
- tmpItem.imgPressed = StatusItems[ID_EXTBKTBBUTTONSPRESSED - ID_STATUS_OFFLINE].imageItem;
+ tmpItem.imgPressed = arStatusItems[ID_EXTBKTBBUTTONSPRESSED - ID_STATUS_OFFLINE]->imageItem;
else {
while(imgItem) {
if ( !_stricmp(imgItem->szName, szBuffer)) {
@@ -1048,7 +988,7 @@ static void BTN_ReadItem(char *itemName, char *file)
imgItem = g_ImageItems;
GetPrivateProfileStringA(itemName, "Normal", "None", szBuffer, 1000, file);
if ( !_stricmp(szBuffer, "default"))
- tmpItem.imgNormal = StatusItems[ID_EXTBKTBBUTTONSNPRESSED - ID_STATUS_OFFLINE].imageItem;
+ tmpItem.imgNormal = arStatusItems[ID_EXTBKTBBUTTONSNPRESSED - ID_STATUS_OFFLINE]->imageItem;
else {
while(imgItem) {
if ( !_stricmp(imgItem->szName, szBuffer)) {
@@ -1062,7 +1002,7 @@ static void BTN_ReadItem(char *itemName, char *file)
imgItem = g_ImageItems;
GetPrivateProfileStringA(itemName, "Hover", "None", szBuffer, 1000, file);
if ( !_stricmp(szBuffer, "default"))
- tmpItem.imgHover = StatusItems[ID_EXTBKTBBUTTONMOUSEOVER - ID_STATUS_OFFLINE].imageItem;
+ tmpItem.imgHover = arStatusItems[ID_EXTBKTBBUTTONMOUSEOVER - ID_STATUS_OFFLINE]->imageItem;
else {
while(imgItem) {
if ( !_stricmp(imgItem->szName, szBuffer)) {
@@ -1392,35 +1332,25 @@ void extbk_import(char *file, HWND hwndDlg)
char szKey[255], szSection[255];
DWORD data, version = 0;
- for (n = 0; n <= ID_EXTBK_LAST - ID_STATUS_OFFLINE; n++) {
- if (StatusItems[n].statusID != ID_EXTBKSEPARATOR) {
- lstrcpyA(buffer, StatusItems[n].szDBname); lstrcatA(buffer, "_ALPHA");
- GetPrivateProfileStructA("ExtBKSettings", buffer, &(StatusItems[n].ALPHA), sizeof(StatusItems[n].ALPHA), file);
- lstrcpyA(buffer, StatusItems[n].szDBname); lstrcatA(buffer, "_COLOR");
- GetPrivateProfileStructA("ExtBKSettings", buffer, &(StatusItems[n].COLOR), sizeof(StatusItems[n].COLOR), file);
- lstrcpyA(buffer, StatusItems[n].szDBname); lstrcatA(buffer, "_COLOR2");
- GetPrivateProfileStructA("ExtBKSettings", buffer, &(StatusItems[n].COLOR2), sizeof(StatusItems[n].COLOR2), file);
- lstrcpyA(buffer, StatusItems[n].szDBname); lstrcatA(buffer, "_COLOR2_TRANSPARENT");
- GetPrivateProfileStructA("ExtBKSettings", buffer, &(StatusItems[n].COLOR2_TRANSPARENT), sizeof(StatusItems[n].COLOR2_TRANSPARENT), file);
- lstrcpyA(buffer, StatusItems[n].szDBname); lstrcatA(buffer, "_TEXTCOLOR");
- GetPrivateProfileStructA("ExtBKSettings", buffer, &(StatusItems[n].TEXTCOLOR), sizeof(StatusItems[n].TEXTCOLOR), file);
- lstrcpyA(buffer, StatusItems[n].szDBname); lstrcatA(buffer, "_CORNER");
- GetPrivateProfileStructA("ExtBKSettings", buffer, &(StatusItems[n].CORNER), sizeof(StatusItems[n].CORNER), file);
- lstrcpyA(buffer, StatusItems[n].szDBname); lstrcatA(buffer, "_GRADIENT");
- GetPrivateProfileStructA("ExtBKSettings", buffer, &(StatusItems[n].GRADIENT), sizeof(StatusItems[n].GRADIENT), file);
- lstrcpyA(buffer, StatusItems[n].szDBname); lstrcatA(buffer, "_IGNORED");
- GetPrivateProfileStructA("ExtBKSettings", buffer, &(StatusItems[n].IGNORED), sizeof(StatusItems[n].IGNORED), file);
- lstrcpyA(buffer, StatusItems[n].szDBname); lstrcatA(buffer, "_MARGIN_BOTTOM");
- GetPrivateProfileStructA("ExtBKSettings", buffer, &(StatusItems[n].MARGIN_BOTTOM), sizeof(StatusItems[n].MARGIN_BOTTOM), file);
- lstrcpyA(buffer, StatusItems[n].szDBname); lstrcatA(buffer, "_MARGIN_LEFT");
- GetPrivateProfileStructA("ExtBKSettings", buffer, &(StatusItems[n].MARGIN_LEFT), sizeof(StatusItems[n].MARGIN_LEFT), file);
- lstrcpyA(buffer, StatusItems[n].szDBname); lstrcatA(buffer, "_MARGIN_RIGHT");
- GetPrivateProfileStructA("ExtBKSettings", buffer, &(StatusItems[n].MARGIN_RIGHT), sizeof(StatusItems[n].MARGIN_RIGHT), file);
- lstrcpyA(buffer, StatusItems[n].szDBname); lstrcatA(buffer, "_MARGIN_TOP");
- GetPrivateProfileStructA("ExtBKSettings", buffer, &(StatusItems[n].MARGIN_TOP), sizeof(StatusItems[n].MARGIN_TOP), file);
- lstrcpyA(buffer, StatusItems[n].szDBname); lstrcatA(buffer, "_BORDERSTYLE");
- GetPrivateProfileStructA("ExtBKSettings", buffer, &(StatusItems[n].BORDERSTYLE), sizeof(StatusItems[n].BORDERSTYLE), file);
- }
+ for (n = 0; n < arStatusItems.getCount(); n++) {
+ StatusItems_t *p = arStatusItems[n];
+ if (p->statusID == ID_EXTBKSEPARATOR)
+ continue;
+
+ char *pszEnd = buffer + mir_snprintf(buffer, SIZEOF(buffer), "%s_", p->szDBname);
+ strcpy(pszEnd, "ALPHA"); GetPrivateProfileStructA("ExtBKSettings", buffer, &(p->ALPHA), sizeof(p->ALPHA), file);
+ strcpy(pszEnd, "COLOR"); GetPrivateProfileStructA("ExtBKSettings", buffer, &(p->COLOR), sizeof(p->COLOR), file);
+ strcpy(pszEnd, "COLOR2"); GetPrivateProfileStructA("ExtBKSettings", buffer, &(p->COLOR2), sizeof(p->COLOR2), file);
+ strcpy(pszEnd, "COLOR2_TRANSPARENT"); GetPrivateProfileStructA("ExtBKSettings", buffer, &(p->COLOR2_TRANSPARENT), sizeof(p->COLOR2_TRANSPARENT), file);
+ strcpy(pszEnd, "TEXTCOLOR"); GetPrivateProfileStructA("ExtBKSettings", buffer, &(p->TEXTCOLOR), sizeof(p->TEXTCOLOR), file);
+ strcpy(pszEnd, "CORNER"); GetPrivateProfileStructA("ExtBKSettings", buffer, &(p->CORNER), sizeof(p->CORNER), file);
+ strcpy(pszEnd, "GRADIENT"); GetPrivateProfileStructA("ExtBKSettings", buffer, &(p->GRADIENT), sizeof(p->GRADIENT), file);
+ strcpy(pszEnd, "IGNORED"); GetPrivateProfileStructA("ExtBKSettings", buffer, &(p->IGNORED), sizeof(p->IGNORED), file);
+ strcpy(pszEnd, "MARGIN_BOTTOM"); GetPrivateProfileStructA("ExtBKSettings", buffer, &(p->MARGIN_BOTTOM), sizeof(p->MARGIN_BOTTOM), file);
+ strcpy(pszEnd, "MARGIN_LEFT"); GetPrivateProfileStructA("ExtBKSettings", buffer, &(p->MARGIN_LEFT), sizeof(p->MARGIN_LEFT), file);
+ strcpy(pszEnd, "MARGIN_RIGHT"); GetPrivateProfileStructA("ExtBKSettings", buffer, &(p->MARGIN_RIGHT), sizeof(p->MARGIN_RIGHT), file);
+ strcpy(pszEnd, "MARGIN_TOP"); GetPrivateProfileStructA("ExtBKSettings", buffer, &(p->MARGIN_TOP), sizeof(p->MARGIN_TOP), file);
+ strcpy(pszEnd, "BORDERSTYLE"); GetPrivateProfileStructA("ExtBKSettings", buffer, &(p->BORDERSTYLE), sizeof(p->BORDERSTYLE), file);
}
data = 0;
@@ -1663,18 +1593,17 @@ INT_PTR CALLBACK OptionsDlgProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lPara
static int iInit = TRUE;
static HWND hwndSkinEdit = 0;
- switch(msg)
- {
+ switch(msg) {
case WM_INITDIALOG:
+ TranslateDialogDefault(hwnd);
{
- TCITEM tci;
- RECT rcClient;
int oPage = cfg::getByte("CLUI", "opage", 0);
- SKINDESCRIPTION sd;
- TranslateDialogDefault(hwnd);
+ RECT rcClient;
GetClientRect(hwnd, &rcClient);
iInit = TRUE;
+
+ TCITEM tci;
tci.mask = TCIF_PARAM|TCIF_TEXT;
tci.lParam = (LPARAM)CreateDialog(g_hInst,MAKEINTRESOURCE(IDD_OPT_SKIN), hwnd, DlgProcSkinOpts);
tci.pszText = TranslateT("Load and apply");
@@ -1684,14 +1613,14 @@ INT_PTR CALLBACK OptionsDlgProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lPara
if (IS_THEMED)
API::pfnEnableThemeDialogTexture((HWND)tci.lParam, ETDT_ENABLETAB);
- if (ServiceExists(MS_CLNSE_INVOKE)) {
- ZeroMemory(&sd, sizeof(sd));
+ if ( ServiceExists(MS_CLNSE_INVOKE)) {
+ SKINDESCRIPTION sd = { 0 };
sd.cbSize = sizeof(sd);
- sd.StatusItems = StatusItems;
+ sd.StatusItems = arStatusItems.getArray();
sd.hWndParent = hwnd;
sd.hWndTab = GetDlgItem(hwnd, IDC_OPTIONSTAB);
sd.pfnSaveCompleteStruct = SaveCompleteStructToDB;
- sd.lastItem = ID_EXTBK_LAST;
+ sd.lastItem = ID_STATUS_OFFLINE + arStatusItems.getCount() + 1;
sd.firstItem = ID_STATUS_OFFLINE;
sd.pfnClcOptionsChanged = pcli->pfnClcOptionsChanged;
sd.hwndCLUI = pcli->hwndContactList;
@@ -1816,24 +1745,24 @@ int CoolSB_SetupScrollBar()
* and no item is set to ignored
*/
- cfg::dat.bSkinnedScrollbar = !StatusItems[ID_EXTBKSCROLLBACK - ID_STATUS_OFFLINE].IGNORED &&
- !StatusItems[ID_EXTBKSCROLLBACKLOWER - ID_STATUS_OFFLINE].IGNORED &&
- !StatusItems[ID_EXTBKSCROLLTHUMB - ID_STATUS_OFFLINE].IGNORED &&
- !StatusItems[ID_EXTBKSCROLLTHUMBHOVER - ID_STATUS_OFFLINE].IGNORED &&
- !StatusItems[ID_EXTBKSCROLLTHUMBPRESSED - ID_STATUS_OFFLINE].IGNORED &&
- !StatusItems[ID_EXTBKSCROLLBUTTON - ID_STATUS_OFFLINE].IGNORED &&
- !StatusItems[ID_EXTBKSCROLLBUTTONHOVER - ID_STATUS_OFFLINE].IGNORED &&
- !StatusItems[ID_EXTBKSCROLLBUTTONPRESSED - ID_STATUS_OFFLINE].IGNORED;
-
-
- if ( !StatusItems[ID_EXTBKSCROLLBACK - ID_STATUS_OFFLINE].imageItem ||
- !StatusItems[ID_EXTBKSCROLLBACKLOWER - ID_STATUS_OFFLINE].imageItem ||
- !StatusItems[ID_EXTBKSCROLLTHUMB - ID_STATUS_OFFLINE].imageItem ||
- !StatusItems[ID_EXTBKSCROLLTHUMBHOVER - ID_STATUS_OFFLINE].imageItem ||
- !StatusItems[ID_EXTBKSCROLLTHUMBPRESSED - ID_STATUS_OFFLINE].imageItem ||
- !StatusItems[ID_EXTBKSCROLLBUTTON - ID_STATUS_OFFLINE].imageItem ||
- !StatusItems[ID_EXTBKSCROLLBUTTONHOVER - ID_STATUS_OFFLINE].imageItem ||
- !StatusItems[ID_EXTBKSCROLLBUTTONPRESSED - ID_STATUS_OFFLINE].imageItem)
+ cfg::dat.bSkinnedScrollbar = !arStatusItems[ID_EXTBKSCROLLBACK - ID_STATUS_OFFLINE]->IGNORED &&
+ !arStatusItems[ID_EXTBKSCROLLBACKLOWER - ID_STATUS_OFFLINE]->IGNORED &&
+ !arStatusItems[ID_EXTBKSCROLLTHUMB - ID_STATUS_OFFLINE]->IGNORED &&
+ !arStatusItems[ID_EXTBKSCROLLTHUMBHOVER - ID_STATUS_OFFLINE]->IGNORED &&
+ !arStatusItems[ID_EXTBKSCROLLTHUMBPRESSED - ID_STATUS_OFFLINE]->IGNORED &&
+ !arStatusItems[ID_EXTBKSCROLLBUTTON - ID_STATUS_OFFLINE]->IGNORED &&
+ !arStatusItems[ID_EXTBKSCROLLBUTTONHOVER - ID_STATUS_OFFLINE]->IGNORED &&
+ !arStatusItems[ID_EXTBKSCROLLBUTTONPRESSED - ID_STATUS_OFFLINE]->IGNORED;
+
+
+ if ( !arStatusItems[ID_EXTBKSCROLLBACK - ID_STATUS_OFFLINE]->imageItem ||
+ !arStatusItems[ID_EXTBKSCROLLBACKLOWER - ID_STATUS_OFFLINE]->imageItem ||
+ !arStatusItems[ID_EXTBKSCROLLTHUMB - ID_STATUS_OFFLINE]->imageItem ||
+ !arStatusItems[ID_EXTBKSCROLLTHUMBHOVER - ID_STATUS_OFFLINE]->imageItem ||
+ !arStatusItems[ID_EXTBKSCROLLTHUMBPRESSED - ID_STATUS_OFFLINE]->imageItem ||
+ !arStatusItems[ID_EXTBKSCROLLBUTTON - ID_STATUS_OFFLINE]->imageItem ||
+ !arStatusItems[ID_EXTBKSCROLLBUTTONHOVER - ID_STATUS_OFFLINE]->imageItem ||
+ !arStatusItems[ID_EXTBKSCROLLBUTTONPRESSED - ID_STATUS_OFFLINE]->imageItem)
cfg::dat.bSkinnedScrollbar = FALSE;
diff --git a/plugins/Clist_nicer/src/statusbar.cpp b/plugins/Clist_nicer/src/statusbar.cpp
index 936f1f0b92..82c5a5e2e6 100644
--- a/plugins/Clist_nicer/src/statusbar.cpp
+++ b/plugins/Clist_nicer/src/statusbar.cpp
@@ -29,7 +29,6 @@ static POINT ptMouse = {0};
static RECT rcMouse = {0};
static int timer_set = 0, tooltip_active = 0;
extern HANDLE hStatusBarShowToolTipEvent, hStatusBarHideToolTipEvent;
-extern StatusItems_t *StatusItems;
extern HBRUSH g_CLUISkinnedBkColor;
extern HANDLE (WINAPI *MyOpenThemeData)(HWND, LPCWSTR);
@@ -85,7 +84,7 @@ LRESULT CALLBACK NewStatusBarWndProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM
break;
case WM_PAINT:
- if (cfg::shutDown || !StatusItems)
+ if (cfg::shutDown || arStatusItems.getCount() == 0)
return 0;
if (cfg::dat.bSkinnedStatusBar) {
@@ -114,7 +113,7 @@ LRESULT CALLBACK NewStatusBarWndProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM
SetBkMode(hdcMem, TRANSPARENT);
hOldFont = reinterpret_cast<HFONT>(SelectObject(hdcMem, GetStockObject(DEFAULT_GUI_FONT)));
BitBlt(hdcMem, 0, 0, rcClient.right, rcClient.bottom, cfg::dat.hdcBg, pt.x, pt.y, SRCCOPY);
- item = &StatusItems[ID_EXTBKSTATUSBAR - ID_STATUS_OFFLINE];
+ item = arStatusItems[ID_EXTBKSTATUSBAR - ID_STATUS_OFFLINE];
if ( !item->IGNORED) {
RECT rc = rcClient;
rc.left += item->MARGIN_LEFT;
diff --git a/plugins/Clist_nicer/src/statusfloater.cpp b/plugins/Clist_nicer/src/statusfloater.cpp
index f605bc1329..751e9f29d6 100644
--- a/plugins/Clist_nicer/src/statusfloater.cpp
+++ b/plugins/Clist_nicer/src/statusfloater.cpp
@@ -58,8 +58,6 @@ BOOL tooltip = FALSE;
UINT_PTR hTooltipTimer = 0;
POINT start_pos;
-
-extern StatusItems_t *StatusItems;
extern int g_padding_y;
extern HIMAGELIST hCListImages;
@@ -765,7 +763,7 @@ void SFL_Update(HICON hIcon, int iIcon, HIMAGELIST hIml, const TCHAR *szText, BO
SIZE szDest, szT;
BLENDFUNCTION bf = {0};
HFONT hOldFont;
- StatusItems_t *item = &StatusItems[ID_EXTBKSTATUSFLOATER - ID_STATUS_OFFLINE];
+ StatusItems_t *item = arStatusItems[ID_EXTBKSTATUSFLOATER - ID_STATUS_OFFLINE];
RECT rcStatusArea;
LONG cy;