% Copyright Barbara Liskov 1985
x_cursor = cluster is none, create, cons, destroy, shape,
get_id, equal, similar, copy
none = proc () returns (cvt)
create = proc (image, mask: x_bitmap, fore, back, xoff, yoff, func: int)
returns (cvt) signals (error(string))
or: oreq, er: ereq := x_buf$get()
er.code := x_storecursor + (func * 2**8)
cons = proc (width, height: int, image, mask: _wordvec, fore, back: int,
xoff, yoff, func: int) returns (x_cursor) signals (error(string))
z: int := ((width + 15) / 16) * height * 2
or: oreq, er: ereq := x_buf$get()
x_buf$send_data(w2b(image), 1, z)
if _wordvec$size(mask) ~= 0
then or, er := x_buf$get()
x_buf$send_data(w2b(mask), 1, z)
except when error (why: string):
if _wordvec$size(mask) ~= 0
img: x_bitmap := _cvt[int, x_bitmap](x_buf$get_lp0())
msk: x_bitmap := _cvt[int, x_bitmap](0)
if _wordvec$size(mask) ~= 0
msk := _cvt[int, x_bitmap](x_buf$get_lp0())
cursor: x_cursor := create(img, msk, fore, back, xoff, yoff, func)
if _wordvec$size(mask) ~= 0
then x_bitmap$destroy(msk) end
destroy = proc (cursor: cvt)
or: oreq, er: ereq := x_buf$get()
shape = proc (width, height: int) returns (int, int) signals (error(string))
or: oreq, er: ereq := x_buf$get()
er.code := x_queryshape + (CursorShape * 2**8)
return(x_buf$get_sp1(), x_buf$get_sp2())
get_id = proc (cursor: cvt) returns (int)
equal = proc (cursor1, cursor2: cvt) returns (bool)
return(cursor1 = cursor2)
similar = proc (cursor1, cursor2: cvt) returns (bool)
return(cursor1 = cursor2)
copy = proc (cursor: cvt) returns (cvt)