changeset 363:5f6d9bb33a53

merge
author Frank Benoit <benoit@tionex.de>
date Sat, 04 Apr 2009 21:38:37 +0200
parents 5b585873fec2 (current diff) 4bffbf81e2d6 (diff)
children 2bcb17ebe0be
files dwt/dwthelper/InflaterInputStream.d dwt/dwthelper/utils.d
diffstat 28 files changed, 185 insertions(+), 217 deletions(-) [+]
line wrap: on
line diff
--- a/dwt/DWTError.d	Sat Apr 04 21:14:54 2009 +0200
+++ b/dwt/DWTError.d	Sat Apr 04 21:38:37 2009 +0200
@@ -17,7 +17,6 @@
 import dwt.DWT;
 
 import tango.core.Exception;
-import tango.io.Stdout;
 
 /**
  * This error is thrown whenever an unrecoverable error
@@ -150,14 +149,14 @@
  * </p>
  */
 public void printStackTrace () {
-    Stderr.formatln( "stacktrace follows (if feature compiled in)" );
+    getDwtLogger().error( "stacktrace follows (if feature compiled in)" );
     foreach( msg; info ){
-        Stderr.formatln( "{}", msg );
+        getDwtLogger().error( "{}", msg );
     }
     if ( throwable !is null) {
-        Stderr.formatln ("*** Stack trace of contained error ***"); //$NON-NLS-1$
+        getDwtLogger().error ("*** Stack trace of contained error ***"); //$NON-NLS-1$
         foreach( msg; throwable.info ){
-            Stderr.formatln( "{}", msg );
+            getDwtLogger().error( "{}", msg );
         }
     }
 }
--- a/dwt/DWTException.d	Sat Apr 04 21:14:54 2009 +0200
+++ b/dwt/DWTException.d	Sat Apr 04 21:38:37 2009 +0200
@@ -17,7 +17,6 @@
 import dwt.DWT;
 
 import tango.core.Exception;
-import tango.io.Stdout;
 
 /**
  * This runtime exception is thrown whenever a recoverable error
@@ -141,14 +140,14 @@
  * </p>
  */
 public void printStackTrace () {
-    Stderr.formatln( "stacktrace follows (if feature compiled in)" );
+    getDwtLogger().error( "stacktrace follows (if feature compiled in)" );
     foreach( msg; info ){
-        Stderr.formatln( "{}", msg );
+        getDwtLogger().error( "{}", msg );
     }
     if ( throwable !is null) {
-        Stderr.formatln ("*** Stack trace of contained exception ***"); //$NON-NLS-1$
+        getDwtLogger().error ("*** Stack trace of contained exception ***"); //$NON-NLS-1$
         foreach( msg; throwable.info ){
-            Stderr.formatln( "{}", msg );
+            getDwtLogger().error( "{}", msg );
         }
     }
 }
--- a/dwt/accessibility/AccessibleFactory.d	Sat Apr 04 21:14:54 2009 +0200
+++ b/dwt/accessibility/AccessibleFactory.d	Sat Apr 04 21:38:37 2009 +0200
@@ -25,8 +25,6 @@
 
 import dwt.DWT;
 
-import tango.io.Stdout;
-
 class AccessibleFactory {
     AtkObjectFactory * handle;
     uint objectParentType;
@@ -147,7 +145,7 @@
             }
         }
         else{
-            Stdout.formatln( "AccessibleFactory.atkObjectFactoryCB_create_accessible cannot find factory instance" );
+            getDwtLogger().info( "AccessibleFactory.atkObjectFactoryCB_create_accessible cannot find factory instance" );
         }
     }
 
--- a/dwt/accessibility/AccessibleObject.d	Sat Apr 04 21:14:54 2009 +0200
+++ b/dwt/accessibility/AccessibleObject.d	Sat Apr 04 21:38:37 2009 +0200
@@ -25,7 +25,6 @@
 import dwt.accessibility.AccessibleFactory;
 import dwt.widgets.Display;
 import dwt.dwthelper.utils;
-import tango.io.Stdout;
 import tango.text.Util;
 import Math = tango.math.Math;
 
@@ -73,7 +72,7 @@
         this.accessible = accessible;
         this.isLightweight = isLightweight;
         AccessibleObjects[handle] = this;
