% Copyright Barbara Liskov 1985 x_bitmap = cluster is none, create, destroy, c2b, get_id, equal, similar, copy rep = int none = proc () returns (cvt) return(0) end none create = proc (width, height: int, bits: _wordvec) returns (cvt) signals (error(string)) or: oreq, er: ereq := x_buf$get() er.code := x_storebitmap er.s0 := height or.s1 := width x_buf$send_data(w2b(bits), 1, ((width + 15) / 16) * height * 2) x_buf$receive() resignal error return(x_buf$get_lp0()) end create destroy = proc (bit: cvt) or: oreq, er: ereq := x_buf$get() er.code := x_freebitmap lr(er).l0 := bit end destroy c2b = proc (font: x_font, c: char) returns (cvt) signals (error(string)) or: oreq, er: ereq := x_buf$get() er.code := x_charbitmap lr(er).l0 := f2i(font) er.s2 := char$c2i(c) x_buf$receive() resignal error return(x_buf$get_lp0()) end c2b get_id = proc (bit: cvt) returns (int) return(bit) end get_id equal = proc (bit1, bit2: cvt) returns (bool) return(bit1 = bit2) end equal similar = proc (bit1, bit2: cvt) returns (bool) return(bit1 = bit2) end similar copy = proc (bit: cvt) returns (cvt) return(bit) end copy end x_bitmap