summaryrefslogtreecommitdiff
path: root/glcdskin/display.h
blob: ec0ee8ba9ac022894920694a82f6b0975271820b (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
/*
 * GraphLCD skin library
 *
 * display.h  -  display class
 *
 * This file is released under the GNU General Public License. Refer
 * to the COPYING file distributed with this package.
 *
 * based on text2skin
 *
 */

#ifndef _GLCDSKIN_DISPLAY_H_
#define _GLCDSKIN_DISPLAY_H_

#include <string>
#include <vector>

#include "object.h"

namespace GLCD
{

class cSkin;

class cSkinDisplay
{
    friend bool StartElem(const std::string &name, std::map<std::string,std::string> &attrs);
    friend bool EndElem(const std::string &name);

private:
    cSkin * mSkin;
    std::string mId;
    cSkinObjects mObjects;

public:
    cSkinDisplay(cSkin * Parent);

    cSkin * Skin(void) const { return mSkin; }
    const std::string & Id(void) const { return mId; }

    uint32_t NumObjects(void) const { return mObjects.size(); }
    cSkinObject * GetObject(uint32_t n) const { return mObjects[n]; }

    void Render(cBitmap * screen);

    bool NeedsUpdate(uint64_t CurrentTime);

    std::string CheckAction(cGLCDEvent * ev);
};

class cSkinDisplays: public std::vector<cSkinDisplay *>
{
public:
    cSkinDisplays(void);
    ~cSkinDisplays(void);
};

} // end of namespace

#endif