File indexing completed on 2026-09-30 09:02:43
0001
0002
0003
0004
0005
0006
0007
0008
0009
0010
0011
0012
0013
0014 #ifndef _Aspect_NeutralWindow_HeaderFile
0015 #define _Aspect_NeutralWindow_HeaderFile
0016
0017 #include <Aspect_Window.hxx>
0018
0019
0020
0021
0022
0023
0024 class Aspect_NeutralWindow : public Aspect_Window
0025 {
0026 DEFINE_STANDARD_RTTIEXT(Aspect_NeutralWindow, Aspect_Window)
0027 public:
0028
0029
0030 Standard_EXPORT Aspect_NeutralWindow();
0031
0032
0033 Aspect_Drawable NativeHandle() const override { return myHandle; }
0034
0035
0036 Aspect_Drawable NativeParentHandle() const override { return myParentHandle; }
0037
0038
0039 Aspect_FBConfig NativeFBConfig() const override { return myFBConfig; }
0040
0041
0042
0043 bool SetNativeHandle(Aspect_Drawable theWindow)
0044 {
0045 return SetNativeHandles(theWindow, 0, nullptr);
0046 }
0047
0048
0049
0050 Standard_EXPORT bool SetNativeHandles(Aspect_Drawable theWindow,
0051 Aspect_Drawable theParentWindow,
0052 Aspect_FBConfig theFbConfig);
0053
0054
0055 bool IsMapped() const override { return myIsMapped; }
0056
0057
0058 void Map() const override { myIsMapped = true; }
0059
0060
0061 void Unmap() const override { myIsMapped = false; }
0062
0063
0064 Aspect_TypeOfResize DoResize() override { return Aspect_TOR_UNKNOWN; }
0065
0066
0067 bool DoMapping() const override { return true; }
0068
0069
0070 double Ratio() const override
0071 {
0072 return (myWidth != 0 && myHeight != 0) ? double(myWidth) / double(myHeight) : 1.0;
0073 }
0074
0075
0076 void Position(int& theX1, int& theY1, int& theX2, int& theY2) const override
0077 {
0078 theX1 = myPosX;
0079 theX2 = myPosX + myWidth;
0080 theY1 = myPosY;
0081 theY2 = myPosY + myHeight;
0082 }
0083
0084
0085
0086 Standard_EXPORT bool SetPosition(int theX1, int theY1);
0087
0088
0089
0090 Standard_EXPORT bool SetPosition(int theX1, int theY1, int theX2, int theY2);
0091
0092
0093 void Size(int& theWidth, int& theHeight) const override
0094 {
0095 theWidth = myWidth;
0096 theHeight = myHeight;
0097 }
0098
0099
0100
0101 Standard_EXPORT bool SetSize(const int theWidth, const int theHeight);
0102
0103 protected:
0104 Aspect_Drawable myHandle;
0105 Aspect_Drawable myParentHandle;
0106 Aspect_FBConfig myFBConfig;
0107 int myPosX;
0108 int myPosY;
0109 int myWidth;
0110 int myHeight;
0111 mutable bool myIsMapped;
0112 };
0113
0114 #endif