WSI and Window Surfaces

This section describes the Thallium WSI system, including the window surface structure.


Types

Objects

typedef struct TL_WindowSurface_t TL_WindowSurface_t

A portable Thallium structure to wrap around a platform-dependent, API-specific representation of a window.

This structure wraps around a platform-dependent, API-specific representation of a window.


Functions

For Cocoa (macOS) systems

Important

Definitions for these functions is compiled only if the -DTHALLIUM_WSI_COCOA=ON CMake flag was present at build. This is the default behaviour on Apple systems.

TL_WindowSurface_t *TL_WindowSurfaceCreateCocoa(void *const window, const TL_Debugger_t *const debugger)

Create a Thallium window surface from a Cocoa window handle.

This function creates a window surface for Thallium functions, using a Cocoa NSWindow window handle.

Parameters:
  • window – The Cocoa NSWindow handle (as a void ptr)

  • debugger – NULL or a debugger for function debugging

Returns:

Resulting window surface for use in Thallium functions.

For Xorg systems (via xcb)

Important

Definitions for these functions is compiled only if the -DTHALLIUM_WSI_XCB=ON CMake flag was present at build. This is the default behaviour on Unix (not Apple) systems.

TL_WindowSurface_t *TL_WindowSurfaceCreateXCB(void *const connection, const uint32_t window, const TL_Debugger_t *const debugger)

Create a Thallium window surface from an XCB window and connection.

This function creates a window surface for Thallium functions, using an XCB window handle.

Parameters:
  • connection – XCB xcb_connection_t * handle (as a void ptr)

  • window – XCB xcb_window_t handle (as an unsigned int)

  • debugger – NULL or a debugger for function debugging

Returns:

Resulting window surface for use in Thallium functions.

For Xorg systems (via Xlib)

Important

Definitions for these functions is compiled only if the -DTHALLIUM_WSI_XLIB=ON CMake flag was present at build. This is the default behaviour on Unix (not Apple) systems.

TL_WindowSurface_t *TL_WindowSurfaceCreateXlib(void *const display, const uint64_t window, const TL_Debugger_t *const debugger)

Create a Thallium window surface from an Xlib (X11) display and window handle.

This function creates a window surface for Thallium functions, using an X11/Xlib window handle.

Parameters:
  • display – Xlib Display * connection to the X server (as a void ptr)

  • window – Xlib Window handle (as an unsigned long)

  • debugger – NULL or a debugger for function debugging

Returns:

Resulting window surface for use in Thallium functions.