summaryrefslogtreecommitdiff
path: root/plugins/Toaster/src/structs.h
blob: 96900ce785e76353067bb3f3ed6cdd7d93bfc4c5 (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
#pragma once

struct ToastData : public MZeroedObject
{
	MCONTACT hContact;
	wchar_t *tszTitle;
	wchar_t *tszText;
	union
	{
		HICON hIcon;
		HBITMAP hBitmap;
	};
	int iType; // 0 = none, 1 = hBitmap, 2 = hIcon

	WNDPROC pPopupProc;
	void *vPopupData;

	ToastData(MCONTACT _hContact, const wchar_t *_tszTitle, const wchar_t *_tszText, HICON _hIcon = NULL) : 
		hContact(_hContact),
		tszTitle(mir_wstrdup(_tszTitle)), 
		tszText(mir_wstrdup(_tszText)), 
		hIcon(_hIcon), 
		iType(_hIcon ? 2 : 0) ,
		pPopupProc(NULL),
		vPopupData(NULL)
	{}
	ToastData(MCONTACT _hContact, const wchar_t *_tszTitle, const wchar_t *_tszText, HBITMAP bmp = NULL) :
		hContact(_hContact),
		tszTitle(mir_wstrdup(_tszTitle)),
		tszText(mir_wstrdup(_tszText)),
		hBitmap(bmp),
		iType(bmp ? 1 : 0),
		pPopupProc(NULL),
		vPopupData(NULL)
	{}
	~ToastData()
	{
		mir_free(tszTitle);
		mir_free(tszText);
	}
};

struct ClassData : public MZeroedObject
{
	int iFlags;
	HICON hIcon;

	WNDPROC pPopupProc;

	ClassData(int f, HICON h = NULL) : iFlags(f), hIcon(h), pPopupProc(NULL)
	{
	}
};