Skip to content

Commit

Permalink
update for 4.21
Browse files Browse the repository at this point in the history
- compile fixes mostly to do with IWYU
  • Loading branch information
getnamo committed Nov 10, 2018
1 parent 14e55f8 commit 8017e69
Show file tree
Hide file tree
Showing 10 changed files with 81 additions and 70 deletions.
2 changes: 1 addition & 1 deletion BLUI.uplugin
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"FileVersion": 3,
"FriendlyName": "BLUI",
"Version": 3,
"VersionName": "3.2.6",
"VersionName": "3.3.0",
"Description": "Chromium Embedded Framework (CEF) powered HTML UI and HUD for Unreal Engine 4",
"Category": "UI",
"CreatedBy": "Aaron M. Shea & Contributors",
Expand Down
4 changes: 3 additions & 1 deletion Source/Blu/Blu.Build.cs
Original file line number Diff line number Diff line change
Expand Up @@ -15,12 +15,14 @@ private void stageFiles(String[] filesToStage)
{
foreach (var f in filesToStage)
{
RuntimeDependencies.Add(new RuntimeDependency(f));
RuntimeDependencies.Add(f);
}
}

public Blu(ReadOnlyTargetRules Target) : base(Target)
{
PCHUsage = PCHUsageMode.UseExplicitOrSharedPCHs;
PrivatePCHHeaderFile = "Private/BluPrivatePCH.h";

PublicDependencyModuleNames.AddRange(
new string[]
Expand Down
1 change: 1 addition & 0 deletions Source/Blu/Private/BluEye.cpp
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
#include "BluEye.h"
#include "BluPrivatePCH.h"
#include "RenderHandler.h"

Expand Down
1 change: 1 addition & 0 deletions Source/Blu/Private/BluJsonObj.cpp
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
#include "BluJsonObj.h"
#include "BluPrivatePCH.h"
#include "Json.h"

Expand Down
1 change: 1 addition & 0 deletions Source/Blu/Private/BluManager.cpp
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
#include "BluManager.h"
#include "BluPrivatePCH.h"

BluManager::BluManager()
Expand Down
4 changes: 3 additions & 1 deletion Source/Blu/Private/RenderHandler.cpp
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
#include "RenderHandler.h"
#include "BluPrivatePCH.h"
#include "BluEye.h"

RenderHandler::RenderHandler(int32 width, int32 height, UBluEye* ui)
{
Expand Down Expand Up @@ -89,7 +91,7 @@ FString ReversePathSlashes(FString forwardPath)
}
FString UtilityBLUIDownloadsFolder()
{
return ReversePathSlashes(FPaths::ConvertRelativePathToFull(FPaths::GameDir() + "Plugins/BLUI/Downloads/"));
return ReversePathSlashes(FPaths::ConvertRelativePathToFull(FPaths::ProjectDir() + "Plugins/BLUI/Downloads/"));
}


Expand Down
131 changes: 66 additions & 65 deletions Source/Blu/Public/BluEye.h
Original file line number Diff line number Diff line change
@@ -1,17 +1,17 @@
#pragma once
#include "BluManager.h"
#include "BluEye.generated.h"

class BrowserClient;
class RenderHandler;

DECLARE_DYNAMIC_MULTICAST_DELEGATE_TwoParams(FScriptEvent, const FString&, EventName, const FString&, EventMessage);


struct FBluTextureParams
{

// Pointer to our Texture's resource
FTexture2DResource* Texture2DResource;

};

struct FUpdateTextureRegionsData
Expand Down Expand Up @@ -61,50 +61,50 @@ class BLU_API UBluEye : public UObject

//Event delegates
UPROPERTY(BlueprintAssignable, Category = "Blu Browser Events")
FDownloadCompleteSignature DownloadComplete;
FDownloadCompleteSignature DownloadComplete;

UPROPERTY(BlueprintAssignable, Category = "Blu Browser Events")
FDownloadUpdatedSignature DownloadUpdated;
FDownloadUpdatedSignature DownloadUpdated;

//GENERATED_UCLASS_BODY()

/** Initialize function, should be called after properties are set */
UFUNCTION(BlueprintCallable, Category = "Blu")
void init();
void init();

/** The default URL this UI component will load */
UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "Blu")
FString DefaultURL;
FString DefaultURL;

/** Is this UI component current active? */
UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "Blu")
bool bEnabled;
bool bEnabled;

