Subversion Repositories Kolibri OS

Rev

Details | Last modification | View Log | RSS feed

Rev Author Line No. Line
4973 right-hear 1
/*
2
***************************************************************************
3
* This file comprises part of PDCurses. PDCurses is Public Domain software.
4
* You may use this code for whatever purposes you desire. This software
5
* is provided AS IS with NO WARRANTY whatsoever.
6
* Should this software be used in another application, an acknowledgement
7
* that PDCurses code is used would be appreciated, but is not mandatory.
8
*
9
* Any changes which you make to this software which may improve or enhance
10
* it, should be forwarded to the current maintainer for the benefit of
11
* other users.
12
*
13
* The only restriction placed on this code is that no distribution of
14
* modified PDCurses code be made under the PDCurses name, by anyone
15
* other than the current maintainer.
16
*
17
* See the file maintain.er for details of the current maintainer.
18
***************************************************************************
19
*/
20
/*
21
$Id$
22
*/
23
#ifndef CURSOS2_INCL
24
#define CURSOS2_INCL 1
25
 
26
#ifdef CURSES__32BIT__
27
 
28
#if (NOVIO)
29
#define KbdSetStatus Kbd32SetStatus
30
#define KbdGetStatus Kbd32GetStatus
31
#define KbdCharIn Kbd32CharIn
32
#define KbdPeek   Kbd32Peek
33
#define KbdFlushBuffer Kbd32FlushBuffer
34
 
35
#define VioGetMode Vio32GetMode
36
#define VioSetMode Vio32SetMode
37
#define VioGetCurPos Vio32GetCurPos
38
#define VioSetCurPos Vio32SetCurPos
39
#define VioGetCurType Vio32GetCurType
40
#define VioSetCurType Vio32SetCurType
41
#define VioScrollDn Vio32ScrollDn
42
#define VioScrollUp Vio32ScrollUp
43
#define VioGetConfig Vio32GetConfig
44
#define VioWrtTTY Vio32WrtTTY
45
#define VioReadCellStr Vio32ReadCellStr
46
#define VioWrtCellStr Vio32WrtCellStr
47
#define VioWrtNAttr Vio32WrtNAttr
48
#endif   /*  NOVIO */
49
 
50
#define FARKeyword
51
 
52
#define CURS_INCL_VIO_KBD
53
 
54
 
55
#ifdef __EMX__
56
#  ifndef USE_OS2_H
57
#   ifdef EMXVIDEO		/* Define to use emx dos compatible video */
58
#    include 
59
#    include 
60
#    ifdef USE_OS2_H
61
#     undef USE_OS2_H	/* And we can use the extra compile speed... */
62
#    endif
63
#   else
64
#    define USE_OS2_H
65
#   endif
66
#  endif
67
#  define APIENTRY
68
#else
69
#  define APIRET ULONG
70
#endif
71
 
72
#else
73
 
74
 
75
#   define FARKeyword far
76
#   define APIRET USHORT
77
 
78
#ifdef USE_OS2_H
79
#   define INCL_VIO
80
#   define INCL_KBD
81
#else
82
#   define CURS_INCL_VIO_KBD
83
#endif
84
 
85
 
86
#endif   /* __32BIT__ */
87
 
88
#ifndef EMXVIDEO
89
 
90
/* if USE_OS2_H is defined then use the os2.h that comes with your compiler ...*/
91
 
92
#ifdef USE_OS2_H
93
#  include 
94
#else
95
 
96
/* ... otherwise use these definitions */
97
 
98
#  include 
99
 
100
#endif
101
 
102
#ifdef CURS_INCL_VIO_KBD
103
 
104
typedef SHANDLE         HKBD;
105
typedef HKBD    FARKeyword *   PHKBD;
106
 
107
 
108
typedef SHANDLE         HVIO;
109
typedef HVIO    FARKeyword *   PHVIO;
110
 
111
 
112
 
113
typedef struct _KBDINFO {
114
        USHORT cb;
115
        USHORT fsMask;
116
        USHORT chTurnAround;
117
        USHORT fsInterim;
118
        USHORT fsState;
119
        }KBDINFO;
120
typedef KBDINFO FARKeyword *PKBDINFO;
121
 
122
 
123
USHORT APIENTRY KbdSetStatus(
124
        PKBDINFO    pkbdinfo,
125
        HKBD        hkbd );
126
 
127
 
128
USHORT APIENTRY KbdGetStatus(
129
        PKBDINFO    pkbdinfo,
130
        HKBD        hdbd  );
131
 
132
 
133
typedef struct _KBDKEYINFO {
134
        UCHAR    chChar;    /* ASCII character code                     */
135
        UCHAR    chScan;    /* Scan Code                                */
136
        UCHAR    fbStatus;
137
        UCHAR    bNlsShift;
138
        USHORT   fsState;
139
        ULONG    time;
140
        }KBDKEYINFO;
141
typedef KBDKEYINFO FARKeyword *PKBDKEYINFO;
142
 
143
#define IO_WAIT     0
144
#define IO_NOWAIT   1
145
 
146
USHORT APIENTRY KbdCharIn(
147
        PKBDKEYINFO pkbci,
148
        USHORT      fWait,      /* IO_WAIT, IO_NOWAIT     */
149
        HKBD        hkbd);
150
 
151
USHORT APIENTRY KbdPeek(
152
        PKBDKEYINFO  pkbci,
153
        HKBD         hkbd );
154
 
155
USHORT APIENTRY KbdFlushBuffer(
156
        HKBD hkbd);
157
 
158
 
159
typedef struct _VIOMODEINFO {
160
        USHORT cb;
161
        UCHAR  fbType;
162
        UCHAR  color;
163
        USHORT col;     /* number of text columns                       */
164
        USHORT row;     /* number of text rows                          */
165
        USHORT hres;    /* horizontal resolution                        */
166
        USHORT vres;    /* vertical resolution                          */
167
        UCHAR  fmt_ID;
168
        UCHAR  attrib;  /* number of attributes                         */
169
        ULONG  buf_addr;
170
        ULONG  buf_length;
171
        ULONG  full_length;
172
        ULONG  partial_length;
173
        PCH    ext_data_addr;
174
        } VIOMODEINFO;
175
typedef VIOMODEINFO FARKeyword *PVIOMODEINFO;
176
 
177
 
178
USHORT APIENTRY VioGetMode(
179
        PVIOMODEINFO  pvioModeInfo,
180
        HVIO          hvio);
181
 
182
 
183
USHORT APIENTRY VioSetMode(
184
        PVIOMODEINFO  pvioModeInfo,
185
        HVIO          hvio);
186
 
187
 
188
USHORT APIENTRY VioGetCurPos(
189
        PUSHORT    pusRow,
190
        PUSHORT    pusColumn,
191
        HVIO       hvio );
192
 
193
 
194
USHORT APIENTRY VioSetCurPos(
195
        USHORT  usRow,
196
        USHORT  usColumn,
197
        HVIO    hvio);
198
 
199
typedef struct _VIOCURSORINFO {
200
        USHORT   yStart;
201
        USHORT   cEnd;
202
        USHORT   cx;
203
        USHORT   attr;   /* -1=hidden cursor, any other=normal cursor   */
204
        } VIOCURSORINFO;
205
typedef VIOCURSORINFO FARKeyword *PVIOCURSORINFO;
206
 
207
 
208
USHORT APIENTRY VioGetCurType(
209
       PVIOCURSORINFO pvioCursorInfo,
210
       HVIO           hvio );
211
 
212
 
213
USHORT APIENTRY VioSetCurType(
214
        PVIOCURSORINFO pvioCursorInfo,
215
        HVIO           hvio );
