mirror of
https://github.com/beefytech/Beef.git
synced 2025-06-08 11:38:21 +02:00
commit
4353d2a10d
5 changed files with 39 additions and 0 deletions
|
@ -103,6 +103,7 @@ namespace Beefy.gfx
|
||||||
scope AutoBeefPerf("Image.LoadFromFile");
|
scope AutoBeefPerf("Image.LoadFromFile");
|
||||||
|
|
||||||
var useFileName = scope String()..Append(fileName);
|
var useFileName = scope String()..Append(fileName);
|
||||||
|
useFileName.Replace('\\', '/');
|
||||||
FilePackManager.TryMakeMemoryString(useFileName);
|
FilePackManager.TryMakeMemoryString(useFileName);
|
||||||
void* aNativeTextureSegment = Gfx_LoadTexture(useFileName, (int32)flags);
|
void* aNativeTextureSegment = Gfx_LoadTexture(useFileName, (int32)flags);
|
||||||
if (aNativeTextureSegment == null)
|
if (aNativeTextureSegment == null)
|
||||||
|
|
|
@ -623,6 +623,9 @@ abstract class CommonDialog
|
||||||
|
|
||||||
public Result<DialogResult> ShowDialog(INativeWindow owner = null)
|
public Result<DialogResult> ShowDialog(INativeWindow owner = null)
|
||||||
{
|
{
|
||||||
|
if (!Linux.IsSystemdAvailable)
|
||||||
|
return .Err;
|
||||||
|
|
||||||
TryC!(Linux.SdBusOpenUser(&mBus)); // Maybe keep the bus open while the program is running ?
|
TryC!(Linux.SdBusOpenUser(&mBus)); // Maybe keep the bus open while the program is running ?
|
||||||
|
|
||||||
Linux.DBusMsg* call = ?;
|
Linux.DBusMsg* call = ?;
|
||||||
|
|
|
@ -44,6 +44,33 @@ class Linux
|
||||||
|
|
||||||
public typealias DBusMsgHandler = function int32(DBusMsg *m, void *userdata, DBusErr *ret_error);
|
public typealias DBusMsgHandler = function int32(DBusMsg *m, void *userdata, DBusErr *ret_error);
|
||||||
|
|
||||||
|
public static bool IsSystemdAvailable { get; private set; } = true;
|
||||||
|
|
||||||
|
[AlwaysInclude, StaticInitPriority(100)]
|
||||||
|
static class AllowFail
|
||||||
|
{
|
||||||
|
public static this()
|
||||||
|
{
|
||||||
|
Runtime.AddErrorHandler(new => Handle);
|
||||||
|
}
|
||||||
|
|
||||||
|
public static Runtime.ErrorHandlerResult Handle(Runtime.ErrorStage errorStage, Runtime.Error error)
|
||||||
|
{
|
||||||
|
if (errorStage == .PreFail)
|
||||||
|
{
|
||||||
|
if (var loadLibaryError = error as Runtime.LoadSharedLibraryError)
|
||||||
|
{
|
||||||
|
if (loadLibaryError.mPath == "libsystemd.so")
|
||||||
|
{
|
||||||
|
IsSystemdAvailable = false;
|
||||||
|
return .Ignore;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return .ContinueFailure;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
[Import("libsystemd.so"), LinkName("sd_bus_open_user")]
|
[Import("libsystemd.so"), LinkName("sd_bus_open_user")]
|
||||||
public static extern c_int SdBusOpenUser(DBus **ret);
|
public static extern c_int SdBusOpenUser(DBus **ret);
|
||||||
[Import("libsystemd.so"), LinkName("sd_bus_open_system")]
|
[Import("libsystemd.so"), LinkName("sd_bus_open_system")]
|
||||||
|
|
|
@ -972,6 +972,9 @@ namespace System
|
||||||
|
|
||||||
public void Append(char8* appendPtr, int length)
|
public void Append(char8* appendPtr, int length)
|
||||||
{
|
{
|
||||||
|
Debug.Assert(length >= 0);
|
||||||
|
if (length <= 0)
|
||||||
|
return;
|
||||||
int newCurrentIndex = mLength + length;
|
int newCurrentIndex = mLength + length;
|
||||||
char8* ptr;
|
char8* ptr;
|
||||||
if (newCurrentIndex > AllocSize)
|
if (newCurrentIndex > AllocSize)
|
||||||
|
@ -996,6 +999,9 @@ namespace System
|
||||||
|
|
||||||
public void Append(char8[] arr, int idx, int length)
|
public void Append(char8[] arr, int idx, int length)
|
||||||
{
|
{
|
||||||
|
Debug.Assert(length >= 0);
|
||||||
|
if (length <= 0)
|
||||||
|
return;
|
||||||
int newCurrentIndex = mLength + length;
|
int newCurrentIndex = mLength + length;
|
||||||
char8* ptr;
|
char8* ptr;
|
||||||
if (newCurrentIndex > AllocSize)
|
if (newCurrentIndex > AllocSize)
|
||||||
|
|
|
@ -3438,6 +3438,8 @@ namespace IDE
|
||||||
delete mWorkspace.mDir;
|
delete mWorkspace.mDir;
|
||||||
mWorkspace.mDir = newPath;
|
mWorkspace.mDir = newPath;
|
||||||
}
|
}
|
||||||
|
else if (mWorkspace.mDir == null)
|
||||||
|
mWorkspace.mDir = new String();
|
||||||
|
|
||||||
List<String> platforms = scope List<String>();
|
List<String> platforms = scope List<String>();
|
||||||
if (IDEApp.sPlatform32Name != null)
|
if (IDEApp.sPlatform32Name != null)
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue