Blender V4.3
GHOST_WindowWayland.hh
Go to the documentation of this file.
1/* SPDX-FileCopyrightText: 2020-2023 Blender Authors
2 *
3 * SPDX-License-Identifier: GPL-2.0-or-later */
4
11#pragma once
12
13#include "GHOST_Window.hh"
14
15#include <vector>
16
17#include <wayland-util.h> /* For #wl_fixed_t */
18
58#define USE_EVENT_BACKGROUND_THREAD
59
61
62struct GWL_Output;
63struct GWL_Window;
64
66 public:
68
70 const char *title,
71 int32_t left,
72 int32_t top,
73 uint32_t width,
74 uint32_t height,
76 const GHOST_IWindow *parentWindow,
78 const bool is_dialog,
79 const bool stereoVisual,
80 const bool exclusive,
81 const bool is_debug,
82 const GHOST_GPUDevice &preferred_device);
83
84 ~GHOST_WindowWayland() override;
85
86 /* Ghost API */
87
88#ifdef USE_EVENT_BACKGROUND_THREAD
89 GHOST_TSuccess swapBuffers() override; /* Only for assertion. */
90#endif
91
92 uint16_t getDPIHint() override;
93
95
97
99 uint8_t *mask,
100 int sizex,
101 int sizey,
102 int hotX,
103 int hotY,
104 bool canInvertColor) override;
105 bool getCursorGrabUseSoftwareDisplay() override;
106
108
109 bool getValid() const override;
110
111 void setTitle(const char *title) override;
112
113 std::string getTitle() const override;
114
115 void getWindowBounds(GHOST_Rect &bounds) const override;
116
117 void getClientBounds(GHOST_Rect &bounds) const override;
118
119 GHOST_TSuccess setClientWidth(uint32_t width) override;
120
121 GHOST_TSuccess setClientHeight(uint32_t height) override;
122
123 GHOST_TSuccess setClientSize(uint32_t width, uint32_t height) override;
124
125 void screenToClient(int32_t inX, int32_t inY, int32_t &outX, int32_t &outY) const override;
126
127 void clientToScreen(int32_t inX, int32_t inY, int32_t &outX, int32_t &outY) const override;
128
129 GHOST_TSuccess setWindowCursorVisibility(bool visible) override;
130
132
133 GHOST_TWindowState getState() const override;
134
135 GHOST_TSuccess invalidate() override;
136
138
139 GHOST_TSuccess beginFullScreen() const override;
140
141 GHOST_TSuccess endFullScreen() const override;
142
143 bool isDialog() const override;
144
145#ifdef WITH_INPUT_IME
146 void beginIME(int32_t x, int32_t y, int32_t w, int32_t h, bool completed) override;
147 void endIME() override;
148#endif /* WITH_INPUT_IME */
149
150 /* WAYLAND direct-data access. */
151
152 int scale_get() const;
153 const struct GWL_WindowScaleParams &scale_params_get() const;
154
155 struct wl_surface *wl_surface_get() const;
156 const std::vector<GWL_Output *> &outputs_get();
157
158 wl_fixed_t wl_fixed_from_window(wl_fixed_t value) const;
159 wl_fixed_t wl_fixed_to_window(wl_fixed_t value) const;
160
161 /* WAYLAND window-level functions. */
162
177
181
182 /* WAYLAND utility functions. */
183
192
193 bool outputs_enter(GWL_Output *output);
194 bool outputs_leave(GWL_Output *output);
195
201
202#ifdef USE_EVENT_BACKGROUND_THREAD
203 const void pending_actions_handle();
204#endif
205
206 private:
207 GHOST_SystemWayland *system_;
208 struct GWL_Window *window_;
209 bool is_debug_context_;
210 GHOST_GPUDevice preferred_device_;
211
216 GHOST_Context *newDrawingContext(GHOST_TDrawingContextType type) override;
217};
#define wl_surface
GHOST_TWindowState
GHOST_TStandardCursor
GHOST_TDrawingContextType
GHOST_TWindowOrder
GHOST_TSuccess
Definition GHOST_Types.h:87
GHOST_TGrabCursorMode
static btDbvtVolume bounds(btDbvtNode **leaves, int count)
Definition btDbvt.cpp:299
SIMD_FORCE_INLINE const btScalar & w() const
Return the w value.
Definition btQuadWord.h:119
GHOST_TSuccess hasCursorShape(GHOST_TStandardCursor cursorShape) override
const struct GWL_WindowScaleParams & scale_params_get() const
GHOST_TSuccess setClientSize(uint32_t width, uint32_t height) override
bool outputs_leave(GWL_Output *output)
GHOST_TSuccess setClientWidth(uint32_t width) override
wl_fixed_t wl_fixed_to_window(wl_fixed_t value) const
GHOST_TSuccess setOrder(GHOST_TWindowOrder order) override
GHOST_TSuccess swapBuffers() override
GHOST_TSuccess setWindowCursorGrab(GHOST_TGrabCursorMode mode) override
GHOST_TSuccess setState(GHOST_TWindowState state) override
GHOST_TSuccess setWindowCursorVisibility(bool visible) override
GHOST_TWindowState getState() const override
bool getCursorGrabUseSoftwareDisplay() override
GHOST_TSuccess beginFullScreen() const override
bool isDialog() const override
struct wl_surface * wl_surface_get() const
GHOST_TSuccess notify_decor_redraw()
bool getValid() const override
wl_fixed_t wl_fixed_from_window(wl_fixed_t value) const
std::string getTitle() const override
void getClientBounds(GHOST_Rect &bounds) const override
uint16_t getDPIHint() override
void clientToScreen(int32_t inX, int32_t inY, int32_t &outX, int32_t &outY) const override
GHOST_TSuccess endFullScreen() const override
GHOST_TSuccess setClientHeight(uint32_t height) override
GHOST_TSuccess cursor_shape_refresh()
void screenToClient(int32_t inX, int32_t inY, int32_t &outX, int32_t &outY) const override
bool outputs_enter(GWL_Output *output)
GHOST_TSuccess invalidate() override
GHOST_TSuccess setWindowCursorShape(GHOST_TStandardCursor shape) override
void setTitle(const char *title) override
GHOST_WindowWayland(GHOST_SystemWayland *system, const char *title, int32_t left, int32_t top, uint32_t width, uint32_t height, GHOST_TWindowState state, const GHOST_IWindow *parentWindow, GHOST_TDrawingContextType type, const bool is_dialog, const bool stereoVisual, const bool exclusive, const bool is_debug, const GHOST_GPUDevice &preferred_device)
GHOST_TSuccess setWindowCustomCursorShape(uint8_t *bitmap, uint8_t *mask, int sizex, int sizey, int hotX, int hotY, bool canInvertColor) override
void getWindowBounds(GHOST_Rect &bounds) const override
GHOST_TSuccess getCursorBitmap(GHOST_CursorBitmapRef *bitmap) override
const std::vector< GWL_Output * > & outputs_get()
static ulong state[N]
unsigned short uint16_t
Definition stdint.h:79
unsigned int uint32_t
Definition stdint.h:80
signed int int32_t
Definition stdint.h:77
unsigned char uint8_t
Definition stdint.h:78