@@ -41,6 +41,7 @@ module deimos.ncurses.curses;
41
41
import std.c.stdio ;
42
42
import std.c.stddef ; /* we want wchar_t */
43
43
import std.c.stdarg ; /* we need va_list */
44
+ import core.stdc.config ; /* we need c_ulong */
44
45
45
46
// #include <ncursesw/unctrl.h>
46
47
public import deimos.ncurses.unctrl;
@@ -68,10 +69,9 @@ string NCURSES_VERSION = "5.7";
68
69
extern (C )
69
70
{
70
71
71
- // TODO curses.h say chtype, mmask_t is a ulong, but that exhibits errors...
72
72
/* types */
73
- alias uint chtype;
74
- alias uint mmask_t;
73
+ alias c_ulong chtype;
74
+ alias c_ulong mmask_t;
75
75
alias chtype attr_t;
76
76
alias int OPTIONS ;
77
77
alias void SCREEN ;
@@ -160,82 +160,79 @@ __gshared chtype acs_map[256];
160
160
161
161
162
162
/* acs symbols */
163
- // /I couldn't make it perfect, this is the best that I have come up with...
164
- // /Instead of calling ACS_VAR, you use ACS_VAR().
165
- // /Close enough for now??
166
163
/* VT100 symbols begin here */
167
164
168
- auto ACS_ULCORNER ()()
165
+ @property auto ACS_ULCORNER ()()
169
166
{ return acs_map[cast (ubyte )' l' ]; }
170
- auto ACS_LLCORNER ()()
167
+ @property auto ACS_LLCORNER ()()
171
168
{ return acs_map[cast (ubyte )' m' ]; }
172
- auto ACS_URCORNER ()()
169
+ @property auto ACS_URCORNER ()()
173
170
{ return acs_map[cast (ubyte )' k' ]; }
174
- auto ACS_LRCORNER ()()
171
+ @property auto ACS_LRCORNER ()()
175
172
{ return acs_map[cast (ubyte )' j' ]; }
176
- auto ACS_LTEE ()()
173
+ @property auto ACS_LTEE ()()
177
174
{ return acs_map[cast (ubyte )' t' ]; }
178
- auto ACS_RTEE ()()
175
+ @property auto ACS_RTEE ()()
179
176
{ return acs_map[cast (ubyte )' u' ]; }
180
- auto ACS_BTEE ()()
177
+ @property auto ACS_BTEE ()()
181
178
{ return acs_map[cast (ubyte )' v' ]; }
182
- auto ACS_TTEE ()()
179
+ @property auto ACS_TTEE ()()
183
180
{ return acs_map[cast (ubyte )' w' ]; }
184
- auto ACS_HLINE ()()
181
+ @property auto ACS_HLINE ()()
185
182
{ return acs_map[cast (ubyte )' q' ]; }
186
- auto ACS_VLINE ()()
183
+ @property auto ACS_VLINE ()()
187
184
{ return acs_map[cast (ubyte )' x' ]; }
188
- auto ACS_PLUS ()()
185
+ @property auto ACS_PLUS ()()
189
186
{ return acs_map[cast (ubyte )' n' ]; }
190
- auto ACS_S1 ()()
187
+ @property auto ACS_S1 ()()
191
188
{ return acs_map[cast (ubyte )' o' ]; }
192
- auto ACS_S9 ()()
189
+ @property auto ACS_S9 ()()
193
190
{ return acs_map[cast (ubyte )' s' ]; }
194
- auto ACS_DIAMOND ()()
191
+ @property auto ACS_DIAMOND ()()
195
192
{ return acs_map[cast (ubyte )' `' ]; }
196
- auto ACS_CKBOARD ()()
193
+ @property auto ACS_CKBOARD ()()
197
194
{ return acs_map[cast (ubyte )' a' ]; }
198
- auto ACS_DEGREE ()()
195
+ @property auto ACS_DEGREE ()()
199
196
{ return acs_map[cast (ubyte )' f' ]; }
200
- auto ACS_PLMINUS ()()
197
+ @property auto ACS_PLMINUS ()()
201
198
{ return acs_map[cast (ubyte )' g' ]; }
202
- auto ACS_BULLET ()()
199
+ @property auto ACS_BULLET ()()
203
200
{ return acs_map[cast (ubyte )' ~' ]; }
204
201
205
202
/* Teletype 5410v1 symbols begin here */
206
- auto ACS_LARROW ()()
203
+ @property auto ACS_LARROW ()()
207
204
{ return acs_map[cast (ubyte )' ,' ]; }
208
- auto ACS_RARROW ()()
205
+ @property auto ACS_RARROW ()()
209
206
{ return acs_map[cast (ubyte )' +' ];}
210
- auto ACS_DARROW ()()
207
+ @property auto ACS_DARROW ()()
211
208
{ return acs_map[cast (ubyte )' .' ]; }
212
- auto ACS_UARROW ()()
209
+ @property auto ACS_UARROW ()()
213
210
{ return acs_map[cast (ubyte )' -' ]; }
214
- auto ACS_BOARD ()()
211
+ @property auto ACS_BOARD ()()
215
212
{ return acs_map[cast (ubyte )' h' ]; }
216
- auto ACS_LANTERN ()()
213
+ @property auto ACS_LANTERN ()()
217
214
{ return acs_map[cast (ubyte )' i' ]; }
218
- auto ACS_BLOCK ()()
215
+ @property auto ACS_BLOCK ()()
219
216
{ return acs_map[cast (ubyte )' 0' ]; }
220
217
221
218
/*
222
219
* These aren't documented, but a lot of System Vs have them anyway
223
220
* (you can spot pprryyzz{{||}} in a lot of AT&T terminfo strings).
224
221
* The ACS_names may not match AT&T's, our source didn't know them.
225
222
*/
226
- auto ACS_S3 ()()
223
+ @property auto ACS_S3 ()()
227
224
{ return acs_map[cast (ubyte )' p' ]; }
228
- auto ACS_S7 ()()
225
+ @property auto ACS_S7 ()()
229
226
{ return acs_map[cast (ubyte )' r' ]; }
230
- auto ACS_LEQUAL ()()
227
+ @property auto ACS_LEQUAL ()()
231
228
{ return acs_map[cast (ubyte )' y' ]; }
232
- auto ACS_GEQUAL ()()
229
+ @property auto ACS_GEQUAL ()()
233
230
{ return acs_map[cast (ubyte )' z' ]; }
234
- auto ACS_PI ()()
231
+ @property auto ACS_PI ()()
235
232
{ return acs_map[cast (ubyte )' {' ]; }
236
- auto ACS_NEQUAL ()()
233
+ @property auto ACS_NEQUAL ()()
237
234
{ return acs_map[cast (ubyte )' |' ]; }
238
- auto ACS_STERLING ()()
235
+ @property auto ACS_STERLING ()()
239
236
{ return acs_map[cast (ubyte )' }' ]; }
240
237
241
238
/*
@@ -244,27 +241,27 @@ auto ACS_STERLING()()
244
241
* be B (blank), S (single), D (double), or T (thick). The subset defined
245
242
* here only uses B and S.
246
243
*/
247
- auto ACS_BSSB ()()
244
+ @property auto ACS_BSSB ()()
248
245
{ return ACS_ULCORNER (); }
249
- auto ACS_SSBB ()()
246
+ @property auto ACS_SSBB ()()
250
247
{ return ACS_LLCORNER (); }
251
- auto ACS_BBSS ()()
248
+ @property auto ACS_BBSS ()()
252
249
{ return ACS_URCORNER (); }
253
- auto ACS_SBBS ()()
250
+ @property auto ACS_SBBS ()()
254
251
{ return ACS_LRCORNER (); }
255
- auto ACS_SBSS ()()
252
+ @property auto ACS_SBSS ()()
256
253
{ return ACS_RTEE (); }
257
- auto ACS_SSSB ()()
254
+ @property auto ACS_SSSB ()()
258
255
{ return ACS_LTEE (); }
259
- auto ACS_SSBS ()()
256
+ @property auto ACS_SSBS ()()
260
257
{ return ACS_BTEE (); }
261
- auto ACS_BSSS ()()
258
+ @property auto ACS_BSSS ()()
262
259
{ return ACS_TTEE (); }
263
- auto ACS_BSBS ()()
260
+ @property auto ACS_BSBS ()()
264
261
{ return ACS_HLINE (); }
265
- auto ACS_SBSB ()()
262
+ @property auto ACS_SBSB ()()
266
263
{ return ACS_VLINE (); }
267
- auto ACS_SSSS ()()
264
+ @property auto ACS_SSSS ()()
268
265
{ return ACS_PLUS (); }
269
266
270
267
@@ -814,7 +811,7 @@ int wattron(W:WINDOW, N:chtype)(W* win, N attrs)
814
811
{ return wattr_on(win, cast (attr_t)attrs, null ); }
815
812
int wattroff (W:WINDOW , N:chtype)(W* win, N attrs)
816
813
{ return wattr_off(win, attrs, null ); }
817
- int wattrset (W:WINDOW , N:chtype)(W* win, N attrs)
814
+ N wattrset (W:WINDOW , N:chtype)(W* win, N attrs)
818
815
{ return win.attrs = attrs; }
819
816
int wattr_get (W:WINDOW , A:attr_t, S:short , V:void )
820
817
(W* win, A* attrs, S* pair, V* opts)
0 commit comments