summaryrefslogtreecommitdiff
path: root/plugins/Clist_modern/src/modern_static_cluiframes_service.h
blob: 8f74e844d531e5090c7bd4319d3c966bf53b605e (plain)
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
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
//////////////////////////////////////////////////////////////////////////
// WARNING
//////////////////////////////////////////////////////////////////////////
// TO BE INCLUDED ONLY TO modern_cluiframes.cpp
//////////////////////////////////////////////////////////////////////////

#pragma once

static int _us_DoSetFramePaintProc(WPARAM wParam, LPARAM lParam);
static int _us_DoAddFrame(WPARAM wParam, LPARAM lParam);
static int _us_DoRemoveFrame(WPARAM wParam, LPARAM lParam);
static int _us_DoSetFrameOptions(WPARAM wParam, LPARAM lParam);
static INT_PTR _us_DoGetFrameOptions(WPARAM wParam, LPARAM lParam);
static int _us_DoUpdateFrame(WPARAM wParam, LPARAM lParam);
static int _us_DoShowHideFrameTitle(WPARAM wParam, LPARAM lParam);
static int _us_DoShowTitles(WPARAM wParam, LPARAM lParam);
static int _us_DoHideTitles(WPARAM wParam, LPARAM lParam);
static int _us_DoShowHideFrame(WPARAM wParam, LPARAM lParam);
static int _us_DoShowAllFrames(WPARAM wParam, LPARAM lParam);
static int _us_DoLockFrame(WPARAM wParam, LPARAM lParam);
static int _us_DoCollapseFrame(WPARAM wParam, LPARAM lParam);
static int _us_DoSetFrameBorder(WPARAM wParam, LPARAM lParam);
static int _us_DoSetFrameAlign(WPARAM wParam, LPARAM lParam);
static int _us_DoMoveFrame(WPARAM wParam, LPARAM lParam);
static int _us_DoMoveFrameUp(WPARAM wParam, LPARAM lParam);
static int _us_DoMoveFrameDown(WPARAM wParam, LPARAM lParam);
static int _us_DoAlignFrameTop(WPARAM wParam, LPARAM lParam);
static int _us_DoAlignFrameClient(WPARAM wParam, LPARAM lParam);
static int _us_DoAlignFrameBottom(WPARAM wParam, LPARAM lParam);
static int _us_DoSetFrameFloat(WPARAM wParam, LPARAM lParam);

enum {
	CFM_FIRST_MGS = WM_USER + 0x2FF,

	CFM_SETFRAMEPAINTPROC,
	CFM_ADDFRAME,
	CFM_REMOVEFRAME,
	CFM_SETFRAMEOPTIONS,
	CFM_GETFRAMEOPTIONS,
	CFM_UPDATEFRAME,
	CFM_SHOWHIDEFRAMETITLE,
	CFM_SHOWTITLES,
	CFM_HIDETITLES,
	CFM_SHOWHIDEFRAME,
	CFM_SHOWALL,
	CFM_LOCKFRAME,
	CFM_COLLAPSEFRAME,
	CFM_SETFRAMEBORDER,
	CFM_SETFRAMEALIGN,
	CFM_MOVEFRAME,
	CFM_MOVEFRAMEUP,
	CFM_MOVEFRAMEDOWN,
	CFM_ALIGNFRAMETOP,
	CFM_ALIGNFRAMEBOTTOM,
	CFM_ALIGNFRAMECLIENT,
	CFM_SETFRAMEFLOAT,

	CFM_LAST_MSG
};

#define CLM_PROCESS( msg, proc ) case msg: result = proc( wParam, lParam); break;

