Open CASCADE Technology  7.4.0
Public Member Functions | Static Public Member Functions | Protected Attributes

Cocoa_Window Class Reference

This class defines Cocoa window. More...

#include <Cocoa_Window.hxx>

Inheritance diagram for Cocoa_Window:
Inheritance graph
[legend]

Public Member Functions

 Cocoa_Window (const Standard_CString theTitle, const Standard_Integer thePxLeft, const Standard_Integer thePxTop, const Standard_Integer thePxWidth, const Standard_Integer thePxHeight)
 Creates a NSWindow and NSView defined by his position and size in pixels. More...
 
 Cocoa_Window (NSView *theViewNS)
 Creates a wrapper over existing NSView handle. More...
 
 ~Cocoa_Window ()
 Destroys the Window and all resourses attached to it. More...
 
virtual void Map () const override
 Opens the window <me> More...
 
virtual void Unmap () const override
 Closes the window <me> More...
 
virtual Aspect_TypeOfResize DoResize () const override
 Applies the resizing to the window <me> More...
 
virtual Standard_Boolean DoMapping () const override
 Apply the mapping change to the window <me> More...
 
virtual Standard_Boolean IsMapped () const override
 Returns True if the window <me> is opened. More...
 
virtual Standard_Real Ratio () const override
 Returns The Window RATIO equal to the physical WIDTH/HEIGHT dimensions. More...
 
virtual void Position (Standard_Integer &X1, Standard_Integer &Y1, Standard_Integer &X2, Standard_Integer &Y2) const override
 Returns The Window POSITION in PIXEL. More...
 
virtual void Size (Standard_Integer &theWidth, Standard_Integer &theHeight) const override
 Returns The Window SIZE in PIXEL. More...
 
NSView * HView () const
 
void SetHView (NSView *theView)
 Setup new NSView. More...
 
virtual Aspect_Drawable NativeHandle () const override
 
virtual Aspect_Drawable NativeParentHandle () const override
 
virtual Aspect_FBConfig NativeFBConfig () const override
 Returns nothing on OS X. More...
 
virtual void SetTitle (const TCollection_AsciiString &theTitle) override
 Sets window title. More...
 
virtual void InvalidateContent (const Handle< Aspect_DisplayConnection > &theDisp=NULL) override
 Invalidate entire window content by setting NSView::setNeedsDisplay property. Call will be implicitly redirected to the main thread when called from non-GUI thread. More...
 
- Public Member Functions inherited from Aspect_Window
void SetBackground (const Aspect_Background &ABack)
 Modifies the window background. More...
 
void SetBackground (const Quantity_Color &color)
 Modifies the window background. More...
 
void SetBackground (const Aspect_GradientBackground &ABackground)
 Modifies the window gradient background. More...
 
void SetBackground (const Quantity_Color &theFirstColor, const Quantity_Color &theSecondColor, const Aspect_GradientFillMethod theFillMethod)
 Modifies the window gradient background. More...
 
Aspect_Background Background () const
 Returns the window background. More...
 
Aspect_FillMethod BackgroundFillMethod () const
 Returns the current image background fill mode. More...
 
Aspect_GradientBackground GradientBackground () const
 Returns the window gradient background. More...
 
Standard_Boolean IsVirtual () const
 Returns True if the window <me> is virtual. More...
 
void SetVirtual (const Standard_Boolean theVirtual)
 Setup the virtual state. More...
 
- Public Member Functions inherited from Standard_Transient
 Standard_Transient ()
 Empty constructor. More...
 
 Standard_Transient (const Standard_Transient &)
 Copy constructor – does nothing. More...
 
Standard_Transientoperator= (const Standard_Transient &)
 Assignment operator, needed to avoid copying reference counter. More...
 
virtual ~Standard_Transient ()
 Destructor must be virtual. More...
 
virtual void Delete () const
 Memory deallocator for transient classes. More...
 
virtual const opencascade::handle< Standard_Type > & DynamicType () const
 Returns a type descriptor about this object. More...
 
Standard_Boolean IsInstance (const opencascade::handle< Standard_Type > &theType) const
 Returns a true value if this is an instance of Type. More...
 
Standard_Boolean IsInstance (const Standard_CString theTypeName) const
 Returns a true value if this is an instance of TypeName. More...
 
Standard_Boolean IsKind (const opencascade::handle< Standard_Type > &theType) const
 Returns true if this is an instance of Type or an instance of any class that inherits from Type. Note that multiple inheritance is not supported by OCCT RTTI mechanism. More...
 
Standard_Boolean IsKind (const Standard_CString theTypeName) const
 Returns true if this is an instance of TypeName or an instance of any class that inherits from TypeName. Note that multiple inheritance is not supported by OCCT RTTI mechanism. More...
 
Standard_TransientThis () const
 Returns non-const pointer to this object (like const_cast). For protection against creating handle to objects allocated in stack or call from constructor, it will raise exception Standard_ProgramError if reference counter is zero. More...
 
Standard_Integer GetRefCount () const
 Get the reference counter of this object. More...
 
void IncrementRefCounter () const
 Increments the reference counter of this object. More...
 
Standard_Integer DecrementRefCounter () const
 Decrements the reference counter of this object; returns the decremented value. More...
 

Static Public Member Functions

static Aspect_VKey VirtualKeyFromNative (Standard_Integer theKey)
 Convert Carbon virtual key into Aspect_VKey. More...
 
