File indexing completed on 2025-01-18 10:02:58
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
0031 Standard_EXPORT Aspect_NeutralWindow();
0032
0033
0034 virtual Aspect_Drawable NativeHandle() const Standard_OVERRIDE { return myHandle; }
0035
0036
0037 virtual Aspect_Drawable NativeParentHandle() const Standard_OVERRIDE { return myParentHandle; }
0038
0039
0040 virtual Aspect_FBConfig NativeFBConfig() const Standard_OVERRIDE { return myFBConfig; }
0041
0042
0043
0044 Standard_Boolean SetNativeHandle (Aspect_Drawable theWindow) { return SetNativeHandles (theWindow, 0, 0); }
0045
0046
0047
0048 Standard_EXPORT Standard_Boolean SetNativeHandles (Aspect_Drawable theWindow,
0049 Aspect_Drawable theParentWindow,
0050 Aspect_FBConfig theFbConfig);
0051
0052
0053 virtual Standard_Boolean IsMapped() const Standard_OVERRIDE { return myIsMapped; }
0054
0055
0056 virtual void Map() const Standard_OVERRIDE { myIsMapped = Standard_True; }
0057
0058
0059 virtual void Unmap() const Standard_OVERRIDE { myIsMapped = Standard_False; }
0060
0061
0062 virtual Aspect_TypeOfResize DoResize() Standard_OVERRIDE { return Aspect_TOR_UNKNOWN; }
0063
0064
0065 virtual Standard_Boolean DoMapping() const Standard_OVERRIDE { return Standard_True; }
0066
0067
0068 virtual Standard_Real Ratio() const Standard_OVERRIDE
0069 {
0070 return (myWidth != 0 && myHeight != 0)
0071 ? Standard_Real(myWidth) / Standard_Real(myHeight)
0072 : 1.0;
0073 }
0074
0075
0076 virtual void Position (Standard_Integer& theX1, Standard_Integer& theY1,
0077 Standard_Integer& theX2, Standard_Integer& theY2) const Standard_OVERRIDE
0078 {
0079 theX1 = myPosX;
0080 theX2 = myPosX + myWidth;
0081 theY1 = myPosY;
0082 theY2 = myPosY + myHeight;
0083 }
0084
0085
0086
0087 Standard_EXPORT Standard_Boolean SetPosition (Standard_Integer theX1,
0088 Standard_Integer theY1);
0089
0090
0091
0092 Standard_EXPORT Standard_Boolean SetPosition (Standard_Integer theX1, Standard_Integer theY1,
0093 Standard_Integer theX2, Standard_Integer theY2);
0094
0095
0096 virtual void Size (Standard_Integer& theWidth,
0097 Standard_Integer& theHeight) const Standard_OVERRIDE
0098 {
0099 theWidth = myWidth;
0100 theHeight = myHeight;
0101 }
0102
0103
0104
0105 Standard_EXPORT Standard_Boolean SetSize (const Standard_Integer theWidth,
0106 const Standard_Integer theHeight);
0107
0108 protected:
0109
0110 Aspect_Drawable myHandle;
0111 Aspect_Drawable myParentHandle;
0112 Aspect_FBConfig myFBConfig;
0113 Standard_Integer myPosX;
0114 Standard_Integer myPosY;
0115 Standard_Integer myWidth;
0116 Standard_Integer myHeight;
0117 mutable Standard_Boolean myIsMapped;
0118
0119 };
0120
0121 DEFINE_STANDARD_HANDLE(Aspect_NeutralWindow, Aspect_Window)
0122
0123 #endif