RuntimeMeshComponentEditorStyle.cpp
Go to the documentation of this file.
1 // Copyright 1998-2017 Epic Games, Inc. All Rights Reserved.
2 
4 #include "Framework/Application/SlateApplication.h"
5 #include "Styling/SlateStyleRegistry.h"
6 #include "SlateGameResources.h"
7 #include "IPluginManager.h"
8 
9 TSharedPtr< FSlateStyleSet > FRuntimeMeshComponentEditorStyle::StyleInstance = NULL;
10 
12 {
13  if (!StyleInstance.IsValid())
14  {
16  FSlateStyleRegistry::RegisterSlateStyle(*StyleInstance);
17  }
18 }
19 
21 {
22  FSlateStyleRegistry::UnRegisterSlateStyle(*StyleInstance);
23  ensure(StyleInstance.IsUnique());
24  StyleInstance.Reset();
25 }
26 
28 {
29  static FName StyleSetName(TEXT("RuntimeMeshComponentEditorStyle"));
30  return StyleSetName;
31 }
32 
33 #define IMAGE_BRUSH( RelativePath, ... ) FSlateImageBrush( Style->RootToContentDir( RelativePath, TEXT(".png") ), __VA_ARGS__ )
34 #define BOX_BRUSH( RelativePath, ... ) FSlateBoxBrush( Style->RootToContentDir( RelativePath, TEXT(".png") ), __VA_ARGS__ )
35 #define BORDER_BRUSH( RelativePath, ... ) FSlateBorderBrush( Style->RootToContentDir( RelativePath, TEXT(".png") ), __VA_ARGS__ )
36 #define TTF_FONT( RelativePath, ... ) FSlateFontInfo( Style->RootToContentDir( RelativePath, TEXT(".ttf") ), __VA_ARGS__ )
37 #define OTF_FONT( RelativePath, ... ) FSlateFontInfo( Style->RootToContentDir( RelativePath, TEXT(".otf") ), __VA_ARGS__ )
38 
39 const FVector2D Icon128x128(128.0f, 128.0f);
40 
41 TSharedRef< FSlateStyleSet > FRuntimeMeshComponentEditorStyle::Create()
42 {
43  TSharedRef< FSlateStyleSet > Style = MakeShareable(new FSlateStyleSet("RuntimeMeshComponentEditorStyle"));
44  Style->SetContentRoot(IPluginManager::Get().FindPlugin("RuntimeMeshComponent")->GetBaseDir() / TEXT("Resources"));
45 
46  Style->Set("RuntimeMeshComponentEditor.PluginAction", new IMAGE_BRUSH(TEXT("Icon128"), Icon128x128));
47 
48  return Style;
49 }
50 
51 #undef IMAGE_BRUSH
52 #undef BOX_BRUSH
53 #undef BORDER_BRUSH
54 #undef TTF_FONT
55 #undef OTF_FONT
56 
58 {
59  if (FSlateApplication::IsInitialized())
60  {
61  FSlateApplication::Get().GetRenderer()->ReloadTextureResources();
62  }
63 }
64 
66 {
67  return *StyleInstance;
68 }
#define IMAGE_BRUSH(RelativePath,...)
const FVector2D Icon128x128(128.0f, 128.0f)
GLdouble f
static TSharedPtr< class FSlateStyleSet > StyleInstance
UTexture2D * Get(TUniquePtr< T > &Dtex)
static TSharedRef< class FSlateStyleSet > Create()
#define NULL
Definition: tinycthread.c:47


librealsense2
Author(s): Sergey Dorodnicov , Doron Hirshberg , Mark Horn , Reagan Lopez , Itay Carpis
autogenerated on Mon May 3 2021 02:47:41