- Static Public Member Functions inherited from Standard_Transient
static const char * get_type_name ()
 Returns a type descriptor about this object. More...
 
static const opencascade::handle< Standard_Type > & get_type_descriptor ()
 Returns type descriptor of Standard_Transient class. More...
 

Protected Attributes

NSWindow * myHWindow
 
NSView * myHView
 
Standard_Integer myXLeft
 
Standard_Integer myYTop
 
Standard_Integer myXRight
 
Standard_Integer myYBottom
 
- Protected Attributes inherited from Aspect_Window
Aspect_Background MyBackground
 
Aspect_GradientBackground MyGradientBackground
 
Aspect_FillMethod MyBackgroundFillMethod
 
Standard_Boolean MyIsVirtual
 

Additional Inherited Members

- Public Types inherited from Standard_Transient
typedef void base_type
 Returns a type descriptor about this object. More...
 
- Protected Member Functions inherited from Aspect_Window
 Aspect_Window ()
 Initializes the datas of a Window. More...
 

Detailed Description

This class defines Cocoa window.

Constructor & Destructor Documentation

◆ Cocoa_Window() [1/2]

Cocoa_Window::Cocoa_Window ( const Standard_CString  theTitle,
const Standard_Integer  thePxLeft,
const Standard_Integer  thePxTop,
const Standard_Integer  thePxWidth,
const Standard_Integer  thePxHeight 
)

Creates a NSWindow and NSView defined by his position and size in pixels.

◆ Cocoa_Window() [2/2]

Cocoa_Window::Cocoa_Window ( NSView *  theViewNS)

Creates a wrapper over existing NSView handle.

◆ ~Cocoa_Window()

Cocoa_Window::~Cocoa_Window ( )

Destroys the Window and all resourses attached to it.

Member Function Documentation

◆ DoMapping()

virtual Standard_Boolean Cocoa_Window::DoMapping ( ) const
overridevirtual

Apply the mapping change to the window <me>

Implements Aspect_Window.

◆ DoResize()

virtual Aspect_TypeOfResize Cocoa_Window::DoResize ( ) const
overridevirtual

Applies the resizing to the window <me>

Implements Aspect_Window.

◆ HView()

NSView* Cocoa_Window::HView ( ) const
inline
Returns
associated NSView

◆ InvalidateContent()

virtual void Cocoa_Window::InvalidateContent ( const Handle< Aspect_DisplayConnection > &  theDisp = NULL)
overridevirtual

Invalidate entire window content by setting NSView::setNeedsDisplay property. Call will be implicitly redirected to the main thread when called from non-GUI thread.

Reimplemented from Aspect_Window.

◆ IsMapped()

virtual Standard_Boolean Cocoa_Window::IsMapped ( ) const
overridevirtual

Returns True if the window <me> is opened.

Implements Aspect_Window.

◆ Map()

virtual void Cocoa_Window::Map ( ) const
overridevirtual

Opens the window <me>

Implements Aspect_Window.

◆ NativeFBConfig()

virtual Aspect_FBConfig Cocoa_Window::NativeFBConfig ( ) const
inlineoverridevirtual

Returns nothing on OS X.

Implements Aspect_Window.

◆ NativeHandle()

virtual Aspect_Drawable Cocoa_Window::NativeHandle ( ) const
inlineoverridevirtual
Returns
native Window handle

Implements Aspect_Window.

◆ NativeParentHandle()

virtual Aspect_Drawable Cocoa_Window::NativeParentHandle ( ) const
inlineoverridevirtual
Returns
parent of native Window handle

Implements Aspect_Window.

◆ Position()

virtual void Cocoa_Window::Position ( Standard_Integer X1,
Standard_Integer Y1,
Standard_Integer X2,
Standard_Integer Y2 
) const
overridevirtual

Returns The Window POSITION in PIXEL.

Implements Aspect_Window.

◆ Ratio()

virtual Standard_Real Cocoa_Window::Ratio ( ) const
overridevirtual

Returns The Window RATIO equal to the physical WIDTH/HEIGHT dimensions.

Implements Aspect_Window.

◆ SetHView()

void Cocoa_Window::SetHView ( NSView *  theView)

Setup new NSView.

◆ SetTitle()

virtual void Cocoa_Window::SetTitle ( const TCollection_AsciiString theTitle)
overridevirtual

Sets window title.

Reimplemented from Aspect_Window.

◆ Size()

virtual void Cocoa_Window::Size ( Standard_Integer theWidth,
Standard_Integer theHeight 
) const
overridevirtual

Returns The Window SIZE in PIXEL.

Implements Aspect_Window.

◆ Unmap()

virtual void Cocoa_Window::Unmap ( ) const
overridevirtual

Closes the window <me>

Implements Aspect_Window.

◆ VirtualKeyFromNative()

static Aspect_VKey Cocoa_Window::VirtualKeyFromNative ( Standard_Integer  theKey)
static

Convert Carbon virtual key into Aspect_VKey.

Field Documentation

◆ myHView

NSView* Cocoa_Window::myHView
protected

◆ myHWindow

NSWindow* Cocoa_Window::myHWindow
protected

◆ myXLeft

Standard_Integer Cocoa_Window::myXLeft
protected

◆ myXRight

Standard_Integer Cocoa_Window::myXRight
protected

◆ myYBottom

Standard_Integer Cocoa_Window::myYBottom
protected

◆ myYTop

Standard_Integer Cocoa_Window::myYTop
protected

The documentation for this class was generated from the following file: