Skip to content

Commit

Permalink
Eliminated HAS_UI from UI library
Browse files Browse the repository at this point in the history
- HAS_UI is defined in .project file, and used only for Win32/Win64 platforms
- HAS_UI no longer appears in UI library, it's external define
  • Loading branch information
gildor2 committed Dec 10, 2019
1 parent d038599 commit 3d98f13
Show file tree
Hide file tree
Showing 19 changed files with 19 additions and 56 deletions.
1 change: 0 additions & 1 deletion Core/Core.h
Original file line number Diff line number Diff line change
Expand Up @@ -149,7 +149,6 @@ typedef unsigned __int64 uint64;
# define FORMAT_SIZE(fmt) "%z" fmt
# undef VSTUDIO_INTEGRATION
# undef WIN32_USE_SEH
# undef HAS_UI // not yet supported on this platform

typedef signed long long int64;
typedef unsigned long long uint64;
Expand Down
1 change: 0 additions & 1 deletion Tools/UITest/Build.h
Original file line number Diff line number Diff line change
@@ -1,2 +1 @@
#define HAS_UI 1
#define MAX_DEBUG 1
5 changes: 0 additions & 5 deletions UI/BaseDialog.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -53,8 +53,6 @@
*/


#if HAS_UI

//#define DEBUG_WINDOWS_ERRORS MAX_DEBUG
//#define DEBUG_MULTILIST_SEL 1

Expand Down Expand Up @@ -3752,6 +3750,3 @@ INT_PTR UIBaseDialog::WndProc(HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam)

unguard;
}


#endif // HAS_UI
4 changes: 0 additions & 4 deletions UI/BaseDialog.h
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,6 @@

#include "Core.h"

#if HAS_UI // defined in Build.h, included from Core.h

#include "Win32Types.h"
#include "UnCore.h" // for TArray and FString

Expand Down Expand Up @@ -1309,6 +1307,4 @@ class UIBaseDialog : public UIGroup
void UISetExceptionHandler(void (*Handler)());


#endif // HAS_UI

#endif // __BASE_DIALOG_H__
4 changes: 0 additions & 4 deletions UI/FileControls.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,6 @@
#include "BaseDialog.h"
#include "FileControls.h"

#if HAS_UI

#if _WIN32

#pragma comment(lib, "ole32.lib")
Expand Down Expand Up @@ -280,5 +278,3 @@ void UIFileNameEditor::OnBrowseClicked(UIButton* sender)
Editor->SetText();
}
}

#endif // HAS_UI
3 changes: 0 additions & 3 deletions UI/FileControls.h
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
#ifndef __FILE_CONTROLS_H__
#define __FILE_CONTROLS_H__

#if HAS_UI