BOOL CALLBACK ProcessCLUIFrameInternalMsg(HWND, UINT msg, WPARAM wParam, LPARAM lParam, LRESULT& result)
{
	if (msg <= CFM_FIRST_MGS || msg >= CFM_LAST_MSG)
		return FALSE;

	switch (msg) {
		CLM_PROCESS(CFM_SETFRAMEPAINTPROC, _us_DoSetFramePaintProc);
		CLM_PROCESS(CFM_ADDFRAME, _us_DoAddFrame);
		CLM_PROCESS(CFM_REMOVEFRAME, _us_DoRemoveFrame);
		CLM_PROCESS(CFM_SETFRAMEOPTIONS, _us_DoSetFrameOptions);
		CLM_PROCESS(CFM_GETFRAMEOPTIONS, _us_DoGetFrameOptions);
		CLM_PROCESS(CFM_UPDATEFRAME, _us_DoUpdateFrame);
		CLM_PROCESS(CFM_SHOWHIDEFRAMETITLE, _us_DoShowHideFrameTitle);
		CLM_PROCESS(CFM_SHOWTITLES, _us_DoShowTitles);
		CLM_PROCESS(CFM_HIDETITLES, _us_DoHideTitles);
		CLM_PROCESS(CFM_SHOWHIDEFRAME, _us_DoShowHideFrame);
		CLM_PROCESS(CFM_SHOWALL, _us_DoShowAllFrames);
		CLM_PROCESS(CFM_LOCKFRAME, _us_DoLockFrame);
		CLM_PROCESS(CFM_COLLAPSEFRAME, _us_DoCollapseFrame);
		CLM_PROCESS(CFM_SETFRAMEBORDER, _us_DoSetFrameBorder);
		CLM_PROCESS(CFM_SETFRAMEALIGN, _us_DoSetFrameAlign);
		CLM_PROCESS(CFM_MOVEFRAME, _us_DoMoveFrame);
		CLM_PROCESS(CFM_MOVEFRAMEUP, _us_DoMoveFrameUp);
		CLM_PROCESS(CFM_MOVEFRAMEDOWN, _us_DoMoveFrameDown);
		CLM_PROCESS(CFM_ALIGNFRAMETOP, _us_DoAlignFrameTop);
		CLM_PROCESS(CFM_ALIGNFRAMEBOTTOM, _us_DoAlignFrameClient);
		CLM_PROCESS(CFM_ALIGNFRAMECLIENT, _us_DoAlignFrameBottom);
		CLM_PROCESS(CFM_SETFRAMEFLOAT, _us_DoSetFrameFloat);
	default:
		return FALSE;   // Not Handled
	}
	return TRUE;
}

static INT_PTR CLUIFrames_SetFramePaintProc(WPARAM wParam, LPARAM lParam)
{
	return (g_clistApi.hwndContactList) ? SendMessage(g_clistApi.hwndContactList, CFM_SETFRAMEPAINTPROC, wParam, lParam) : 0;
}

static INT_PTR CLUIFrames_AddFrame(WPARAM wParam, LPARAM lParam)
{
	return (g_clistApi.hwndContactList) ? SendMessage(g_clistApi.hwndContactList, CFM_ADDFRAME, wParam, lParam) : 0;
}

static INT_PTR CLUIFrames_RemoveFrame(WPARAM wParam, LPARAM lParam)
{
	return (g_clistApi.hwndContactList) ? SendMessage(g_clistApi.hwndContactList, CFM_REMOVEFRAME, wParam, lParam) : 0;
}

static INT_PTR CLUIFrames_SetFrameOptions(WPARAM wParam, LPARAM lParam)
{
	return (g_clistApi.hwndContactList) ? SendMessage(g_clistApi.hwndContactList, CFM_SETFRAMEOPTIONS, wParam, lParam) : 0;
}

static INT_PTR CLUIFrames_GetFrameOptions(WPARAM wParam, LPARAM lParam)
{
	return (g_clistApi.hwndContactList) ? SendMessage(g_clistApi.hwndContactList, CFM_GETFRAMEOPTIONS, wParam, lParam) : 0;
}

