From 8017e695c8ec0dffcb323ef8fd679342f848a0a3 Mon Sep 17 00:00:00 2001 From: getnamo Date: Sat, 10 Nov 2018 03:24:10 -0800 Subject: [PATCH] update for 4.21 - compile fixes mostly to do with IWYU --- BLUI.uplugin | 2 +- Source/Blu/Blu.Build.cs | 4 +- Source/Blu/Private/BluEye.cpp | 1 + Source/Blu/Private/BluJsonObj.cpp | 1 + Source/Blu/Private/BluManager.cpp | 1 + Source/Blu/Private/RenderHandler.cpp | 4 +- Source/Blu/Public/BluEye.h | 131 ++++++++++++++------------- Source/Blu/Public/BluManager.h | 1 + Source/Blu/Public/RenderHandler.h | 3 +- Source/BluLoader/BluLoader.Build.cs | 3 + 10 files changed, 81 insertions(+), 70 deletions(-) diff --git a/BLUI.uplugin b/BLUI.uplugin index b0e1861..b576afc 100644 --- a/BLUI.uplugin +++ b/BLUI.uplugin @@ -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", diff --git a/Source/Blu/Blu.Build.cs b/Source/Blu/Blu.Build.cs index b8d9112..818dab6 100644 --- a/Source/Blu/Blu.Build.cs +++ b/Source/Blu/Blu.Build.cs @@ -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[] diff --git a/Source/Blu/Private/BluEye.cpp b/Source/Blu/Private/BluEye.cpp index 8085120..9352c1d 100644 --- a/Source/Blu/Private/BluEye.cpp +++ b/Source/Blu/Private/BluEye.cpp @@ -1,3 +1,4 @@ +#include "BluEye.h" #include "BluPrivatePCH.h" #include "RenderHandler.h" diff --git a/Source/Blu/Private/BluJsonObj.cpp b/Source/Blu/Private/BluJsonObj.cpp index dc56735..323926f 100644 --- a/Source/Blu/Private/BluJsonObj.cpp +++ b/Source/Blu/Private/BluJsonObj.cpp @@ -1,3 +1,4 @@ +#include "BluJsonObj.h" #include "BluPrivatePCH.h" #include "Json.h" diff --git a/Source/Blu/Private/BluManager.cpp b/Source/Blu/Private/BluManager.cpp index 78ac561..cf022b9 100644 --- a/Source/Blu/Private/BluManager.cpp +++ b/Source/Blu/Private/BluManager.cpp @@ -1,3 +1,4 @@ +#include "BluManager.h" #include "BluPrivatePCH.h" BluManager::BluManager() diff --git a/Source/Blu/Private/RenderHandler.cpp b/Source/Blu/Private/RenderHandler.cpp index 1041417..a3a5b2c 100644 --- a/Source/Blu/Private/RenderHandler.cpp +++ b/Source/Blu/Private/RenderHandler.cpp @@ -1,4 +1,6 @@ +#include "RenderHandler.h" #include "BluPrivatePCH.h" +#include "BluEye.h" RenderHandler::RenderHandler(int32 width, int32 height, UBluEye* ui) { @@ -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/")); } diff --git a/Source/Blu/Public/BluEye.h b/Source/Blu/Public/BluEye.h index 9d1222f..1703419 100644 --- a/Source/Blu/Public/BluEye.h +++ b/Source/Blu/Public/BluEye.h @@ -1,4 +1,5 @@ #pragma once +#include "BluManager.h" #include "BluEye.generated.h" class BrowserClient; @@ -6,12 +7,11 @@ 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 @@ -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, @@ -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. @@ -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 params); + void ExecuteJSMethodWithParams(const FString& methodName, const TArray 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, @@ -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, @@ -234,31 +234,31 @@ 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 browser; @@ -266,33 +266,34 @@ class BLU_API UBluEye : public UObject void BeginDestroy() override; - protected: - CefWindowInfo info; - CefRefPtr g_handler; - CefBrowserSettings browserSettings; - RenderHandler* renderer; +protected: + + CefWindowInfo info; + CefRefPtr 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; }; diff --git a/Source/Blu/Public/BluManager.h b/Source/Blu/Public/BluManager.h index 72f85f2..5952bf9 100644 --- a/Source/Blu/Public/BluManager.h +++ b/Source/Blu/Public/BluManager.h @@ -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 diff --git a/Source/Blu/Public/RenderHandler.h b/Source/Blu/Public/RenderHandler.h index 85009bf..a64940e 100644 --- a/Source/Blu/Public/RenderHandler.h +++ b/Source/Blu/Public/RenderHandler.h @@ -17,8 +17,7 @@ THIRD_PARTY_INCLUDES_END #include "HideWindowsPlatformTypes.h" #endif -#include "../Public/BluEye.h" - +#include "BluEye.h" class RenderHandler : public CefRenderHandler { diff --git a/Source/BluLoader/BluLoader.Build.cs b/Source/BluLoader/BluLoader.Build.cs index f7df2b2..27b66c8 100644 --- a/Source/BluLoader/BluLoader.Build.cs +++ b/Source/BluLoader/BluLoader.Build.cs @@ -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[] {