File indexing completed on 2025-01-18 10:03:22
0001
0002
0003
0004
0005
0006
0007
0008
0009
0010
0011
0012
0013
0014
0015
0016 #ifndef Cocoa_Window_HeaderFile
0017 #define Cocoa_Window_HeaderFile
0018
0019 #if defined(__APPLE__)
0020 #import <TargetConditionals.h>
0021 #endif
0022
0023 #if defined(TARGET_OS_IPHONE) && TARGET_OS_IPHONE
0024 #ifdef __OBJC__
0025 @class UIView;
0026 @class UIWindow;
0027 #else
0028 struct UIView;
0029 struct UIWindow;
0030 #endif
0031 #else
0032 #ifdef __OBJC__
0033 @class NSView;
0034 @class NSWindow;
0035 #else
0036 struct NSView;
0037 struct NSWindow;
0038 #endif
0039 #endif
0040
0041 #include <Aspect_Window.hxx>
0042
0043 #include <Standard.hxx>
0044 #include <Standard_Type.hxx>
0045
0046 #include <Aspect_FillMethod.hxx>
0047 #include <Aspect_GradientFillMethod.hxx>
0048 #include <Aspect_Handle.hxx>
0049 #include <Aspect_TypeOfResize.hxx>
0050 #include <Aspect_VKey.hxx>
0051 #include <Quantity_NameOfColor.hxx>
0052
0053 class Aspect_WindowDefinitionError;
0054 class Aspect_WindowError;
0055 class Aspect_Background;
0056 class Quantity_Color;
0057 class Aspect_GradientBackground;
0058
0059
0060 class Cocoa_Window : public Aspect_Window
0061 {
0062 public:
0063
0064
0065 Standard_EXPORT static Aspect_VKey VirtualKeyFromNative (Standard_Integer theKey);
0066
0067 public:
0068
0069
0070 Standard_EXPORT Cocoa_Window (const Standard_CString theTitle,
0071 const Standard_Integer thePxLeft,
0072 const Standard_Integer thePxTop,
0073 const Standard_Integer thePxWidth,
0074 const Standard_Integer thePxHeight);
0075
0076 #if defined(TARGET_OS_IPHONE) && TARGET_OS_IPHONE
0077
0078 Standard_EXPORT Cocoa_Window (UIView* theViewUI);
0079 #else
0080
0081 Standard_EXPORT Cocoa_Window (NSView* theViewNS);
0082 #endif
0083
0084
0085 Standard_EXPORT ~Cocoa_Window();
0086
0087
0088 Standard_EXPORT virtual void Map() const Standard_OVERRIDE;
0089
0090
0091 Standard_EXPORT virtual void Unmap() const Standard_OVERRIDE;
0092
0093
0094 Standard_EXPORT virtual Aspect_TypeOfResize DoResize() Standard_OVERRIDE;
0095
0096
0097 Standard_EXPORT virtual Standard_Boolean DoMapping() const Standard_OVERRIDE;
0098
0099
0100 Standard_EXPORT virtual Standard_Boolean IsMapped() const Standard_OVERRIDE;
0101
0102
0103 Standard_EXPORT virtual Standard_Real Ratio() const Standard_OVERRIDE;
0104
0105
0106 Standard_EXPORT virtual void Position (Standard_Integer& X1,
0107 Standard_Integer& Y1,
0108 Standard_Integer& X2,
0109 Standard_Integer& Y2) const Standard_OVERRIDE;
0110
0111
0112 Standard_EXPORT virtual void Size (Standard_Integer& theWidth,
0113 Standard_Integer& theHeight) const Standard_OVERRIDE;
0114
0115 #if defined(TARGET_OS_IPHONE) && TARGET_OS_IPHONE
0116
0117 UIView* HView() const { return myHView; }
0118
0119
0120 Standard_EXPORT void SetHView (UIView* theView);
0121 #else
0122
0123 NSView* HView() const { return myHView; }
0124
0125
0126 Standard_EXPORT void SetHView (NSView* theView);
0127 #endif
0128
0129
0130 virtual Aspect_Drawable NativeHandle() const Standard_OVERRIDE
0131 {
0132 return (Aspect_Drawable )HView();
0133 }
0134
0135
0136 virtual Aspect_Drawable NativeParentHandle() const Standard_OVERRIDE
0137 {
0138 return 0;
0139 }
0140
0141
0142 virtual Aspect_FBConfig NativeFBConfig() const Standard_OVERRIDE { return NULL; }
0143
0144
0145 Standard_EXPORT virtual void SetTitle (const TCollection_AsciiString& theTitle) Standard_OVERRIDE;
0146
0147
0148
0149 Standard_EXPORT virtual void InvalidateContent (const Handle(Aspect_DisplayConnection)& theDisp = NULL) Standard_OVERRIDE;
0150
0151 protected:
0152
0153 #if defined(TARGET_OS_IPHONE) && TARGET_OS_IPHONE
0154 UIView* myHView;
0155 #else
0156 NSWindow* myHWindow;
0157 NSView* myHView;
0158 #endif
0159 Standard_Integer myXLeft;
0160 Standard_Integer myYTop;
0161 Standard_Integer myXRight;
0162 Standard_Integer myYBottom;
0163
0164 public:
0165
0166 DEFINE_STANDARD_RTTIEXT(Cocoa_Window,Aspect_Window)
0167
0168 };
0169
0170 DEFINE_STANDARD_HANDLE(Cocoa_Window, Aspect_Window)
0171
0172 #endif