Blender V4.3
GHOST_WindowX11.hh
Go to the documentation of this file.
1/* SPDX-FileCopyrightText: 2001-2002 NaN Holding BV. All rights reserved.
2 *
3 * SPDX-License-Identifier: GPL-2.0-or-later */
4
10#pragma once
11
12#include "GHOST_Window.hh"
13#include <X11/Xlib.h>
14#include <X11/Xutil.h>
15/* For tablets. */
16#ifdef WITH_X11_XINPUT
17# include <X11/extensions/XInput.h>
18#endif
19
20#include "GHOST_TaskbarX11.hh"
21
22#include <map>
23
24class GHOST_SystemX11;
25
26#ifdef WITH_XDND
28#endif
29
36 public:
53 Display *display,
54 const char *title,
55 int32_t left,
56 int32_t top,
57 uint32_t width,
58 uint32_t height,
60 GHOST_WindowX11 *parentWindow,
62 const bool is_dialog,
63 const bool stereoVisual,
64 const bool exclusive,
65 const bool is_debug,
66 const GHOST_GPUDevice &preferred_device);
67
68 bool getValid() const override;
69
70 void setTitle(const char *title) override;
71
72 std::string getTitle() const override;
73
74 void getWindowBounds(GHOST_Rect &bounds) const override;
75
76 void getClientBounds(GHOST_Rect &bounds) const override;
77
78 bool isDialog() const override;
79
81
83
84 GHOST_TSuccess setClientSize(uint32_t width, uint32_t height) override;
85
86 void screenToClient(int32_t inX, int32_t inY, int32_t &outX, int32_t &outY) const override;
87
88 void clientToScreen(int32_t inX, int32_t inY, int32_t &outX, int32_t &outY) const override;
89
90 GHOST_TWindowState getState() const override;
91
93
95
96 GHOST_TSuccess invalidate() override;
97
98 GHOST_TSuccess setProgressBar(float progress) override;
100
105 ~GHOST_WindowX11() override;
106
117 void validate();
118
123
125 {
126 return m_tabletData;
127 }
128
129#if defined(WITH_X11_XINPUT) && defined(X_HAVE_UTF8_STRING)
130 XIC getX11_XIC()
131 {
132 return m_xic;
133 }
134
135 bool createX11_XIC();
136#endif
137
138#ifdef WITH_X11_XINPUT
139 void refreshXInputDevices();
140#endif
141
142#ifdef WITH_XDND
143 GHOST_DropTargetX11 *getDropTarget()
144 {
145 return m_dropTarget;
146 }
147#endif
148
149 /*
150 * Need this in case that we want start the window
151 * in FullScree or Maximized state.
152 * Check GHOST_WindowX11.cc
153 */
156
157 GHOST_TSuccess beginFullScreen() const override;
158
159 GHOST_TSuccess endFullScreen() const override;
160
162
163 uint16_t getDPIHint() override;
164
165 protected:
171
176 GHOST_TSuccess setWindowCursorVisibility(bool visible) override;
177
183
185
192
198 uint8_t *mask,
199 int sizex,
200 int sizey,
201 int hotX,
202 int hotY,
203 bool canInvertColor) override;
204
205 private:
206 /* Force use of public constructor. */
207
209
211
212 GHOST_TSuccess getStandardCursor(GHOST_TStandardCursor g_cursor, Cursor &xcursor);
213
214 Cursor getEmptyCursor();
215
216 Window m_window;
217 Display *m_display;
218 XVisualInfo *m_visualInfo;
219 void *m_fbconfig;
220
221 GHOST_TWindowState m_normal_state;
222
224 GHOST_SystemX11 *m_system;
225
227 bool m_invalid_window;
228
230 Cursor m_empty_cursor;
231
233 Cursor m_custom_cursor;
234
236 Cursor m_visible_cursor;
237
239 std::map<uint, Cursor> m_standard_cursors;
240
241 GHOST_TaskBarX11 m_taskbar;
242
243#ifdef WITH_XDND
244 GHOST_DropTargetX11 *m_dropTarget;
245#endif
246
247 GHOST_TabletData m_tabletData;
248
249#if defined(WITH_X11_XINPUT) && defined(X_HAVE_UTF8_STRING)
250 XIC m_xic;
251#endif
252
253 bool m_valid_setup;
254 bool m_is_debug_context;
255 GHOST_GPUDevice m_preferred_device;
256
257 void icccmSetState(int state);
258 int icccmGetState() const;
259
260 void netwmMaximized(bool set);
261 bool netwmIsMaximized() const;
262
263 void netwmFullScreen(bool set);
264 bool netwmIsFullScreen() const;
265
266 void motifFullScreen(bool set);
267 bool motifIsFullScreen() const;
268};
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
GHOST_TSuccess setDialogHints(GHOST_WindowX11 *parentWindow)
GHOST_Context * newDrawingContext(GHOST_TDrawingContextType type) override
GHOST_TSuccess beginFullScreen() const override
bool getValid() const 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
void getWindowBounds(GHOST_Rect &bounds) const override
GHOST_TabletData & GetTabletData()
~GHOST_WindowX11() override
GHOST_TWindowState m_post_state
GHOST_TSuccess setState(GHOST_TWindowState state) override
GHOST_TSuccess endProgressBar() override
void getClientBounds(GHOST_Rect &bounds) const override
void setTitle(const char *title) override
std::string getTitle() const override
GHOST_TSuccess setClientWidth(uint32_t width) override
GHOST_TSuccess setWindowCursorShape(GHOST_TStandardCursor shape) override
GHOST_TSuccess setProgressBar(float progress) override
GHOST_TSuccess hasCursorShape(GHOST_TStandardCursor shape) override
GHOST_TSuccess setWindowCustomCursorShape(uint8_t *bitmap, uint8_t *mask, int sizex, int sizey, int hotX, int hotY, bool canInvertColor) override
GHOST_TSuccess setClientSize(uint32_t width, uint32_t height) override
GHOST_TSuccess setOrder(GHOST_TWindowOrder order) override
GHOST_TSuccess setWindowCursorVisibility(bool visible) override
void screenToClient(int32_t inX, int32_t inY, int32_t &outX, int32_t &outY) const override
bool isDialog() const override
uint16_t getDPIHint() override
GHOST_TSuccess setWindowCursorGrab(GHOST_TGrabCursorMode mode) override
GHOST_TSuccess invalidate() override
GHOST_TGrabCursorMode getWindowCursorGrab() const
GHOST_TWindowState getState() const override
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