diff options
-rw-r--r-- | plugins/Clist_modern/src/hdr/modern_static_clui.h | 92 | ||||
-rw-r--r-- | plugins/Clist_modern/src/modern_clui.cpp | 101 |
2 files changed, 96 insertions, 97 deletions
diff --git a/plugins/Clist_modern/src/hdr/modern_static_clui.h b/plugins/Clist_modern/src/hdr/modern_static_clui.h index 844d172c7c..357f3967e9 100644 --- a/plugins/Clist_modern/src/hdr/modern_static_clui.h +++ b/plugins/Clist_modern/src/hdr/modern_static_clui.h @@ -94,25 +94,6 @@ void RowHeight_InitModernRow(); int UnhookAll(); -/* Global variables */ - -UINT g_dwMainThreadID = 0; -HANDLE g_hAwayMsgThread = 0, g_hGetTextAsyncThread = 0, g_hSmoothAnimationThread = 0; - -HMENU g_hMenuMain; -BOOL g_bTransparentFlag=FALSE; - -BOOL g_mutex_bChangingMode=FALSE, - g_mutex_bSizing=FALSE; - -BOOL g_flag_bOnModulesLoadedCalled=FALSE; - -RECT g_rcEdgeSizingRect={0}; - -BOOL (WINAPI *g_proc_SetLayeredWindowAttributes)(HWND,COLORREF,BYTE,DWORD); -BOOL (WINAPI *g_proc_SetLayeredWindowAttributesNew)(HWND,COLORREF,BYTE,DWORD); -BOOL (WINAPI *g_proc_AnimateWindow)(HWND hWnd,DWORD dwTime,DWORD dwFlags); - /* Module function prototypes */ int CLUI_IsInMainWindow(HWND hwnd); @@ -141,49 +122,6 @@ typedef struct tagCHECKFILLING RECT rcRect; } CHECKFILLING; -/* Module global variables */ - -static BYTE bAlphaEnd; -static BYTE bOldHideOffline; -static BYTE bOldUseGroups; - -static WORD wBehindEdgeShowDelay, - wBehindEdgeHideDelay, - wBehindEdgeBorderSize; - -static BOOL mutex_bAnimationInProgress=FALSE, - mutex_bShowHideCalledFromAnimation=FALSE, - mutex_bIgnoreActivation=FALSE, - mutex_bDisableAutoUpdate=TRUE, - mutex_bDuringSizing=FALSE, - mutex_bDelayedSizing=FALSE; //TBC is it need? - -static BOOL flag_bFirstTimeCall=FALSE; - -static BOOL bTransparentFocus=TRUE, - bNeedFixSizingRect=FALSE, - bShowEventStarted=FALSE; - -static HGENMENU hRenameMenuItem, hShowAvatarMenuItem, hHideAvatarMenuItem; - -static UINT uMsgGetProfile=0; - -static int nLastRequiredHeight=0, - nRequiredHeight=0, - nMirMenuState=0, - nStatusMenuState=0; - -static RECT rcNewWindowRect={0}, - rcOldWindowRect ={0}, - rcSizingRect={0}, - rcCorrectSizeRect={0}; - -static HANDLE hFrameContactTree; - -static PROTOTICKS CycleStartTick[64]={0};//max 64 protocols - -static int nAnimatedIconStep=100; - int CheckFramesPos(RECT *wr); //cluiframes.c int CLUIFrames_ApplyNewSizes(int mode); //cluiframes.c int CLUIFrames_GetTotalHeight(); //cluiframes.c @@ -196,33 +134,3 @@ int InitSkinHotKeys(); BOOL amWakeThread(); BOOL gtaWakeThread(); void CreateViewModeFrame(); - -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} -}; - -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} -}; diff --git a/plugins/Clist_modern/src/modern_clui.cpp b/plugins/Clist_modern/src/modern_clui.cpp index cea7571750..ec9a5673ea 100644 --- a/plugins/Clist_modern/src/modern_clui.cpp +++ b/plugins/Clist_modern/src/modern_clui.cpp @@ -45,6 +45,95 @@ void DestroyTrayMenu(HMENU hMenu); #include <crtdbg.h>
#endif
+/* Global variables */ + +UINT g_dwMainThreadID = 0; +HANDLE g_hAwayMsgThread = 0, g_hGetTextAsyncThread = 0, g_hSmoothAnimationThread = 0; + +HMENU g_hMenuMain; +BOOL g_bTransparentFlag = FALSE; + +BOOL g_mutex_bChangingMode = FALSE, g_mutex_bSizing = FALSE; + +BOOL g_flag_bOnModulesLoadedCalled = FALSE; + +RECT g_rcEdgeSizingRect={0}; + +BOOL (WINAPI *g_proc_SetLayeredWindowAttributesNew)(HWND,COLORREF,BYTE,DWORD); +
+/* Module global variables */ + +static BYTE bAlphaEnd; +static BYTE bOldHideOffline; +static BYTE bOldUseGroups; + +static WORD wBehindEdgeShowDelay, + wBehindEdgeHideDelay, + wBehindEdgeBorderSize; + +static BOOL mutex_bAnimationInProgress=FALSE, + mutex_bShowHideCalledFromAnimation=FALSE, + mutex_bIgnoreActivation=FALSE, + mutex_bDisableAutoUpdate=TRUE, + mutex_bDuringSizing=FALSE, + mutex_bDelayedSizing=FALSE; //TBC is it need? + +static BOOL flag_bFirstTimeCall=FALSE; + +static BOOL bTransparentFocus=TRUE, + bNeedFixSizingRect=FALSE, + bShowEventStarted=FALSE; + +static HGENMENU hRenameMenuItem, hShowAvatarMenuItem, hHideAvatarMenuItem; + +static UINT uMsgGetProfile=0; + +static int nLastRequiredHeight=0, + nRequiredHeight=0, + nMirMenuState=0, + nStatusMenuState=0; + +static RECT rcNewWindowRect={0}, + rcOldWindowRect ={0}, + rcSizingRect={0}, + rcCorrectSizeRect={0}; + +static HANDLE hFrameContactTree; + +static PROTOTICKS CycleStartTick[64]={0};//max 64 protocols + +static int nAnimatedIconStep=100; +
+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} +}; + +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} +}; +
//////////////// CLUI CLASS IMPLEMENTATION /////////////////////////////////
#include "hdr/modern_clui.h"
@@ -249,7 +338,6 @@ HRESULT CLUI::LoadDllsRuntime() if (m_hUserDll) {
g_proc_UpdateLayeredWindow = (BOOL (WINAPI *)(HWND,HDC,POINT*,SIZE*,HDC,POINT*,COLORREF,BLENDFUNCTION*,DWORD))GetProcAddress(m_hUserDll, "UpdateLayeredWindow");
g_proc_SetLayeredWindowAttributesNew = (BOOL (WINAPI *)(HWND,COLORREF,BYTE,DWORD))GetProcAddress(m_hUserDll, "SetLayeredWindowAttributes");
- g_proc_AnimateWindow = (BOOL (WINAPI*)(HWND,DWORD,DWORD))GetProcAddress(m_hUserDll,"AnimateWindow");
g_CluiData.fLayered = (g_proc_UpdateLayeredWindow != NULL) && !db_get_b(NULL,"ModernData","DisableEngine", SETTING_DISABLESKIN_DEFAULT);
g_CluiData.fSmoothAnimation = IsWinVer2000Plus() && db_get_b(NULL, "CLUI", "FadeInOut", SETTING_FADEIN_DEFAULT);
@@ -1278,7 +1366,6 @@ int CLUI_TestCursorOnBorders() if (g_bTransparentFlag) {
if ( !bTransparentFocus && gf != hwnd) {
CLUI_SmoothAlphaTransition(hwnd, db_get_b(NULL,"CList","Alpha",SETTING_ALPHA_DEFAULT), 1);
- //g_proc_SetLayeredWindowAttributes(hwnd, RGB(0, 0, 0), (BYTE)db_get_b(NULL,"CList","Alpha",SETTING_ALPHA_DEFAULT), LWA_ALPHA);
bTransparentFocus = 1;
CLUI_SafeSetTimer(hwnd, TM_AUTOALPHA,250, NULL);
}
@@ -2654,9 +2741,13 @@ LRESULT CLUI::OnDestroy(UINT msg, WPARAM wParam, LPARAM lParam) while (CLUI_WaitThreadsCompletion(m_hWnd)); //stop all my threads
TRACE("CLUI.c: WM_DESTROY - WaitThreadsCompletion DONE\n");
- for (int i=0; i < 64; i++)
- if (CycleStartTick[i].szProto)
- mir_free_and_nil(CycleStartTick[i].szProto);
+ for (int i=0; i < 64; i++) {
+ PROTOTICKS &p = CycleStartTick[i];
+ if (p.szProto)
+ mir_free_and_nil(p.szProto);
+ if (p.himlIconList)
+ ImageList_Destroy(p.himlIconList);
+ }
if (state == SETTING_STATE_NORMAL)
CLUI_ShowWindowMod(m_hWnd,SW_HIDE);
|