1 /* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
2 /* This Source Code Form is subject to the terms of the Mozilla Public
3 * License, v. 2.0. If a copy of the MPL was not distributed with this
4 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
15 // Avoid including windowsx.h to prevent macro pollution
17 #define GET_X_LPARAM(pt) (short(LOWORD(pt)))
20 #define GET_Y_LPARAM(pt) (short(HIWORD(pt)))
24 * Makes sure exit/enter mouse messages are always dispatched.
25 * In the case where the mouse has exited the outer most window the
26 * only way to tell if it has exited is to set a timer and look at the
27 * mouse pointer to see if it is within the outer most window.
33 HWND
GetMouseTrailerWindow() { return mMouseTrailerWindow
; }
34 HWND
GetCaptureWindow() { return mCaptureWindow
; }
36 void SetMouseTrailerWindow(HWND aWnd
);
37 void SetCaptureWindow(HWND aWnd
);
38 void Disable() { mEnabled
= false; DestroyTimer(); }
39 void Enable() { mEnabled
= true; CreateTimer(); }
46 nsresult
CreateTimer();
48 static void TimerProc(nsITimer
* aTimer
, void* aClosure
);
50 // Information for mouse enter/exit events
51 HWND mMouseTrailerWindow
;
53 bool mIsInCaptureMode
;
55 nsCOMPtr
<nsITimer
> mTimer
;
59 * Wrapper around the thread running the message pump.
60 * The toolkit abstraction is necessary because the message pump must
61 * execute within the same thread that created the widget under Win32.
73 static nsToolkit
* GetToolkit();
75 static HINSTANCE mDllInstance
;
76 static MouseTrailer
*gMouseTrailer
;
78 static void Startup(HMODULE hModule
);
79 static void Shutdown();
80 static void StartAllowingD3D9();
83 static nsToolkit
* gToolkit
;
85 nsCOMPtr
<nsITimer
> mD3D9Timer
;
86 MouseTrailer mMouseTrailer
;