Blender  V3.3
Classes | Variables
GHOST_WindowWayland.cpp File Reference
#include "GHOST_WindowWayland.h"
#include "GHOST_SystemWayland.h"
#include "GHOST_WaylandUtils.h"
#include "GHOST_WindowManager.h"
#include "GHOST_utildefines.h"
#include "GHOST_Event.h"
#include "GHOST_ContextEGL.h"
#include "GHOST_ContextNone.h"
#include <wayland-client-protocol.h>
#include <wayland-egl.h>
#include <algorithm>
#include "CLG_log.h"

Go to the source code of this file.

Classes

struct  window_t
 

Functions

Internal Utilities
static int output_scale_cmp (const output_t *output_a, const output_t *output_b)
 
static int outputs_max_scale_or_default (const std::vector< output_t * > &outputs, const int32_t scale_default, uint32_t *r_dpi)
 

Variables

static constexpr size_t base_dpi = 96
 
static GHOST_WindowManagerwindow_manager = nullptr
 

Listener (Surface), #wl_surface_listener

#define LOG   (&LOG_WL_XDG_TOPLEVEL)
 
#define LOG   (&LOG_WL_XDG_TOPLEVEL_DECORATION)
 
#define LOG   (&LOG_WL_XDG_SURFACE)
 
#define LOG   (&LOG_WL_SURFACE)
 
static CLG_LogRef LOG_WL_SURFACE = {"ghost.wl.handle.surface"}
 
static struct wl_surface_listener wl_surface_listener
 
static void surface_handle_enter (void *data, struct wl_surface *, struct wl_output *output)
 
static void surface_handle_leave (void *data, struct wl_surface *, struct wl_output *output)
 

Listener (XDG Top Level), #xdg_toplevel_listener

static CLG_LogRef LOG_WL_XDG_TOPLEVEL = {"ghost.wl.handle.xdg_toplevel"}
 
static const xdg_toplevel_listener toplevel_listener
 
static void xdg_toplevel_handle_configure (void *data, xdg_toplevel *, const int32_t width, const int32_t height, wl_array *states)
 
static void xdg_toplevel_handle_close (void *data, xdg_toplevel *)
 

Listener (XDG Decoration Listener), #zxdg_toplevel_decoration_v1_listener

static CLG_LogRef LOG_WL_XDG_TOPLEVEL_DECORATION = {"ghost.wl.handle.xdg_toplevel_decoration"}
 
static const zxdg_toplevel_decoration_v1_listener toplevel_decoration_v1_listener
 
static void xdg_toplevel_decoration_handle_configure (void *data, struct zxdg_toplevel_decoration_v1 *, const uint32_t mode)
 

Listener (XDG Surface Handle Configure), #xdg_surface_listener

static CLG_LogRef LOG_WL_XDG_SURFACE = {"ghost.wl.handle.xdg_surface"}
 
static const xdg_surface_listener xdg_surface_listener
 
static void xdg_surface_handle_configure (void *data, xdg_surface *xdg_surface, const uint32_t serial)
 

Macro Definition Documentation

◆ LOG [1/4]

Definition at line 368 of file GHOST_WindowWayland.cpp.

◆ LOG [2/4]

Definition at line 368 of file GHOST_WindowWayland.cpp.

◆ LOG [3/4]

#define LOG   (&LOG_WL_XDG_SURFACE)

Definition at line 368 of file GHOST_WindowWayland.cpp.

◆ LOG [4/4]

#define LOG   (&LOG_WL_SURFACE)

Definition at line 368 of file GHOST_WindowWayland.cpp.

Function Documentation

◆ output_scale_cmp()

static int output_scale_cmp ( const output_t output_a,
const output_t output_b 
)
static

Return -1 if output_a has a scale smaller than output_b, 0 when there equal, otherwise 1.

Definition at line 90 of file GHOST_WindowWayland.cpp.

References output_t::has_scale_fractional, output_t::scale, and output_t::scale_fractional.

Referenced by outputs_max_scale_or_default().

◆ outputs_max_scale_or_default()

static int outputs_max_scale_or_default ( const std::vector< output_t * > &  outputs,
const int32_t  scale_default,
uint32_t r_dpi 
)
static

◆ surface_handle_enter()

static void surface_handle_enter ( void data,
struct wl_surface *  ,
struct wl_output *  output 
)
static

