Changeset 38
- Timestamp:
- 08/12/04 19:00:44 (4 years ago)
- Files:
-
- downloads/dwt20040812.zip (added)
- trunk/src/SConstruct_my (added)
- trunk/src/dwt/events (added)
- trunk/src/dwt/events/armevent.d (added)
- trunk/src/dwt/events/armlistener.d (added)
- trunk/src/dwt/events/controladapter.d (added)
- trunk/src/dwt/events/controlevent.d (added)
- trunk/src/dwt/events/controllistener.d (added)
- trunk/src/dwt/events/disposeevent.d (added)
- trunk/src/dwt/events/disposelistener.d (added)
- trunk/src/dwt/events/focusadapter.d (added)
- trunk/src/dwt/events/focusevent.d (added)
- trunk/src/dwt/events/focuslistener.d (added)
- trunk/src/dwt/events/helpevent.d (added)
- trunk/src/dwt/events/helplistener.d (added)
- trunk/src/dwt/events/keyadapter.d (added)
- trunk/src/dwt/events/keyevent.d (added)
- trunk/src/dwt/events/keylistener.d (added)
- trunk/src/dwt/events/menuadapter.d (added)
- trunk/src/dwt/events/menuevent.d (added)
- trunk/src/dwt/events/menulistener.d (added)
- trunk/src/dwt/events/modifyevent.d (added)
- trunk/src/dwt/events/modifylistener.d (added)
- trunk/src/dwt/events/mouseadapter.d (added)
- trunk/src/dwt/events/mouseevent.d (added)
- trunk/src/dwt/events/mouselistener.d (added)
- trunk/src/dwt/events/mousemovelistener.d (added)
- trunk/src/dwt/events/mousetrackadapter.d (added)
- trunk/src/dwt/events/mousetracklistener.d (added)
- trunk/src/dwt/events/paintevent.d (added)
- trunk/src/dwt/events/paintlistener.d (added)
- trunk/src/dwt/events/selectionadapter.d (added)
- trunk/src/dwt/events/selectionevent.d (added)
- trunk/src/dwt/events/selectionlistener.d (added)
- trunk/src/dwt/events/shelladapter.d (added)
- trunk/src/dwt/events/shellevent.d (added)
- trunk/src/dwt/events/shelllistener.d (added)
- trunk/src/dwt/events/traverseevent.d (added)
- trunk/src/dwt/events/traverselistener.d (added)
- trunk/src/dwt/events/treeadapter.d (added)
- trunk/src/dwt/events/treeevent.d (added)
- trunk/src/dwt/events/treelistener.d (added)
- trunk/src/dwt/events/typedevent.d (added)
- trunk/src/dwt/events/verifyevent.d (added)
- trunk/src/dwt/events/verifylistener.d (added)
- trunk/src/dwt/graphics/device.d (modified) (1 diff)
- trunk/src/dwt/graphics/font.d (modified) (3 diffs)
- trunk/src/dwt/graphics/fontdata.d (modified) (4 diffs)
- trunk/src/dwt/graphics/fontmetrics.d (modified) (2 diffs)
- trunk/src/dwt/graphics/gc.d (modified) (5 diffs)
- trunk/src/dwt/graphics/gcdata.d (modified) (2 diffs)
- trunk/src/dwt/graphics/image.d (modified) (3 diffs)
- trunk/src/dwt/graphics/palettedata.d (modified) (2 diffs)
- trunk/src/dwt/graphics/region.d (modified) (4 diffs)
- trunk/src/dwt/graphics/rgb.d (modified) (3 diffs)
- trunk/src/dwt/internal/dwteventlistener.d (added)
- trunk/src/dwt/internal/dwteventobject.d (added)
- trunk/src/dwt/internal/library.d (modified) (1 diff)
- trunk/src/dwt/internal/ttypes.d (added)
- trunk/src/dwt/internal/types.d (deleted)
- trunk/src/dwt/internal/win32/func.d (added)
- trunk/src/dwt/internal/win32/os.d (modified) (23 diffs)
- trunk/src/dwt/internal/win32/types.d (modified) (1 diff)
- trunk/src/dwt/util/eventlistener.d (added)
- trunk/src/dwt/util/eventobject.d (added)
- trunk/src/dwt/util/throwable.d (modified) (1 diff)
- trunk/src/dwt/util/util.d (modified) (1 diff)
- trunk/src/dwt/widgets/button.d (modified) (3 diffs)
- trunk/src/dwt/widgets/composite.d (modified) (3 diffs)
- trunk/src/dwt/widgets/control.d (modified) (13 diffs)
- trunk/src/dwt/widgets/decorations.d (modified) (2 diffs)
- trunk/src/dwt/widgets/display.d (modified) (2 diffs)
- trunk/src/dwt/widgets/eventtable.d (modified) (7 diffs)
- trunk/src/dwt/widgets/listener.d (added)
- trunk/src/dwt/widgets/menu.d (modified) (2 diffs)
- trunk/src/dwt/widgets/monitor.d (modified) (2 diffs)
- trunk/src/dwt/widgets/runnablelock.d (modified) (2 diffs)
- trunk/src/dwt/widgets/scrollbar.d (modified) (2 diffs)
- trunk/src/dwt/widgets/shell.d (modified) (4 diffs)
- trunk/src/dwt/widgets/synchronizer.d (modified) (1 diff)
- trunk/src/dwt/widgets/typedlistener.d (added)
- trunk/src/err.txt (added)
- trunk/src/makefile_orig (added)
- trunk/src/win32.mak (modified) (5 diffs)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
trunk/src/dwt/graphics/device.d
r36 r38 22 22 module dwt.graphics.device; 23 23 24 /+ 25 import org.eclipse.swt.internal.*; 26 import org.eclipse.swt.internal.win32.*; 27 import org.eclipse.swt.*; 28 +/ 24 29 25 30 private import dwt.graphics.IDrawable; trunk/src/dwt/graphics/font.d
r33 r38 27 27 +/ 28 28 29 /** 30 * Instances of this class manage operating system resources that 31 * define how text looks when it is displayed. Fonts may be constructed 32 * by providing a device and either name, size and style information 33 * or a <code>FontData</code> object which encapsulates this data. 34 * <p> 35 * Application code must explicitly invoke the <code>Font.dispose()</code> 36 * method to release the operating system resources managed by each instance 37 * when those instances are no longer required. 38 * </p> 39 * 40 * @see FontData 41 */ 42 43 public final class Font { 44 29 45 private import dwt.dwt; 30 46 private import dwt.graphics.device; … … 33 49 private import dwt.internal.win32.types; 34 50 //private import std.string; 35 36 37 /**38 * Instances of this class manage operating system resources that39 * define how text looks when it is displayed. Fonts may be constructed40 * by providing a device and either name, size and style information41 * or a <code>FontData</code> object which encapsulates this data.42 * <p>43 * Application code must explicitly invoke the <code>Font.dispose()</code>44 * method to release the operating system resources managed by each instance45 * when those instances are no longer required.46 * </p>47 *48 * @see FontData49 */50 51 public final class Font {52 51 53 52 /** … … 256 255 public char[] toString () { 257 256 if (isDisposed()) return "Font {*DISPOSED*}"; 258 return "Font {" ~ std.string.toString(handle) ~ "}"; 257 // return "Font {" ~ std.string.toString(handle) ~ "}"; 258 return "Font {"; 259 259 } 260 260 trunk/src/dwt/graphics/fontdata.d
r33 r38 27 27 import org.eclipse.swt.*; 28 28 +/ 29 30 private import dwt.dwt;31 32 private import dwt.internal.callback;33 34 private import dwt.internal.win32.os;35 private import dwt.internal.win32.tchar;36 private import dwt.internal.win32.types;37 38 private import dwt.util.string;39 //private import dwt.util.util;40 41 private import std.string;42 private import std.utf;43 44 29 45 30 /** … … 70 55 71 56 public final class FontData { 57 58 59 private import dwt.dwt; 60 61 private import dwt.internal.callback; 62 63 private import dwt.internal.win32.os; 64 private import dwt.internal.win32.tchar; 65 private import dwt.internal.win32.types; 66 67 private import dwt.util.string; 68 //private import dwt.util.util; 69 70 private import std.string; 71 private import std.utf; 72 72 73 73 /** … … 591 591 */ 592 592 public char[] toString() { 593 /+ 593 594 char[] fontDescription = "1|" ~ std.utf.toUTF8(getName()) ~ "|" 594 595 ~ .toString(getHeight()) ~ "|" … … 609 610 ~ .toUTF8(getName()); 610 611 return fontDescription; 612 +/ 613 return "fontDescription"; 611 614 } 612 615 trunk/src/dwt/graphics/fontmetrics.d
r33 r38 26 26 +/ 27 27 28 private import dwt.internal.win32.types;29 30 28 /** 31 29 * Instances of this class provide measurement information … … 39 37 40 38 public final class FontMetrics { 39 40 private import dwt.internal.win32.types; 41 41 42 42 /** trunk/src/dwt/graphics/gc.d
r33 r38 27 27 import org.eclipse.swt.*; 28 28 +/ 29 30 /** 31 * Class <code>GC</code> is where all of the drawing capabilities that are 32 * supported by DWT are located. Instances are used to draw on either an 33 * <code>Image</code>, a <code>Control</code>, or directly on a <code>Display</code>. 34 * <dl> 35 * <dt><b>Styles:</b></dt> 36 * <dd>LEFT_TO_RIGHT, RIGHT_TO_LEFT</dd> 37 * </dl> 38 * 39 * <p> 40 * Application code must explicitly invoke the <code>GC.dispose()</code> 41 * method to release the operating system resources managed by each instance 42 * when those instances are no longer required. This is <em>particularly</em> 43 * important on Windows95 and Windows98 where the operating system has a limited 44 * number of device contexts available. 45 * </p> 46 * 47 * <p> 48 * Note: Only one of LEFT_TO_RIGHT and RIGHT_TO_LEFT may be specified. 49 * </p> 50 * 51 * @see org.eclipse.swt.events.PaintEvent 52 */ 53 54 public final class GC { 29 55 30 56 private … … 56 82 // import std.string; 57 83 } 58 59 /**60 * Class <code>GC</code> is where all of the drawing capabilities that are61 * supported by DWT are located. Instances are used to draw on either an62 * <code>Image</code>, a <code>Control</code>, or directly on a <code>Display</code>.63 * <dl>64 * <dt><b>Styles:</b></dt>65 * <dd>LEFT_TO_RIGHT, RIGHT_TO_LEFT</dd>66 * </dl>67 *68 * <p>69 * Application code must explicitly invoke the <code>GC.dispose()</code>70 * method to release the operating system resources managed by each instance71 * when those instances are no longer required. This is <em>particularly</em>72 * important on Windows95 and Windows98 where the operating system has a limited73 * number of device contexts available.74 * </p>75 *76 * <p>77 * Note: Only one of LEFT_TO_RIGHT and RIGHT_TO_LEFT may be specified.78 * </p>79 *80 * @see org.eclipse.swt.events.PaintEvent81 */82 83 public final class GC {84 84 85 85 /** … … 781 781 /* Scale the foreground pixels with alpha */ 782 782 //OS.MoveMemory(dibBM.bmBits, srcData, sizeInBytes); 783 dibBM.bmBits[] = srcData[]; 783 // TODO: Make sure this is correct!! -JJR 784 dibBM.bmBits = srcData[0 .. sizeInBytes].dup; 784 785 /* 785 786 * Bug in WinCE and Win98. StretchBlt does not correctly stretch when … … 1688 1689 //OS.MoveMemory(pVertex + TRIVERTEX.sizeof, trivertex, TRIVERTEX.sizeof); 1689 1690 1690 bit success = OS.GradientFill(handle, trivertex, 2, gradientRect, 1,1691 vertical ? OS.GRADIENT_FILL_RECT_V : OS.GRADIENT_FILL_RECT_H) ;1691 bit success = (OS.GradientFill(handle, trivertex, 2, gradientRect, 1, 1692 vertical ? OS.GRADIENT_FILL_RECT_V : OS.GRADIENT_FILL_RECT_H) == 0) ? false : true; 1692 1693 //OS.HeapFree(hHeap, 0, pMesh); 1693 1694 if (success) return; … … 2561 2562 public char[] toString () { 2562 2563 if (isDisposed()) return "GC {*DISPOSED*}"; 2563 return "GC {" ~ std.string.toString(handle) ~ "}"; 2564 // return "GC {" ~ std.string.toString(handle) ~ "}"; 2565 return "GC {"; 2564 2566 } 2565 2567 trunk/src/dwt/graphics/gcdata.d
r33 r38 26 26 +/ 27 27 28 private import dwt.internal.win32.types;29 30 31 28 /** 32 29 * Instances of this class are descriptions of GCs in terms … … 41 38 42 39 public final class GCData { 40 41 private import dwt.internal.win32.types; 43 42 private import dwt.graphics.device; 44 43 private import dwt.graphics.image; 44 45 45 public Device device; 46 46 public int style; trunk/src/dwt/graphics/image.d
r33 r38 28 28 +/ 29 29 30 private31 {32 import dwt.dwt;33 import dwt.graphics.device;34 import dwt.graphics.IDrawable;35 import dwt.graphics.gc;36 import dwt.graphics.gcdata;37 import dwt.graphics.rectangle;38 import dwt.graphics.color;39 import dwt.graphics.imagedata;40 import dwt.graphics.palettedata;41 import dwt.graphics.rgb;42 43 import dwt.internal.win32.os;44 import dwt.internal.win32.types;45 46 // import std.string;47 }48 30 49 31 /** … … 94 76 * @see ImageLoader 95 77 */ 78 private import dwt.graphics.IDrawable; 96 79 97 80 public final class Image : IDrawable { 98 81 82 private 83 { 84 import dwt.dwt; 85 import dwt.graphics.device; 86 import dwt.graphics.gc; 87 import dwt.graphics.gcdata; 88 import dwt.graphics.rectangle; 89 import dwt.graphics.color; 90 import dwt.graphics.imagedata; 91 import dwt.graphics.palettedata; 92 import dwt.graphics.rgb; 93 94 import dwt.internal.win32.os; 95 import dwt.internal.win32.types; 96 97 // import std.string; 98 } 99 99 /** 100 100 * specifies whether the receiver is a bitmap or an icon … … 1963 1963 public char[] toString () { 1964 1964 if (isDisposed()) return "Image {*DISPOSED*}"; 1965 return "Image {" ~ std.string.toString(handle) ~ "}"; 1965 // return "Image {" ~ std.string.toString(handle) ~ "}"; 1966 return "Image {"; 1966 1967 } 1967 1968 trunk/src/dwt/graphics/palettedata.d
r33 r38 20 20 21 21 module dwt.graphics.palettedata; 22 23 private24 {25 import dwt.dwt;26 import dwt.graphics.rgb;27 }28 22 29 23 /** … … 68 62 final class PaletteData { 69 63 64 private 65 { 66 import dwt.dwt; 67 import dwt.graphics.rgb; 68 } 69 70 70 /** 71 71 * true if the receiver is a direct palette, trunk/src/dwt/graphics/region.d
r33 r38 27 27 +/ 28 28 29 private30 {31 import dwt.dwt;32 33 import dwt.graphics.device;34 import dwt.graphics.rectangle;35 import dwt.graphics.point;36 37 import dwt.internal.win32.os;38 import dwt.internal.win32.types;39 40 // import dwt.util.string;41 42 }43 29 44 30 /** … … 55 41 public final class Region { 56 42 43 private 44 { 45 import dwt.dwt; 46 47 import dwt.graphics.device; 48 import dwt.graphics.rectangle; 49 import dwt.graphics.point; 50 51 import dwt.internal.win32.os; 52 import dwt.internal.win32.types; 53 54 // import dwt.util.string; 55 56 } 57 57 /** 58 58 * the OS resource for the region … … 202 202 public bit contains (int x, int y) { 203 203 if (isDisposed()) DWT.error(DWT.ERROR_GRAPHIC_DISPOSED); 204 return OS.PtInRegion (handle, x, y);204 return (OS.PtInRegion (handle, x, y) == 0) ? false : true; 205 205 } 206 206 … … 362 362 RECT r; 363 363 OS.SetRect (&r, x, y, x + width, y + height); 364 return OS.RectInRegion (handle, &r);364 return (OS.RectInRegion (handle, &r) == 0) ? false : true; 365 365 } 366 366 trunk/src/dwt/graphics/rgb.d
r33 r38 27 27 +/ 28 28 29 private30 {31 import dwt.dwt;32 import dwt.internal.serializablecompatibility;33 import std.string;34 }35 36 29 /** 37 30 * Instances of this class are descriptions of colors in … … 53 46 public struct RGB { 54 47 48 49 private 50 { 51 import dwt.dwt; 52 import dwt.internal.serializablecompatibility; 53 import std.string; 54 } 55 55 /** 56 56 * the red component of the RGB … … 128 128 */ 129 129 public char[] toString () { 130 /+ 130 131 return "RGB {" ~ .toString(red) ~ ", " 131 132 ~ .toString(green) ~ ", " 132 133 ~ .toString(blue) ~ "}"; //$NON-NLS-1$//$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$ 134 +/ 135 return "RGB"; 133 136 } 134 137 trunk/src/dwt/internal/library.d
r33 r38 22 22 module dwt.internal.library; 23 23 24 public class Library { 25 24 26 private import dwt.internal.platform; 25 26 public class Library {27 27 28 28 /* DWT Version - Mmmm (M=major, mmm=minor) */ trunk/src/dwt/internal/win32/os.d
r36 r38 18 18 *******************************************************************************/ 19 19 20 21 22 20 module dwt.internal.win32.os; 23 24 private 25 { 21 22 private { 26 23 import dwt.internal.library; 27 28 24 import dwt.internal.win32.tchar; 29 25 import dwt.internal.win32.types; 30 }31 26 } 27 32 28 public class OS { 33 29 private import dwt.internal.win32.func; 30 34 31 /* 35 32 * DWT Windows flags. … … 1447 1444 1448 1445 static bool DrawState (int hdc, int hbr, int lpOutputFunc, int lData, int wData, int x, int y, int cx, int cy, int fuFlags) { 1449 if (IsUnicode) return DrawStateW (hdc, hbr, lpOutputFunc, lData, wData, x, y, cx, cy, fuFlags); 1450 return DrawStateA (hdc, hbr, lpOutputFunc, lData, wData, x, y, cx, cy, fuFlags); 1446 if (IsUnicode) 1447 return (DrawStateW (hdc, hbr, lpOutputFunc, lData, wData, x, y, cx, cy, fuFlags) == 0) ? false : true; 1448 return (DrawStateA(hdc, hbr, lpOutputFunc, lData, wData, x, y, cx, cy, fuFlags) == 0) ? false : true ; 1451 1449 } 1452 1450 … … 1472 1470 static bool EnumSystemLocales (void* lpLocaleEnumProc, int dwFlags) { 1473 1471 if (IsUnicode) 1474 return EnumSystemLocalesW (lpLocaleEnumProc, dwFlags);1472 return (EnumSystemLocalesW(lpLocaleEnumProc, dwFlags) == 0) ? false : true; 1475 1473 else 1476 return EnumSystemLocalesA (lpLocaleEnumProc, dwFlags);1474 return (EnumSystemLocalesA (lpLocaleEnumProc, dwFlags) == 0) ? false : true; 1477 1475 } 1478 1476 1479 1477 1480 1478 static bool EnumSystemLanguageGroups (int pLangGroupEnumProc, int dwFlags, int lParam) { 1481 if (IsUnicode) return EnumSystemLanguageGroupsW (pLangGroupEnumProc, dwFlags, lParam); 1482 return EnumSystemLanguageGroupsA (pLangGroupEnumProc, dwFlags, lParam); 1479 if (IsUnicode) 1480 return (EnumSystemLanguageGroupsW (pLangGroupEnumProc, dwFlags, lParam) == 0) ? false : true; 1481 return (EnumSystemLanguageGroupsA (pLangGroupEnumProc, dwFlags, lParam) == 0) ? false : true; 1483 1482 } 1484 1483 … … 1506 1505 if (IsUnicode) { 1507 1506 wchar* lpString1 = w_str(lpString); 1508 return ExtTextOutW (hdc, X, Y, fuOptions, lprc, lpString1, cbCount, lpDx);1507 return (ExtTextOutW (hdc, X, Y, fuOptions, lprc, lpString1, cbCount, lpDx) == 0) ? false : true; 1509 1508 } 1510 1509 char* lpString1 = c_str(lpString); 1511 return ExtTextOutA (hdc, X, Y, fuOptions, lprc, lpString1, cbCount, lpDx);1510 return (ExtTextOutA (hdc, X, Y, fuOptions, lprc, lpString1, cbCount, lpDx) == 0 ) ? false : true; 1512 1511 } 1513 1512 … … 1524 1523 1525 1524 static bool GetCharABCWidths (int hdc, int iFirstChar, int iLastChar, int [] lpabc) { 1526 if (IsUnicode) return GetCharABCWidthsW (hdc,iFirstChar, iLastChar, lpabc); 1527 return GetCharABCWidthsA (hdc,iFirstChar, iLastChar, lpabc); 1525 if (IsUnicode) 1526 return (GetCharABCWidthsW (hdc,iFirstChar, iLastChar, lpabc) == 0) ? false : true; 1527 return (GetCharABCWidthsA (hdc,iFirstChar, iLastChar, lpabc) == 0) ? false : true; 1528 1528 } 1529 1529 … … 1539 1539 1540 1540 static bool GetCharWidth (int hdc, int iFirstChar, int iLastChar, int [] lpabc) { 1541 if (IsUnicode) return GetCharWidthW (hdc,iFirstChar, iLastChar, lpabc); 1542 return GetCharWidthA (hdc,iFirstChar, iLastChar, lpabc); 1541 if (IsUnicode) 1542 return (GetCharWidthW (hdc,iFirstChar, iLastChar, lpabc) == 0) ? false : true; 1543 return (GetCharWidthA (hdc,iFirstChar, iLastChar, lpabc) == 0) ? false : true; 1543 1544 } 1544 1545 … … 1546 1547 if (IsUnicode) { 1547 1548 wchar* lpClassName1 = w_str(lpClassName); 1548 return GetClassInfoW (hInstance, lpClassName1, lpWndClass);1549 return (GetClassInfoW (hInstance, lpClassName1, lpWndClass) == 0) ? false : true; 1549 1550 } 1550 1551 char* lpClassName1 = c_str(lpClassName); 1551 return GetClassInfoA (hInstance, lpClassName1, lpWndClass);1552 return (GetClassInfoA (hInstance, lpClassName1, lpWndClass) == 0) ? false : true; 1552 1553 } 1553 1554 … … 1583 1584 1584 1585 static bool GetMenuItemInfo (int hMenu, int uItem, bool fByPosition, MENUITEMINFO* lpmii) { 1585 if (IsUnicode) return GetMenuItemInfoW (hMenu, uItem, fByPosition, lpmii); 1586 return GetMenuItemInfoA (hMenu, uItem, fByPosition, lpmii); 1586 if (IsUnicode) 1587 return (GetMenuItemInfoW (hMenu, uItem, fByPosition, lpmii) == 0) ? false : true; 1588 return (GetMenuItemInfoA (hMenu, uItem, fByPosition, lpmii) == 0) ? false : true; 1587 1589 } 1588 1590 1589 1591 static bool GetMessage (MSG lpMsg, int hWnd, int wMsgFilterMin, int wMsgFilterMax) { 1590 if (IsUnicode) return GetMessageW (lpMsg, hWnd, wMsgFilterMin, wMsgFilterMax); 1591 return GetMessageA (lpMsg, hWnd, wMsgFilterMin, wMsgFilterMax); 1592 if (IsUnicode) 1593 return (GetMessageW (lpMsg, hWnd, wMsgFilterMin, wMsgFilterMax) == 0) ? false : true; 1594 return (GetMessageA (lpMsg, hWnd, wMsgFilterMin, wMsgFilterMax) == 0) ? false : true; 1592 1595 } 1593 1596 … … 1602 1605 1603 1606 static bool GetMonitorInfo (int hmonitor, MONITORINFO* lpmi) { 1604 if (IsUnicode) return GetMonitorInfoW (hmonitor, lpmi); 1605 return GetMonitorInfoA (hmonitor, lpmi); 1607 if (IsUnicode) 1608 return (GetMonitorInfoW (hmonitor, lpmi) == 0) ? false : true; 1609 return (GetMonitorInfoA (hmonitor, lpmi) == 0) ? false : true; 1606 1610 } 1607 1611 … … 1637 1641 1638 1642 static bool GetOpenFileName (OPENFILENAME* lpofn) { 1639 if (IsUnicode) return GetOpenFileNameW (lpofn); 1640 return GetOpenFileNameA (lpofn); 1643 if (IsUnicode) 1644 return (GetOpenFileNameW (lpofn) == 0) ? false : true; 1645 return (GetOpenFileNameA (lpofn) == 0) ? false : true; 1641 1646 } 1642 1647 … … 1657 1662 1658 1663 static bool GetSaveFileName (OPENFILENAME* lpofn) { 1659 if (IsUnicode) return GetSaveFileNameW (lpofn); 1660 return GetSaveFileNameA (lpofn); 1664 if (IsUnicode) 1665 return (GetSaveFileNameW (lpofn) == 0) ? false : true; 1666 return (GetSaveFileNameA (lpofn) == 0) ? false : true; 1661 1667 } 1662 1668 … … 1664 1670 if (IsUnicode) { 1665 1671 wchar* lpString1 = w_str(lpString); 1666 return GetTextExtentPoint32W (hdc, lpString1, cbString, lpSize);1672 return (GetTextExtentPoint32W (hdc, lpString1, cbString, lpSize) == 0) ? false : true; 1667 1673 } 1668 1674 char* lpString1 = c_str(lpString); 1669 return GetTextExtentPoint32A (hdc, lpString1, cbString, lpSize);1675 return (GetTextExtentPoint32A (hdc, lpString1, cbString, lpSize) == 0) ? false : true; 1670 1676 } 1671 1677 1672 1678 1673 1679 static bool GetTextMetrics (int hdc, TEXTMETRIC* lptm) { 1674 if (IsUnicode) return GetTextMetricsW (hdc, cast(TEXTMETRICW*)lptm); 1675 return GetTextMetricsA (hdc, cast(TEXTMETRICA*)lptm); 1680 if (IsUnicode) 1681 return (GetTextMetricsW (hdc, cast(TEXTMETRICW*)lptm) == 0) ? false : true; 1682 return (GetTextMetricsA (hdc, cast(TEXTMETRICA*)lptm) == 0) ? false : true; 1676 1683 } 1677 1684 … … 1679 1686 static bool GetVersionEx (OSVERSIONINFO* lpVersionInfo) { 1680 1687 if (IsUnicode) 1681 return GetVersionExW (cast(OSVERSIONINFOW*)lpVersionInfo);1688 return (GetVersionExW (cast(OSVERSIONINFOW*)lpVersionInfo) == 0) ? false : true; 1682 1689 else 1683 return GetVersionExA (cast(OSVERSIONINFOA*)lpVersionInfo);1690 return (GetVersionExA (cast(OSVERSIONINFOA*)lpVersionInfo) == 0) ? false : true; 1684 1691 } 1685 1692 … … 1708 1715 static bool ImmGetCompositionFont (int hIMC, LOGFONT* lplf) { 1709 1716 if (IsUnicode) 1710 return ImmGetCompositionFontW (hIMC, cast(LOGFONTW*)lplf);1717 return (ImmGetCompositionFontW (hIMC, cast(LOGFONTW*)lplf) == 0) ? false : true; 1711 1718 else 1712 return ImmGetCompositionFontA (hIMC, cast(LOGFONTA*)lplf);1719 return (ImmGetCompositionFontA (hIMC, cast(LOGFONTA*)lplf) == 0) ? false : true; 1713 1720 } 1714 1721 1715 1722 static bool ImmSetCompositionFont (int hIMC, LOGFONT* lplf) { 1716 1723 if (IsUnicode) 1717 return ImmSetCompositionFontW (hIMC, cast(LOGFONTW*)lplf);1724 return (ImmSetCompositionFontW (hIMC, cast(LOGFONTW*)lplf) == 0) ? false : true; 1718 1725 else 1719 return ImmSetCompositionFontA (hIMC, cast(LOGFONTA*)lplf);1726 return (ImmSetCompositionFontA (hIMC, cast(LOGFONTA*)lplf) == 0) ? false : true; 1720 1727 } 1721 1728 … … 1733 1740 if (IsUnicode) { 1734 1741 wchar* lpNewItem1 = w_str(lpNewItem); 1735 return InsertMenuW (hMenu, uPosition, uFlags, uIDNewItem, lpNewItem1);1742 return (InsertMenuW (hMenu, uPosition, uFlags, uIDNewItem, lpNewItem1) == 0) ? false : true; 1736 1743 } else { 1737 1744 char* lpNewItem1 = lpNewItem is null ? cast(char*)null : lpNewItem.bytes; 1738 return InsertMenuA (hMenu, uPosition, uFlags, uIDNewItem, lpNewItem1);1745 return (InsertMenuA (hMenu, uPosition, uFlags, uIDNewItem, lpNewItem1) == 0) ? false : true; 1739 1746 } 1740 1747 } 1741 1748 1742 1749 static bool InsertMenuItem (int hMenu, int uItem, bool fByPosition, MENUITEMINFO* lpmii) { 1743 if (IsUnicode) return InsertMenuItemW (hMenu, uItem, fByPosition, lpmii); 1744 return InsertMenuItemA (hMenu, uItem, fByPosition, lpmii); 1750 if (IsUnicode) 1751 return (InsertMenuItemW (hMenu, uItem, fByPosition, lpmii) == 0) ? false : true; 1752 return (InsertMenuItemA (hMenu, uItem, fByPosition, lpmii) == 0) ? false : true; 1745 1753 } 1746 1754 … … 1831 1839 } 1832 1840 1833 1841 // added to call proper win32 specific functions 1842 1843 static void MoveMemory (DRAWITEMSTRUCT Destination, int Source, int Length) { 1844 dwt.internal.win32.func.MoveMemory(Destination, Source, Length); 1845 } 1846 1847 static void MoveMemory (NMHDR* Destination, int Source, int Length) { 1848 dwt.internal.win32.func.MoveMemory(Destination, Source, Length); 1849 } 1850 1851 static void MoveMemory (NMTTDISPINFOA Destination, int Source, int Length) { 1852 dwt.internal.win32.func.MoveMemory(Destination, Source, Length); 1853 } 1854 1855 static void MoveMemory (NMTTDISPINFOW Destination, int Source, int Length) { 1856 dwt.internal.win32.func.MoveMemory(Destination, Source, Length); 1857 } 1858 1859 static void MoveMemory (int Destination, NMTTDISPINFOW Source, int Length) { 1860 dwt.internal.win32.func.MoveMemory(Destination, Source, Length); 1861 } 1862 1863 static void MoveMemory (HELPINFO* Destination, int Source, int Length) { 1864 dwt.internal.win32.func.MoveMemory(Destination, Source, Length); 1865 } 1866 1867 static void MoveMemory (MEASUREITEMSTRUCT Destination, int Source, int Length) { 1868 dwt.internal.win32.func.MoveMemory(Destination, Source, Length); 1869 } 1870 1871 static void MoveMemory (char* Destination, ACCEL Source, int Length) { 1872 dwt.internal.win32.func.MoveMemory(Destination, Source, Length); 1873 } 1874 1875 static void MoveMemory (WINDOWPOS* Destination, int Source, int Length) { 1876 dwt.internal.win32.func.MoveMemory(Destination, Source, Length); 1877 } 1878 1879 static void MoveMemory(int Destination, WINDOWPOS* Source, int Length) { 1880 dwt.internal.win32.func.MoveMemory(Destination, Source, Length); 1881 } 1882 1883 static void MoveMemory(MSG Destination, int Source, int Length) { 1884 dwt.internal.win32.func.MoveMemory(Destination, Source, Length); 1885 } 1886 1887 static void MoveMemory(int Destination, MEASUREITEMSTRUCT Source, int Length) { 1888 dwt.internal.win32.func.MoveMemory(Destination, Source, Length); 1889 } 1890 1891 static void MoveMemory(int Destination, byte[] Source, int Length) { 1892 dwt.internal.win32.func.MoveMemory(Destination, Source, Length); 1893 } 1894 1895 static void MoveMemory(int Destination, wchar* Source, int Length) { 1896 dwt.internal.win32.func.MoveMemory(Destination, Source, Length); 1897 } 1898 // ----------------------------- 1834 1899 1835 1900 static bool PeekMessage(MSG* lpMsg, int hWnd, int wMsgFilterMin, int wMsgFilterMax, int wRemoveMsg) { 1836 if (IsUnicode) return PeekMessageW (lpMsg, hWnd, wMsgFilterMin, wMsgFilterMax, wRemoveMsg); 1837 return PeekMessageA (lpMsg, hWnd, wMsgFilterMin, wMsgFilterMax, wRemoveMsg); 1901 if (IsUnicode) 1902 return (PeekMessageW (lpMsg, hWnd, wMsgFilterMin, wMsgFilterMax, wRemoveMsg) == 0) ? false : true; 1903 return (PeekMessageA (lpMsg, hWnd, wMsgFilterMin, wMsgFilterMax, wRemoveMsg) == 0) ? false : true; 1838 1904 } 1839 1905 1840 1906 static bool PostMessage (int hWnd, int Msg, int wParam, int lParam) { 1841 if (IsUnicode) return PostMessageW (hWnd, Msg, wParam, lParam); 1842 return PostMessageA (hWnd, Msg, wParam, lParam); 1907 if (IsUnicode) 1908 return (PostMessageW (hWnd, Msg, wParam, lParam) == 0) ? false : true; 1909 return (PostMessageA (hWnd, Msg, wParam, lParam) == 0) ? false : true; 1843 1910 } 1844 1911 1845 1912 static bool PostThreadMessage (int idThread, int Msg, int wParam, int lParam) { 1846 if (IsUnicode) return PostThreadMessageW (idThread, Msg, wParam, lParam); 1847 return PostThreadMessageA (idThread, Msg, wParam, lParam); 1913 if (IsUnicode) 1914 return (PostThreadMessageW (idThread, Msg, wParam, lParam) == 0) ? false : true; 1915 return (PostThreadMessageA (idThread, Msg, wParam, lParam) == 0) ? false : true; 1848 1916 } 1849 1917 1850 1918 static bool PrintDlg (PRINTDLG lppd) { 1851 if (IsUnicode) return PrintDlgW (lppd); 1852 return PrintDlgA (lppd); 1919 if (IsUnicode) 1920 return (PrintDlgW (lppd) == 0) ? false : true; 1921 return (PrintDlgA (lppd) == 0) ? false : true; 1853 1922 } 1854 1923 … … 1998 2067 1999 2068 static bool SetMenuItemInfo (int hMenu, int uItem, bool fByPosition, MENUITEMINFO* lpmii) { 2000 if (IsUnicode) return SetMenuItemInfoW (hMenu, uItem, fByPosition, lpmii); 2001 return SetMenuItemInfoA (hMenu, uItem, fByPosition, lpmii); 2069 if (IsUnicode) 2070 return (SetMenuItemInfoW (hMenu, uItem, fByPosition, lpmii) == 0) ? false : true; 2071 return (SetMenuItemInfoA (hMenu, uItem, fByPosition, lpmii) == 0) ? false : true; 2002 2072 } 2003 2073 … … 2015 2085 if (IsUnicode) { 2016 2086 wchar* lpString1 = w_str(lpString); 2017 return SetWindowTextW (hWnd, lpString1);2087 return (SetWindowTextW (hWnd, lpString1) == 0) ? false : true; 2018 2088 } 2019 2089 char* lpString1 = c_str(lpString); 2020 return SetWindowTextA (hWnd, lpString1);2090 return (SetWindowTextA (hWnd, lpString1) == 0) ? false : true; 2021 2091 } 2022 2092 … … 2027 2097 2028 2098 static bool ShellExecuteEx (SHELLEXECUTEINFO* lpExecInfo) { 2029 if (IsUnicode) return ShellExecuteExW(lpExecInfo); 2030 return ShellExecuteExA (lpExecInfo); 2099 if (IsUnicode) 2100 return (ShellExecuteExW(lpExecInfo) == 0) ? false : true; 2101 return (ShellExecuteExA (lpExecInfo) == 0) ? false : true; 2031 2102 } 2032 2103 … … 2034 2105 if (IsUnicode) { 2035 2106 wchar* pszPath1 = w_str(pszPath); 2036 return SHGetPathFromIDListW (pidl, pszPath1);2107 return (SHGetPathFromIDListW (pidl, pszPath1) == 0) ? false : true; 2037 2108 } 2038 2109 char* pszPath1 = c_str(pszPath); 2039 return SHGetPathFromIDListA (pidl, pszPath1);2110 return (SHGetPathFromIDListA (pidl, pszPath1) == 0) ? false : true; 2040 2111 } 2041 2112 … … 2046 2117 2047 2118 static bool SystemParametersInfo (int uiAction, int uiParam, RECT* pvParam, int fWinIni) { 2048 if (IsUnicode) return SystemParametersInfoW(uiAction, uiParam, pvParam, fWinIni); 2049 return SystemParametersInfoA (uiAction, uiParam, pvParam, fWinIni); 2119 if (IsUnicode) 2120 return (SystemParametersInfoW(uiAction, uiParam, pvParam, fWinIni) == 0) ? false : true; 2121 return (SystemParametersInfoA (uiAction, uiParam, pvParam, fWinIni) == 0) ? false : true; 2050 2122 } 2051 2123 2052 2124 static bool SystemParametersInfo (int uiAction, int uiParam, NONCLIENTMETRICS* pvParam, int fWinIni) { 2053 if (IsUnicode) return SystemParametersInfoW (uiAction, uiParam, cast(NONCLIENTMETRICSW*)pvParam, fWinIni); 2054 return SystemParametersInfoA (uiAction, uiParam, cast(NONCLIENTMETRICSA*)pvParam, fWinIni); 2125 if (IsUnicode) 2126 return (SystemParametersInfoW (uiAction, uiParam, cast(NONCLIENTMETRICSW*)pvParam, fWinIni) == 0) ? false : true; 2127 return (SystemParametersInfoA (uiAction, uiParam, cast(NONCLIENTMETRICSA*)pvParam, fWinIni) == 0) ? false : true; 2055 2128 } 2056 2129 2057 2130 static bool SystemParametersInfo (int uiAction, int uiParam, int[] pvParam, int fWinIni) { 2058 if (IsUnicode) return SystemParametersInfoW (uiAction, uiParam, pvParam, fWinIni); 2059 return SystemParametersInfoA (uiAction, uiParam, pvParam, fWinIni); 2131 if (IsUnicode) 2132 return (SystemParametersInfoW (uiAction, uiParam, pvParam, fWinIni) == 0) ? false : true; 2133 return (SystemParametersInfoA (uiAction, uiParam, pvParam, fWinIni) == 0) ? false : true; 2060 2134 } 2061 2135 … … 2068 2142 if (IsUnicode) { 2069 2143 wchar* lpClassName1 = w_str(lpClassName); 2070 return UnregisterClassW(lpClassName1, hInstance);2144 return (UnregisterClassW(lpClassName1, hInstance) == 0) ? false : true; 2071 2145 } 2072 2146 char* lpClassName1 = c_str(lpClassName); 2073 return UnregisterClassA (lpClassName1, hInstance);2147 return (UnregisterClassA (lpClassName1, hInstance) == 0) ? false : true; 2074 2148 } 2075 2149 … … 2079 2153 } 2080 2154 2081 2082 2083 2084 2085 /** Natives */ 2086 2087 static extern (Windows) 2088 { 2089 int AbortDoc (int hdc); 2090 int ActivateKeyboardLayout(int hkl, int Flags); 2091 bool AdjustWindowRectEx (RECT* lpRect, int dwStyle, bool bMenu, int dwExStyle); 2092 bool Arc (int hdc,int nLeftRect,int nTopRect,int nRightRect,int nBottomRect,int nXStartArc,int nYStartArc,int nXEndArc,int nYEndArc); 2093 int BeginDeferWindowPos (int nNumWindows); 2094 int BeginPaint (int hWnd, PAINTSTRUCT* lpPaint); 2095 bool BitBlt (int hdcDest,int nXDest,int nYDest,int nWidth,int nHeight,int hdcSrc,int nXSrc,int nYSrc,int dwRop); 2096 bool BringWindowToTop (int hWnd); 2097 int Call (int address, DLLVERSIONINFO* arg0); 2098 int CallNextHookEx(int hhk, int nCode, int wParam, int lParam); 2099 int CallWindowProcW (int lpPrevWndFunc, int hWnd, int Msg, int wParam, int lParam); 2100 int CallWindowProcA (int lpPrevWndFunc, int hWnd, int Msg, int wParam, int lParam); 2101 short CharLowerW (short ch); 2102 short CharLowerA (short ch); 2103 short CharUpperW (short ch); 2104 short CharUpperA (short ch); 2105 bool CheckMenuItem (int hmenu, int uIDCheckItem, int uCheck); 2106
