File indexing completed on 2026-09-12 09:19:14
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
0034 class WNT_Window : public Aspect_Window
0035 {
0036 DEFINE_STANDARD_RTTIEXT(WNT_Window, Aspect_Window)
0037 public:
0038
0039 Standard_EXPORT static Aspect_VKey VirtualKeyFromNative(int theKey);
0040
0041
0042 Standard_EXPORT static Aspect_VKeyFlags MouseKeyFlagsFromEvent(WPARAM theKeys);
0043
0044
0045 Standard_EXPORT static Aspect_VKeyMouse MouseButtonsFromEvent(WPARAM theKeys);
0046
0047
0048 Standard_EXPORT static Aspect_VKeyFlags MouseKeyFlagsAsync();
0049
0050
0051 Standard_EXPORT static Aspect_VKeyMouse MouseButtonsAsync();
0052
0053 public:
0054
0055
0056
0057 Standard_EXPORT WNT_Window(const char* const theTitle,
0058 const occ::handle<WNT_WClass>& theClass,
0059 const WNT_Dword& theStyle,
0060 const int thePxLeft,
0061 const int thePxTop,
0062 const int thePxWidth,
0063 const int thePxHeight,
0064 const Quantity_NameOfColor theBackColor = Quantity_NOC_MATRAGRAY,
0065 const Aspect_Handle theParent = 0,
0066 const Aspect_Handle theMenu = 0,
0067 void* const theClientStruct = 0);
0068
0069
0070 Standard_EXPORT WNT_Window(const Aspect_Handle theHandle,
0071 const Quantity_NameOfColor theBackColor = Quantity_NOC_MATRAGRAY);
0072
0073
0074 Standard_EXPORT virtual ~WNT_Window();
0075
0076
0077 Standard_EXPORT void SetCursor(const Aspect_Handle theCursor) const;
0078
0079
0080 Standard_EXPORT virtual void Map() const override;
0081
0082
0083
0084
0085 Standard_EXPORT void Map(const int theMapMode) const;
0086
0087
0088 Standard_EXPORT virtual void Unmap() const override;
0089
0090
0091 Standard_EXPORT virtual Aspect_TypeOfResize DoResize() override;
0092
0093
0094 virtual bool DoMapping() const override { return true; }
0095
0096
0097 Standard_EXPORT void SetPos(const int X, const int Y, const int X1, const int Y1);
0098
0099
0100
0101 Standard_EXPORT virtual bool IsMapped() const override;
0102
0103
0104
0105 Standard_EXPORT virtual double Ratio() const override;
0106
0107
0108 Standard_EXPORT virtual void Position(int& X1, int& Y1, int& X2, int& Y2) const override;
0109
0110
0111 Standard_EXPORT virtual void Size(int& Width, int& Height) const override;
0112
0113
0114 virtual Aspect_Drawable NativeHandle() const override { return (Aspect_Drawable)myHWindow; }
0115
0116
0117 virtual Aspect_Drawable NativeParentHandle() const override
0118 {
0119 return (Aspect_Drawable)myHParentWindow;
0120 }
0121
0122
0123 virtual Aspect_FBConfig NativeFBConfig() const override { return NULL; }
0124
0125
0126 Standard_EXPORT virtual void SetTitle(const TCollection_AsciiString& theTitle) override;
0127
0128
0129
0130
0131 Standard_EXPORT virtual void InvalidateContent(
0132 const occ::handle<Aspect_DisplayConnection>& theDisp =
0133 occ::handle<Aspect_DisplayConnection>()) override;
0134
0135 public:
0136
0137 Aspect_Handle HWindow() const { return myHWindow; }
0138
0139
0140 Aspect_Handle HParentWindow() const { return myHParentWindow; }
0141
0142
0143 enum RawInputMask
0144 {
0145 RawInputMask_Mouse = 0x01,
0146 RawInputMask_SpaceMouse = 0x02,
0147 };
0148
0149
0150
0151
0152 Standard_EXPORT int RegisterRawInputDevices(unsigned int theRawDeviceMask);
0153
0154
0155
0156
0157
0158 Standard_EXPORT virtual bool ProcessMessage(Aspect_WindowInputListener& theListener, MSG& theMsg);
0159
0160 private:
0161 class TouchInputHelper;
0162
0163 protected:
0164 occ::handle<WNT_WClass> myWClass;
0165 occ::handle<TouchInputHelper> myTouchInputHelper;
0166 Aspect_Handle myHWindow;
0167 Aspect_Handle myHParentWindow;
0168 int myXLeft;
0169 int myYTop;
0170 int myXRight;
0171 int myYBottom;
0172 bool myIsForeign;
0173 };
0174
0175 #endif
0176 #endif