From 085df92011d2d4d4225bb44956b1762439d51adf Mon Sep 17 00:00:00 2001 From: JCash Date: Tue, 20 Oct 2020 15:14:21 +0200 Subject: [PATCH] Added support for headless mode --- defos/src/defos.cpp | 2 +- defos/src/defos_html5.cpp | 7 ++----- defos/src/defos_linux.cpp | 6 +++--- defos/src/defos_mac.mm | 7 ++----- defos/src/defos_win.cpp | 5 +++-- 5 files changed, 11 insertions(+), 16 deletions(-) diff --git a/defos/src/defos.cpp b/defos/src/defos.cpp index a735fe7..5937d73 100644 --- a/defos/src/defos.cpp +++ b/defos/src/defos.cpp @@ -7,7 +7,7 @@ #endif #include -#if defined(DM_PLATFORM_OSX) || defined(DM_PLATFORM_WINDOWS) || defined(DM_PLATFORM_HTML5) || defined(DM_PLATFORM_LINUX) +#if !defined(DM_HEADLESS) && (defined(DM_PLATFORM_OSX) || defined(DM_PLATFORM_WINDOWS) || defined(DM_PLATFORM_HTML5) || defined(DM_PLATFORM_LINUX)) #include "defos_private.h" #include diff --git a/defos/src/defos_html5.cpp b/defos/src/defos_html5.cpp index 283b68b..26ec85f 100644 --- a/defos/src/defos_html5.cpp +++ b/defos/src/defos_html5.cpp @@ -1,11 +1,8 @@ -#ifndef DLIB_LOG_DOMAIN -#define DLIB_LOG_DOMAIN "defos" -#endif -#include -#if defined(DM_PLATFORM_HTML5) +#if defined(DM_PLATFORM_HTML5) && !defined(DM_HEADLESS) #include "defos_private.h" +#include #include #include diff --git a/defos/src/defos_linux.cpp b/defos/src/defos_linux.cpp index 1b884dd..876bdb3 100644 --- a/defos/src/defos_linux.cpp +++ b/defos/src/defos_linux.cpp @@ -1,6 +1,4 @@ -#include - -#if defined(DM_PLATFORM_LINUX) +#if defined(DM_PLATFORM_LINUX) && !defined(DM_HEADLESS) /* some resources to manage window for x11. @@ -17,6 +15,8 @@ setting the window icon */ +#include + #include "defos_private.h" #include #include diff --git a/defos/src/defos_mac.mm b/defos/src/defos_mac.mm index 4b46ca3..db0056a 100644 --- a/defos/src/defos_mac.mm +++ b/defos/src/defos_mac.mm @@ -1,11 +1,8 @@ -#ifndef DLIB_LOG_DOMAIN -#define DLIB_LOG_DOMAIN "defos" -#endif -#include -#if defined(DM_PLATFORM_OSX) +#if defined(DM_PLATFORM_OSX) && !defined(DM_HEADLESS) #include "defos_private.h" +#include #include #include #include diff --git a/defos/src/defos_win.cpp b/defos/src/defos_win.cpp index 137257d..7ac6495 100644 --- a/defos/src/defos_win.cpp +++ b/defos/src/defos_win.cpp @@ -1,8 +1,9 @@ + +#if defined(DM_PLATFORM_WINDOWS) && !defined(DM_HEADLESS) + #include #include "defos_private.h" -#if defined(DM_PLATFORM_WINDOWS) - #include #include #include