CrystalSpace

Public API Reference

csutil/eventhandlers.h File Reference

Event handler naming, name management, indexing, and instantiation. More...

#include "cssysdef.h"
#include "csextern.h"
#include "iutil/eventnames.h"
#include "iutil/eventhandlers.h"
#include "iutil/eventh.h"
#include "csutil/csstring.h"
#include "csutil/eventnames.h"
#include "csutil/frameeventsignpost.h"
#include "csutil/scf_implementation.h"
#include "csutil/threading/rwmutex.h"
#include "csutil/hash.h"
#include "csutil/strset.h"
#include "csutil/ref.h"

Go to the source code of this file.

Classes

class  csEventHandlerRegistry
 The csEventHandlerRegistry maintains a global one-to-one mapping from strings to csHandlerIDs, and a one-to-(zero or one) mapping from csHandlerIDs to iEventHandler pointers. More...

Defines

#define CS_EVENTHANDLER_PHASE_2D(x)
 Use this macro to declare your event handler as wanting to handle the csevFrame event in the "2D" phase (i.e., after any handlers in the "3D" phase and before any handlers in the "console" phase).
#define CS_EVENTHANDLER_PHASE_3D(x)
 Use this macro to declare your event handler as wanting to handle the csevFrame event in the "3D" phase (i.e., after any handlers in the "logic" phase and before any handlers in the "2D" phase).
#define CS_EVENTHANDLER_PHASE_CONSOLE(x)
 Use this macro to declare your event handler as wanting to handle the csevFrame event in the "Console" phase (i.e., after any handlers in the "2D" phase and before any handlers in the "debug" phase).
#define CS_EVENTHANDLER_PHASE_DEBUG(x)
 Use this macro to declare your event handler as wanting to handle the csevFrame event in the "Debug" phase (i.e., after any handlers in the "Console" phase and before any handlers in the "Frame" phase).
