Changeset 80
- Timestamp:
- 04/11/09 20:54:18 (3 years ago)
- Files:
-
- trunk/win32/dfl/application.d (modified) (2 diffs)
- trunk/win32/dfl/data.d (modified) (1 diff)
- trunk/win32/dfl/drawing.d (modified) (3 diffs)
- trunk/win32/dfl/internal/dlib.d (modified) (6 diffs)
- trunk/win32/dfl/messagebox.d (modified) (2 diffs)
- trunk/win32/dfl/registry.d (modified) (1 diff)
- trunk/win32/dfl/textbox.d (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
trunk/win32/dfl/application.d
r74 r80 177 177 void enableVisualStyles() 178 178 { 179 const Dstring MANIFEST = `<?xml version="1.0" encoding="UTF-8" standalone="yes"?>` \r\n180 `<assembly xmlns="urn:schemas-microsoft-com:asm.v1" manifestVersion="1.0">` \r\n181 `<description>DFL manifest</description>` \r\n182 `<dependency>` \r\n183 `<dependentAssembly>` \r\n179 const Dstring MANIFEST = `<?xml version="1.0" encoding="UTF-8" standalone="yes"?>` "\r\n" 180 `<assembly xmlns="urn:schemas-microsoft-com:asm.v1" manifestVersion="1.0">` "\r\n" 181 `<description>DFL manifest</description>` "\r\n" 182 `<dependency>` "\r\n" 183 `<dependentAssembly>` "\r\n" 184 184 `<assemblyIdentity ` 185 185 `type="win32" ` … … 189 189 `publicKeyToken="6595b64144ccf1df" ` 190 190 `language="*" ` 191 `/>` \r\n192 `</dependentAssembly>` \r\n193 `</dependency>` \r\n194 `</assembly>` \r\n;191 `/>` "\r\n" 192 `</dependentAssembly>` "\r\n" 193 `</dependency>` "\r\n" 194 `</assembly>` "\r\n"; 195 195 196 196 HMODULE kernel32; trunk/win32/dfl/data.d
r74 r80 459 459 { 460 460 // Unicode string. 461 //return data.getUnicodeText() ~ cast(Dwstring) \0;462 //return cast(void[])(data.getUnicodeText() ~ cast(Dwstring) \0); // Needed in D2. Not guaranteed safe.463 return (data.getUnicodeText() ~ cast(Dwstring) \0).dup; // Needed in D2.461 //return data.getUnicodeText() ~ cast(Dwstring)"\0"; 462 //return cast(void[])(data.getUnicodeText() ~ cast(Dwstring)"\0"); // Needed in D2. Not guaranteed safe. 463 return (data.getUnicodeText() ~ cast(Dwstring)"\0").dup; // Needed in D2. 464 464 } 465 465 else if(data.info == typeid(Ddstring)) 466 466 { 467 //return (*cast(Ddstring*)data.value) ~ \0;468 //return cast(void[])((*cast(Ddstring*)data.value) ~ \0); // Needed in D2. Not guaranteed safe.469 return ((*cast(Ddstring*)data.value) ~ \0).dup; // Needed in D2.467 //return (*cast(Ddstring*)data.value) ~ "\0"; 468 //return cast(void[])((*cast(Ddstring*)data.value) ~ "\0"); // Needed in D2. Not guaranteed safe. 469 return ((*cast(Ddstring*)data.value) ~ "\0").dup; // Needed in D2. 470 470 } 471 471 else if(CF_HDROP == id) trunk/win32/dfl/drawing.d
r77 r80 457 457 458 458 459 Color* Dthisptr(Color* t) { return t; } 460 Color* Dthisptr(ref Color t) { return &t; } 461 Color Dthisval(Color* t) { return *t; } 462 Color Dthisval(Color t) { return t; } 463 464 459 465 deprecated static Color opCall(COLORREF argb) 460 466 { … … 547 553 Color blendColor(Color wc) 548 554 { 549 if( *this== Color.empty)555 if(Dthisval(this) == Color.empty) 550 556 return wc; 551 557 if(wc == Color.empty) 552 return *this;558 return Dthisval(this); 553 559 554 560 validateColor(); … … 570 576 //if(0x7F == this.color.alpha) 571 577 // return blendColor(backColor); 572 //if( *this== Color.empty) // Checked if(0 == this.color.alpha)578 //if(Dthisval(this) == Color.empty) // Checked if(0 == this.color.alpha) 573 579 // return backColor; 574 580 if(0 == this.color.alpha) 575 581 return backColor; 576 582 if(backColor == Color.empty) 577 return *this;583 return Dthisval(this); 578 584 if(0xFF == this.color.alpha) 579 return *this;585 return Dthisval(this); 580 586 581 587 validateColor(); trunk/win32/dfl/internal/dlib.d
r76 r80 1 1 /* 2 Copyright (C) 2007-200 8Christopher E. Miller2 Copyright (C) 2007-2009 Christopher E. Miller 3 3 4 4 This software is provided 'as-is', without any express or implied … … 34 34 35 35 36 version(DFL_NO_D2_AND_ABOVE) 37 { 36 version(D_Version2) 37 { 38 version = DFL_D2; 39 version = DFL_D2_AND_ABOVE; 40 } 41 else version(D_Version3) 42 { 43 version = DFL_D3; 44 version = DFL_D3_AND_ABOVE; 45 version = DFL_D2_AND_ABOVE; 46 } 47 else version(D_Version4) 48 { 49 version = DFL_D4; 50 version = DFL_D4_AND_ABOVE; 51 version = DFL_D3_AND_ABOVE; 52 version = DFL_D2_AND_ABOVE; 38 53 } 39 54 else 40 55 { 41 version(D_Version2) 42 { 43 version = DFL_D2_AND_ABOVE; 44 } 45 else version(D_Version3) 46 { 47 version = DFL_D3_AND_ABOVE; 48 version = DFL_D2_AND_ABOVE; 49 } 50 } 51 52 53 version(DFL_DMD2020) 54 { 55 version = DFL_USE_CORE_MEMORY; 56 version = DFL_USE_CORE_EXCEPTION_OUTOFMEMORY; 57 } 58 59 60 version(DFL_USE_CORE_MEMORY) 61 { 62 version = DFL_USE_CORE_EXCEPTION_OUTOFMEMORY; 56 version = DFL_D1; 57 } 58 //version = DFL_D1_AND_ABOVE; 59 60 61 version(DFL_D1) 62 { 63 version(DFL_USE_CORE_MEMORY) 64 { 65 } 66 else 67 { 68 version = DFL_NO_USE_CORE_MEMORY; 69 version = _DFL_NO_USE_CORE_EXCEPTION_OUTOFMEMORY_EXCEPTION; 70 } 71 } 72 73 74 version(DFL_D2_AND_ABOVE) 75 { 76 version(DFL_beforeDMD2020) 77 { 78 version = DFL_NO_USE_CORE_MEMORY; 79 version = _DFL_NO_USE_CORE_EXCEPTION_OUTOFMEMORY_EXCEPTION; 80 version = _DFL_NO_USE_CORE_EXCEPTION_OUTOFMEMORY_ERROR; 81 } 82 83 version(DFL_beforeDMD2021) 84 { 85 version = _DFL_NO_USE_CORE_EXCEPTION_OUTOFMEMORY_ERROR; 86 } 87 } 88 89 90 version(DFL_NO_USE_CORE_MEMORY) 91 { 92 version = _DFL_NO_USE_CORE_EXCEPTION_OUTOFMEMORY_EXCEPTION; 63 93 } 64 94 … … 282 312 283 313 284 version( DFL_USE_CORE_EXCEPTION_OUTOFMEMORY)285 { 286 private import core.exception;287 288 class OomException: core.exception.OutOfMemoryException314 version(_DFL_NO_USE_CORE_EXCEPTION_OUTOFMEMORY_EXCEPTION) 315 { 316 private import tango.core.Exception; 317 318 class OomException: tango.core.Exception.OutOfMemoryException 289 319 { 290 320 this() … … 296 326 else 297 327 { 298 private import tango.core.Exception;299 300 class OomException: tango.core.Exception.OutOfMemoryException328 private import core.exception; 329 330 class OomException: core.exception.OutOfMemoryException 301 331 { 302 332 this() … … 512 542 513 543 514 version(DFL_ USE_CORE_MEMORY)515 { 516 private import core.memory;544 version(DFL_NO_USE_CORE_MEMORY) 545 { 546 private import std.gc; // If you get "module gc cannot read file 'core\memory.d'" then use -version=DFL_NO_USE_CORE_MEMORY <http://wiki.dprogramming.com/Dfl/CompileVersions> 517 547 518 548 void gcPin(void* p) { } 519 549 void gcUnpin(void* p) { } 520 550 521 deprecated void gcGenCollect() 522 { 523 core.memory.GC.collect(); 524 } 525 526 void gcFullCollect() 527 { 528 core.memory.GC.collect(); 529 } 530 } 531 else 532 { 533 private import std.gc; // If you get "module gc cannot read file 'std\gc.d'" then use -version=DFL_USE_CORE_MEMORY <http://wiki.dprogramming.com/Dfl/CompileVersions> 551 deprecated alias std.gc.genCollect gcGenCollect; 552 553 alias std.gc.fullCollect gcFullCollect; 554 } 555 else 556 { 557 private import core.memory; // If you get "module gc cannot read file 'std\gc.d'" then use -version=DFL_USE_CORE_MEMORY <http://wiki.dprogramming.com/Dfl/CompileVersions> 534 558 535 559 void gcPin(void* p) { } 536 560 void gcUnpin(void* p) { } 537 561 538 deprecated alias std.gc.genCollect gcGenCollect; 539 540 alias std.gc.fullCollect gcFullCollect; 562 deprecated void gcGenCollect() 563 { 564 core.memory.GC.collect(); 565 } 566 567 void gcFullCollect() 568 { 569 core.memory.GC.collect(); 570 } 541 571 } 542 572 … … 575 605 576 606 577 version(DFL_USE_CORE_EXCEPTION_OUTOFMEMORY) 607 version(_DFL_NO_USE_CORE_EXCEPTION_OUTOFMEMORY_EXCEPTION) 608 { 609 private import std.outofmemory; 610 611 alias std.outofmemory.OutOfMemoryException OomException; 612 } 613 else 578 614 { 579 615 private import core.exception; 580 616 581 class OomException: core.exception.OutOfMemoryException582 { 583 this()617 version(_DFL_NO_USE_CORE_EXCEPTION_OUTOFMEMORY_ERROR) 618 { 619 class OomException: core.exception.OutOfMemoryException 584 620 { 585 super(null, 0); 621 this() 622 { 623 super(null, 0); 624 } 586 625 } 587 626 } 588 } 589 else 590 { 591 private import std.outofmemory; 592 593 alias std.outofmemory.OutOfMemoryException OomException; 627 else 628 { 629 class OomException: core.exception.OutOfMemoryError 630 { 631 this() 632 { 633 super(null, 0); 634 } 635 } 636 } 594 637 } 595 638 trunk/win32/dfl/messagebox.d
r54 r80 61 61 DialogResult msgBox(Dstring txt) // docmain 62 62 { 63 return cast(DialogResult)dfl.internal.utf.messageBox(GetActiveWindow(), txt, \0, MB_OK);63 return cast(DialogResult)dfl.internal.utf.messageBox(GetActiveWindow(), txt, "\0", MB_OK); 64 64 } 65 65 … … 68 68 { 69 69 return cast(DialogResult)dfl.internal.utf.messageBox(owner ? owner.handle : GetActiveWindow(), 70 txt, \0, MB_OK);70 txt, "\0", MB_OK); 71 71 } 72 72 trunk/win32/dfl/registry.d
r72 r80 251 251 foreach(Dstring str; value) 252 252 { 253 result ~= str ~ \r\n;253 result ~= str ~ "\r\n"; 254 254 } 255 255 if(result.length) trunk/win32/dfl/textbox.d
r74 r80 112 112 foreach(Dstring s; lns) 113 113 { 114 result ~= s ~ \r\n;114 result ~= s ~ "\r\n"; 115 115 } 116 116 if(result.length) // Remove last \r\n.
