diff options
author | George Hazan <george.hazan@gmail.com> | 2012-07-05 22:41:06 +0000 |
---|---|---|
committer | George Hazan <george.hazan@gmail.com> | 2012-07-05 22:41:06 +0000 |
commit | e3cefc7b6ca803e3f87dbadae54a110332778490 (patch) | |
tree | 0ee41f14f962f946c9e64fae4a11fbcb197af853 /plugins/Clist_nicer | |
parent | f0fb070eab8f276e66c0154363656045bc0dadb3 (diff) |
- first of the /Core standard plugins;
- code cleaning
git-svn-id: http://svn.miranda-ng.org/main/trunk@778 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'plugins/Clist_nicer')
-rw-r--r-- | plugins/Clist_nicer/SRC/clc.cpp | 12 | ||||
-rw-r--r-- | plugins/Clist_nicer/SRC/clcpaint.cpp | 24 | ||||
-rw-r--r-- | plugins/Clist_nicer/SRC/clui.cpp | 1 | ||||
-rw-r--r-- | plugins/Clist_nicer/SRC/init.cpp | 65 | ||||
-rw-r--r-- | plugins/Clist_nicer/SRC/statusbar.cpp | 2 |
5 files changed, 48 insertions, 56 deletions
diff --git a/plugins/Clist_nicer/SRC/clc.cpp b/plugins/Clist_nicer/SRC/clc.cpp index 17af82664b..9a7d81a66b 100644 --- a/plugins/Clist_nicer/SRC/clc.cpp +++ b/plugins/Clist_nicer/SRC/clc.cpp @@ -186,11 +186,6 @@ static int ClcSettingChanged(WPARAM wParam, LPARAM lParam) return 0;
}
-static int ClcModulesLoaded(WPARAM wParam, LPARAM lParam)
-{
- return 0;
-}
-
static int ClcPreshutdown(WPARAM wParam, LPARAM lParam)
{
SFL_Destroy();
@@ -218,13 +213,11 @@ int ClcShutdown(WPARAM wParam, LPARAM lParam) DeleteObject(cfg::dat.hBrushColorKey);
DeleteObject(cfg::dat.hBrushCLCBk);
DeleteObject(cfg::dat.hBrushAvatarBorder);
- DestroyMenu(cfg::dat.hMenuNotify);
+ DestroyMenu(cfg::dat.hMenuNotify);
ClearIcons(1);
SFL_UnregisterWindowClass();
if (cfg::eCache) {
- int i;
-
- for (i = 0; i < cfg::nextCacheEntry; i++) {
+ for (int i = 0; i < cfg::nextCacheEntry; i++) {
if (cfg::eCache[i].statusMsg)
free(cfg::eCache[i].statusMsg);
if (cfg::eCache[i].status_item) {
@@ -255,7 +248,6 @@ int LoadCLCModule(void) hCListImages = (HIMAGELIST) CallService(MS_CLIST_GETICONSIMAGELIST, 0, 0);
- HookEvent(ME_SYSTEM_MODULESLOADED, ClcModulesLoaded);
hClcSettingsChanged = HookEvent(ME_DB_CONTACT_SETTINGCHANGED, ClcSettingChanged);
hClcDBEvent = HookEvent(ME_DB_EVENT_ADDED, ClcEventAdded);
HookEvent(ME_OPT_INITIALISE, ClcOptInit);
diff --git a/plugins/Clist_nicer/SRC/clcpaint.cpp b/plugins/Clist_nicer/SRC/clcpaint.cpp index 8844972745..c9b11d07b3 100644 --- a/plugins/Clist_nicer/SRC/clcpaint.cpp +++ b/plugins/Clist_nicer/SRC/clcpaint.cpp @@ -1387,22 +1387,22 @@ void PaintClc(HWND hwnd, struct ClcData *dat, HDC hdc, RECT *rcPaint) my_status = GetGeneralisedStatus();
g_HDC = hdc;
- /*
- * temporary DC for avatar drawing
- */
+ /*
+ * temporary DC for avatar drawing
+ */
- g_padding_y = 0;
+ g_padding_y = 0;
- hdcTempAV = CreateCompatibleDC(g_HDC);
- hdcAV = CreateCompatibleDC(g_HDC);
- hbmTempAV = CreateCompatibleBitmap(g_HDC, g_maxAV_X, g_maxAV_Y);
- hbmTempOldAV = reinterpret_cast<HBITMAP>(SelectObject(hdcTempAV, hbmTempAV));
+ hdcTempAV = CreateCompatibleDC(g_HDC);
+ hdcAV = CreateCompatibleDC(g_HDC);
+ hbmTempAV = CreateCompatibleBitmap(g_HDC, g_maxAV_X, g_maxAV_Y);
+ hbmTempOldAV = reinterpret_cast<HBITMAP>(SelectObject(hdcTempAV, hbmTempAV));
- cfg::dat.t_now = time(NULL);
+ cfg::dat.t_now = time(NULL);
GetSystemTime(&cfg::dat.st);
SystemTimeToFileTime(&cfg::dat.st, &cfg::dat.ft);
- cfg::dat.bUseFastGradients = cfg::dat.bWantFastGradients && (API::pfnGradientFill != 0);
+ cfg::dat.bUseFastGradients = cfg::dat.bWantFastGradients && (API::pfnGradientFill != 0);
av_left = (cfg::dat.dwFlags & CLUI_FRAME_AVATARSLEFT);
av_right = (cfg::dat.dwFlags & CLUI_FRAME_AVATARSRIGHT);
@@ -1581,8 +1581,8 @@ bgdone: }
line_num++;
- if(cfg::dat.bForceRefetchOnPaint)
- group->cl.items[group->scanIndex]->ace = (struct avatarCacheEntry*)-1;
+ if(cfg::dat.bForceRefetchOnPaint)
+ group->cl.items[group->scanIndex]->ace = (struct avatarCacheEntry*)-1;
if (y > rcPaint->top - dat->row_heights[line_num] && y <= rcPaint->bottom) {
if (group->cl.items[group->scanIndex]->ace == (struct avatarCacheEntry*)-1 )
diff --git a/plugins/Clist_nicer/SRC/clui.cpp b/plugins/Clist_nicer/SRC/clui.cpp index e4009d6feb..366e503c76 100644 --- a/plugins/Clist_nicer/SRC/clui.cpp +++ b/plugins/Clist_nicer/SRC/clui.cpp @@ -2066,6 +2066,7 @@ void LoadCLUIModule(void) HookEvent(ME_MC_SUBCONTACTSCHANGED, MetaChanged);
InitGroupMenus();
+ LoadExtBkSettingsFromDB();
wndclass.style = 0;
wndclass.lpfnWndProc = EventAreaWndProc;
diff --git a/plugins/Clist_nicer/SRC/init.cpp b/plugins/Clist_nicer/SRC/init.cpp index 0454d0d36a..16a33bfc66 100644 --- a/plugins/Clist_nicer/SRC/init.cpp +++ b/plugins/Clist_nicer/SRC/init.cpp @@ -205,7 +205,6 @@ static int systemModulesLoaded(WPARAM wParam, LPARAM lParam) ZeroMemory((void *)overlayicons, sizeof(HICON) * 10);
CLN_LoadAllIcons(1);
- LoadExtBkSettingsFromDB();
return 0;
}
@@ -240,38 +239,38 @@ extern "C" int __declspec(dllexport) CListInitialise() cfg::maxCacheEntry = iCount;
cfg::init();
- cfg::dat.hMenuNotify = CreatePopupMenu();
- cfg::dat.wNextMenuID = 1;
- cfg::dat.sortTimer = cfg::getDword("CLC", "SortTimer", 150);
- cfg::dat.szNoEvents = TranslateTS(szNoevents);
- cfg::dat.avatarBorder = (COLORREF)cfg::getDword("CLC", "avatarborder", 0);
- cfg::dat.avatarRadius = (COLORREF)cfg::getDword("CLC", "avatarradius", 4);
- cfg::dat.hBrushAvatarBorder = CreateSolidBrush(cfg::dat.avatarBorder);
- cfg::dat.avatarSize = cfg::getWord("CList", "AvatarSize", 24);
- cfg::dat.dualRowMode = cfg::getByte("CLC", "DualRowMode", 0);
- cfg::dat.avatarPadding = cfg::getByte("CList", "AvatarPadding", 0);
- cfg::dat.isTransparent = cfg::getByte("CList", "Transparent", 0);
- cfg::dat.alpha = cfg::getByte("CList", "Alpha", SETTING_ALPHA_DEFAULT);
- cfg::dat.autoalpha = cfg::getByte("CList", "AutoAlpha", SETTING_ALPHA_DEFAULT);
- cfg::dat.fadeinout = cfg::getByte("CLUI", "FadeInOut", 0);
- cfg::dat.autosize = cfg::getByte("CLUI", "AutoSize", 0);
- cfg::dat.dwExtraImageMask = cfg::getDword("CLUI", "ximgmask", 0);
- cfg::dat.bNoOfflineAvatars = cfg::getByte("CList", "NoOfflineAV", 1);
- cfg::dat.bFullTransparent = cfg::getByte("CLUI", "fulltransparent", 0);
- cfg::dat.bDblClkAvatars = cfg::getByte("CLC", "dblclkav", 0);
- cfg::dat.bEqualSections = cfg::getByte("CLUI", "EqualSections", 0);
- cfg::dat.bCenterStatusIcons = cfg::getByte("CLC", "si_centered", 1);
- cfg::dat.boldHideOffline = -1;
- cfg::dat.bSecIMAvail = ServiceExists("SecureIM/IsContactSecured") ? 1 : 0;
- cfg::dat.bNoTrayTips = cfg::getByte("CList", "NoTrayTips", 0);
- cfg::dat.bShowLocalTime = cfg::getByte("CLC", "ShowLocalTime", 1);
- cfg::dat.bShowLocalTimeSelective = cfg::getByte("CLC", "SelectiveLocalTime", 1);
- cfg::dat.bDontSeparateOffline = cfg::getByte("CList", "DontSeparateOffline", 0);
- cfg::dat.bShowXStatusOnSbar = cfg::getByte("CLUI", "xstatus_sbar", 0);
- cfg::dat.bLayeredHack = cfg::getByte("CLUI", "layeredhack", 1);
- cfg::dat.bFirstRun = cfg::getByte("CLUI", "firstrun", 1);
- cfg::dat.langPackCP = CallService(MS_LANGPACK_GETCODEPAGE, 0, 0);
- cfg::dat.realTimeSaving = cfg::getByte("CLUI", "save_pos_always", 0);
+ cfg::dat.hMenuNotify = CreatePopupMenu();
+ cfg::dat.wNextMenuID = 1;
+ cfg::dat.sortTimer = cfg::getDword("CLC", "SortTimer", 150);
+ cfg::dat.szNoEvents = TranslateTS(szNoevents);
+ cfg::dat.avatarBorder = (COLORREF)cfg::getDword("CLC", "avatarborder", 0);
+ cfg::dat.avatarRadius = (COLORREF)cfg::getDword("CLC", "avatarradius", 4);
+ cfg::dat.hBrushAvatarBorder = CreateSolidBrush(cfg::dat.avatarBorder);
+ cfg::dat.avatarSize = cfg::getWord("CList", "AvatarSize", 24);
+ cfg::dat.dualRowMode = cfg::getByte("CLC", "DualRowMode", 0);
+ cfg::dat.avatarPadding = cfg::getByte("CList", "AvatarPadding", 0);
+ cfg::dat.isTransparent = cfg::getByte("CList", "Transparent", 0);
+ cfg::dat.alpha = cfg::getByte("CList", "Alpha", SETTING_ALPHA_DEFAULT);
+ cfg::dat.autoalpha = cfg::getByte("CList", "AutoAlpha", SETTING_ALPHA_DEFAULT);
+ cfg::dat.fadeinout = cfg::getByte("CLUI", "FadeInOut", 0);
+ cfg::dat.autosize = cfg::getByte("CLUI", "AutoSize", 0);
+ cfg::dat.dwExtraImageMask = cfg::getDword("CLUI", "ximgmask", 0);
+ cfg::dat.bNoOfflineAvatars = cfg::getByte("CList", "NoOfflineAV", 1);
+ cfg::dat.bFullTransparent = cfg::getByte("CLUI", "fulltransparent", 0);
+ cfg::dat.bDblClkAvatars = cfg::getByte("CLC", "dblclkav", 0);
+ cfg::dat.bEqualSections = cfg::getByte("CLUI", "EqualSections", 0);
+ cfg::dat.bCenterStatusIcons = cfg::getByte("CLC", "si_centered", 1);
+ cfg::dat.boldHideOffline = -1;
+ cfg::dat.bSecIMAvail = ServiceExists("SecureIM/IsContactSecured") ? 1 : 0;
+ cfg::dat.bNoTrayTips = cfg::getByte("CList", "NoTrayTips", 0);
+ cfg::dat.bShowLocalTime = cfg::getByte("CLC", "ShowLocalTime", 1);
+ cfg::dat.bShowLocalTimeSelective = cfg::getByte("CLC", "SelectiveLocalTime", 1);
+ cfg::dat.bDontSeparateOffline = cfg::getByte("CList", "DontSeparateOffline", 0);
+ cfg::dat.bShowXStatusOnSbar = cfg::getByte("CLUI", "xstatus_sbar", 0);
+ cfg::dat.bLayeredHack = cfg::getByte("CLUI", "layeredhack", 1);
+ cfg::dat.bFirstRun = cfg::getByte("CLUI", "firstrun", 1);
+ cfg::dat.langPackCP = CallService(MS_LANGPACK_GETCODEPAGE, 0, 0);
+ cfg::dat.realTimeSaving = cfg::getByte("CLUI", "save_pos_always", 0);
DWORD sortOrder = cfg::getDword("CList", "SortOrder", SORTBY_NAME);
cfg::dat.sortOrder[0] = LOBYTE(LOWORD(sortOrder));
diff --git a/plugins/Clist_nicer/SRC/statusbar.cpp b/plugins/Clist_nicer/SRC/statusbar.cpp index 8d130cd866..09036b2ed7 100644 --- a/plugins/Clist_nicer/SRC/statusbar.cpp +++ b/plugins/Clist_nicer/SRC/statusbar.cpp @@ -83,7 +83,7 @@ LRESULT CALLBACK NewStatusBarWndProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM break;
case WM_PAINT:
- if(cfg::shutDown)
+ if(cfg::shutDown || !StatusItems)
return 0;
if(cfg::dat.bSkinnedStatusBar) {
|