wGui::CMessageServer Class Reference

A server which queues and dispatches messages. More...

#include <wg_message_server.h>

Public Types

Public Member Functions

Static Public Member Functions

Protected Member Functions

Protected Attributes

Static Protected Attributes


Detailed Description

A server which queues and dispatches messages.

CMessageServer is a singeton (only one instance of it is allowed to exist at any time) Clients must register to get messages sent to them

See also:
CMessage CMessageClient

Definition at line 69 of file wg_message_server.h.


Member Enumeration Documentation

enum wGui::CMessageServer::EClientPriority

Used for marking the priority of registered message clients, where the higher priority clients will get messages first.

Enumerator:
PRIORITY_LAST  The absolute lowest priority available.
PRIORITY_LOW  Low priority.
PRIORITY_NORMAL  Standard priority.
PRIORITY_HIGH  High priority.
PRIORITY_FIRST  The absolute highest priority available.

Definition at line 81 of file wg_message_server.h.


Member Function Documentation

CMessageServer & wGui::CMessageServer::Instance ( void   )  [static]

Gets the single instance of the message server

Returns:
The single valid instance of the message server, or create one if it doesn't already exist

Definition at line 55 of file wg_message_server.cpp.

References m_pInstance.

Referenced by wGui::CButton::CButton(), wGui::CCheckBox::CCheckBox(), wGui::CDropDown::CDropDown(), wGui::CEditBox::CEditBox(), wGui::CFrame::CFrame(), wGui::CListBox::CListBox(), wGui::CFrame::CloseFrame(), wGui::CMenu::CMenu(), wGui::CMenuBase::CMenuBase(), wGui::CPopupMenu::CPopupMenu(), wGui::CRadioButton::CRadioButton(), wGui::CScrollBar::CScrollBar(), wGui::CTextBox::CTextBox(), wGui::CToolBar::CToolBar(), wGui::CToolTip::CToolTip(), wGui::CView::CView(), wGui::CWindow::Draw(), wGui::CApplication::Exec(), wGui::CView::HandleMessage(), wGui::CToolBar::HandleMessage(), wGui::CTextBox::HandleMessage(), wGui::CScrollBar::HandleMessage(), wGui::CRadioButton::HandleMessage(), wGui::CMessageBox::HandleMessage(), wGui::CMenuBase::HandleMessage(), wGui::CFrame::HandleMessage(), wGui::CEditBox::HandleMessage(), wGui::CDropDown::HandleMessage(), wGui::CCheckBox::HandleMessage(), wGui::CApplication::HandleSDLEvent(), wGui::CPopupMenu::Hide(), wGui::CToolTip::HideTip(), wGui::CApplication::Init(), wGui::CWindow::MoveWindow(), wGui::CTextBox::OnMouseButtonDown(), wGui::CPopupMenu::OnMouseButtonDown(), wGui::CMenu::OnMouseButtonDown(), wGui::CFrame::OnMouseButtonDown(), wGui::CEditBox::OnMouseButtonDown(), wGui::CRadioButton::OnMouseButtonUp(), wGui::CListBox::OnMouseButtonUp(), wGui::CCheckBox::OnMouseButtonUp(), wGui::CButton::OnMouseButtonUp(), wGui::CApplication::SetKeyFocus(), wGui::CApplication::SetMouseFocus(), wGui::CRangeControl< int >::SetValue(), wGui::CWindow::SetVisible(), wGui::CTimer::TimerHit(), wGui::CMessageClient::~CMessageClient(), and wGui::CWindow::~CWindow().

void wGui::CMessageServer::RegisterMessageClient ( CMessageClient pClient,
CMessage::EMessageType  eMessageType,
unsigned char  Priority = PRIORITY_NORMAL 
)

Register a client to recieve messages

Parameters:
pClient A pointer to the client which should recieve the messages
eMessageType The message type the client wishes to recieve
Priority The priority of the client for recieving the message

Definition at line 70 of file wg_message_server.cpp.

References wUtil::CLog::AddLogEntry(), wGui::APP_LOG_ERROR, wGui::CApplication::GetApplicationLog(), wGui::CApplication::Instance(), and m_MessageClients.

