Annotation of 43BSD/contrib/X/CLUlib/sun/x_pixmap.clu, revision 1.1.1.1

1.1       root        1: % Copyright    Barbara Liskov    1985, 1986
                      2: 
                      3: x_pixmap = cluster is none, create, create_xy, create_z, tile, destroy, shape,
                      4:                      get_id, equal, similar, copy
                      5: 
                      6: rep = int
                      7: 
                      8: none = proc () returns (cvt)
                      9:     return(0)
                     10:     end none
                     11: 
                     12: create = proc (mask: x_bitmap, fore, back: int) returns (cvt)
                     13:           signals (error(string))
                     14:     x_buf$setup(x_makepixmap, 0, 0, 0)
                     15:     x_buf$set_l0s23(b2i(mask), fore, back)
                     16:     x_buf$receive()
                     17:        resignal error
                     18:     return(x_buf$get_lp0())
                     19:     end create
                     20: 
                     21: create_xy = proc (width, height: int, bits: _wordvec) returns (cvt)
                     22:              signals (error(string))
                     23:     x_buf$setup(x_storepixmap, XYFormat, 0, 0)
                     24:     x_buf$set_s01(height, width)
                     25:     x_buf$send_data(w2b(bits), 1,
                     26:                    ((width + 15) / 16) * height * 2 * x_display$planes())
                     27:     x_buf$receive()
                     28:        resignal error
                     29:     return(x_buf$get_lp0())
                     30:     end create_xy
                     31: 
                     32: create_z = proc (width, height: int, bits: _wordvec) returns (cvt)
                     33:             signals (error(string))
                     34:     x_buf$setup(x_storepixmap, ZFormat, 0, 0)
                     35:     x_buf$set_s01(height, width)
                     36:     z: int := width * height
                     37:     if x_display$planes() > 8
                     38:        then z := z + z end
                     39:     x_buf$send_data(w2b(bits), 1, z)
                     40:     x_buf$receive()
                     41:        resignal error
                     42:     return(x_buf$get_lp0())
                     43:     end create_z
                     44: 
                     45: tile = proc (pixel: int) returns (cvt) signals (error(string))
                     46:     x_buf$setup(x_makepixmap, 0, 0, 0)
                     47:     x_buf$set_l0s23(0, pixel, 0)
                     48:     x_buf$receive()
                     49:        resignal error
                     50:     return(x_buf$get_lp0())
                     51:     end tile
                     52: 
                     53: destroy = proc (pix: cvt)
                     54:     x_buf$setup(x_freepixmap, 0, 0, 0)
                     55:     x_buf$set_l0(pix)
                     56:     end destroy
                     57: 
                     58: shape = proc (width, height: int) returns (int, int) signals (error(string))
                     59:     x_buf$setup(x_queryshape, TileShape, 0, 0)
                     60:     x_buf$set_s01(height, width)
                     61:     x_buf$receive()
                     62:        resignal error
                     63:     return(x_buf$get_sp1(), x_buf$get_sp0())
                     64:     end shape
                     65: 
                     66: get_id = proc (pix: cvt) returns (int)
                     67:     return(pix)
                     68:     end get_id
                     69: 
                     70: equal = proc (pix1, pix2: cvt) returns (bool)
                     71:     return(pix1 = pix2)
                     72:     end equal
                     73: 
                     74: similar = proc (pix1, pix2: cvt) returns (bool)
                     75:     return(pix1 = pix2)
                     76:     end similar
                     77: 
                     78: copy = proc (pix: cvt) returns (cvt)
                     79:     return(pix)
                     80:     end copy
                     81: 
                     82: end x_pixmap

unix.superglobalmegacorp.com

This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.