Changeset 74
- Timestamp:
- 11/15/08 14:03:15 (2 months ago)
- Files:
-
- trunk/win32/dfl/application.d (modified) (8 diffs)
- trunk/win32/dfl/control.d (modified) (17 diffs)
- trunk/win32/dfl/data.d (modified) (5 diffs)
- trunk/win32/dfl/event.d (modified) (1 diff)
- trunk/win32/dfl/filedialog.d (modified) (3 diffs)
- trunk/win32/dfl/form.d (modified) (5 diffs)
- trunk/win32/dfl/internal/clib.d (modified) (2 diffs)
- trunk/win32/dfl/internal/com.d (modified) (4 diffs)
- trunk/win32/dfl/internal/dlib.d (modified) (6 diffs)
- trunk/win32/dfl/internal/utf.d (modified) (1 diff)
- trunk/win32/dfl/listview.d (modified) (1 diff)
- trunk/win32/dfl/menu.d (modified) (2 diffs)
- trunk/win32/dfl/socket.d (modified) (2 diffs)
- trunk/win32/dfl/textbox.d (modified) (2 diffs)
- trunk/win32/dfl/timer.d (modified) (1 diff)
- trunk/win32/dfl/treeview.d (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
trunk/win32/dfl/application.d
r73 r74 265 265 { 266 266 debug(APP_PRINT) 267 printf("CreateActCtxW failed.\n");267 cprintf("CreateActCtxW failed.\n"); 268 268 } 269 269 } … … 892 892 if(except) 893 893 { 894 printf("Error: %.*s\n", cast(int)getObjectString(e).length, getObjectString(e).ptr);894 cprintf("Error: %.*s\n", cast(int)getObjectString(e).length, getObjectString(e).ptr); 895 895 896 896 abort(); … … 918 918 919 919 //throw e; 920 printf("Error: %.*s\n", cast(int)getObjectString(e).length, getObjectString(e).ptr);920 cprintf("Error: %.*s\n", cast(int)getObjectString(e).length, getObjectString(e).ptr); 921 921 //exitThread(); 922 922 Environment.exit(EXIT_FAILURE); … … 1508 1508 Application.gctimer = 0; 1509 1509 1510 // printf("Auto-collecting\n");1511 dfl.internal.dlib.gc GenCollect();1510 //cprintf("Auto-collecting\n"); 1511 dfl.internal.dlib.gcFullCollect(); 1512 1512 1513 1513 Application.gcinfo = GetTickCount() + 4000; … … 1694 1694 extern(Windows) LRESULT dflWndProc(HWND hwnd, UINT msg, WPARAM wparam, LPARAM lparam) 1695 1695 { 1696 // printf("HWND %p; WM %d(0x%X); WPARAM %d(0x%X); LPARAM %d(0x%X);\n", hwnd, msg, msg, wparam, wparam, lparam, lparam);1696 //cprintf("HWND %p; WM %d(0x%X); WPARAM %d(0x%X); LPARAM %d(0x%X);\n", hwnd, msg, msg, wparam, wparam, lparam, lparam); 1697 1697 1698 1698 if(msg == wmDfl) … … 1797 1797 { 1798 1798 debug(APP_PRINT) 1799 printf("Unable to add window 0x%X.\n", hwnd);1799 cprintf("Unable to add window 0x%X.\n", hwnd); 1800 1800 return dm.result; 1801 1801 } … … 1805 1805 ctrl.hwnd = hwnd; 1806 1806 debug(APP_PRINT) 1807 printf("Added window 0x%X.\n", hwnd);1807 cprintf("Added window 0x%X.\n", hwnd); 1808 1808 1809 1809 //ctrl.finishCreating(hwnd); … … 2062 2062 2063 2063 2064 /+2065 // GC 1.0 by default.2066 version(Tango)2067 {2068 }2069 else2070 {2071 version(DFL_NO_GC_V1_0)2072 {2073 }2074 else // DFL_GC_V1_02075 {2076 version = _DFL_STD_GC_V1_0;2077 2078 private import std.gc;2079 }2080 }2081 +/2082 // Not GC 1.0 by default.2083 version(Tango)2084 {2085 }2086 else2087 {2088 version(DFL_GC_V1_0)2089 {2090 version = _DFL_STD_GC_V1_0;2091 }2092 }2093 2094 2095 2064 static this() 2096 2065 { 2097 version(_DFL_STD_GC_V1_0)2098 {2099 static if(is(typeof(&std.gc.setV1_0)))2100 {2101 std.gc.setV1_0();2102 }2103 else2104 {2105 pragma(msg, "DFL: assuming version=DFL_NO_GC_V1_0");2106 }2107 }2108 2109 2066 dfl.internal.utf._utfinit(); 2110 2067 trunk/win32/dfl/control.d
r72 r74 1008 1008 { 1009 1009 debug(APP_PRINT) 1010 printf("Control created due to handle request.\n");1010 cprintf("Control created due to handle request.\n"); 1011 1011 1012 1012 createHandle(); … … 1125 1125 debug(EVENT_PRINT) 1126 1126 { 1127 printf("{ Event: onBackColorChanged - Control %.*s }\n", name);1127 cprintf("{ Event: onBackColorChanged - Control %.*s }\n", name); 1128 1128 } 1129 1129 … … 1489 1489 debug(EVENT_PRINT) 1490 1490 { 1491 printf("{ Event: onCursorChanged - Control %.*s }\n", name);1491 cprintf("{ Event: onCursorChanged - Control %.*s }\n", name); 1492 1492 } 1493 1493 +/ … … 1960 1960 debug(EVENT_PRINT) 1961 1961 { 1962 printf("{ Event: onForeColorChanged - Control %.*s }\n", name);1962 cprintf("{ Event: onForeColorChanged - Control %.*s }\n", name); 1963 1963 } 1964 1964 … … 2145 2145 debug(EVENT_PRINT) 2146 2146 { 2147 printf("{ Event: onParentChanged - Control %.*s }\n", name);2147 cprintf("{ Event: onParentChanged - Control %.*s }\n", name); 2148 2148 } 2149 2149 … … 4313 4313 debug(EVENT_PRINT) 4314 4314 { 4315 printf("{ Event: onFontChanged - Control %.*s }\n", name);4315 cprintf("{ Event: onFontChanged - Control %.*s }\n", name); 4316 4316 } 4317 4317 … … 4325 4325 debug(EVENT_PRINT) 4326 4326 { 4327 printf("{ Event: onRightToLeftChanged - Control %.*s }\n", name);4327 cprintf("{ Event: onRightToLeftChanged - Control %.*s }\n", name); 4328 4328 } 4329 4329 … … 4366 4366 debug(EVENT_PRINT) 4367 4367 { 4368 printf("{ Event: onHelpRequested - Control %.*s }\n", name);4368 cprintf("{ Event: onHelpRequested - Control %.*s }\n", name); 4369 4369 } 4370 4370 … … 4378 4378 debug(EVENT_PRINT) 4379 4379 { 4380 printf("{ Event: onSystemColorsChanged - Control %.*s }\n", name);4380 cprintf("{ Event: onSystemColorsChanged - Control %.*s }\n", name); 4381 4381 } 4382 4382 … … 5405 5405 if(msg.msg == wmGetControlName) 5406 5406 { 5407 // printf("WM_GETCONTROLNAME: %.*s; wparam: %d\n", cast(uint)name.length, name.ptr, msg.wParam);5407 //cprintf("WM_GETCONTROLNAME: %.*s; wparam: %d\n", cast(uint)name.length, name.ptr, msg.wParam); 5408 5408 if(msg.wParam && this.name.length) 5409 5409 { … … 6011 6011 { 6012 6012 debug(APP_PRINT) 6013 printf("~Control %p\n", cast(void*)this);6013 cprintf("~Control %p\n", cast(void*)this); 6014 6014 6015 6015 version(DFL_NO_ZOMBIE_FORM) … … 6301 6301 debug(APP_PRINT) 6302 6302 { 6303 printf("Creating Control handle while disposing.\n");6303 cprintf("Creating Control handle while disposing.\n"); 6304 6304 } 6305 6305 … … 6358 6358 debug(APP_PRINT) 6359 6359 { 6360 printf("CreateWindowEx failed."6360 cprintf("CreateWindowEx failed." 6361 6361 " (exStyle=0x%X, className=`%.*s`, caption=`%.*s`, style=0x%X, x=%d, y=%d, width=%d, height=%d," 6362 6362 " parent=0x%X, menu=0x%X, inst=0x%X, param=0x%X)\n", … … 6463 6463 private final void fillRecreationData() 6464 6464 { 6465 // printf(" { fillRecreationData %.*s }\n", name);6465 //cprintf(" { fillRecreationData %.*s }\n", name); 6466 6466 6467 6467 if(!(ctrlStyle & ControlStyles.CACHE_TEXT)) … … 6561 6561 if(!_disallowLayout) 6562 6562 { 6563 // printf("alayout\n");6563 //cprintf("alayout\n"); 6564 6564 scope LayoutEventArgs lea = new LayoutEventArgs(ctrl); 6565 6565 onLayout(lea); … … 6577 6577 version(RADIO_GROUP_LAYOUT) 6578 6578 { 6579 // printf("vchanged\n");6579 //cprintf("vchanged\n"); 6580 6580 6581 6581 bool foundRadio = false; … … 6640 6640 debug(EVENT_PRINT) 6641 6641 { 6642 printf("{ Event: onLayout - Control %.*s }\n", name);6642 cprintf("{ Event: onLayout - Control %.*s }\n", name); 6643 6643 } 6644 6644 trunk/win32/dfl/data.d
r54 r74 667 667 // doConvert ... 668 668 669 // printf("Looking for format '%.*s'.\n", fmt);669 //cprintf("Looking for format '%.*s'.\n", fmt); 670 670 int i; 671 671 i = find(fmt); … … 1024 1024 if(!nfetched) 1025 1025 break; 1026 // printf("\t\t{getFormats:%d}\n", fmte.cfFormat);1026 //cprintf("\t\t{getFormats:%d}\n", fmte.cfFormat); 1027 1027 result ~= DataFormats.getFormat(fmte.cfFormat).name; 1028 1028 } … … 1054 1054 if(!hmem) 1055 1055 { 1056 // printf("Unable to GlobalAlloc().\n");1056 //cprintf("Unable to GlobalAlloc().\n"); 1057 1057 err_set: 1058 1058 throw new DflException("Unable to set data"); … … 1061 1061 if(!pmem) 1062 1062 { 1063 // printf("Unable to GlobalLock().\n");1063 //cprintf("Unable to GlobalLock().\n"); 1064 1064 GlobalFree(hmem); 1065 1065 goto err_set; … … 1082 1082 if(S_OK != hr) 1083 1083 { 1084 // printf("Unable to IDataObject::SetData() = %d (0x%X).\n", hr, hr);1084 //cprintf("Unable to IDataObject::SetData() = %d (0x%X).\n", hr, hr); 1085 1085 // Failed, need to free it.. 1086 1086 GlobalFree(hmem); trunk/win32/dfl/event.d
r54 r74 249 249 /+ 250 250 private static byte[] buf; 251 private import std.gc; 251 private import std.gc; // <-- ... 252 252 253 253 trunk/win32/dfl/filedialog.d
r54 r74 481 481 482 482 default: ; 483 // printf(" nmhdr.code = %d/0x%X\n", nmhdr.code, nmhdr.code);483 //cprintf(" nmhdr.code = %d/0x%X\n", nmhdr.code, nmhdr.code); 484 484 } 485 485 } … … 684 684 foreach(Dstring ext; exts) 685 685 { 686 printf("sel ext: %.*s\n", ext);686 cprintf("sel ext: %.*s\n", ext); 687 687 } 688 688 … … 987 987 } 988 988 989 // printf("hook msg(%d/0x%X) to obj %p\n", msg, msg, fd);989 //cprintf("hook msg(%d/0x%X) to obj %p\n", msg, msg, fd); 990 990 if(fd) 991 991 { trunk/win32/dfl/form.d
r64 r74 373 373 debug(APP_PRINT) 374 374 { 375 printf("Creating Form handle while killing.\n");375 cprintf("Creating Form handle while killing.\n"); 376 376 } 377 377 … … 3173 3173 { 3174 3174 Control cc = Control.fromHandle(hw); 3175 // printf("mnemonic for ");3175 //cprintf("mnemonic for "); 3176 3176 if(!cc) 3177 3177 { … … 3179 3179 return false; 3180 3180 } 3181 // printf("'%.*s' ", cc.name);3181 //cprintf("'%.*s' ", cc.name); 3182 3182 return cc._processMnemonic(cast(dchar)m.wParam); 3183 3183 } … … 3514 3514 { 3515 3515 debug(APP_PRINT) 3516 printf("RegisterClassEx() failed for park class.\n");3516 cprintf("RegisterClassEx() failed for park class.\n"); 3517 3517 3518 3518 init_err: … … 3527 3527 { 3528 3528 debug(APP_PRINT) 3529 printf("CreateWindowEx() failed for park window.\n");3529 cprintf("CreateWindowEx() failed for park window.\n"); 3530 3530 3531 3531 goto init_err; trunk/win32/dfl/internal/clib.d
r5 r74 11 11 tango.stdc.stdint, 12 12 tango.stdc.stdio; 13 14 alias tango.stdc.stdio.printf cprintf; 13 15 } 14 16 else // Phobos … … 18 20 std.stdint, // Mostly the same as the C interface. 19 21 std.c.stdio; 22 23 alias std.c.stdio.printf cprintf; 20 24 } 21 25 trunk/win32/dfl/internal/com.d
r67 r74 33 33 override ULONG AddRef() 34 34 { 35 // printf("AddRef `%.*s`\n", cast(int)toString().length, toString().ptr);35 //cprintf("AddRef `%.*s`\n", cast(int)toString().length, toString().ptr); 36 36 return C_refCountInc(cast(void*)this); 37 37 } … … 39 39 override ULONG Release() 40 40 { 41 // printf("Release `%.*s`\n", cast(int)toString().length, toString().ptr);41 //cprintf("Release `%.*s`\n", cast(int)toString().length, toString().ptr); 42 42 return C_refCountDec(cast(void*)this); 43 43 } … … 159 159 HRESULT result = S_OK; 160 160 161 // printf("seek move=%u, origin=0x%x\n", cast(uint)dlibMove.QuadPart, dwOrigin);161 //cprintf("seek move=%u, origin=0x%x\n", cast(uint)dlibMove.QuadPart, dwOrigin); 162 162 163 163 try … … 423 423 HRESULT Seek(LARGE_INTEGER dlibMove, DWORD dwOrigin, ULARGE_INTEGER* plibNewPosition) 424 424 { 425 // printf("seek move=%u, origin=0x%x\n", cast(uint)dlibMove.QuadPart, dwOrigin);425 //cprintf("seek move=%u, origin=0x%x\n", cast(uint)dlibMove.QuadPart, dwOrigin); 426 426 427 427 auto toPos = cast(long)dlibMove.QuadPart; trunk/win32/dfl/internal/dlib.d
r72 r74 32 32 alias typeof(""d.ptr) Ddstringz; 33 33 alias typeof(" "d[0]) Ddchar; 34 35 36 version(DFL_NO_D2_AND_ABOVE) 37 { 38 } 39 else 40 { 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; 63 } 34 64 35 65 … … 143 173 144 174 145 private import tango.core.Memory; 146 147 void gcPin(void* p) { } 148 void gcUnpin(void* p) { } 149 150 void gcGenCollect() 151 { 152 version(DFL_TANGObefore099rc3) 153 gc.collect(); 154 else 155 GC.collect(); 156 } 157 158 void gcFullCollect() 159 { 160 version(DFL_TANGObefore099rc3) 161 gc.collect(); 162 else 163 GC.collect(); 175 version(DFL_USE_CORE_MEMORY) 176 { 177 private import core.memory; 178 179 void gcPin(void* p) { } 180 void gcUnpin(void* p) { } 181 182 deprecated void gcGenCollect() 183 { 184 core.memory.GC.collect(); 185 } 186 187 void gcFullCollect() 188 { 189 core.memory.GC.collect(); 190 } 191 } 192 else 193 { 194 private import tango.core.Memory; 195 196 void gcPin(void* p) { } 197 void gcUnpin(void* p) { } 198 199 deprecated void gcGenCollect() 200 { 201 version(DFL_TANGObefore099rc3) 202 gc.collect(); 203 else 204 GC.collect(); 205 } 206 207 void gcFullCollect() 208 { 209 version(DFL_TANGObefore099rc3) 210 gc.collect(); 211 else 212 GC.collect(); 213 } 164 214 } 165 215 … … 215 265 216 266 217 private import tango.core.Exception; 218 219 class OomException: tango.core.Exception.OutOfMemoryException 220 { 221 this() 222 { 223 super(null, 0); 267 version(DFL_USE_CORE_EXCEPTION_OUTOFMEMORY) 268 { 269 private import core.exception; 270 271 class OomException: core.exception.OutOfMemoryException 272 { 273 this() 274 { 275 super(null, 0); 276 } 277 } 278 } 279 else 280 { 281 private import tango.core.Exception; 282 283 class OomException: tango.core.Exception.OutOfMemoryException 284 { 285 this() 286 { 287 super(null, 0); 288 } 224 289 } 225 290 } … … 418 483 else // Phobos 419 484 { 420 public import std.t hread, std.traits;485 public import std.traits; 421 486 422 487 … … 430 495 431 496 432 private import std.gc; 433 434 void gcPin(void* p) { } 435 void gcUnpin(void* p) { } 436 437 alias std.gc.genCollect gcGenCollect; 438 439 alias std.gc.fullCollect gcFullCollect; 497 version(DFL_USE_CORE_MEMORY) 498 { 499 private import core.memory; 500 501 void gcPin(void* p) { } 502 void gcUnpin(void* p) { } 503 504 deprecated void gcGenCollect() 505 { 506 core.memory.GC.collect(); 507 } 508 509 void gcFullCollect() 510 { 511 core.memory.GC.collect(); 512 } 513 } 514 else 515 { 516 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> 517 518 void gcPin(void* p) { } 519 void gcUnpin(void* p) { } 520 521 deprecated alias std.gc.genCollect gcGenCollect; 522 523 alias std.gc.fullCollect gcFullCollect; 524 } 440 525 441 526 … … 473 558 474 559 475 private import std.outofmemory; 476 477 alias std.outofmemory.OutOfMemoryException OomException; 560 version(DFL_USE_CORE_EXCEPTION_OUTOFMEMORY) 561 { 562 private import core.exception; 563 564 class OomException: core.exception.OutOfMemoryException 565 { 566 this() 567 { 568 super(null, 0); 569 } 570 } 571 } 572 else 573 { 574 private import std.outofmemory; 575 576 alias std.outofmemory.OutOfMemoryException OomException; 577 } 478 578 479 579 trunk/win32/dfl/internal/utf.d
r54 r74 59 59 version(D_Version2) 60 60 { 61 version = DFL_D2_AND_ABOVE; 62 } 63 else version(D_Version3) 64 { 65 version = DFL_D3_AND_ABOVE; 61 66 version = DFL_D2_AND_ABOVE; 62 67 } trunk/win32/dfl/listview.d
r72 r74 2582 2582 { 2583 2583 /+ 2584 printf("^ Insert item: index=%d, lparam=0x%X, text='%.*s', subItemIndex=%d\n",2584 cprintf("^ Insert item: index=%d, lparam=0x%X, text='%.*s', subItemIndex=%d\n", 2585 2585 index, lparam, itemText.length > 20 ? 20 : itemText.length, cast(char*)itemText, subItemIndex); 2586 2586 +/ trunk/win32/dfl/menu.d
r72 r74 55 55 56 56 debug(APP_PRINT) 57 printf("~ContextMenu\n");57 cprintf("~ContextMenu\n"); 58 58 } 59 59 … … 515 515 516 516 debug(APP_PRINT) 517 printf("~MenuItem\n");517 cprintf("~MenuItem\n"); 518 518 } 519 519 trunk/win32/dfl/socket.d
r54 r74 739 739 { 740 740 debug(APP_PRINT) 741 printf("RegisterClassEx() failed for network event class.\n");741 cprintf("RegisterClassEx() failed for network event class.\n"); 742 742 743 743 init_err: … … 754 754 { 755 755 debug(APP_PRINT) 756 printf("CreateWindowEx() failed for network event window.\n");756 cprintf("CreateWindowEx() failed for network event window.\n"); 757 757 758 758 goto init_err; trunk/win32/dfl/textbox.d
r64 r74 489 489 { 490 490 debug(APP_PRINT) 491 printf("Unable to OpenClipboard().\n");491 cprintf("Unable to OpenClipboard().\n"); 492 492 //throw new DflException("Unable to set clipboard data."); 493 493 return; … … 513 513 { 514 514 debug(APP_PRINT) 515 printf("Unable to OpenClipboard().\n");515 cprintf("Unable to OpenClipboard().\n"); 516 516 //throw new DflException("Unable to set clipboard data."); 517 517 return; trunk/win32/dfl/timer.d
r11 r74 172 172 { 173 173 debug(APP_PRINT) 174 printf("Unknown timer 0x%X.\n", idEvent);174 cprintf("Unknown timer 0x%X.\n", idEvent); 175 175 } 176 176 } trunk/win32/dfl/treeview.d
r72 r74 698 698 void add(TreeNode node) 699 699 { 700 // printf("Adding node %p '%.*s'\n", cast(void*)node, getObjectString(node));700 //cprintf("Adding node %p '%.*s'\n", cast(void*)node, getObjectString(node)); 701 701 702 702 int i;
