Mercurial > projects > dwt2
comparison org.eclipse.swt.win32.win32.x86/src/org/eclipse/swt/internal/win32/OS.d @ 18:735224fcc45f
redirected all printings to DwtLogger
author | Frank Benoit <benoit@tionex.de> |
---|---|
date | Wed, 18 Mar 2009 09:57:53 +0100 |
parents | 950d84783eac |
children | 4642ab680468 |
comparison
equal
deleted
inserted
replaced
17:6f068362a363 | 18:735224fcc45f |
---|---|
28 | 28 |
29 alias tango.sys.win32.UserGdi WINAPI; | 29 alias tango.sys.win32.UserGdi WINAPI; |
30 alias org.eclipse.swt.internal.win32.WINAPI DWTWINAPI; | 30 alias org.eclipse.swt.internal.win32.WINAPI DWTWINAPI; |
31 | 31 |
32 void trace(int line ){ | 32 void trace(int line ){ |
33 getDwtLogger.trace( "OS {}", line ); | 33 getDwtLogger.trace( __FILE__, __LINE__, "OS {}", line ); |
34 } | 34 } |
35 | 35 |
36 // declare of Callback functions | 36 // declare of Callback functions |
37 extern (Windows) | 37 extern (Windows) |
38 { | 38 { |
87 if (auto lib = tango.sys.SharedLib.SharedLib.load(libname)) { | 87 if (auto lib = tango.sys.SharedLib.SharedLib.load(libname)) { |
88 foreach( inout s; symbols ){ | 88 foreach( inout s; symbols ){ |
89 if( OS.WIN32_VERSION >= OS.VERSION( s.major, s.minor )){ | 89 if( OS.WIN32_VERSION >= OS.VERSION( s.major, s.minor )){ |
90 *s.symbol = lib.getSymbol( s.name.ptr ); | 90 *s.symbol = lib.getSymbol( s.name.ptr ); |
91 if( s.symbol is null ){ | 91 if( s.symbol is null ){ |
92 getDwtLogger.error( "{}: Symbol '{}' not found", libname, s.name ); | 92 getDwtLogger.error( __FILE__, __LINE__, "{}: Symbol '{}' not found", libname, s.name ); |
93 } | 93 } |
94 } | 94 } |
95 } | 95 } |
96 } else { | 96 } else { |
97 getDwtLogger.error( "Could not load the library {}", libname ); | 97 getDwtLogger.error( __FILE__, __LINE__, "Could not load the library {}", libname ); |
98 } | 98 } |
99 } | 99 } |
100 | 100 |
101 public static HINSTANCE GetLibraryHandle(){ | 101 public static HINSTANCE GetLibraryHandle(){ |
102 //PORTING_FIXME: GetLibraryHandle | 102 //PORTING_FIXME: GetLibraryHandle |
400 | 400 |
401 public static void enableVisualStyles() { | 401 public static void enableVisualStyles() { |
402 void printError( char[] msg ){ | 402 void printError( char[] msg ){ |
403 char[] winMsg = tango.sys.Common.SysError.lastMsg(); | 403 char[] winMsg = tango.sys.Common.SysError.lastMsg(); |
404 char[2000] buf; | 404 char[2000] buf; |
405 getDwtLogger.error("{}: {}", msg, CodePage.from( winMsg, buf ) ); | 405 getDwtLogger.error( __FILE__, __LINE__, "{}: {}", msg, CodePage.from( winMsg, buf ) ); |
406 } | 406 } |
407 TCHAR[] buffer = new TCHAR[ MAX_PATH ]; | 407 TCHAR[] buffer = new TCHAR[ MAX_PATH ]; |
408 buffer[] = 0; | 408 buffer[] = 0; |
409 HANDLE hModule = OS.GetLibraryHandle (); | 409 HANDLE hModule = OS.GetLibraryHandle (); |
410 while (OS.GetModuleFileName (hModule, buffer.ptr, buffer.length ) is buffer.length ) { | 410 while (OS.GetModuleFileName (hModule, buffer.ptr, buffer.length ) is buffer.length ) { |
2708 if (auto lib = tango.sys.SharedLib.SharedLib.load(`uxtheme.dll`)) { | 2708 if (auto lib = tango.sys.SharedLib.SharedLib.load(`uxtheme.dll`)) { |
2709 foreach( inout s; Symbols_UxTheme ){ | 2709 foreach( inout s; Symbols_UxTheme ){ |
2710 if( OS.WIN32_VERSION >= OS.VERSION( s.major, s.minor )){ | 2710 if( OS.WIN32_VERSION >= OS.VERSION( s.major, s.minor )){ |
2711 *s.symbol = lib.getSymbol( s.name.ptr ); | 2711 *s.symbol = lib.getSymbol( s.name.ptr ); |
2712 if( *s.symbol is null ){ | 2712 if( *s.symbol is null ){ |
2713 getDwtLogger.error("UxTheme.dll: Symbol '{}' not found", s.name ); | 2713 getDwtLogger.error( __FILE__, __LINE__, "UxTheme.dll: Symbol '{}' not found", s.name ); |
2714 } | 2714 } |
2715 } | 2715 } |
2716 } | 2716 } |
2717 } else { | 2717 } else { |
2718 getDwtLogger.error("Could not load the library UxTheme.dll"); | 2718 getDwtLogger.error( __FILE__, __LINE__, "Could not load the library UxTheme.dll"); |
2719 } | 2719 } |
2720 } | 2720 } |
2721 //---------------------------------------------------------------------- | 2721 //---------------------------------------------------------------------- |
2722 // Coreimm.lib (WinCE) | 2722 // Coreimm.lib (WinCE) |
2723 // this function vars exist primarily for link error elimination | 2723 // this function vars exist primarily for link error elimination |