/** Should this be rendered in game to be transparent? */
UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "Blu")
bool bIsTransparent;
bool bIsTransparent;

/** Width of the view resolution */
UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "Blu")
int32 Width;
int32 Width;

/** Height of the view resolution */
UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "Blu")
int32 Height;
int32 Height;

UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "Blu")
bool bEnableWebGL;
bool bEnableWebGL;

/** Material that will be instanced to load UI texture into it */
UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "Blu")
UMaterialInterface* BaseMaterial;
UMaterialInterface* BaseMaterial;

/** Name of parameter to load UI texture into material */
UPROPERTY(EditAnywhere, BlueprintReadOnly, Category = "Blu")
FName TextureParameterName = "BluTexture";
FName TextureParameterName = "BluTexture";

UFUNCTION(BlueprintCallable, Category = "Blu")
UBluEye* SetProperties(const int32 SetWidth,
UBluEye* SetProperties(const int32 SetWidth,
const int32 SetHeight,
const bool SetIsTransparent,
const bool SetEnabled,
Expand All @@ -115,11 +115,11 @@ class BLU_API UBluEye : public UObject

/** Get the texture data from our UI component */
UFUNCTION(BlueprintCallable, Category = "Blu")
UTexture2D* GetTexture() const;
UTexture2D* GetTexture() const;

/** Execute JS code inside the browser */
UFUNCTION(BlueprintCallable, Category = "Blu")
void ExecuteJS(const FString& code);
void ExecuteJS(const FString& code);

/**
* Execute a JS function/method by name with FString Array as params.
Expand All @@ -129,87 +129,87 @@ class BLU_API UBluEye : public UObject
* To pass as a string, place quotes around the param when adding to the array: "10.5" and "hello" are strings
*/
UFUNCTION(BlueprintCallable, Category = "Blu", meta = (DisplayName = "Execute Javascript With Params", Keywords = "js javascript parameters"))
void ExecuteJSMethodWithParams(const FString& methodName, const TArray<FString> params);
void ExecuteJSMethodWithParams(const FString& methodName, const TArray<FString> params);

/** Load a new URL into the browser */
UFUNCTION(BlueprintCallable, Category = "Blu")
void LoadURL(const FString& newURL);
void LoadURL(const FString& newURL);

/** Get the currently loaded URL */
UFUNCTION(BlueprintPure, Category = "Blu")
FString GetCurrentURL();
FString GetCurrentURL();

/** Trigger Zoom */
UFUNCTION(BlueprintCallable, Category = "Blu")
void SetZoom(const float scale = 1);
void SetZoom(const float scale = 1);

/** Get our zoom level */
UFUNCTION(BlueprintPure, Category = "Blu")
float GetZoom();
float GetZoom();

//Not ready yet
//UFUNCTION(BlueprintCallable, Category = "Blu Test")
void Test();
void Test();

/** Download a file */
UFUNCTION(BlueprintCallable, Category = "Blu")
void DownloadFile(const FString& fileUrl);
void DownloadFile(const FString& fileUrl);

/** Trigger a LEFT click in the browser via a Vector2D */
UFUNCTION(BlueprintCallable, Category = "Blu")
void TriggerLeftClick(const FVector2D& pos, const float scale = 1);
void TriggerLeftClick(const FVector2D& pos, const float scale = 1);

/** Trigger a RIGHT click in the browser via a Vector2D */
UFUNCTION(BlueprintCallable, Category = "Blu")
void TriggerRightClick(const FVector2D& pos, const float scale = 1);
void TriggerRightClick(const FVector2D& pos, const float scale = 1);

/** Trigger a LEFT MOUSE DOWN in the browser via a Vector2D */
UFUNCTION(BlueprintCallable, Category = "Blu")
void TriggerLeftMouseDown(const FVector2D& pos, const float scale = 1);
void TriggerLeftMouseDown(const FVector2D& pos, const float scale = 1);

/** Trigger a RIGHT MOUSE DOWN in the browser via a Vector2D */
UFUNCTION(BlueprintCallable, Category = "Blu")
void TriggerRightMouseDown(const FVector2D& pos, const float scale = 1);
void TriggerRightMouseDown(const FVector2D& pos, const float scale = 1);

/** Trigger a LEFT MOUSE UP in the browser via a Vector2D */
UFUNCTION(BlueprintCallable, Category = "Blu")
void TriggerLeftMouseUp(const FVector2D& pos, const float scale = 1);
void TriggerLeftMouseUp(const FVector2D& pos, const float scale = 1);

/* Trigger a RIGHT MOUSE UP in the browser via a Vector2D */
UFUNCTION(BlueprintCallable, Category = "Blu")
void TriggerRightMouseUp(const FVector2D& pos, const float scale = 1);
void TriggerRightMouseUp(const FVector2D& pos, const float scale = 1);

/** Move the mouse in the browser */
UFUNCTION(BlueprintCallable, Category = "Blu")
void TriggerMouseMove(const FVector2D& pos, const float scale = 1);
void TriggerMouseMove(const FVector2D& pos, const float scale = 1);

/** Move the mouse in the browser */
UFUNCTION(BlueprintCallable, Category = "Blu")
void TriggerMouseWheel(const float MouseWheelDelta, const FVector2D& pos, const float scale = 1);
void TriggerMouseWheel(const float MouseWheelDelta, const FVector2D& pos, const float scale = 1);

/** Javascript event emitter */
UPROPERTY(BlueprintAssignable)
FScriptEvent ScriptEventEmitter;
FScriptEvent ScriptEventEmitter;

/** Trigger a key down event */
UFUNCTION(BlueprintCallable, Category = "Blu")
void KeyDown(FKeyEvent InKey);
void KeyDown(FKeyEvent InKey);

/** Trigger a key up event */
UFUNCTION(BlueprintCallable, Category = "Blu")
void KeyUp(FKeyEvent InKey);
void KeyUp(FKeyEvent InKey);

/** Trigger a key press event */
UFUNCTION(BlueprintCallable, Category = "Blu")
void KeyPress(FKeyEvent InKey);
void KeyPress(FKeyEvent InKey);

/** Trigger a character key event */
UFUNCTION(BlueprintCallable, Category = "Blu")
void CharKeyPress(FCharacterEvent CharEvent);
void CharKeyPress(FCharacterEvent CharEvent);

/** Trigger a raw keypress via a character */
UFUNCTION(BlueprintCallable, Category = "Blu", meta = (AdvancedDisplay = "2"))
void RawCharKeyPress(const FString charToPress, bool isRepeat,
void RawCharKeyPress(const FString charToPress, bool isRepeat,
bool LeftShiftDown,
bool RightShiftDown,
bool LeftControlDown,
Expand All @@ -221,7 +221,7 @@ class BLU_API UBluEye : public UObject
bool CapsLocksOn);

UFUNCTION(BlueprintCallable, Category = "Blu", meta = (AdvancedDisplay = "2"))
void SpecialKeyPress(EBluSpecialKeys key,
void SpecialKeyPress(EBluSpecialKeys key,
bool LeftShiftDown,
bool RightShiftDown,
bool LeftControlDown,
Expand All @@ -234,65 +234,66 @@ class BLU_API UBluEye : public UObject

/** Close the browser */
UFUNCTION(BlueprintCallable, Category = "Blu")
void CloseBrowser();
void CloseBrowser();

/** Check if the browser is still loading */
UFUNCTION(BlueprintCallable, Category = "Blu")
bool IsBrowserLoading();
bool IsBrowserLoading();

/** Reloads the browser's current page */
UFUNCTION(BlueprintCallable, Category = "Blu")
void ReloadBrowser(bool IgnoreCache);
void ReloadBrowser(bool IgnoreCache);

/** Navigate back in this web view's history */
UFUNCTION(BlueprintCallable, Category = "Blu")
void NavBack();
void NavBack();

/** Navigate forward in this web view's history */
UFUNCTION(BlueprintCallable, Category = "Blu")
void NavForward();
void NavForward();

/** Resize the browser's viewport */
UFUNCTION(BlueprintCallable, Category = "Blu")
UTexture2D* ResizeBrowser(const int32 NewWidth, const int32 NewHeight);
UTexture2D* ResizeBrowser(const int32 NewWidth, const int32 NewHeight);

//This cropping function doesn't work atm
//UFUNCTION(BlueprintCallable, Category = "Blu")
UTexture2D* CropWindow(const int32 Y, const int32 X, const int32 NewWidth, const int32 NewHeight);
UTexture2D* CropWindow(const int32 Y, const int32 X, const int32 NewWidth, const int32 NewHeight);

CefRefPtr<CefBrowser> browser;

void TextureUpdate(const void* buffer, FUpdateTextureRegion2D * updateRegions, uint32 regionCount);

void BeginDestroy() override;

protected:
CefWindowInfo info;
CefRefPtr<BrowserClient> g_handler;
CefBrowserSettings browserSettings;
RenderHandler* renderer;
protected:

CefWindowInfo info;
CefRefPtr<BrowserClient> g_handler;
CefBrowserSettings browserSettings;
RenderHandler* renderer;

void ResetTexture();
void DestroyTexture();
void ResetMatInstance();
void ResetTexture();
void DestroyTexture();
void ResetMatInstance();

// Parse UE4 key events, helper
void processKeyCode(FKeyEvent InKey);
// Parse UE4 key events, helper
void processKeyCode(FKeyEvent InKey);

// Helper for processing key modifiers
void processKeyMods(FInputEvent InKey);
// Helper for processing key modifiers
void processKeyMods(FInputEvent InKey);

// Store UI state in this UTexture2D
UPROPERTY()
UTexture2D* Texture;
// Store UI state in this UTexture2D
UPROPERTY()
UTexture2D* Texture;

UMaterialInstanceDynamic* MaterialInstance;
UMaterialInstanceDynamic* MaterialInstance;

CefMouseEvent mouse_event;
CefKeyEvent key_event;
CefMouseEvent mouse_event;
CefKeyEvent key_event;

private:
private:

FBluTextureParams RenderParams;
FBluTextureParams RenderParams;

};
1 change: 1 addition & 0 deletions Source/Blu/Public/BluManager.h
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
#undef OVERRIDE // cef headers provide their own OVERRIDE macro
THIRD_PARTY_INCLUDES_START
#include "include/cef_app.h"
#include "include/cef_browser.h"
THIRD_PARTY_INCLUDES_END
#pragma pop_macro("OVERRIDE")
#if PLATFORM_WINDOWS
Expand Down
3 changes: 1 addition & 2 deletions Source/Blu/Public/RenderHandler.h
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,7 @@ THIRD_PARTY_INCLUDES_END
#include "HideWindowsPlatformTypes.h"
#endif

#include "../Public/BluEye.h"

#include "BluEye.h"

class RenderHandler : public CefRenderHandler
{
Expand Down
3 changes: 3 additions & 0 deletions Source/BluLoader/BluLoader.Build.cs
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,9 @@ public class BluLoader : ModuleRules
{
public BluLoader(ReadOnlyTargetRules Target) : base(Target)
{
PCHUsage = PCHUsageMode.UseExplicitOrSharedPCHs;
PrivatePCHHeaderFile = "Private/BluLoaderPrivatePCH.h";

PublicDependencyModuleNames.AddRange(
new string[]
{
Expand Down

0 comments on commit 8017e69

Please sign in to comment.