summaryrefslogtreecommitdiff
path: root/plugins/FloatingContacts/src/fltcont.h
blob: c4e98ab4984da09890e0077e478cf6b5527e2fab (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

#ifndef __FLTCONT_H__
#define __FLTCONT_H__

#pragma once

/////////////////////////////////////////////////////////////////////////////
//

#define WND_CLASS					_T("MirandaThumbsWnd")
#define	WM_REFRESH_CONTACT			WM_USER + 0x100

#ifndef WS_EX_LAYERED
	#define WS_EX_LAYERED           0x00080000
#endif

#ifndef LWA_ALPHA
	#define LWA_ALPHA               0x00000002
#endif

#ifndef ULW_ALPHA
	#define ULW_ALPHA				0x00000002
#endif

#define TIMERID_SELECT_T			1
#define TIMERID_HOVER_T				2
#define TIMERID_TOTOP_T				3
#define TIMERID_LEAVE_T				4


#if WINVER < 0x0500
	#define SM_XVIRTUALSCREEN       76
	#define SM_YVIRTUALSCREEN       77
	#define SM_CXVIRTUALSCREEN      78
	#define SM_CYVIRTUALSCREEN      79
#endif

/////////////////////////////////////////////////////////////////////////////
//

enum
{
	FLT_FONTID_CONTACTS,
	FLT_FONTID_INVIS,
	FLT_FONTID_OFFLINE,
	FLT_FONTID_OFFINVIS,
	FLT_FONTID_NOTONLIST,
	FLT_FONTIDS,
};

#define DBFONTF_BOLD       1
#define DBFONTF_ITALIC     2
#define DBFONTF_UNDERLINE  4

/////////////////////////////////////////////////////////////////////////////
//

#define FLT_DEFAULT_DRAWBORDER			TRUE
#define FLT_DEFAULT_LTEDGESCOLOR		GetSysColor(COLOR_3DHILIGHT)
#define FLT_DEFAULT_RBEDGESCOLOR		GetSysColor(COLOR_3DDKSHADOW)
#define FLT_DEFAULT_BKGNDCOLOR			GetSysColor(COLOR_3DFACE)
#define FLT_DEFAULT_BKGNDUSEBITMAP		FALSE
#define FLT_DEFAULT_BKGNDBITMAPOPT		CLB_STRETCH

/////////////////////////////////////////////////////////////////////////////
//

#define MODULE "FloatingContacts"

#define TOTOPTIME_P	1000
#define TOTOPTIME_MAX	(15*(60000/TOTOPTIME_P))
#define TOTOPTIME_DEF	(3*(60000/TOTOPTIME_P))

#define MAXRCOOR 32767.0
#define DB_POS_GETX(pos) (short)(((float)(short)(LOWORD(pos))*(float)GetSystemMetrics(SM_CXSCREEN))/MAXRCOOR+0.5)
#define DB_POS_GETY(pos) (short)(((float)(short)(HIWORD(pos))*(float)GetSystemMetrics(SM_CYSCREEN))/MAXRCOOR+0.5)
#define DB_POS_MAKE_XY(x, y) MAKELONG((short)(((float)x*MAXRCOOR)/(float)GetSystemMetrics(SM_CXSCREEN)+0.5), (short)(((float)y*MAXRCOOR)/(float)GetSystemMetrics(SM_CYSCREEN)+0.5))

extern HINSTANCE	hInst;

//extern BOOL			bHideOffline;
//extern BOOL			bHideAll;
//extern BOOL			bHideWhenFullscreen;
//extern BOOL			bMoveTogether;
//extern BOOL			bFixedWidth;
//extern int			nThumbWidth;
//extern BYTE			thumbAlpha;
//extern BOOL			bShowTip;
extern BOOL			bEnableTip;
//extern WORD			TimeIn;
//extern BOOL			bToTop;
//extern WORD			ToTopTime;
//extern BOOL			bHideWhenCListShow;

extern BOOL			bIsCListShow;
extern HWND			hwndMiranda;
extern HIMAGELIST	himlMiranda;
extern RECT			rcScreen;

extern HFONT		hFont[FLT_FONTIDS];
extern COLORREF		tColor[FLT_FONTIDS];

extern HPEN			hLTEdgesPen;
extern HPEN			hRBEdgesPen;
extern HBRUSH		hBkBrush;
extern DWORD		bkColor;
extern HBITMAP		hBmpBackground;
extern WORD			nBackgroundBmpUse;



typedef struct _FCOptions
{
	BYTE	thumbAlpha;
	BOOL	bHideOffline;
	BOOL	bHideAll;
	BOOL	bHideWhenFullscreen;
	BOOL	bMoveTogether;
	BOOL	bFixedWidth;
	int		nThumbWidth;
	BOOL	bShowTip;
	WORD	TimeIn;
	BOOL	bToTop;
	WORD	ToTopTime;
	BOOL	bHideWhenCListShow;
	BOOL	bUseSingleClick;
	BOOL	bShowIdle;
} 
FCOptions;

extern FCOptions fcOpt;

/////////////////////////////////////////////////////////////////////////////

static __forceinline BOOL ImageList_GetIconSize_my(HIMAGELIST himl, SIZE &sz)
{
	int cx, cy;
	BOOL res = ImageList_GetIconSize(himl, &cx, &cy);
	sz.cx = cx; sz.cy = cy;
	return res;
}

void RegHotkey				( HANDLE hContact, HWND hwnd );
BOOL IsStatusVisible		( int status );
BOOL HideOnFullScreen		();
void SendMsgDialog			( HWND hwnd, TCHAR *pText );
void SaveContactsPos		( void );

/////////////////////////////////////////////////////////////////////////////

void ApplyOptionsChanges();

void OnStatusChanged();

void SetThumbsOpacity(BYTE btAlpha);

int OnOptionsInitialize(WPARAM wParam, LPARAM lParam);

/////////////////////////////////////////////////////////////////////////////

#endif	// #ifndef __FLTCONT_H__

/////////////////////////////////////////////////////////////////////////////
// End Of File fltcont.h