2 * This header contains common boilerplate initialisation code for a
3 * lot of debug programs.
11 #ifdef ENABLE_XML_DIALOG
12 #include "Dialogs/XML.hpp"
14 #define ENABLE_RESOURCE_LOADER
17 #if defined(ENABLE_RESOURCE_LOADER) && defined(USE_GDI)
18 #include "ResourceLoader.hpp"
22 #include "Dialogs/DialogSettings.hpp"
23 #include "UIGlobals.hpp"
24 #define ENABLE_DIALOG_LOOK
27 #ifdef ENABLE_MAIN_WINDOW
28 #include "Screen/SingleWindow.hpp"
29 #include "UIGlobals.hpp"
33 #include "Look/Look.hpp"
34 #include "UISettings.hpp"
36 #elif defined(ENABLE_DIALOG_LOOK)
37 #include "Look/DialogLook.hpp"
42 #include "Screen/Init.hpp"
43 #include "Screen/Layout.hpp"
48 #include "Profile/Profile.hpp"
49 #define ENABLE_DATA_PATH
52 #ifdef ENABLE_DATA_PATH
53 #include "LocalPath.hpp"
62 ParseCommandLine(Args
&args
);
71 #ifdef ENABLE_DIALOG_LOOK
72 static DialogLook
*dialog_look
;
76 static DialogSettings dialog_settings
;
78 const DialogSettings
&
79 UIGlobals::GetDialogSettings()
81 return dialog_settings
;
85 UIGlobals::GetDialogLook()
91 #ifdef ENABLE_MAIN_WINDOW
92 static SingleWindow main_window
;
95 UIGlobals::GetMainWindow()
102 int main(int argc
, char **argv
)
105 WinMain(HINSTANCE hInstance
, HINSTANCE hPrevInstance
,
114 #ifdef ENABLE_CMDLINE
116 Args
args(GetCommandLine(), USAGE
);
118 Args
args(argc
, argv
, USAGE
);
120 ParseCommandLine(args
);
124 #if defined(ENABLE_RESOURCE_LOADER) && defined(USE_GDI)
125 ResourceLoader::Init(hInstance
);
129 ScreenGlobalInit screen_init
;
130 Layout::Initialize({640, 480});
135 dialog_settings
.SetDefaults();
140 look
->Initialise(normal_font
, bold_font
, small_font
);
143 UISettings ui_settings
;
144 ui_settings
.SetDefaults();
145 look
->InitialiseConfigured(ui_settings
,
146 normal_font
, bold_font
, small_font
,
147 small_font
, monospace_font
,
148 normal_font
, small_font
,
155 dialog_look
= &look
->dialog
;
156 #elif defined(ENABLE_DIALOG_LOOK)
157 dialog_look
= new DialogLook();
158 dialog_look
->Initialise(bold_font
, normal_font
, small_font
,
159 bold_font
, bold_font
, bold_font
);
162 #ifdef ENABLE_XML_DIALOG
163 SetXMLDialogLook(*dialog_look
);
166 #ifdef ENABLE_DATA_PATH
167 InitialiseDataPath();
170 #ifdef ENABLE_PROFILE
171 Profile::SetFiles(_T(""));
175 #ifdef ENABLE_MAIN_WINDOW
176 main_window
.Create(_T("Test"), {640, 480});
182 #ifdef ENABLE_MAIN_WINDOW
183 main_window
.Destroy();
186 #ifdef ENABLE_DATA_PATH
187 DeinitialiseDataPath();
192 #elif defined(ENABLE_DIALOG_LOOK)