30 #include <wayland-egl.h>
67 for (
enum xdg_toplevel_state *
state =
static_cast<xdg_toplevel_state *
>(states->data);
71 case XDG_TOPLEVEL_STATE_MAXIMIZED:
74 case XDG_TOPLEVEL_STATE_FULLSCREEN:
77 case XDG_TOPLEVEL_STATE_ACTIVATED:
101 wl_egl_window_get_attached_size(win->
egl_window, &
w, &h);
119 xdg_surface_ack_configure(xdg_surface, serial);
148 const bool is_dialog,
149 const bool stereoVisual,
150 const bool exclusive)
160 w->is_dialog = is_dialog;
163 w->surface = wl_compositor_create_surface(m_system->
compositor());
164 w->egl_window = wl_egl_window_create(
w->surface,
int(
width),
int(
height));
166 w->xdg_surface = xdg_wm_base_get_xdg_surface(m_system->
shell(),
w->surface);
167 w->xdg_toplevel = xdg_surface_get_toplevel(
w->xdg_surface);
169 wl_surface_set_user_data(
w->surface,
this);
175 xdg_toplevel_set_parent(
180 wl_surface_commit(
w->surface);
181 wl_display_roundtrip(m_system->
display());
183 #ifdef GHOST_OPENGL_ALPHA
193 GHOST_PRINT(
"Failed to create EGL context" << std::endl);
221 #ifdef GHOST_OPENGL_ALPHA
254 xdg_toplevel_set_title(
w->xdg_toplevel, title);
255 xdg_toplevel_set_app_id(
w->xdg_toplevel, title);
261 return this->title.empty() ?
"untitled" : this->title;
271 bounds.set(0, 0,
w->width,
w->height);
286 wl_egl_window_resize(
w->egl_window,
int(
width),
int(
height), 0, 0);
312 wl_egl_window_destroy(
w->egl_window);
313 xdg_toplevel_destroy(
w->xdg_toplevel);
314 xdg_surface_destroy(
w->xdg_surface);
315 wl_surface_destroy(
w->surface);
332 xdg_toplevel_unset_maximized(
w->xdg_toplevel);
335 xdg_toplevel_unset_fullscreen(
w->xdg_toplevel);
342 xdg_toplevel_set_maximized(
w->xdg_toplevel);
345 xdg_toplevel_set_minimized(
w->xdg_toplevel);
348 xdg_toplevel_set_fullscreen(
w->xdg_toplevel,
nullptr);
358 if (
w->is_fullscreen) {
361 else if (
w->is_maximised) {
381 xdg_toplevel_set_fullscreen(
w->xdg_toplevel,
nullptr);
387 xdg_toplevel_unset_fullscreen(
w->xdg_toplevel);
396 #ifdef GHOST_OPENGL_ALPHA
397 void GHOST_WindowWayland::setOpaque()
const
399 struct wl_region *region;
402 region = wl_compositor_create_region(m_system->
compositor());
403 wl_region_add(region, 0, 0,
w->width,
w->height);
404 wl_surface_set_opaque_region(
w->surface, region);
405 wl_region_destroy(region);
422 EGLNativeWindowType(
w->egl_window),
423 EGLNativeDisplayType(m_system->
display()),
424 EGL_CONTEXT_OPENGL_CORE_PROFILE_BIT,
KDTree *BLI_kdtree_nd_() new(unsigned int maxsize)
#define GHOST_OPENGL_EGL_CONTEXT_FLAGS
#define GHOST_OPENGL_EGL_RESET_NOTIFICATION_STRATEGY
@ GHOST_kWindowStateMinimized
@ GHOST_kWindowStateMaximized
@ GHOST_kWindowStateEmbedded
@ GHOST_kWindowStateNormal
@ GHOST_kWindowStateFullScreen
@ GHOST_kStandardCursorDefault
unsigned int GHOST_TUns32
@ GHOST_kEventWindowClose
@ GHOST_kEventWindowActivate
@ GHOST_kEventWindowDeactivate
GHOST_TDrawingContextType
@ GHOST_kDrawingContextTypeOpenGL
@ GHOST_kDrawingContextTypeNone
unsigned char GHOST_TUns8
static void surface_configure(void *data, xdg_surface *xdg_surface, uint32_t serial)
static const xdg_surface_listener surface_listener
static void toplevel_close(void *data, xdg_toplevel *)
static const xdg_toplevel_listener toplevel_listener
static void toplevel_configure(void *data, xdg_toplevel *, int32_t width, int32_t height, wl_array *states)
_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 type
_GL_VOID GLfloat value _GL_VOID_RET _GL_VOID const GLuint GLboolean *residences _GL_BOOL_RET _GL_VOID GLsizei height
static btDbvtVolume bounds(btDbvtNode **leaves, int count)
SIMD_FORCE_INLINE const btScalar & w() const
Return the w value.
GHOST_TSuccess setCursorGrab(const GHOST_TGrabCursorMode mode, wl_surface *surface)
wl_compositor * compositor()
GHOST_TSuccess setCursorVisibility(bool visible)
GHOST_TSuccess setCursorShape(GHOST_TStandardCursor shape)
GHOST_TSuccess setCustomCursorShape(GHOST_TUns8 *bitmap, GHOST_TUns8 *mask, int sizex, int sizey, int hotX, int hotY, bool canInvertColor)
GHOST_TSuccess hasCursorShape(GHOST_TStandardCursor cursorShape)
GHOST_WindowManager * getWindowManager() const
GHOST_TSuccess pushEvent(GHOST_IEvent *event)
virtual GHOST_TUns64 getMilliSeconds() const
GHOST_TSuccess setActiveWindow(GHOST_IWindow *window)
void setWindowInactive(const GHOST_IWindow *window)
GHOST_TSuccess hasCursorShape(GHOST_TStandardCursor cursorShape) override
GHOST_WindowWayland(GHOST_SystemWayland *system, const char *title, GHOST_TInt32 left, GHOST_TInt32 top, GHOST_TUns32 width, GHOST_TUns32 height, GHOST_TWindowState state, const GHOST_IWindow *parentWindow, GHOST_TDrawingContextType type, const bool is_dialog, const bool stereoVisual, const bool exclusive)
void clientToScreen(GHOST_TInt32 inX, GHOST_TInt32 inY, GHOST_TInt32 &outX, GHOST_TInt32 &outY) const override
GHOST_TSuccess setOrder(GHOST_TWindowOrder order) override
GHOST_TSuccess setClientSize(GHOST_TUns32 width, GHOST_TUns32 height) override
GHOST_TSuccess setWindowCursorGrab(GHOST_TGrabCursorMode mode) override
GHOST_TSuccess setClientHeight(GHOST_TUns32 height) override
GHOST_TSuccess notify_size()
GHOST_TSuccess setState(GHOST_TWindowState state) override
GHOST_TSuccess setWindowCursorVisibility(bool visible) override
GHOST_TSuccess setClientWidth(GHOST_TUns32 width) override
GHOST_TWindowState getState() const override
GHOST_TSuccess beginFullScreen() const override
bool isDialog() const override
std::string getTitle() const override
GHOST_TSuccess deactivate()
void getClientBounds(GHOST_Rect &bounds) const override
GHOST_TSuccess setWindowCustomCursorShape(GHOST_TUns8 *bitmap, GHOST_TUns8 *mask, int sizex, int sizey, int hotX, int hotY, bool canInvertColor) override
GHOST_TSuccess activate()
GHOST_TSuccess endFullScreen() const override
void screenToClient(GHOST_TInt32 inX, GHOST_TInt32 inY, GHOST_TInt32 &outX, GHOST_TInt32 &outY) const override
~GHOST_WindowWayland() override
GHOST_TSuccess invalidate() override
GHOST_TSuccess setWindowCursorShape(GHOST_TStandardCursor shape) override
void setTitle(const char *title) override
void getWindowBounds(GHOST_Rect &bounds) const override
GHOST_TSuccess setDrawingContextType(GHOST_TDrawingContextType type)
GHOST_TStandardCursor m_cursorShape
GHOST_TSuccess releaseNativeHandles()
struct SELECTID_Context context
wl_egl_window * egl_window
struct xdg_toplevel * xdg_toplevel
struct xdg_surface * xdg_surface
ccl_device_inline float4 mask(const int4 &mask, const float4 &a)