Update backend to support headless

This commit is contained in:
Gregory Casamento 2023-08-03 01:36:00 -04:00
parent 49cefc8df9
commit 78a80fe920
2 changed files with 20 additions and 3 deletions

View file

@ -35,7 +35,7 @@
+ (void) initializeBackend;
@end
#if BUILD_SERVER == SERVER_x11
#if (BUILD_SERVER == SERVER_x11) || (BUILD_SERVER == SERVER_xheadless)
#include <x11/XGServer.h>
@interface XGServer (Initialize)
+ (void) initializeBackend;
@ -70,6 +70,8 @@
[WIN32Server initializeBackend];
#elif BUILD_SERVER == SERVER_wayland
[WaylandServer initializeBackend];
#elif BUILD_SERVER == SERVER_xheadless
[XGServer initializeBackend];
#else
[NSException raise: NSInternalInconsistencyException
format: @"No Window Server configured in backend"];
@ -93,9 +95,11 @@
#elif (BUILD_GRAPHICS==GRAPHICS_winlib)
context = @"WIN32Context";
#elif (BUILD_GRAPHICS==GRAPHICS_cairo)
context = @"CairoContext";
#elif (BUILD_GRAPHICS==GRAPHICS_opal)
context = @"CairoContext";
#elif (BUILD_GRAPHICS==GRAPHICS_opal)
context = @"OpalContext";
#elif (BUILD_GRAPHICS==GRAPHICS_headlesslib)
context = @"HeadlessContext";
#else
#error INVALID build graphics type
#endif

View file

@ -57,6 +57,19 @@
# endif /* USE_GLITZ */
# include "x11/XGServerWindow.h"
# include "x11/XWindowBuffer.h"
#elif BUILD_SERVER == SERVER_xheadless
# include "cairo/CairoGState.h"
# include "x11/XGServer.h"
# define _CAIRO_GSTATE_CLASSNAME CairoGState
# ifdef USE_GLITZ
# define _CAIRO_SURFACE_CLASSNAME XGCairoGlitzSurface
# include "cairo/XGCairoGlitzSurface.h"
# else
# define _CAIRO_SURFACE_CLASSNAME XGCairoModernSurface
# include "cairo/XGCairoModernSurface.h"
# endif /* USE_GLITZ */
# include "x11/XGServerWindow.h"
# include "x11/XWindowBuffer.h"
#elif BUILD_SERVER == SERVER_win32
# include "cairo/Win32CairoGState.h"
# include <windows.h>