#define CS_EVENTHANDLER_PHASE_FRAME(x)
 Use this macro to declare your event handler as wanting to handle the csevFrame event in the "Frame" phase (i.e., after any handlers in the "Debug" phase.
#define CS_EVENTHANDLER_PHASE_LOGIC(x)
 Use this macro to declare your event handler as wanting to handle the csevFrame event in the "logic" phase (i.e., before any handlers in the "3D" phase).

Detailed Description

Event handler naming, name management, indexing, and instantiation.

Definition in file eventhandlers.h.


Define Documentation

#define CS_EVENTHANDLER_PHASE_2D (  ) 
Value:
CS_EVENTHANDLER_NAMES(x)                                                \
CS_EVENTHANDLER_DEFAULT_INSTANCE_CONSTRAINTS                            \
virtual const csHandlerID * GenericPrec                 \
(csRef<iEventHandlerRegistry> &r1, csRef<iEventNameRegistry> &r2,       \
 csEventID event) const {                                               \
  if (event != csevFrame(r2))                                           \
    return 0;                                                           \
  static csHandlerID precConstraint[3] = {                              \
    FrameSignpost_Logic3D::StaticID(r1),                                \
    FrameSignpost_3D2D::StaticID(r1),                                   \
    CS_HANDLERLIST_END                                                  \
  };                                                                    \
  return precConstraint;                                                \
}                                                                       \
virtual const csHandlerID * GenericSucc                 \
(csRef<iEventHandlerRegistry> &r1, csRef<iEventNameRegistry> &r2,       \
 csEventID event) const {                                               \
  if (event != csevFrame(r2))                                           \
    return 0;                                                           \
  static csHandlerID succConstraint[4] = {                              \
    FrameSignpost_2DConsole::StaticID(r1),                              \
    FrameSignpost_ConsoleDebug::StaticID(r1),                           \
    FrameSignpost_DebugFrame::StaticID(r1),                             \
    CS_HANDLERLIST_END                                                  \
  };                                                                    \
  return succConstraint;                                                \
}

Use this macro to declare your event handler as wanting to handle the csevFrame event in the "2D" phase (i.e., after any handlers in the "3D" phase and before any handlers in the "console" phase).

Definition at line 380 of file eventhandlers.h.

#define CS_EVENTHANDLER_PHASE_3D (  ) 
Value:
CS_EVENTHANDLER_NAMES(x)                                                \
CS_EVENTHANDLER_DEFAULT_INSTANCE_CONSTRAINTS                            \
virtual const csHandlerID * GenericPrec                 \
(csRef<iEventHandlerRegistry> &r1, csRef<iEventNameRegistry> &r2,       \
 csEventID event) const {                                               \
  if (event != csevFrame(r2))                                           \
    return 0;                                                           \
  static csHandlerID precConstraint[2] = {                              \
    FrameSignpost_Logic3D::StaticID(r1),                                \
    CS_HANDLERLIST_END                                                  \
  };                                                                    \
  return precConstraint;                                                \
}                                                                       \
virtual const csHandlerID * GenericSucc                 \
(csRef<iEventHandlerRegistry> &r1, csRef<iEventNameRegistry> &r2,       \
 csEventID event) const {                                               \
  if (event != csevFrame(r2))                                           \
    return 0;                                                           \
  static csHandlerID succConstraint[5] = {                              \
    FrameSignpost_3D2D::StaticID(r1),                                   \
    FrameSignpost_2DConsole::StaticID(r1),                              \
    FrameSignpost_ConsoleDebug::StaticID(r1),                           \
    FrameSignpost_DebugFrame::StaticID(r1),                             \
    CS_HANDLERLIST_END                                                  \
  };                                                                    \
  return succConstraint;                                                \
}

Use this macro to declare your event handler as wanting to handle the csevFrame event in the "3D" phase (i.e., after any handlers in the "logic" phase and before any handlers in the "2D" phase).

Definition at line 345 of file eventhandlers.h.

#define CS_EVENTHANDLER_PHASE_CONSOLE (  ) 
Value:
CS_EVENTHANDLER_NAMES(x)                                                \
CS_EVENTHANDLER_DEFAULT_INSTANCE_CONSTRAINTS                            \
virtual const csHandlerID * GenericPrec                 \
(csRef<iEventHandlerRegistry> &r1, csRef<iEventNameRegistry> &r2,       \
 csEventID event) const {                                               \
  if (event != csevFrame(r2))                                           \
    return 0;                                                           \
  static csHandlerID precConstraint[4] = {                              \
    FrameSignpost_Logic3D::StaticID(r1),                                \
    FrameSignpost_3D2D::StaticID(r1),                                   \
    FrameSignpost_2DConsole::StaticID(r1),                              \
    CS_HANDLERLIST_END                                                  \
  };                                                                    \
  return precConstraint;                                                \
}                                                                       \
virtual const csHandlerID * GenericSucc                 \
(csRef<iEventHandlerRegistry> &r1, csRef<iEventNameRegistry> &r2,       \
 csEventID event) const {                                               \
  if (event != csevFrame(r2))                                           \
    return 0;                                                           \
  static csHandlerID succConstraint[3] = {                              \
    FrameSignpost_ConsoleDebug::StaticID(r1),                           \
    FrameSignpost_DebugFrame::StaticID(r1),                             \
    CS_HANDLERLIST_END                                                  \
  };                                                                    \
  return succConstraint;                                                \
}

Use this macro to declare your event handler as wanting to handle the csevFrame event in the "Console" phase (i.e., after any handlers in the "2D" phase and before any handlers in the "debug" phase).

Definition at line 415 of file eventhandlers.h.

#define CS_EVENTHANDLER_PHASE_DEBUG (  ) 
Value:
CS_EVENTHANDLER_NAMES(x)                                                \
CS_EVENTHANDLER_DEFAULT_INSTANCE_CONSTRAINTS                            \
virtual const csHandlerID * GenericPrec                 \
(csRef<iEventHandlerRegistry> &r1, csRef<iEventNameRegistry> &r2,       \
 csEventID event) const {                                               \
  if (event != csevFrame(r2))                                           \
    return 0;                                                           \
  static csHandlerID precConstraint[5] = {                              \
    FrameSignpost_Logic3D::StaticID(r1),                                \
    FrameSignpost_3D2D::StaticID(r1),                                   \
    FrameSignpost_2DConsole::StaticID(r1),                              \
    FrameSignpost_ConsoleDebug::StaticID(r1),                           \
    CS_HANDLERLIST_END                                                  \
  };                                                                    \
  return precConstraint;                                                \
}                                                                       \
virtual const csHandlerID * GenericSucc                 \
(csRef<iEventHandlerRegistry> &r1, csRef<iEventNameRegistry> &r2,       \
 csEventID event) const {                                               \
  if (event != csevFrame(r2))                                           \
    return 0;                                                           \
  static csHandlerID succConstraint[2] = {                              \
    FrameSignpost_DebugFrame::StaticID(r1),                             \
    CS_HANDLERLIST_END                                                  \
  };                                                                    \
  return succConstraint;                                                \
}

Use this macro to declare your event handler as wanting to handle the csevFrame event in the "Debug" phase (i.e., after any handlers in the "Console" phase and before any handlers in the "Frame" phase).

Definition at line 450 of file eventhandlers.h.

#define CS_EVENTHANDLER_PHASE_FRAME (  ) 
Value:
CS_EVENTHANDLER_NAMES(x)                                                \
CS_EVENTHANDLER_DEFAULT_INSTANCE_CONSTRAINTS                            \
virtual const csHandlerID * GenericPrec                 \
(csRef<iEventHandlerRegistry> &r1, csRef<iEventNameRegistry> &r2,       \
 csEventID event) const {                                               \
  if (event != csevFrame(r2))                                           \
    return 0;                                                           \
  static csHandlerID precConstraint[6]= {                               \
    FrameSignpost_Logic3D::StaticID(r1),                                \
    FrameSignpost_3D2D::StaticID(r1),                                   \
    FrameSignpost_2DConsole::StaticID(r1),                              \
    FrameSignpost_ConsoleDebug::StaticID(r1),                           \
    FrameSignpost_DebugFrame::StaticID(r1),                             \
    CS_HANDLERLIST_END                                                  \
  };                                                                    \
  return precConstraint;                                                \
}                                                                       \
virtual const csHandlerID * GenericSucc                 \
(csRef<iEventHandlerRegistry> &, csRef<iEventNameRegistry> &,           \
 csEventID) const {                                                     \
  return 0;                                                             \
}

Use this macro to declare your event handler as wanting to handle the csevFrame event in the "Frame" phase (i.e., after any handlers in the "Debug" phase.

Definition at line 484 of file eventhandlers.h.

#define CS_EVENTHANDLER_PHASE_LOGIC (  ) 
Value:
CS_EVENTHANDLER_NAMES(x)                                                \
CS_EVENTHANDLER_DEFAULT_INSTANCE_CONSTRAINTS                            \
virtual const csHandlerID * GenericPrec                 \
(csRef<iEventHandlerRegistry> &, csRef<iEventNameRegistry> &,           \
 csEventID) const {                                                     \
  return 0;                                                             \
}                                                                       \
virtual const csHandlerID * GenericSucc                 \
(csRef<iEventHandlerRegistry> &r1, csRef<iEventNameRegistry> &r2,       \
 csEventID event) const {                                               \
  if (event != csevFrame(r2))                                           \
    return 0;                                                           \
  static csHandlerID succConstraint[6] = {                              \
    FrameSignpost_Logic3D::StaticID(r1),                                \
    FrameSignpost_3D2D::StaticID(r1),                                   \
    FrameSignpost_2DConsole::StaticID(r1),                              \
    FrameSignpost_ConsoleDebug::StaticID(r1),                           \
    FrameSignpost_DebugFrame::StaticID(r1),                             \
    CS_HANDLERLIST_END                                                  \
  };                                                                    \
  return succConstraint;                                                \
}

Use this macro to declare your event handler as wanting to handle the csevFrame event in the "logic" phase (i.e., before any handlers in the "3D" phase).

Definition at line 315 of file eventhandlers.h.


Generated for Crystal Space 2.1 by doxygen 1.6.1