diff org.eclipse.swt.win32.win32.x86/src/org/eclipse/swt/internal/gdip/native.d @ 46:17310ba3c1bc

Moved all load lib functionality into own module
author Frank Benoit <benoit@tionex.de>
date Fri, 27 Mar 2009 11:10:45 +0100
parents 0ecb2b338560
children 9f4c18c268b2
line wrap: on
line diff
--- a/org.eclipse.swt.win32.win32.x86/src/org/eclipse/swt/internal/gdip/native.d	Wed Mar 25 18:52:36 2009 +0100
+++ b/org.eclipse.swt.win32.win32.x86/src/org/eclipse/swt/internal/gdip/native.d	Fri Mar 27 11:10:45 2009 +0100
@@ -15,11 +15,6 @@
 import org.eclipse.swt.internal.win32.WINTYPES;
 import java.lang.all;
 
-version(Tango){
-    static import tango.sys.SharedLib;
-} else { // Phobos
-}
-
 extern(Windows):
 
 /******************************************************************************
@@ -732,6 +727,7 @@
 
 }
 else{ // version(!STATIC_GDIPLUS)
+import java.nonstandard.SharedLib;
 Status function( uint* token, GdiplusStartupInput* input, GdiplusStartupOutput* output) GdiplusStartup;
 void   function(uint token) GdiplusShutdown;
 Status function(Handle hdc, out Handle graphics) GdipCreateFromHDC;
@@ -1202,11 +1198,6 @@
 Status function(Handle format, int hotkeyPrefix) GdipSetStringFormatHotkeyPrefix;
 Status function( Handle format, float firstTabOffset, int count, float* tabStops) GdipSetStringFormatTabStops;
 
-struct Symbol {
-    String name;
-    void** symbol;
-}
-
 Symbol[] symbols = [
     { "GdiplusStartup", cast(void**)& GdiplusStartup },
     { "GdiplusShutdown", cast(void**)& GdiplusShutdown },
@@ -1681,20 +1672,7 @@
 
 
 void loadLib_Gdip(){
-    version(Tango){
-        if (auto lib = tango.sys.SharedLib.SharedLib.load(`gdiplus.dll`)) {
-            foreach( inout s; symbols ){
-                *s.symbol = lib.getSymbol( s.name.ptr );
-                if( s.symbol is null ){
-                    getDwtLogger.error( __FILE__, __LINE__, "gdiplus.dll: Symbol '{}' not found", s.name );
-                }
-            }
-        } else {
-            getDwtLogger.error( __FILE__, __LINE__, "Could not load the library gdiplus.dll");
-        }
-    } else { // Phobos
-        implMissing( __FILE__, __LINE__ );
-    }
+    SharedLib.loadLibSymbols( symbols, "gdiplus.dll" );
 }
 
 }