Mercurial > projects > dwt-win
comparison dwt/internal/win32/OS.d @ 332:1ee938a6e02e
Tango updates, removing trace prints and added prints via Logger
author | Frank Benoit <benoit@tionex.de> |
---|---|
date | Sun, 01 Feb 2009 19:40:09 +0100 |
parents | 2b8f40a1c515 |
children | f866e80af235 |
comparison
equal
deleted
inserted
replaced
331:27479f54069d | 332:1ee938a6e02e |
---|---|
25 alias dwt.internal.win32.WINAPI DWTWINAPI; | 25 alias dwt.internal.win32.WINAPI DWTWINAPI; |
26 } | 26 } |
27 | 27 |
28 import dwt.internal.C; | 28 import dwt.internal.C; |
29 import dwt.internal.Library; | 29 import dwt.internal.Library; |
30 import dwt.dwthelper.utils; | |
30 import tango.sys.SharedLib : SharedLib; | 31 import tango.sys.SharedLib : SharedLib; |
31 import tango.sys.Common : SysError; | 32 import tango.sys.Common : SysError; |
32 static import tango.stdc.stdlib; | 33 static import tango.stdc.stdlib; |
33 | 34 |
34 import tango.stdc.string : memset, strlen; | 35 import tango.stdc.string : memset, strlen; |
36 import tango.text.convert.Utf : toString16; | 37 import tango.text.convert.Utf : toString16; |
37 static import tango.io.TempFile; | 38 static import tango.io.TempFile; |
38 import tango.io.File; | 39 import tango.io.File; |
39 | 40 |
40 | 41 |
41 import tango.util.log.Trace; | |
42 import tango.io.Console; | 42 import tango.io.Console; |
43 void trace(int line ){ | 43 void trace(int line ){ |
44 //Trace.formatln( "OS {}", line ); | 44 getDwtLogger.trace( "OS {}", line ); |
45 } | 45 } |
46 | 46 |
47 // declare of Callback functions | 47 // declare of Callback functions |
48 extern (Windows) | 48 extern (Windows) |
49 { | 49 { |
98 if (auto lib = SharedLib.load(libname)) { | 98 if (auto lib = SharedLib.load(libname)) { |
99 foreach( inout s; symbols ){ | 99 foreach( inout s; symbols ){ |
100 if( OS.WIN32_VERSION >= OS.VERSION( s.major, s.minor )){ | 100 if( OS.WIN32_VERSION >= OS.VERSION( s.major, s.minor )){ |
101 *s.symbol = lib.getSymbol( s.name.ptr ); | 101 *s.symbol = lib.getSymbol( s.name.ptr ); |
102 if( s.symbol is null ){ | 102 if( s.symbol is null ){ |
103 Trace.formatln( "{}: Symbol '{}' not found", libname, s.name ); | 103 getDwtLogger.error( "{}: Symbol '{}' not found", libname, s.name ); |
104 } | 104 } |
105 } | 105 } |
106 } | 106 } |
107 } else { | 107 } else { |
108 Trace.formatln( "Could not load the library {}", libname ); | 108 getDwtLogger.error( "Could not load the library {}", libname ); |
109 } | 109 } |
110 } | 110 } |
111 | 111 |
112 public static HINSTANCE GetLibraryHandle(){ | 112 public static HINSTANCE GetLibraryHandle(){ |
113 //PORTING_FIXME: GetLibraryHandle | 113 //PORTING_FIXME: GetLibraryHandle |
411 | 411 |
412 public static void enableVisualStyles() { | 412 public static void enableVisualStyles() { |
413 void printError( char[] msg ){ | 413 void printError( char[] msg ){ |
414 char[] winMsg = SysError.lastMsg(); | 414 char[] winMsg = SysError.lastMsg(); |
415 char[2000] buf; | 415 char[2000] buf; |
416 Trace.formatln("{}: {}", msg, CodePage.from( winMsg, buf ) ); | 416 getDwtLogger.error("{}: {}", msg, CodePage.from( winMsg, buf ) ); |
417 } | 417 } |
418 TCHAR[] buffer = new TCHAR[ MAX_PATH ]; | 418 TCHAR[] buffer = new TCHAR[ MAX_PATH ]; |
419 buffer[] = 0; | 419 buffer[] = 0; |
420 HANDLE hModule = OS.GetLibraryHandle (); | 420 HANDLE hModule = OS.GetLibraryHandle (); |
421 while (OS.GetModuleFileName (hModule, buffer.ptr, buffer.length ) is buffer.length ) { | 421 while (OS.GetModuleFileName (hModule, buffer.ptr, buffer.length ) is buffer.length ) { |
2719 if (auto lib = SharedLib.load(`uxtheme.dll`)) { | 2719 if (auto lib = SharedLib.load(`uxtheme.dll`)) { |
2720 foreach( inout s; Symbols_UxTheme ){ | 2720 foreach( inout s; Symbols_UxTheme ){ |
2721 if( OS.WIN32_VERSION >= OS.VERSION( s.major, s.minor )){ | 2721 if( OS.WIN32_VERSION >= OS.VERSION( s.major, s.minor )){ |
2722 *s.symbol = lib.getSymbol( s.name.ptr ); | 2722 *s.symbol = lib.getSymbol( s.name.ptr ); |
2723 if( *s.symbol is null ){ | 2723 if( *s.symbol is null ){ |
2724 Trace.formatln("UxTheme.dll: Symbol '{}' not found", s.name ); | 2724 getDwtLogger.error("UxTheme.dll: Symbol '{}' not found", s.name ); |
2725 } | 2725 } |
2726 } | 2726 } |
2727 } | 2727 } |
2728 } else { | 2728 } else { |
2729 Trace.formatln("Could not load the library UxTheme.dll"); | 2729 getDwtLogger.error("Could not load the library UxTheme.dll"); |
2730 } | 2730 } |
2731 } | 2731 } |
2732 //---------------------------------------------------------------------- | 2732 //---------------------------------------------------------------------- |
2733 // Coreimm.lib (WinCE) | 2733 // Coreimm.lib (WinCE) |
2734 // this function vars exist primarily for link error elimination | 2734 // this function vars exist primarily for link error elimination |