VTK  9.6.20260201
vtkWaylandRenderWindowInteractor.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
18
19#ifndef vtkWaylandRenderWindowInteractor_h
20#define vtkWaylandRenderWindowInteractor_h
21
23#include "vtkRenderingUIModule.h" // For export macro
24#include "vtkWaylandHardwareWindow.h" // The hardware window it depends on
25#include "vtkWrappingHints.h" // For VTK_MARSHALAUTO
26
27// Forward declarations for Wayland and xkbcommon types.
28struct wl_display;
29struct wl_registry;
30struct wl_surface;
31struct wl_seat;
32struct wl_pointer;
33struct wl_keyboard;
34struct wl_data_device_manager;
35struct wl_data_device;
36struct wl_data_offer;
37struct xkb_context;
38struct xkb_keymap;
39struct xkb_state;
40
41VTK_ABI_NAMESPACE_BEGIN
42
43class vtkWaylandRenderWindowInteractorInternals;
44
47{
48public:
51 void PrintSelf(ostream& os, vtkIndent indent) override;
52
57 void Initialize() override;
58
62 void TerminateApp() override;
63
67 void ProcessEvents() override;
68
70
73 void Enable() override;
74 void Disable() override;
76
77 // These members are accessed by static C-style callbacks and must be public.
78
79 // Input device objects
80 struct wl_seat* Seat = nullptr;
81 struct wl_pointer* Pointer = nullptr;
82 struct wl_keyboard* Keyboard = nullptr;
83 uint32_t PointerSerial = 0;
84 uint32_t KeyboardSerial = 0;
85
86 // Keyboard handling via xkbcommon
87 struct xkb_context* XkbContext = nullptr;
88 struct xkb_keymap* XkbKeymap = nullptr;
89 struct xkb_state* XkbState = nullptr;
90
91protected:
94
95 // Wayland connection and window handles, obtained from HardwareWindow
96 struct wl_display* DisplayId = nullptr;
97 struct wl_surface* WindowId = nullptr;
98 struct wl_registry* Registry = nullptr; // Own registry for finding input devices
99
100 // Drag and drop related (placeholder for future implementation)
101 struct wl_data_device_manager* DataDeviceManager = nullptr;
102 struct wl_data_device* DataDevice = nullptr;
103 struct wl_data_offer* DndDataOffer = nullptr;
104
105 // Internal state
107
109
112 int InternalCreateTimer(int timerId, int timerType, unsigned long duration) override;
113 int InternalDestroyTimer(int platformTimerId) override;
115
117
121 void StartEventLoop() override;
122
127
131 void Finalize();
132
137 void Render() override;
138
140
141private:
143 void operator=(const vtkWaylandRenderWindowInteractor&) = delete;
144};
145
146VTK_ABI_NAMESPACE_END
147#endif
a simple class to control print indentation
Definition vtkIndent.h:108
void StartEventLoop() override
This starts the Wayland event loop and never returns.
static vtkWaylandRenderWindowInteractor * New()
void Disable() override
Enable/Disable interactions.
void Finalize()
Deallocate Wayland input resources.
void Enable() override
Enable/Disable interactions.
void WaitForEvents()
Wait for new events on the Wayland display file descriptor.
void ProcessEvents() override
Process all pending Wayland events and timer events, then return.
int InternalCreateTimer(int timerId, int timerType, unsigned long duration) override
Wayland-specific internal timer methods.
vtkWaylandRenderWindowInteractorInternals * Internal
void Initialize() override
Initializes the event handlers.
int InternalDestroyTimer(int platformTimerId) override
Wayland-specific internal timer methods.
void TerminateApp() override
Sets a flag to break the event loop.
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
struct wl_data_device_manager * DataDeviceManager
void Render() override
Request a render.
#define VTK_MARSHALAUTO