Linux and UNIX Man Pages

Linux & Unix Commands - Search Man Pages

xeventsqueued(3) [hpux man page]

XEventsQueued() 														   XEventsQueued()

Name
  XEventsQueued - check the number of events in the event queue.

Synopsis
  int XEventsQueued(display, mode)
	  Display *display;
	  int mode;

Arguments
  display   Specifies a connection to a Display structure, returned from XOpenDisplay().

  mode	    Specifies  whether the request buffer is flushed if there are no events in Xlib's queue.  You can specify one of these constants:
	    QueuedAlready, QueuedAfterFlush, QueuedAfterReading.

Returns
  The number of events.

Description
  XEventsQueued() checks whether events are queued.  If there are events in Xlib's queue, the routine returns immediately to the calling rou-
  tine.  Its return value is the number of events regardless of mode.

  mode specifies what happens if no events are found on Xlib's queue.

  o  If  mode  is  QueuedAlready, and there are no events in the queue, XEventsQueued() returns zero (it does not flush the request buffer or
     attempt to read more events from the connection).

  o  If mode is QueuedAfterFlush, and there are no events in the queue, XEventsQueued() flushes the request buffer,  attempts  to  read  more
     events out of the application's connection, and returns the number read.

  o  If  mode  is  QueuedAfterReading, and there are no events in the queue, XEventsQueued() attempts to read more events out of the applica-
     tion's connection without flushing the request buffer and returns the number read.

  Note that XEventsQueued() always returns immediately without I/O if there are events already in the queue.

  XEventsQueued() with mode QueuedAfterFlush is identical in behavior to XPending().  XEventsQueued() with mode QueuedAlready is identical to
  the QLength() macro (see Appendix C, Macros).

  For more information, see Volume One, Chapter 8, Events.

See Also
  XQLength(),  XAllowEvents(),	XCheckIfEvent(),  XCheckMaskEvent(), XCheckTypedEvent(), XCheckTypedWindowEvent(), XCheckWindowEvent(), XGet-
  InputFocus(), XGetMotionEvents(), XIfEvent(), XMaskEvent(), XNextEvent(), XPeekEvent(), XPeekIfEvent(), XPending(),  XPutBackEvent(),  XSe-
  lectInput(), XSendEvent(), XSetInputFocus(), XSynchronize(), XWindowEvent().

Xlib - Resource Manager 													   XEventsQueued()

Check Out this Related Man Page

XFlush(3)							  XLIB FUNCTIONS							 XFlush(3)

NAME
XFlush, XSync, XEventsQueued, XPending - handle output buffer or event queue SYNTAX
int XFlush(Display *display); int XSync(Display *display, Bool discard); int XEventsQueued(Display *display, int mode); int XPending(Display *display); ARGUMENTS
discard Specifies a Boolean value that indicates whether XSync discards all events on the event queue. display Specifies the connection to the X server. mode Specifies the mode. You can pass QueuedAlready, QueuedAfterFlush, or QueuedAfterReading. DESCRIPTION
The XFlush function flushes the output buffer. Most client applications need not use this function because the output buffer is automati- cally flushed as needed by calls to XPending, XNextEvent, and XWindowEvent. Events generated by the server may be enqueued into the library's event queue. The XSync function flushes the output buffer and then waits until all requests have been received and processed by the X server. Any errors generated must be handled by the error handler. For each protocol error received by Xlib, XSync calls the client application's error handling routine (see section 11.8.2). Any events generated by the server are enqueued into the library's event queue. Finally, if you passed False, XSync does not discard the events in the queue. If you passed True, XSync discards all events in the queue, including those events that were on the queue before XSync was called. Client applications seldom need to call XSync. If mode is QueuedAlready, XEventsQueued returns the number of events already in the event queue (and never performs a system call). If mode is QueuedAfterFlush, XEventsQueued returns the number of events already in the queue if the number is nonzero. If there are no events in the queue, XEventsQueued flushes the output buffer, attempts to read more events out of the application's connection, and returns the number read. If mode is QueuedAfterReading, XEventsQueued returns the number of events already in the queue if the number is nonzero. If there are no events in the queue, XEventsQueued attempts to read more events out of the application's connection without flushing the out- put buffer and returns the number read. XEventsQueued always returns immediately without I/O if there are events already in the queue. XEventsQueued with mode QueuedAfterFlush is identical in behavior to XPending. XEventsQueued with mode QueuedAlready is identical to the XQLength function. The XPending function returns the number of events that have been received from the X server but have not been removed from the event queue. XPending is identical to XEventsQueued with the mode QueuedAfterFlush specified. SEE ALSO
AllPlanes(3), XIfEvent(3), XNextEvent(3), XPutBackEvent(3) Xlib - C Language X Interface X Version 11 libX11 1.3.2 XFlush(3)
Man Page