# include "Ximage.h"

/************** ParseEvent *************/
int
ParseEvent (graphic, event, keysym)
Graphic graphic[];
XEvent *event;
KeySym *keysym;
{

  XComposeStatus composestatus;
  char string[10];
  int status;
 
  status = FALSE;
  switch (event[0].type) {
  case ButtonPress:
    status = TRUE;
    break;
  case ButtonRelease:
    status = TRUE;
    break;
  case ClientMessage:
    status = TRUE;
    break;
  case MotionNotify:
    status = TRUE;
    break;
  case PropertyNotify:
    status = TRUE;
    break;
  case SelectionClear:
    status = TRUE;
    break;
  case SelectionNotify:
    status = TRUE;
    break;
  case SelectionRequest:
    status = TRUE;
    break;
  case ConfigureNotify:
    if ((graphic[0].dx != event[0].xconfigure.width) || 
	(graphic[0].dy != event[0].xconfigure.height))
      status = TRUE;
    break;
  case Expose:
    status = TRUE;
    if (event[0].xexpose.count != 0)
      status = FALSE;
    break;
  case KeyPress:
    status = TRUE;
    XLookupString ((XKeyEvent *)event, string, 9, keysym, &composestatus);
    break;
  case MappingNotify:
    XRefreshKeyboardMapping ((XMappingEvent *)event);
    break;
  }

  return (status);
}
