summaryrefslogtreecommitdiff
path: root/plugins/MirandaG15/src/LCDFramework/CLCDDevice.h
blob: e177a9b21016c70abcffb639e337cdcfaf714f08 (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
#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(uint32_t 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 ? L"G15" : L"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