winDispatch.h

Engine/source/windowManager/win32/winDispatch.h

More...

Public Enumerations

enum
DispatchType {
  DelayedDispatch 
  ImmediateDispatch 
}

Some events must be processed immediately, and others can or should be processed later.

Public Functions

Dispatch(DispatchType type, HWND hWnd, UINT message, WPARAM wparam, WPARAM lparam)

Dispatch the event into the journaling system.

bool

Dispatch the next event in the delayed dispatch queue.

DispatchRemove(HWND hWnd)

Remove events related to the window from the dispatch queue.

RemoveMessages(HWND hWnd, UINT msgBegin, UINT msgEnd)

Remove messages from the event queue, matching a msg value range or hWnd.

Detailed Description

Public Enumerations

DispatchType

Enumerator

DelayedDispatch
ImmediateDispatch

Some events must be processed immediately, and others can or should be processed later.

This enum allows us to distinguish between the two types.

Public Functions

Dispatch(DispatchType type, HWND hWnd, UINT message, WPARAM wparam, WPARAM lparam)

Dispatch the event into the journaling system.

Dispatch Win32 events into the journaling system. To avoid problems with journaling, events should normally use the DelayedDispatch type.

Delayed events are pushed onto a queue for later processing by DispatchNext().

DispatchNext()

Dispatch the next event in the delayed dispatch queue.

This function should be called outside of any journaled calls. Returns true if an event was dispatched.

DispatchRemove(HWND hWnd)

Remove events related to the window from the dispatch queue.

RemoveMessages(HWND hWnd, UINT msgBegin, UINT msgEnd)

Remove messages from the event queue, matching a msg value range or hWnd.

If no filter is specified, either HWND or MessageRange, nothing will be removed You may not match HWND and MsgRange both, currently.

Message Range is calculated as follows.

  • Both Begin and End are specified as message values, ex WM_MOUSEMOVE

  • Specifying an identical set of begin/end will remove all messages matching that message value (WM_MOUSEMOVE)

  • If you specify a range it will remove from that beginning value through the end value

note:

: The range is useful because on windows messages declared such that you can filter a block of messages just by specifying the beginning value and end.
ex. WM_MOUSEFIRST,WM_MOUSELAST range will match all mouse messages.

Parameters:
hWnd

The HWND to filter by, this cannot be combined with a msg range filter currently

msgBegin

The beginning msg value to filter from

msgEnd

The ending msg value to filter to

 1
 2//-----------------------------------------------------------------------------
 3// Copyright (c) 2012 GarageGames, LLC
 4//
 5// Permission is hereby granted, free of charge, to any person obtaining a copy
 6// of this software and associated documentation files (the "Software"), to
 7// deal in the Software without restriction, including without limitation the
 8// rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
 9// sell copies of the Software, and to permit persons to whom the Software is
10// furnished to do so, subject to the following conditions:
11//
12// The above copyright notice and this permission notice shall be included in
13// all copies or substantial portions of the Software.
14//
15// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
20// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
21// IN THE SOFTWARE.
22//-----------------------------------------------------------------------------
23
24#ifndef _WINDOWMANAGER_WIN32_WINDISPATCH_H_
25#define _WINDOWMANAGER_WIN32_WINDISPATCH_H_
26
27//
28// *** This header requires that Window.h be included before this.
29//
30
31/// Some events must be processed immediately, and others can or should be
32/// processed later. This enum allows us to distinguish between the two
33/// types.
34enum DispatchType {
35   DelayedDispatch,
36   ImmediateDispatch,
37};
38
39/// Dispatch the event into the journaling system.
40///
41/// Dispatch Win32 events into the journaling system. To avoid problems
42/// with journaling, events should normally use the DelayedDispatch type.
43///
44/// Delayed events are pushed onto a queue for later processing by DispatchNext().
45void Dispatch(DispatchType,HWND hWnd,UINT message,WPARAM wparam,WPARAM lparam);
46
47/// Remove messages from the event queue, matching a msg value range or hWnd
48///
49/// If no filter is specified, either HWND or MessageRange, nothing will be removed
50/// You may not match HWND and MsgRange both, currently.
51///
52/// Message Range is calculated as follows.
53/// @li Both Begin and End are specified as message values, ex WM_MOUSEMOVE
54/// @li Specifying an identical set of begin/end will remove all messages matching that message value (WM_MOUSEMOVE)
55/// @li If you specify a range it will remove from that beginning value through the end value
56/// 
57/// @note : The range is useful because on windows messages declared such that you can filter a block of
58///  messages just by specifying the beginning value and end.  
59///  ex. WM_MOUSEFIRST,WM_MOUSELAST range will match all mouse messages.
60
61/// 
62/// @param hWnd The HWND to filter by, this cannot be combined with a msg range filter currently
63/// @param msgBegin The beginning msg value to filter from
64/// @param msgEnd The ending msg value to filter to
65void RemoveMessages(HWND hWnd,UINT msgBegin,UINT msgEnd );
66
67/// Dispatch the next event in the delayed dispatch queue.
68/// This function should be called outside of any journaled calls.
69/// Returns true if an event was dispatched.
70bool DispatchNext();
71
72/// Remove events related to the window from the dispatch queue.
73void DispatchRemove(HWND hWnd);
74
75#endif
76