VTK  9.6.20260202
vtkCocoaHardwareWindow.h
Go to the documentation of this file.
1// SPDX-FileCopyrightText: Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen
2// SPDX-License-Identifier: BSD-3-Clause
11
12#ifndef vtkCocoaHardwareWindow_h
13#define vtkCocoaHardwareWindow_h
14
15#include "vtkHardwareWindow.h"
16#include "vtkRenderingUIModule.h" // For export macro
17
18#include "vtkWrappingHints.h" // For VTK_MARSHALAUTO
19
20// Forward declare Objective-C classes
21#ifdef __OBJC__
22@class NSWindow;
23@class NSView;
24@class vtkCocoaWindowDelegate;
25#else
26class NSWindow;
27class NSView;
28class vtkCocoaWindowDelegate;
29#endif
30
31VTK_ABI_NAMESPACE_BEGIN
32
33class VTKRENDERINGUI_EXPORT VTK_MARSHALAUTO vtkCocoaHardwareWindow : public vtkHardwareWindow
34{
35public:
41 void PrintSelf(ostream& os, vtkIndent indent) override;
42
46 NSWindow* GetWindowId();
47
51 NSView* GetViewId();
52
57
58 // vtkHardwareWindow overrides
59 void Create() override;
60 void Destroy() override;
61
62 void* GetGenericWindowId() override;
63 void* GetGenericParentId() override;
64
66
69 void SetSize(int, int) override;
72
74
77 void SetPosition(int, int) override;
80
84 void SetWindowName(const char*) override;
85
87
90 void HideCursor() override;
91 void ShowCursor() override;
93
97 void SetCurrentCursor(int) override;
98
99protected:
102
103 NSWindow* WindowId = nullptr;
104 NSView* ViewId = nullptr;
105 vtkCocoaWindowDelegate* Delegate = nullptr;
106
107 bool OwnsWindow = false;
108 bool CursorHidden = false;
109
110private:
112 void operator=(const vtkCocoaHardwareWindow&) = delete;
113};
114
115VTK_ABI_NAMESPACE_END
116#endif // vtkCocoaHardwareWindow_h
void Destroy() override
void SetCurrentCursor(int) override
Change the shape of the cursor.
static vtkCocoaHardwareWindow * New()
Instantiate the class.
~vtkCocoaHardwareWindow() override
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
void ShowCursor() override
Hide or show the mouse cursor.
void * GetGenericWindowId() override
These are window system independent methods that are used to help interface vtkWindow to native windo...
void SetPosition(int, int) override
Set the position of the window in screen coordinates.
NSWindow * GetWindowId()
Get the native Cocoa window object.
vtkCocoaWindowDelegate * Delegate
void * GetGenericParentId() override
These are window system independent methods that are used to help interface vtkWindow to native windo...
void SetWindowName(const char *) override
Set the name (title) of the window.
void * GetMetalLayer()
Get the metal layer object.
void SetSize(int, int) override
Set the size of the window in screen coordinates.
void Create() override
void HideCursor() override
Hide or show the mouse cursor.
NSView * GetViewId()
Get the native Cocoa view object.
a simple class to control print indentation
Definition vtkIndent.h:108
virtual void SetPosition(int x, int y)
Set the position (x and y) of the rendering window in screen coordinates (in pixels).
virtual void SetSize(int width, int height)
Set the size (width and height) of the rendering window in screen coordinates (in pixels).
#define VTK_MARSHALAUTO