src/mnwevent.c
/************************************************************************/
/*									*/
/*				D o R i n g				*/
/*									*/
/*	Take keyboard events and turn them into Lisp event info		*/
/*	(when running under X)						*/
/*									*/
/************************************************************************/
D o R i n g

Take keyboard events and turn them into Lisp event info
(when running under X)
D o R i n g Take keyboard events and turn them into Lisp event info ( when running under X )
void DoMNWRing(int type, LispPTR screen, LispPTR window, int l, int b, int wid, int h)
{
  DLword w, r;
  MNWEvent *event;
  int foo = MNWEVENTSIZE; 
  if (!CTopMNWEvent) {
    LispPTR index;
    index = get_package_atom("\\MNWEVENTQUEUE", 14, "INTERLISP", 9, NIL);
    if (index != 0xFFFFFFFF) {
      MNWEVENTQUEUE68k = GetVALCELL68k(index);
      DOMNWEVENT_index = get_package_atom("\\DOMNWEVENT", 11, "INTERLISP", 9, NIL);
      CTopMNWEvent = (DLword *)Addr68k_from_LADDR(*MNWEVENTQUEUE68k);
    }
  }
do_ring:
  if (CTopMNWEvent) {
    r = RING_READ(CTopMNWEvent);
    w = RING_WRITE(CTopMNWEvent);
    if (r == w) return;
    event = (MNWEvent *)(CTopMNWEvent + w);
    event->Any.event = type;
    event->Any.screen = screen;
    event->Any.window = window;
    event->Any.pad[0] = l;
    event->Any.pad[1] = b;
    event->Any.pad[2] = wid;
    event->Any.pad[3] = h;
    if (r == 0) 
      ((RING *)CTopMNWEvent)->read = w;
    if (w >= MAXMNWEVENT)
      ((RING *)CTopMNWEvent)->write = MINMNWEVENT;
    else
      ((RING *)CTopMNWEvent)->write = w + MNWEVENTSIZE;
    if (*MNWBUFFERING68k == NIL) *MNWBUFFERING68k = ATOM_T;
    if (MNWEventFlg++ > 0) Irq_Stk_End = Irq_Stk_Check = 0; 
  }
}
void DoMNWRing ( int type , LispPTR screen , LispPTR window , int l , int b , int wid , int h ) { DLword w , r ; MNWEvent * event ; int foo = MNWEVENTSIZE ; if ( ! CTopMNWEvent ) { LispPTR index ; index = get_package_atom ( " \\ " , 14 , " " , 9 , NIL ) ; if ( index != 0xFFFFFFFF ) { MNWEVENTQUEUE68k = GetVALCELL68k ( index ) ; DOMNWEVENT_index = get_package_atom ( " \\ " , 11 , " " , 9 , NIL ) ; CTopMNWEvent = ( DLword * ) Addr68k_from_LADDR ( * MNWEVENTQUEUE68k ) ; } } do_ring : if ( CTopMNWEvent ) { r = RING_READ ( CTopMNWEvent ) ; w = RING_WRITE ( CTopMNWEvent ) ; if ( r == w ) return ; event = ( MNWEvent * ) ( CTopMNWEvent + w ) ; event -> Any . event = type ; event -> Any . screen = screen ; event -> Any . window = window ; event -> Any . pad [ 0 ] = l ; event -> Any . pad [ 1 ] = b ; event -> Any . pad [ 2 ] = wid ; event -> Any . pad [ 3 ] = h ; if ( r == 0 ) ( ( RING * ) CTopMNWEvent ) -> read = w ; if ( w >= MAXMNWEVENT ) ( ( RING * ) CTopMNWEvent ) -> write = MINMNWEVENT ; else ( ( RING * ) CTopMNWEvent ) -> write = w + MNWEVENTSIZE ; if ( * MNWBUFFERING68k == NIL ) * MNWBUFFERING68k = ATOM_T ; if ( MNWEventFlg ++ > 0 ) Irq_Stk_End = Irq_Stk_Check = 0 ; } }
D o R i n g
D o R i n g
/* so we can examine the value */ /* Queue was empty */ /* Ask for interrupt */