static INT_PTR CLUIFrames_UpdateFrame(WPARAM wParam, LPARAM lParam)
{
	return (g_clistApi.hwndContactList) ? SendMessage(g_clistApi.hwndContactList, CFM_UPDATEFRAME, wParam, lParam) : 0;
}

static INT_PTR CLUIFrames_ShowHideFrameTitle(WPARAM wParam, LPARAM lParam)
{
	return (g_clistApi.hwndContactList) ? SendMessage(g_clistApi.hwndContactList, CFM_SHOWHIDEFRAMETITLE, wParam, lParam) : 0;
}

static INT_PTR CLUIFrames_ShowTitles(WPARAM wParam, LPARAM lParam)
{
	return (g_clistApi.hwndContactList) ? SendMessage(g_clistApi.hwndContactList, CFM_SHOWTITLES, wParam, lParam) : 0;
}

static INT_PTR CLUIFrames_HideTitles(WPARAM wParam, LPARAM lParam)
{
	return (g_clistApi.hwndContactList) ? SendMessage(g_clistApi.hwndContactList, CFM_HIDETITLES, wParam, lParam) : 0;
}

static INT_PTR CLUIFrames_ShowHideFrame(WPARAM wParam, LPARAM lParam)
{
	return (g_clistApi.hwndContactList) ? SendMessage(g_clistApi.hwndContactList, CFM_SHOWHIDEFRAME, wParam, lParam) : 0;
}

static INT_PTR CLUIFrames_ShowAllFrames(WPARAM wParam, LPARAM lParam)
{
	return (g_clistApi.hwndContactList) ? SendMessage(g_clistApi.hwndContactList, CFM_SHOWALL, wParam, lParam) : 0;
}

static INT_PTR CLUIFrames_LockFrame(WPARAM wParam, LPARAM lParam)
{
	return (g_clistApi.hwndContactList) ? SendMessage(g_clistApi.hwndContactList, CFM_LOCKFRAME, wParam, lParam) : 0;
}

static INT_PTR CLUIFrames_CollapseFrame(WPARAM wParam, LPARAM lParam)
{
	return (g_clistApi.hwndContactList) ? SendMessage(g_clistApi.hwndContactList, CFM_COLLAPSEFRAME, wParam, lParam) : 0;
}

static INT_PTR CLUIFrames_SetFrameBorder(WPARAM wParam, LPARAM lParam)
{
	return (g_clistApi.hwndContactList) ? SendMessage(g_clistApi.hwndContactList, CFM_SETFRAMEBORDER, wParam, lParam) : 0;
}

static INT_PTR CLUIFrames_SetFrameAlign(WPARAM wParam, LPARAM lParam)
{
	return (g_clistApi.hwndContactList) ? SendMessage(g_clistApi.hwndContactList, CFM_SETFRAMEALIGN, wParam, lParam) : 0;
}

static INT_PTR CLUIFrames_MoveFrame(WPARAM wParam, LPARAM lParam)
{
	return (g_clistApi.hwndContactList) ? SendMessage(g_clistApi.hwndContactList, CFM_MOVEFRAME, wParam, lParam) : 0;
}

static INT_PTR CLUIFrames_MoveFrameUp(WPARAM wParam, LPARAM lParam)
{
	return (g_clistApi.hwndContactList) ? SendMessage(g_clistApi.hwndContactList, CFM_MOVEFRAMEUP, wParam, lParam) : 0;
}

static INT_PTR CLUIFrames_MoveFrameDown(WPARAM wParam, LPARAM lParam)
{
	return (g_clistApi.hwndContactList) ? SendMessage(g_clistApi.hwndContactList, CFM_MOVEFRAMEDOWN, wParam, lParam) : 0;
}

static INT_PTR CLUIFrames_AlignFrameTop(WPARAM wParam, LPARAM lParam)
{
	return (g_clistApi.hwndContactList) ? SendMessage(g_clistApi.hwndContactList, CFM_ALIGNFRAMETOP, wParam, lParam) : 0;
}

