File indexing completed on 2025-01-18 10:05:33
0001
0002
0003
0004
0005
0006
0007
0008
0009
0010
0011
0012
0013
0014
0015
0016
0017 #ifndef _WNT_Window_HeaderFile
0018 #define _WNT_Window_HeaderFile
0019
0020 #include <Aspect_Window.hxx>
0021
0022 #if defined(_WIN32) && !defined(OCCT_UWP)
0023
0024 #include <Aspect_Drawable.hxx>
0025 #include <Aspect_VKey.hxx>
0026 #include <Aspect_Handle.hxx>
0027 #include <WNT_Dword.hxx>
0028
0029 class Aspect_WindowInputListener;
0030 class WNT_WClass;
0031 typedef struct tagMSG MSG;
0032
0033 DEFINE_STANDARD_HANDLE(WNT_Window, Aspect_Window)
0034
0035
0036 class WNT_Window : public Aspect_Window
0037 {
0038 DEFINE_STANDARD_RTTIEXT(WNT_Window, Aspect_Window)
0039 public:
0040
0041
0042 Standard_EXPORT static Aspect_VKey VirtualKeyFromNative (Standard_Integer theKey);
0043
0044
0045 Standard_EXPORT static Aspect_VKeyFlags MouseKeyFlagsFromEvent (WPARAM theKeys);
0046
0047
0048 Standard_EXPORT static Aspect_VKeyMouse MouseButtonsFromEvent (WPARAM theKeys);
0049
0050
0051 Standard_EXPORT static Aspect_VKeyFlags MouseKeyFlagsAsync();
0052
0053
0054 Standard_EXPORT static Aspect_VKeyMouse MouseButtonsAsync();
0055
0056 public:
0057
0058
0059
0060 Standard_EXPORT WNT_Window (const Standard_CString theTitle,
0061 const Handle(WNT_WClass)& theClass,
0062 const WNT_Dword& theStyle,
0063 const Standard_Integer thePxLeft, const Standard_Integer thePxTop,
0064 const Standard_Integer thePxWidth, const Standard_Integer thePxHeight,
0065 const Quantity_NameOfColor theBackColor = Quantity_NOC_MATRAGRAY,
0066 const Aspect_Handle theParent = 0,
0067 const Aspect_Handle theMenu = 0,
0068 const Standard_Address theClientStruct = 0);
0069
0070
0071 Standard_EXPORT WNT_Window (const Aspect_Handle theHandle,
0072 const Quantity_NameOfColor theBackColor = Quantity_NOC_MATRAGRAY);
0073
0074
0075 Standard_EXPORT virtual ~WNT_Window();
0076
0077
0078 Standard_EXPORT void SetCursor (const Aspect_Handle theCursor) const;
0079
0080
0081 Standard_EXPORT virtual void Map() const Standard_OVERRIDE;
0082
0083
0084
0085
0086 Standard_EXPORT void Map (const Standard_Integer theMapMode) const;
0087
0088
0089 Standard_EXPORT virtual void Unmap() const Standard_OVERRIDE;
0090
0091
0092 Standard_EXPORT virtual Aspect_TypeOfResize DoResize() Standard_OVERRIDE;
0093
0094
0095 virtual Standard_Boolean DoMapping() const Standard_OVERRIDE { return Standard_True; }
0096
0097
0098 Standard_EXPORT void SetPos (const Standard_Integer X, const Standard_Integer Y, const Standard_Integer X1, const Standard_Integer Y1);
0099
0100
0101
0102 Standard_EXPORT virtual Standard_Boolean IsMapped() const Standard_OVERRIDE;
0103
0104
0105
0106 Standard_EXPORT virtual Standard_Real Ratio() const Standard_OVERRIDE;
0107
0108
0109 Standard_EXPORT virtual void Position (Standard_Integer& X1, Standard_Integer& Y1, Standard_Integer& X2, Standard_Integer& Y2) const Standard_OVERRIDE;
0110
0111
0112 Standard_EXPORT virtual void Size (Standard_Integer& Width, Standard_Integer& Height) const Standard_OVERRIDE;
0113
0114
0115 virtual Aspect_Drawable NativeHandle() const Standard_OVERRIDE { return (Aspect_Drawable )myHWindow; }
0116
0117
0118 virtual Aspect_Drawable NativeParentHandle() const Standard_OVERRIDE { return (Aspect_Drawable )myHParentWindow; }
0119
0120
0121 virtual Aspect_FBConfig NativeFBConfig() const Standard_OVERRIDE { return NULL; }
0122
0123
0124 Standard_EXPORT virtual void SetTitle (const TCollection_AsciiString& theTitle) Standard_OVERRIDE;
0125
0126
0127
0128 Standard_EXPORT virtual void InvalidateContent (const Handle(Aspect_DisplayConnection)& theDisp = Handle(Aspect_DisplayConnection)()) Standard_OVERRIDE;
0129
0130 public:
0131
0132
0133 Aspect_Handle HWindow() const { return myHWindow; }
0134
0135
0136 Aspect_Handle HParentWindow() const { return myHParentWindow; }
0137
0138
0139 enum RawInputMask
0140 {
0141 RawInputMask_Mouse = 0x01,
0142 RawInputMask_SpaceMouse = 0x02,
0143 };
0144
0145
0146
0147
0148 Standard_EXPORT int RegisterRawInputDevices (unsigned int theRawDeviceMask);
0149
0150
0151
0152
0153
0154 Standard_EXPORT virtual bool ProcessMessage (Aspect_WindowInputListener& theListener,
0155 MSG& theMsg);
0156
0157 private:
0158
0159 class TouchInputHelper;
0160
0161 protected:
0162
0163 Handle(WNT_WClass) myWClass;
0164 Handle(TouchInputHelper) myTouchInputHelper;
0165 Aspect_Handle myHWindow;
0166 Aspect_Handle myHParentWindow;
0167 Standard_Integer myXLeft;
0168 Standard_Integer myYTop;
0169 Standard_Integer myXRight;
0170 Standard_Integer myYBottom;
0171 Standard_Boolean myIsForeign;
0172
0173 };
0174
0175 #endif
0176 #endif