Changeset 197:184ab53b7785
- Timestamp:
- 04/10/08 05:19:49 (6 months ago)
- Files:
-
- dwt/custom/BusyIndicator.d (modified) (1 diff)
- dwt/custom/CTabFolder.d (modified) (1 diff)
- dwt/custom/StyledText.d (modified) (2 diffs)
- dwt/dnd/HTMLTransfer.d (modified) (1 diff)
- dwt/dnd/RTFTransfer.d (modified) (1 diff)
- dwt/dnd/TextTransfer.d (modified) (1 diff)
- dwt/dnd/URLTransfer.d (modified) (1 diff)
- dwt/dwthelper/BufferedInputStream.d (modified) (1 diff)
- dwt/dwthelper/Float.d (deleted)
- dwt/dwthelper/Integer.d (deleted)
- dwt/dwthelper/ResourceBundle.d (modified) (5 diffs)
- dwt/dwthelper/System.d (modified) (1 diff)
- dwt/dwthelper/utils.d (modified) (12 diffs)
- dwt/graphics/Color.d (modified) (4 diffs)
- dwt/graphics/Cursor.d (modified) (1 diff)
- dwt/graphics/Device.d (modified) (2 diffs)
- dwt/graphics/Font.d (modified) (5 diffs)
- dwt/graphics/FontData.d (modified) (1 diff)
- dwt/graphics/GC.d (modified) (5 diffs)
- dwt/graphics/Image.d (modified) (14 diffs)
- dwt/internal/BidiUtil.d (modified) (1 diff)
- dwt/internal/DWTEventObject.d (modified) (3 diffs)
- dwt/internal/image/TIFFDirectory.d (modified) (1 diff)
- dwt/layout/GridLayout.d (modified) (1 diff)
- dwt/program/Program.d (modified) (1 diff)
- dwt/widgets/Display.d (modified) (2 diffs)
- dwt/widgets/Spinner.d (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
dwt/custom/BusyIndicator.d
r155 r197 19 19 import dwt.widgets.Display; 20 20 import dwt.widgets.Shell; 21 import dwt.dwthelper. Integer;21 import dwt.dwthelper.utils; 22 22 import dwt.dwthelper.Runnable; 23 23 dwt/custom/CTabFolder.d
r178 r197 50 50 51 51 import dwt.dwthelper.utils; 52 import dwt.dwthelper.Integer;53 52 import tango.util.Convert; 54 53 static import tango.text.convert.Utf; dwt/custom/StyledText.d
r178 r197 466 466 } 467 467 } 468 void init () {468 void init_() { 469 469 Rectangle trim = printer.computeTrim(0, 0, 0, 0); 470 470 Point dpi = printer.getDPI(); … … 695 695 } 696 696 if (printer.startJob(jobName)) { 697 init ();697 init_(); 698 698 print(); 699 699 dispose(); dwt/dnd/HTMLTransfer.d
r140 r197 21 21 import dwt.dnd.DND; 22 22 23 import dwt.dwthelper.Integer;24 23 import dwt.dwthelper.utils; 25 24 static import tango.text.Text; dwt/dnd/RTFTransfer.d
r141 r197 21 21 import dwt.dnd.DND; 22 22 23 import dwt.dwthelper.Integer;24 23 import dwt.dwthelper.utils; 25 24 static import tango.text.Text; dwt/dnd/TextTransfer.d
r158 r197 21 21 import dwt.dnd.DND; 22 22 23 import dwt.dwthelper.Integer;24 23 import dwt.dwthelper.utils; 25 24 static import tango.text.Text; dwt/dnd/URLTransfer.d
r145 r197 23 23 import dwt.dnd.DND; 24 24 25 import dwt.dwthelper.Integer;26 25 import dwt.dwthelper.utils; 27 26 static import tango.text.Text; dwt/dwthelper/BufferedInputStream.d
r0 r197 51 51 pos = 0; 52 52 count = 0; 53 intcount = getAndCheckIstr().read( buf );53 count = getAndCheckIstr().read( buf ); 54 54 if( count < 0 ){ 55 55 count = 0; dwt/dwthelper/ResourceBundle.d
r124 r197 7 7 import tango.io.Stdout; 8 8 9 import dwt.DWT; 10 import dwt.dwthelper.utils; 9 11 10 12 class ResourceBundle { … … 35 37 //tango.io.Stdout.Stdout.formatln( "properties put {} startline", __LINE__ ); 36 38 readLine(); 37 line = line.trim();39 line = dwt.dwthelper.utils.trim(line); 38 40 if( line.length is 0 ){ 39 41 //tango.io.Stdout.Stdout.formatln( "properties put {} was 0 length", __LINE__ ); … … 62 64 case 'n': c = '\n'; break; 63 65 case '\\': c = '\\'; break; 66 case '\"': c = '\"'; break; 64 67 default: break; 65 68 } … … 90 93 } 91 94 if( iskeypart ){ 92 //tango.io.Stdout.Stdout.formatln( "dwt.dwthelper.ResourceBundle ctor cannot find '='." ); 95 // Cannot find '=' in record 96 DWT.error( __FILE__, __LINE__, DWT.ERROR_INVALID_ARGUMENT ); 93 97 continue; 94 98 } 95 key = key.trim();96 value = value.trim();99 key = dwt.dwthelper.utils.trim(key); 100 value = dwt.dwthelper.utils.trim(value); 97 101 //tango.io.Stdout.Stdout.formatln( "properties put {}=>{}", key, value ); 98 102 … … 110 114 return (*v).dup; 111 115 } 112 return key; 116 throw new MissingResourceException( "key not found", this.classinfo.name, key ); 117 } 118 119 public char[][] getKeys(){ 120 return map.keys; 113 121 } 114 122 dwt/dwthelper/System.d
r84 r197 129 129 .exit(code); 130 130 } 131 public static int identityHashCode(Object x){ 132 if( x is null ){ 133 return 0; 134 } 135 return (*cast(Object *)&x).toHash(); 136 } 131 137 138 public static char[] getProperty( char[] key ){ 139 switch( key ){ 140 case "os.name": return "windows"; 141 default: return null; 142 } 143 } 132 144 } 133 145 dwt/dwthelper/utils.d
r194 r197 10 10 11 11 import tango.io.Stdout; 12 import tango.io.Print; 12 13 import tango.stdc.stringz; 13 14 static import tango.text.Util; 15 static import tango.text.Text; 14 16 import tango.text.Unicode; 15 17 import tango.text.convert.Utf; … … 18 20 19 21 import tango.util.log.Trace; 22 import tango.text.UnicodeData; 23 static import tango.util.collection.model.Seq; 24 // static import tango.util.collection.ArraySeq; 25 // static import tango.util.collection.LinkSeq; 26 // static import tango.util.collection.model.Map; 27 // static import tango.util.collection.HashMap; 28 // 29 // alias tango.util.collection.model.Seq.Seq!(Object) List; 30 // alias tango.util.collection.ArraySeq.ArraySeq!(Object) ArrayList; 31 // alias tango.util.collection.LinkSeq.LinkSeq!(Object) LinkList; 32 // alias tango.util.collection.model.Map.Map!(Object,Object) Map; 33 // alias tango.util.collection.HashMap.HashMap!(Object,Object) HashMap; 34 35 alias char[] String; 36 alias tango.text.Text.Text!(char) StringBuffer; 20 37 21 38 void implMissing( char[] file, uint line ){ … … 42 59 value = data; 43 60 } 44 } 45 46 alias ValueWrapperT!(bool) ValueWrapperBool; 47 alias ValueWrapperT!(int) ValueWrapperInt; 48 alias ValueWrapperT!(long) ValueWrapperLong; 61 public int opEquals( T other ){ 62 return value == other; 63 } 64 public int opEquals( Object other ){ 65 if( auto o = cast(ValueWrapperT!(T))other ){ 66 return value == o.value; 67 } 68 return false; 69 } 70 } 71 72 class Boolean : ValueWrapperT!(bool) { 73 public static Boolean TRUE; 74 public static Boolean FALSE; 75 public this( bool v ){ 76 super(v); 77 } 78 79 alias ValueWrapperT!(bool).opEquals opEquals; 80 public int opEquals( int other ){ 81 return value == ( other !is 0 ); 82 } 83 public int opEquals( Object other ){ 84 if( auto o = cast(Boolean)other ){ 85 return value == o.value; 86 } 87 return false; 88 } 89 public bool booleanValue(){ 90 return value; 91 } 92 } 93 94 alias Boolean ValueWrapperBool; 95 96 97 class Byte : ValueWrapperT!(byte) { 98 public static byte parseByte( char[] s ){ 99 try{ 100 int res = tango.text.convert.Integer.parse( s ); 101 if( res < byte.min || res > byte.max ){ 102 throw new NumberFormatException( "out of range" ); 103 } 104 return res; 105 } 106 catch( IllegalArgumentException e ){ 107 throw new NumberFormatException( e ); 108 } 109 } 110 this( byte value ){ 111 super( value ); 112 } 113 } 114 alias Byte ValueWrapperByte; 115 116 117 class Integer : ValueWrapperT!(int) { 118 119 public static int MIN_VALUE = 0x80000000; 120 public static int MAX_VALUE = 0x7fffffff; 121 public static int SIZE = 32; 122 123 public this ( int value ){ 124 super( value ); 125 } 126 127 public this ( char[] s ){ 128 implMissing( __FILE__, __LINE__ ); 129 super(0); 130 } 131 132 public static char[] toString( int i, int radix ){ 133 switch( radix ){ 134 case 2: 135 return toBinaryString(i); 136 case 8: 137 return toOctalString(i); 138 case 10: 139 return toString(i); 140 case 16: 141 return toHexString(i); 142 default: 143 implMissing( __FILE__, __LINE__ ); 144 return null; 145 } 146 } 147 148 public static char[] toHexString( int i ){ 149 return tango.text.convert.Integer.toString(i, tango.text.convert.Integer.Style.Hex ); 150 } 151 152 public static char[] toOctalString( int i ){ 153 return tango.text.convert.Integer.toString(i, tango.text.convert.Integer.Style.Octal ); 154 } 155 156 public static char[] toBinaryString( int i ){ 157 return tango.text.convert.Integer.toString(i, tango.text.convert.Integer.Style.Binary ); 158 } 159 160 public static char[] toString( int i ){ 161 return tango.text.convert.Integer.toString(i); 162 } 163 164 public static int parseInt( char[] s, int radix ){ 165 try{ 166 return tango.text.convert.Integer.parse( s, cast(uint)radix ); 167 } 168 catch( IllegalArgumentException e ){ 169 throw new NumberFormatException( e ); 170 } 171 } 172 173 public static int parseInt( char[] s ){ 174 try{ 175 return tango.text.convert.Integer.parse( s ); 176 } 177 catch( IllegalArgumentException e ){ 178 throw new NumberFormatException( e ); 179 } 180 } 181 182 public static Integer valueOf( char[] s, int radix ){ 183 implMissing( __FILE__, __LINE__ ); 184 return null; 185 } 186 187 public static Integer valueOf( char[] s ){ 188 implMissing( __FILE__, __LINE__ ); 189 return null; 190 } 191 192 public static Integer valueOf( int i ){ 193 implMissing( __FILE__, __LINE__ ); 194 return null; 195 } 196 197 public byte byteValue(){ 198 return cast(byte)value; 199 } 200 201 public short shortValue(){ 202 return cast(short)value; 203 } 204 205 public int intValue(){ 206 return value; 207 } 208 209 public long longValue(){ 210 return cast(long)value; 211 } 212 213 public float floatValue(){ 214 return cast(float)value; 215 } 216 217 public double doubleValue(){ 218 return cast(double)value; 219 } 220 221 public override hash_t toHash(){ 222 return intValue(); 223 } 224 225 public override char[] toString(){ 226 return tango.text.convert.Integer.toString( value ); 227 } 228 } 229 alias Integer ValueWrapperInt; 230 231 class Double : ValueWrapperT!(double) { 232 this( double value ){ 233 super(value); 234 } 235 this( char[] str ){ 236 implMissing( __FILE__, __LINE__ ); 237 super(0.0); 238 } 239 public double doubleValue(){ 240 return value; 241 } 242 public static char[] toString( double value ){ 243 implMissing( __FILE__, __LINE__ ); 244 return null; 245 } 246 } 247 248 class Float : ValueWrapperT!(float) { 249 250 public static float POSITIVE_INFINITY = (1.0f / 0.0f); 251 public static float NEGATIVE_INFINITY = ((-1.0f) / 0.0f); 252 public static float NaN = (0.0f / 0.0f); 253 public static float MAX_VALUE = 3.4028235e+38f; 254 public static float MIN_VALUE = 1.4e-45f; 255 public static int SIZE = 32; 256 257 this( float value ){ 258 super(value); 259 } 260 this( char[] str ){ 261 implMissing( __FILE__, __LINE__ ); 262 super(0.0); 263 } 264 public float floatValue(){ 265 return value; 266 } 267 public static char[] toString( float value ){ 268 implMissing( __FILE__, __LINE__ ); 269 return null; 270 } 271 public static float parseFloat( char[] s ){ 272 try{ 273 return tango.text.convert.Float.toFloat( s ); 274 } 275 catch( IllegalArgumentException e ){ 276 throw new NumberFormatException( e ); 277 } 278 } 279 280 } 281 class Long : ValueWrapperT!(long) { 282 this( long value ){ 283 super(value); 284 } 285 this( char[] str ){ 286 implMissing( __FILE__, __LINE__ ); 287 super(0); 288 } 289 public long longValue(){ 290 return value; 291 } 292 public static long parseLong(char[] s){ 293 implMissing( __FILE__, __LINE__ ); 294 return 0; 295 } 296 public static char[] toString( double value ){ 297 implMissing( __FILE__, __LINE__ ); 298 return null; 299 } 300 } 301 alias Long ValueWrapperLong; 302 303 304 // alias ValueWrapperT!(int) ValueWrapperInt; 305 49 306 alias ArrayWrapperT!(byte) ArrayWrapperByte; 50 307 alias ArrayWrapperT!(int) ArrayWrapperInt; … … 53 310 alias ArrayWrapperT!(char[]) ArrayWrapperString2; 54 311 312 Object[] StringArrayToObjectArray( String[] strs ){ 313 Object[] res = new Object[strs.length]; 314 foreach( idx, str; strs ){ 315 res[idx] = new ArrayWrapperString(str); 316 } 317 return res; 318 } 55 319 int codepointIndexToIndex( char[] str, int cpIndex ){ 56 320 int cps = cpIndex; … … 204 468 } 205 469 470 bool CharacterIsDefined( dchar ch ){ 471 return (ch in tango.text.UnicodeData.unicodeData) !is null; 472 } 206 473 dchar CharacterFirstToLower( char[] str ){ 207 474 int consumed; … … 229 496 return tango.text.Unicode.isDigit( c ); 230 497 } 498 bool CharacterIsLetter( dchar c ){ 499 return tango.text.Unicode.isLetter( c ); 500 } 501 public char[] toUpperCase( char[] str ){ 502 return tango.text.Unicode.toUpper( str ); 503 } 231 504 232 505 public int indexOf( char[] str, char searched ){ … … 260 533 return res; 261 534 } 535 public int lastIndexOf(char[] str, char[] ch ){ 536 return lastIndexOf( str, ch, str.length ); 537 } 538 public int lastIndexOf(char[] str, char[] ch, int start ){ 539 int res = tango.text.Util.locatePatternPrior( str, ch, start ); 540 if( res is str.length ) res = -1; 541 return res; 542 } 262 543 263 544 public char[] replace( char[] str, char from, char to ){ … … 314 595 return src[ 0 .. pattern.length ] == pattern; 315 596 } 597 316 598 public char[] toLowerCase( char[] src ){ 317 599 return tango.text.Unicode.toLower( src ); … … 324 606 public char[] trim( char[] str ){ 325 607 return tango.text.Util.trim( str ).dup; 608 } 609 public char[] intern( char[] str ){ 610 return str; 326 611 } 327 612 … … 347 632 } 348 633 634 class RuntimeException : Exception { 635 this( char[] e = null){ 636 super(e); 637 } 638 this( Exception e ){ 639 super(e.toString); 640 } 641 } 642 class IndexOutOfBoundsException : Exception { 643 this( char[] e = null){ 644 super(e); 645 } 646 } 647 648 class UnsupportedOperationException : RuntimeException { 649 this( char[] e = null){ 650 super(e); 651 } 652 this( Exception e ){ 653 super(e.toString); 654 } 655 } 349 656 class NumberFormatException : IllegalArgumentException { 350 657 this( char[] e ){ … … 353 660 this( Exception e ){ 354 661 super(e.toString); 662 } 663 } 664 class NullPointerException : Exception { 665 this( char[] e = null ){ 666 super(e); 667 } 668 this( Exception e ){ 669 super(e.toString); 670 } 671 } 672 class IllegalStateException : Exception { 673 this( char[] e = null ){ 674 super(e); 675 } 676 this( Exception e ){ 677 super(e.toString); 678 } 679 } 680 class InterruptedException : Exception { 681 this( char[] e = null ){ 682 super(e); 683 } 684 this( Exception e ){ 685 super(e.toString); 686 } 687 } 688 class InvocationTargetException : Exception { 689 Exception cause; 690 this( Exception e = null, char[] msg = null ){ 691 super(msg); 692 cause = e; 693 } 694 695 alias getCause getTargetException; 696 Exception getCause(){ 697 return cause; 698 } 699 } 700 class MissingResourceException : Exception { 701 char[] classname; 702 char[] key; 703 this( char[] msg, char[] classname, char[] key ){ 704 super(msg); 705 this.classname = classname; 706 this.key = key; 707 } 708 } 709 class ParseException : Exception { 710 this( char[] e = null ){ 711 super(e); 712 } 713 } 714 715 interface Cloneable{ 716 } 717 718 interface Comparable { 719 int compareTo(Object o); 720 } 721 interface Comparator { 722 int compare(Object o1, Object o2); 723 } 724 interface EventListener{ 725 } 726 727 class EventObject { 728 protected Object source; 729 730 public this(Object source) { 731 if (source is null) 732 throw new IllegalArgumentException( "null arg" ); 733 this.source = source; 734 } 735 736 public Object getSource() { 737 return source; 738 } 739 740 public override char[] toString() { 741 return this.classinfo.name ~ "[source=" ~ source.toString() ~ "]"; 355 742 } 356 743 } … … 371 758 372 759 373 374 760 void ExceptionPrintStackTrace( Exception e ){ 761 ExceptionPrintStackTrace( e, Stderr ); 762 } 763 void ExceptionPrintStackTrace( Exception e, Print!(char) print ){ 764 print.formatln( "Exception in {}({}): {}", e.file, e.line, e.msg ); 765 } 766 767 interface Reader{ 768 } 769 interface Writer{ 770 } 771 772 773 class Collator : Comparator { 774 public static Collator getInstance(){ 775 implMissing( __FILE__, __LINE__ ); 776 return null; 777 } 778 private this(){ 779 } 780 int compare(Object o1, Object o2){ 781 implMissing( __FILE__, __LINE__ ); 782 return 0; 783 } 784 } 785 786 interface Enumeration { 787 public bool hasMoreElements(); 788 public Object nextElement(); 789 } 790 791 792 template arraycast(T) { 793 T[] arraycast(U) (U[] u) { 794 static if ( 795 (is (T == interface ) && is (U == interface )) || 796 (is (T == class ) && is (U == class ))) { 797 return(cast(T[])u); 798 } 799 else { 800 int l = u.length; 801 T[] res; 802 res.length = l; 803 for (int i = 0; i < l; i++) { 804 res[i] = cast(T)u[i]; 805 } 806 return(res); 807 } 808 } 809 } 810 811 char[] stringcast( Object o ){ 812 if( auto str = cast(ArrayWrapperString) o ){ 813 return str.array; 814 } 815 return null; 816 } 817 char[][] stringcast( Object[] objs ){ 818 char[][] res = new char[][](objs.length); 819 foreach( idx, obj; objs ){ 820 res[idx] = stringcast(obj); 821 } 822 return res; 823 } 824 ArrayWrapperString stringcast( char[] str ){ 825 return new ArrayWrapperString( str ); 826 } 827 ArrayWrapperString[] stringcast( char[][] strs ){ 828 ArrayWrapperString[] res = new ArrayWrapperString[ strs.length ]; 829 foreach( idx, str; strs ){ 830 res[idx] = stringcast(str); 831 } 832 return res; 833 } 834 835 836 bool ArrayEquals(T)( T[] a, T[] b ){ 837 if( a.length !is b.length ){ 838 return false; 839 } 840 for( int i = 0; i < a.length; i++ ){ 841 static if( is( T==class) || is(T==interface)){ 842 if( a[i] !is null && b[i] !is null ){ 843 if( a[i] != b[i] ){ 844 return false; 845 } 846 } 847 else if( a[i] is null && b[i] is null ){ 848 } 849 else{ 850 return false; 851 } 852 } 853 else{ 854 if( a[i] != b[i] ){ 855 return false; 856 } 857 } 858 } 859 } 860 861 class Arrays{ 862 public static bool equals(Object[] a, Object[] b){ 863 if( a.length !is b.length ){ 864 return false; 865 } 866 for( int i = 0; i < a.length; i++ ){ 867 if( a[i] is null && b[i] is null ){ 868 continue; 869 } 870 if( a[i] !is null && b[i] !is null && a[i] == b[i] ){ 871 continue; 872 } 873 return false; 874 } 875 return true; 876 } 877 } 878 879 int SeqIndexOf(T)( tango.util.collection.model.Seq.Seq!(T) s, T src ){ 880 int idx; 881 foreach( e; s ){ 882 if( e == src ){ 883 return idx; 884 } 885 idx++; 886 } 887 return -1; 888 } 889 int arrayIndexOf(T)( T[] arr, T v ){ 890 int res = -1; 891 int idx = 0; 892 foreach( p; arr ){ 893 if( p == v){ 894 res = idx; 895 break; 896 } 897 idx++; 898 } 899 return res; 900 } 901 902 int seqIndexOf( tango.util.collection.model.Seq.Seq!(Object) seq, Object v ){ 903 int res = -1; 904 int idx = 0; 905 foreach( p; seq ){ 906 if( p == v){ 907 res = idx; 908 break; 909 } 910 idx++; 911 } 912 return res; 913 } 914 915 void PrintStackTrace(){ 916 try{ 917 throw new Exception( null ); 918 } 919 catch( Exception e ){ 920 foreach( msg; e.info ){ 921 Trace.formatln( "trc: {}", msg ); 922 } 923 } 924 } 925 926 struct ImportData{ 927 void[] data; 928 char[] name; 929 930 public static ImportData opCall( void[] data, char[] name ){ 931 ImportData res; 932 res.data = data; 933 res.name = name; 934 return res; 935 } 936 } 937 938 template getImportData(char[] name ){ 939 const ImportData getImportData = ImportData( import(name), name ); 940 } dwt/graphics/Color.d
r48 r197 12 12 *******************************************************************************/ 13 13 module dwt.graphics.Color; 14 15 14 16 15 import dwt.DWT; … … 86 85 if (device is null) device = Device.getDevice(); 87 86 if (device is null) DWT.error(DWT.ERROR_NULL_ARGUMENT); 88 init (device, red, green, blue);87 init_(device, red, green, blue); 89 88 if (device.tracking) device.new_Object(this); 90 89 } … … 116 115 if (device is null) DWT.error(DWT.ERROR_NULL_ARGUMENT); 117 116 if (rgb is null) DWT.error(DWT.ERROR_NULL_ARGUMENT); 118 init (device, rgb.red, rgb.green, rgb.blue);117 init_(device, rgb.red, rgb.green, rgb.blue); 119 118 if (device.tracking) device.new_Object(this); 120 119 } … … 250 249 * @see #dispose 251 250 */ 252 void init (Device device, int red, int green, int blue) {251 void init_(Device device, int red, int green, int blue) { 253 252 if (red > 255 || red < 0 || green > 255 || green < 0 || blue > 255 || blue < 0) { 254 253 DWT.error(DWT.ERROR_INVALID_ARGUMENT); dwt/graphics/Cursor.d
r175 r197 348 348 } 349 349 ImageData mask = source.getTransparencyMask(); 350 int[] result = Image.init (device, null, source, mask);350 int[] result = Image.init_(device, null, source, mask); 351 351 auto hBitmap = cast(HBITMAP)result[0]; 352 352 auto hMask = cast(HBITMAP)result[1]; dwt/graphics/Device.d
r174 r197 143 143 } 144 144 create (data); 145 init ();145 init_ (); 146 146 if (tracking) { 147 147 errors = new Exception [128]; … … 656 656 * @see #create 657 657 */ 658 protected void init () {658 protected void init_ () { 659 659 if (debug_) { 660 660 static if (!OS.IsWinCE) OS.GdiSetBatchLimit(1); dwt/graphics/Font.d
r48 r197 81 81 if (device is null) device = Device.getDevice(); 82 82 if (device is null) DWT.error(DWT.ERROR_NULL_ARGUMENT); 83 init (device, fd);83 init_(device, fd); 84 84 if (device.tracking) device.new_Object(this); 85 85 } … … 116 116 if (fds[i] is null) DWT.error(DWT.ERROR_INVALID_ARGUMENT); 117 117 } 118 init (device, fds[0]);118 init_(device, fds[0]); 119 119 if (device.tracking) device.new_Object(this); 120 120 } … … 146 146 if (device is null) DWT.error(DWT.ERROR_NULL_ARGUMENT); 147 147 if (name is null) DWT.error(DWT.ERROR_NULL_ARGUMENT); 148 init (device, new FontData (name, height, style));148 init_(device, new FontData (name, height, style)); 149 149 if (device.tracking) device.new_Object(this); 150 150 } … … 154 154 if (device is null) DWT.error(DWT.ERROR_NULL_ARGUMENT); 155 155 if (name is null) DWT.error(DWT.ERROR_NULL_ARGUMENT); 156 init (device, new FontData (name, height, style));156 init_(device, new FontData (name, height, style)); 157 157 if (device.tracking) device.new_Object(this); 158 158 } … … 223 223 } 224 224 225 void init (Device device, FontData fd) {225 void init_ (Device device, FontData fd) { 226 226 if (fd is null) DWT.error(DWT.ERROR_NULL_ARGUMENT); 227 227 this.device = device; dwt/graphics/FontData.d
r175 r197 18 18 19 19 import dwt.dwthelper.utils; 20 import dwt.dwthelper.Float;21 import dwt.dwthelper.Integer;22 20 static import tango.text.Text; 23 21 import tango.util.Convert; dwt/graphics/GC.d
r194 r197 12 12 *******************************************************************************/ 13 13 module dwt.graphics.GC; 14 15 16 17 /+18 //PORTING_TYPE19 class GC{20 void dispose();21 bool isDisposed();22 void flush ();23 GCData data;24 HDC handle;25 public void drawImage(Image image, int x, int y) ;26 public void drawImage(Image image, int srcX, int srcY, int srcWidth, int srcHeight, int destX, int destY, int destWidth, int destHeight) ;27 void drawImage(Image srcImage, int srcX, int srcY, int srcWidth, int srcHeight, int destX, int destY, int destWidth, int destHeight, bool simple) ;28 }29 +/30 14 31 15 import dwt.DWT; … … 197 181 if (device is null) DWT.error(DWT.ERROR_NULL_ARGUMENT); 198 182 this.device = data.device = device; 199 init (drawable, data, hDC);183 init_ (drawable, data, hDC); 200 184 if (device.tracking) device.new_Object(this); 201 185 } … … 3700 3684 } 3701 3685 3702 void init (Drawable drawable, GCData data, HDC hDC) {3686 void init_(Drawable drawable, GCData data, HDC hDC) { 3703 3687 auto foreground = data.foreground; 3704 3688 if (foreground !is -1) { … … 4871 4855 auto hDC = drawable.internal_new_GC(data); 4872 4856 gc.device = data.device; 4873 gc.init (drawable, data, hDC);4857 gc.init_(drawable, data, hDC); 4874 4858 return gc; 4875 4859 } … … 4893 4877 GC gc = new GC(); 4894 4878 gc.device = data.device; 4895 gc.init (null, data, hDC);4879 gc.init_(null, data, hDC); 4896 4880 return gc; 4897 4881 } dwt/graphics/Image.d
r117 r197 193 193 if (device is null) device = Device.getDevice(); 194 194 if (device is null) DWT.error(DWT.ERROR_NULL_ARGUMENT); 195 init (device, width, height);195 init_(device, width, height); 196 196 if (device.tracking) device.new_Object(this); 197 197 } … … 270 270 case DWT.ICON: 271 271 static if (OS.IsWinCE) { 272 init (device, srcImage.data);272 init_(device, srcImage.data); 273 273 } else { 274 274 handle = OS.CopyImage(srcImage.handle, OS.IMAGE_ICON, rect.width, rect.height, 0); … … 338 338 } 339 339 } 340 init (device, newData);340 init_ (device, newData); 341 341 if (device.tracking) device.new_Object(this); 342 342 return; … … 403 403 } 404 404 } 405 init (device, newData);405 init_ (device, newData); 406 406 if (device.tracking) device.new_Object(this); 407 407 return; … … 446 446 if (device is null) DWT.error(DWT.ERROR_NULL_ARGUMENT); 447 447 if (bounds is null) DWT.error(DWT.ERROR_NULL_ARGUMENT); 448 init (device, bounds.width, bounds.height);448 init_(device, bounds.width, bounds.height); 449 449 if (device.tracking) device.new_Object(this); 450 450 } … … 471 471 if (device is null) device = Device.getDevice(); 472 472 if (device is null) DWT.error(DWT.ERROR_NULL_ARGUMENT); 473 init (device, data);473 init_(device, data); 474 474 if (device.tracking) device.new_Object(this); 475 475 } … … 509 509 } 510 510 mask = ImageData.convertMask(mask); 511 init (device, this, source, mask);511 init_(device, this, source, mask); 512 512 if (device.tracking) device.new_Object(this); 513 513 } … … 564 564 if (device is null) device = Device.getDevice(); 565 565 if (device is null) DWT.error(DWT.ERROR_NULL_ARGUMENT); 566 init (device, new ImageData(stream));566 init_(device, new ImageData(stream)); 567 567 if (device.tracking) device.new_Object(this); 568 568 } … … 742 742 &nbs
