Unified · Split
| @@ -276,5 +276,17 @@ Then start the following in a separate "command" window: · 275 unmodified lines | |||
| 276 | telnet tcp!127.0.0.1!49160 | 276 | telnet tcp!127.0.0.1!49160 |
| 277 | .EE | 277 | .EE |
| 278 | .PP | 278 | .PP |
| 279 | .SH PLUMBING | ||
| 280 | Orca supports injecting files at the current cursor position by | ||
| 281 | plumbing. Add this to your plumbing rules to get it working: | ||
| 282 | .EX | ||
| 283 | type is text | ||
| 284 | data matches '[a-zA-Z¡-0-9_\-.,/]+' | ||
| 285 | data matches '([a-zA-Z¡-0-9_\-.,/]+)\.orca' | ||
| 286 | arg isfile $0 | ||
| 287 | plumb to orca | ||
| 288 | plumb start window games/orca $file | ||
| 289 | .EE | ||
| 290 | .PP | ||
| 279 | .SH SOURCE | 291 | .SH SOURCE |
| 280 | https://github.com/hundredrabbits/Orca | 292 | https://github.com/hundredrabbits/Orca |
| @@ -7,6 +7,7 @@ · 6 unmodified lines | |||
| 7 | #include <mouse.h> | 7 | #include <mouse.h> |
| 8 | #include <keyboard.h> | 8 | #include <keyboard.h> |
| 9 | #include <thread.h> | 9 | #include <thread.h> |
| 10 | #include <plumb.h> | ||
| 10 | 11 | ||
| 11 | #define MIN(x,y) ((x)<=(y)?(x):(y)) | 12 | #define MIN(x,y) ((x)<=(y)?(x):(y)) |
| 12 | #define MAX(x,y) ((x)>=(y)?(x):(y)) | 13 | #define MAX(x,y) ((x)>=(y)?(x):(y)) |
| @@ -1116,6 +1117,23 @@ stdinproc(void *) · 1103 unmodified lines | |||
| 1116 | threadexits(nil); | 1117 | threadexits(nil); |
| 1117 | } | 1118 | } |
| 1118 | 1119 | ||
| 1120 | static void | ||
| 1121 | plumbthread(void *) | ||
| 1122 | { | ||
| 1123 | int f; | ||
| 1124 | Plumbmsg *m; | ||
| 1125 | |||
| 1126 | threadsetname("plumb"); | ||
| 1127 | if ((f = plumbopen("orca", OREAD)) >= 0) { | ||
| 1128 | while ((m = plumbrecv(f)) != nil) { | ||
| 1129 | inject(m->data); | ||
| 1130 | plumbfree(m); | ||
| 1131 | } | ||
| 1132 | } | ||
| 1133 | |||
| 1134 | threadexits(nil); | ||
| 1135 | } | ||
| 1136 | |||
| 1119 | static void | 1137 | static void |
| 1120 | kbdproc(void *cchan) | 1138 | kbdproc(void *cchan) |
| 1121 | { | 1139 | { |
| @@ -1368,6 +1386,8 @@ threadmain(int argc, char **argv) · 246 unmodified lines | |||
| 1368 | 1386 | ||
| 1369 | snaps = calloc(maxsnaps, sizeof(Snap)); | 1387 | snaps = calloc(maxsnaps, sizeof(Snap)); |
| 1370 | 1388 | ||
| 1389 | proccreate(plumbthread, nil, mainstacksize); | ||
| 1390 | |||
| 1371 | for (;;) { | 1391 | for (;;) { |
| 1372 | redraw(complete); | 1392 | redraw(complete); |
| 1373 | complete = false; | 1393 | complete = false; |