My Project
Public Member Functions | Static Public Member Functions | Static Public Attributes | Protected Types | Protected Attributes | Static Protected Attributes | List of all members
ParaEngine::CEventBinding Class Reference

This class is for maintaining the event binding table and script binding table. More...

#include <EventBinding.h>

Inheritance diagram for ParaEngine::CEventBinding:
ParaEngine::IObject ParaEngine::CRefCounted

Public Member Functions

 CEventBinding (const CEventBinding &)
 
void InitEventMappingTable (bool bDisable=false)
 
void EnableEvent (int eEvent)
 
void DisableEvent (int eEvent)
 
void MapEvent (int eSrcEvent, int eDestEvent)
 Mapping an event to another event.
 
void UnmapEvent (int eSrcEvent, int eDestEvent)
 Unmap an event to any event.
 
bool IsMapTo (int eSrcEvent, int eDestEvent) const
 Decide if the first event is mapped to the second event.
 
void DefaultMap_Text ()
 
void DefaultMap_Control ()
 
void DefaultMap_Mouse ()
 
void DisableKeyboard ()
 
void EnableKeyboard ()
 
void DisableMouse ()
 
void EnableMouse ()
 
void MapEventToScript (int eEvent, const SimpleScript *script)
 
void UnmapEventToScript (int eEvent)
 
const SimpleScriptGetEventScript (int eEvent) const
 
bool HasEventScript (int eEvent) const
 
CEventBindingoperator= (CEventBinding &input)
 
virtual void Clone (IObject *pobj) const
 Clone the object's contains to a pointer. More...
 
virtual IObjectClone () const
 Clone the object's contains and return a pointer to the newly created object. More...
 
virtual int Release ()
 
virtual bool Equals (const IObject *obj) const
 Compare the object with another object. More...
 
- Public Member Functions inherited from ParaEngine::IObject
virtual const ITypeGetType () const
 
virtual std::string ToString () const
 
WeakPtr_typeGetWeakReference ()
 get weak reference object. More...
 
virtual int ProcessObjectEvent (const ObjectEvent &event)
 this function is only used to backward compatibility of ParaObject:AddEvent() function. More...
 
- Public Member Functions inherited from ParaEngine::CRefCounted
void addref () const
 add reference count of the object. More...
 
bool delref () const
 decrease reference count of the object. More...
 
int GetRefCount () const
 get the reference count
 
CRefCountedAddToAutoReleasePool ()
 addref and releases the ownership sometime soon automatically (usually at the end of the current frame). More...
 

Static Public Member Functions

static void StaticInit ()
 
static int StringToEventValue (const string &str)
 
static string & EventValueToString (int value)
 
static void InitMsg (MSG *event, DWORD time, DWORD message, POINT &pt)
 
static DWORD TranslateVKToDIK (DWORD dwVKey)
 converting a windows virtual key to direct input key scan code. More...
 

Static Public Attributes

static DWORD ScancodeToKeyTable [256]
 
static DWORD WinVirtualKeyToDIK [256]
 windows virtual key code to direct input key. More...
 
static DWORD DIKToWinVirtualKey [256]
 direct input key to windows virtual key code. More...
 

Protected Types

typedef std::bitset< EventCount > EventEnabledArray_type
 
typedef std::map< int, SimpleScriptEventScriptMap_type
 
typedef boost::array< set< int >, EventCount > EventMapping_type
 
typedef cow_ptr< boost::array< set< int >, EventCount > > EventMapping_cow_type
 

Protected Attributes

EventEnabledArray_type m_pEventEnable
 
EventScriptMap_type m_pEventToScript
 
EventMapping_cow_type m_pEventMappingTable
 
- Protected Attributes inherited from ParaEngine::IObject
WeakPtr_type m_weak_reference
 
- Protected Attributes inherited from ParaEngine::CRefCounted
int m_refcount
 

Static Protected Attributes

static map< string, int > StringToEventTable
 
static map< int, string > EventToStringTable
 

Additional Inherited Members

- Public Types inherited from ParaEngine::IObject
typedef ParaEngine::weak_ptr< IObjectWeakPtr_type
 

Detailed Description

This class is for maintaining the event binding table and script binding table.

It also contains method to translate string to event and also backwards

Member Function Documentation

§ Clone() [1/2]

void CEventBinding::Clone ( IObject obj) const
virtual

Clone the object's contains to a pointer.

The caller should allocate the memory and pass the pointer to this function.. Inheritance should implement this function void Clone(IObject*) and IObject* Clone() should have the same behavior In some cases, if you want to avoid Dead Reference( one object is being referred to by many objects and you can't update all the references). It is possible to use this function to replace the contains at a given pointer. But this may result in memory leak if you do not implement this function carefully or misuse it.

Reimplemented from ParaEngine::IObject.

§ Clone() [2/2]

IObject * CEventBinding::Clone ( ) const
virtual

Clone the object's contains and return a pointer to the newly created object.

The caller should free the memory of the return object. Inheritance should implement this function void Clone(IObject*) and IObject* Clone() should have the same behavior

Reimplemented from ParaEngine::IObject.

§ Equals()

bool CEventBinding::Equals ( const IObject obj) const
virtual

Compare the object with another object.

Inheritance should implement this function

Reimplemented from ParaEngine::IObject.

§ TranslateVKToDIK()

DWORD CEventBinding::TranslateVKToDIK ( DWORD  dwVKey)
static

converting a windows virtual key to direct input key scan code.

Member Data Documentation

§ DIKToWinVirtualKey

DWORD CEventBinding::DIKToWinVirtualKey
static

direct input key to windows virtual key code.

§ WinVirtualKeyToDIK

DWORD CEventBinding::WinVirtualKeyToDIK
static

windows virtual key code to direct input key.


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