#ifndef _WNT_Window_HeaderFile
#define _WNT_Window_HeaderFile
-#include <Standard.hxx>
-#include <Standard_Type.hxx>
+#include <Aspect_Window.hxx>
-#include <Standard_Integer.hxx>
+#if defined(_WIN32) && !defined(OCCT_UWP)
+
+#include <Aspect_Drawable.hxx>
+#include <Aspect_VKey.hxx>
#include <Aspect_Handle.hxx>
-#include <Standard_Boolean.hxx>
-#include <Aspect_Window.hxx>
-#include <Standard_CString.hxx>
+#include <Standard_Type.hxx>
#include <WNT_Dword.hxx>
-#include <Quantity_NameOfColor.hxx>
-#include <Standard_Address.hxx>
-#include <Aspect_TypeOfResize.hxx>
-#include <Quantity_Ratio.hxx>
-#include <Aspect_Drawable.hxx>
-class WNT_WClass;
-class Aspect_WindowDefinitionError;
-class Aspect_WindowError;
+class WNT_WClass;
-class WNT_Window;
DEFINE_STANDARD_HANDLE(WNT_Window, Aspect_Window)
//! This class defines Windows NT window
class WNT_Window : public Aspect_Window
{
+public:
+
+ //! Convert WInAPI virtual key (VK_ enumeration) into Aspect_VKey.
+ Standard_EXPORT static Aspect_VKey VirtualKeyFromNative (Standard_Integer theKey);
+
+ //! Convert WPARAM from mouse event to key flags.
+ Standard_EXPORT static Aspect_VKeyFlags MouseKeyFlagsFromEvent (WPARAM theKeys);
+
+ //! Convert WPARAM from mouse event to mouse buttons bitmask.
+ Standard_EXPORT static Aspect_VKeyMouse MouseButtonsFromEvent (WPARAM theKeys);
+
+ //! Use GetAsyncKeyState() to fetch actual mouse key flags regardless of event loop.
+ Standard_EXPORT static Aspect_VKeyFlags MouseKeyFlagsAsync();
+
+ //! Use GetAsyncKeyState() to fetch actual mouse buttons state regardless of event loop.
+ Standard_EXPORT static Aspect_VKeyMouse MouseButtonsAsync();
public:
-
//! Creates a Window defined by his position and size
//! in pixles from the Parent Window.
//! Trigger: Raises WindowDefinitionError if the Position out of the
//! This handle equals ( aPart1 << 16 ) + aPart2.
Standard_EXPORT WNT_Window(const Aspect_Handle aHandle, const Quantity_NameOfColor aBackColor = Quantity_NOC_MATRAGRAY);
- //! Destroies the Window and all resourses attached to it.
- Standard_EXPORT virtual void Destroy();
-~WNT_Window()
-{
- Destroy();
-}
+ //! Destroys the Window and all resourses attached to it.
+ Standard_EXPORT ~WNT_Window();
//! Sets cursor <aCursor> for ENTIRE WINDOW CLASS to which
//! the Window belongs.
Standard_EXPORT virtual void Unmap() const Standard_OVERRIDE;
//! Applies the resizing to the window <me>.
- Standard_EXPORT virtual Aspect_TypeOfResize DoResize() const Standard_OVERRIDE;
+ Standard_EXPORT virtual Aspect_TypeOfResize DoResize() Standard_OVERRIDE;
//! Apply the mapping change to the window <me>
//! and returns TRUE if the window is mapped at screen.
//! Returns The Window RATIO equal to the physical
//! WIDTH/HEIGHT dimensions.
- Standard_EXPORT virtual Quantity_Ratio Ratio() const Standard_OVERRIDE;
+ Standard_EXPORT virtual Standard_Real Ratio() const Standard_OVERRIDE;
//! Returns The Window POSITION in PIXEL
Standard_EXPORT virtual void Position (Standard_Integer& X1, Standard_Integer& Y1, Standard_Integer& X2, Standard_Integer& Y2) const Standard_OVERRIDE;
//! Returns nothing on Windows
virtual Aspect_FBConfig NativeFBConfig() const Standard_OVERRIDE { return NULL; }
- DEFINE_STANDARD_RTTI(WNT_Window,Aspect_Window)
+ //! Sets window title.
+ Standard_EXPORT virtual void SetTitle (const TCollection_AsciiString& theTitle) Standard_OVERRIDE;
-protected:
+ //! Invalidate entire window content by calling InvalidateRect() WinAPI function, resulting in WM_PAINT event put into window message loop.
+ //! Method can be called from non-window thread, and system will also automatically aggregate multiple events into single one.
+ Standard_EXPORT virtual void InvalidateContent (const Handle(Aspect_DisplayConnection)& theDisp = NULL) Standard_OVERRIDE;
+
+ //! Raw input flags.
+ enum RawInputMask
+ {
+ RawInputMask_Mouse = 0x01, //!< HID_USAGE_GENERIC_MOUSE
+ RawInputMask_SpaceMouse = 0x02, //!< HID_USAGE_GENERIC_MULTI_AXIS_CONTROLLER
+ };
+
+ //! RegisterRawInputDevices() wrapper.
+ //! @param theRawDeviceMask [in] mask of RawInputMask flags
+ //! @return number of actually registered device types
+ Standard_EXPORT int RegisterRawInputDevices (unsigned int theRawDeviceMask);
+ DEFINE_STANDARD_RTTIEXT(WNT_Window,Aspect_Window)
+
+protected:
Standard_Integer aXLeft;
Standard_Integer aYTop;
Aspect_Handle myHParentWindow;
Standard_Boolean myIsForeign;
-
-private:
-
-
-
-
};
-
#include <WNT_Window.lxx>
-
-
-
-
+#endif // _WIN32
#endif // _WNT_Window_HeaderFile