Unified · Split
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
| @@ -1,2 +1,2 @@ | ||
| 1 | 1 | #! /system/xbin/bash |
| 2 | −echo "wm/wm" | /data/inferno/Linux/arm/bin/emu-g | |
| 2 | +echo "wm/wm" | /data/inferno/Android/arm/bin/emu-g | |
| @@ -83,6 +83,7 @@ init(ctxt: ref Draw->Context, nil: list of string) · 82 unmodified lines | ||
| 83 | 83 | tk->cmd(t, conv_window[i]); |
| 84 | 84 | |
| 85 | 85 | convs := loadconvos(); |
| 86 | + tk->cmd(t, ".f.lb insert end New"); | |
| 86 | 87 | for (; convs != nil; convs = tl convs) |
| 87 | 88 | tk->cmd(t, ".f.lb insert end '"+ hd convs); |
| 88 | 89 | |
| @@ -110,7 +111,10 @@ init(ctxt: ref Draw->Context, nil: list of string) · 21 unmodified lines | ||
| 110 | 111 | sys->print("read %s\n", u); |
| 111 | 112 | if (u != nil) { |
| 112 | 113 | #break; |
| 113 | − spawn readthread(ctxt, u); | |
| 114 | + if (u == "New") | |
| 115 | + spawn newmsg(ctxt); | |
| 116 | + else | |
| 117 | + spawn readthread(ctxt, u); | |
| 114 | 118 | } |
| 115 | 119 | tk->cmd(t, ".f.lb selection clear 0"); |
| 116 | 120 | } |
| @@ -125,6 +129,53 @@ init(ctxt: ref Draw->Context, nil: list of string) · 8 unmodified lines | ||
| 125 | 129 | } |
| 126 | 130 | } |
| 127 | 131 | |
| 132 | +newmsg(ctxt: ref Draw->Context) | |
| 133 | +{ | |
| 134 | + (t, wmchan) := tkclient->toplevel(ctxt, nil, "New message", 0); | |
| 135 | + cmd := chan of string; | |
| 136 | + tk->namechan(t, cmd, "cmd"); | |
| 137 | + | |
| 138 | + tk->cmd(t, "frame .f"); | |
| 139 | + tk->cmd(t, "label .f.l -font /fonts/lucida/unicode.12.font -text {Enter Number}"); | |
| 140 | + tk->cmd(t, "entry .f.e -font /fonts/lucida/unicode.12.font"); | |
| 141 | + tk->cmd(t, "button .f.b -text {Ok} -font /fonts/lucida/unicode.12.font -command {send cmd ok}"); | |
| 142 | + tk->cmd(t, "pack .f.l .f.e .f.b -in .f"); | |
| 143 | + tk->cmd(t, "pack .f"); | |
| 144 | + tk->cmd(t, ".pack propagate . 0"); | |
| 145 | + tk->cmd(t, "update"); | |
| 146 | + tkclient->onscreen(t, "onscreen"); | |
| 147 | + | |
| 148 | + tkclient->startinput(t, "kbd"::"ptr"::nil); | |
| 149 | + for (;;) { | |
| 150 | + alt { | |
| 151 | + s := <-t.ctxt.kbd => | |
| 152 | + tk->keyboard(t, s); | |
| 153 | + s := <-t.ctxt.ptr => | |
| 154 | + tk->pointer(t, *s); | |
| 155 | + s := <-t.ctxt.ctl or | |
| 156 | + s = <-t.wreq or | |
| 157 | + s = <-wmchan => | |
| 158 | + tkclient->wmctl(t, s); | |
| 159 | + s := <-cmd => | |
| 160 | + sys->print("read %s\n", s); | |
| 161 | + if (s == "ok") { | |
| 162 | + num := tk->cmd(t, ".f.e get"); | |
| 163 | + sys->print("number: %s\n", num); | |
| 164 | + | |
| 165 | + filename := "/usr/"+rf("/dev/user")+"/lib/sms/"+num; | |
| 166 | + | |
| 167 | + (ret, dir) := sys->stat(filename); | |
| 168 | + if (ret == -1) { | |
| 169 | + fd := sys->create(filename, Sys->OWRITE, 8r770); | |
| 170 | + #fd.close(fd); | |
| 171 | + } | |
| 172 | + spawn readthread(ctxt, num); | |
| 173 | + return; | |
| 174 | + } | |
| 175 | + } | |
| 176 | + } | |
| 177 | +} | |
| 178 | + | |
| 128 | 179 | # We spawn a new window so we could, theoretically, minimize this |
| 129 | 180 | # and go open a new thread to read at the same time. |
| 130 | 181 | readthread(ctxt: ref Draw->Context, u: string) |
| @@ -216,6 +267,7 @@ convupdater(t: ref Tk->Toplevel, pid: chan of int) · 85 unmodified lines | ||
| 216 | 267 | if (dirstat.mtime > lastmtime) { |
| 217 | 268 | convs := loadconvos(); |
| 218 | 269 | tk->cmd(t, ".f.lb delete 0 end"); |
| 270 | + tk->cmd(t, ".f.lb insert end New"); | |
| 219 | 271 | for (; convs != nil; convs = tl convs) |
| 220 | 272 | tk->cmd(t, ".f.lb insert end '"+ hd convs); |
| 221 | 273 | tk->cmd(t, "update"); |
| @@ -88,5 +88,4 @@ void modinit(void){ · 87 unmodified lines | ||
| 88 | 88 | |
| 89 | 89 | int dontcompile = 1; |
| 90 | 90 | char* conffile = "emu-g"; |
| 91 | −#define KERNDATE 0 | |
| 92 | 91 | ulong kerndate = KERNDATE; |
| @@ -34,7 +34,7 @@ enum · 33 unmodified lines | ||
| 34 | 34 | NSTACKSPERALLOC = 16, |
| 35 | 35 | X11STACK= 256*1024 |
| 36 | 36 | }; |
| 37 | −char *hosttype = "Linux"; | |
| 37 | +char *hosttype = "Android"; | |
| 38 | 38 | |
| 39 | 39 | extern void unlockandexit(int*); |
| 40 | 40 | extern void executeonnewstack(void*, void (*f)(void*), void*); |
| @@ -30,7 +30,7 @@ enum · 29 unmodified lines | ||
| 30 | 30 | NSTACKSPERALLOC = 16, |
| 31 | 31 | X11STACK= 256*1024 |
| 32 | 32 | }; |
| 33 | −char *hosttype = "Linux"; | |
| 33 | +char *hosttype = "Android"; | |
| 34 | 34 | |
| 35 | 35 | typedef sem_t Sem; |
| 36 | 36 | |
| @@ -453,10 +453,6 @@ extern Queue* gkbdq; · 452 unmodified lines | ||
| 453 | 453 | extern Queue* gkscanq; |
| 454 | 454 | extern int Xsize; |
| 455 | 455 | extern int Ysize; |
| 456 | −extern int rotation_opt; | |
| 457 | −extern char **eventfiles; | |
| 458 | −extern int eventfds[MAX_EVENTFDS]; | |
| 459 | −extern Queue *eventq; | |
| 460 | 456 | extern Pool* mainmem; |
| 461 | 457 | extern char rootdir[MAXROOT]; /* inferno root */ |
| 462 | 458 | extern Procs procs; |
| @@ -466,11 +462,19 @@ extern int globfs; · 3 unmodified lines | ||
| 466 | 462 | extern int greyscale; |
| 467 | 463 | extern uint qiomaxatomic; |
| 468 | 464 | extern int displaydepth; |
| 465 | + | |
| 466 | +// Android stuff | |
| 467 | +extern char **eventfiles; | |
| 468 | +extern int eventfds[MAX_EVENTFDS]; | |
| 469 | +extern Queue *eventq; | |
| 470 | +#ifdef ANDROID | |
| 471 | +extern int rotation_opt; | |
| 469 | 472 | extern char* mousefile; |
| 470 | 473 | extern char type; |
| 471 | 474 | extern int maineventnum; |
| 472 | 475 | extern char* homedevice; |
| 473 | 476 | extern char* voldevice; |
| 477 | +#endif | |
| 474 | 478 | |
| 475 | 479 | /* |
| 476 | 480 | * floating point control and status register masks |
| @@ -6,8 +6,9 @@ · 5 unmodified lines | ||
| 6 | 6 | #include "draw.h" |
| 7 | 7 | #include "version.h" |
| 8 | 8 | |
| 9 | −/* Android thing */ | |
| 9 | +#ifdef ANDROID | |
| 10 | 10 | #include <cutils/properties.h> |
| 11 | +#endif | |
| 11 | 12 | |
| 12 | 13 | int rebootargc = 0; |
| 13 | 14 | char** rebootargv; |
| @@ -15,12 +16,6 @@ static char *imod = "/dis/emuinit.dis"; · 1 unmodified line | ||
| 15 | 16 | extern char* hosttype; |
| 16 | 17 | char* tkfont; /* for libtk/utils.c */ |
| 17 | 18 | int tkstylus; /* libinterp/tk.c */ |
| 18 | −char* mousefile = "/dev/input/event0"; | |
| 19 | −char type = 's'; | |
| 20 | −int maineventnum = 5; | |
| 21 | −char* homedevice = "/dev/input/event5"; | |
| 22 | −char* voldevice = "/dev/input/event2"; | |
| 23 | −char **eventfiles = NULL; | |
| 24 | 19 | extern int mflag; |
| 25 | 20 | int dflag; |
| 26 | 21 | int vflag; |
| @@ -38,6 +33,15 @@ extern int mflag; · 11 unmodified lines | ||
| 38 | 33 | int displaydepth; |
| 39 | 34 | char *cputype; |
| 40 | 35 | |
| 36 | +#ifdef ANDROID | |
| 37 | +char* mousefile = "/dev/input/event0"; | |
| 38 | +char type = 's'; | |
| 39 | +int maineventnum = 5; | |
| 40 | +char* homedevice = "/dev/input/event5"; | |
| 41 | +char* voldevice = "/dev/input/event2"; | |
| 42 | +#endif | |
| 43 | +char **eventfiles = NULL; | |
| 44 | + | |
| 41 | 45 | static void |
| 42 | 46 | usage(void) |
| 43 | 47 | { |
| @@ -257,8 +261,8 @@ main(int argc, char *argv[]) · 213 unmodified lines | ||
| 257 | 261 | } |
| 258 | 262 | option(argc, argv, usage); |
| 259 | 263 | |
| 264 | +#ifdef ANDROID | |
| 260 | 265 | /* Set up Android-specific things */ |
| 261 | − /* This will definitely need to be factored out later */ | |
| 262 | 266 | tkfont = "/fonts/pelm/ascii.12.font"; |
| 263 | 267 | property_get("ro.product.device", device, ""); |
| 264 | 268 | print("read ro.product.device = %s\n", device); |
| @@ -312,6 +316,7 @@ main(int argc, char *argv[]) · 47 unmodified lines | ||
| 312 | 316 | voldevice = "/dev/input/event0"; |
| 313 | 317 | maineventnum = 0; |
| 314 | 318 | } |
| 319 | +#endif | |
| 315 | 320 | |
| 316 | 321 | eve = strdup("inferno"); |
| 317 | 322 | |
Empty file deleted.