2014-12-07 19:09:38 -05:00
|
|
|
// Copyright 1998-2015 Epic Games, Inc. All Rights Reserved.
|
2014-03-14 14:13:41 -04:00
|
|
|
|
|
|
|
|
#include "SlateViewerApp.h"
|
|
|
|
|
#include "RequiredProgramMainCPPInclude.h"
|
2014-08-27 20:35:19 -04:00
|
|
|
#include "STestSuite.h"
|
2014-09-10 06:43:48 -04:00
|
|
|
#include "ISourceCodeAccessModule.h"
|
2014-11-07 18:01:32 -05:00
|
|
|
#include "SPerfSuite.h"
|
2014-11-13 04:46:55 -05:00
|
|
|
#include "SDockTab.h"
|
|
|
|
|
#include "SWebBrowser.h"
|
2014-03-14 14:13:41 -04:00
|
|
|
|
|
|
|
|
IMPLEMENT_APPLICATION(SlateViewer, "SlateViewer");
|
|
|
|
|
|
2014-11-13 04:46:55 -05:00
|
|
|
#define LOCTEXT_NAMESPACE "SlateViewer"
|
2014-03-14 14:13:41 -04:00
|
|
|
|
|
|
|
|
namespace WorkspaceMenu
|
|
|
|
|
{
|
2014-11-13 04:46:55 -05:00
|
|
|
TSharedRef<FWorkspaceItem> DeveloperMenu = FWorkspaceItem::NewGroup(LOCTEXT("DeveloperMenu", "Developer"));
|
2014-03-14 14:13:41 -04:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
void RunSlateViewer( const TCHAR* CommandLine )
|
|
|
|
|
{
|
|
|
|
|
// start up the main loop
|
|
|
|
|
GEngineLoop.PreInit(CommandLine);
|
|
|
|
|
|
|
|
|
|
// crank up a normal Slate application using the platform's standalone renderer
|
|
|
|
|
FSlateApplication::InitializeAsStandaloneApplication(GetStandardStandaloneRenderer());
|
|
|
|
|
|
2014-09-10 06:43:48 -04:00
|
|
|
// Load the source code access module
|
|
|
|
|
ISourceCodeAccessModule& SourceCodeAccessModule = FModuleManager::LoadModuleChecked<ISourceCodeAccessModule>( FName( "SourceCodeAccess" ) );
|
|
|
|
|
|
|
|
|
|
// Manually load in the source code access plugins, as standalone programs don't currently support plugins.
|
|
|
|
|
#if PLATFORM_MAC
|
|
|
|
|
IModuleInterface& XCodeSourceCodeAccessModule = FModuleManager::LoadModuleChecked<IModuleInterface>( FName( "XCodeSourceCodeAccess" ) );
|
|
|
|
|
SourceCodeAccessModule.SetAccessor(FName("XCodeSourceCodeAccess"));
|
|
|
|
|
#elif PLATFORM_WINDOWS
|
|
|
|
|
IModuleInterface& VisualStudioSourceCodeAccessModule = FModuleManager::LoadModuleChecked<IModuleInterface>( FName( "VisualStudioSourceCodeAccess" ) );
|
|
|
|
|
SourceCodeAccessModule.SetAccessor(FName("VisualStudioSourceCodeAccess"));
|
|
|
|
|
#endif
|
|
|
|
|
|
2014-03-14 14:13:41 -04:00
|
|
|
// set the application name
|
2014-11-13 04:46:55 -05:00
|
|
|
FGlobalTabmanager::Get()->SetApplicationTitle(LOCTEXT("AppTitle", "Slate Viewer"));
|
Slate: Refactored core Slate implementation into SlateCore module in preparation for UMG.
Other Updates:
- The WidgetReflector is now in its own module as well. It will be converted to a plug-in later.
- The Public API of both Slate and SlateCore has largely been reorganized for better discoverabilty. More cleanup work is needed.
- Added a lot of missing API documentation and fixed existing ones. More and better documentation is needed.
- Removed dead code, fixed a couple things I stubled upon, and conformed to coding guidelines (NULL vs nullptr, line breaks, etc.)
Upgrade Notes:
- The Slate Remote Server is currently disabled - will be re-enabled shortly!
- If your module previously had a module dependency to 'Slate', it now also needs a PrivateModuleDependency to 'SlateCore' in its Build.cs file.
- If your module exposes in any of its Public header files types that are now declared in SlateCore, it needs a PublicModuleDependency to 'SlateCore'
- The ToolTip property type on SWidget has changed from SToolTip to IToolTip; change local variables to TSharedPtr<IToolTip> instead of TSharedPtr<SToolTip> where needed
- IToolTip is not a widget. If you need access to the actual widget that represents the tool tip, use IToolTip::AsWidget(); If you need access to the tool tip's content, use IToolTip::GetContentWidget()
Troubleshooting:
- After syncing to this changelist you may have to clean your /Engine/Intermediate/Build/ directory and rebuild your entire project
- If in your project you are getting linker errors for unresolved types that are now declared in SlateCore, you may be missing a dependency to 'SlateCore'
- If in the Engine code you are getting linker errors for unresolved types that are now declared in SlateCore, you may need to rebuild the entire Engine
[CL 2057118 by Max Preussner in Main branch]
2014-04-26 15:07:24 -04:00
|
|
|
FModuleManager::LoadModuleChecked<ISlateReflectorModule>("SlateReflector").RegisterTabSpawner(WorkspaceMenu::DeveloperMenu);
|
2014-03-14 14:13:41 -04:00
|
|
|
|
2014-11-13 04:46:55 -05:00
|
|
|
FGlobalTabmanager::Get()->RegisterNomadTabSpawner("WebBrowserTab", FOnSpawnTab::CreateStatic(&SpawnWebBrowserTab))
|
|
|
|
|
.SetDisplayName(LOCTEXT("WebBrowserTab", "Web Browser"));
|
2014-11-07 18:01:32 -05:00
|
|
|
|
|
|
|
|
if (FParse::Param(FCommandLine::Get(), TEXT("perftest")))
|
|
|
|
|
{
|
|
|
|
|
// Bring up perf test
|
|
|
|
|
SummonPerfTestSuite();
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
// Bring up the test suite.
|
|
|
|
|
RestoreSlateTestSuite();
|
|
|
|
|
}
|
|
|
|
|
|
2014-03-14 14:13:41 -04:00
|
|
|
|
|
|
|
|
#if WITH_SHARED_POINTER_TESTS
|
|
|
|
|
SharedPointerTesting::TestSharedPointer<ESPMode::Fast>();
|
|
|
|
|
SharedPointerTesting::TestSharedPointer<ESPMode::ThreadSafe>();
|
|
|
|
|
#endif
|
|
|
|
|
|
|
|
|
|
// loop while the server does the rest
|
|
|
|
|
while (!GIsRequestingExit)
|
|
|
|
|
{
|
2014-11-05 13:13:07 -05:00
|
|
|
FTaskGraphInterface::Get().ProcessThreadUntilIdle(ENamedThreads::GameThread);
|
|
|
|
|
FStats::AdvanceFrame(false);
|
|
|
|
|
FTicker::GetCoreTicker().Tick(FApp::GetDeltaTime());
|
2014-03-14 14:13:41 -04:00
|
|
|
FSlateApplication::Get().PumpMessages();
|
2014-11-05 13:13:07 -05:00
|
|
|
FSlateApplication::Get().Tick();
|
2014-03-14 14:13:41 -04:00
|
|
|
FPlatformProcess::Sleep(0);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
FSlateApplication::Shutdown();
|
|
|
|
|
}
|
2014-11-13 04:46:55 -05:00
|
|
|
|
|
|
|
|
TSharedRef<SDockTab> SpawnWebBrowserTab(const FSpawnTabArgs& Args)
|
|
|
|
|
{
|
|
|
|
|
return SNew(SDockTab)
|
|
|
|
|
.Label(LOCTEXT("WebBrowserTab", "Web Browser"))
|
|
|
|
|
.ToolTipText(LOCTEXT("WebBrowserTabToolTip", "Switches to the Web Browser to test its features."))
|
|
|
|
|
.TabRole(ETabRole::NomadTab)
|
|
|
|
|
[
|
|
|
|
|
SNew(SWebBrowser)
|
|
|
|
|
.ParentWindow(Args.GetOwnerWindow())
|
|
|
|
|
];
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
#undef LOCTEXT_NAMESPACE
|