1
0
Fork 0
mirror of https://github.com/beefytech/Beef.git synced 2025-06-08 03:28:20 +02:00

linux build quick fix

This commit is contained in:
M0N7Y5 2024-08-27 05:48:22 +02:00
parent 5a31cc35ba
commit 81a2f95279
7 changed files with 3841 additions and 3828 deletions

View file

@ -299,6 +299,7 @@ void bf::System::Console::PutChar(char c)
void bf::System::Console::ReopenHandles()
{
#ifdef _MSC_VER
FILE* fDummy;
freopen_s(&fDummy, "CONOUT$", "w", stdout);
freopen_s(&fDummy, "CONOUT$", "w", stderr);
@ -310,6 +311,7 @@ void bf::System::Console::ReopenHandles()
SetStdHandle(STD_OUTPUT_HANDLE, hConOut);
SetStdHandle(STD_ERROR_HANDLE, hConOut);
SetStdHandle(STD_INPUT_HANDLE, hConIn);
#endif
}
void bf::System::Runtime::Init(int version, int flags, BfRtCallbacks* callbacks)

View file

@ -24,10 +24,9 @@ using IDE.Util;
using IDE.ui;
using IDE.util;
[AttributeUsage(.Method, .ReflectAttribute | .AlwaysIncludeTarget, ReflectUser=.All)]
[AttributeUsage(.Method, .ReflectAttribute | .AlwaysIncludeTarget, ReflectUser = .All)]
struct IDECommandAttribute : Attribute
{
}
namespace IDE
@ -57,7 +56,6 @@ namespace IDE
class DeferredUserRequest
{
}
class DeferredShowPCLocation : DeferredUserRequest
@ -124,10 +122,10 @@ namespace IDE
#if BF_PLATFORM_WINDOWS
public static readonly String sPlatform64Name = "Win64";
public static readonly String sPlatform32Name = "Win32";
#elif BF_PLATFORM_LINUX
#elif BF_PLATFORM_LINUX
public static readonly String sPlatform64Name = "Linux64";
public static readonly String sPlatform32Name = "Linux32";
#elif BF_PLATFORM_MACOS
#elif BF_PLATFORM_MACOS
public static readonly String sPlatform64Name = "macOS";
public static readonly String sPlatform32Name = null;
#else
@ -197,8 +195,10 @@ namespace IDE
public bool mWantShowOutput;
public OutputPanel mOutputPanel;
#if BF_PLATFORM_WINDOWS
public TerminalPanel mTerminalPanel;
public ConsolePanel mConsolePanel;
#endif
public ImmediatePanel mImmediatePanel;
public FindResultsPanel mFindResultsPanel;
public WatchPanel mAutoWatchPanel;
@ -428,7 +428,6 @@ namespace IDE
class OpenDebugConsoleCmd : ExecutionCmd
{
}
class StartDebugCmd : ExecutionCmd
@ -455,7 +454,6 @@ namespace IDE
public ~this()
{
}
}
@ -577,7 +575,7 @@ namespace IDE
mEnableGCCollect = value;
//GC.SetAutoCollectPeriod(mEnableGCCollect ? 2000 : -1);
GC.SetAutoCollectPeriod(mEnableGCCollect ? 20 : -1);
GC.SetCollectFreeThreshold(mEnableGCCollect ? 64*1024*1024 : -1);
GC.SetCollectFreeThreshold(mEnableGCCollect ? 64 * 1024 * 1024 : -1);
}
}
@ -598,14 +596,14 @@ namespace IDE
}
}
[CallingConvention(.Stdcall),CLink]
[CallingConvention(.Stdcall), CLink]
static extern void IDEHelper_ProgramStart();
[CallingConvention(.Stdcall),CLink]
[CallingConvention(.Stdcall), CLink]
static extern void IDEHelper_ProgramDone();
public this()
{
ThreadPool.MaxStackSize = 8*1024*1024;
ThreadPool.MaxStackSize = 8 * 1024 * 1024;
sApp = this;
gApp = this;
@ -724,8 +722,10 @@ namespace IDE
RemoveAndDelete!(mProjectPanel);
RemoveAndDelete!(mClassViewPanel);
RemoveAndDelete!(mOutputPanel);
#if BF_PLATFORM_WINDOWS
RemoveAndDelete!(mTerminalPanel);
RemoveAndDelete!(mConsolePanel);
#endif
RemoveAndDelete!(mImmediatePanel);
RemoveAndDelete!(mFindResultsPanel);
RemoveAndDelete!(mAutoWatchPanel);
@ -830,8 +830,10 @@ namespace IDE
dlg(mProjectPanel);
dlg(mClassViewPanel);
dlg(mOutputPanel);
#if BF_PLATFORM_WINDOWS
dlg(mTerminalPanel);
dlg(mConsolePanel);
#endif
dlg(mImmediatePanel);
dlg(mFindResultsPanel);
dlg(mAutoWatchPanel);
@ -890,7 +892,7 @@ namespace IDE
{
if (((mBfBuildCompiler != null) && mBfBuildCompiler.HasQueuedCommands()) ||
((mBfResolveCompiler != null) && (mBfResolveCompiler.HasQueuedCommands()))
#if IDE_C_SUPPORT
#if IDE_C_SUPPORT
|| (mDepClang.HasQueuedCommands()) ||
(mResolveClang.HasQueuedCommands())
#endif
@ -1042,7 +1044,7 @@ namespace IDE
for (String openFileName in fileDialog.FileNames)
{
String.NewOrSet!(mDeferredOpenFileName, openFileName);
mDeferredOpen =.DebugSession;
mDeferredOpen = .DebugSession;
break;
}
}
@ -1205,7 +1207,7 @@ namespace IDE
{
String text = scope String("The following files have been modified: ");
text.Join(", ", changedList.GetEnumerator());
text .Append(". Save before closing?");
text.Append(". Save before closing?");
aDialog = ThemeFactory.mDefault.CreateDialog("Save files?", text, DarkTheme.sDarkTheme.mIconWarning);
}
@ -1260,7 +1262,6 @@ namespace IDE
changedList.Add(fileName);
}
}
});
WithSourceViewPanels(scope (sourceViewPanel) =>
{
@ -1331,7 +1332,8 @@ namespace IDE
void CloseTabs()
{
WithDocumentTabbedViewsOf(window, scope (tabbedView) => {
WithDocumentTabbedViewsOf(window, scope (tabbedView) =>
{
tabbedView.CloseTabs(false, true, true);
});
}
@ -1354,7 +1356,8 @@ namespace IDE
}
});
if (changedList.Count == 0) {
if (changedList.Count == 0)
{
CloseTabs();
return true;
}
@ -1420,7 +1423,7 @@ namespace IDE
{
if ((sourceViewPanel.mParent != null) && (sourceViewPanel != excludeSourceViewPanel))
{
if (viewRefreshKind ==.Collapse)
if (viewRefreshKind == .Collapse)
sourceViewPanel.QueueCollapseRefresh();
else
sourceViewPanel.QueueFullRefresh(true);
@ -1904,7 +1907,6 @@ namespace IDE
SerializeWindow(sd, mMainWindow);
else
{
sd.Add("X", mRequestedWindowRect.mX);
sd.Add("Y", mRequestedWindowRect.mY);
sd.Add("Width", mRequestedWindowRect.mWidth);
@ -2591,7 +2593,6 @@ namespace IDE
[IDECommand]
void CollapseRedo()
{
}
[IDECommand]
@ -2609,7 +2610,6 @@ namespace IDE
[IDECommand]
void CollapseUndo()
{
}
[IDECommand]
@ -2664,7 +2664,7 @@ namespace IDE
if (var sourceViewPanel = GetLastActiveDocumentPanel() as SourceViewPanel)
{
var sewc = sourceViewPanel.mEditWidget.mEditWidgetContent as SourceEditWidgetContent;
uint8[] newData = new uint8[sewc.mData.mTextLength*4];
uint8[] newData = new uint8[sewc.mData.mTextLength * 4];
var idData = ref sewc.mData.mTextIdData;
/*idData.Prepare();
@ -2981,8 +2981,6 @@ namespace IDE
LoadFailed();
default:
}
}
}
mWorkspace.Deserialize(data);
@ -3082,7 +3080,7 @@ namespace IDE
if (useVerSpec case .SemVer)
{
// First pass we just try to use the 'expected' project name
FindLoop: for (int pass < 2)
FindLoop:for (int pass < 2)
{
using (mBeefConfig.mRegistry.mMonitor.Enter())
{
@ -3256,7 +3254,7 @@ namespace IDE
mActiveDocumentsTabbedView = tabbedView;
SourceViewTabButton activeTab = null;
for (data.Enumerate("Tabs"))
for ( data.Enumerate("Tabs"))
{
Panel panel = Panel.Create(data);
if (panel == null)
@ -3385,7 +3383,7 @@ namespace IDE
DeserializeDockingFrame(data, mDockingFrame);
ClearAndDeleteItems(mRecentlyDisplayedFiles);
for (data.Enumerate("RecentFilesList"))
for ( data.Enumerate("RecentFilesList"))
{
String relPath = scope String();
data.GetCurString(relPath);
@ -3503,7 +3501,7 @@ namespace IDE
mDebugger.SetDisplayTypes(referenceIdStr, formatStr, intDisplayType, mmDisplayType, floatDisplayType);
}
for (data.Enumerate("StepFilters"))
for ( data.Enumerate("StepFilters"))
{
String filter = scope String();
data.GetCurString(filter);
@ -3511,7 +3509,7 @@ namespace IDE
mDebugger.CreateStepFilter(filter, false, .Filtered);
}
for (data.Enumerate("StepNotFilters"))
for ( data.Enumerate("StepNotFilters"))
{
String filter = scope String();
data.GetCurString(filter);
@ -3719,7 +3717,6 @@ namespace IDE
success &= SaveFile(projectSource);
}
}
});
for (var project in mWorkspace.mProjects)
{
@ -4303,9 +4300,9 @@ namespace IDE
if (scale < 4.0f)
{
if (scale < 0)
scale += 0.02f;//0.05f;
scale += 0.02f; //0.05f;
else //if (scale < 2.0f)
scale += 0.04f;//0.10f;
scale += 0.04f; //0.10f;
SetScale(scale);
}
@ -4979,11 +4976,9 @@ namespace IDE
#unwarn
if (var processBfCompileCmd = cmd as ProcessBfCompileCmd)
{
}
else if (var buildCompleteCmd = cmd as BuildCompletedCmd)
{
}
else
{
@ -5168,19 +5163,21 @@ namespace IDE
{
ShowPanel(mAutoWatchPanel, "Auto Watches");
}
[IDECommand]
public void ShowTerminal()
{
#if BF_PLATFORM_WINDOWS
ShowPanel(mTerminalPanel, "Terminal");
#endif
}
[IDECommand]
public void ShowConsole()
{
#if BF_PLATFORM_WINDOWS
ShowPanel(mConsolePanel, "Console");
#endif
}
[IDECommand]
public void ShowImmediatePanel()
{
@ -5821,7 +5818,7 @@ namespace IDE
mSettings.mRecentFiles.mRecents[(int)RecentFiles.RecentKind.OpenedFile].mMenu = recentMenu.AddMenuItem("Open Recent &File");
mSettings.mRecentFiles.mRecents[(int)RecentFiles.RecentKind.OpenedCrashDump].mMenu = recentMenu.AddMenuItem("Open Recent &Crash Dump");
AddMenuItem(subMenu, "&Save File","Save File", new => UpdateMenuItem_HasActiveDocument);
AddMenuItem(subMenu, "&Save File", "Save File", new => UpdateMenuItem_HasActiveDocument);
AddMenuItem(subMenu, "Save &As...", "Save As", new => UpdateMenuItem_HasActiveDocument);
AddMenuItem(subMenu, "Save A&ll", "Save All");
let prefMenu = subMenu.AddMenuItem("&Preferences");
@ -5899,11 +5896,11 @@ namespace IDE
var comptimeMenu = subMenu.AddMenuItem("Comptime");
var emitViewCompiler = comptimeMenu.AddMenuItem("Emit View Compiler");
var subItem = emitViewCompiler.AddMenuItem("Resolve", null,
new (menu) => { SetEmbedCompiler(.Resolve); } ,
new (menu) => { SetEmbedCompiler(.Resolve); },
new (menu) => { menu.SetCheckState((mSettings.mEditorSettings.mEmitCompiler == .Resolve) ? 1 : 0); },
null, true, (mSettings.mEditorSettings.mEmitCompiler == .Resolve) ? 1 : 0);
subItem = emitViewCompiler.AddMenuItem("Build", null,
new (menu) => { SetEmbedCompiler(.Build); } ,
new (menu) => { SetEmbedCompiler(.Build); },
new (menu) => { menu.SetCheckState((mSettings.mEditorSettings.mEmitCompiler == .Build) ? 1 : 0); },
null, true, (mSettings.mEditorSettings.mEmitCompiler == .Build) ? 1 : 0);
@ -6006,7 +6003,6 @@ namespace IDE
sysMenu.Modify("&Continue", sysMenu.mHotKey, null, mDebugger.IsPaused());
else
sysMenu.Modify("&Start Debugging", sysMenu.mHotKey, null, mWorkspace.IsInitialized);
});
AddMenuItem(subMenu, "Start Wit&hout Debugging", "Start Without Debugging", new => UpdateMenuItem_DebugStopped_HasWorkspace);
AddMenuItem(subMenu, "Start With&out Compiling", "Start Without Compiling", new => UpdateMenuItem_DebugStopped_HasWorkspace);
@ -6032,8 +6028,8 @@ namespace IDE
if (mSettings.mEnableDevMode)
{
var internalDebugMenu = subMenu.AddMenuItem("Internal");
internalDebugMenu.AddMenuItem("Error Test", null, new (menu) => { DoErrorTest(); } );
internalDebugMenu.AddMenuItem("Reconnect BeefPerf", null, new (menu) => { BeefPerf.RetryConnect(); } );
internalDebugMenu.AddMenuItem("Error Test", null, new (menu) => { DoErrorTest(); });
internalDebugMenu.AddMenuItem("Reconnect BeefPerf", null, new (menu) => { BeefPerf.RetryConnect(); });
AddMenuItem(internalDebugMenu, "Report Memory", "Report Memory");
internalDebugMenu.AddMenuItem("Crash", null, new (menu) => { int* ptr = null; *ptr = 123; });
internalDebugMenu.AddMenuItem("Show Welcome", null, new (menu) => { ShowWelcome(); });
@ -6703,7 +6699,7 @@ namespace IDE
}
}
editData.BuildHash(text);
} ) case .Err)
}) case .Err)
return false;
editData..GetFileTime();
@ -7043,7 +7039,6 @@ namespace IDE
public void UpdateRecentFilesMenuItems(List<String> filesList)
{
}
public void UpdateRecentDisplayedFilesMenuItems()
@ -7928,7 +7923,7 @@ namespace IDE
mWantsClean = true;
mRunningTestScript = true;
mScriptManager.SetTimeoutMS(20*60*1000); // 20 minute timeout
mScriptManager.SetTimeoutMS(20 * 60 * 1000); // 20 minute timeout
mScriptManager.QueueCommandFile(absTestPath);
case "-verbosity":
if (value == "quiet")
@ -8262,8 +8257,10 @@ namespace IDE
if (!evt.mKeyFlags.HeldKeys.HasFlag(.Alt))
{
#if BF_PLATFORM_WINDOWS
mConsolePanel.SysKeyDown(evt);
mTerminalPanel.SysKeyDown(evt);
#endif
}
if (evt.mHandled)
@ -8439,8 +8436,10 @@ namespace IDE
void SysKeyUp(KeyCode keyCode)
{
#if BF_PLATFORM_WINDOWS
mConsolePanel.SysKeyUp(keyCode);
mTerminalPanel.SysKeyUp(keyCode);
#endif
}
void ShowOpenFileInSolutionDialog()
@ -8778,7 +8777,7 @@ namespace IDE
if (executionInstance.mProcess.AttachStandardInput(fileStream) case .Err)
return;
WriteLoop: while (!executionInstance.mStdInData.IsEmpty)
WriteLoop:while (!executionInstance.mStdInData.IsEmpty)
{
switch (fileStream.TryWrite(.((.)executionInstance.mStdInData.Ptr, executionInstance.mStdInData.Length)))
{
@ -8836,7 +8835,7 @@ namespace IDE
FileStream fileStream = (.)obj;
int count = 0;
Loop: while (true)
Loop:while (true)
{
uint8[4096] data = ?;
switch (fileStream.TryRead(data, -1))
@ -9060,17 +9059,14 @@ namespace IDE
protected virtual void BeefCompileStarted()
{
}
protected virtual void BeefCompileDone()
{
}
protected virtual void CompileDone(bool succeeded)
{
}
BuildCompletedCmd GetBuildCompletedCmd()
@ -9255,9 +9251,9 @@ namespace IDE
}
}
#if BF_PLATFORM_WINDOWS
if (let startDebugCmd = next as StartDebugCmd)
{
#if BF_PLATFORM_WINDOWS
if ((mSettings.mDebugConsoleKind == .Native) && (mSettings.mKeepNativeConsoleOpen))
{
if (!startDebugCmd.mConnectedToConsole)
@ -9319,9 +9315,8 @@ namespace IDE
}
}
}
#endif
}
#endif
defer delete next;
mExecutionQueue.RemoveAt(0);
@ -9422,7 +9417,7 @@ namespace IDE
pipe.Stream.Write((int32)mDebugger.GetProcessId());
pipe.EndMessage();
}
#endif*/
#endif*/
}
}
else if (next is ExecutionQueueCmd)
@ -9606,7 +9601,7 @@ namespace IDE
{
String text = scope String();
bool isValid = false;
if (LoadTextFile(fullPath, text, true, scope [?] () => { if (sourceHash != null) *sourceHash = SourceHash.Create(.MD5, text); } ) case .Ok)
if (LoadTextFile(fullPath, text, true, scope [?] () => { if (sourceHash != null) *sourceHash = SourceHash.Create(.MD5, text); }) case .Ok)
{
mFileWatcher.FileIsValid(fullPath);
isValid = true;
@ -10309,7 +10304,7 @@ namespace IDE
bool hadError = false;
for ( ; i < result.Length - 2; i++)
for (; i < result.Length - 2; i++)
{
if ((result[i] == '$') && (result[i + 1] == '('))
{
@ -10578,7 +10573,6 @@ namespace IDE
newString.Append(".a\"");
default:
}
}
case "VSToolPath":
if (Workspace.PlatformType.GetPtrSizeByName(platformName) == 4)
@ -10654,7 +10648,7 @@ namespace IDE
public void ReplaceVariables(String result)
{
int i = 0;
for ( ; i < result.Length - 2; i++)
for (; i < result.Length - 2; i++)
{
if ((result[i] == '$') && (result[i + 1] == '('))
{
@ -10740,7 +10734,6 @@ namespace IDE
}
}
}
}
public bool ResolveConfigString(String platformName, Workspace.Options workspaceOptions, Project project, Project.Options options, StringView configString, String errorContext, String outResult)
@ -10789,7 +10782,6 @@ namespace IDE
if (workspaceOptions.mToolsetType != .GNU)
clangOptions.Append("-gcodeview ");
}
else
clangOptions.Append("-g ");
@ -10897,7 +10889,7 @@ namespace IDE
if (!isC)
{
if (!String.IsNullOrEmpty(options.mCOptions.mOtherCPPFlags))
clangOptions.Append(options.mCOptions.mOtherCPPFlags, " ") ;
clangOptions.Append(options.mCOptions.mOtherCPPFlags, " ");
clangOptions.Append("-std=c++14 ");
}
else
@ -10905,7 +10897,6 @@ namespace IDE
if (!String.IsNullOrEmpty(options.mCOptions.mOtherCFlags))
clangOptions.Append(options.mCOptions.mOtherCFlags, " ");
}
}
static void QuoteIfNeeded(String str)
@ -11491,7 +11482,7 @@ namespace IDE
public void QueueProfiling(int threadId, String desc, int sampleRate)
{
if(mExecutionQueue.IsEmpty)
if (mExecutionQueue.IsEmpty)
return;
var profileCmd = new ProfileCmd();
profileCmd.mThreadId = threadId;
@ -11545,7 +11536,6 @@ namespace IDE
});
dialog.AddButton("No", new (evt) =>
{
});
dialog.PopupWindow(GetActiveWindow());
}
@ -11679,7 +11669,6 @@ namespace IDE
},
new (dlg) =>
{
});
dlg.PopupWindow(GetActiveWindow());
#else
@ -11866,7 +11855,6 @@ namespace IDE
},
new (dlg) =>
{
});
((DarkButton)dlg.mButtons[0]).Label = "Open Link";
dlg.PopupWindow(GetActiveWindow());
@ -12097,7 +12085,9 @@ namespace IDE
if (mSettings.mDebugConsoleKind == .Embedded)
{
ShowConsole();
#if BF_PLATFORM_WINDOWS
mConsolePanel.Attach();
#endif
}
if (mSettings.mDebugConsoleKind == .RedirectToImmediate)
@ -12112,8 +12102,10 @@ namespace IDE
if (!mDebugger.OpenFile(launchPath, targetPath, arguments, workingDir, envBlock, wasCompiled, workspaceOptions.mAllowHotSwapping, openFileFlags))
{
#if BF_PLATFORM_WINDOWS
if (!mSettings.mAlwaysEnableConsole)
mConsolePanel.Detach();
#endif
DeleteAndNullify!(mCompileAndRunStopwatch);
return false;
}
@ -12469,12 +12461,14 @@ namespace IDE
mClassViewPanel.mAutoDelete = false;
mOutputPanel = new OutputPanel(true);
mOutputPanel.mAutoDelete = false;
#if BF_PLATFORM_WINDOWS
mTerminalPanel = new TerminalPanel();
mTerminalPanel .Init();
mTerminalPanel.mAutoDelete = false;
mConsolePanel = new ConsolePanel();
mConsolePanel.Init();
mConsolePanel.mAutoDelete = false;
#endif
mImmediatePanel = new ImmediatePanel();
mImmediatePanel.mAutoDelete = false;
mFindResultsPanel = new FindResultsPanel();
@ -12564,7 +12558,7 @@ namespace IDE
int32 height = (int32)(workHeight * 0.85f);
int32 width = Math.Min(4 * height / 3, (int32)(workWidth * 0.85f));
mRequestedWindowRect = .(workX + (workWidth - width)/2, workY + (workHeight - height)/2, width, height);
mRequestedWindowRect = .(workX + (workWidth - width) / 2, workY + (workHeight - height) / 2, width, height);
}
if (!loadedWorkspaceUserData)
@ -12765,7 +12759,7 @@ namespace IDE
return;
float fontSize = DarkTheme.sScale * mSettings.mEditorSettings.mFontSize;
float tinyFontSize = fontSize * 8.0f/9.0f;
float tinyFontSize = fontSize * 8.0f / 9.0f;
String err = scope String();
void FontFail(StringView name)
@ -13302,7 +13296,7 @@ namespace IDE
mBfResolveCompiler?.CancelBackground();
if ((!mBfBuildCompiler.HasQueuedCommands()) && (!mBfResolveCompiler.HasQueuedCommands())
#if IDE_C_SUPPORT
#if IDE_C_SUPPORT
&& (!mDepClang.HasQueuedCommands()) && (!mResolveClang.HasQueuedCommands())
#endif
)
@ -13594,7 +13588,6 @@ namespace IDE
if (addWidget != null)
mOutputPanel.AddInlineWidget(addWidget);
}
else if (infoPos != -1)
{
@ -13700,7 +13693,7 @@ namespace IDE
if (mScriptManager.mFailed)
mScriptManager.Clear();
mScriptManager.mSoftFail = true;
mScriptManager.SetTimeoutMS(20*60*1000); // 20 minute timeout
mScriptManager.SetTimeoutMS(20 * 60 * 1000); // 20 minute timeout
mScriptManager.QueueCommandFile(absTestPath);
}
else
@ -13729,8 +13722,10 @@ namespace IDE
var disassemblyPanel = TryGetDisassemblyPanel(false);
if (disassemblyPanel != null)
disassemblyPanel.Disable();
#if BF_PLATFORM_WINDOWS
if (!mSettings.mAlwaysEnableConsole)
mConsolePanel.Detach();
#endif
mDebugger.DisposeNativeBreakpoints();
mDebugger.Detach();
mDebugger.mIsRunning = false;
@ -13884,10 +13879,12 @@ namespace IDE
{
if ((--mForegroundTargetCountdown == 0) && (mDebugger.mIsRunning))
{
#if BF_PLATFORM_WINDOWS
if (mConsolePanel.mBeefConAttachState case .Connected(let processId))
mDebugger.ForegroundTarget(processId);
else
mDebugger.ForegroundTarget(0);
#endif
}
}
@ -13952,7 +13949,7 @@ namespace IDE
DeleteAndNullify!(mLaunchData);
mErrorsPanel?.UpdateAlways();
#if BF_PLATFORM_WINDOWS
if ((mConsolePanel != null) && (mConsolePanel.mBeefConAttachState case .Attached(let consoleProcessId)))
{
if (!mDebugger.mIsRunning)
@ -13979,6 +13976,7 @@ namespace IDE
}
}
}
#endif
}
public void ShowPassOutput(BfPassInstance bfPassInstance)
@ -14142,7 +14140,7 @@ namespace IDE
String newName = null;
if (newPath != null)
{
newName = scope ::String();
newName = scope:: String();
Path.GetFileName(newPath, newName);
}
@ -14265,7 +14263,6 @@ namespace IDE
changed = true;
}
}
}
else
changed = true;
@ -14277,7 +14274,6 @@ namespace IDE
}
}
}
});
}
}
@ -14321,7 +14317,6 @@ namespace IDE
},
new (dlg) =>
{
});
dialog.PopupWindow(GetActiveWindow());
hadChange = true;
@ -14389,7 +14384,7 @@ namespace IDE
}
}
while (/*(appHasFocus) && */((mFileChangedDialog == null) || (mFileChangedDialog.mClosed)))
while ( /*(appHasFocus) && */((mFileChangedDialog == null) || (mFileChangedDialog.mClosed)))
{
while (mExternalChangeDeferredOpen.Count > 0)
{
@ -14431,7 +14426,7 @@ namespace IDE
if (editData.mQueuedContent == null)
editData.mQueuedContent = new String();
editData.mQueuedContent.Clear();
if (LoadTextFile(fileName, editData.mQueuedContent, false, scope() =>
if (LoadTextFile(fileName, editData.mQueuedContent, false, scope () =>
{
editData.BuildHash(editData.mQueuedContent);
}) case .Err(let err))
@ -14547,7 +14542,7 @@ namespace IDE
else
{
#if !DEBUG
OutputLine("IPC: Hosting");//
OutputLine("IPC: Hosting"); //
#endif
}
}
@ -14709,7 +14704,7 @@ namespace IDE
DoOpenFile();
case .CrashDump:
DoOpenCrashDump();
case .Workspace, .NewWorkspace, .NewWorkspaceOrProject:
case .Workspace,.NewWorkspace,.NewWorkspaceOrProject:
if ((mDeferredOpenFileName == null) && (deferredOpen == .Workspace))
{
@ -14756,7 +14751,6 @@ namespace IDE
Runtime.Assert(sourceViewPanel != null, "Source marked as modified with no SourceViewPanel");
}
}
});
}
@ -14787,7 +14781,7 @@ namespace IDE
{
RefreshRate = 60;
}
#if BF_PLATFORM_WINDOWS
if (mTerminalPanel != null)
{
// Detach terminal if the panel is closed
@ -14797,7 +14791,7 @@ namespace IDE
mTerminalPanel.Detach();
}
}
#endif
bool hasFocus = false;
for (let window in mWindows)
{
@ -14840,7 +14834,6 @@ namespace IDE
}
else if (IsCompiling)
{
}
else if (mDebugger.mIsRunning)
{
@ -14881,6 +14874,7 @@ namespace IDE
if (mScriptManager != null)
mScriptManager.Update();
#if BF_PLATFORM_WINDOWS
if (mConsolePanel != null)
{
if ((mSettings.mAlwaysEnableConsole) ||
@ -14889,7 +14883,7 @@ namespace IDE
else
mConsolePanel.Detach();
}
#endif
if (mTestManager != null)
{
mTestManager.Update();

View file

@ -14,7 +14,7 @@ using System.Threading;
using IDE.util;
namespace IDE.ui;
#if BF_PLATFORM_WINDOWS
class ConsolePanel : Panel
{
class View : Widget
@ -369,7 +369,9 @@ class ConsolePanel : Panel
public virtual void Init()
{
#if BF_PLATFORM_WINDOWS
mConsoleProvider = new WinNativeConsoleProvider();
#endif
}
public override void Serialize(StructuredData data)
@ -810,3 +812,4 @@ class ConsolePanel : Panel
mView.SetFocus();
}
}
#endif

View file

@ -83,8 +83,11 @@ namespace IDE.ui
data.GetString("Type", type);
Panel panel = null;
#if BF_PLATFORM_WINDOWS
if (type == "")
return gApp.mTerminalPanel;
#endif
if (type == "CallStackPanel")
panel = gApp.mCallStackPanel;
@ -98,7 +101,9 @@ namespace IDE.ui
}
else if (type == "TerminalPanel")
{
#if BF_PLATFORM_WINDOWS
panel = gApp.mTerminalPanel;
#endif
}
else if (type == "ImmediatePanel")
{
@ -168,11 +173,15 @@ namespace IDE.ui
}
else if (type == "TerminalPanel")
{
#if BF_PLATFORM_WINDOWS
panel = gApp.mTerminalPanel;
#endif
}
else if (type == "ConsolePanel")
{
#if BF_PLATFORM_WINDOWS
panel = gApp.mConsolePanel;
#endif
}
if (panel != null)

View file

@ -3047,8 +3047,10 @@ namespace IDE.ui
if (!path.IsWhiteSpace)
{
#if BF_PLATFORM_WINDOWS
gApp.ShowTerminal();
gApp.mTerminalPanel.OpenDirectory(path);
#endif
}
});
}

View file

@ -13,7 +13,7 @@ using Beefy.utils;
using IDE.util;
namespace IDE.ui;
#if BF_PLATFORM_WINDOWS
class TerminalPanel : ConsolePanel
{
public override void Serialize(StructuredData data)
@ -58,3 +58,4 @@ class TerminalPanel : ConsolePanel
consoleProvider.Attach();
}
}
#endif

View file

@ -8,6 +8,7 @@ using System.IO;
using System.Threading;
namespace IDE.util;
#if BF_PLATFORM_WINDOWS
class ConsoleProvider
{
public enum UpdateState
@ -1325,3 +1326,4 @@ class BeefConConsoleProvider : ConsoleProvider
mPipe.EndMessage();
}
}
#endif