% Copyright Barbara Liskov 1985 x_pixmap = cluster is none, create, create_xy, create_z, tile, destroy, shape, get_id, equal, similar, copy rep = int none = proc () returns (cvt) return(0) end none create = proc (mask: x_bitmap, fore, back: int) returns (cvt) signals (error(string)) or: oreq, er: ereq := x_buf$get() er.code := x_makepixmap lr(er).l0 := b2i(mask) er.s2 := fore or.s3 := back x_buf$receive() resignal error return(x_buf$get_lp0()) end create create_xy = proc (width, height: int, bits: _wordvec) returns (cvt) signals (error(string)) or: oreq, er: ereq := x_buf$get() er.code := x_storepixmap + (XYFormat * 2**8) er.s0 := height or.s1 := width x_buf$send_data(w2b(bits), 1, ((width + 15) / 16) * height * 2 * x_display$planes()) x_buf$receive() resignal error return(x_buf$get_lp0()) end create_xy create_z = proc (width, height: int, bits: _wordvec) returns (cvt) signals (error(string)) or: oreq, er: ereq := x_buf$get() er.code := x_storepixmap + (ZFormat * 2**8) er.s0 := height or.s1 := width z: int := width * height if x_display$planes() > 8 then z := z + z end x_buf$send_data(w2b(bits), 1, z) x_buf$receive() resignal error return(x_buf$get_lp0()) end create_z tile = proc (pixel: int) returns (cvt) signals (error(string)) or: oreq, er: ereq := x_buf$get() er.code := x_makepixmap lr(er).l0 := 0 er.s2 := pixel x_buf$receive() resignal error return(x_buf$get_lp0()) end tile destroy = proc (pix: cvt) or: oreq, er: ereq := x_buf$get() er.code := x_freepixmap lr(er).l0 := pix end destroy shape = proc (width, height: int) returns (int, int) signals (error(string)) or: oreq, er: ereq := x_buf$get() er.code := x_queryshape + (TileShape * 2**8) er.s0 := height or.s1 := width x_buf$receive() resignal error return(x_buf$get_sp1(), x_buf$get_sp0()) end shape get_id = proc (pix: cvt) returns (int) return(pix) end get_id equal = proc (pix1, pix2: cvt) returns (bool) return(pix1 = pix2) end equal similar = proc (pix1, pix2: cvt) returns (bool) return(pix1 = pix2) end similar copy = proc (pix: cvt) returns (cvt) return(pix) end copy end x_pixmap