示例#1
0
文件: iluXt.c 项目: spchamp/ilu
static void
  default_ilu_Xt_run (int *stop)
{
  /*
    If the XtAppNextEvent (), XtDispatchEvent() function pair
    is used instead of XtAppProcessEvent(), alternate input sources are
    not read until an X event occurs.  Bug in Xt? (GWT)
    */

  /*    XEvent event; */
  StackFrame ours;

  XtAppContext app = _XtDefaultAppContext();

  /* push our "frame" onto the "stack" */
  ours.next = run_stack;
  ours.stop = stop;
  run_stack = &ours;

  *stop = 1;

  while (*stop != 0) {
    /*	XtAppNextEvent(app, &event); */
    /*	XtDispatchEvent(&event); */
    XtAppProcessEvent (app, XtIMAll);
  }

  /* pop our "frame" from the stack */
  run_stack = ours.next;

  return;
}
示例#2
0
XrmDatabase *XtGetErrorDatabase()
{
#if GLOBALERRORS
    return &errorDB;
#else
    return XtAppGetErrorDatabase(_XtDefaultAppContext());
#endif /* GLOBALERRORS */
}
示例#3
0
XrmDatabase *XtGetErrorDatabase(void)
{
    XrmDatabase* retval;
#if GLOBALERRORS
    LOCK_PROCESS;
    retval = &errorDB;
    UNLOCK_PROCESS;
#else
    retval = XtAppGetErrorDatabase(_XtDefaultAppContext());
#endif /* GLOBALERRORS */
    return retval;
}
示例#4
0
文件: iluXt.c 项目: spchamp/ilu
static ilu_boolean 
  register_output (int fd,
		   ilu_IOHandler handler,
		   ilu_private rock)
{
  Rock r;
  XtAppContext app = _XtDefaultAppContext();

  DeleteRock (fd, Output);
  r = AddRock (fd, handler, rock, Output);
  r->id = XtAppAddInput (app, fd, (XtPointer)XtInputWriteMask,
			 (XtInputCallbackProc)callback_proc, r);
  return ((r->id != (XtInputId)NULL) ? ilu_TRUE : ilu_FALSE);
}
示例#5
0
文件: iluXt.c 项目: spchamp/ilu
static void
  set_alarm (void * alarm,
	     ilu_FineTime t,
	     void (*proc) (ilu_private rock),
	     ilu_private rock)
{
  ilu_FineTime t2;
  iluXtAlarm al = (iluXtAlarm) alarm;
  XtAppContext app = _XtDefaultAppContext();

  if (al->id != 0)	/* alarm already set */
    XtRemoveTimeOut (al->id);	/* clear current setting */
  al->proc = proc;
  al->rock = rock;
  t2 = ilu_FineTime_Sub(t, ilu_FineTime_Now());
  al->timeout = t2.ft_s * 1000 + (t2.ft_t * (1000/ilu_FineTimeRate));
  al->id = XtAppAddTimeOut (app, al->timeout,
			    (XtTimerCallbackProc)handle_timer, (void *) al);

  return;
}