Main Page   Class Hierarchy   Alphabetical List   Compound List   File List   Compound Members

FX::FXEventDispatcher Class Reference

A FXEventDispatcher extends FXDispatcher, adding graphical user interface handling and other display-related events. More...

#include <FXEventDispatcher.h>

Inheritance diagram for FX::FXEventDispatcher:
FX::FXDispatcher FX::FXReactor

Public Types

typedef FXCallback< FXbool(FXEventDispatcher *, FXRawEvent &event)> EventCallback
 Event callback when GUI has activity.
 
- Public Types inherited from FX::FXDispatcher
typedef FXCallback< FXbool(FXDispatcher *, FXInputHandle, FXuint, void *)> HandleCallback
 I/O Handle callback when a handle is raised.
 
typedef FXCallback< FXbool(FXDispatcher *, FXint, void *)> SignalCallback
 Signal callback when signal has been fired.
 
typedef FXCallback< FXbool(FXDispatcher *, FXTime, void *)> TimeoutCallback
 Timer callback when timer expired.
 
typedef FXCallback< FXbool(FXDispatcher *, void *)> IdleCallback
 Idle callback when dispatcher is about to block.
 
- Public Types inherited from FX::FXReactor
enum  { InputNone = 0, InputRead = 1, InputWrite = 2, InputExcept = 4 }
 Modes. More...
 
enum  {
  DispatchAll = 0xffffffff, DispatchSignals = 0x00000001, DispatchTimers = 0x00000002, DispatchIdle = 0x00000004,
  DispatchEvents = 0x00000008, DispatchOther = 0x00000010
}
 Dispatch flags. More...
 

Public Member Functions

 FXEventDispatcher ()
 Construct event dispatcher object.
 
virtual FXbool init (FXptr dpy)
 Initialize dispatcher with display.
 
virtual FXbool init ()
 Initialize dispatcher without display.
 
FXptr getDisplay () const
 Return display pointer.
 
virtual FXbool dispatch (FXTime blocking=forever, FXuint flags=DispatchAll)
 Dispatch if something happens within given blocking time. More...
 
virtual FXbool dispatchEvent (FXRawEvent &event)
 Dispatch platform-dependent event.
 
virtual FXbool exit ()
 Exit dispatcher.
 
virtual ~FXEventDispatcher ()
 Destroy event dispatcher object.
 
- Public Member Functions inherited from FX::FXDispatcher
 FXDispatcher ()
 Construct dispatcher object.
 
virtual FXbool addHandle (HandleCallback cb, FXInputHandle hnd, FXuint mode=InputRead, void *ptr=nullptr)
 Add callback cb with new handle hnd to watch-list.
 
virtual FXbool addHandle (FXInputHandle hnd, FXuint mode=InputRead)
 Add new handle hnd to watch-list (no callback)
 
virtual FXbool remHandle (FXInputHandle hnd)
 Remove handle hnd from watch-list.
 
virtual FXbool hasHandle (FXInputHandle hnd) const
 Return true if handle has been set.
 
virtual FXbool dispatchHandle (FXInputHandle hnd, FXuint mode, FXuint flags)
 Dispatch handler when handle index is raised. More...
 
virtual FXbool addSignal (SignalCallback cb, FXint sig, void *ptr=nullptr, FXbool async=false)
 Add (optionally asynchronous) callback cb for signal sig to signal-set.
 
virtual FXbool addSignal (FXint sig, FXbool async=false)
 Add (optionally asynchronous) signal sig to signal-set (no callback)
 
virtual FXbool remSignal (FXint sig)
 Remove signal from signal-set.
 
virtual FXbool dispatchSignal (FXint sig)
 Dispatch a signal handler if signal fired. More...
 
virtual void * addTimeout (TimeoutCallback cb, FXTime due, void *ptr=nullptr)
 Add timeout callback cb at time due (ns since Epoch). More...
 
virtual void * addInterval (TimeoutCallback cb, FXTime interval, void *ptr=nullptr)
 Add timeout callback cb after time interval (ns). More...
 
virtual void * remTimeout (TimeoutCallback cb)
 Remove timeout callback cb. More...
 
virtual FXTime getTimeout (TimeoutCallback cb) const
 Return when timeout callback cb is due. More...
 
virtual FXbool hasTimeout (TimeoutCallback cb) const
 Return true if timeout callback cb been set.
 
virtual FXTime nextTimeout ()
 Return time when first timer callback is due. More...
 
virtual FXbool dispatchTimeout (FXTime due)
 Dispatch a timer when due. More...
 
virtual void * addIdle (IdleCallback cb, void *ptr=nullptr)
 Add idle callback be executed when dispatch about to block. More...
 
virtual void * remIdle (IdleCallback cb)
 Remove idle callback cb. More...
 
virtual FXbool hasIdle (IdleCallback cb) const
 Return true if idle callback cb been set.
 
virtual FXbool dispatchIdle ()
 Dispatch one idle callback. More...
 
virtual ~FXDispatcher ()
 Destroy dispatcher object.
 
- Public Member Functions inherited from FX::FXReactor
 FXReactor ()
 Construct reactor.
 
FXbool isInitialized () const
 Is reactor initialized.
 
virtual FXbool hasSignal (FXint sig) const
 Return true if signal sig is handled by this dispatcher.
 
virtual ~FXReactor ()
 Destroy reactor object.
 

Additional Inherited Members

- Static Public Attributes inherited from FX::FXReactor
static const FXTime maxwait
 Sleep no longer than this.
 

Detailed Description

A FXEventDispatcher extends FXDispatcher, adding graphical user interface handling and other display-related events.

Member Function Documentation

◆ dispatch()

virtual FXbool FX::FXEventDispatcher::dispatch ( FXTime  blocking = forever,
FXuint  flags = DispatchAll 
)
virtual

Dispatch if something happens within given blocking time.

Flags control subsets of events to be dispatched (signals, timers, idle, and more). Default is to dispatch all events.

Reimplemented from FX::FXReactor.


The documentation for this class was generated from the following file:

Copyright © 1997-2022 Jeroen van der Zijp