/elec/propeller-clock

To get this branch, use:
bzr branch http://bzr.ed.am/elec/propeller-clock

« back to all changes in this revision

Viewing changes to src/switcher_major_mode.h

  • Committer: edam
  • Date: 2012-02-28 16:50:26 UTC
  • Revision ID: edam@waxworlds.org-20120228165026-pwnwo300xx2e2kg6
removed ulibc, fixed button, added text rendering

Show diffs side-by-side

added added

removed removed

1
1
/*
2
 
 * mode_switcher.h
 
2
 * switcher_major_mode.h
3
3
 *
4
4
 * Copyright (C) 2011 Tim Marston <tim@ed.am> and Dan Marston.
5
5
 *
20
20
 * You should have received a copy of the GNU Lesser General Public License
21
21
 * along with this program.  If not, see <http://www.gnu.org/licenses/>.
22
22
 */
23
 
#ifndef _MODE_SWITCHER_H_
24
 
#define _MODE_SWITCHER_H_
 
23
#ifndef _SWITCHER_MAJOR_MODE_H_
 
24
#define _SWITCHER_MAJOR_MODE_H_
25
25
 
26
26
 
27
27
#include "major_mode.h"
28
 
#include <vector>
 
28
 
 
29
 
 
30
#define MAX_MINOR_MODES 5
29
31
 
30
32
 
31
33
class MinorMode;
32
34
class Drawer;
33
35
 
34
36
 
35
 
class ModeSwitcher
 
37
class SwitcherMajorMode
36
38
    :
37
39
    public MajorMode
38
40
{
39
41
public:
40
42
 
41
 
        ModeSwitcher();
 
43
        SwitcherMajorMode();
42
44
 
43
45
        /**
44
46
         * Called to inform the major mode that there has been a short press.
45
47
         */
46
 
        void short_press();
 
48
        void press();
47
49
 
48
50
        /**
49
51
         * Called to inform the major mode that there has been a long press.
65
67
private:
66
68
 
67
69
        /* minor modes that this mode switcher switches */
68
 
        std::vector< MinorMode * > _modes;
 
70
        MinorMode *_modes[ MAX_MINOR_MODES ];
69
71
 
70
72
        /* current mode */
71
73
        int _mode;
73
75
};
74
76
 
75
77
 
76
 
#endif //_MODE_SWITCHER_H_
 
78
#endif //_SWITCHER_MAJOR_MODE_H_