summaryrefslogtreecommitdiff
path: root/man/2/devpointer
blob: 6433221c52ecc649e2aaede3a5d922c56f6d2f2b (plain)
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
.TH DEVPOINTER 2 mux
.SH NAME
devpointer \- I/O interface for the pointer device
.SH SYNOPSIS
.EX
include "draw.m";   # for Draw->Pointer
include "devpointer.m";
ptr:= load Devpointer Devpointer->PATH;

init:      fn(file: string, posn: chan of ref Draw->Pointer): int;
bytes2ptr: fn(buf: array of byte)    : ref Draw->Pointer;
ptr2bytes: fn(ptr: ref Draw->Pointer): array of byte;
.EE
.SH DESCRIPTION
.B Devpointer
reads messages from pointer devices with the same data format as
.BR /dev/pointer ,
converting them to
.B Pointer
adts.
.PP
.B Init
spawns a process to read continually the pointer device specified by
.I file
and send a
.B Pointer
adts over the channel specified by
.IR posn .
If
.I file
is
.BR nil ,
the default device is
.BR /dev/pointer .
.PP
.B Bytes2ptr
converts the array of bytes
.I buf
to a
.B Pointer
and returns a reference to it.
.I Buf
should consist of exactly
.B Devpointer->Size
bytes and be in the format returned by
.BR /dev/pointer .
.PP
.B Ptr2bytes
provides the inverse transformation of
.BR bytes2ptr :
it packs the data into an array of bytes of appropriate format,
which it returns.
.SH FILES
.B /dev/pointer
.SH "SEE ALSO"
.IR draw-intro (2),
.IR draw-pointer (2)