Annotation of 43BSD/contrib/X/CLUlib/vax/x_window.clu, revision 1.1.1.1

1.1       root        1: % Copyright    Barbara Liskov    1985
                      2: 
                      3: x_window = cluster is none, create, create_transparency,
                      4:                      destroy, destroy_subwindows, map, map_subwindows,
                      5:                      unmap, unmap_subwindows, unmap_transparent, raise, lower,
                      6:                      circulate_up, circulate_down, move, change, configure,
                      7:                      set_background, set_border, set_tilemode, set_clipmode,
                      8:                      query, query_tree, get_name, set_name, set_icon,
                      9:                      get_resize, set_resize, set_cursor, set_input,
                     10:                      grab_mouse, ungrab_mouse, grab_button, ungrab_button,
                     11:                      query_mouse, interpret_locator,
                     12:                      warp_mouse, cond_warp_mouse,
                     13:                      focus_keyboard, clear, pix_set, pix_fill, tile_set,
                     14:                      tile_fill, pixmap_put, pixmap_xybitsput, pixmap_zbitsput,
                     15:                      bitmap_bitsput, move_area, copy_area,
                     16:                      text, textv, texta, text_pad, textv_pad, texta_pad,
                     17:                      text_mask, textv_mask, texta_mask,
                     18:                      text_mask_pad, textv_mask_pad, texta_mask_pad,
                     19:                      line, draw,
                     20:                      draw_dashed, draw_patterned, draw_filled, draw_tiled,
                     21:                      save_region, read_xyregion, read_zregion,
                     22:                      get_id, equal, similar, copy
                     23: 
                     24: rep = int
                     25: 
                     26: none = proc () returns (cvt)
                     27:     return(0)
                     28:     end none
                     29: 
                     30: create = proc (x, y, width, height: int, background: x_pixmap, parent: cvt,
                     31:               borderwidth: int, border: x_pixmap) returns (cvt)
                     32:           signals (error(string))
                     33:     or: oreq, er: ereq := x_buf$get()
                     34:     er.code := x_createwindow + (borderwidth * 2**8)
                     35:     er.ewin := parent
                     36:     er.s0 := height
                     37:     or.s1 := width
                     38:     er.s2 := x
                     39:     or.s3 := y
                     40:     lr(er).l2 := border.id
                     41:     lr(er).l3 := background.id
                     42:     x_buf$receive()
                     43:        resignal error
                     44:     return(x_buf$get_lp0())
                     45:     end create
                     46: 
                     47: create_transparency = proc (x, y, width, height: int, parent: cvt) returns (cvt)
                     48:                        signals (error(string))
                     49:     or: oreq, er: ereq := x_buf$get()
                     50:     er.code := x_createtransparency
                     51:     er.ewin := parent
                     52:     er.s0 := height
                     53:     or.s1 := width
                     54:     er.s2 := x
                     55:     or.s3 := y
                     56:     x_buf$receive()
                     57:        resignal error
                     58:     return(x_buf$get_lp0())
                     59:     end create_transparency
                     60: 
                     61: destroy = proc (w: cvt)
                     62:     or: oreq, er: ereq := x_buf$get()
                     63:     er.code := x_destroywindow
                     64:     er.ewin := w
                     65:     end destroy
                     66: 
                     67: destroy_subwindows = proc (w: cvt)
                     68:     or: oreq, er: ereq := x_buf$get()
                     69:     er.code := x_destroysubwindows
                     70:     er.ewin := w
                     71:     end destroy_subwindows
                     72: 
                     73: map = proc (w: cvt)
                     74:     or: oreq, er: ereq := x_buf$get()
                     75:     er.code := x_mapwindow
                     76:     er.ewin := w
                     77:     end map
                     78: 
                     79: map_subwindows = proc (w: cvt)
                     80:     or: oreq, er: ereq := x_buf$get()
                     81:     er.code := x_mapsubwindows
                     82:     er.ewin := w
                     83:     end map_subwindows
                     84: 
                     85: unmap = proc (w: cvt)
                     86:     or: oreq, er: ereq := x_buf$get()
                     87:     er.code := x_unmapwindow
                     88:     er.ewin := w
                     89:    end unmap
                     90: 
                     91: unmap_subwindows = proc (w: cvt)
                     92:     or: oreq, er: ereq := x_buf$get()
                     93:     er.code := x_unmapsubwindows
                     94:     er.ewin := w
                     95:     end unmap_subwindows
                     96: 
                     97: unmap_transparent = proc (w: cvt)
                     98:     or: oreq, er: ereq := x_buf$get()
                     99:     er.code := x_unmaptransparent
                    100:     er.ewin := w
                    101:     end unmap_transparent
                    102: 
                    103: raise = proc (w: cvt)
                    104:     or: oreq, er: ereq := x_buf$get()
                    105:     er.code := x_raisewindow
                    106:     er.ewin := w
                    107:     end raise
                    108: 
                    109: lower = proc (w: cvt)
                    110:     or: oreq, er: ereq := x_buf$get()
                    111:     er.code := x_lowerwindow
                    112:     er.ewin := w
                    113:     end lower
                    114: 
                    115: circulate_up = proc (w: cvt)
                    116:     or: oreq, er: ereq := x_buf$get()
                    117:     er.code := x_circwindowup
                    118:     er.ewin := w
                    119:     end circulate_up
                    120: 
                    121: circulate_down = proc (w: cvt)
                    122:     or: oreq, er: ereq := x_buf$get()
                    123:     er.code := x_circwindowdown
                    124:     er.ewin := w
                    125:     end circulate_down
                    126: 
                    127: move = proc (w: cvt, x, y: int)
                    128:     or: oreq, er: ereq := x_buf$get()
                    129:     er.code := x_movewindow
                    130:     er.ewin := w
                    131:     er.s0 := x
                    132:     or.s1 := y
                    133:     end move
                    134: 
                    135: change = proc (w: cvt, width, height: int)
                    136:     or: oreq, er: ereq := x_buf$get()
                    137:     er.code := x_changewindow
                    138:     er.ewin := w
                    139:     er.s0 := height
                    140:     or.s1 := width
                    141:     end change
                    142: 
                    143: configure = proc (w: cvt, x, y, width, height: int)
                    144:     or: oreq, er: ereq := x_buf$get()
                    145:     er.code := x_configurewindow
                    146:     er.ewin := w
                    147:     er.s0 := height
                    148:     or.s1 := width
                    149:     er.s2 := x
                    150:     or.s3 := y
                    151:     end configure
                    152: 
                    153: set_background = proc (w: cvt, background: x_pixmap)
                    154:     or: oreq, er: ereq := x_buf$get()
                    155:     er.code := x_changebackground
                    156:     er.ewin := w
                    157:     lr(er).l0 := p2i(background)
                    158:     end set_background
                    159: 
                    160: set_border = proc (w: cvt, border: x_pixmap)
                    161:     or: oreq, er: ereq := x_buf$get()
                    162:     er.code := x_changeborder
                    163:     er.ewin := w
                    164:     lr(er).l0 := p2i(border)
                    165:     end set_border
                    166: 
                    167: set_tilemode = proc (w: cvt, relative: bool)
                    168:     or: oreq, er: ereq := x_buf$get()
                    169:     if relative
                    170:        then er.code := x_tilemode + (TileModeRelative * 2**8)
                    171:        else er.code := x_tilemode + (TileModeAbsolute * 2**8)
                    172:        end
                    173:     er.ewin := w
                    174:     end set_tilemode
                    175: 
                    176: set_clipmode = proc (w: cvt, drawthru: bool)
                    177:     or: oreq, er: ereq := x_buf$get()
                    178:     if drawthru
                    179:        then er.code := x_clipmode + (ClipModeDrawThru * 2**8)
                    180:        else er.code := x_clipmode + (ClipModeClipped * 2**8)
                    181:        end
                    182:     er.ewin := w
                    183:     end set_clipmode
                    184: 
                    185: % returns (x, y, width, height, border, map, kind, icon)
                    186: 
                    187: query = proc (w: cvt) returns (int, int, int, int, int, int, int, cvt)
                    188:          signals (error(string))
                    189:     or: oreq, er: ereq := x_buf$get()
                    190:     er.code := x_querywindow
                    191:     er.ewin := w
                    192:     x_buf$receive()
                    193:        resignal error
                    194:     return(x_buf$get_sp2(), x_buf$get_sp3(), x_buf$get_sp1(), x_buf$get_sp0(),
                    195:           x_buf$get_sp4(), x_buf$get_bp10(), x_buf$get_bp11(),
                    196:           x_buf$get_lp3())
                    197:     end query
                    198: 
                    199: query_tree = proc (w: cvt) returns (cvt, wlist) signals (error(string))
                    200:     wlist = array[x_window]
                    201:     or: oreq, er: ereq := x_buf$get()
                    202:     er.code := x_querytree
                    203:     er.ewin := w
                    204:     x_buf$receive()
                    205:        resignal error
                    206:     parent: int := x_buf$get_lp0()
                    207:     n: int := x_buf$get_lp1()
                    208:     subs: wlist := wlist$fill(1, n, up(parent))
                    209:     if n > 0
                    210:        then b: _bytevec := _bytevec$create(n * 4)
                    211:            x_buf$receive_data(b)
                    212:            for i: int in int$from_to(1, n) do
                    213:                subs[i] := up(b2w(b)[i])
                    214:                end
                    215:        end
                    216:     return(parent, subs)
                    217:     end query_tree
                    218: 
                    219: get_name = proc (w: cvt) returns (string) signals (error(string))
                    220:     or: oreq, er: ereq := x_buf$get()
                    221:     er.code := x_fetchname
                    222:     er.ewin := w
                    223:     x_buf$receive()
                    224:        resignal error
                    225:     n: int := x_buf$get_sp0()
                    226:     if n = 0
                    227:        then return("") end
                    228:     b: _bytevec := _bytevec$create(n)
                    229:     x_buf$receive_data(b)
                    230:     return(b2s(b))
                    231:     end get_name
                    232: 
                    233: set_name = proc (w: cvt, n: string)
                    234:     or: oreq, er: ereq := x_buf$get()
                    235:     er.code := x_storename
                    236:     er.ewin := w
                    237:     er.s0 := string$size(n)
                    238:     x_buf$send_data(s2b(n), 1, string$size(n))
                    239:     end set_name
                    240: 
                    241: set_icon = proc (w, icon: cvt)
                    242:     or: oreq, er: ereq := x_buf$get()
                    243:     er.code := x_seticonwindow
                    244:     er.ewin := w
                    245:     lr(er).l0 := icon
                    246:     end set_icon
                    247: 
                    248: get_resize = proc (w: cvt) returns (int, int, int, int) signals (error(string))
                    249:     or: oreq, er: ereq := x_buf$get()
                    250:     er.code := x_getresizehint
                    251:     er.ewin := w
                    252:     x_buf$receive()
                    253:        resignal error
                    254:     return(x_buf$get_sp2(), x_buf$get_sp3(), x_buf$get_sp0(), x_buf$get_sp1())
                    255:     end get_resize
                    256: 
                    257: set_resize = proc (w: cvt, width0, widthinc, height0, heightinc: int)
                    258:     or: oreq, er: ereq := x_buf$get()
                    259:     er.code := x_setresizehint
                    260:     er.ewin := w
                    261:     er.s0 := height0
                    262:     or.s1 := heightinc
                    263:     er.s2 := width0
                    264:     or.s3 := widthinc
                    265:     end set_resize
                    266: 
                    267: set_cursor = proc (w: cvt, cursor: x_cursor)
                    268:     or: oreq, er: ereq := x_buf$get()
                    269:     er.code := x_definecursor
                    270:     er.ewin := w
                    271:     lr(er).l0 := c2i(cursor)
                    272:     end set_cursor
                    273: 
                    274: set_input = proc (w: cvt, mask: int)
                    275:     or: oreq, er: ereq := x_buf$get()
                    276:     er.code := x_selectinput
                    277:     er.ewin := w
                    278:     lr(er).l0 := mask
                    279:     end set_input
                    280: 
                    281: grab_mouse = proc (w: cvt, mask: int, cursor: x_cursor) signals (error(string))
                    282:     or: oreq, er: ereq := x_buf$get()
                    283:     er.code := x_grabmouse
                    284:     er.ewin := w
                    285:     lr(er).l0 := c2i(cursor)
                    286:     lr(er).l1 := mask
                    287:     x_buf$receive()
                    288:        resignal error
                    289:     end grab_mouse
                    290: 
                    291: ungrab_mouse = proc ()
                    292:     or: oreq, er: ereq := x_buf$get()
                    293:     er.code := x_ungrabmouse
                    294:     end ungrab_mouse
                    295: 
                    296: grab_button = proc (w: cvt, button, mask: int, cursor: x_cursor)
                    297:                signals (error(string))
                    298:     or: oreq, er: ereq := x_buf$get()
                    299:     er.code := x_grabbutton
                    300:     or.mask := button
                    301:     er.ewin := w
                    302:     lr(er).l0 := c2i(cursor)
                    303:     lr(er).l1 := mask
                    304:     x_buf$receive()
                    305:        resignal error
                    306:     end grab_button
                    307: 
                    308: ungrab_button = proc (button: int)
                    309:     or: oreq, er: ereq := x_buf$get()
                    310:     er.code := x_ungrabmouse
                    311:     or.mask := button
                    312:     end ungrab_button
                    313: 
                    314: % returns (x, y, window)
                    315: 
                    316: query_mouse = proc (w: cvt) returns (int, int, cvt) signals (error(string))
                    317:     or: oreq, er: ereq := x_buf$get()
                    318:     er.code := x_querymouse
                    319:     er.ewin := w
                    320:     x_buf$receive()
                    321:        resignal error
                    322:     return(x_buf$get_sp2(), x_buf$get_sp3(), x_buf$get_lp0())
                    323:     end query_mouse
                    324: 
                    325: interpret_locator = proc (w: cvt, x, y: int) returns (int, int, cvt)
                    326:                      signals (error(string))
                    327:     or: oreq, er: ereq := x_buf$get()
                    328:     er.code := x_interpretlocator
                    329:     er.ewin := w
                    330:     er.s0 := y
                    331:     or.s1 := x
                    332:     x_buf$receive()
                    333:        resignal error
                    334:     return(x_buf$get_sp2(), x_buf$get_sp3(), x_buf$get_lp0())
                    335:     end interpret_locator
                    336: 
                    337: warp_mouse = proc (w: cvt, x, y: int)
                    338:     or: oreq, er: ereq := x_buf$get()
                    339:     er.code := x_warpmouse
                    340:     er.ewin := w
                    341:     er.s0 := x
                    342:     or.s1 := y
                    343:     lr(er).l1 := down(x_display$root())
                    344:     er.s4 := 0
                    345:     or.s5 := 0
                    346:     er.s6 := 0
                    347:     or.s7 := 0
                    348:     end warp_mouse
                    349: 
                    350: cond_warp_mouse = proc (dstw: cvt, dstx, dsty: int, srcw: cvt,
                    351:                        srcx, srcy, srcwidth, srcheight: int)
                    352:     or: oreq, er: ereq := x_buf$get()
                    353:     er.code := x_warpmouse
                    354:     er.ewin := dstw
                    355:     er.s0 := dstx
                    356:     or.s1 := dsty
                    357:     lr(er).l1 := srcw
                    358:     er.s4 := srcheight
                    359:     or.s5 := srcwidth
                    360:     er.s6 := srcx
                    361:     or.s7 := srcy
                    362:     end cond_warp_mouse
                    363: 
                    364: focus_keyboard = proc (w: cvt)
                    365:     or: oreq, er: ereq := x_buf$get()
                    366:     er.code := x_focuskeyboard
                    367:     er.ewin := w
                    368:     end focus_keyboard
                    369: 
                    370: clear = proc (w: cvt)
                    371:     or: oreq, er: ereq := x_buf$get()
                    372:     er.code := x_clear
                    373:     er.ewin := w
                    374:     end clear
                    375: 
                    376: pix_set = proc (w: cvt, pixel, x, y, width, height: int)
                    377:     or: oreq, er: ereq := x_buf$get()
                    378:     er.code := x_pixfill + (GXcopy * 2**8)
                    379:     or.mask := -1
                    380:     er.ewin := w
                    381:     er.s0 := height
                    382:     or.s1 := width
                    383:     er.s2 := x
                    384:     or.s3 := y
                    385:     er.s4 := pixel
                    386:     lr(er).l3 := 0
                    387:     end pix_set
                    388: 
                    389: pix_fill = proc (w: cvt, pixel: int, mask: x_bitmap, x, y, width, height: int,
                    390:                 func, planes: int)
                    391:     or: oreq, er: ereq := x_buf$get()
                    392:     er.code := x_pixfill + (func * 2**8)
                    393:     or.mask := planes
                    394:     er.ewin := w
                    395:     er.s0 := height
                    396:     or.s1 := width
                    397:     er.s2 := x
                    398:     or.s3 := y
                    399:     er.s4 := pixel
                    400:     lr(er).l3 := b2i(mask)
                    401:     end pix_fill
                    402: 
                    403: tile_set = proc (w: cvt, tile: x_pixmap, x, y, width, height: int)
                    404:     or: oreq, er: ereq := x_buf$get()
                    405:     er.code := x_tilefill + (GXcopy * 2**8)
                    406:     or.mask := -1
                    407:     er.ewin := w
                    408:     er.s0 := height
                    409:     or.s1 := width
                    410:     er.s2 := x
                    411:     or.s3 := y
                    412:     lr(er).l2 := p2i(tile)
                    413:     lr(er).l3 := 0
                    414:     end tile_set
                    415: 
                    416: tile_fill = proc (w: cvt, tile: x_pixmap, mask: x_bitmap,
                    417:                  x, y, width, height, func, planes: int)
                    418:     or: oreq, er: ereq := x_buf$get()
                    419:     er.code := x_tilefill + (func * 2**8)
                    420:     or.mask := planes
                    421:     er.ewin := w
                    422:     er.s0 := height
                    423:     or.s1 := width
                    424:     er.s2 := x
                    425:     or.s3 := y
                    426:     lr(er).l2 := p2i(tile)
                    427:     lr(er).l3 := b2i(mask)
                    428:     end tile_fill
                    429: 
                    430: pixmap_put = proc (w: cvt, pix: x_pixmap,
                    431:                   srcx, srcy, width, height, dstx, dsty, func, planes: int)
                    432:     or: oreq, er: ereq := x_buf$get()
                    433:     er.code := x_pixmapput + (func * 2**8)
                    434:     or.mask := planes
                    435:     er.ewin := w
                    436:     er.s0 := height
                    437:     or.s1 := width
                    438:     er.s2 := srcx
                    439:     or.s3 := srcy
                    440:     lr(er).l2 := p2i(pix)
                    441:     er.s6 := dstx
                    442:     or.s7 := dsty
                    443:     end pixmap_put
                    444: 
                    445: pixmap_zbitsput = proc (w: cvt, width, height: int, bits: _wordvec,
                    446:                        mask: x_bitmap, x, y, func, planes: int)
                    447:     or: oreq, er: ereq := x_buf$get()
                    448:     er.code := x_pixmapbitsput + (func * 2**8)
                    449:     or.mask := planes
                    450:     er.ewin := w
                    451:     er.s0 := height
                    452:     or.s1 := width
                    453:     er.s2 := x
                    454:     or.s3 := y
                    455:     er.s4 := ZFormat
                    456:     lr(er).l3 := b2i(mask)
                    457:     z: int := width * height
                    458:     if x_display$planes() > 8
                    459:        then z := z + z end
                    460:     x_buf$send_data(w2b(bits), 1, z)
                    461:     end pixmap_zbitsput
                    462: 
                    463: pixmap_xybitsput = proc (w: cvt, width, height: int, bits: _wordvec,
                    464:                         mask: x_bitmap, x, y, func, planes: int)
                    465:     or: oreq, er: ereq := x_buf$get()
                    466:     er.code := x_pixmapbitsput + (func * 2**8)
                    467:     or.mask := planes
                    468:     er.ewin := w
                    469:     er.s0 := height
                    470:     or.s1 := width
                    471:     er.s2 := x
                    472:     or.s3 := y
                    473:     er.s4 := XYFormat
                    474:     lr(er).l3 := b2i(mask)
                    475:     x_buf$send_data(w2b(bits), 1,
                    476:                    ((width + 15) / 16) * height * 2 * x_display$planes())
                    477:     end pixmap_xybitsput
                    478: 
                    479: bitmap_bitsput = proc (w: cvt, width, height: int, bits: _wordvec,
                    480:                       fore, back: int, mask: x_bitmap, x, y, func, planes: int)
                    481:     or: oreq, er: ereq := x_buf$get()
                    482:     er.code := x_bitmapbitsput + (func * 2**8)
                    483:     or.mask := planes
                    484:     er.ewin := w
                    485:     er.s0 := height
                    486:     or.s1 := width
                    487:     er.s2 := x
                    488:     or.s3 := y
                    489:     er.s4 := fore
                    490:     or.s5 := back
                    491:     lr(er).l3 := b2i(mask)
                    492:     x_buf$send_data(w2b(bits), 1, ((width + 15) / 16) * height * 2)
                    493:     end bitmap_bitsput
                    494: 
                    495: move_area = proc (w: cvt, srcx, srcy, width, height, dstx, dsty: int)
                    496:     or: oreq, er: ereq := x_buf$get()
                    497:     er.code := x_copyarea + (GXcopy * 2**8)
                    498:     or.mask := -1
                    499:     er.ewin := w
                    500:     er.s0 := height
                    501:     or.s1 := width
                    502:     er.s2 := srcx
                    503:     or.s3 := srcy
                    504:     er.s6 := dstx
                    505:     or.s7 := dsty
                    506:     end move_area
                    507: 
                    508: copy_area = proc (w: cvt, srcx, srcy, width, height, dstx, dsty: int,
                    509:                  func, planes: int)
                    510:     or: oreq, er: ereq := x_buf$get()
                    511:     er.code := x_copyarea + (func * 2**8)
                    512:     or.mask := planes
                    513:     er.ewin := w
                    514:     er.s0 := height
                    515:     or.s1 := width
                    516:     er.s2 := srcx
                    517:     or.s3 := srcy
                    518:     er.s6 := dstx
                    519:     or.s7 := dsty
                    520:     end copy_area
                    521: 
                    522: text = proc (w: cvt, s: string, font: x_font, fore, back, x, y: int)
                    523:     or: oreq, er: ereq := x_buf$get()
                    524:     er.code := x_text + (GXcopy * 2**8)
                    525:     or.mask := -1
                    526:     er.ewin := w
                    527:     er.s0 := x
                    528:     or.s1 := y
                    529:     lr(er).l1 := f2i(font)
                    530:     er.s4 := fore
                    531:     or.s5 := back
                    532:     er.s6 := string$size(s)
                    533:     x_buf$send_data(s2b(s), 1, string$size(s))
                    534:     end text
                    535: 
                    536: textv = proc (w: cvt, b: _bytevec, start, z: int, font: x_font,
                    537:              fore, back, x, y: int)
                    538:     or: oreq, er: ereq := x_buf$get()
                    539:     er.code := x_text + (GXcopy * 2**8)
                    540:     or.mask := -1
                    541:     er.ewin := w
                    542:     er.s0 := x
                    543:     or.s1 := y
                    544:     lr(er).l1 := f2i(font)
                    545:     er.s4 := fore
                    546:     or.s5 := back
                    547:     er.s6 := z
                    548:     x_buf$send_data(b, start, z)
                    549:     end textv
                    550: 
                    551: texta = proc (w: cvt, a: array[char], start, z: int, font: x_font,
                    552:              fore, back, x, y: int)
                    553:     or: oreq, er: ereq := x_buf$get()
                    554:     er.code := x_text + (GXcopy * 2**8)
                    555:     or.mask := -1
                    556:     er.ewin := w
                    557:     er.s0 := x
                    558:     or.s1 := y
                    559:     lr(er).l1 := f2i(font)
                    560:     er.s4 := fore
                    561:     or.s5 := back
                    562:     er.s6 := z
                    563:     x_buf$send_array(a, start, z)
                    564:     end texta
                    565: 
                    566: text_pad = proc (w: cvt, s: string, font: x_font, fore, back, cpad, spad: int,
                    567:                 x, y: int, func, planes: int)
                    568:     or: oreq, er: ereq := x_buf$get()
                    569:     er.code := x_text + (func * 2**8)
                    570:     or.mask := planes
                    571:     er.ewin := w
                    572:     er.s0 := x
                    573:     or.s1 := y
                    574:     lr(er).l1 := f2i(font)
                    575:     er.s4 := fore
                    576:     or.s5 := back
                    577:     er.s6 := string$size(s)
                    578:     or.s7 := (cpad // 2**8) + (spad * 2**8)
                    579:     x_buf$send_data(s2b(s), 1, string$size(s))
                    580:     end text_pad
                    581: 
                    582: textv_pad = proc (w: cvt, b: _bytevec, start, z: int, font: x_font,
                    583:                  fore, back, cpad, spad: int, x, y: int, func, planes: int)
                    584:     or: oreq, er: ereq := x_buf$get()
                    585:     er.code := x_text + (func * 2**8)
                    586:     or.mask := planes
                    587:     er.ewin := w
                    588:     er.s0 := x
                    589:     or.s1 := y
                    590:     lr(er).l1 := f2i(font)
                    591:     er.s4 := fore
                    592:     or.s5 := back
                    593:     er.s6 := z
                    594:     or.s7 := (cpad // 2**8) + (spad * 2**8)
                    595:     x_buf$send_data(b, start, z)
                    596:     end textv_pad
                    597: 
                    598: texta_pad = proc (w: cvt, a: array[char], start, z: int, font: x_font,
                    599:                  fore, back, cpad, spad: int, x, y: int, func, planes: int)
                    600:     or: oreq, er: ereq := x_buf$get()
                    601:     er.code := x_text + (func * 2**8)
                    602:     or.mask := planes
                    603:     er.ewin := w
                    604:     er.s0 := x
                    605:     or.s1 := y
                    606:     lr(er).l1 := f2i(font)
                    607:     er.s4 := fore
                    608:     or.s5 := back
                    609:     er.s6 := z
                    610:     or.s7 := (cpad // 2**8) + (spad * 2**8)
                    611:     x_buf$send_array(a, start, z)
                    612:     end texta_pad
                    613: 
                    614: text_mask = proc (w: cvt, s: string, font: x_font, pixel, x, y: int)
                    615:     or: oreq, er: ereq := x_buf$get()
                    616:     er.code := x_textmask + (GXcopy * 2**8)
                    617:     or.mask := -1
                    618:     er.ewin := w
                    619:     er.s0 := x
                    620:     or.s1 := y
                    621:     lr(er).l1 := f2i(font)
                    622:     er.s4 := pixel
                    623:     er.s6 := string$size(s)
                    624:     x_buf$send_data(s2b(s), 1, string$size(s))
                    625:     end text_mask
                    626: 
                    627: textv_mask = proc (w: cvt, b: _bytevec, start, z: int, font: x_font,
                    628:                   pixel, x, y: int)
                    629:     or: oreq, er: ereq := x_buf$get()
                    630:     er.code := x_textmask + (GXcopy * 2**8)
                    631:     or.mask := -1
                    632:     er.ewin := w
                    633:     er.s0 := x
                    634:     or.s1 := y
                    635:     lr(er).l1 := f2i(font)
                    636:     er.s4 := pixel
                    637:     er.s6 := z
                    638:     x_buf$send_data(b, start, z)
                    639:     end textv_mask
                    640: 
                    641: texta_mask = proc (w: cvt, a: array[char], start, z: int, font: x_font,
                    642:                   pixel, x, y: int)
                    643:     or: oreq, er: ereq := x_buf$get()
                    644:     er.code := x_textmask + (GXcopy * 2**8)
                    645:     or.mask := -1
                    646:     er.ewin := w
                    647:     er.s0 := x
                    648:     or.s1 := y
                    649:     lr(er).l1 := f2i(font)
                    650:     er.s4 := pixel
                    651:     er.s6 := z
                    652:     x_buf$send_array(a, start, z)
                    653:     end texta_mask
                    654: 
                    655: text_mask_pad = proc (w: cvt, s: string, font: x_font, pixel, cpad, spad: int,
                    656:                      x, y: int, func, planes: int)
                    657:     or: oreq, er: ereq := x_buf$get()
                    658:     er.code := x_textmask + (func * 2**8)
                    659:     or.mask := planes
                    660:     er.ewin := w
                    661:     er.s0 := x
                    662:     or.s1 := y
                    663:     lr(er).l1 := f2i(font)
                    664:     er.s4 := pixel
                    665:     er.s6 := string$size(s)
                    666:     or.s7 := (cpad // 2**8) + (spad * 2**8)
                    667:     x_buf$send_data(s2b(s), 1, string$size(s))
                    668:     end text_mask_pad
                    669: 
                    670: textv_mask_pad = proc (w: cvt, b: _bytevec, start, z: int, font: x_font,
                    671:                       pixel, cpad, spad: int, x, y: int, func, planes: int)
                    672:     or: oreq, er: ereq := x_buf$get()
                    673:     er.code := x_textmask + (func * 2**8)
                    674:     or.mask := planes
                    675:     er.ewin := w
                    676:     er.s0 := x
                    677:     or.s1 := y
                    678:     lr(er).l1 := f2i(font)
                    679:     er.s4 := pixel
                    680:     er.s6 := z
                    681:     or.s7 := (cpad // 2**8) + (spad * 2**8)
                    682:     x_buf$send_data(b, start, z)
                    683:     end textv_mask_pad
                    684: 
                    685: texta_mask_pad = proc (w: cvt, a: array[char], start, z: int, font: x_font,
                    686:                       pixel, cpad, spad: int, x, y: int, func, planes: int)
                    687:     or: oreq, er: ereq := x_buf$get()
                    688:     er.code := x_textmask + (func * 2**8)
                    689:     or.mask := planes
                    690:     er.ewin := w
                    691:     er.s0 := x
                    692:     or.s1 := y
                    693:     lr(er).l1 := f2i(font)
                    694:     er.s4 := pixel
                    695:     er.s6 := z
                    696:     or.s7 := (cpad // 2**8) + (spad * 2**8)
                    697:     x_buf$send_array(a, start, z)
                    698:     end texta_mask_pad
                    699: 
                    700: line = proc (w: cvt, pixel, width, height, x1, y1, x2, y2, func, planes: int)
                    701:     or: oreq, er: ereq := x_buf$get()
                    702:     er.code := x_line + (func * 2**8)
                    703:     or.mask := planes
                    704:     er.ewin := w
                    705:     er.s0 := x1
                    706:     or.s1 := y1
                    707:     er.s2 := x2
                    708:     or.s3 := y2
                    709:     er.s4 := pixel
                    710:     or.s5 := (height // 2**8) + (width * 2**8)
                    711:     end line
                    712: 
                    713: draw = proc (w: cvt, verts: x_vlist, z, pixel, width, height, func, planes: int)
                    714:     or: oreq, er: ereq := x_buf$get()
                    715:     er.code := x_draw + (func * 2**8)
                    716:     or.mask := planes
                    717:     er.ewin := w
                    718:     er.s0 := z
                    719:     or.s1 := pixel
                    720:     er.s2 := (height // 2**8) + (width * 2**8)
                    721:     or.s3 := DrawSolidLine
                    722:     x_buf$send_data(v2b(verts), 1, 6 * z)
                    723:     end draw
                    724: 
                    725: draw_dashed = proc (w: cvt, verts: x_vlist, z, pixel, width, height: int,
                    726:                    pattern, patlen, patmul, func, planes: int)
                    727:     or: oreq, er: ereq := x_buf$get()
                    728:     er.code := x_draw + (func * 2**8)
                    729:     or.mask := planes
                    730:     er.ewin := w
                    731:     er.s0 := z
                    732:     or.s1 := pixel
                    733:     er.s2 := (height // 2**8) + (width * 2**8)
                    734:     or.s3 := DrawDashedLine
                    735:     or.s5 := pattern
                    736:     er.s6 := patlen
                    737:     or.s7 := patmul
                    738:     x_buf$send_data(v2b(verts), 1, 6 * z)
                    739:     end draw_dashed
                    740: 
                    741: draw_patterned = proc (w: cvt, verts: x_vlist, z, pixel, altpix: int,
                    742:                        width, height, pattern, patlen, patmul, func, planes: int)
                    743:     or: oreq, er: ereq := x_buf$get()
                    744:     er.code := x_draw + (func * 2**8)
                    745:     or.mask := planes
                    746:     er.ewin := w
                    747:     er.s0 := z
                    748:     or.s1 := pixel
                    749:     er.s2 := (height // 2**8) + (width * 2**8)
                    750:     or.s3 := DrawPatternedLine
                    751:     er.s4 := altpix
                    752:     or.s5 := pattern
                    753:     er.s6 := patlen
                    754:     or.s7 := patmul
                    755:     x_buf$send_data(v2b(verts), 1, 6 * z)
                    756:     end draw_patterned
                    757: 
                    758: draw_filled = proc (w: cvt, verts: x_vlist, z, pixel, func, planes: int)
                    759:     or: oreq, er: ereq := x_buf$get()
                    760:     er.code := x_drawfilled + (func * 2**8)
                    761:     or.mask := planes
                    762:     er.ewin := w
                    763:     er.s0 := z
                    764:     or.s1 := pixel
                    765:     lr(er).l1 := 0
                    766:     x_buf$send_data(v2b(verts), 1, 6 * z)
                    767:     end draw_filled
                    768: 
                    769: draw_tiled = proc (w: cvt, verts: x_vlist, z: int, tile: x_pixmap,
                    770:                   func, planes: int)
                    771:     or: oreq, er: ereq := x_buf$get()
                    772:     er.code := x_drawfilled + (func * 2**8)
                    773:     or.mask := planes
                    774:     er.ewin := w
                    775:     er.s0 := z
                    776:     lr(er).l1 := p2i(tile)
                    777:     x_buf$send_data(v2b(verts), 1, 6 * z)
                    778:     end draw_tiled
                    779: 
                    780: save_region = proc (w: cvt, x, y, width, height: int) returns (x_pixmap)
                    781:                signals (error(string))
                    782:     or: oreq, er: ereq := x_buf$get()
                    783:     er.code := x_pixmapsave
                    784:     er.ewin := w
                    785:     er.s0 := height
                    786:     or.s1 := width
                    787:     er.s2 := x
                    788:     or.s3 := y
                    789:     x_buf$receive()
                    790:        resignal error
                    791:     return(_cvt[int, x_pixmap](x_buf$get_lp0()))
                    792:     end save_region
                    793: 
                    794: read_xyregion = proc (w: cvt, x, y, width, height: int) returns (_wordvec)
                    795:                signals (error(string))
                    796:     or: oreq, er: ereq := x_buf$get()
                    797:     er.code := x_pixmapget + (XYFormat * 2**8)
                    798:     er.ewin := w
                    799:     er.s0 := height
                    800:     or.s1 := width
                    801:     er.s2 := x
                    802:     or.s3 := y
                    803:     x_buf$receive()
                    804:        resignal error
                    805:     b: _bytevec := _bytevec$create(x_buf$get_lp0())
                    806:     x_buf$receive_data(b)
                    807:     return(b2w(b))
                    808:     end read_xyregion
                    809: 
                    810: read_zregion = proc (w: cvt, x, y, width, height: int) returns (_wordvec)
                    811:                signals (error(string))
                    812:     or: oreq, er: ereq := x_buf$get()
                    813:     er.code := x_pixmapget + (ZFormat * 2**8)
                    814:     er.ewin := w
                    815:     er.s0 := height
                    816:     or.s1 := width
                    817:     er.s2 := x
                    818:     or.s3 := y
                    819:     x_buf$receive()
                    820:        resignal error
                    821:     b: _bytevec := _bytevec$create(x_buf$get_lp0())
                    822:     x_buf$receive_data(b)
                    823:     return(b2w(b))
                    824:     end read_zregion
                    825: 
                    826: get_id = proc (w: cvt) returns (int)
                    827:     return(w)
                    828:     end get_id
                    829: 
                    830: equal = proc (w1, w2: cvt) returns (bool)
                    831:     return(w1 = w2)
                    832:     end equal
                    833: 
                    834: similar = proc (w1, w2: cvt) returns (bool)
                    835:     return(w1 = w2)
                    836:     end similar
                    837: 
                    838: copy = proc (w: cvt) returns (cvt)
                    839:     return(w)
                    840:     end copy
                    841: 
                    842: end x_window

unix.superglobalmegacorp.com

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