bool FKDevelopSourceCodeAccessor::OpenSourceFiles(const TArray<FString>& AbsoluteSourcePaths)
{
	if (IsIDERunning())
	{
		// use qdbus
		STUBBED("OpenSourceFiles: KDevelop is running, use qdbus");
		return false;
	}
	
	STUBBED("FKDevelopSourceCodeAccessor::OpenSourceFiles");
	return false;
}
Exemplo n.º 2
0
static bool createWebsocketContext(int port) {
	assert(!wsState);

	wsState = new WSState;

	struct lws_context_creation_info info;
	memset(&info, 0, sizeof(info));
	if (port == PORT_ANY) {
		info.port = CONTEXT_PORT_NO_LISTEN;
	} else {
		info.port = port;
	}
	info.protocols = protocols;
	info.gid = -1;
	info.uid = -1;
	STUBBED("TODO: put keepalive stuff in cvars");
	info.ka_time = 5;
	info.ka_probes = 3;
	info.ka_interval = 1;

	wsState->websocketContext = libwebsocket_create_context(&info);
	if (!wsState->websocketContext) {
		delete wsState;
		wsState = NULL;
		return false;
	}

	int retval = libwebsocket_service(wsState->websocketContext, 0);
	Com_Printf("libwebsocket_service returned %d\n", LOG_NET, retval);

	return true;
}
bool FLinuxTargetDevice::GetUserCredentials( FString& OutUserName, FString& OutUserPassword )
{
	STUBBED("FLinuxTargetDevice::GetUserCredentials");
	OutUserName = UserName;
	OutUserPassword = UserPassword;
	return true;
}
bool FLinuxTargetDevice::TerminateProcess( const int64 ProcessId )
{
#if PLATFORM_LINUX // if running natively, just terminate the local process
	// get process path from the ProcessId
	const int32 ReadLinkSize = 1024;
	char ReadLinkCmd[ReadLinkSize] = {0};
	FCStringAnsi::Sprintf(ReadLinkCmd, "/proc/%lld/exe", ProcessId);
	char ProcessPath[ MAX_PATH + 1 ] = {0};
	int32 Ret = readlink(ReadLinkCmd, ProcessPath, ARRAY_COUNT(ProcessPath) - 1);
	if (Ret != -1)
	{
		struct stat st;
		uid_t euid;
		stat(ProcessPath, &st);
		euid = geteuid(); // get effective uid of current application, as this user is asking to kill a process

		// now check if we own the process
		if (st.st_uid == euid)
		{
			// terminate it (will this terminate children as well because we set their pgid?)
			kill(ProcessId, SIGTERM);
			sleep(2); // sleep in case process still remains then send a more strict signal
			kill(ProcessId, SIGKILL);
			return true;
		}
	}
#else
	// @todo: support remote termination
	STUBBED("FLinuxTargetDevice::TerminateProcess");
#endif // PLATFORM_LINUX
	return false;
}
bool FLinuxTargetDevice::Deploy( const FString& SourceFolder, FString& OutAppId )
{
#if PLATFORM_LINUX	// if running natively, support simplified, local deployment	
	OutAppId = TEXT("");

	FString PlatformName = TEXT("Linux");
	FString DeploymentDir = FPaths::EngineIntermediateDir() / TEXT("Devices") / PlatformName;

	// delete previous build
	IFileManager::Get().DeleteDirectory(*DeploymentDir, false, true);

	// copy files into device directory
	TArray<FString> FileNames;

	IFileManager::Get().FindFilesRecursive(FileNames, *SourceFolder, TEXT("*.*"), true, false);

	for (int32 FileIndex = 0; FileIndex < FileNames.Num(); ++FileIndex)
	{
		const FString& SourceFilePath = FileNames[FileIndex];
		FString DestFilePath = DeploymentDir + SourceFilePath.RightChop(SourceFolder.Len());

		IFileManager::Get().Copy(*DestFilePath, *SourceFilePath);
	}

	return true;
#else
	// @todo: support deployment to a remote machine
	STUBBED("FLinuxTargetDevice::Deploy");
	return false;
#endif // PLATFORM_LINUX
}
Exemplo n.º 6
0
// prepares pixel format for OpenGL context
BOOL CGfxLibrary::SetupPixelFormat_OGL( HDC hdc, BOOL bReport/*=FALSE*/)
{
  SDL_Window *window = (SDL_Window *) hdc;
  const DisplayDepth dd  = gl_dmCurrentDisplayMode.dm_ddDepth;

  // clamp depth/stencil values
  extern INDEX gap_iDepthBits;
  extern INDEX gap_iStencilBits;
       if( gap_iDepthBits <12) gap_iDepthBits   = 0;
  else if( gap_iDepthBits <22) gap_iDepthBits   = 16;
  else if( gap_iDepthBits <28) gap_iDepthBits   = 24;
  else                         gap_iDepthBits   = 32;
       if( gap_iStencilBits<3) gap_iStencilBits = 0;
  else if( gap_iStencilBits<7) gap_iStencilBits = 4;
  else                         gap_iStencilBits = 8;

  SDL_GL_SetAttribute(SDL_GL_RED_SIZE, (dd != DD_16BIT) ? 8 : 5);
  SDL_GL_SetAttribute(SDL_GL_GREEN_SIZE, (dd != DD_16BIT) ? 8 : 6);
  SDL_GL_SetAttribute(SDL_GL_BLUE_SIZE, (dd != DD_16BIT) ? 8 : 5);
  SDL_GL_SetAttribute(SDL_GL_ALPHA_SIZE, 0);
  SDL_GL_SetAttribute(SDL_GL_DOUBLEBUFFER, 1);
  SDL_GL_SetAttribute(SDL_GL_DEPTH_SIZE, gap_iDepthBits);
  SDL_GL_SetAttribute(SDL_GL_STENCIL_SIZE, gap_iStencilBits);

  STUBBED("co-opt the existing T-buffer support for multisampling?");
  //SDL_GL_SetAttribute(SDL_GL_MULTISAMPLEBUFFERS, x);
  //SDL_GL_SetAttribute(SDL_GL_MULTISAMPLESAMPLES, y);

  return TRUE;
}
Exemplo n.º 7
0
bool FLinuxTargetDevice::Launch( const FString& AppId, EBuildConfigurations::Type BuildConfiguration, EBuildTargets::Type BuildTarget, const FString& Params, uint32* OutProcessId )
{
#if PLATFORM_LINUX	// if running natively, support launching in place
	// build executable path
	FString PlatformName = TEXT("Linux");
	FString ExecutablePath = FPaths::EngineIntermediateDir() / TEXT("Devices") / PlatformName / TEXT("Engine") / TEXT("Binaries") / PlatformName;

	if (BuildTarget == EBuildTargets::Game)
	{
		ExecutablePath /= TEXT("UE4Game");
	}
	else if (BuildTarget == EBuildTargets::Server)
	{
		ExecutablePath /= TEXT("UE4Server");
	}
	else if (BuildTarget == EBuildTargets::Editor)
	{
		ExecutablePath /= TEXT("UE4Editor");
	}

	if (BuildConfiguration != EBuildConfigurations::Development)
	{
		ExecutablePath += FString::Printf(TEXT("-%s-%s"), *PlatformName, EBuildConfigurations::ToString(BuildConfiguration));
	}

	// launch the game
	FProcHandle ProcessHandle = FPlatformProcess::CreateProc(*ExecutablePath, *Params, true, false, false, OutProcessId, 0, NULL, NULL);
	return ProcessHandle.Close();
#else
	// @todo: support launching on a remote machine
	STUBBED("FLinuxTargetDevice::Launch");
	return false;
#endif // PLATFORM_LINUX
}
Exemplo n.º 8
0
bool FDesktopPlatformLinux::OpenProject(const FString &ProjectFileName)
{
	// Get the project filename in a native format
	FString PlatformProjectFileName = ProjectFileName;
	FPaths::MakePlatformFilename(PlatformProjectFileName);

	STUBBED("FDesktopPlatformLinux::OpenProject");
	return false;
}
Exemplo n.º 9
0
void SCRIPT_GetDouble
   (
   int32 scripthandle,
   char  * sectionname,
   char  * entryname,
   double * number
   )
{
	STUBBED("GetDouble");
}
Exemplo n.º 10
0
/*
==============
=
= SCRIPT_PutRaw
=
==============
*/
void SCRIPT_PutRaw
   (
   int32 scripthandle,
   uint8_t  * sectionname,
   uint8_t  * entryname,
   uint8_t  * raw
   )
{
	STUBBED("PutRaw");
}
Exemplo n.º 11
0
/*
==============
=
= SCRIPT_GetBoolean
=
==============
*/
void SCRIPT_GetBoolean
   (
   int32 scripthandle,
   uint8_t  * sectionname,
   uint8_t  * entryname,
   boolean * b
   )
{
	STUBBED("GetBoolean");
}
Exemplo n.º 12
0
void FIntroTutorials::HandleCompilerNotFound()
{
#if PLATFORM_WINDOWS
	LaunchTutorialByName( TEXT( "Engine/Tutorial/Installation/InstallingVisualStudioTutorial.InstallingVisualStudioTutorial" ) );
#elif PLATFORM_MAC
	LaunchTutorialByName( TEXT( "Engine/Tutorial/Installation/InstallingXCodeTutorial.InstallingXCodeTutorial" ) );
#else
	STUBBED("FIntroTutorials::HandleCompilerNotFound");
#endif
}
Exemplo n.º 13
0
/*
==============
=
= SCRIPT_PutMultiComment
=
==============
*/
void SCRIPT_PutMultiComment
   (
   int32 scripthandle,
   uint8_t  * sectionname,
   uint8_t  * comment,
   ...
   )
{
	STUBBED("PutMultiComment");
}
Exemplo n.º 14
0
void SCRIPT_PutDouble
   (
   int32 scripthandle,
   uint8_t  * sectionname,
   uint8_t  * entryname,
   double number,
   boolean defaultvalue
   )
{
	STUBBED("PutDouble");
}
Exemplo n.º 15
0
bool FLinuxTargetDevice::Run( const FString& ExecutablePath, const FString& Params, uint32* OutProcessId )
{
#if PLATFORM_LINUX	// if running natively, support simplified, local deployment	
	FProcHandle ProcessHandle = FPlatformProcess::CreateProc(*ExecutablePath, *Params, true, false, false, OutProcessId, 0, NULL, NULL);
	return ProcessHandle.Close();
#else
	// @todo: support remote run
	STUBBED("FLinuxTargetDevice::Run");
	return false;
#endif // PLATFORM_LINUX
}
Exemplo n.º 16
0
void FLinuxPlatformProcess::TerminateProc( FProcHandle & ProcessHandle, bool KillTree )
{
	if (KillTree)
	{
		// TODO: enumerate the children
		STUBBED("FLinuxPlatformProcess::TerminateProc() : Killing a subtree is not implemented yet");
	}

	int KillResult = kill(ProcessHandle.Get(), SIGTERM);	// graceful
	check(KillResult != -1 || errno != EINVAL);
}
Exemplo n.º 17
0
static std::unique_ptr<Connection> createConnection(const netadr_t &to) {
	assert(wsState);

	char addrBuf[3 * 4 + 5];
	snprintf(addrBuf, sizeof(addrBuf), "%u.%u.%u.%u", to.ip[0], to.ip[1], to.ip[2], to.ip[3]);
	struct libwebsocket *newWsi = libwebsocket_client_connect(wsState->websocketContext, addrBuf, ntohs(to.port), 0, "/", addrBuf, addrBuf, "quake2", -1);
	if (newWsi == NULL) {
		STUBBED("TODO: log connection create failure");
		return std::unique_ptr<Connection>();
	}
	libwebsocket_callback_on_writable(wsState->websocketContext, newWsi);

	STUBBED("TODO: unnecessary(?) libwebsocket_service");
	libwebsocket_service(wsState->websocketContext, 0);

	std::unique_ptr<Connection> conn(new Connection(to, newWsi));

	wsState->wsiLookup.emplace(newWsi, conn.get());

	return conn;
}
Exemplo n.º 18
0
bool Connection::sendPacket(const char *data, size_t length) {
	assert(socket > 0);
	assert(readyState == Open);

	STUBBED("TODO: allocate from sendBuf from heap, keep permanently"); // connection-specific?
	char sendBuf[2 + length];
	assert(length < 16384);
	uint16_t l16 = length;
	memcpy(&sendBuf[0], &l16, 2);
	memcpy(&sendBuf[2], data, length);

	return (q2wsSend(socket, &sendBuf[0], length + 2) >= 0);
}
Exemplo n.º 19
0
static void websocketShutdown() {
	assert(wsState);

	wsState->connections.clear();

	// destroying all the connections must have cleared these
	assert(wsState->socketLookup.empty());
	assert(wsState->pendingData.empty());

	STUBBED("clean up javascript side");

	delete wsState;
	wsState = NULL;
}
bool FKDevelopSourceCodeAccessor::OpenFileAtLine(const FString& FullPath, int32 LineNumber, int32 ColumnNumber)
{
	// column & line numbers are 1-based, so dont allow zero
	if(LineNumber == 0)
	{
		LineNumber++;
	}
	if(ColumnNumber == 0)
{
		ColumnNumber++;
	}

	// Automatically fail if there's already an attempt in progress
	if (IsIDERunning())
	{
		// use qdbus
		STUBBED("OpenFileAtLine: KDevelop is running, use qdbus");
		return false;
	}

	STUBBED("FKDevelopSourceCodeAccessor::OpenFileAtLine");
	return false;
}
Exemplo n.º 21
0
/// This is tricky as we use our screen as both input and output
void PostAAPreRenderOperator::execute(const Camera& camera, GFX::CommandBuffer& bufferInOut) {
    STUBBED("ToDo: Move PostAA to compute shaders to avoid a blit and RT swap. -Ionut");
    RenderTargetHandle ldrTarget = _parent.outputRT();

    PipelineDescriptor pipelineDescriptor;
    pipelineDescriptor._stateHash = _context.get2DStateBlock();
    pipelineDescriptor._shaderProgramHandle = (_useSMAA ? _smaa : _fxaa)->getID();

    GFX::BindPipelineCommand pipelineCmd;
    pipelineCmd._pipeline = _context.newPipeline(pipelineDescriptor);
    GFX::EnqueueCommand(bufferInOut, pipelineCmd);

    GFX::BlitRenderTargetCommand blitRTCommand;
    blitRTCommand._source = ldrTarget._targetID;
    blitRTCommand._destination = _samplerCopy._targetID;
    blitRTCommand._blitColours.emplace_back();
    GFX::EnqueueCommand(bufferInOut, blitRTCommand);

    TextureData data0 = _samplerCopy._rt->getAttachment(RTAttachmentType::Colour, 0).texture()->getData();
    GFX::BindDescriptorSetsCommand descriptorSetCmd;
    descriptorSetCmd._set._textureData.setTexture(data0, to_U8(ShaderProgram::TextureUsage::UNIT0));
    GFX::EnqueueCommand(bufferInOut, descriptorSetCmd);

    // Apply FXAA/SMAA to the specified render target
    GFX::BeginRenderPassCommand beginRenderPassCmd;
    beginRenderPassCmd._target = ldrTarget._targetID;
    beginRenderPassCmd._name = "DO_POSTAA_PASS";
    GFX::EnqueueCommand(bufferInOut, beginRenderPassCmd);

    GenericDrawCommand pointsCmd;
    pointsCmd._primitiveType = PrimitiveType::API_POINTS;
    pointsCmd._drawCount = 1;

    GFX::SendPushConstantsCommand pushConstantsCommand;
    pushConstantsCommand._constants = _fxaaConstants;
    GFX::EnqueueCommand(bufferInOut, pushConstantsCommand);

    GFX::DrawCommand drawCmd;
    drawCmd._drawCommands.push_back(pointsCmd);
    GFX::EnqueueCommand(bufferInOut, drawCmd);

    GFX::EndRenderPassCommand endRenderPassCmd;
    GFX::EnqueueCommand(bufferInOut, endRenderPassCmd);
}
Exemplo n.º 22
0
bool Connection::sendPacket(const char *data, size_t length) {
	assert(wsi);
	assert(readyState == Open);
	assert(length < 16384);
	uint16_t l16 = length;
	memcpy(&sendBuf[LWS_SEND_BUFFER_PRE_PADDING], &l16, 2);
	memcpy(&sendBuf[LWS_SEND_BUFFER_PRE_PADDING + 2], data, length);

	// TODO: too many calls to libwebsocket_service here
	libwebsocket_service(wsState->websocketContext, 0);

	if (!writable) {
		// track socket writable status, only write when would not block
	// TODO: buffer or drop?
		return false;
	}

	int retval = libwebsocket_write(wsi, &sendBuf[LWS_SEND_BUFFER_PRE_PADDING], length + 2, LWS_WRITE_BINARY);
	if (retval < 0) {
		return false;
	}

	writable = false;
	libwebsocket_callback_on_writable(wsState->websocketContext, wsi);

	libwebsocket_service(wsState->websocketContext, 0);

	if (retval < length) {
		// partial send
		// TODO: handle this better, try to resend rest later
		STUBBED("resend");
		return false;
	}

	return true;
}
bool FLinuxTargetDevice::Reboot( bool bReconnect)
{
	STUBBED("FLinuxTargetDevice::Reboot");
	return false;
}
int32 FLinuxTargetDevice::GetProcessSnapshot( TArray<FTargetDeviceProcessInfo>& OutProcessInfos )
{
	STUBBED("FLinuxTargetDevice::GetProcessSnapshot");
	return 0;
}
Exemplo n.º 25
0
void FSourceControlModule::ShowLoginDialog(const FSourceControlLoginClosed& InOnSourceControlLoginClosed, ELoginWindowMode::Type InLoginWindowMode, EOnLoginWindowStartup::Type InOnLoginWindowStartup)
{
#if SOURCE_CONTROL_WITH_SLATE
	// Get Active Provider Name
	ActiveProviderName = GetProvider().GetName().ToString();

	// if we are showing a modal version of the dialog & a modeless version already exists, we must destroy the modeless dialog first
	if(InLoginWindowMode == ELoginWindowMode::Modal && SourceControlLoginPtr.IsValid())
	{
		// unhook the delegate so it doesn't fire in this case
		SourceControlLoginWindowPtr->SetOnWindowClosed(FOnWindowClosed());
		SourceControlLoginWindowPtr->RequestDestroyWindow();
		SourceControlLoginWindowPtr = NULL;
		SourceControlLoginPtr = NULL;
	}

	if(SourceControlLoginWindowPtr.IsValid())
	{
		SourceControlLoginWindowPtr->BringToFront();
	}
	else
	{
		// set provider to 'none'.
		// When we open the window, we turn off the fact that source control is available, this solves issues that are present with
		// being a three state modeless system (Accepted settings, disabled, and not yet decided).
		if(InOnLoginWindowStartup == EOnLoginWindowStartup::ResetProviderToNone)
		{
			SetProvider("None");
		}

		// temporarily disable access to source control features
		bTemporarilyDisabled = true;

		// Create the window
		SourceControlLoginWindowPtr = SNew(SWindow)
			.Title( LOCTEXT("SourceControlLoginTitle", "Source Control Login") )
			.HasCloseButton(false)
			.SupportsMaximize(false) 
			.SupportsMinimize(false)
			.SizingRule( ESizingRule::Autosized );

		// Set the closed callback
		SourceControlLoginWindowPtr->SetOnWindowClosed(FOnWindowClosed::CreateRaw(this, &FSourceControlModule::OnSourceControlDialogClosed));

		// Setup the content for the created login window.
		SourceControlLoginWindowPtr->SetContent(
			SNew(SBox)
			.WidthOverride(700.0f)
			[
				SAssignNew(SourceControlLoginPtr, SSourceControlLogin)
				.ParentWindow(SourceControlLoginWindowPtr)
				.OnSourceControlLoginClosed(InOnSourceControlLoginClosed)
			]
			);

		TSharedPtr<SWindow> RootWindow = FGlobalTabmanager::Get()->GetRootWindow();
		if(RootWindow.IsValid())
		{
			if(InLoginWindowMode == ELoginWindowMode::Modal)
			{
				FSlateApplication::Get().AddModalWindow(SourceControlLoginWindowPtr.ToSharedRef(), RootWindow);
			}
			else
			{
				FSlateApplication::Get().AddWindowAsNativeChild(SourceControlLoginWindowPtr.ToSharedRef(), RootWindow.ToSharedRef());
			}
		}
		else
		{
			if(InLoginWindowMode == ELoginWindowMode::Modal)
			{
				FSlateApplication::Get().AddModalWindow(SourceControlLoginWindowPtr.ToSharedRef(), RootWindow);
			}
			else
			{
				FSlateApplication::Get().AddWindow(SourceControlLoginWindowPtr.ToSharedRef());
			}
		}
	}
#else
	STUBBED("FSourceControlModule::ShowLoginDialog - no Slate");
#endif // SOURCE_CONTROL_WITH_SLATE
}
bool FKDevelopSourceCodeAccessor::IsIDERunning()
{
	// FIXME: implement
	STUBBED("FKDevelopSourceCodeAccessor::IsIDERunning");
	return false;
}
void FLinuxTargetDevice::SetUserCredentials( const FString& InUserName, const FString& InUserPassword )
{
	STUBBED("FLinuxTargetDevice::SetUserCredentials");
	UserName = InUserName;
	UserPassword = InUserPassword;
}
bool FLinuxTargetDevice::SupportsSdkVersion( const FString& VersionString ) const
{
	STUBBED("FLinuxTargetDevice::SupportsSdkVersion");
	return true;
}
bool FKDevelopSourceCodeAccessor::SaveAllOpenDocuments() const
{
	STUBBED("FKDevelopSourceCodeAccessor::SaveAllOpenDocuments");
	return false;
}
bool FKDevelopSourceCodeAccessor::OpenSolution()
{
	if (IsIDERunning())
	{
		// use qdbus to open the project within session?
		STUBBED("OpenSolution: KDevelop is running, use qdbus to open the project within session?");
		return false;
	}

	FString Solution = GetSolutionPath();
	FString IDEPath;
	if (!CanRunKDevelop(IDEPath))
	{
		UE_LOG(LogKDevelopAccessor, Warning, TEXT("FKDevelopSourceCodeAccessor::OpenSourceFiles: cannot find kdevelop binary"));
		return false;
	}
	
	FProcHandle Proc = FPlatformProcess::CreateProc(*IDEPath, *Solution, true, false, false, nullptr, 0, nullptr, nullptr);
	if (Proc.IsValid())
	{
		FPlatformProcess::CloseProc(Proc);
		return true;
	}
	return false;
}