-        if (DEBUG) Stdout.formatln("new AccessibleObject: {}", handle);
+        if (DEBUG) getDwtLogger().info("new AccessibleObject: {}", handle);
     }
 
     void addChild (AccessibleObject child) {
@@ -83,7 +82,7 @@
 
     package static extern(C) char* atkAction_get_keybinding (void* obj, int index) {
         auto atkObject = cast(AtkObject*)obj;
-        if (DEBUG) Stdout.formatln ("-->atkAction_get_keybinding");
+        if (DEBUG) getDwtLogger().info ("-->atkAction_get_keybinding");
         AccessibleObject object = getAccessibleObject (atkObject);
         if (object is null) return null;
         char* parentResult;
@@ -116,7 +115,7 @@
 
     package static extern(C) char* atkAction_get_name (void* obj, int index) {
         auto atkObject = cast(AtkObject*)obj;
-        if (DEBUG) Stdout.formatln ("-->atkAction_get_name");
+        if (DEBUG) getDwtLogger().info ("-->atkAction_get_name");
         AccessibleObject object = getAccessibleObject (atkObject);
         if (object is null) return null;
         char* parentResult;
@@ -149,7 +148,7 @@
 
     package static extern(C) void atkComponent_get_extents (void* obj, int* x, int* y, int* width, int* height, int coord_type) {
         auto atkObject = cast(AtkObject*)obj;
-        if (DEBUG) Stdout.formatln ("-->atkComponent_get_extents");
+        if (DEBUG) getDwtLogger().info ("-->atkComponent_get_extents");
         AccessibleObject object = getAccessibleObject (atkObject);
         if (object is null) return 0;
         *x = 0;
@@ -203,7 +202,7 @@
 
     package static extern(C) void atkComponent_get_position (void* obj, int* x, int* y, int coord_type) {
         auto atkObject = cast(AtkObject*)obj;
-        if (DEBUG) Stdout.formatln ("-->atkComponent_get_position, object: {} x:{} y:{} coord:{}", atkObject, x, y, coord_type);
+        if (DEBUG) getDwtLogger().info ("-->atkComponent_get_position, object: {} x:{} y:{} coord:{}", atkObject, x, y, coord_type);
         AccessibleObject object = getAccessibleObject (atkObject);
         if (object is null) return 0;
         *x=0;
@@ -255,7 +254,7 @@
     //package static extern(C) void atkComponent_get_size (void* obj, int* width, int* height, int coord_type) {
     package static extern(C) void atkComponent_get_size (void* obj, int* width, int* height) {
         auto atkObject = cast(AtkObject*)obj;
-        if (DEBUG) Stdout.formatln ("-->atkComponent_get_size");
+        if (DEBUG) getDwtLogger().info ("-->atkComponent_get_size");
         AccessibleObject object = getAccessibleObject (atkObject);
         if (object is null) return 0;
         *width=0;
@@ -286,7 +285,7 @@
 
     package static extern(C) AtkObject* atkComponent_ref_accessible_at_point (void* obj, int x, int y, int coord_type) {
         auto atkObject = cast(AtkObject*)obj;
-        if (DEBUG) Stdout.formatln ("-->atkComponent_ref_accessible_at_point");
+        if (DEBUG) getDwtLogger().info ("-->atkComponent_ref_accessible_at_point");
         AccessibleObject object = getAccessibleObject (atkObject);
         if (object is null) return null;
         AtkObject* parentResult;
@@ -327,24 +326,24 @@
 
     package static extern(C) AtkHyperlink* atkHypertext_get_link (void* obj, int link_index) {
         auto atkObject = cast(AtkObject*)obj;
-        if (DEBUG) Stdout.formatln ("-->atkHypertext_get_link");
+        if (DEBUG) getDwtLogger().info ("-->atkHypertext_get_link");
         return null;
     }
 
     package static extern(C) int atkHypertext_get_n_links (void* obj) {
         auto atkObject = cast(AtkObject*)obj;
-        if (DEBUG) Stdout.formatln ("-->atkHypertext_get_n_links");
+        if (DEBUG) getDwtLogger().info ("-->atkHypertext_get_n_links");
         return 0;   /* read hyperlink's name */
     }
 
     package static extern(C) int atkHypertext_get_link_index (void* obj, int char_index) {
         auto atkObject = cast(AtkObject*)obj;
-        if (DEBUG) Stdout.formatln ("-->atkHypertext_get_link_index");
+        if (DEBUG) getDwtLogger().info ("-->atkHypertext_get_link_index");
         return 0;
     }
 
     package static extern(C) char* atkObject_get_description (AtkObject* atkObject) {
-        if (DEBUG) Stdout.formatln ("-->atkObject_get_description");
+        if (DEBUG) getDwtLogger().info ("-->atkObject_get_description");
         AccessibleObject object = getAccessibleObject (atkObject);
         if (object is null) return null;
         char* parentResult;
@@ -372,7 +371,7 @@
         return descriptionPtr.ptr;  }
 
     package static extern(C) char* atkObject_get_name (AtkObject* atkObject) {
-        if (DEBUG) Stdout.formatln ("-->atkObject_get_name: {}", atkObject);
+        if (DEBUG) getDwtLogger().info ("-->atkObject_get_name: {}", atkObject);
         AccessibleObject object = getAccessibleObject (atkObject);
         if (object is null) return null;
         char* parentResult;
@@ -400,7 +399,7 @@
     }
 
     package static extern(C) int atkObject_get_n_children (AtkObject* atkObject) {
-        if (DEBUG) Stdout.formatln ("-->atkObject_get_n_children: {}", atkObject);
+        if (DEBUG) getDwtLogger().info ("-->atkObject_get_n_children: {}", atkObject);
         AccessibleObject object = getAccessibleObject (atkObject);
         if (object is null) return 0;
         int /*long*/ parentResult = 0;
@@ -421,7 +420,7 @@
     }
 
     package static extern(C) int atkObject_get_index_in_parent (AtkObject* atkObject) {
-        if (DEBUG) Stdout.formatln ("-->atkObjectCB_get_index_in_parent.  ");
+        if (DEBUG) getDwtLogger().info ("-->atkObjectCB_get_index_in_parent.  ");
         AccessibleObject object = getAccessibleObject (atkObject);
         if (object is null) return 0;
         if (object.index !is -1) return object.index;
@@ -431,7 +430,7 @@
     }
 
     package static extern(C) AtkObject* atkObject_get_parent (AtkObject* atkObject) {
-        if (DEBUG) Stdout.formatln ("-->atkObject_get_parent: {}", atkObject);
+        if (DEBUG) getDwtLogger().info ("-->atkObject_get_parent: {}", atkObject);
         AccessibleObject object = getAccessibleObject (atkObject);
         if (object is null) return null;
         if (object.parent !is null) return object.parent.handle;
@@ -441,7 +440,7 @@
     }
 
     package static extern(C) int atkObject_get_role (AtkObject* atkObject) {
-        if (DEBUG) Stdout.formatln ("-->atkObject_get_role: {}", atkObject);
+        if (DEBUG) getDwtLogger().info ("-->atkObject_get_role: {}", atkObject);
         AccessibleObject object = getAccessibleObject (atkObject);
         if (object is null) return 0;
         if (object.getAccessibleListeners ().length !is 0) {
@@ -494,7 +493,7 @@
     }
 
     package static extern(C) AtkObject* atkObject_ref_child (AtkObject* atkObject, int /*long*/ index) {
-        if (DEBUG) Stdout.formatln ("-->atkObject_ref_child: {} of: {}", index, atkObject);
+        if (DEBUG) getDwtLogger().info ("-->atkObject_ref_child: {} of: {}", index, atkObject);
         AccessibleObject object = getAccessibleObject (atkObject);
         if (object is null) return null;
         object.updateChildren ();
@@ -509,7 +508,7 @@
     }
 
     package static extern(C) AtkStateSet * atkObject_ref_state_set (AtkObject* atkObject) {
-        if (DEBUG) Stdout.formatln ("-->atkObject_ref_state_set");
+        if (DEBUG) getDwtLogger().info ("-->atkObject_ref_state_set");
         AccessibleObject object = getAccessibleObject (atkObject);
         if (object is null) return null;
         AtkStateSet* parentResult;
@@ -551,7 +550,7 @@
 
     package static extern(C) int atkSelection_is_child_selected (void* obj, int index) {
         auto atkObject = cast(AtkObject*)obj;
-        if (DEBUG) Stdout.formatln ("-->atkSelection_is_child_selected");
+        if (DEBUG) getDwtLogger().info ("-->atkSelection_is_child_selected");
         AccessibleObject object = getAccessibleObject (atkObject);
         if (object is null) return 0;
         int /*long*/ parentResult = 0;
@@ -578,7 +577,7 @@
 
     package static extern(C) AtkObject* atkSelection_ref_selection (void* obj, int index) {
         auto atkObject = cast(AtkObject*)obj;
-        if (DEBUG) Stdout.formatln ("-->atkSelection_ref_selection");
+        if (DEBUG) getDwtLogger().info ("-->atkSelection_ref_selection");
         AccessibleObject object = getAccessibleObject (atkObject);
         if (object is null) return null;
         AtkObject* parentResult;
@@ -607,7 +606,7 @@
 
     package static extern(C) int atkText_get_caret_offset (void* obj) {
         auto atkObject = cast(AtkObject*)obj;
-        if (DEBUG) Stdout.formatln ("-->atkText_get_caret_offset");
+        if (DEBUG) getDwtLogger().info ("-->atkText_get_caret_offset");
         AccessibleObject object = getAccessibleObject (atkObject);
         if (object is null) return 0;
         int /*long*/ parentResult = 0;
@@ -631,7 +630,7 @@
 
     package static extern(C) uint atkText_get_character_at_offset (void* obj, int offset) {
         auto atkObject = cast(AtkObject*)obj;
-        if (DEBUG) Stdout.formatln ("-->atkText_get_character_at_offset");
+        if (DEBUG) getDwtLogger().info ("-->atkText_get_character_at_offset");
         AccessibleObject object = getAccessibleObject (atkObject);
         if (object is null) return 0;
         String text = object.getText ();
@@ -647,7 +646,7 @@
 
     package static extern(C) int atkText_get_character_count (void* obj) {
         auto atkObject = cast(AtkObject*)obj;
-        if (DEBUG) Stdout.formatln ("-->atkText_get_character_count");
+        if (DEBUG) getDwtLogger().info ("-->atkText_get_character_count");
         AccessibleObject object = getAccessibleObject (atkObject);
         if (object is null) return 0;
         String text = object.getText ();
@@ -663,7 +662,7 @@
 
     package static extern(C) int atkText_get_n_selections (void* obj) {
         auto atkObject = cast(AtkObject*)obj;
-        if (DEBUG) Stdout.formatln("-->atkText_get_n_selections");
+        if (DEBUG) getDwtLogger().info("-->atkText_get_n_selections");
         AccessibleObject object = getAccessibleObject (atkObject);
         if (object is null) return 0;
         int /*long*/ parentResult = 0;
@@ -686,7 +685,7 @@
 
     package static extern(C) char* atkText_get_selection (void* obj, int selection_num, int* start_offset, int* end_offset) {
         auto atkObject = cast(AtkObject*)obj;
-        if (DEBUG) Stdout.formatln ("-->atkText_get_selection");
+        if (DEBUG) getDwtLogger().info ("-->atkText_get_selection");
         AccessibleObject object = getAccessibleObject (atkObject);
         if (object is null) return null;
         *start_offset=0;
@@ -718,7 +717,7 @@
 
     package static extern(C) char* atkText_get_text (void* obj, int start_offset, int end_offset) {
         auto atkObject = cast(AtkObject*)obj;
-        if (DEBUG) Stdout.formatln ("-->atkText_get_text: {},{}", start_offset, end_offset);
+        if (DEBUG) getDwtLogger().info ("-->atkText_get_text: {},{}", start_offset, end_offset);
         AccessibleObject object = getAccessibleObject (atkObject);
         if (object is null) return null;
         String text = object.getText ();
@@ -740,7 +739,7 @@
 
     package static extern(C) char* atkText_get_text_after_offset (void* obj, int offset_value, int boundary_type, int* start_offset, int* end_offset) {
         auto atkObject = cast(AtkObject*)obj;
-        if (DEBUG) Stdout.formatln ("-->atkText_get_text_after_offset");
+        if (DEBUG) getDwtLogger().info ("-->atkText_get_text_after_offset");
         AccessibleObject object = getAccessibleObject (atkObject);
         if (object is null) return null;
         int offset = cast(int)/*64*/offset_value;
@@ -917,7 +916,7 @@
 
     package static extern(C) char* atkText_get_text_at_offset (void* obj, int offset_value, int boundary_type, int* start_offset, int* end_offset) {
         auto atkObject = cast(AtkObject*)obj;
-        if (DEBUG) Stdout.formatln ("-->atkText_get_text_at_offset: {} start: {} end: {}", offset_value, start_offset, end_offset);
+        if (DEBUG) getDwtLogger().info ("-->atkText_get_text_at_offset: {} start: {} end: {}", offset_value, start_offset, end_offset);
         AccessibleObject object = getAccessibleObject (atkObject);
         if (object is null) return null;
         int offset = offset_value;
@@ -1035,7 +1034,7 @@
 
     package static extern(C) char* atkText_get_text_before_offset (void* obj, int offset_value, int boundary_type, int* start_offset, int* end_offset) {
         auto atkObject = cast(AtkObject*)obj;
-        if (DEBUG) Stdout.formatln ("-->atkText_get_text_before_offset");
+        if (DEBUG) getDwtLogger().info ("-->atkText_get_text_before_offset");
         AccessibleObject object = getAccessibleObject (atkObject);
         if (object is null) return null;
         int offset = offset_value;
@@ -1280,7 +1279,7 @@
     }
 
     void release () {
-        if (DEBUG) Stdout.formatln("AccessibleObject.release: {}", handle);
+        if (DEBUG) getDwtLogger().info("AccessibleObject.release: {}", handle);
         accessible = null;
         foreach( child; children ){
             if (child.isLightweight) OS.g_object_unref (child.handle);
--- a/dwt/browser/Browser.d	Sat Apr 04 21:14:54 2009 +0200
+++ b/dwt/browser/Browser.d	Sat Apr 04 21:38:37 2009 +0200
@@ -15,7 +15,6 @@
 import dwt.dwthelper.utils;
 
 import tango.core.Thread;
-import tango.io.Stdout;
 
 import dwt.DWT;
 import dwt.DWTError;
@@ -372,7 +371,7 @@
     name = name.substring(0, name.lastIndexOf('.'));
     int index = name.lastIndexOf('.');
     if (!name.substring (0, index + 1).equals (PACKAGE_PREFIX)) {
-        Stdout ("name: ")(name.substring(0, index + 1))(" == " )(PACKAGE_PREFIX).newline;
+        getDwtLogger().info("name: {} == {}", name.substring(0, index + 1), PACKAGE_PREFIX);
         DWT.error (DWT.ERROR_INVALID_SUBCLASS);
     }
 }
--- a/dwt/browser/Mozilla.d	Sat Apr 04 21:14:54 2009 +0200
+++ b/dwt/browser/Mozilla.d	Sat Apr 04 21:38:37 2009 +0200
@@ -15,7 +15,6 @@
 import dwt.dwthelper.utils;
 
 import tango.text.locale.Core;
-import tango.io.Stdout;
 import tango.text.convert.Format;
 import tango.io.Console;
 import tango.sys.Environment;
@@ -1442,7 +1441,7 @@
 
 extern(D)
 static String error (int code, char[] file, int line) {
-    Stdout ("File: ")(file)("  Line: ")(line).newline;
+    getDwtLogger().info( "File: {}  Line: {}", file, line);
     throw new DWTError ("XPCOM error " ~ Integer.toString(code)); //$NON-NLS-1$
 }
 
--- a/dwt/dwthelper/ByteArrayOutputStream.d	Sat Apr 04 21:14:54 2009 +0200
+++ b/dwt/dwthelper/ByteArrayOutputStream.d	Sat Apr 04 21:38:37 2009 +0200
@@ -5,18 +5,18 @@
 
 public import dwt.dwthelper.OutputStream;
 import dwt.dwthelper.utils;
-import tango.io.Buffer;
+import tango.io.device.Array;
 
 public class ByteArrayOutputStream : dwt.dwthelper.OutputStream.OutputStream {
 
-    protected GrowBuffer buffer;
+    protected Array buffer;
 
     public this (){
-        buffer = new GrowBuffer();
+        buffer = new Array();
     }
 
     public this ( int par_size ){
-        buffer = new GrowBuffer(par_size);
+        buffer = new Array(par_size);
     }
 
     public synchronized override void write( int b ){
--- a/dwt/dwthelper/FileInputStream.d	Sat Apr 04 21:14:54 2009 +0200
+++ b/dwt/dwthelper/FileInputStream.d	Sat Apr 04 21:38:37 2009 +0200
@@ -8,11 +8,10 @@
 import dwt.dwthelper.InputStream;
 
 version(TANGOSVN){
-    import tango.io.device.File;
+import TangoFile = tango.io.device.File;
 } else {
-    import tango.io.FileConduit;
+import TangoFile = tango.io.FileConduit;
 }
-import tango.io.protocol.Reader;
 import tango.core.Exception;
 import tango.text.convert.Format;
 
@@ -20,11 +19,7 @@
 
     alias dwt.dwthelper.InputStream.InputStream.read read;
 
-    version(TANGOSVN)
-        private tango.io.device.File.File file_;
-    else
-        private FileConduit conduit;
-        
+    private TangoFile.File conduit;
     private ubyte[] buffer;
     private int buf_pos;
     private int buf_size;
@@ -32,20 +27,13 @@
     private bool eof;
 
     public this ( String name ){
-        version(TANGOSVN)
-            file_ = new tango.io.device.File.File( name );
-        else
-            conduit = new FileConduit( name );
-            
+        conduit = new TangoFile.File( name );
         buffer = new ubyte[]( BUFFER_SIZE );
     }
 
     public this ( dwt.dwthelper.File.File file ){
         implMissing( __FILE__, __LINE__ );
-        version(TANGOSVN)
-            file_ = new tango.io.device.File.File ( file.getAbsolutePath(), tango.io.device.File.File.ReadExisting );
-        else
-            conduit = new FileConduit( file.getAbsolutePath(), FileConduit.ReadExisting );
+        conduit = new TangoFile.File( file.getAbsolutePath(), TangoFile.File.ReadExisting );
         buffer = new ubyte[]( BUFFER_SIZE );
     }
 
@@ -56,10 +44,7 @@
         try{
             if( buf_pos == buf_size ){
                 buf_pos = 0;
-                version(TANGOSVN)
-                    buf_size = file_.read( buffer );
-                else
-                    buf_size = conduit.input.read( buffer );
+                buf_size = conduit.input.read( buffer );
             }
             if( buf_size <= 0 ){
                 eof = true;
@@ -88,10 +73,7 @@
     }
 
     public override void close(){
-        version(TANGOSVN)
-            file_.close();
-        else
-            conduit.close();
+        conduit.close();
     }
 }
 
--- a/dwt/dwthelper/FileOutputStream.d	Sat Apr 04 21:14:54 2009 +0200
+++ b/dwt/dwthelper/FileOutputStream.d	Sat Apr 04 21:38:37 2009 +0200
@@ -9,33 +9,23 @@
 import dwt.dwthelper.utils;
 
 version(TANGOSVN){
-import tango.io.device.File;
+import TangoFile = tango.io.device.File;
 } else {
-import tango.io.FileConduit;
+import TangoFile = tango.io.FileConduit;
 }
 
 public class FileOutputStream : dwt.dwthelper.OutputStream.OutputStream {
 
     alias dwt.dwthelper.OutputStream.OutputStream.write write;
     alias dwt.dwthelper.OutputStream.OutputStream.close close;
-    
-    version(TANGOSVN)
-        tango.io.device.File.File fc;
-    else
-        FileConduit fc;
+    TangoFile.File fc;
     
     public this ( String name ){
-        version(TANGOSVN)
-            fc = new tango.io.device.File.File( name, tango.io.device.File.File.WriteCreate );
-        else
-            fc = new FileConduit( name, FileConduit.WriteCreate );
+        fc = new TangoFile.File( name, TangoFile.File.WriteCreate );
     }
 
     public this ( String name, bool append ){
-        version(TANGOSVN)
-            fc = new tango.io.device.File.File( name, append ? tango.io.device.File.File.WriteAppending : tango.io.device.File.File.WriteCreate );
-        else    
-            fc = new FileConduit( name, append ? FileConduit.WriteAppending : FileConduit.WriteCreate );
+        fc = new TangoFile.File( name, append ? TangoFile.File.WriteAppending : TangoFile.File.WriteCreate );
     }
 
     public this ( dwt.dwthelper.File.File file ){
--- a/dwt/dwthelper/InflaterInputStream.d	Sat Apr 04 21:14:54 2009 +0200
+++ b/dwt/dwthelper/InflaterInputStream.d	Sat Apr 04 21:38:37 2009 +0200
@@ -5,7 +5,6 @@
 
 public import dwt.dwthelper.InputStream;
 import dwt.dwthelper.utils;
-import tango.io.Stdout;
 import tango.io.compress.ZlibStream;
 version(Windows){
     version(build){
@@ -26,19 +25,19 @@
         int res = istr.read( cast(byte[])dst );
         return res;
     }
-    void[] load (void[] dst = null) {
-            return Conduit.load (this, dst);
+
+    IOStream flush () {
+            return this;
+    }
+
+    void[] load ( size_t max = -1 ) {
+            return Conduit.load (this, max);
     }
 
     tango.io.model.IConduit.InputStream clear (){
         return this;
     }
 
-    long seek ( long offset, IOStream.Anchor anchor = IOStream.Anchor.Begin )
-    {
-        throw new IOException(__FILE__ ~ "seek method not implemented");
-    }
-    
     tango.io.model.IConduit.IConduit conduit (){
         return null;
     }
@@ -46,9 +45,11 @@
     void close (){
         istr.close();
     }
-    
-    tango.io.model.IConduit.InputStream input() {
-        return this; //??
+    tango.io.model.IConduit.InputStream input (){
+        return null;
+    }
+    long seek (long offset, Anchor anchor = Anchor.Begin){
+        return 0;
     }
 }
 
--- a/dwt/dwthelper/ResourceBundle.d	Sat Apr 04 21:14:54 2009 +0200
+++ b/dwt/dwthelper/ResourceBundle.d	Sat Apr 04 21:38:37 2009 +0200
@@ -4,15 +4,12 @@
 module dwt.dwthelper.ResourceBundle;
 
 import tango.text.Util;
-import tango.io.Stdout;
 
 import dwt.DWT;
 import dwt.dwthelper.utils;
-import tango.io.File;
+import tango.io.device.File;
 import tango.text.locale.Core;
 
-import tango.util.log.Trace;
-
 class ResourceBundle {
 
     String[ String ] map;
@@ -27,7 +24,7 @@
             char[] end = "_" ~ name ~ ".properties";
             foreach( entry; data ){
                 if( entry.name.length > end.length && entry.name[ $-end.length .. $ ] == end ){
-                    Trace.formatln( "ResourceBundle {}", entry.name );
+                    //Trace.formatln( "ResourceBundle {}", entry.name );
                     initialize( cast(char[])entry.data );
                     return;
                 }
@@ -36,12 +33,12 @@
         char[] end = "_" ~ name[0..2] ~ ".properties";
         foreach( entry; data ){
             if( entry.name.length > end.length && entry.name[ $-end.length .. $ ] == end ){
-                Trace.formatln( "ResourceBundle {}", entry.name );
+                //Trace.formatln( "ResourceBundle {}", entry.name );
                 initialize( cast(char[])entry.data );
                 return;
             }
         }
-        Trace.formatln( "ResourceBundle default" );
+        //Trace.formatln( "ResourceBundle default" );
         initialize( cast(char[])data[0].data );
     }
     public this( ImportData data ){
@@ -54,7 +51,6 @@
         String line;
         int dataIndex;
 
-        //tango.io.Stdout.Stdout.formatln( "properties put ..." );
         void readLine(){
             line.length = 0;
             char i = data[ dataIndex++ ];
@@ -64,22 +60,18 @@
             }
         }
 
-        //tango.io.Stdout.Stdout.formatln( "properties put {}", __LINE__ );
         bool linecontinue = false;
         bool iskeypart = true;
         String key;
         String value;
 nextline:
         while( dataIndex < data.length ){
-            //tango.io.Stdout.Stdout.formatln( "properties put {} startline", __LINE__ );
             readLine();
             line = dwt.dwthelper.utils.trim(line);
             if( line.length is 0 ){
-                //tango.io.Stdout.Stdout.formatln( "properties put {} was 0 length", __LINE__ );
                 continue;
             }
             if( line[0] == '#' ){
-                //tango.io.Stdout.Stdout.formatln( "properties put {} was comment", __LINE__ );
                 continue;
             }
             int pos = 0;
@@ -140,10 +132,8 @@
             }
             key = dwt.dwthelper.utils.trim(key);
             value = dwt.dwthelper.utils.trim(value);
-            //tango.io.Stdout.Stdout.formatln( "properties put {}=>{}", key, value );
 
             map[ key.dup ] = value.dup;
-            //tango.io.Stdout.Stdout.formatln( "properties put {}", __LINE__ );
         }
     }
 
@@ -170,8 +160,7 @@
     }
     public static ResourceBundle getBundle( String name ){
         try{
-            scope f = new File(name);
-            return new ResourceBundle( cast(String) f.read() );
+            return new ResourceBundle( cast(String) File.get(name) );
         }
         catch( IOException e){
             e.msg ~= " file:" ~ name;
--- a/dwt/dwthelper/System.d	Sat Apr 04 21:14:54 2009 +0200
+++ b/dwt/dwthelper/System.d	Sat Apr 04 21:38:37 2009 +0200
@@ -158,9 +158,7 @@
     public static String getProperty( String key ){
         /* get values for global system keys (environment) */
         switch( key ) {
-            // Ubuntu Gutsy:Environment.get for OSTYPE is not working
-            // Force default to "linux" for now -JJR
-            case "os.name": return Environment.get("OSTYPE","linux");
+            case "os.name": return "linux";// Environment.get("OSTYPE");
             case "user.name": return Environment.get("USER");
             case "user.home": return Environment.get("HOME");
             case "user.dir" : return Environment.get("PWD");
--- a/dwt/dwthelper/utils.d	Sat Apr 04 21:14:54 2009 +0200
+++ b/dwt/dwthelper/utils.d	Sat Apr 04 21:38:37 2009 +0200
@@ -10,13 +10,7 @@
 public import tango.core.Exception : IllegalArgumentException, IOException;
 
 import tango.io.Stdout;
-version(TANGOSVN) {
-    import tango.io.stream.Format;
-    alias FormatOutput Print;
-}
-else
-    import tango.io.Print;
-
+import tango.io.stream.Format;
 static import tango.stdc.stringz;
 static import tango.text.Util;
 static import tango.text.Text;
@@ -26,17 +20,21 @@
 import tango.core.Exception;
 import tango.stdc.stdlib : exit;
 
-import tango.util.log.Trace;
+import tango.util.log.Log;
 import tango.text.UnicodeData;
 
+Logger getDwtLogger(){
+    return Log.lookup( "dwt" );
+}
+
 alias char[] String;
 alias tango.text.Text.Text!(char) StringBuffer;
 
 alias ArrayBoundsException ArrayIndexOutOfBoundsException;
 
 void implMissing( String file, uint line ){
-    Stderr.formatln( "implementation missing in file {} line {}", file, line );
-    Stderr.formatln( "exiting ..." );
+    getDwtLogger().fatal( "implementation missing in file {} line {}", file, line );
+    getDwtLogger().fatal( "exiting ..." );
     exit(1);
 }
 
@@ -59,7 +57,7 @@
     public override hash_t toHash(){
         return (typeid(T[])).getHash(&array);
     }
-    static if( is( T == char[] )){
+    static if( is( T == char )){
         public override char[] toString(){
             return array;
         }
@@ -454,7 +452,7 @@
     dchar[] res = str.toString32( buf, &ate );
     consumed = ate;
     if( ate is 0 || res.length is 0 ){
-        Trace.formatln( "dwthelper.utils {}: str.length={} str={:X2}", __LINE__, str.length, cast(ubyte[])str );
+        getDwtLogger().trace( "dwthelper.utils {}: str.length={} str={:X2}", __LINE__, str.length, cast(ubyte[])str );
     }
     assert( ate > 0 );
     assert( res.length is 1 );
@@ -466,7 +464,7 @@
     dchar[] res = str.toString32( buf, &ate );
     consumed = ate;
     if( ate is 0 || res.length is 0 ){
-        Trace.formatln( "dwthelper.utils {}: str.length={} str={:X2}", __LINE__, str.length, cast(ubyte[])str );
+        getDwtLogger().trace( "dwthelper.utils {}: str.length={} str={:X2}", __LINE__, str.length, cast(ubyte[])str );
     }
     assert( ate > 0 );
     assert( res.length is 1 );
@@ -490,17 +488,54 @@
 //alias tango.text.convert.Utf.toString16 toString16;
 //alias tango.text.convert.Utf.toString toString;
 
+int toAbsoluteCodePointStartOffset( String str, int index ){
+    //getDwtLogger().trace( "str={}, str.length={}, index={}", str, str.length, index );
+    //Trace.memory( str );
+    if( str.length is index ){
+        return index;
+    }
+    if( ( str[index] & 0x80 ) is 0x00 ) {
+        return index;
+    }
+    else{
+        int steps = 0;
+        while(( str[index] & 0xC0 ) is 0x80 ){
+            index--;
+            steps++;
+            if( steps > 3 || index < 0 ){
+                break;
+            }
+        }
+        if((( str[index] & 0xE0 ) is 0xC0) && ( steps <= 1 )){
+            // ok
+        }
+        else if((( str[index] & 0xF0 ) is 0xE0) && ( steps <= 2 )){
+            // ok
+        }
+        else if((( str[index] & 0xF8 ) is 0xF0) && ( steps <= 3 )){
+            // ok
+        }
+        else{
+            tango.text.convert.Utf.onUnicodeError( "invalid utf8 input to toAbsoluteCodePointStartOffset" );
+        }
+        return index;
+    }
+}
 int getRelativeCodePointOffset( String str, int startIndex, int searchRelCp ){
     return getAbsoluteCodePointOffset( str, startIndex, searchRelCp ) - startIndex;
 }
 int getAbsoluteCodePointOffset( String str, int startIndex, int searchRelCp ){
+
+    //getDwtLogger().trace( "str={}, str.length={}, startIndex={}, searchRelCp={}", str, str.length, startIndex, searchRelCp );
+    //Trace.memory( str );
+
     int ignore;
     int i = startIndex;
     if( searchRelCp > 0 ){
         while( searchRelCp !is 0 ){
 
             if( ( i < str.length )
-                && ( str[i] & 0x80 ) is 0x00 )
+            && (( str[i] & 0x80 ) is 0x00 ))
             {
                 i+=1;
             }
@@ -526,7 +561,7 @@
                 i+=4;
             }
             else{
-                Trace.formatln( "invalid utf8 characters:  {:X2}", cast(ubyte[]) str );
+                getDwtLogger().trace( "getAbsoluteCodePointOffset invalid utf8 characters:  {:X2}", cast(ubyte[]) str );
                 tango.text.convert.Utf.onUnicodeError( "invalid utf8 input", i );
             }
             searchRelCp--;
@@ -538,8 +573,6 @@
                 i--;
                 if( i < 0 ){
                     return startIndex-1;
-                    //Trace.formatln( "dwthelper.utils getRelativeCodePointOffset {}: str={}, startIndex={}, searchRelCp={}", __LINE__, str, startIndex, searchRelCp );
-                    //tango.text.convert.Utf.onUnicodeError( "invalid utf8 input", i );
                 }
             } while(( str[i] & 0xC0 ) is 0x80 );
             searchRelCp++;
@@ -565,8 +598,8 @@
                 i+=2;
             }
             else{
-                Trace.formatln( "invalid utf8 characters:  {:X2}", cast(ubyte[]) str );
-                tango.text.convert.Utf.onUnicodeError( "invalid utf8 input", i );
+                getDwtLogger().trace( "invalid utf16 characters:  {:X2}", cast(ubyte[]) str );
+                tango.text.convert.Utf.onUnicodeError( "invalid utf16 input", i );
             }
             searchRelCp--;
         }
@@ -577,8 +610,8 @@
                 i--;
                 if( i < 0 ){
                     return startIndex-1;
-                    //Trace.formatln( "dwthelper.utils getRelativeCodePointOffset {}: str={}, startIndex={}, searchRelCp={}", __LINE__, str, startIndex, searchRelCp );
-                    //tango.text.convert.Utf.onUnicodeError( "invalid utf8 input", i );
+                    //getDwtLogger().trace( "dwthelper.utils getRelativeCodePointOffset {}: str={}, startIndex={}, searchRelCp={}", __LINE__, str, startIndex, searchRelCp );
+                    //tango.text.convert.Utf.onUnicodeError( "invalid utf16 input", i );
                 }
             } while(( str[i] & 0xDC00 ) is 0xDC00 );
             searchRelCp++;
@@ -627,8 +660,8 @@
         res--;
         assert( tries-- > 0 );
     }
-    Trace.formatln( "utf8OffsetDecr {}->{}", offset, res );
-    Trace.memory( str );
+    getDwtLogger().trace( "utf8OffsetDecr {}->{}", offset, res );
+    //Trace.memory( str );
     return res;
 }
 
@@ -1045,7 +1078,7 @@
 void ExceptionPrintStackTrace( Exception e ){
     ExceptionPrintStackTrace( e, Stderr );
 }
-void ExceptionPrintStackTrace( Exception e, Print!(char) print ){
+void ExceptionPrintStackTrace( Exception e, FormatOutput!(char) print ){
     Exception exception = e;
     while( exception !is null ){
         print.formatln( "Exception in {}({}): {}", exception.file, exception.line, exception.msg );
@@ -1265,7 +1298,7 @@
     const start = 3;
     foreach( msg; e.info ){
         if( idx >= start && idx < start+deepth ) {
-            Trace.formatln( "{}: {}", prefix, msg );
+            getDwtLogger().trace( "{}: {}", prefix, msg );
         }
         idx++;
     }
--- a/dwt/graphics/Device.d	Sat Apr 04 21:14:54 2009 +0200
+++ b/dwt/graphics/Device.d	Sat Apr 04 21:38:37 2009 +0200
@@ -28,7 +28,6 @@
 import dwt.dwthelper.utils;
 
 import tango.core.Exception;
-import tango.io.Stdout;
 
 /**
  * This class is the abstract superclass of all device objects,
@@ -841,7 +840,7 @@
         if (device.warningLevel is 0) {
             if (DEBUG || device.debugging) {
                 foreach( msg; (new Exception ("")).info ){
-                    Stderr.formatln( "trc {}", msg );
+                    getDwtLogger().error( "{}", msg );
                 }
             }
             //PORTING_FIXME ??
@@ -860,13 +859,13 @@
     if (device !is null) {
         if (DEBUG || device.debugging) {
             foreach( msg; (new Exception ("")).info ){
-                Stderr.formatln( "trc {}", msg );
+                getDwtLogger().error( "trc {}", msg );
             }
         }
     } else {
         if (DEBUG) {
             foreach( msg; (new Exception ("")).info ){
-                Stderr.formatln( "trc {}", msg );
+                getDwtLogger().error( "{}", msg );
             }
         }
     }
--- a/dwt/graphics/FontData.d	Sat Apr 04 21:14:54 2009 +0200
+++ b/dwt/graphics/FontData.d	Sat Apr 04 21:38:37 2009 +0200
@@ -19,7 +19,6 @@
 import tango.text.Util : locate;
 import tango.util.Convert;
 import dwt.dwthelper.utils;
-import tango.util.log.Trace;
 
 /**
  * Instances of this class describe operating system fonts.
@@ -277,7 +276,7 @@
             result = result[0 .. $ - 1];
         }
     }
-Trace.formatln( "getLocal {}", result );
+getDwtLogger().trace( "getLocal {}", result );
     return result;
 }
 
@@ -364,7 +363,7 @@
  * @see java.util.Locale#toString
  */
 public void setLocale(String locale) {
-Trace.formatln( "setLocal {}", locale );
+getDwtLogger().trace( "setLocal {}", locale );
     lang = country = variant = null;
     if (locale !is null) {
         char sep = '_';
--- a/dwt/internal/c/glx.d	Sat Apr 04 21:14:54 2009 +0200
+++ b/dwt/internal/c/glx.d	Sat Apr 04 21:38:37 2009 +0200
@@ -12,7 +12,6 @@
 
 version(DYNLINK){
     import tango.sys.SharedLib : SharedLib;
-    import tango.util.log.Trace;
     struct Symbol{
         String name;
         void** symbol;
@@ -35,11 +34,11 @@
                 }
                 catch(Exception e){}
                 if( *s.symbol is null ){
-                    Trace.formatln( "{}: Symbol '{}' not found", libname, s.name );
+                    getDwtLogger().trace( "{}: Symbol '{}' not found", libname, s.name );
                 }
             }
         } else {
-            Trace.formatln( "Could not load the library {}", libname );
+            getDwtLogger().trace( "Could not load the library {}", libname );
         }
     }
 }
--- a/dwt/internal/c/gtk.d	Sat Apr 04 21:14:54 2009 +0200
+++ b/dwt/internal/c/gtk.d	Sat Apr 04 21:38:37 2009 +0200
@@ -27,7 +27,6 @@
 
 
     import tango.sys.SharedLib : SharedLib;
-    import tango.util.log.Trace;
     struct Symbol{
         String name;
         void** symbol;
@@ -50,14 +49,14 @@
                 }
                 catch(Exception e){}
                 if( *s.symbol is null ){
-                    //Trace.formatln( "{}: Symbol '{}' not found", libname, s.name );
+                    //getDwtLogger().trace( "{}: Symbol '{}' not found", libname, s.name );
                 }
                 else{
                     loaded++;
                 }
             }
         } else {
-            Trace.formatln( "Could not load the library {}", libname );
+            getDwtLogger().trace( "Could not load the library {}", libname );
         }
         assert( gtk_check_version !is null );
     }
--- a/dwt/internal/c/gtk_unix_print_2_0.d	Sat Apr 04 21:14:54 2009 +0200
+++ b/dwt/internal/c/gtk_unix_print_2_0.d	Sat Apr 04 21:38:37 2009 +0200
@@ -10,7 +10,6 @@
 
 version(DYNLINK){
     import tango.sys.SharedLib : SharedLib;
-    import tango.util.log.Trace;
     struct Symbol{
         String name;
         void** symbol;
@@ -33,11 +32,11 @@
                 }
                 catch(Exception e){}
                 if( *s.symbol is null ){
-                    Trace.formatln( "{}: Symbol '{}' not found", libname, s.name );
+                    getDwtLogger().trace( "{}: Symbol '{}' not found", libname, s.name );
                 }
             }
         } else {
-            Trace.formatln( "Could not load the library {}", libname );
+            getDwtLogger().trace( "Could not load the library {}", libname );
         }
     }
 }
--- a/dwt/internal/c/pango.d	Sat Apr 04 21:14:54 2009 +0200
+++ b/dwt/internal/c/pango.d	Sat Apr 04 21:38:37 2009 +0200
@@ -12,7 +12,6 @@
 
 version(DYNLINK){
     import tango.sys.SharedLib : SharedLib;
-    import tango.util.log.Trace;
     struct Symbol{
         String name;
         void** symbol;
@@ -35,14 +34,14 @@
                 }
                 catch(Exception e){}
                 if( *s.symbol is null ){
-                    Trace.formatln( "{}: Symbol '{}' not found", libname, s.name );
+                    getDwtLogger().trace( "{}: Symbol '{}' not found", libname, s.name );
                 }
                 else{
                     loaded++;
                 }
             }
         } else {
-            Trace.formatln( "Could not load the library {}", libname );
+            getDwtLogger().trace( "Could not load the library {}", libname );
         }
     }
 }
--- a/dwt/internal/gtk/OS.d	Sat Apr 04 21:14:54 2009 +0200
+++ b/dwt/internal/gtk/OS.d	Sat Apr 04 21:38:37 2009 +0200
@@ -21,7 +21,6 @@
 import tango.core.Traits;
 import tango.stdc.locale;
 import tango.stdc.posix.stdlib : realpath;
-import tango.util.log.Trace;
 
 import  dwt.internal.c.gtk,
         dwt.internal.c.gdk,
--- a/dwt/printing/Printer.d	Sat Apr 04 21:14:54 2009 +0200
+++ b/dwt/printing/Printer.d	Sat Apr 04 21:38:37 2009 +0200
@@ -28,7 +28,6 @@
 import dwt.printing.PrinterData;
 import dwt.dwthelper.utils;
 
-import tango.io.Stdout;
 import tango.util.Convert;
 
 
@@ -205,7 +204,7 @@
         char [] valueBuffer = new char [end - start];
         System.arraycopy (settingsData, start, valueBuffer, 0, valueBuffer.length);
         OS.gtk_print_settings_set(settings, keyBuffer.ptr, valueBuffer.ptr);
-        if (DEBUG) Stdout.formatln("{}: {}", keyBuffer, valueBuffer );
+        if (DEBUG) getDwtLogger().info("{}: {}", keyBuffer, valueBuffer );
     }
     end++; // skip extra null terminator
 
@@ -338,7 +337,7 @@
     char [] valueBuffer = new char [length_];
     System.arraycopy (settingsData, start, valueBuffer, 0, length_);
 
-    if (DEBUG) tango.io.Stdout.Stdout.formatln( "{}: {}", keyBuffer, valueBuffer );
+    if (DEBUG) getDwtLogger().info( "{}: {}", keyBuffer, valueBuffer );
 
     return valueBuffer;
 }
@@ -604,7 +603,7 @@
 public override Point getDPI() {
     checkDevice();
     int resolution = OS.gtk_print_settings_get_resolution(settings);
-    if (DEBUG) tango.io.Stdout.Stdout.formatln("print_settings.resolution={}", resolution);
+    if (DEBUG) getDwtLogger().info("print_settings.resolution={}", resolution);
     //TODO: Return 72 (1/72 inch = 1 point) until gtk bug 346245 is fixed
     //TODO: Fix this: gtk_print_settings_get_resolution returns 0? (see gtk bug 346252)
     if (true || resolution is 0) return new Point(72, 72);
--- a/dwt/program/Program.d	Sat Apr 04 21:14:54 2009 +0200
+++ b/dwt/program/Program.d	Sat Apr 04 21:38:37 2009 +0200
@@ -32,7 +32,7 @@
 } else {
 import tango.io.FileConduit;
 }
-import tango.text.stream.LineIterator;
+import tango.io.stream.Lines;
 
 version( build ){
     pragma(link, "gnomeui-2" );
@@ -602,7 +602,7 @@
         scope file = new tango.io.device.File.File ("/usr/share/mime/globs");
     else
         scope file = new FileConduit ("/usr/share/mime/globs");
-    scope it = new LineIterator!(char)(file);
+    scope it = new Lines!(char)(file);
     // process file one line at a time
     String[][ String ] mimeInfo;
     foreach (line; it ){
--- a/dwt/widgets/Button.d	Sat Apr 04 21:14:54 2009 +0200
+++ b/dwt/widgets/Button.d	Sat Apr 04 21:38:37 2009 +0200
@@ -26,7 +26,6 @@
 import dwt.widgets.TypedListener;
 import dwt.widgets.Decorations;
 
-import tango.io.Stdout;
 
 /**
  * Instances of this class represent a selectable user interface object that
--- a/dwt/widgets/Composite.d	Sat Apr 04 21:14:54 2009 +0200
+++ b/dwt/widgets/Composite.d	Sat Apr 04 21:38:37 2009 +0200
@@ -33,8 +33,6 @@
 import dwt.graphics.Rectangle;
 import dwt.dwthelper.utils;
 
-import tango.io.Stdout;
-
 /**
  * Instances of this class are controls which are capable
  * of containing other controls.
--- a/dwt/widgets/Control.d	Sat Apr 04 21:14:54 2009 +0200
+++ b/dwt/widgets/Control.d	Sat Apr 04 21:38:37 2009 +0200
@@ -58,7 +58,6 @@
 
 import Math = tango.math.Math;
 import tango.core.Thread;
-import tango.io.Stdout;
 
 
 /**
--- a/dwt/widgets/Display.d	Sat Apr 04 21:14:54 2009 +0200
+++ b/dwt/widgets/Display.d	Sat Apr 04 21:38:37 2009 +0200
@@ -48,7 +48,6 @@
 import dwt.dwthelper.Runnable;
 
 import tango.core.Thread;
-import tango.io.Stdout;
 
 /**
  * Instances of this class are responsible for managing the
@@ -614,7 +613,7 @@
     OS.gtk_container_forall (cast(GtkContainer*)widget, cast(GtkCallback)&allChildrenProcFunc, &allChildrenProcCallbackData);
 }
 private static extern(C) int /*long*/ allChildrenProcFunc (GtkWidget* handle, void* user_data) {
-    version(LOG) Stderr.formatln( "Display {}:", __LINE__ ).flush;
+    version(LOG) getDwtLogger().error( "Display {}:", __LINE__ ).flush;
     CallbackData* cbdata = cast(CallbackData*)user_data;
     return cbdata.display.allChildrenProc( cast(GtkWidget*)handle, cast(int)cbdata.data );
 }
@@ -746,7 +745,7 @@
     GtkTreeIter *iter,
     void* data)
 {
-    version(LOG) Stderr.formatln( "Display {}:", __LINE__ ).flush;
+    version(LOG) getDwtLogger().error( "Display {}:", __LINE__ ).flush;
     CallbackData* cbdata = cast(CallbackData*)data;
     return cbdata.display.cellDataProc( tree_column, cell, tree_model, iter, cbdata.data );
 }
@@ -781,7 +780,7 @@
 }
 
 private static extern(C) int checkIfEventProcFunc (void* display, XEvent* xEvent, char* userData) {
-    version(LOG) Stderr.formatln( "Display {}:", __LINE__ ).flush;
+    version(LOG) getDwtLogger().error( "Display {}:", __LINE__ ).flush;
     auto disp = cast(Display)userData;
     return disp.checkIfEventProcMeth( display, xEvent );
 }
@@ -916,7 +915,7 @@
 }
 
 private static extern(C) int XErrorHandler( void*, XErrorEvent* ){
-    Stdout.formatln ("*** XError" );
+    getDwtLogger().error ("*** XError" );
     byte* p;
     *p = 3;
     return 0;
@@ -940,10 +939,10 @@
     char* ptr = OS.gtk_check_version (MAJOR, MINOR, MICRO);
     if (ptr !is null) {
         char [] buffer = fromStringz(ptr);
-        Stdout.formatln ("***WARNING: {}", buffer );
-        Stdout.formatln ("***WARNING: DWT requires GTK {}.{}.{}", MAJOR, MINOR, MICRO );
+        getDwtLogger().warn ("***WARNING: {}", buffer );
+        getDwtLogger().warn ("***WARNING: DWT requires GTK {}.{}.{}", MAJOR, MINOR, MICRO );
         int major = OS.gtk_major_version (), minor = OS.gtk_minor_version (), micro = OS.gtk_micro_version ();
-        Stdout.formatln ("***WARNING: Detected: {}.{}.{}", major, minor, micro);
+        getDwtLogger().warn ("***WARNING: Detected: {}.{}.{}", major, minor, micro);
     }
     if (fixed_type is 0) {
         GTypeInfo* fixed_info = new GTypeInfo ();
@@ -1205,7 +1204,7 @@
 }
 
 private static extern(C) void eventProcFunc (GdkEvent* event, void* data) {
-    version(LOG) Stderr.formatln( "Display {}:", __LINE__ ).flush;
+    version(LOG) getDwtLogger().error( "Display {}:", __LINE__ ).flush;
     Display disp = cast(Display)data;
     disp.eventProcMeth(event);
 }
@@ -1320,7 +1319,7 @@
 }
 
 private static extern(C) void fixedClassInitProcFunc (void* g_class, void* class_data) {
-    version(LOG) Stderr.formatln( "Display {}:", __LINE__ ).flush;
+    version(LOG) getDwtLogger().error( "Display {}:", __LINE__ ).flush;
     GtkWidgetClass* klass = cast(GtkWidgetClass*)g_class;
     klass.map = &fixedMapProcFunc;
     oldFixedSizeAllocateProc = klass.size_allocate;
@@ -1328,7 +1327,7 @@
 }
 
 private static extern(C)  void fixedMapProcFunc (GtkWidget * handle) {
-    version(LOG) Stderr.formatln( "Display {}:", __LINE__ ).flush;
+    version(LOG) getDwtLogger().error( "Display {}:", __LINE__ ).flush;
     Display display = getCurrent ();
     Widget widget = display.getWidget (handle);
     if (widget !is null) widget.fixedMapProc (handle);
@@ -1342,7 +1341,7 @@
 }
 
 private static extern(C) void rendererClassInitProcFunc (void* g_class, void* class_data) {
-    version(LOG) Stderr.formatln( "Display {}:", __LINE__ ).flush;
+    version(LOG) getDwtLogger().error( "Display {}:", __LINE__ ).flush;
     GtkCellRendererClass* klass = cast(GtkCellRendererClass*)g_class;
     klass.render = &rendererRenderProcFunc;
     klass.get_size = &rendererGetSizeProcFunc;
@@ -1357,13 +1356,13 @@
     int                  *width,
     int                  *height)
 {
-    version(LOG) Stderr.formatln( "Display {}:", __LINE__ ).flush;
+    version(LOG) getDwtLogger().error( "Display {}:", __LINE__ ).flush;
     Display display = getCurrent ();
     Widget widget = display.getWidget (handle);
     if (widget !is null) widget.rendererGetSizeProc (cell, handle, cell_area, x_offset, y_offset, width, height);
 }
 private static extern(C) void rendererRenderProcFunc(GtkCellRenderer * cell, GdkDrawable * window, GtkWidget * handle, GdkRectangle *background_area, GdkRectangle *cell_area, GdkRectangle *expose_area, int flags){
-    version(LOG) Stderr.formatln( "Display {}:", __LINE__ ).flush;
+    version(LOG) getDwtLogger().error( "Display {}:", __LINE__ ).flush;
     Display display = getCurrent ();
     Widget widget = display.getWidget (handle);
     if (widget !is null) widget.rendererRenderProc (cell, window, handle, background_area, cell_area, expose_area, flags);
@@ -1516,7 +1515,7 @@
 }
 
 private static extern(C) int filterProcFunc (GdkXEvent* xEvent, GdkEvent* gdkEvent, void* data) {
-    version(LOG) Stderr.formatln( "Display {}:", __LINE__ ).flush;
+    version(LOG) getDwtLogger().error( "Display {}:", __LINE__ ).flush;
     auto callbackdata = cast(CallbackData*)data;
     auto disp = callbackdata.display;
     if( disp is null ) return 0;
@@ -2355,7 +2354,7 @@
 }
 
 private static extern(C) int idleProcFunc (void* data) {
-    version(LOG) Stderr.formatln( "Display {}:", __LINE__ ).flush;
+    version(LOG) getDwtLogger().error( "Display {}:", __LINE__ ).flush;
     auto dbdata = cast(CallbackData*)data;
     return dbdata.display.idleProc();
 }
@@ -2797,7 +2796,7 @@
 }
 
 private static extern(C) void menuPositionProcFunc (GtkMenu* menu, int* x, int* y, int* push_in, void* user_data) {
-    version(LOG) Stderr.formatln( "Display {}:", __LINE__ ).flush;
+    version(LOG) getDwtLogger().error( "Display {}:", __LINE__ ).flush;
     auto display = cast(Display)user_data;
     display.menuPositionProc( menu, x, y, push_in, null );
 }
@@ -2876,7 +2875,7 @@
 }
 
 private static extern(C) int /*long*/ mouseHoverProcFunc ( void* user_data) {
-    version(LOG) Stderr.formatln( "Display {}:", __LINE__ ).flush;
+    version(LOG) getDwtLogger().error( "Display {}:", __LINE__ ).flush;
     CallbackData* cbdata = cast(CallbackData*)user_data;
     return cbdata.display.mouseHoverProc( cast(GtkWidget*)cbdata.data );
 }
@@ -3650,7 +3649,7 @@
 }
 
 package static extern(C) int /*long*/ setDirectionProcFunc (GtkWidget* widget, void* data) {
-    version(LOG) Stderr.formatln( "Display {}:", __LINE__ ).flush;
+    version(LOG) getDwtLogger().error( "Display {}:", __LINE__ ).flush;
     CallbackData* cbdata = cast(CallbackData*)data;
     return cbdata.display.setDirectionProc( widget, cast(int)cbdata.data );
 }
@@ -3899,7 +3898,7 @@
 
 
 private static extern(C) int timerProcFunc ( void * data ) {
-    version(LOG) Stderr.formatln( "Display {}:", __LINE__ ).flush;
+    version(LOG) getDwtLogger().error( "Display {}:", __LINE__ ).flush;
     CallbackData* cbdata = cast( CallbackData* ) data;
     return cbdata.display.timerProc( cast(int) cbdata.data );
 }
@@ -3917,7 +3916,7 @@
 }
 
 private static extern(C) int caretProcFunc ( void * data ) {
-    version(LOG) Stderr.formatln( "Display {}:", __LINE__ ).flush;
+    version(LOG) getDwtLogger().error( "Display {}:", __LINE__ ).flush;
     CallbackData* cbdata = cast( CallbackData* ) data;
     return cbdata.display.caretProc( cast(int) cbdata.data );
 }
@@ -3946,7 +3945,7 @@
 }
 
 private static extern(C) void sizeAllocateProcFunc (GtkWidget* handle, int /*long*/ arg0, int /*long*/ user_data) {
-    version(LOG) Stderr.formatln( "Display {}:", __LINE__ ).flush;
+    version(LOG) getDwtLogger().error( "Display {}:", __LINE__ ).flush;
     auto cbdata = cast(CallbackData*)user_data;
     cbdata.display.sizeAllocateProc( cast(GtkWidget*)handle, arg0, cast(int)cbdata.data );
 }
@@ -3965,7 +3964,7 @@
 }
 
 private static extern(C) void  sizeRequestProcFunc (GtkWidget* handle, int /*long*/ arg0, int /*long*/ user_data) {
-    version(LOG) Stderr.formatln( "Display {}:", __LINE__ ).flush;
+    version(LOG) getDwtLogger().error( "Display {}:", __LINE__ ).flush;
     auto cbdata = cast(CallbackData*)user_data;
     cbdata.display.sizeRequestProcMeth( cast(GtkWidget*)handle, arg0, cast(int)cbdata.data );
 }
@@ -3983,7 +3982,7 @@
 }
 
 private static extern(C) void  treeSelectionProcFunc (GtkTreeModel *model, GtkTreePath *path, GtkTreeIter *iter, void* data) {
-    version(LOG) Stderr.formatln( "Display {}:", __LINE__ ).flush;
+    version(LOG) getDwtLogger().error( "Display {}:", __LINE__ ).flush;
     auto cbdata = cast(CallbackData*)data;
     cbdata.display.treeSelectionProcMeth( model, path, iter, cbdata.data );
 }
@@ -4049,7 +4048,7 @@
 }
 
 private static extern(C) int /*long*/ shellMapProcFunc (int /*long*/ handle, int /*long*/ arg0, int /*long*/ user_data) {
-    version(LOG) Stderr.formatln( "Display {}:", __LINE__ ).flush;
+    version(LOG) getDwtLogger().error( "Display {}:", __LINE__ ).flush;
     auto cbdata = cast(CallbackData*)user_data;
     return cbdata.display.shellMapProc( cast(GtkWidget*)handle, arg0, cast(int)cbdata.data );
 }
@@ -4061,7 +4060,7 @@
 }
 
 private static extern(C) int /*long*/ styleSetProcFunc (int /*long*/ gobject, int /*long*/ arg1, int /*long*/ user_data) {
-    version(LOG) Stderr.formatln( "Display {}:", __LINE__ ).flush;
+    version(LOG) getDwtLogger().error( "Display {}:", __LINE__ ).flush;
     auto cbdata = cast(CallbackData*)user_data;
     return cbdata.display.styleSetProcMeth( gobject, arg1, cast(int)cbdata.data );
 }
@@ -4178,7 +4177,7 @@
 }
 
 private static extern(C) int /*long*/ windowProcFunc2 (GtkWidget* handle, int /*long*/ user_data) {
-    version(LOG) Stderr.formatln( "Display {}:", __LINE__ ).flush;
+    version(LOG) getDwtLogger().error( "Display {}:", __LINE__ ).flush;
     CallbackData* cbdata = cast(CallbackData*)user_data;
     return cbdata.display.windowProc( handle, cast(int)cbdata.data );
 }
@@ -4189,7 +4188,7 @@
 }
 
 private static extern(C) int /*long*/ windowProcFunc3 (int /*long*/ handle, int /*long*/ arg0, int /*long*/ user_data) {
-    version(LOG) Stderr.formatln( "Display {}:", __LINE__ ).flush;
+    version(LOG) getDwtLogger().error( "Display {}:", __LINE__ ).flush;
     CallbackData* cbdata = cast(CallbackData*)user_data;
     return cbdata.display.windowProc( cast(GtkWidget*)handle, arg0, cast(int)cbdata.data );
 }
@@ -4200,7 +4199,7 @@
 }
 
 private static extern(C) int /*long*/ windowProcFunc4 (int /*long*/ handle, int /*long*/ arg0, int /*long*/ arg1, int /*long*/ user_data) {
-    version(LOG) Stderr.formatln( "Display {}:", __LINE__ ).flush;
+    version(LOG) getDwtLogger().error( "Display {}:", __LINE__ ).flush;
     CallbackData* cbdata = cast(CallbackData*)user_data;
     return cbdata.display.windowProc( cast(GtkWidget*)handle, arg0, arg1, cast(int)cbdata.data );
 }
@@ -4211,7 +4210,7 @@
 }
 
 private static extern(C) int /*long*/ windowProcFunc5 (int /*long*/ handle, int /*long*/ arg0, int /*long*/ arg1, int /*long*/ arg2, int /*long*/ user_data) {
-    version(LOG) Stderr.formatln( "Display {}:", __LINE__ ).flush;
+    version(LOG) getDwtLogger().error( "Display {}:", __LINE__ ).flush;
     CallbackData* cbdata = cast(CallbackData*)user_data;
     return cbdata.display.windowProc( cast(GtkWidget*)handle, arg0, arg1, arg2, cast(int)cbdata.data );
 }
@@ -4226,7 +4225,7 @@
     return OS.gtk_timeout_add (delay, &windowTimerProcFunc, widget);
 }
 private static extern(C) int /*long*/ windowTimerProcFunc (void* user_data) {
-    version(LOG) Stderr.formatln( "Display {}:", __LINE__ ).flush;
+    version(LOG) getDwtLogger().error( "Display {}:", __LINE__ ).flush;
     Display d = cast(Display) OS.g_object_get_data(cast(GObject*)user_data, Display.classinfo.name.ptr );
     return d.windowTimerProc( cast(GtkWidget*)user_data );
 }
--- a/dwt/widgets/ProgressBar.d	Sat Apr 04 21:14:54 2009 +0200
+++ b/dwt/widgets/ProgressBar.d	Sat Apr 04 21:38:37 2009 +0200
@@ -23,7 +23,6 @@
 import dwt.widgets.Display;
 
 import Math = tango.math.Math;
-import tango.io.Stdout;
 
 /**
  * Instances of the receiver represent an unselectable
--- a/dwt/widgets/Widget.d	Sat Apr 04 21:14:54 2009 +0200
+++ b/dwt/widgets/Widget.d	Sat Apr 04 21:38:37 2009 +0200
@@ -28,10 +28,6 @@
 import tango.stdc.string;
 import tango.core.Thread;
 
-//version=LOG;
-version(LOG){
-    import tango.io.Stdout;
-}
 
 /**
  * This class is the abstract superclass of all user interface objects.
@@ -1625,7 +1621,7 @@
 
 int /*long*/ windowProc (GtkWidget* handle, int /*long*/ user_data) {
     void trace( String str ){
-        version(LOG) Stderr.formatln( "Widget windowProc {}", str ).flush;
+        version(LOG) getDwtLogger().error( "Widget windowProc {}", str ).flush;
     }
 
     switch (cast(int)/*64*/user_data) {
@@ -1688,7 +1684,7 @@
 
 int /*long*/ windowProc (GtkWidget* handle, int /*long*/ arg0, int /*long*/ user_data) {
     void trace( String str ){
-        version(LOG) Stderr.formatln( "Widget windowProc1 {}", str ).flush;
+        version(LOG) getDwtLogger().error( "Widget windowProc1 {}", str ).flush;
     }
 
     switch (cast(int)/*64*/user_data) {
@@ -1801,7 +1797,7 @@
 
 int /*long*/ windowProc (GtkWidget* handle, int /*long*/ arg0, int /*long*/ arg1, int /*long*/ user_data) {
     void trace( String str ){
-        version(LOG) Stderr.formatln( "Widget windowProc2 {}", str ).flush;
+        version(LOG) getDwtLogger().error( "Widget windowProc2 {}", str ).flush;
     }
 
     switch (cast(int)/*64*/user_data) {
@@ -1835,7 +1831,7 @@
 
 int /*long*/ windowProc (GtkWidget* handle, int /*long*/ arg0, int /*long*/ arg1, int /*long*/ arg2, int /*long*/ user_data) {
     void trace( String str ){
-        version(LOG) Stderr.formatln( "Widget windowProc3 {}", str ).flush;
+        version(LOG) getDwtLogger().error( "Widget windowProc3 {}", str ).flush;
     }
 
     switch (cast(int)/*64*/user_data) {