; _______________________________________________________________________________________
;|                                                                                       |
;| ..::FreshLib::..  Free, open source. Licensed under "BSD 2-clause" license."          |
;|_______________________________________________________________________________________|
;
;  Description: MIT_SHM extension equates.
;
;  Target OS: Linux
;
;  Dependencies:
;
;  Notes:
;_________________________________________________________________________________________


; MIT-SHM minor opcodes

opShmAttach = 1
opShmDetach = 2
opShmPutImage = 3



struct evShmCompletion
  .event        db    ?
                db    ?
  .seq          dw    ?
  .drawable     dd    ?
  .minor_event  dw    ?
  .major_event  db    ?
                db    ?
  .segID        dd    ?
  .offset       dd    ?
                rd    3
ends


struct __xShmAttachReq
  .op         db ?      ; SHM extension major opcode.
  .minor      db ?      ; = opShmAttach
  .length     dw ?      ; = 4
  .segID      dd ?
  .shmID      dd ?
  .read_only  db ?
              rb 3
ends


struct __xShmDetachReq
  .op         db ?      ; SHM extension major opcode.
  .minor      db ?      ; = opShmDetach
  .length     dw ?      ; = 2
  .segID      dd ?
ends


struct __xShmPutImageReq
  .op         db ?      ; SHM extension major opcode.
  .minor      db ?      ; = opShmAttach = 1
  .length     dw ?      ; = 10
  .drawable   dd ?      ; where to draw
  .context    dd ?
  .total_w    dw ?
  .total_h    dw ?
  .src_x      dw ?
  .src_y      dw ?
  .src_w      dw ?
  .src_h      dw ?
  .dst_x      dw ?
  .dst_y      dw ?
  .depth      db ?
  .format     db ?
  .send_event db ?
              db ?
  .segID      dd ?
  .offset     dd ?
ends


struct XShmSegmentInfo
  .SegID     dd ?
  .ShmID     dd ?
  .Addr      dd ?
  .fReadOnly dd ?
ends


ShmCompletion = 0
