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