Fix compilation without SDL
This commit is contained in:
@@ -372,7 +372,7 @@ public:
|
|||||||
/// <summary>
|
/// <summary>
|
||||||
/// Returns the display server name on Linux.
|
/// Returns the display server name on Linux.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
API_PROPERTY() static String GetDisplayServer() = delete;
|
API_PROPERTY() static String GetDisplayServer();
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Returns true if is running 64 bit application (otherwise 32 bit). It's compile-time constant.
|
/// Returns true if is running 64 bit application (otherwise 32 bit). It's compile-time constant.
|
||||||
|
|||||||
@@ -12,11 +12,14 @@
|
|||||||
#include "Engine/Platform/Linux/LinuxPlatform.h"
|
#include "Engine/Platform/Linux/LinuxPlatform.h"
|
||||||
#include "Engine/Platform/Linux/IncludeX11.h"
|
#include "Engine/Platform/Linux/IncludeX11.h"
|
||||||
|
|
||||||
|
#if PLATFORM_SDL
|
||||||
#include <libportal/portal-enums.h>
|
#include <libportal/portal-enums.h>
|
||||||
#include <libportal/screenshot.h>
|
#include <libportal/screenshot.h>
|
||||||
|
#endif
|
||||||
|
|
||||||
Delegate<Color32> ScreenUtilitiesBase::PickColorDone;
|
Delegate<Color32> ScreenUtilitiesBase::PickColorDone;
|
||||||
|
|
||||||
|
#if PLATFORM_SDL
|
||||||
namespace PortalImpl
|
namespace PortalImpl
|
||||||
{
|
{
|
||||||
XdpPortal* Portal = nullptr;
|
XdpPortal* Portal = nullptr;
|
||||||
@@ -25,6 +28,7 @@ namespace PortalImpl
|
|||||||
gpointer GLibMainLoop(gpointer data);
|
gpointer GLibMainLoop(gpointer data);
|
||||||
void PickColorCallback(GObject* source, GAsyncResult* result, gpointer data);
|
void PickColorCallback(GObject* source, GAsyncResult* result, gpointer data);
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
Color32 LinuxScreenUtilities::GetColorAt(const Float2& pos)
|
Color32 LinuxScreenUtilities::GetColorAt(const Float2& pos)
|
||||||
{
|
{
|
||||||
@@ -93,7 +97,7 @@ void LinuxScreenUtilities::PickColor()
|
|||||||
LinuxPlatform::xEventReceived.Bind(OnScreenUtilsXEventCallback);
|
LinuxPlatform::xEventReceived.Bind(OnScreenUtilsXEventCallback);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
#if PLATFORM_SDL
|
||||||
if (PortalImpl::MainLoopReady == 0)
|
if (PortalImpl::MainLoopReady == 0)
|
||||||
{
|
{
|
||||||
// Initialize portal
|
// Initialize portal
|
||||||
@@ -117,8 +121,10 @@ void LinuxScreenUtilities::PickColor()
|
|||||||
// Enter color picking mode, the callback receives the final color
|
// Enter color picking mode, the callback receives the final color
|
||||||
xdp_portal_pick_color(PortalImpl::Portal, nullptr, nullptr, PortalImpl::PickColorCallback, nullptr);
|
xdp_portal_pick_color(PortalImpl::Portal, nullptr, nullptr, PortalImpl::PickColorCallback, nullptr);
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#if PLATFORM_SDL
|
||||||
gpointer PortalImpl::GLibMainLoop(gpointer data)
|
gpointer PortalImpl::GLibMainLoop(gpointer data)
|
||||||
{
|
{
|
||||||
GMainContext* mainContext = g_main_context_get_thread_default();
|
GMainContext* mainContext = g_main_context_get_thread_default();
|
||||||
@@ -154,5 +160,6 @@ void PortalImpl::PickColorCallback(GObject* source, GAsyncResult* result, gpoint
|
|||||||
|
|
||||||
ScreenUtilities::PickColorDone(color);
|
ScreenUtilities::PickColorDone(color);
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|||||||
@@ -89,6 +89,7 @@ public:
|
|||||||
void Focus() override;
|
void Focus() override;
|
||||||
void SetTitle(const StringView& title) override;
|
void SetTitle(const StringView& title) override;
|
||||||
DragDropEffect DoDragDrop(const StringView& data) override;
|
DragDropEffect DoDragDrop(const StringView& data) override;
|
||||||
|
using WindowBase::DoDragDrop;
|
||||||
void StartTrackingMouse(bool useMouseScreenOffset) override;
|
void StartTrackingMouse(bool useMouseScreenOffset) override;
|
||||||
void EndTrackingMouse() override;
|
void EndTrackingMouse() override;
|
||||||
void SetCursor(CursorType type) override;
|
void SetCursor(CursorType type) override;
|
||||||
|
|||||||
@@ -55,6 +55,7 @@ public:
|
|||||||
void Focus() override;
|
void Focus() override;
|
||||||
void SetTitle(const StringView& title) override;
|
void SetTitle(const StringView& title) override;
|
||||||
DragDropEffect DoDragDrop(const StringView& data) override;
|
DragDropEffect DoDragDrop(const StringView& data) override;
|
||||||
|
using WindowBase::DoDragDrop;
|
||||||
void StartTrackingMouse(bool useMouseScreenOffset) override;
|
void StartTrackingMouse(bool useMouseScreenOffset) override;
|
||||||
void EndTrackingMouse() override;
|
void EndTrackingMouse() override;
|
||||||
void SetCursor(CursorType type) override;
|
void SetCursor(CursorType type) override;
|
||||||
|
|||||||
@@ -183,6 +183,7 @@ public:
|
|||||||
void Focus() override;
|
void Focus() override;
|
||||||
void SetTitle(const StringView& title) override;
|
void SetTitle(const StringView& title) override;
|
||||||
DragDropEffect DoDragDrop(const StringView& data) override;
|
DragDropEffect DoDragDrop(const StringView& data) override;
|
||||||
|
using WindowBase::DoDragDrop;
|
||||||
void StartTrackingMouse(bool useMouseScreenOffset) override;
|
void StartTrackingMouse(bool useMouseScreenOffset) override;
|
||||||
void EndTrackingMouse() override;
|
void EndTrackingMouse() override;
|
||||||
void SetCursor(CursorType type) override;
|
void SetCursor(CursorType type) override;
|
||||||
|
|||||||
@@ -123,6 +123,7 @@ public:
|
|||||||
void Focus() override;
|
void Focus() override;
|
||||||
void SetTitle(const StringView& title) override;
|
void SetTitle(const StringView& title) override;
|
||||||
DragDropEffect DoDragDrop(const StringView& data) override;
|
DragDropEffect DoDragDrop(const StringView& data) override;
|
||||||
|
using WindowBase::DoDragDrop;
|
||||||
void StartTrackingMouse(bool useMouseScreenOffset) override;
|
void StartTrackingMouse(bool useMouseScreenOffset) override;
|
||||||
void EndTrackingMouse() override;
|
void EndTrackingMouse() override;
|
||||||
void StartClippingCursor(const Rectangle& bounds) override;
|
void StartClippingCursor(const Rectangle& bounds) override;
|
||||||
|
|||||||
Reference in New Issue
Block a user