about summary refs log tree commit diff stats
path: root/config.def.h
Commit message (Expand)AuthorAgeFilesLines
* introduced NOBORDER macro to hide the nasty - 2 * c->bw in various calculatio...Anselm R Garbe2008-08-271-0/+1
* added a comment about FAQ regarding mfact meaningAnselm R Garbe2008-08-181-1/+1
* made readin a config.h variableAnselm R Garbe2008-08-021-0/+1
* make hg tip compilable with default configPremysl Hruby2008-07-181-2/+2
* got rid of compile time xidx configuration, querying mouse pointer insteadAnselm R Garbe2008-07-161-4/+0
* removed useless commentAnselm R Garbe2008-07-021-1/+1
* removed useless charactersAnselm R Garbe2008-06-241-3/+3
* applied Gottox' ClkTagBar patchAnselm R Garbe2008-06-201-15/+4
* untested monocleAnselm R Garbe2008-06-191-6/+9
* branch merge 5.0Anselm R Garbe2008-06-171-1/+1
|\
| * s/tags ref/tags mask/arg@suckless.org2008-06-151-1/+1
* | tiled layout resizehints should be respected by defaultAnselm R Garbe2008-06-171-2/+2
|/
* removed scroll-wheel based focussing on window title clicksAnselm R Garbe2008-06-141-2/+0
* fix of swapped focusstack mouse buttonsAnselm R Garbe2008-06-141-2/+2
* removed root window click handlingAnselm R Garbe2008-06-141-1/+0
* removed font and color definitionsAnselm R Garbe2008-06-141-18/+21
* updateAnselm R Garbe2008-06-121-1/+1
* integrated yiyus mouse.diff (though the bar click handling is slightly broken...Anselm R Garbe2008-06-111-25/+59
* made Xinerama screen index customizableAnselm R Garbe2008-06-111-4/+8
* added nsz' patchAnselm R Garbe2008-06-111-0/+3
* integrated Peter Hartlich's patch, removed const char *c from union, simplifi...Anselm R Garbe2008-06-111-4/+4
* applied anydot's patchset.diffAnselm R Garbe2008-06-111-35/+35
* Gottox' drawtext simplificationAnselm R Garbe2008-06-011-1/+1
* applied noviewprev.diff, fix.diff and unusedflags.diffAnselm R Garbe2008-06-011-1/+1
* removed Layout->updategeom, unnecessaryAnselm R Garbe2008-05-261-3/+3
* applied yiyus domax patch with slight modificationsAnselm R Garbe2008-05-261-36/+16
* s/int/uint/ in config.hAnselm R Garbe2008-05-221-38/+38
* setmfact argument was wrongAnselm R Garbe2008-05-221-2/+2
* applied Gottox bitmask + void *arg patchAnselm R Garbe2008-05-221-43/+44
* merged tile.c again into dwm.canselm@anselm12008-05-191-3/+1
* recent changes, introduced togglebar, changed some defines into variable decl...Anselm R Garbe2008-05-191-4/+9
* removed the <M> togglelayout callAnselm R Garbe2008-05-171-3/+2
* removed monocle for nowAnselm R Garbe2008-05-171-1/+0
* removed the exact focus mechanism of next/prev windowAnselm R Garbe2008-05-171-2/+0
* moved all tile()-related stuff into tile.c which is included from config.def....Anselm R Garbe2008-05-171-7/+7
* removed tileh, renamed tilev into tile again, removed counttiles, tilemasterAnselm R Garbe2008-05-171-1/+1
* removed Layout->isfloatingAnselm R Garbe2008-05-171-4/+4
* removed reapply() -- unnecessaryAnselm R Garbe2008-05-171-1/+0
* renamed setlayout into togglelayoutAnselm R Garbe2008-05-171-74/+73
* having monocle on Mod1-mAnselm R Garbe2008-05-111-0/+1
* removed Geom stuff, introduced updategeom() again, still view is somewhat bro...Anselm R Garbe2008-05-111-11/+1
* cleaned up config.def.hAnselm R Garbe2008-05-111-8/+2
* implemented exact focus next, if arg != NULL to focus{next,prev}Anselm R Garbe2008-05-111-0/+2
* applied JUCE patchAnselm R Garbe2008-05-061-0/+2
* applied yiyus fgeom patchAnselm R Garbe2008-04-271-1/+4
* geometry fix proposed by JukkaAnselm R Garbe2008-04-081-1/+1
* some cleanup changesAnselm R Garbe2008-04-031-2/+0
* uncommented dual layout in preparation of dwm 4.9anselm@anselm12008-04-021-2/+2
* applied Peter Hartlich's simplification patch of setmfact and his revival of ...anselm@anselm12008-04-021-1/+1
* revival of mfact and setmfactAnselm R Garbe2008-03-241-1/+4
13e1f709c69375202e8ecafb337a24abed45'>^
363be37f ^
12d73ee8 ^

5f128523 ^
ac0e9db5 ^

e4630643 ^







827898fc ^
57bcdaee ^

e4630643 ^



57bcdaee ^
57bcdaee ^


e4630643 ^



57bcdaee ^



dc1323e9 ^

5f128523 ^


596490f4 ^
5f128523 ^


dc1323e9 ^

57bcdaee ^
dc1323e9 ^

596490f4 ^
dc1323e9 ^


dc1323e9 ^

5f128523 ^

596490f4 ^
12d73ee8 ^





363be37f ^
12d73ee8 ^

0487a30e ^


12d73ee8 ^





363be37f ^
12d73ee8 ^

e4630643 ^







827898fc ^
e4630643 ^



827898fc ^
5f128523 ^
596490f4 ^
12d73ee8 ^


0012c703 ^


363be37f ^
0012c703 ^

dc1323e9 ^
ac0e9db5 ^
dc1323e9 ^


596490f4 ^
dc1323e9 ^
0012c703 ^





363be37f ^
0012c703 ^

dc1323e9 ^


596490f4 ^
dc1323e9 ^
0012c703 ^





363be37f ^
0012c703 ^

dc1323e9 ^
ac0e9db5 ^
dc1323e9 ^


596490f4 ^
dc1323e9 ^
0012c703 ^





363be37f ^
0012c703 ^

dc1323e9 ^


596490f4 ^
dc1323e9 ^
0012c703 ^


9fae6657 ^


363be37f ^
9fae6657 ^









363be37f ^
9fae6657 ^






48bb8627 ^


363be37f ^
48bb8627 ^








363be37f ^
48bb8627 ^





596490f4 ^


363be37f ^
596490f4 ^








363be37f ^
596490f4 ^






45c08fea ^
12d73ee8 ^

45c08fea ^
54d48b25 ^
363be37f ^
54d48b25 ^
45c08fea ^
e02d7e98 ^
45c08fea ^
bbff2a35 ^



45c08fea ^
bbff2a35 ^
363be37f ^
bbff2a35 ^
45c08fea ^

e02d7e98 ^
bbff2a35 ^
45c08fea ^




















0487a30e ^
45c08fea ^





bbff2a35 ^
45c08fea ^
e766fd13 ^
45c08fea ^





6fef33fd ^








45c08fea ^




54d48b25 ^

5e9eff8c ^










fec4d874 ^






















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
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
                                                     
 

                       
                       
                                                  
                        
 
                                             
             
                                        
                                              
                                                
                    

                                   






                                                                                                                   



                                             
              
                                        
                                                
                                                
                     
                


        


                        
                                             

                                        
                                                

                                                

                                   



                                             









                                                

                                        
                                                                

                                                

                                                          
                                                            

                                             
                                





                                             
                                                                          

                                                
                                  

                                          







                                                                                                                                                                                                       
                                            

                              



                                                                                                                                                                                                                        
                                    


                              



                                                                                                                                                                                                                       



                                                                  

                                 


                                                 
                                    


          

                             
                                                                          

                                                 
                                    


          

                                 

                                               
                                





                                             
                                                                          

                                                


                                           





                                             
                                                                  

                                                







                                                                                                                                                                                                    
                                        



                                                                                                                                                                                                        
                                           
                                             
                                


        


                                             
                                                                            

                                                
                    
                                          


                                               
                                  
   





                                             
                                                                        

                                                


                                               
                                  
   





                                             
                                                                              

                                                
                   
                                         


                                               
                                  
   





                                             
                                                                            

                                                


                                               
                                  
   


        


                                             
                                                









                                                
                                                  






                                                


                                             
                                                                  








                                                
                                                                  





                                                


                                             
                                              








                                                
                                              






                                                
                              

                                             
                          
                                        
                                                                        
                                                
                                 
                 
                        



                                             
                      
                                        
                                                                
                                                

                                           
                 
                                                  




















                                                                                  
                                   





                                                 
   
                                     
                                               





                                                               








                                                 




                                           

        










                                                         






















                                                                                                        
//: Take charge of the text-mode display and console.

//:: Display management

:(before "End Globals")
long long int Display_row = 0, Display_column = 0;
bool Autodisplay = true;

:(before "End Primitive Recipe Declarations")
OPEN_CONSOLE,
:(before "End Primitive Recipe Numbers")
Recipe_ordinal["open-console"] = OPEN_CONSOLE;
:(before "End Primitive Recipe Implementations")
case OPEN_CONSOLE: {
  tb_init();
  Display_row = Display_column = 0;
  long long int width = tb_width();
  long long int height = tb_height();
  if (width > 222 || height > 222) tb_shutdown();
  if (width > 222)
    raise << "sorry, mu doesn't support windows wider than 222 characters. Please resize your window.\n" << end();
  if (height > 222)
    raise << "sorry, mu doesn't support windows taller than 222 characters. Please resize your window.\n" << end();
  break;
}

:(before "End Primitive Recipe Declarations")
CLOSE_CONSOLE,
:(before "End Primitive Recipe Numbers")
Recipe_ordinal["close-console"] = CLOSE_CONSOLE;
:(before "End Primitive Recipe Implementations")
case CLOSE_CONSOLE: {
  tb_shutdown();
  break;
}

:(before "End Teardown")
tb_shutdown();

:(before "End Primitive Recipe Declarations")
CLEAR_DISPLAY,
:(before "End Primitive Recipe Numbers")
Recipe_ordinal["clear-display"] = CLEAR_DISPLAY;
:(before "End Primitive Recipe Implementations")
case CLEAR_DISPLAY: {
  tb_clear();
  Display_row = Display_column = 0;
  break;
}

:(before "End Primitive Recipe Declarations")
SYNC_DISPLAY,
:(before "End Primitive Recipe Numbers")
Recipe_ordinal["sync-display"] = SYNC_DISPLAY;
:(before "End Primitive Recipe Implementations")
case SYNC_DISPLAY: {
  tb_sync();
  break;
}

:(before "End Primitive Recipe Declarations")
CLEAR_LINE_ON_DISPLAY,
:(before "End Primitive Recipe Numbers")
Recipe_ordinal["clear-line-on-display"] = CLEAR_LINE_ON_DISPLAY;
:(before "End Primitive Recipe Implementations")
case CLEAR_LINE_ON_DISPLAY: {
  long long int width = tb_width();
  for (long long int x = Display_column; x < width; ++x) {
    tb_change_cell(x, Display_row, ' ', TB_WHITE, TB_BLACK);
  }
  tb_set_cursor(Display_column, Display_row);
  if (Autodisplay) tb_present();
  break;
}

:(before "End Primitive Recipe Declarations")
PRINT_CHARACTER_TO_DISPLAY,
:(before "End Primitive Recipe Numbers")
Recipe_ordinal["print-character-to-display"] = PRINT_CHARACTER_TO_DISPLAY;
:(before "End Primitive Recipe Implementations")
case PRINT_CHARACTER_TO_DISPLAY: {
  int h=tb_height(), w=tb_width();
  long long int height = (h >= 0) ? h : 0;
  long long int width = (w >= 0) ? w : 0;
  if (ingredients.empty()) {
    raise << current_recipe_name() << ": 'print-character-to-display' requires at least one ingredient, but got " << current_instruction().to_string() << '\n' << end();
    break;
  }
  if (!scalar(ingredients.at(0))) {
    raise << current_recipe_name() << ": first ingredient of 'print-character-to-display' should be a character, but got " << current_instruction().ingredients.at(0).original_string << '\n' << end();
    break;
  }
  long long int c = ingredients.at(0).at(0);
  int color = TB_BLACK;
  if (SIZE(ingredients) > 1) {
    if (!scalar(ingredients.at(1))) {
      raise << current_recipe_name() << ": second ingredient of 'print-character-to-display' should be a foreground color number, but got " << current_instruction().ingredients.at(1).original_string << '\n' << end();
      break;
    }
    color = ingredients.at(1).at(0);
  }
  int bg_color = TB_BLACK;
  if (SIZE(ingredients) > 2) {
    if (!scalar(ingredients.at(2))) {
      raise << current_recipe_name() << ": third ingredient of 'print-character-to-display' should be a background color number, but got " << current_instruction().ingredients.at(2).original_string << '\n' << end();
      break;
    }
    bg_color = ingredients.at(2).at(0);
    if (bg_color == 0) bg_color = TB_BLACK;
  }
  tb_change_cell(Display_column, Display_row, c, color, bg_color);
  if (c == '\n' || c == '\r') {
    if (Display_row < height-1) {
      Display_column = 0;
      ++Display_row;
      tb_set_cursor(Display_column, Display_row);
      if (Autodisplay) tb_present();
    }
    break;
  }
  if (c == '\b') {
    if (Display_column > 0) {
      tb_change_cell(Display_column-1, Display_row, ' ', color, bg_color);
      --Display_column;
      tb_set_cursor(Display_column, Display_row);
      if (Autodisplay) tb_present();
    }
    break;
  }
  if (Display_column < width-1) {
    ++Display_column;
    tb_set_cursor(Display_column, Display_row);
  }
  if (Autodisplay) tb_present();
  break;
}

:(before "End Primitive Recipe Declarations")
CURSOR_POSITION_ON_DISPLAY,
:(before "End Primitive Recipe Numbers")
Recipe_ordinal["cursor-position-on-display"] = CURSOR_POSITION_ON_DISPLAY;
:(before "End Primitive Recipe Implementations")
case CURSOR_POSITION_ON_DISPLAY: {
  products.resize(2);
  products.at(0).push_back(Display_row);
  products.at(1).push_back(Display_column);
  break;
}

:(before "End Primitive Recipe Declarations")
MOVE_CURSOR_ON_DISPLAY,
:(before "End Primitive Recipe Numbers")
Recipe_ordinal["move-cursor-on-display"] = MOVE_CURSOR_ON_DISPLAY;
:(before "End Primitive Recipe Implementations")
case MOVE_CURSOR_ON_DISPLAY: {
  if (SIZE(ingredients) != 2) {
    raise << current_recipe_name() << ": 'move-cursor-on-display' requires two ingredients, but got " << current_instruction().to_string() << '\n' << end();
    break;
  }
  if (!scalar(ingredients.at(0))) {
    raise << current_recipe_name() << ": first ingredient of 'move-cursor-on-display' should be a row number, but got " << current_instruction().ingredients.at(0).original_string << '\n' << end();
    break;
  }
  Display_row = ingredients.at(0).at(0);
  if (!scalar(ingredients.at(1))) {
    raise << current_recipe_name() << ": second ingredient of 'move-cursor-on-display' should be a column number, but got " << current_instruction().ingredients.at(1).original_string << '\n' << end();
    break;
  }
  Display_column = ingredients.at(1).at(0);
  tb_set_cursor(Display_column, Display_row);
  if (Autodisplay) tb_present();
  break;
}

:(before "End Primitive Recipe Declarations")
MOVE_CURSOR_DOWN_ON_DISPLAY,
:(before "End Primitive Recipe Numbers")
Recipe_ordinal["move-cursor-down-on-display"] = MOVE_CURSOR_DOWN_ON_DISPLAY;
:(before "End Primitive Recipe Implementations")
case MOVE_CURSOR_DOWN_ON_DISPLAY: {
  int h=tb_height();
  long long int height = (h >= 0) ? h : 0;
  if (Display_row < height-1) {
    Display_row++;
    tb_set_cursor(Display_column, Display_row);
    if (Autodisplay) tb_present();
  }
  break;
}

:(before "End Primitive Recipe Declarations")
MOVE_CURSOR_UP_ON_DISPLAY,
:(before "End Primitive Recipe Numbers")
Recipe_ordinal["move-cursor-up-on-display"] = MOVE_CURSOR_UP_ON_DISPLAY;
:(before "End Primitive Recipe Implementations")
case MOVE_CURSOR_UP_ON_DISPLAY: {
  if (Display_row > 0) {
    Display_row--;
    tb_set_cursor(Display_column, Display_row);
    if (Autodisplay) tb_present();
  }
  break;
}

:(before "End Primitive Recipe Declarations")
MOVE_CURSOR_RIGHT_ON_DISPLAY,
:(before "End Primitive Recipe Numbers")
Recipe_ordinal["move-cursor-right-on-display"] = MOVE_CURSOR_RIGHT_ON_DISPLAY;
:(before "End Primitive Recipe Implementations")
case MOVE_CURSOR_RIGHT_ON_DISPLAY: {
  int w=tb_width();
  long long int width = (w >= 0) ? w : 0;
  if (Display_column < width-1) {
    Display_column++;
    tb_set_cursor(Display_column, Display_row);
    if (Autodisplay) tb_present();
  }
  break;
}

:(before "End Primitive Recipe Declarations")
MOVE_CURSOR_LEFT_ON_DISPLAY,
:(before "End Primitive Recipe Numbers")
Recipe_ordinal["move-cursor-left-on-display"] = MOVE_CURSOR_LEFT_ON_DISPLAY;
:(before "End Primitive Recipe Implementations")
case MOVE_CURSOR_LEFT_ON_DISPLAY: {
  if (Display_column > 0) {
    Display_column--;
    tb_set_cursor(Display_column, Display_row);
    if (Autodisplay) tb_present();
  }
  break;
}

:(before "End Primitive Recipe Declarations")
DISPLAY_WIDTH,
:(before "End Primitive Recipe Numbers")
Recipe_ordinal["display-width"] = DISPLAY_WIDTH;
:(before "End Primitive Recipe Implementations")
case DISPLAY_WIDTH: {
  products.resize(1);
  products.at(0).push_back(tb_width());
  break;
}

:(before "End Primitive Recipe Declarations")
DISPLAY_HEIGHT,
:(before "End Primitive Recipe Numbers")
Recipe_ordinal["display-height"] = DISPLAY_HEIGHT;
:(before "End Primitive Recipe Implementations")
case DISPLAY_HEIGHT: {
  products.resize(1);
  products.at(0).push_back(tb_height());
  break;
}

:(before "End Primitive Recipe Declarations")
HIDE_CURSOR_ON_DISPLAY,
:(before "End Primitive Recipe Numbers")
Recipe_ordinal["hide-cursor-on-display"] = HIDE_CURSOR_ON_DISPLAY;
:(before "End Primitive Recipe Implementations")
case HIDE_CURSOR_ON_DISPLAY: {
  tb_set_cursor(TB_HIDE_CURSOR, TB_HIDE_CURSOR);
  break;
}

:(before "End Primitive Recipe Declarations")
SHOW_CURSOR_ON_DISPLAY,
:(before "End Primitive Recipe Numbers")
Recipe_ordinal["show-cursor-on-display"] = SHOW_CURSOR_ON_DISPLAY;
:(before "End Primitive Recipe Implementations")
case SHOW_CURSOR_ON_DISPLAY: {
  tb_set_cursor(Display_row, Display_column);
  break;
}

:(before "End Primitive Recipe Declarations")
HIDE_DISPLAY,
:(before "End Primitive Recipe Numbers")
Recipe_ordinal["hide-display"] = HIDE_DISPLAY;
:(before "End Primitive Recipe Implementations")
case HIDE_DISPLAY: {
  Autodisplay = false;
  break;
}

:(before "End Primitive Recipe Declarations")
SHOW_DISPLAY,
:(before "End Primitive Recipe Numbers")
Recipe_ordinal["show-display"] = SHOW_DISPLAY;
:(before "End Primitive Recipe Implementations")
case SHOW_DISPLAY: {
  Autodisplay = true;
  tb_present();
  break;
}

//:: Keyboard/mouse management

:(before "End Primitive Recipe Declarations")
WAIT_FOR_SOME_INTERACTION,
:(before "End Primitive Recipe Numbers")
Recipe_ordinal["wait-for-some-interaction"] = WAIT_FOR_SOME_INTERACTION;
:(before "End Primitive Recipe Implementations")
case WAIT_FOR_SOME_INTERACTION: {
  tb_event event;
  tb_poll_event(&event);
  break;
}

:(before "End Primitive Recipe Declarations")
CHECK_FOR_INTERACTION,
:(before "End Primitive Recipe Numbers")
Recipe_ordinal["check-for-interaction"] = CHECK_FOR_INTERACTION;
:(before "End Primitive Recipe Implementations")
case CHECK_FOR_INTERACTION: {
  products.resize(2);  // result and status
  tb_event event;
  int event_type = tb_peek_event(&event, 5/*ms*/);
  if (event_type == TB_EVENT_KEY && event.ch) {
    products.at(0).push_back(/*text event*/0);
    products.at(0).push_back(event.ch);
    products.at(0).push_back(0);
    products.at(0).push_back(0);
    products.at(1).push_back(/*found*/true);
    break;
  }
  // treat keys within ascii as unicode characters
  if (event_type == TB_EVENT_KEY && event.key < 0xff) {
    products.at(0).push_back(/*text event*/0);
    if (event.key == TB_KEY_CTRL_C) tb_shutdown(), exit(1);
    if (event.key == TB_KEY_BACKSPACE2) event.key = TB_KEY_BACKSPACE;
    if (event.key == TB_KEY_CARRIAGE_RETURN) event.key = TB_KEY_NEWLINE;
    products.at(0).push_back(event.key);
    products.at(0).push_back(0);
    products.at(0).push_back(0);
    products.at(1).push_back(/*found*/true);
    break;
  }
  // keys outside ascii aren't unicode characters but arbitrary termbox inventions
  if (event_type == TB_EVENT_KEY) {
    products.at(0).push_back(/*keycode event*/1);
    products.at(0).push_back(event.key);
    products.at(0).push_back(0);
    products.at(0).push_back(0);
    products.at(1).push_back(/*found*/true);
    break;
  }
  if (event_type == TB_EVENT_MOUSE) {
    products.at(0).push_back(/*touch event*/2);
    products.at(0).push_back(event.key);  // which button, etc.
    products.at(0).push_back(event.y);  // row
    products.at(0).push_back(event.x);  // column
    products.at(1).push_back(/*found*/true);
    break;
  }
  if (event_type == TB_EVENT_RESIZE) {
    products.at(0).push_back(/*resize event*/3);
    products.at(0).push_back(event.w);  // width
    products.at(0).push_back(event.h);  // height
    products.at(0).push_back(0);
    products.at(1).push_back(/*found*/true);
    break;
  }
  assert(event_type == 0);
  products.at(0).push_back(0);
  products.at(0).push_back(0);
  products.at(0).push_back(0);
  products.at(0).push_back(0);
  products.at(1).push_back(/*found*/false);
  break;
}

:(before "End Primitive Recipe Declarations")
INTERACTIONS_LEFT,
:(before "End Primitive Recipe Numbers")
Recipe_ordinal["interactions-left?"] = INTERACTIONS_LEFT;
:(before "End Primitive Recipe Implementations")
case INTERACTIONS_LEFT: {
  products.resize(1);
  products.at(0).push_back(tb_event_ready());
  break;
}

//: a hack to make edit.mu more responsive

:(before "End Primitive Recipe Declarations")
CLEAR_DISPLAY_FROM,
:(before "End Primitive Recipe Numbers")
Recipe_ordinal["clear-display-from"] = CLEAR_DISPLAY_FROM;
:(before "End Primitive Recipe Implementations")
case CLEAR_DISPLAY_FROM: {
  // todo: error checking
  int row = ingredients.at(0).at(0);
  int column = ingredients.at(1).at(0);
  int left = ingredients.at(2).at(0);
  int right = ingredients.at(3).at(0);
  int height=tb_height();
  for (; row < height; ++row, column=left) {  // start column from left in every inner loop except first
    for (; column <= right; ++column) {
      tb_change_cell(column, row, ' ', TB_WHITE, TB_BLACK);
    }
  }
  if (Autodisplay) tb_present();
  break;
}