/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/text.h

  • Committer: Tim Marston
  • Date: 2013-03-31 17:07:36 UTC
  • Revision ID: tim@ed.am-20130331170736-hphm2hg0y6l7w6z1
made rtc-test's DS1307 library a symlink to the main one in src/util

Show diffs side-by-side

added added

removed removed

35
35
{
36
36
        enum {
37
37
                // one of these to select face
38
 
                MODE_TOP = 1,
39
 
                MODE_BOTTOM = 0,
 
38
                MODE_TOP = 0,
 
39
                MODE_BOTTOM = 64,
40
40
 
41
41
                // one of these to select size
42
 
                MODE_ONEQUARTER = 0,
43
 
                MODE_ONETHIRD = 4,
44
 
                MODE_HALF = 8,
45
 
                MODE_TWOTHIRDS = 12,
46
 
                MODE_THREEQUARTERS = 16,
47
 
                MODE_ALL = 20,
 
42
                MODE_ONEQUARTER = 1,
 
43
                MODE_ONETHIRD = 2,
 
44
                MODE_HALF = 3,
 
45
                MODE_TWOTHIRDS = 4,
 
46
                MODE_THREEQUARTERS = 5,
 
47
                MODE_ALL = 6,
48
48
 
49
49
                // flag to turn on horizontal scrolling
50
50
                MODE_HSCROLL = 32,
 
51
 
 
52
                // text scale constants
 
53
                SCALE_VSMALL = 1,
 
54
                SCALE_SMALL = 2,
 
55
                SCALE_NORMAL = 3,
 
56
                SCALE_FAT = 4,
 
57
                SCALE_VFAT = 5,
51
58
        };
52
59
 
53
60
        /**
 
61
         * Reset internal state, for a new text display. This deactivates all
 
62
         * messages and they will need to be enabled again with set_up_message().
 
63
         */
 
64
        void reset();
 
65
 
 
66
        /**
 
67
         * Activate the display of a message and specify its display parameters.
 
68
         *
 
69
         * @param message_num the message to reset
 
70
         * @param mode the new mode for this message
 
71
         * @param scale text
 
72
         */
 
73
        void set_up_message( int message_num, char mode, char scale = SCALE_NORMAL );
 
74
 
 
75
        /**
54
76
         * After modifying a message buffer, call this to reset the internal state
55
77
         * of the text renderer with regard to this message.
56
78
         *
57
79
         * @param message_num the buffer number
58
80
         * @param pstring the PString that represents this message's buffer
59
81
         */
60
 
        void set_message( int message_num, PString &pstring );
61
 
 
62
 
        /**
63
 
         * Reset the display of a message and specify its display parameters.
64
 
         *
65
 
         * @param message_num the message to reset
66
 
         * @param mode the new mode for this message
67
 
         * @param scale text
68
 
         */
69
 
        void reset_message( int message_num, char mode, int scale = 3 );
70
 
 
71
 
        /**
72
 
         * Reset internal state, for a new text display.
73
 
         */
74
 
        void reset();
 
82
        void set_message_text( int message_num, PString &pstring );
75
83
 
76
84
        /**
77
85
         * Call at the start of each frame.
79
87
        void draw_reset();
80
88
 
81
89
        /**
 
90
         * Call after drawing each frame
 
91
         */
 
92
        void post_draw();
 
93
 
 
94
        /**
82
95
         * Draw segment for the specified message number using whatever mode that
83
96
         * message is set to.
84
97
         *
85
 
         * @param message_num the message buffer number
86
98
         * @param segment to draw
87
99
         */
88
 
        void draw( int message_num, int segment );
 
100
        void draw( int segment );
89
101
 
90
102
        /** internal message buffers */
91
103
        extern char _messages[ NUM_MESSAGE_BUFFERS ][ MESSAGE_LEN ];