comparison dwt/graphics/Device.d @ 361:4bffbf81e2d6

redirect direct prints to DwtLogger
author Frank Benoit <benoit@tionex.de>
date Fri, 20 Mar 2009 21:00:06 +0100
parents 17757a168f51
children
comparison
equal deleted inserted replaced
360:ee1dd551f5b1 361:4bffbf81e2d6
26 import dwt.internal.Compatibility; 26 import dwt.internal.Compatibility;
27 import dwt.internal.gtk.OS; 27 import dwt.internal.gtk.OS;
28 import dwt.dwthelper.utils; 28 import dwt.dwthelper.utils;
29 29
30 import tango.core.Exception; 30 import tango.core.Exception;
31 import tango.io.Stdout;
32 31
33 /** 32 /**
34 * This class is the abstract superclass of all device objects, 33 * This class is the abstract superclass of all device objects,
35 * such as the Display device and the Printer device. Devices 34 * such as the Display device and the Printer device. Devices
36 * can have a graphics context (GC) created for them, and they 35 * can have a graphics context (GC) created for them, and they
839 Device device = findDevice (xDisplay); 838 Device device = findDevice (xDisplay);
840 if (device !is null) { 839 if (device !is null) {
841 if (device.warningLevel is 0) { 840 if (device.warningLevel is 0) {
842 if (DEBUG || device.debugging) { 841 if (DEBUG || device.debugging) {
843 foreach( msg; (new Exception ("")).info ){ 842 foreach( msg; (new Exception ("")).info ){
844 Stderr.formatln( "trc {}", msg ); 843 getDwtLogger().error( "{}", msg );
845 } 844 }
846 } 845 }
847 //PORTING_FIXME ?? 846 //PORTING_FIXME ??
848 //OS.Call (XErrorProc, xDisplay, xErrorEvent); 847 //OS.Call (XErrorProc, xDisplay, xErrorEvent);
849 } 848 }
858 private static extern(C) int /*long*/ XIOErrorProcFunc (void* xDisplay) { 857 private static extern(C) int /*long*/ XIOErrorProcFunc (void* xDisplay) {
859 Device device = findDevice (xDisplay); 858 Device device = findDevice (xDisplay);
860 if (device !is null) { 859 if (device !is null) {
861 if (DEBUG || device.debugging) { 860 if (DEBUG || device.debugging) {
862 foreach( msg; (new Exception ("")).info ){ 861 foreach( msg; (new Exception ("")).info ){
863 Stderr.formatln( "trc {}", msg ); 862 getDwtLogger().error( "trc {}", msg );
864 } 863 }
865 } 864 }
866 } else { 865 } else {
867 if (DEBUG) { 866 if (DEBUG) {
868 foreach( msg; (new Exception ("")).info ){ 867 foreach( msg; (new Exception ("")).info ){
869 Stderr.formatln( "trc {}", msg ); 868 getDwtLogger().error( "{}", msg );
870 } 869 }
871 } 870 }
872 } 871 }
873 //PORTING_FIXME ?? 872 //PORTING_FIXME ??
874 //OS.Call (XIOErrorProc, xDisplay, 0); 873 //OS.Call (XIOErrorProc, xDisplay, 0);