Main Page | Modules | Namespace List | Class Hierarchy | Class List | Directories | File List | Namespace Members | Class Members | File Members | Related Pages

CP_EventHandler_Imp Class Reference

Implementation class for the CP_EventHandler when using MacOS Carbon Events. More...

Inheritance diagram for CP_EventHandler_Imp:

CP_SigSlot::CP_SlotObject CP_NoCopy CP_NoCopy CP_NoCopy CP_EventHandler CP_EventHandler_Imp_MDIFrame List of all members.

Windows Messages

virtual LRESULT CALLBACK EventHandlerProc (HWND inHwnd, UINT iMsg, WPARAM wParam, LPARAM lParam) throw ()
LRESULT CallDefault () throw ()

Public Member Functions

void disconnect_all ()
void signal_connect (CP_Signal *inSender)
void signal_disconnect (CP_Signal *inSender)
Constructor / Destructor
 CP_EventHandler_Imp ()
 Constructor.
virtual ~CP_EventHandler_Imp ()
 Destructor.
Constructor / Destructor
 CP_EventHandler_Imp ()
 Constructor.
 CP_EventHandler_Imp (EventTargetRef inTarget)
virtual ~CP_EventHandler_Imp ()
 Destructor.
Constructor / Destructor
 CP_EventHandler_Imp ()
 Constructor.
virtual ~CP_EventHandler_Imp ()
 Destructor.

Protected Member Functions

virtual OSWindow FindOSWindowFromMessage (OSWindow inWindow, LPARAM inLParam, UINT inMsg)

Protected Attributes

CP_EventHandler_Map fEventHandlers
EventTargetRef fTarget
EventHandlerRef fEventHandlerRef
WPARAM fWParam
LPARAM fLParam
WNDPROC fnOldWndProc
HWND fHWND
UINT fIMsg
sender_set fSenders

Static Private Member Functions

Callback
static pascal::OSStatus EventHandlerProc (EventHandlerCallRef inHandlerCallRef, EventRef inEvent, void *inUserData) throw ()

Detailed Description


Constructor & Destructor Documentation

CPLAT_Begin_Namespace_CPLAT CP_EventHandler_Imp::CP_EventHandler_Imp  ) 
 

Constructor.

Exceptions:
none 

CP_EventHandler_Imp::~CP_EventHandler_Imp  )  [virtual]
 

Desstructor.

Exceptions:
none 

CP_EventHandler_Imp::CP_EventHandler_Imp  ) 
 

CP_EventHandler_Imp::CP_EventHandler_Imp EventTargetRef  inTarget  ) 
 

Constructor.

Parameters:
inTarget The event target ref that this event belongs to.
Exceptions:
none 

virtual CP_EventHandler_Imp::~CP_EventHandler_Imp  )  [virtual]
 

CP_EventHandler_Imp::CP_EventHandler_Imp  ) 
 

virtual CP_EventHandler_Imp::~CP_EventHandler_Imp  )  [virtual]
 


Member Function Documentation

void CP_EventHandler_Imp::Add UInt32  inEventClass,
UInt32  inEventKind,
CP_EventSignal inEventSignal,
OSWindow  inWindow = NULL
 

Adds the passed in event and event signal handler to the list of events we maintain. This will also register with the Carbon Event handler the fact that we handle the passed in event class and event kind.

Parameters:
inEventClass The class of the event being handled
inEventKind The kind of the event being handled
inEventSignal The signal to be called when this event class and kind is encountered. Note: This signal will be deleted when the event is removed from the list of events, and should be unique for each event, ie don't assign the same signal to the same event.
inWindow Not used
Exceptions:
CP_OSErrorException Exception thrown in there was a problem adding the event to the Carbon Event handler.
Returns:
void

void CP_EventHandler_Imp::Remove UInt32  inEventClass,
UInt32  inEventKind
 

Removes the event hanndler associated with the passed in event class and event kind.

Parameters:
inEventClass The class of the event being handled
inEventKind The kind of the event being handled
Exceptions:
CP_OSErrorException Exception thrown in there was a problem removing the event from the Carbon Event handler.
Returns:
void

bool CP_EventHandler_Imp::HasHandler UInt32  inEventClass,
UInt32  inEventKind
 

Returns true if we have an installed handler for the passed in inEventClass and inEventKind.

Parameters:
inEventClass The class of the event being handled
inEventKind The kind of the event being handled
Exceptions:
none 
Returns:
bool True if the event class / kind handler exists.

CP_EventSignal * CP_EventHandler_Imp::FindHandler UInt32  inEventClass,
UInt32  inEventKind
 

Returns the CP_EventSignal that will handle the passed in Carbon Event, based on the event class and event kind.

Parameters:
inEventClass The class of the event being handled
inEventKind The kind of the event being handled
Exceptions:
none 
Returns:
CP_EventSignal * The CP_EventSignal for the event.

void CP_EventHandler_Imp::Add UInt32  inClass,
UInt32  inKind,
CP_EventSignal inEventSignal,
OSWindow  inWindow = NULL
 

void CP_EventHandler_Imp::Remove UInt32  inEventClass,
UInt32  inEventKind
 

bool CP_EventHandler_Imp::HasHandler UInt32  inEventClass,
UInt32  inEventKind
 

CP_EventSignal* CP_EventHandler_Imp::FindHandler UInt32  inEventClass,
UInt32  inEventKind
 

EventTargetRef CP_EventHandler_Imp::GetEventTargetRef  ) 
 

void CP_EventHandler_Imp::SetEventTargetRef EventTargetRef  inTarget  ) 
 

