#include <wg_message_server.h>
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
Definition at line 69 of file wg_message_server.h.
Used for marking the priority of registered message clients, where the higher priority clients will get messages first.
Definition at line 81 of file wg_message_server.h.
CMessageServer & wGui::CMessageServer::Instance | ( | void | ) | [static] |
Gets the single instance of the message server
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
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
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
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
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
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)
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().