216
 
217
USHORT APIENTRY VioScrollDn(
218
        USHORT  usTopRow,
219
        USHORT  usLeftCol,
220
        USHORT  usBotRow,
221
        USHORT  usRightCol,
222
        USHORT  cbLines,
223
        PBYTE   pCell,
224
        HVIO    hvio );
225
 
226
 
227
 
228
USHORT APIENTRY VioScrollUp(
229
        USHORT  usTopRow,
230
        USHORT  usLeftCol,
231
        USHORT  usBotRow,
232
        USHORT  usRightCol,
233
        USHORT  cbLines,
234
        PBYTE   pCell,
235
        HVIO    hvio );
236
 
237
 
238
   /* VIOCONFIGINFO.adapter constants */
239
 
240
   #define DISPLAY_MONOCHROME      0x0000
241
   #define DISPLAY_CGA             0x0001
242
   #define DISPLAY_EGA             0x0002
243
   #define DISPLAY_VGA             0x0003
244
   #define DISPLAY_8514A           0x0007
245
 
246
   /* VIOCONFIGINFO.display constants */
247
 
248
   #define MONITOR_MONOCHROME      0x0000
249
   #define MONITOR_COLOR           0x0001
250
   #define MONITOR_ENHANCED        0x0002
251
   #define MONITOR_8503            0x0003
252
   #define MONITOR_851X_COLOR      0x0004
253
   #define MONITOR_8514            0x0009
254
 
255
typedef struct _VIOCONFIGINFO {
256
        USHORT  cb;
257
        USHORT  adapter;
258
        USHORT  display;
259
        ULONG   cbMemory;
260
        USHORT  Configuration;
261
        USHORT  VDHVersion;
262
        USHORT  Flags;
263
        ULONG   HWBufferSize;
264
        ULONG   FullSaveSize;
265
        ULONG   PartSaveSize;
266
        USHORT  EMAdaptersOFF;
267
        USHORT  EMDisplaysOFF;
268
        } VIOCONFIGINFO;
269
typedef VIOCONFIGINFO FARKeyword *PVIOCONFIGINFO;
270
 
271
 
272
USHORT APIENTRY VioGetConfig(
273
        USHORT         usConfigId,  /* Reserved (must be 0)             */
274
        PVIOCONFIGINFO pvioin,
275
        HVIO           hvio );
276
 
277
USHORT APIENTRY VioWrtTTY(
278
        PCH     pch,
279
        USHORT  cb,
280
        HVIO    hvio );
281
 
282
USHORT APIENTRY VioReadCellStr(
283
        PCH       pchCellStr,
284
        PUSHORT   pcb,
285
        USHORT    usRow,
286
        USHORT    usColumn,
287
        HVIO      hvio );
288
 
289
USHORT APIENTRY VioWrtCellStr(
290
        PCH      pchCellStr,
291
        USHORT   cb,
292
        USHORT   usRow,
293
        USHORT   usColumn,
294
        HVIO     hvio );
295
 
296
USHORT APIENTRY VioWrtNAttr(
297
        PBYTE     pAttr,
298
        USHORT    cb,
299
        USHORT    usRow,
300
        USHORT    usColumn,
301
        HVIO      hvio );
302
 
303
 
304
USHORT APIENTRY VioWrtNCell(
305
        PBYTE   pCell,
306
        USHORT  cb,
307
        USHORT  usRow,
308
        USHORT  usColumn,
309
        HVIO    hvio );
310
 
311
#endif
312
 
313
#endif
314
 
315
 
316
#ifndef KEYBOARD_ASCII_MODE
317
#define KEYBOARD_ASCII_MODE 0x0008
318
#endif
319
 
320
#ifndef KEYBOARD_BINARY_MODE
321
#define KEYBOARD_BINARY_MODE 0x0004
322
#endif
323
 
324
#endif	/* !EMXVIDEO */