pascal::OSStatus CP_EventHandler_Imp::EventHandlerProc EventHandlerCallRef  inHandlerCallRef,
EventRef  inEvent,
void *  inUserData
throw () [static, private]
 

Callback for the Carbon Event handler when it has a registered event to process. This will look up the CP_EventSignal and call it to handle the event.

Parameters:
inHandlerCallRef Carbon Event handler call ref for the event.
inEvent Carbon Event event ref for the event.
inUserData User supplied data passed to this callback, in this case it points to the instance of this class that will handle the event.
Exceptions:
none 
Returns:
void

void CP_EventHandler_Imp::Add UInt32  inClass,
UInt32  inKind,
CP_EventSignal inEventSignal,
OSWindow  inWindow
 

void CP_EventHandler_Imp::Remove UInt32  inEventClass,
UInt32  inEventKind,
OSWindow  inWindow
 

Removes the event hanndler associated with the passed in event class and event kind.

Parameters:
inEventClass The class of the event being handled
inEventKind The kind of the event being handled
Exceptions:
CP_OSErrorException Exception thrown in there was a problem removing the event from the Carbon Event handler.
Returns:
void

void CP_EventHandler_Imp::RemoveAll  ) 
 

Removes the event hanndler associated with the passed in event class and event kind.

Parameters:
inEventClass The class of the event being handled
inEventKind The kind of the event being handled
Exceptions:
CP_OSErrorException Exception thrown in there was a problem removing the event from the Carbon Event handler.
Returns:
void

bool CP_EventHandler_Imp::HasHandler UInt32  inEventClass,
UInt32  inEventKind,
OSWindow  inWindow
 

Returns true if we have an installed handler for the passed in inEventClass and inEventKind.

Parameters:
inEventClass The class of the event being handled
inEventKind The kind of the event being handled
Exceptions:
none 
Returns:
bool True if the event class / kind handler exists.

CP_EventSignal * CP_EventHandler_Imp::FindHandler UInt32  inEventClass,
UInt32  inEventKind,
OSWindow  inWindow,
LPARAM  inLParam
 

Returns the CP_EventSignal that will handle the passed in Carbon Event, based on the event class and event kind.

Parameters:
inEventClass The class of the event being handled
inEventKind The kind of the event being handled
Exceptions:
none 
Returns:
CP_EventSignal * The CP_EventSignal for the event.

WNDPROC CP_EventHandler_Imp::GetWndProc  ) 
 

Returns the Windows window proc callback used with this event handler.

Exceptions:
none 
Returns:
WNDPROC Windows callback for this event handler.

void CP_EventHandler_Imp::SetWndProc WNDPROC  inWndProc  ) 
 

Sets the Windows window proc callback used with this event handler.

Parameters:
inWndProc Windows callback to use for this event handler.
Exceptions:
none 
Returns:
void

WPARAM CP_EventHandler_Imp::GetWParam  ) 
 

Returns the wParam for this event.

Exceptions:
none 
Returns:
WPARAM The WPARAM for this event.

LPARAM CP_EventHandler_Imp::GetLParam  ) 
 

Returns the lParam for this event.

Exceptions:
none 
Returns:
LPARAM The LPARAM for this event.

HWND CP_EventHandler_Imp::GetHWND  ) 
 

LRESULT CALLBACK CP_EventHandler_Imp::EventHandlerProc HWND  inHwnd,
UINT  inMsg,
WPARAM  inWParam,
LPARAM  inLParam
throw () [virtual]
 

Callback for the Windows window message handler when it has a registered event to process. This will look up the CP_EventSignal and call it to handle the event.

Parameters:
inHwnd The HWND that the message applies to.
inMsg The incoming message to handle.
inWParam The wParam for the message.
inLParam The lParam for the message.
Exceptions:
none 
Returns:
void

Reimplemented in CP_EventHandler_Imp_MDIFrame.

LRESULT CP_EventHandler_Imp::CallDefault  )  throw ()
 

OSWindow CP_EventHandler_Imp::FindOSWindowFromMessage OSWindow  inWindow,
LPARAM  inLParam,
UINT  inMsg
[protected, virtual]
 

void CP_SigSlot::CP_SlotObject::disconnect_all  )  [inherited]
 

void CP_SigSlot::CP_SlotObject::signal_connect CP_Signal inSender  )  [inherited]
 

void CP_SigSlot::CP_SlotObject::signal_disconnect CP_Signal inSender  )  [inherited]
 


Member Data Documentation

CP_EventHandler_Map CP_EventHandler_Imp::fEventHandlers [protected]
 

EventTargetRef CP_EventHandler_Imp::fTarget [protected]
 

Map that contains all of the registered handlers.

EventHandlerRef CP_EventHandler_Imp::fEventHandlerRef [protected]
 

Carbon Event target ref.

WPARAM CP_EventHandler_Imp::fWParam [protected]
 

List of registered event handlers.

LPARAM CP_EventHandler_Imp::fLParam [protected]
 

WPARAM for this event.

WNDPROC CP_EventHandler_Imp::fnOldWndProc [protected]
 

LPARAM for this event.

HWND CP_EventHandler_Imp::fHWND [protected]
 

Callback to be used when there is no event handler for this event.

UINT CP_EventHandler_Imp::fIMsg [protected]
 

sender_set CP_SigSlot::CP_SlotObject::fSenders [protected, inherited]
 


The documentation for this class was generated from the following files:
Generated on Sat Sep 17 20:01:40 2005 for CPLAT by  doxygen 1.4.0