static INT_PTR CLUIFrames_AlignFrameClient(WPARAM wParam, LPARAM lParam)
{
	return (g_clistApi.hwndContactList) ? SendMessage(g_clistApi.hwndContactList, CFM_ALIGNFRAMEBOTTOM, wParam, lParam) : 0;
}

static INT_PTR CLUIFrames_AlignFrameBottom(WPARAM wParam, LPARAM lParam)
{
	return (g_clistApi.hwndContactList) ? SendMessage(g_clistApi.hwndContactList, CFM_ALIGNFRAMECLIENT, wParam, lParam) : 0;
}

static INT_PTR CLUIFrames_SetFrameFloat(WPARAM wParam, LPARAM lParam)
{
	return (g_clistApi.hwndContactList) ? SendMessage(g_clistApi.hwndContactList, CFM_SETFRAMEFLOAT, wParam, lParam) : 0;
}

static void CreateCluiFramesServices()
{
	CreateServiceFunction(MS_SKINENG_REGISTERPAINTSUB, CLUIFrames_SetFramePaintProc);
	CreateServiceFunction(MS_CLIST_FRAMES_ADDFRAME, CLUIFrames_AddFrame);
	CreateServiceFunction(MS_CLIST_FRAMES_REMOVEFRAME, CLUIFrames_RemoveFrame);

	CreateServiceFunction(MS_CLIST_FRAMES_SETFRAMEOPTIONS, CLUIFrames_SetFrameOptions);
	CreateServiceFunction(MS_CLIST_FRAMES_GETFRAMEOPTIONS, CLUIFrames_GetFrameOptions);
	CreateServiceFunction(MS_CLIST_FRAMES_UPDATEFRAME, CLUIFrames_UpdateFrame);

	CreateServiceFunction(MS_CLIST_FRAMES_SHFRAMETITLEBAR, CLUIFrames_ShowHideFrameTitle);
	CreateServiceFunction(MS_CLIST_FRAMES_SHOWALLFRAMESTB, CLUIFrames_ShowTitles);
	CreateServiceFunction(MS_CLIST_FRAMES_HIDEALLFRAMESTB, CLUIFrames_HideTitles);
	CreateServiceFunction(MS_CLIST_FRAMES_SHFRAME, CLUIFrames_ShowHideFrame);
	CreateServiceFunction(MS_CLIST_FRAMES_SHOWALLFRAMES, CLUIFrames_ShowAllFrames);

	CreateServiceFunction(MS_CLIST_FRAMES_ULFRAME, CLUIFrames_LockFrame);
	CreateServiceFunction(MS_CLIST_FRAMES_UCOLLFRAME, CLUIFrames_CollapseFrame);
	CreateServiceFunction(MS_CLIST_FRAMES_SETUNBORDER, CLUIFrames_SetFrameBorder);

	CreateServiceFunction(CLUIFRAMESSETALIGN, CLUIFrames_SetFrameAlign);
	CreateServiceFunction(CLUIFRAMESMOVEUPDOWN, CLUIFrames_MoveFrame);
	CreateServiceFunction(CLUIFRAMESMOVEUP, CLUIFrames_MoveFrameUp);
	CreateServiceFunction(CLUIFRAMESMOVEDOWN, CLUIFrames_MoveFrameDown);

	CreateServiceFunction(CLUIFRAMESSETALIGNALTOP, CLUIFrames_AlignFrameTop);
	CreateServiceFunction(CLUIFRAMESSETALIGNALCLIENT, CLUIFrames_AlignFrameClient);
	CreateServiceFunction(CLUIFRAMESSETALIGNALBOTTOM, CLUIFrames_AlignFrameBottom);

	CreateServiceFunction(CLUIFRAMESSETFLOATING, CLUIFrames_SetFrameFloat);
}