class UIFilePathEditor : public UIGroup
{
Expand Down Expand Up @@ -100,6 +99,4 @@ FString ShowFileSelectionDialog(
const TArray<FString>& Filters);


#endif // HAS_UI

#endif // __FILE_CONTROLS_H__
5 changes: 0 additions & 5 deletions UI/UILayout.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,6 @@
// Licensed under the BSD license. See LICENSE.txt file in the project root for full license information.

#include "BaseDialog.h"

#if HAS_UI

#include "UIPrivate.h"

//#define DEBUG_LAYOUT 1
Expand Down Expand Up @@ -488,5 +485,3 @@ void UIPageControl::ComputeLayoutWithBorders(int borderLeft, int borderRight, in

unguard;
}

#endif // HAS_UI
5 changes: 0 additions & 5 deletions UI/UIMenu.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,6 @@
#endif // _WIN32

#include "BaseDialog.h"

#if HAS_UI

#include "UIPrivate.h"

/*-----------------------------------------------------------------------------
Expand Down Expand Up @@ -636,5 +633,3 @@ void UIMenu::Popup(UIElement* Owner, int x, int y)

unguard;
}

#endif // HAS_UI
4 changes: 0 additions & 4 deletions UI/stl-stub/Core.h
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,6 @@
#include <string.h>


#ifndef HAS_UI
#define HAS_UI 1
#endif

#undef min
#undef max

Expand Down
1 change: 0 additions & 1 deletion UmodelTool/Build.h
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@
#define RENDERING 1
#define PROFILE 1
#define DECLARE_VIEWER_PROPS 1
#define HAS_UI 1 // disable this line to remove UI code
//#define VSTUDIO_INTEGRATION 1 // improved debugging with Visual Studio

//#define PRIVATE_BUILD 1
Expand Down
3 changes: 1 addition & 2 deletions UmodelTool/PackageDialog.cpp
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
#include "BaseDialog.h"

#if HAS_UI

#include "BaseDialog.h"
#include "PackageDialog.h"
#include "PackageScanDialog.h"
#include "ProgressDialog.h"
Expand Down
4 changes: 0 additions & 4 deletions UmodelTool/PackageDialog.h
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
#ifndef __PACKAGE_DIALOG_H__
#define __PACKAGE_DIALOG_H__

#if HAS_UI

class UIPackageList;

class UIPackageDialog : public UIBaseDialog
Expand Down Expand Up @@ -81,6 +79,4 @@ class UIPackageDialog : public UIBaseDialog
virtual void InitUI();
};

#endif // HAS_UI

#endif // __PACKAGE_DIALOG_H__
3 changes: 1 addition & 2 deletions UmodelTool/PackageScanDialog.cpp
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
#include "BaseDialog.h"

#if HAS_UI

#include "BaseDialog.h"
#include "ProgressDialog.h"
#include "PackageUtils.h"

Expand Down
3 changes: 1 addition & 2 deletions UmodelTool/ProgressDialog.cpp
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
#include "BaseDialog.h"

#if HAS_UI

#include "BaseDialog.h"
#include "ProgressDialog.h"
#include "UnObject.h"

Expand Down
3 changes: 2 additions & 1 deletion UmodelTool/SettingsDialog.cpp
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
#if HAS_UI

#include "BaseDialog.h"
#include "SettingsDialog.h"
#include "FileControls.h"

#if HAS_UI

UISettingsDialog::UISettingsDialog(CUmodelSettings& settings, OptionsKind kind)
: Kind(kind)
Expand Down
4 changes: 0 additions & 4 deletions UmodelTool/SettingsDialog.h
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
#ifndef __SETTINGS_DIALOG_H__
#define __SETTINGS_DIALOG_H__

#if HAS_UI

#include "UmodelSettings.h"

class UISettingsDialog : public UIBaseDialog
Expand Down Expand Up @@ -47,6 +45,4 @@ class UISettingsDialog : public UIBaseDialog
UIElement& MakeUIOptions();
};

#endif // HAS_UI

#endif // __SETTINGS_DIALOG_H__
3 changes: 1 addition & 2 deletions UmodelTool/StartupDialog.cpp
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
#include "BaseDialog.h"

#if HAS_UI

#include "BaseDialog.h"
#include "StartupDialog.h"
#include "FileControls.h"

Expand Down
4 changes: 0 additions & 4 deletions UmodelTool/StartupDialog.h
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
#ifndef __STARTUP_DIALOG_H__
#define __STARTUP_DIALOG_H__

#if HAS_UI

#include "UmodelSettings.h"

class UIStartupDialog : public UIBaseDialog
Expand All @@ -24,6 +22,4 @@ class UIStartupDialog : public UIBaseDialog
virtual void InitUI();
};

#endif // HAS_UI

#endif // __STARTUP_DIALOG_H__
15 changes: 13 additions & 2 deletions UmodelTool/umodel.project
Original file line number Diff line number Diff line change
Expand Up @@ -8,15 +8,26 @@ UMODEL=UmodelTool

INCLUDES += $UMODEL UI

!if "$PLATFORM" eq "win32" || "$PLATFORM" eq "win64"
IS_WINDOWS = 1
!else
IS_WINDOWS = 0
!endif

# Allow GUI for Windows platform
!if "$IS_WINDOWS" eq "1"
DEFINES += HAS_UI=1
!endif

sources(MAIN) = {
Exporters/*.cpp
Unreal/*.cpp
Viewers/*.cpp
MeshInstance/*.cpp
Core/*.cpp
UI/*.cpp
$UMODEL/*.cpp
!if "$PLATFORM" eq "win32" || "$PLATFORM" eq "win64"
!if "$IS_WINDOWS" eq "1"
UI/*.cpp
$UMODEL/res/umodel.rc
!endif
}
Expand Down

0 comments on commit 3d98f13

Please sign in to comment.