/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: Tim Marston
  • Date: 2012-03-09 23:42:20 UTC
  • Revision ID: tim@ed.am-20120309234220-xr1vxzve0o5n2oss
added support for eclipse project and converted to a manual Makefile

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
36
 
    :
37
 
    public MajorMode
 
37
class SwitcherMajorMode : public MajorMode
38
38
{
39
39
public:
40
40
 
41
 
        ModeSwitcher();
 
41
        SwitcherMajorMode();
42
42
 
43
43
        /**
44
44
         * Called to inform the major mode that there has been a short press.
45
45
         */
46
 
        void short_press();
 
46
        void press();
47
47
 
48
48
        /**
49
49
         * Called to inform the major mode that there has been a long press.
65
65
private:
66
66
 
67
67
        /* minor modes that this mode switcher switches */
68
 
        std::vector< MinorMode * > _modes;
 
68
        MinorMode *_modes[ MAX_MINOR_MODES ];
69
69
 
70
70
        /* current mode */
71
71
        int _mode;
73
73
};
74
74
 
75
75
 
76
 
#endif //_MODE_SWITCHER_H_
 
76
#endif //_SWITCHER_MAJOR_MODE_H_