Referenced by wGui::CButton::CButton(), wGui::CCheckBox::CCheckBox(), wGui::CDropDown::CDropDown(), wGui::CEditBox::CEditBox(), wGui::CFrame::CFrame(), wGui::CListBox::CListBox(), wGui::CMenu::CMenu(), wGui::CMenuBase::CMenuBase(), wGui::CPopupMenu::CPopupMenu(), wGui::CRadioButton::CRadioButton(), wGui::CScrollBar::CScrollBar(), wGui::CTextBox::CTextBox(), wGui::CToolBar::CToolBar(), wGui::CToolTip::CToolTip(), wGui::CView::CView(), and wGui::CApplication::Init().

void wGui::CMessageServer::DeregisterMessageClient ( CMessageClient pClient,
CMessage::EMessageType  eMessageType 
)

Deregister a client for a certain message type

Parameters:
pClient A pointer to the message client to be deregistered
eMessageType The message type for which the client no longer should recieve messages

Definition at line 84 of file wg_message_server.cpp.

References m_MessageClients.

Referenced by wGui::CMessageClient::~CMessageClient(), and wGui::CWindow::~CWindow().

void wGui::CMessageServer::DeregisterMessageClient ( CMessageClient pClient  ) 

Deregister a client for all message types

Parameters:
pClient A pointer to the message client to be deregistered

Definition at line 103 of file wg_message_server.cpp.

References m_MessageClients.

void wGui::CMessageServer::QueueMessage ( CMessage pMessage  ) 

Adds a message to the message queue

Parameters:
pMessage A pointer to the message to be queued

Definition at line 186 of file wg_message_server.cpp.

References wGui::CMessage::APP_PAINT, wGui::CMessage::Destination(), m_bIgnoreAllNewMessages, m_MessageQueue, and wGui::CMessage::MessageType().

Referenced by wGui::CFrame::CloseFrame(), wGui::CWindow::Draw(), wGui::CApplication::Exec(), wGui::CView::HandleMessage(), wGui::CToolBar::HandleMessage(), wGui::CTextBox::HandleMessage(), wGui::CScrollBar::HandleMessage(), wGui::CRadioButton::HandleMessage(), wGui::CMessageBox::HandleMessage(), wGui::CMenuBase::HandleMessage(), wGui::CFrame::HandleMessage(), wGui::CEditBox::HandleMessage(), wGui::CDropDown::HandleMessage(), wGui::CCheckBox::HandleMessage(), wGui::CApplication::HandleSDLEvent(), wGui::CPopupMenu::Hide(), wGui::CToolTip::HideTip(), wGui::CWindow::MoveWindow(), wGui::CTextBox::OnMouseButtonDown(), wGui::CPopupMenu::OnMouseButtonDown(), wGui::CMenu::OnMouseButtonDown(), wGui::CFrame::OnMouseButtonDown(), wGui::CEditBox::OnMouseButtonDown(), wGui::CRadioButton::OnMouseButtonUp(), wGui::CListBox::OnMouseButtonUp(), wGui::CCheckBox::OnMouseButtonUp(), wGui::CButton::OnMouseButtonUp(), wGui::CApplication::SetKeyFocus(), wGui::CApplication::SetMouseFocus(), wGui::CRangeControl< int >::SetValue(), wGui::CWindow::SetVisible(), and wGui::CTimer::TimerHit().

bool wGui::CMessageServer::MessageAvailable ( void   )  [inline]

Indicates if there are any messages available

Returns:
true if there's a message available in the queue

Definition at line 118 of file wg_message_server.h.

References m_MessageQueue.

void wGui::CMessageServer::IgnoreAllNewMessages ( bool  bIgnore  )  [inline]

Sets the server to ignore any new incoming messages (messages already in the queue are unaffected)

Parameters:
bIgnore if true, the message queue will ignore any new messages

Definition at line 122 of file wg_message_server.h.

References m_bIgnoreAllNewMessages.

Referenced by wGui::CApplication::Exec().


The documentation for this class was generated from the following files:
Generated on Wed May 16 23:11:27 2007 for wGui by  doxygen 1.5.1