summaryrefslogtreecommitdiff
path: root/plugins/MirandaG15/LCDFramework/src/CLCDDevice.h
blob: f7d9c15922c3e128f62f46dff5df653f8ff96ce8 (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
#ifndef _CLCDDEVICE_H_
#define _CLCDDEVICE_H_

#include "../g15sdk/lglcd.h"

class CLCDDevice {
private:
	int m_iIndex;

protected:
	CLCDDevice(int iIndex) {
		m_iIndex = iIndex;
	}

public:
	int GetIndex() {
		return m_iIndex;
	}

	// Returns the display name
	virtual tstring GetDisplayName() = NULL;
	// Returns the display size
	virtual SIZE GetDisplaySize() = NULL;
	// Returns the number of buttons for the display
	virtual int GetButtonCount() = NULL;
	// Returns the number of available colors
	virtual int GetColorCount() = NULL;
};

class CLgLCDDevice : public CLCDDevice {
private:
	SIZE m_size;
	int m_iButtons;
	int m_iBPP;

public:
	CLgLCDDevice(DWORD type, SIZE size, int buttons, int BPP) : CLCDDevice(type) {
		m_size = size;
		m_iButtons = buttons;
		m_iBPP = BPP;
	}
	
	// Returns the display name
	tstring GetDisplayName() {
		return m_iBPP == 1? _T("G15") : _T("G19");
	}

	// Returns the display size
	SIZE GetDisplaySize() {
		return m_size;
	}
	// Returns the number of buttons for the display
	int GetButtonCount() {
		return m_iButtons;
	}

	// Returns the number of available colors
	int GetColorCount() {
		return m_iBPP;
	}
};

#endif