mirror of https://github.com/buggins/dlangui.git
platform initialization/deinitialization refactoring
This commit is contained in:
parent
c54da25549
commit
1b50e0586a
|
@ -222,10 +222,10 @@ class Window {
|
|||
measure();
|
||||
//Log.d("measured size: ", _mainWidget.measuredWidth, "x", _mainWidget.measuredHeight);
|
||||
long measureEnd = currentTimeMillis;
|
||||
Log.d("measure took ", measureEnd - measureStart, " ms");
|
||||
debug Log.d("resize: measure took ", measureEnd - measureStart, " ms");
|
||||
layout();
|
||||
long layoutEnd = currentTimeMillis;
|
||||
Log.d("layout took ", layoutEnd - measureEnd, " ms");
|
||||
debug Log.d("resize: layout took ", layoutEnd - measureEnd, " ms");
|
||||
//Log.d("layout position: ", _mainWidget.pos);
|
||||
}
|
||||
update(true);
|
||||
|
@ -986,7 +986,7 @@ class Window {
|
|||
if (!needLayout) {
|
||||
needLayout = root.needLayout || needLayout;
|
||||
if (needLayout) {
|
||||
Log.d("need layout: ", root.id);
|
||||
debug(DebugRedraw) Log.d("need layout: ", root.id);
|
||||
}
|
||||
}
|
||||
if (root.animating && root.visible)
|
||||
|
@ -1566,4 +1566,18 @@ void releaseResourcesOnAppExit() {
|
|||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/// initialize logging (for win32 - to file ui.log, for other platforms - stderr; log level is TRACE for debug builds, and WARN for release builds)
|
||||
void initLogs() {
|
||||
version (Windows) {
|
||||
Log.setFileLogger(std.stdio.File("ui.log", "w"));
|
||||
} else {
|
||||
Log.setStderrLogger();
|
||||
}
|
||||
debug {
|
||||
Log.setLogLevel(LogLevel.Trace);
|
||||
} else {
|
||||
Log.setLogLevel(LogLevel.Warn);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1237,12 +1237,7 @@ version (Windows) {
|
|||
|
||||
int myWinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpCmdLine, int iCmdShow)
|
||||
{
|
||||
Log.setFileLogger(std.stdio.File("ui.log", "w"));
|
||||
debug {
|
||||
Log.setLogLevel(LogLevel.Trace);
|
||||
} else {
|
||||
Log.setLogLevel(LogLevel.Warn);
|
||||
}
|
||||
initLogs();
|
||||
Log.d("myWinMain()");
|
||||
string basePath = exePath();
|
||||
Log.i("Current executable: ", exePath());
|
||||
|
@ -1268,12 +1263,7 @@ version (Windows) {
|
|||
int main(string[] args)
|
||||
{
|
||||
|
||||
Log.setStderrLogger();
|
||||
debug {
|
||||
Log.setLogLevel(LogLevel.Trace);
|
||||
} else {
|
||||
Log.setLogLevel(LogLevel.Warn);
|
||||
}
|
||||
initLogs();
|
||||
|
||||
if (!initFontManager()) {
|
||||
Log.e("******************************************************************");
|
||||
|
|
|
@ -929,12 +929,8 @@ private __gshared Win32Platform w32platform;
|
|||
|
||||
int myWinMain(void* hInstance, void* hPrevInstance, char* lpCmdLine, int iCmdShow)
|
||||
{
|
||||
Log.setFileLogger(std.stdio.File("ui.log", "w"));
|
||||
debug {
|
||||
Log.setLogLevel(LogLevel.Trace);
|
||||
} else {
|
||||
Log.setLogLevel(LogLevel.Info);
|
||||
}
|
||||
initLogs();
|
||||
|
||||
Log.d("myWinMain()");
|
||||
string basePath = exePath();
|
||||
Log.i("Current executable: ", exePath());
|
||||
|
|
Loading…
Reference in New Issue