◆ surface_handle_leave()

static void surface_handle_leave ( void data,
struct wl_surface *  ,
struct wl_output *  output 
)
static

◆ xdg_surface_handle_configure()

static void xdg_surface_handle_configure ( void data,
xdg_surface *  xdg_surface,
const uint32_t  serial 
)
static

◆ xdg_toplevel_decoration_handle_configure()

static void xdg_toplevel_decoration_handle_configure ( void data,
struct zxdg_toplevel_decoration_v1 *  ,
const uint32_t  mode 
)
static

Definition at line 293 of file GHOST_WindowWayland.cpp.

References CLOG_INFO, data, and LOG.

◆ xdg_toplevel_handle_close()

static void xdg_toplevel_handle_close ( void data,
xdg_toplevel *   
)
static

Definition at line 189 of file GHOST_WindowWayland.cpp.

References CLOG_INFO, data, LOG, and w().

◆ xdg_toplevel_handle_configure()

static void xdg_toplevel_handle_configure ( void data,
xdg_toplevel *  ,
const int32_t  width,
const int32_t  height,
wl_array *  states 
)
static

Variable Documentation

◆ base_dpi

constexpr size_t base_dpi = 96
staticconstexpr

Definition at line 37 of file GHOST_WindowWayland.cpp.

Referenced by outputs_max_scale_or_default().

◆ LOG_WL_SURFACE

CLG_LogRef LOG_WL_SURFACE = {"ghost.wl.handle.surface"}
static

Definition at line 367 of file GHOST_WindowWayland.cpp.

◆ LOG_WL_XDG_SURFACE

CLG_LogRef LOG_WL_XDG_SURFACE = {"ghost.wl.handle.xdg_surface"}
static

Definition at line 318 of file GHOST_WindowWayland.cpp.

◆ LOG_WL_XDG_TOPLEVEL

CLG_LogRef LOG_WL_XDG_TOPLEVEL = {"ghost.wl.handle.xdg_toplevel"}
static

Definition at line 151 of file GHOST_WindowWayland.cpp.

◆ LOG_WL_XDG_TOPLEVEL_DECORATION

CLG_LogRef LOG_WL_XDG_TOPLEVEL_DECORATION = {"ghost.wl.handle.xdg_toplevel_decoration"}
static

Definition at line 290 of file GHOST_WindowWayland.cpp.

◆ toplevel_decoration_v1_listener

const zxdg_toplevel_decoration_v1_listener toplevel_decoration_v1_listener
static
Initial value:
= {
}
static void xdg_toplevel_decoration_handle_configure(void *data, struct zxdg_toplevel_decoration_v1 *, const uint32_t mode)

Definition at line 302 of file GHOST_WindowWayland.cpp.

Referenced by GHOST_WindowWayland::GHOST_WindowWayland().

◆ toplevel_listener

const xdg_toplevel_listener toplevel_listener
static
Initial value:
= {
}
static void xdg_toplevel_handle_configure(void *data, xdg_toplevel *, const int32_t width, const int32_t height, wl_array *states)
static void xdg_toplevel_handle_close(void *data, xdg_toplevel *)

Definition at line 195 of file GHOST_WindowWayland.cpp.

Referenced by GHOST_WindowWayland::GHOST_WindowWayland().

◆ window_manager

GHOST_WindowManager* window_manager = nullptr
static

Definition at line 39 of file GHOST_WindowWayland.cpp.

Referenced by GHOST_WindowWayland::GHOST_WindowWayland().

◆ wl_surface_listener

struct wl_surface_listener wl_surface_listener
static
Initial value:
= {
}
static void surface_handle_leave(void *data, struct wl_surface *, struct wl_output *output)
static void surface_handle_enter(void *data, struct wl_surface *, struct wl_output *output)

Definition at line 387 of file GHOST_WindowWayland.cpp.

Referenced by GHOST_WindowWayland::GHOST_WindowWayland().

◆ xdg_surface_listener

const xdg_surface_listener xdg_surface_listener
static
Initial value:
= {
}
static void xdg_surface_handle_configure(void *data, xdg_surface *xdg_surface, const uint32_t serial)

Definition at line 353 of file GHOST_WindowWayland.cpp.

Referenced by GHOST_WindowWayland::GHOST_WindowWayland().