Blender  V3.3
GHOST_WindowX11.h
Go to the documentation of this file.
1 /* SPDX-License-Identifier: GPL-2.0-or-later
2  * Copyright 2001-2002 NaN Holding BV. All rights reserved. */
3 
9 #pragma once
10 
11 #include "GHOST_Window.h"
12 #include <X11/Xlib.h>
13 #include <X11/Xutil.h>
14 // For tablets
15 #ifdef WITH_X11_XINPUT
16 # include <X11/extensions/XInput.h>
17 #endif
18 
19 #include "GHOST_TaskbarX11.h"
20 
21 #include <map>
22 
23 class GHOST_SystemX11;
24 
25 #ifdef WITH_XDND
27 #endif
28 
35 class GHOST_WindowX11 : public GHOST_Window {
36  public:
53  Display *display,
54  const char *title,
55  int32_t left,
56  int32_t top,
60  GHOST_WindowX11 *parentWindow,
62  const bool is_dialog = false,
63  const bool stereoVisual = false,
64  const bool exclusive = false,
65  const bool alphaBackground = false,
66  const bool is_debug = false);
67 
68  bool getValid() const;
69 
70  void setTitle(const char *title);
71 
72  std::string getTitle() const;
73 
74  void getWindowBounds(GHOST_Rect &bounds) const;
75 
76  void getClientBounds(GHOST_Rect &bounds) const;
77 
78  bool isDialog() const;
79 
81 
83 
85 
86  void screenToClient(int32_t inX, int32_t inY, int32_t &outX, int32_t &outY) const;
87 
88  void clientToScreen(int32_t inX, int32_t inY, int32_t &outX, int32_t &outY) const;
89 
91 
93 
95 
97 
98  GHOST_TSuccess setProgressBar(float progress);
100 
106 
117  void validate();
118 
122  Window getXWindow();
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.cpp
153  */
156 
158 
160 
162 
164 
165  protected:
171 
177 
183 
185 
192 
198  uint8_t *mask,
199  int sizex,
200  int sizey,
201  int hotX,
202  int hotY,
203  bool canInvertColor);
204 
205  private:
206  /* Force use of public constructor. */
207 
208  GHOST_WindowX11();
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<unsigned int, 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 
256  void icccmSetState(int state);
257  int icccmGetState() const;
258 
259  void netwmMaximized(bool set);
260  bool netwmIsMaximized() const;
261 
262  void netwmFullScreen(bool set);
263  bool netwmIsFullScreen() const;
264 
265  void motifFullScreen(bool set);
266  bool motifIsFullScreen() const;
267 };
GHOST_TWindowState
Definition: GHOST_Types.h:129
GHOST_TStandardCursor
Definition: GHOST_Types.h:214
GHOST_TDrawingContextType
Definition: GHOST_Types.h:148
@ GHOST_kDrawingContextTypeNone
Definition: GHOST_Types.h:149
GHOST_TWindowOrder
Definition: GHOST_Types.h:146
GHOST_TSuccess
Definition: GHOST_Types.h:74
GHOST_TGrabCursorMode
Definition: GHOST_Types.h:404
_GL_VOID GLfloat value _GL_VOID_RET _GL_VOID const GLuint GLboolean *residences _GL_BOOL_RET _GL_VOID GLsizei height
_GL_VOID GLfloat value _GL_VOID_RET _GL_VOID const GLuint GLboolean *residences _GL_BOOL_RET _GL_VOID GLsizei GLfloat GLfloat GLfloat GLfloat const GLubyte *bitmap _GL_VOID_RET _GL_VOID GLenum type
_GL_VOID GLfloat value _GL_VOID_RET _GL_VOID const GLuint GLboolean *residences _GL_BOOL_RET _GL_VOID GLsizei GLfloat GLfloat GLfloat GLfloat const GLubyte *bitmap _GL_VOID_RET _GL_VOID GLenum const void *lists _GL_VOID_RET _GL_VOID const GLdouble *equation _GL_VOID_RET _GL_VOID GLdouble GLdouble blue _GL_VOID_RET _GL_VOID GLfloat GLfloat blue _GL_VOID_RET _GL_VOID GLint GLint blue _GL_VOID_RET _GL_VOID GLshort GLshort blue _GL_VOID_RET _GL_VOID GLubyte GLubyte blue _GL_VOID_RET _GL_VOID GLuint GLuint blue _GL_VOID_RET _GL_VOID GLushort GLushort blue _GL_VOID_RET _GL_VOID GLbyte GLbyte GLbyte alpha _GL_VOID_RET _GL_VOID GLdouble GLdouble GLdouble alpha _GL_VOID_RET _GL_VOID GLfloat GLfloat GLfloat alpha _GL_VOID_RET _GL_VOID GLint GLint GLint alpha _GL_VOID_RET _GL_VOID GLshort GLshort GLshort alpha _GL_VOID_RET _GL_VOID GLubyte GLubyte GLubyte alpha _GL_VOID_RET _GL_VOID GLuint GLuint GLuint alpha _GL_VOID_RET _GL_VOID GLushort GLushort GLushort alpha _GL_VOID_RET _GL_VOID GLenum mode _GL_VOID_RET _GL_VOID GLint GLsizei width
_GL_VOID GLfloat value _GL_VOID_RET _GL_VOID const GLuint GLboolean *residences _GL_BOOL_RET _GL_VOID GLsizei GLfloat GLfloat GLfloat GLfloat const GLubyte *bitmap _GL_VOID_RET _GL_VOID GLenum const void *lists _GL_VOID_RET _GL_VOID const GLdouble *equation _GL_VOID_RET _GL_VOID GLdouble GLdouble blue _GL_VOID_RET _GL_VOID GLfloat GLfloat blue _GL_VOID_RET _GL_VOID GLint GLint blue _GL_VOID_RET _GL_VOID GLshort GLshort blue _GL_VOID_RET _GL_VOID GLubyte GLubyte blue _GL_VOID_RET _GL_VOID GLuint GLuint blue _GL_VOID_RET _GL_VOID GLushort GLushort blue _GL_VOID_RET _GL_VOID GLbyte GLbyte GLbyte alpha _GL_VOID_RET _GL_VOID GLdouble GLdouble GLdouble alpha _GL_VOID_RET _GL_VOID GLfloat GLfloat GLfloat alpha _GL_VOID_RET _GL_VOID GLint GLint GLint alpha _GL_VOID_RET _GL_VOID GLshort GLshort GLshort alpha _GL_VOID_RET _GL_VOID GLubyte GLubyte GLubyte alpha _GL_VOID_RET _GL_VOID GLuint GLuint GLuint alpha _GL_VOID_RET _GL_VOID GLushort GLushort GLushort alpha _GL_VOID_RET _GL_VOID GLenum mode _GL_VOID_RET _GL_VOID GLint GLsizei GLsizei GLenum type _GL_VOID_RET _GL_VOID GLsizei GLenum GLenum const void *pixels _GL_VOID_RET _GL_VOID const void *pointer _GL_VOID_RET _GL_VOID GLdouble v _GL_VOID_RET _GL_VOID GLfloat v _GL_VOID_RET _GL_VOID GLint GLint i2 _GL_VOID_RET _GL_VOID GLint j _GL_VOID_RET _GL_VOID GLfloat param _GL_VOID_RET _GL_VOID GLint param _GL_VOID_RET _GL_VOID GLdouble GLdouble GLdouble top
_GL_VOID GLfloat value _GL_VOID_RET _GL_VOID const GLuint GLboolean *residences _GL_BOOL_RET _GL_VOID GLsizei GLfloat GLfloat GLfloat GLfloat const GLubyte *bitmap _GL_VOID_RET _GL_VOID GLenum const void *lists _GL_VOID_RET _GL_VOID const GLdouble *equation _GL_VOID_RET _GL_VOID GLdouble GLdouble blue _GL_VOID_RET _GL_VOID GLfloat GLfloat blue _GL_VOID_RET _GL_VOID GLint GLint blue _GL_VOID_RET _GL_VOID GLshort GLshort blue _GL_VOID_RET _GL_VOID GLubyte GLubyte blue _GL_VOID_RET _GL_VOID GLuint GLuint blue _GL_VOID_RET _GL_VOID GLushort GLushort blue _GL_VOID_RET _GL_VOID GLbyte GLbyte GLbyte alpha _GL_VOID_RET _GL_VOID GLdouble GLdouble GLdouble alpha _GL_VOID_RET _GL_VOID GLfloat GLfloat GLfloat alpha _GL_VOID_RET _GL_VOID GLint GLint GLint alpha _GL_VOID_RET _GL_VOID GLshort GLshort GLshort alpha _GL_VOID_RET _GL_VOID GLubyte GLubyte GLubyte alpha _GL_VOID_RET _GL_VOID GLuint GLuint GLuint alpha _GL_VOID_RET _GL_VOID GLushort GLushort GLushort alpha _GL_VOID_RET _GL_VOID GLenum mode _GL_VOID_RET _GL_VOID GLint GLsizei GLsizei GLenum type _GL_VOID_RET _GL_VOID GLsizei GLenum GLenum const void *pixels _GL_VOID_RET _GL_VOID const void *pointer _GL_VOID_RET _GL_VOID GLdouble v _GL_VOID_RET _GL_VOID GLfloat v _GL_VOID_RET _GL_VOID GLint GLint i2 _GL_VOID_RET _GL_VOID GLint j _GL_VOID_RET _GL_VOID GLfloat param _GL_VOID_RET _GL_VOID GLint param _GL_VOID_RET _GL_VOID GLdouble GLdouble GLdouble GLdouble GLdouble zFar _GL_VOID_RET _GL_UINT GLdouble *equation _GL_VOID_RET _GL_VOID GLenum GLint *params _GL_VOID_RET _GL_VOID GLenum GLfloat *v _GL_VOID_RET _GL_VOID GLenum GLfloat *params _GL_VOID_RET _GL_VOID GLfloat *values _GL_VOID_RET _GL_VOID GLushort *values _GL_VOID_RET _GL_VOID GLenum GLfloat *params _GL_VOID_RET _GL_VOID GLenum GLdouble *params _GL_VOID_RET _GL_VOID GLenum GLint *params _GL_VOID_RET _GL_VOID GLsizei const void *pointer _GL_VOID_RET _GL_VOID GLsizei const void *pointer _GL_VOID_RET _GL_BOOL GLfloat param _GL_VOID_RET _GL_VOID GLint param _GL_VOID_RET _GL_VOID GLenum GLfloat param _GL_VOID_RET _GL_VOID GLenum GLint param _GL_VOID_RET _GL_VOID GLushort pattern _GL_VOID_RET _GL_VOID GLdouble GLdouble GLint GLint order
static btDbvtVolume bounds(btDbvtNode **leaves, int count)
Definition: btDbvt.cpp:299
GHOST_TSuccess setDialogHints(GHOST_WindowX11 *parentWindow)
void setTitle(const char *title)
GHOST_TWindowState m_post_state
GHOST_TSuccess setOrder(GHOST_TWindowOrder order)
void screenToClient(int32_t inX, int32_t inY, int32_t &outX, int32_t &outY) const
GHOST_TSuccess endProgressBar()
GHOST_TSuccess hasCursorShape(GHOST_TStandardCursor shape)
GHOST_TSuccess endFullScreen() const
bool isDialog() const
void getClientBounds(GHOST_Rect &bounds) const
GHOST_TSuccess setClientSize(uint32_t width, uint32_t height)
GHOST_Context * newDrawingContext(GHOST_TDrawingContextType type)
GHOST_TSuccess setWindowCustomCursorShape(uint8_t *bitmap, uint8_t *mask, int sizex, int sizey, int hotX, int hotY, bool canInvertColor)
GHOST_TSuccess setWindowCursorGrab(GHOST_TGrabCursorMode mode)
std::string getTitle() const
bool getValid() const
GHOST_TSuccess setState(GHOST_TWindowState state)
GHOST_TabletData & GetTabletData()
GHOST_TSuccess setWindowCursorVisibility(bool visible)
GHOST_TWindowState getState() const
GHOST_TSuccess setWindowCursorShape(GHOST_TStandardCursor shape)
GHOST_TSuccess invalidate()
void getWindowBounds(GHOST_Rect &bounds) const
GHOST_TSuccess setClientWidth(uint32_t width)
GHOST_TSuccess beginFullScreen() const
GHOST_TGrabCursorMode getWindowCursorGrab() const
GHOST_TSuccess setClientHeight(uint32_t height)
void clientToScreen(int32_t inX, int32_t inY, int32_t &outX, int32_t &outY) const
GHOST_TSuccess setProgressBar(float progress)
const int state
ccl_device_inline float4 mask(const int4 &mask, const float4 &a)
Definition: math_float4.h:513
static int left
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