Eclectic Media Git rhapsode / 42f1157
Implement table navigation. Adrian Cochrane 4 months ago
1 changed file(s) with 28 addition(s) and 0 deletion(s). Raw diff Collapse all Expand all
133133 switch (getc(stdin)) {
134134 case 'A':
135135 // 🠕
136 if (in_table) {
137 tablerow--;
138 if (tablerow > 0) {
139 sprintf(mark, "-rhaps-tablecell%i:%ix%i", tableno, tablerow, tablecol);
140 speak(ssml, mark);
141 break;
142 } else in_table = 0;
143 }
136144 section_no--;
137145 sprintf(mark, "-rhaps-section%i", section_no);
138146 speak(ssml, section_no > 0 ? mark : NULL);
139147 break;
140148 case 'B':
141149 // 🠗
150 if (in_table) {
151 tablerow++;
152 sprintf(mark, "-rhaps-tablecell%i:%ix%i", tableno, tablerow, tablecol);
153 speak(ssml, mark);
154 break; // FIXME What if that mark doesn't exist?
155 }
142156 section_no++;
143157 sprintf(mark, "-rhaps-section%i", section_no);
144158 speak(ssml, section_no > 0 ? mark : NULL);
145159 break;
146160 case 'C':
147161 // ➔
162 if (in_table) {
163 tablecol++;
164 sprintf(mark, "-rhaps-tablecell%i:%ix%i", tableno, tablerow, tablecol);
165 speak(ssml, mark);
166 break; // FIXME What if that mark doesn't exist?
167 }
148168 paragraph_no++;
149169 sprintf(mark, "-rhaps-paragraph%i", paragraph_no);
150170 speak(ssml, paragraph_no > 0 ? mark : NULL);
151171 break;
152172 case 'D':
153173 // 🠔
174 if (in_table) {
175 tablecol--;
176 if (tablecol > 0) {
177 sprintf(mark, "-rhaps-tablecell%i:%ix%i", tableno, tablerow, tablecol);
178 speak(ssml, mark);
179 break;
180 } else in_table = 0;
181 }
154182 paragraph_no--;
155183 sprintf(mark, "-rhaps-paragraph%i", paragraph_no);
156184 speak(ssml, paragraph_no > 0 ? mark : NULL);