| plan 9 kernel history: overview | file list | diff list |
1993/1009/port/devmouse.c (diff list | history)
| 1993/1008/sys/src/9/port/devmouse.c:62,67 – 1993/1009/sys/src/9/port/devmouse.c:62,68 (short | long | prev | next) | ||
| 1993/1006 | int mouseshifted; int mousetype; int hwcurs; | |
| 1993/1009 | Cursor curs; | |
| 1993/1006 | Cursor arrow = { | |
| 1993/1008/sys/src/9/port/devmouse.c:116,126 – 1993/1009/sys/src/9/port/devmouse.c:117,129 | ||
| 1993/1006 | enum{ Qdir, | |
| 1993/1009 | Qcursor, | |
| 1993/1006 | Qmouse, Qmousectl, }; Dirtab mousedir[]={ | |
| 1993/1009 | "cursor", {Qcursor}, 0, 0666, | |
| 1993/1006 | "mouse", {Qmouse}, 0, 0666, "mousectl", {Qmousectl}, 0, 0220, }; | |
| 1993/1008/sys/src/9/port/devmouse.c:141,146 – 1993/1009/sys/src/9/port/devmouse.c:144,150 | ||
| 1993/1006 | if(r == 0) flipping = 1; flipping = 0; /* howard, why is this necessary to get a black arrow on carrera? */ | |
| 1993/1009 | curs = arrow; | |
| 1993/1006 | Cursortocursor(&arrow); } | |
| 1993/1008/sys/src/9/port/devmouse.c:244,249 – 1993/1009/sys/src/9/port/devmouse.c:248,259 | ||
| 1993/1006 | lock(&mouse); if(c->qid.path == Qmouse) mouse.open = 0; | |
| 1993/1009 | if(--mouse.ref == 0){ cursoroff(1); curs = arrow; Cursortocursor(&arrow); cursoron(1); } | |
| 1993/1006 | unlock(&mouse); } } | |
| 1993/1008/sys/src/9/port/devmouse.c:252,263 – 1993/1009/sys/src/9/port/devmouse.c:262,289 | ||
| 1993/1006 | mouseread(Chan *c, void *va, long n, ulong offset) { | |
| 1993/1008 | char buf[4*12+1]; | |
| 1993/1009 | uchar *p; | |
| 1993/1006 |
| |
| 1993/1009 | p = va; switch(c->qid.path){ case CHDIR: | |
| 1993/1006 | return devdirread(c, va, n, mousedir, NMOUSE, devgen); | |
| 1993/1009 | case Qcursor: if(offset != 0) return 0; if(n < 2*4+2*2*16) error(Eshort); n = 2*4+2*2*16; lock(&cursor); BPLONG(p+0, curs.offset.x); BPLONG(p+4, curs.offset.y); memmove(p+8, curs.clr, 2*16); memmove(p+40, curs.set, 2*16); unlock(&cursor); return n; case Qmouse: | |
| 1993/1006 | while(mousechanged(0) == 0) sleep(&mouse.r, mousechanged, 0); lock(&cursor); | |
| 1993/1008/sys/src/9/port/devmouse.c:281,291 – 1993/1009/sys/src/9/port/devmouse.c:307,332 | ||
| 1993/1006 | Point pt; char buf[64]; | |
| 1993/1009 | p = va; | |
| 1993/1006 | switch(c->qid.path){ case CHDIR: error(Eisdir); | |
| 1993/1009 | case Qcursor: cursoroff(1); if(n < 2*4+2*2*16){ curs = arrow; Cursortocursor(&arrow); }else{ n = 2*4+2*2*16; curs.offset.x = BGLONG(p+0); curs.offset.y = BGLONG(p+4); memmove(curs.clr, p+8, 2*16); memmove(curs.set, p+40, 2*16); Cursortocursor(&curs); } cursoron(1); return n; | |
| 1993/1006 | case Qmousectl: if(n >= sizeof(buf)) | |