1 // ------------------------------------------------------------------------------- 2 // 3 // DXライブラリ iOS用データタイプ定義ヘッダファイル 4 // 5 // Ver 3.22a 6 // 7 // ------------------------------------------------------------------------------- 8 module dxlib_d.dxdatatypeios; 9 10 11 version (iOS): 12 13 extern (C): 14 nothrow @nogc: 15 16 // インクルード ------------------------------------------------------------------ 17 public import dxlib_d.dxcompileconfig; 18 private static import core.stdc.config; 19 private static import core.stdc.stddef; 20 private static import std.traits; 21 private static import dxlib_d.dxlib; 22 23 //extern (C++, DxLib) { 24 // マクロ定義 -------------------------------------------------------------------- 25 26 // 環境依存キーワードなど 27 /+ 28 #ifndef FASTCALL 29 #define FASTCALL 30 #endif 31 +/ 32 33 alias HBITMAP = void*; 34 alias HINSTANCE = void*; 35 alias LPSTR = char*; 36 37 enum TRUE = 1; 38 enum FALSE = 0; 39 alias BOOL = int; 40 41 version (Unicode) { 42 alias TCHAR = core.stdc.stddef.wchar_t; 43 } else { 44 alias TCHAR = char; 45 } 46 47 version (Unicode) { 48 /+ 49 #define _T(x) L##x 50 +/ 51 } else { 52 /+ 53 #define _T(x) x 54 +/ 55 } 56 57 version (Unicode) { 58 /+ 59 #define TEXT(x) L##x 60 +/ 61 } else { 62 /+ 63 #define TEXT(x) x 64 +/ 65 } 66 67 /+ 68 #define NEAR 69 #define FAR 70 #define WINAPI 71 +/ 72 73 alias LONG = int; 74 alias LPLONG = int*; 75 alias LONGLONG = core.stdc.config.cpp_longlong; 76 alias ULONGLONG = core.stdc.config.cpp_ulonglong; 77 alias BYTE = ubyte; 78 alias WORD = ushort; 79 alias DWORD = uint; 80 alias LPDWORD = uint*; 81 alias DWORD_PTR = core.stdc.config.cpp_ulonglong; 82 alias LONG_PTR = core.stdc.config.cpp_longlong; 83 84 enum _FPCLASS_SNAN = 0x0001; 85 enum _FPCLASS_QNAN = 0x0002; 86 enum _FPCLASS_NINF = 0x0004; 87 enum _FPCLASS_NN = 0x0008; 88 enum _FPCLASS_ND = 0x0010; 89 enum _FPCLASS_NZ = 0x0020; 90 enum _FPCLASS_PZ = 0x0040; 91 enum _FPCLASS_PD = 0x0080; 92 enum _FPCLASS_PN = 0x0100; 93 enum _FPCLASS_PINF = 0x0200; 94 95 enum FILE_ATTRIBUTE_DIRECTORY = 0x00000010; 96 97 enum BI_RGB = 0L; 98 enum BI_RLE8 = 1L; 99 enum BI_RLE4 = 2L; 100 enum BI_BITFIELDS = 3L; 101 102 pragma(inline, true) 103 pure nothrow @safe @nogc 104 .DWORD MAKEFOURCC(C0, C1, C2, C3)(C0 ch0, C1 ch1, C2 ch2, C3 ch3) 105 if ((std.traits.isNumeric!(C1)) && (std.traits.isNumeric!(C2)) && (std.traits.isNumeric!(C3)) && (std.traits.isNumeric!(C3))) 106 107 do 108 { 109 return (cast(.DWORD)(cast(.BYTE)(ch0))) | (cast(.DWORD)(cast(.BYTE)(ch1)) << 8) | (cast(.DWORD)(cast(.BYTE)(ch2)) << 16) | (cast(.DWORD)(cast(.BYTE)(ch3)) << 24); 110 } 111 112 // ATRAC9 を使用した読み込み処理 113 enum DX_READSOUNDFUNCTION_AT9 = 1 << (dxlib_d.dxlib.DX_READSOUNDFUNCTION_DEFAULT_NUM + 0); 114 115 // 構造体定義 -------------------------------------------------------------------- 116 117 package struct tagRECT 118 { 119 .LONG left; 120 .LONG top; 121 .LONG right; 122 .LONG bottom; 123 } 124 125 public alias RECT = .tagRECT; 126 public alias PRECT = .tagRECT*; 127 public alias NPRECT = /* NEAR */ .tagRECT*; 128 public alias LPRECT = /* FAR */ .tagRECT*; 129 130 package struct tagPOINT 131 { 132 .LONG x; 133 .LONG y; 134 } 135 136 public alias POINT = .tagPOINT; 137 public alias PPOINT = .tagPOINT*; 138 public alias NPPOINT = /* NEAR */ .tagPOINT*; 139 public alias LPPOINT = /* FAR */ .tagPOINT*; 140 141 package struct tagSIZE 142 { 143 .LONG cx; 144 .LONG cy; 145 } 146 147 public alias SIZE = .tagSIZE; 148 public alias PSIZE = .tagSIZE*; 149 public alias LPSIZE = .tagSIZE*; 150 151 align(2) 152 package struct tagBITMAPFILEHEADER 153 { 154 align(2): 155 .WORD bfType; 156 .DWORD bfSize; 157 .WORD bfReserved1; 158 .WORD bfReserved2; 159 .DWORD bfOffBits; 160 } 161 162 public alias BITMAPFILEHEADER = .tagBITMAPFILEHEADER; 163 public alias LPBITMAPFILEHEADER = /* FAR */ .tagBITMAPFILEHEADER*; 164 public alias PBITMAPFILEHEADER = .tagBITMAPFILEHEADER*; 165 166 package struct tagRGBQUAD 167 { 168 .BYTE rgbBlue; 169 .BYTE rgbGreen; 170 .BYTE rgbRed; 171 .BYTE rgbReserved; 172 } 173 174 public alias RGBQUAD = .tagRGBQUAD; 175 176 package struct tagBITMAPINFOHEADER 177 { 178 .DWORD biSize; 179 .LONG biWidth; 180 .LONG biHeight; 181 .WORD biPlanes; 182 .WORD biBitCount; 183 .DWORD biCompression; 184 .DWORD biSizeImage; 185 .LONG biXPelsPerMeter; 186 .LONG biYPelsPerMeter; 187 .DWORD biClrUsed; 188 .DWORD biClrImportant; 189 } 190 191 public alias BITMAPINFOHEADER = .tagBITMAPINFOHEADER; 192 public alias LPBITMAPINFOHEADER = /* FAR */ .tagBITMAPINFOHEADER*; 193 public alias PBITMAPINFOHEADER = .tagBITMAPINFOHEADER*; 194 195 package struct tagBITMAPINFO 196 { 197 .BITMAPINFOHEADER bmiHeader; 198 .RGBQUAD[1] bmiColors; 199 } 200 201 public alias BITMAPINFO = .tagBITMAPINFO; 202 public alias LPBITMAPINFO = /* FAR */ .tagBITMAPINFO*; 203 public alias PBITMAPINFO = .tagBITMAPINFO*; 204 205 // テーブル----------------------------------------------------------------------- 206 207 // 内部大域変数宣言 -------------------------------------------------------------- 208 209 // 関数プロトタイプ宣言----------------------------------------------------------- 210 211 //}