1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
|
/*
* astyle --force-indent=tab=4 --brackets=linux --indent-switches
* --pad=oper --one-line=keep-blocks --unpad=paren
*
* Miranda IM: the free IM client for Microsoft* Windows*
*
* Copyright 2000-2010 Miranda ICQ/IM project,
* all portions of this codebase are copyrighted to the people
* listed in contributors.txt.
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* you should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*
* part of clist_nicer plugin for Miranda.
*
* (C) 2005-2010 by silvercircle _at_ gmail _dot_ com and contributors
*
* $Id$
*
*/
#ifndef __CLUI_H_
#define __CLUI_H_
#define TM_AUTOALPHA 1
#define TIMERID_AUTOSIZE 100
#define MENU_MIRANDAMENU 0xFFFF1234
#define EXICON_COUNT 11
struct TCluiData {
DWORD dwFlags;
int soundsOff;
BYTE bMetaAvail;
BYTE bAvatarServiceAvail, tabSRMM_Avail;
HICON hIconVisible, hIconInvisible, hIconChatactive, hIconConnecting;
int notifyActive;
int hIconNotify;
HMENU hMenuNotify;
int iLastEventAdded;
int wNextMenuID;
MCONTACT hUpdateContact;
wchar_t* szNoEvents;
BOOL forceResize;
COLORREF avatarBorder;
HBRUSH hBrushAvatarBorder;
HBRUSH hBrushCLCBk, hBrushCLCGroupsBk;
int avatarSize;
BOOL bForceRefetchOnPaint;
BYTE dualRowMode;
BYTE avatarPadding;
BYTE isTransparent;
BYTE alpha, autoalpha;
BYTE fadeinout;
BYTE autosize;
BYTE gapBetweenFrames;
BYTE titleBarHeight;
DWORD dwExtraImageMask;
BYTE bRowSpacing;
HDC hdcBg;
HBITMAP hbmBg, hbmBgOld;
SIZE dcSize;
POINT ptW;
BOOL bNoOfflineAvatars;
BOOL bEventAreaEnabled;
BOOL bDblClkAvatars;
BOOL bApplyIndentToBg;
BOOL bEqualSections;
DWORD bFilterEffective;
BOOL bCenterStatusIcons;
BOOL bUsePerProto;
BOOL bOverridePerStatusColors;
BOOL bDontSeparateOffline;
wchar_t groupFilter[2048];
char protoFilter[2048];
DWORD lastMsgFilter;
char current_viewmode[256], old_viewmode[256];
BYTE boldHideOffline;
DWORD statusMaskFilter;
DWORD stickyMaskFilter;
DWORD filterFlags;
COLORREF colorkey;
char szMetaName[256];
BOOL bMetaEnabled;
BOOL bNoTrayTips;
int exIconScale;
BOOL bShowLocalTime;
BOOL bShowLocalTimeSelective;
BYTE bSkinnedButtonMode;
BYTE bFirstRun;
BYTE bUseDCMirroring;
BYTE bUseFloater;
SIZE szOldCTreeSize;
BYTE sortOrder[3];
BYTE bGroupAlign;
BYTE bSkinnedScrollbar;
DWORD langPackCP;
int group_padding;
DWORD t_now;
BYTE exIconOrder[EXICON_COUNT];
BOOL realTimeSaving;
FILETIME ft;
SYSTEMTIME st;
};
class CLUI
{
public:
static void Tweak_It (const COLORREF clr);
static void layoutButtons (HWND hwnd, RECT *rc);
static HWND preCreateCLC (HWND parent);
static int createCLC (HWND parent);
static void loadModule (void);
static int modulesLoaded (WPARAM wParam, LPARAM lParam);
static LRESULT CALLBACK wndProc (HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam);
static void configureGeometry (int mode);
static void reloadExtraIcons ();
static void loadExtraIconModule ();
static void removeFromTaskBar (HWND hWnd);
static void addToTaskBar (HWND hWnd);
static DWORD getWindowStyle (BYTE style);
static void applyBorderStyle ();
static LRESULT CALLBACK eventAreaWndProc (HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam);
static void setFrameButtonStates (MCONTACT hPassedContact);
static void Show (HWND hwnd);
static void setButtonStates (HWND hwnd);
static void configureWindowLayout ();
static void hideShowNotifyFrame ();
static void configureEventArea (HWND hwnd);
static void updateLayers ();
static void setLayeredAttributes (COLORREF clr, BYTE alpha, DWORD flags);
static inline void Redraw ();
static HPEN hPenFrames;
static int fading_active;
static bool fInSizing;
static LRESULT (CALLBACK* saveContactListWndProc ) (HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam);
static WNDPROC OldStatusBarProc;
static RECT newRect, rcWPC, cluiPos;
static UPDATELAYEREDWINDOWINFO ulwInfo;
static BLENDFUNCTION bf;
static HIMAGELIST hExtraImages;
static TImageItem* bgImageItem, *bgImageItem_nonAero, *bgClientItem;
static TButtonItem* buttonItems;
#ifdef _USE_D2D
static ID2D1HwndRenderTarget* renderTarget;
#endif
};
void CLUI::Redraw()
{
RedrawWindow(pcli->hwndContactList, NULL, NULL, RDW_INVALIDATE | RDW_ERASE | RDW_FRAME | RDW_UPDATENOW | RDW_ALLCHILDREN);
}
int MTG_OnmodulesLoad (WPARAM wParam,LPARAM lParam);
void InitGroupMenus ();
#endif /* __CLUI_H_ */
|