Initial revision
[AROS-Contrib.git] / development / compilers / freepascal / rtl / os2 / moucalls.pas
blob03068569c0696c20a59db0f4f95254517ca4c5d1
1 {Set tabsize to 4.}
2 {****************************************************************************
4 $Id$
6 MOUCALLS interface unit
7 Free Pascal Runtime Library for OS/2
8 Copyright (c) 1999-2000 by Florian Kl„mpfl
9 Copyright (c) 1999-2000 by Daniel Mantione
10 Copyright (c) 1999-2000 by Tomas Hajny
12 The Free Pascal runtime library is distributed under the Library GNU Public
13 License v2. So is this unit. The Library GNU Public License requires you to
14 distribute the source code of this unit with any product that uses it.
15 Because the EMX library isn't under the LGPL, we grant you an exception to
16 this, and that is, when you compile a program with the Free Pascal Compiler,
17 you do not need to ship source code with that program, AS LONG AS YOU ARE
18 USING UNMODIFIED CODE! If you modify this code, you MUST change the next
19 line:
21 <This is an official, unmodified Free Pascal source code file.>
23 Send us your modified files, we can work together if you want!
25 Free Pascal is distributed in the hope that it will be useful,
26 but WITHOUT ANY WARRANTY; without even the implied warranty of
27 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
28 Library GNU General Public License for more details.
30 You should have received a copy of the Library GNU General Public License
31 along with Free Pascal; see the file COPYING.LIB. If not, write to
32 the Free Software Foundation, 59 Temple Place - Suite 330,
33 Boston, MA 02111-1307, USA.
35 ****************************************************************************}
37 unit MouCalls;
39 { Interface library to MOUCALLS.DLL (through EMXWRAP.DLL; C calling convention
40 - cdecl - must be used for EMXWRAP, whereas direct MOUCALLS calls would need
41 16-bit Pascal calling convention with thunking instead).
43 Variant records and aliases for some record types created to maintain highest
44 possible level of compatibility with other existing OS/2 compilers.
46 Changelog:
48 People:
50 TH - Tomas Hajny (xhajt03@mbox.vol.cz on Internet)
52 Date: Description of change: Changed by:
54 - First released version 1.0 TH
56 Coding style:
58 I have tried to use the same coding style as Daniel Mantione in unit
59 DOSCALLS, although I can't say I would write it the same way otherwise
60 (I would write much more spaces myself, at least). Try to use it as well,
61 please. Original note by Daniel Mantione follows:
64 It may be well possible that coding style feels a bit strange to you.
65 Nevertheless I friendly ask you to try to make your changes not look all
66 to different. To make life easier, set your IDE to use tab characters,
67 turn optimal fill, autoindent and backspace unindents on and set a
68 tabsize of 4.}
70 {***************************************************************************}
71 interface
72 {***************************************************************************}
74 {$IFDEF FPC}
75 {$PACKRECORDS 1}
76 {$ENDIF FPC}
78 const
79 {return codes / error constants (those marked with * shouldn't occur under
80 normal conditions)}
81 NO_ERROR = 0;
82 Error_Invalid_Parameter = 87;
83 ERROR_SEM_TIMEOUT =121;
84 ERROR_MOUSE_NO_DEVICE =385;
85 ERROR_MOUSE_INV_HANDLE =386; {*}
86 ERROR_MOUSE_INV_PARMS =387;
87 ERROR_MOUSE_CANT_RESET =388; {*}
88 ERROR_MOUSE_DISPLAY_PARMS =389; {*}
89 ERROR_MOUSE_INV_MODULE =390;
90 ERROR_MOUSE_INV_ENTRY_PT =391; {*}
91 ERROR_MOUSE_INV_MASK =392; {*}
92 NO_ERROR_MOUSE_NO_DATA =393;
93 NO_ERROR_MOUSE_PTR_DRAWN =394; {*}
94 ERROR_MOUSE_SMG_ONLY =412;
95 ERROR_MOUSE_INVALID_ASCIIZ =413;
96 ERROR_MOUSE_INVALID_MASK =414;
97 ERROR_MOUSE_REGISTER =415;
98 ERROR_MOUSE_DEREGISTER =416;
99 ERROR_MOUSE_INVALID_IOWAIT =435; {*}
100 ERROR_MOU_DETACHED =466;
101 ERROR_MOUSE_NO_CONSOLE =501;
102 ERROR_MOUSE_INVALID_HANDLE =502; {*}
103 ERROR_MOU_EXTENDED_SG =505;
104 ERROR_MOU_NOT_INITIALIZED =530; {*}
105 ERROR_MOUINITREAL_DONE =531; {*}
106 ERROR_MOUSE_CALLER_NOT_SUBSYS =533; {*}
108 {constants for FnMask in MouRegister}
109 MR_MOUGETNUMBUTTONS =$00000001;
110 MR_MOUGETNUMMICKEYS =$00000002;
111 MR_MOUGETDEVSTATUS =$00000004;
112 MR_MOUGETNUMQUEEL =$00000008;
113 MR_MOUREADEVENTQUE =$00000010;
114 MR_MOUGETSCALEFACT =$00000020;
115 MR_MOUGETEVENTMASK =$00000040;
116 MR_MOUSETSCALEFACT =$00000080;
117 MR_MOUSETEVENTMASK =$00000100;
118 MR_MOUOPEN =$00000800;
119 MR_MOUCLOSE =$00001000;
120 MR_MOUGETPTRSHAPE =$00002000;
121 MR_MOUSETPTRSHAPE =$00004000;
122 MR_MOUDRAWPTR =$00008000;
123 MR_MOUREMOVEPTR =$00010000;
124 MR_MOUGETPTRPOS =$00020000;
125 MR_MOUSETPTRPOS =$00040000;
126 MR_MOUINITREAL =$00080000;
127 MR_MOUSETDEVSTATUS =$00100000;
129 {constants for mouse hot key bits in MouGetHotKey/MouSetHotKey}
130 MHK_BUTTON1 =1;
131 MHK_BUTTON2 =2;
132 MHK_BUTTON3 =4;
134 {MouGetDevStatus/MouSetDevStatus device status constants}
135 MOUSE_QUEUEBUSY =$0001; {event queue busy with I/O}
136 MOUSE_BLOCKREAD =$0002; {block read in progress}
137 MOUSE_FLUSH =$0004; {flush in progress}
138 MOUSE_UNSUPPORTED_MODE =$0008; {pointer draw routine disabled}
139 {by unsupported mode }
140 MOUSE_DISABLED =$0100; {drawing operations for pointer}
141 {draw routine are disabled }
142 MOUSE_MICKEYS =$0200; {mouse data returned in mickeys, not pels}
144 {constants for WaitFlag in MouReadEventQue and MouSynch}
145 MOU_NOWAIT =$0000; {MouReadEventQue: don't wait for data }
146 { on empty queue (return a null record)}
147 {MouSynch: control immediately}
148 { returned to requestor }
149 MOU_WAIT =$0001; {MouReadEventQue: wait for data on empty queue}
150 {MouSynch: requestor waits until}
151 { mouse device driver is free }
153 {constants for MouGetEventMask/MouSetEventMask events}
154 MOUSE_MOTION =$0001; {report mouse motion events with}
155 {no button press/release events }
156 MOUSE_MOTION_WITH_BN1_DOWN =$0002; {report button 1 press/release}
157 {events, with mouse motion }
158 MOUSE_BN1_DOWN =$0004; {report button 1 press/release}
159 {events, without mouse motion }
160 MOUSE_MOTION_WITH_BN2_DOWN =$0008; {report button 2 press/release}
161 {events, with mouse motion }
162 MOUSE_BN2_DOWN =$0010; {report button 2 press/release}
163 {events, without mouse motion }
164 MOUSE_MOTION_WITH_BN3_DOWN =$0020; {report button 3 press/release}
165 {events, with mouse motion }
166 MOUSE_BN3_DOWN =$0040; {report button 3 press/release}
167 {events, without mouse motion }
169 {constants for Status in MouSetDevStatus}
170 MOU_DRAW =0;
171 MOU_NODRAW =1;
173 MOU_PELS =0;
174 MOU_MICKEYS =2;
176 type
177 {unnecessary, just FYI}
178 THMOU=word;
179 PHMOU=^THMOU;
181 {record type for MouGetPtrPos/MouSetPtrPos}
182 TPtrLoc=record
183 Row, {mouse pointer row coordinate (in pels or characters)}
184 Col:word; {mouse pointer column coordinate (in pels or characters)}
185 end;
186 PPtrLoc=^TPtrLoc;
187 PtrLoc=TPtrLoc;
189 {record type for MouGetPtrShape/MouSetPtrShape}
190 TPtrShape=record
191 cb, {length of image buffer in bytes}
192 Col, {pointer width in characters (in text}
193 {modes; always 1) or pixels (>= 1) }
194 Row, {pointer height in characters (in text}
195 {modes; always 1) or pixels (>=1) }
196 ColHot, {hotspot offset from the left}
197 {side, in characters or pels }
198 {(must be 0 in text modes) }
199 RowHot:word; {hotspot offset from the top,}
200 {in characters or pels }
201 {(must be 0 in text modes) }
202 end;
203 PPtrShape=^TPtrShape;
204 PtrShape=TPtrShape;
206 {record type for MouReadEventQue}
207 (* #pragma pack(2) ??? *)
208 TMouEventInfo=record
209 fs:word; {event bits (state of the mouse at the time }
210 {of the event) - see MOUSE_MOTION, }
211 {MOUSE_MOTION_WITH_BN1_DOWN, MOUSE_BN1_DOWN, }
212 {MOUSE_MOTION_WITH_BN2_DOWN, MOUSE_BN2_DOWN, }
213 {MOUSE_MOTION_WITH_BN3_DOWN and MOUSE_BN3_DOWN }
214 {constants (other bits reserved and set to zero)}
215 Time:cardinal; {event timestamp - unique number of milliseconds}
216 {(since the system was started }
217 Row, {pointer current row position (absolute or relative)}
218 Col:integer; {pointer current column position}
219 {(absolute or relative) }
220 end;
221 PMouEventInfo=^TMouEventInfo;
222 MouEventInfo=TMouEventInfo;
224 {record type for MouGetNumQueEl}
225 TMouQueInfo=record
226 cEvents, {current number of elements in event}
227 {queue, between 0 and cmaxEvents }
228 cmaxEvents:word; {maximum queue size in elements, as specified }
229 {in the QSIZE=NN parameter in DEVICE=MOUSExxx.SYS}
230 {statement in CONFIG.SYS }
231 end;
232 PMouQueInfo=^TMouQueInfo;
233 MouQueInfo=TMouQueInfo;
235 {record type for MouGetScaleFact/MouSetScaleFact}
236 TScaleFact=record
237 RowScale, {current row scaling factor}
238 ColScale:word; {current column scaling factor}
239 end;
240 PScaleFact=^TScaleFact;
241 ScaleFact=TScaleFact;
243 {record type for MouRemovePtr}
244 TNoPtrRect=record
245 Row, {upper row of the rectangle (pels or characters)}
246 Col, {column of the left edge (pels or characters)}
247 cRow, {bottom row of the rectangle (pels or characters)}
248 cCol:word; {column of the right edge (pels or characters)}
249 end;
250 PNoPtrRect=^TNoPtrRect;
251 NoPtrRect=TNoPtrRect;
253 TThreshold=record
254 case boolean of
255 false:(Length:word; {length of data in bytes}
256 Level1, {first movement level}
257 Lev1Mult, {first level multiplier}
258 Level2, {second movement level}
259 Lev2Mult:word); {second level multiplier}
260 true:(aLength:word);
261 end;
262 PThreshold=^TThreshold;
263 Threshold=TThreshold;
266 {Register a mouse subsystem within a session.}
267 {ModuleName is name of the dynamic link module (the maximum length
268 is 8 characters - plus the final #0 character in the PChar version of this
269 call), ProcName is the dynamic link entry point name of a routine that receives
270 control when any of the registered functions are called (the maximum length
271 is 32 bytes - plus the final #0 character in the PChar version of this call),
272 FnMask is a mask of bits, where each bit set to 1 identifies a mouse function
273 being registered - see MR_MOU* constants.}
274 {Possible return codes:
275 0 NO_ERROR
276 385 ERROR_MOUSE_NO_DEVICE
277 413 ERROR_MOUSE_INVALID_ASCIIZ
278 414 ERROR_MOUSE_INVALID_MASK
279 415 ERROR_MOUSE_REGISTER
280 466 ERROR_MOU_DETACHED
281 505 ERROR_MOU_EXTENDED_SG}
282 {Remarks:
283 * The Base Mouse Subsystem is the default mouse subsystem. There can be only
284 one MouRegister outstanding for each session without an intervening
285 MouDeRegister. MouDeRegister must be issued by the same process that issued
286 MouRegister.
287 * When any registered function is called, control is routed to EntryName.
288 When this routine is entered, four additional values are pushed onto the
289 stack. The first is the index number (Word) of the function being called.
290 The second is a near pointer (Word). The third is the caller's DS register
291 (Word). The fourth is the return address (DWord) to the mouse router. For
292 example, if MouGetNumMickeys were called and control routed to EntryName,
293 the stack would appear as if the following instructions were executed:
295 PUSH@ WORD MickeyCnt
296 PUSH WORD MouHandle
297 CALL FAR MouGetNumMickeys
298 PUSH WORD Function Code
299 CALL NEAR Entry point in Mouse Router
300 PUSH DS
301 CALL FAR EntryName
304 * When a registered function returns to the Mouse Router, AX is interpreted
305 as follows:
306 AX = 0 - no error, do not invoke the Base Mouse Subsystem routine,
307 return AX = 0
308 AX = -1 - invoke the BaseMouse Subsystem routine, return AX = return code
309 from the Base Mouse Subsystem
310 AX = error (if not 0 or -1) - do not invoke the Base Mouse Subsystem
311 Routine, return AX = error
312 * When the mouse router receives a mouse call, it routes it to the Base Mouse
313 Subsystem unless an application or other mouse subsystem has previously
314 issued MouRegister for that call. If the call was registered, the subsystem
315 is entered at the EntryName specified, and provided with the applicable
316 function code.
317 * The registered function mask is used to determine whether a requested
318 function is performed by the registered mouse subsystem or default to the
319 Base Mouse Subsystem.
320 * The following list shows the relationship of the mouse API calls and the
321 Function Code passed to either the Base Mouse Subsystem or a registered
322 mouse subsystem.
324 MOU API calls Function Code
325 MouGetNumButtons 00h
326 MouGetNumMickeys 01h
327 MouGetDevStatus 02h
328 MouGetNumQueEl 03h
329 MouReadEventQue 04h
330 MouGetScaleFact 05h
331 MouGetEventMask 06h
332 MouSetScaleFact 07h
333 MouSetEventMask 08h
334 Reserved 09h
335 Reserved 0Ah
336 MouOpen 0Bh
337 MouClose 0Ch
338 MouGetPtrShape 0Dh
339 MouSetPtrShape 0Eh
340 MouDrawPtr 0Fh
341 MouRemovePtr 10h
342 MouGetPtrPos 11h
343 MouSetPtrPos 12h
344 MouInitReal 13h
345 MouFlushQue 14h
346 MouSetDevStatus 15h
347 * A registered mouse sybsystem must leave the stack, on exit, in the exact
348 state it was received.}
349 function MouRegister(ModuleName,ProcName:PChar;FnMask:cardinal):word; cdecl;
350 function MouRegister(ModuleName,ProcName:string;FnMask:cardinal):word;
352 {Deregister a mouse subsystem previously registered within a session.}
353 {Possible return codes:
354 0 NO_ERROR
355 385 ERROR_MOUSE_NO_DEVICE
356 416 ERROR_MOUSE_DEREGISTER
357 466 ERROR_MOU_DETACHED
358 505 ERROR_MOU_EXTENDED_SG}
359 {Remarks:
360 * The process that issued the MouRegister must release the session
361 (by a MouDeRegister call) from the registered subsystem before another PID
362 may issue MouRegister.
363 * The process that issued the MouRegister is the only process that may
364 issue MouDeRegister against the currently registered subsystem.
365 * After the owning process has released the subsystem with a MouDeRegister
366 call, any other process in the session may issue a MouRegister and therefore
367 modify the mouse support for the entire session.}
368 function MouDeRegister:word; cdecl;
370 {Direct the mouse driver to flush (empty) the mouse event queue and the monitor
371 chain data for the session.}
372 {MouHandle is the mouse device handle from a previous MouOpen call.}
373 {Possible return codes:
374 0 NO_ERROR
375 385 ERROR_MOUSE_NO_DEVICE
376 466 ERROR_MOU_DETACHED
377 501 ERROR_MOUSE_NO_CONSOLE
378 505 ERROR_MOU_EXTENDED_SG}
379 function MouFlushQue(MouHandle:word):word; cdecl;
381 {Query the mouse driver to determine the current row and column coordinate
382 position of the mouse pointer.}
383 {Mouse pointer position returned in MouPtr, MouHandle is the mouse device
384 handle from a previous MouOpen call.}
385 {Possible return codes:
386 0 NO_ERROR
387 385 ERROR_MOUSE_NO_DEVICE
388 466 ERROR_MOU_DETACHED
389 501 ERROR_MOUSE_NO_CONSOLE
390 505 ERROR_MOU_EXTENDED_SG}
391 {Remarks:
392 * For a text window (VIO) application, the text window is a view on the
393 larger logical video buffer (LVB). The mouse pointer can be outside that
394 view and still be within the extent of the LVB. MouGetPtrPos then returns
395 the coordinates of the cell under the mouse pointer. If the pointer is
396 outside the LVB image extent, the coordinates of the nearest LVB cell are
397 returned. In either case, the LVB is scrolled until the reported LVB cell
398 appears within the view window.}
399 function MouGetPtrPos(var MouPtr:TPtrLoc;MouHandle:word):word; cdecl;
401 {Direct the mouse driver to set a new row and column coordinate position for
402 the mouse pointer.}
403 {MouPtr contains the new pointer coordinates, MouHandle is the mouse device
404 handle from a previous MouOpen call.}
405 {Possible return codes:
406 0 NO_ERROR
407 385 ERROR_MOUSE_NO_DEVICE
408 387 ERROR_MOUSE_INV_PARMS
409 466 ERROR_MOU_DETACHED
410 501 ERROR_MOUSE_NO_CONSOLE
411 505 ERROR_MOU_EXTENDED_SG}
412 {Remarks:
413 * The application must ensure that the coordinate position specified conforms
414 to the current display mode orientation for the session. Pel values must
415 be used for graphics modes and character values for text modes.
416 * This function has no effect on the display's current collision area
417 definition as specified by the MouDrawPtr call. If the mouse pointer image
418 is directed into a defined collision area, the pointer image is not drawn
419 until either the pointer is moved outside the collision area or the collision
420 area is released by the MouDrawPtr call.}
421 function MouSetPtrPos(const MouPtr:TPtrLoc;MouHandle:word):word; cdecl;
423 {Set the pointer shape and size to be used as the mouse device pointer image
424 for all applications in a session.}
425 {ImageBuf contains the bit image used by the mouse device driver as the pointer
426 shape for that session. The buffer consists of AND and XOR pointer masks
427 in a format meaningful to the pointer draw device driver (see remarks bellow),
428 ImageInfo contains the necessary data for the pointer draw device driver to
429 build a row-by-column image for each bit plan for the current display mode,
430 MouHandle is the mouse device handle from a previous MouOpen call.}
431 {Possible return codes:
432 0 NO_ERROR
433 385 ERROR_MOUSE_NO_DEVICE
434 387 ERROR_MOUSE_INV_PARMS
435 466 ERROR_MOU_DETACHED
436 501 ERROR_MOUSE_NO_CONSOLE
437 505 ERROR_MOU_EXTENDED_SG}
438 {Remarks:
439 * An application passes a data image to the mouse device driver that the mouse
440 driver applies to the screen whenever the logical pointer position is not
441 located in the application-defined collision area. The application
442 synchronizes use of the screen with the mouse driver by way of MouRemovePtr
443 and MouDrawPtr.
444 * The pointer shape is dependent on the display device driver used to support
445 the display device. OS/2 supports text and graphics modes. These modes are
446 restricted to modes 0 through 7, depending on the display device. Character
447 modes (modes 0, 1, 2, 3, and 7) support the pointer cursor only as a reverse
448 block character. This reverse block character has a character height
449 and width equal to 1.
450 * The pointer shape is mapped by the Pointer Draw Device Driver and determined
451 completely by the application. The height and width may vary from 1 through
452 the pel size of the display screen. For restrictions concerning the Pointer
453 Draw Device Driver, see IBM Operating System/2 Version 1.2 I/O Subsystems And
454 Device Support Volume 1.
455 * For CGA compatible text modes (0, 1, 2, and 3) the following describes
456 the AND and XOR pointer mask bit definitions for each character cell
457 of the masks. Bit values are:
458 Bit Description
459 15 Blinking
460 14-12 Background color
461 11 Intensity
462 10-8 Foreground color
463 7-0 Character
464 * For other custom displays and for the extended modes of the EGA attachment,
465 it is possible to set the display to modes that require multiple bit planes.
466 In these cases, the area sized by the row and column limits must be repeated
467 for each bit plane supported in that mode. Consequently, the calling process
468 must supply enough data to allow the mouse device driver to draw the pointer
469 shape on all currently supported bit planes in that session. For text modes,
470 row and column offset must equal 0.}
471 function MouSetPtrShape(var ImageBuf;var ImageInfo:TPtrShape;
472 MouHandle:word):word; cdecl;
473 function MouSetPtrShape(ImageBuf:pointer;var ImageInfo:TPtrShape;
474 MouHandle:word):word; cdecl;
476 {Get (copy) the mouse pointer shape for the session.}
477 {The pointer bit image is returned in ImageBuf (see MouSetPtrShape description
478 for information about the resulting content of this buffer), the size of the
479 pointer image buffer must be supplied in ImageInfo.cb (if the value is too
480 small, the true length is placed in this field and an error is returned),
481 on return, ImageInfo is filled with mouse pointer information, MouHandle is
482 the mouse device handle from a previous MouOpen call.}
483 {Possible return codes:
484 0 NO_ERROR
485 385 ERROR_MOUSE_NO_DEVICE
486 387 ERROR_MOUSE_INV_PARMS
487 466 ERROR_MOU_DETACHED
488 501 ERROR_MOUSE_NO_CONSOLE
489 505 ERROR_MOU_EXTENDED_SG}
490 {Remarks:
491 * The application passes a parameter list with the same meaning as defined
492 for MouSetPtrShape to the mouse device driver. The mouse device driver
493 copies the parameters that describe the pointer shape and attributes into
494 the pointer definition control block pointed to by the PtrDefRec parameter.
495 The word 0 (buffer length = cb) pointer definition record parameter field
496 must contain the size in bytes of the application buffer where the device
497 driver is to insert the session's pointer image. All other words in
498 the parameter list are returned to the application by MouGetPtrShape.
499 * For all OS/2 system-supported modes, size of the pointer image buffer
500 is specified in bytes and is equal to:
501 1) Mono & Text Modes:
502 For text mode, height and width must be 1, so length is always 4.
504 size = (height in chars) * (width in chars) * 2 * 2 = 1 * 1 * 2 * 2 = 4
506 2) Graphics Mode:
507 Width-in-pels must be a multiple of 8.
509 size = (height in pels) * (width in pels) * (bits per pel) * 2 / 8
511 a) Modes 4 and 5 (320 X 200)
513 size = (height) * (width) * 2 * 2 / 8
515 b) Mode 6 (640 X 200)
517 size = (height) * (width) * 1 * 2 / 8
518 * If the buffer size is insufficient, the cb field contains the actual size
519 in bytes of the returned pointer image.
520 * The pointer shape may be set by the application with MouSetPtrShape or may
521 be the default image provided by the installed Pointer Device Driver.}
522 function MouGetPtrShape(var ImageBuf;var ImageInfo:TPtrShape;
523 MouHandle:word):word; cdecl;
524 function MouGetPtrShape(ImageBuf:pointer;var ImageInfo:TPtrShape;
525 MouHandle:word):word; cdecl;
527 {Return status flags for the installed mouse device driver.}
528 {The current status flag settings for the installed mouse device driver are
529 returned in Status - see MOUSE_QUEUEBUSY, MOUSE_BLOCKREAD, MOUSE_FLUSH,
530 MOUSE_UNSUPPORTED_MODE, MOUSE_DISABLED and MOUSE_MICKEYS constants (other bits
531 are reserved and set to zero), MouHandle is the mouse device handle from
532 a previous MouOpen call.}
533 {Possible return codes:
534 0 NO_ERROR
535 385 ERROR_MOUSE_NO_DEVICE
536 466 ERROR_MOU_DETACHED
537 501 ERROR_MOUSE_NO_CONSOLE
538 505 ERROR_MOU_EXTENDED_SG}
539 function MouGetDevStatus(var Status:word;MouHandle:word):word; cdecl;
541 {Return the number of buttons supported on the installed mouse driver.}
542 {Number of physical buttons (1..3) returned in ButtonCount, MouHandle is
543 the mouse device handle from a previous MouOpen call.}
544 {Possible return codes:
545 0 NO_ERROR
546 385 ERROR_MOUSE_NO_DEVICE
547 466 ERROR_MOU_DETACHED
548 501 ERROR_MOUSE_NO_CONSOLE
549 505 ERROR_MOU_EXTENDED_SG}
550 function MouGetNumButtons(var ButtonCount:word;MouHandle:word):word; cdecl;
552 {Return the number of mickeys in each centimeter for the installed mouse
553 driver.}
554 {Number of physical mouse motion units (mickeys) in each centimeter (a constant
555 based upon the attached mouse device) returned in MickeyCnt, MouHandle is
556 the mouse device handle from a previous MouOpen call.}
557 {Possible return codes:
558 0 NO_ERROR
559 385 ERROR_MOUSE_NO_DEVICE
560 466 ERROR_MOU_DETACHED
561 501 ERROR_MOUSE_NO_CONSOLE
562 505 ERROR_MOU_EXTENDED_SG}
563 function MouGetNumMickeys(var MickeyCnt:word;MouHandle:word):word; cdecl;
565 {Read an event from the mouse device FIFO event queue.}
566 {The mouse event queue is returned in Event, WaitFlag determines the action to
567 take when MouReadEventQue is issued and no event is available (the mouse event
568 queue is empty) - see MOU_NOWAIT and MOU_WAIT constants, MouHandle is the mouse
569 device handle from a previous MouOpen call.}
570 {Possible return codes:
571 0 NO_ERROR
572 385 ERROR_MOUSE_NO_DEVICE
573 387 ERROR_MOUSE_INV_PARMS
574 393 ERROR_MOUSE_NO_DATA
575 466 ERROR_MOU_DETACHED
576 501 ERROR_MOUSE_NO_CONSOLE
577 505 ERROR_MOU_EXTENDED_SG}
578 {Remarks:
579 * The types of queued events are directly affected by the current value of
580 the Mouse EventMask. MouSetEventMask is used to indicate the types of events
581 desired, and MouGetEventMask is used to query the current value of the mask.
582 Refer to these functions for further explanation of the masking of events.
583 Recognition of the mouse transition depends on the use of MouState returned
584 in the event record. The application should focus on bit transitions that
585 occur in this word. It is important to properly set the event mask with
586 MouSetEventMask for reporting the state transitions.
587 Event.fs reports the state of the mouse that resulted from the action that
588 caused the event. The action can be pressing or releasing a button, and/or
589 moving the mouse. All status is given, regardless of the EventMask that
590 was used to determine whether or not to report the event.
591 For example, assume the EventMask indicates that the application wishes only
592 button 1 events. The EventMask has only bits 1 and 2 set in this case. Also
593 assume the current state of the mouse is no buttons down, and mouse is not
594 moving. At this point, button 1 is pressed causing an event; the status shows
595 button 1 down (bit 2 set). Next the mouse is moved, thereby causing more
596 events; status shows bit 1 set. Finally, mouse is stopped and button 1 is
597 released. The event shows status with no bits set.
598 Next, button 2 is pressed. No event occurs. Mouse is then moved; again,
599 no event. Then, while mouse is still in motion, button 1 is pressed; an event
600 is generated with bits 1 and 3 set in the state word. While mouse is still
601 in motion, both buttons are released. Because button 1 changes states,
602 an event occurs. The state word has bit 0 set. Finally, mouse is stopped.
603 No event occurs, again because no button 1 transition has taken place.
604 * The Event.Row and Event.Col fields may contain either absolute display
605 coordinates or relative mouse motion in mickeys. See MouSetDevStatus for
606 additional information.}
607 function MouReadEventQue(var Event:TMouEventInfo;var WaitFlag:word;
608 MouHandle:word):word; cdecl;
610 {Return the current status for the mouse device driver event queue.}
611 {Mouse queue status returned in MouseQInfo, MouHandle is the mouse device
612 handle from a previous MouOpen call.}
613 {Possible return codes:
614 0 NO_ERROR
615 385 ERROR_MOUSE_NO_DEVICE
616 466 ERROR_MOU_DETACHED
617 501 ERROR_MOUSE_NO_CONSOLE
618 505 ERROR_MOU_EXTENDED_SG}
619 function MouGetNumQueEl(var MouseQInfo:TMouQueInfo;MouHandle:word):word; cdecl;
621 {Return the current value of the mouse event queue mask.}
622 {The current mouse device driver's event mask (as previously set by
623 MouSetEventMask call) is returned in EventMask - see MOUSE_MOTION,
624 MOUSE_MOTION_WITH_BN1_DOWN, MOUSE_BN1_DOWN, MOUSE_MOTION_WITH_BN2_DOWN,
625 MOUSE_BN2_DOWN, MOUSE_MOTION_WITH_BN3_DOWN and MOUSE_BN3_DOWN constants (other
626 bits are reserved and set to zero, MouHandle is the mouse device handle from
627 a previous MouOpen call.}
628 {Possible return codes:
629 0 NO_ERROR
630 385 ERROR_MOUSE_NO_DEVICE
631 466 ERROR_MOU_DETACHED
632 501 ERROR_MOUSE_NO_CONSOLE
633 505 ERROR_MOU_EXTENDED_SG}
634 {Remarks:
635 * Buttons are logically numbered from left to right.}
636 function MouGetEventMask(var EventMask:word;MouHandle:word):word; cdecl;
638 {Assign a new event mask to the current mouse device driver.}
639 {EventMask contains the mask indicating what mouse events are to be placed on
640 the event queue (see MouReadEventQue) and which events are to be ignored - see
641 MOUSE_MOTION, MOUSE_MOTION_WITH_BN1_DOWN, MOUSE_BN1_DOWN,
642 MOUSE_MOTION_WITH_BN2_DOWN, MOUSE_BN2_DOWN, MOUSE_MOTION_WITH_BN3_DOWN and
643 MOUSE_BN3_DOWN constants (other bits reserved and set to zero; a bit set to
644 zero means that the associated type of event is not reported to the
645 application, mouse buttons are always numbered from left to right - when the
646 mouse is properly positioned for use, the left-hand button is button 1),
647 MouHandle is the mouse device handle from a previous MouOpen call.}
648 {Possible return codes:
649 0 NO_ERROR
650 385 ERROR_MOUSE_NO_DEVICE
651 466 ERROR_MOU_DETACHED
652 501 ERROR_MOUSE_NO_CONSOLE
653 505 ERROR_MOU_EXTENDED_SG}
654 {Remarks:
655 * Setting a bit in the event mask means that the associated event is reported
656 on the mouse FIFO event queue. See MouReadEventQue for examples of event
657 mask use.}
658 function MouSetEventMask(var EventMask:word;MouHandle:word):word; cdecl;
660 {Return scaling factors for the current mouse device (a pair of 1-word
661 values).}
662 {Current row and column coordinate scaling factors (1 <= factor <= 32767)
663 returned in Scale (see MouSetScaleFact for more information), MouHandle is
664 the mouse device handle from a previous MouOpen call.}
665 {Possible return codes:
666 0 NO_ERROR
667 385 ERROR_MOUSE_NO_DEVICE
668 466 ERROR_MOU_DETACHED
669 501 ERROR_MOUSE_NO_CONSOLE
670 505 ERROR_MOU_EXTENDED_SG}
671 {Remarks:
672 * The units of the scale factor depend on the mode of the display screen
673 for the session. If the screen is operating in text mode, the scaling units
674 are relative to characters. If the screen is operating in graphics mode,
675 the scaling units are relative to pels.}
676 function MouGetScaleFact(var Scale:TScaleFact;MouHandle:word):word; cdecl;
678 {Assign to the current mouse device driver a new pair of 1-word scaling
679 factors.}
680 {Scale contains the new row and column coordinate scaling factors (1 <= factor
681 <= 32767), MouHandle is the mouse device handle from a previous MouOpen call.}
682 {Possible return codes:
683 0 NO_ERROR
684 385 ERROR_MOUSE_NO_DEVICE
685 387 ERROR_MOUSE_INV_PARMS
686 466 ERROR_MOU_DETACHED
687 501 ERROR_MOUSE_NO_CONSOLE
688 505 ERROR_MOU_EXTENDED_SG}
689 {Remarks:
690 * MouSetScaleFact sets the mickey-to-pixel ratio for mouse motion. The row
691 scale and column scale ratios specify a number of mickeys for each 8 pixels.
692 The default value for the row scale is 16 mickeys for each 8 pixels. The
693 default value for the column scale is 8 mickeys to 8 pixels.
694 * The number of pixels moved does not have to correspond 1-to-1 with the number
695 of mickeys the mouse moves. The scaling factor defines a sensitivity
696 for the mouse that is a ratio of the number of mickeys required to move
697 the cursor 8 pixels on the screen. The sensitivity determines at what rate
698 the cursor moves on the screen.}
699 function MouSetScaleFact(const Scale:TScaleFact;MouHandle:word):word; cdecl;
701 {Open the mouse device for the current session.}
702 {DriverName contains the name of the pointer draw device driver to be used as
703 the pointer-image drawing routine for this session (such device driver must be
704 included in the CONFIG.SYS file at system start-up time) or is nil (the default
705 pointer draw device driver supplied by the system is used then), mouse device
706 handle is returned in MouHandle.}
707 {Possible return codes:
708 0 NO_ERROR
709 385 ERROR_MOUSE_NO_DEVICE
710 390 ERROR_MOUSE_INV_MODULE_PT
711 466 ERROR_MOU_DETACHED
712 501 ERROR_MOUSE_NO_CONSOLE
713 505 ERROR_MOU_EXTENDED_SG}
714 {Remarks:
715 * MouOpen initializes the mouse functions to a known state. The application
716 may have to issue additional mouse functions to establish the environment
717 it desires. For example, after the MouOpen, the collision area is defined
718 to be the size of the entire display. Therefore, to get the pointer to be
719 displayed, the application must issue a MouDrawPtr to remove the collision
720 area.
721 * The state of the mouse after the first MouOpen is:
722 - Row/Col scale factors set to 16/8 (see MouSetScaleFact)
723 - all events reported (see MouSetEventMask)
724 - empty event queue (see MouReadEventQue and MouGetNumQueEl)
725 - all user settable Device Status bits reset (set to zero;
726 see MouSetDevStatus)
727 - pointer set to center of screen if valid display mode is set (see
728 MouSetPtrPos)
729 - pointer shape set to the default for the pointer device driver currently
730 registered in the session (see MouSetPtrShape)
731 - collision area equal to full screen (see MouDrawPtr and MouRemovePtr)
732 * DriverName has a different definition when the caller is the Base Video
733 Subsystem (BVS). However, this implies direct calling of the 16-bit routine,
734 which is not supported currently. In such case the selector portion
735 of the pointer is zero, the offset portion is non-zero and contains a display
736 configuration number (sequentially numbered where 1 is the first display
737 configuration). The MouOpen call issued by BVS is executed on the VioSetMode
738 path. Using the display configuration number passed on the MouOpen call, the
739 Base Mouse Subsystem can detect a change in display configurations. This form
740 of the MouOpen call is not recommended for applications. Applications should
741 either send the name of the pointer draw device driver or nil.}
742 function MouOpen(DriverName:PChar;var MouHandle:word):word; cdecl;
743 function MouOpen(DriverName:string;var MouHandle:word):word;
745 {Close the mouse device for the current session.}
746 {MouHandle is the mouse device handle from a previous MouOpen call.}
747 {Possible return codes:
748 0 NO_ERROR
749 385 ERROR_MOUSE_NO_DEVICE
750 466 ERROR_MOU_DETACHED
751 501 ERROR_MOUSE_NO_CONSOLE
752 505 ERROR_MOU_EXTENDED_SG}
753 {Remarks:
754 * MouClose closes the mouse device for the current session and removes the
755 mouse device driver handle from the list of valid open mouse device
756 handles.}
757 function MouClose(MouHandle:word):word; cdecl;
759 {Notify the mouse device driver that the area defined by the passed parameters
760 if for exclusive use of the application. This area is defined as the
761 "collision" area and is not available to the mouse device driver when drawing
762 pointer images.}
763 {ProtectArea is the pointer shape collision area, MouHandle is the mouse device
764 handle from a previous MouOpen call.}
765 {Possible return codes:
766 0 NO_ERROR
767 385 ERROR_MOUSE_NO_DEVICE
768 387 ERROR_MOUSE_INV_PARMS
769 466 ERROR_MOU_DETACHED
770 501 ERROR_MOUSE_NO_CONSOLE
771 505 ERROR_MOU_EXTENDED_SG}
772 {Remarks:
773 * MouRemovePtr may be issued by any process in the session. However, only one
774 collision area is active at a time. Each MouRemovePtr command has the effect
775 of resetting the collision area to the location and area specified
776 by the current command.
777 * If the logical pointer position is outside of the collision area specified
778 by the latest MouRemovePtr command, the pointer image is drawn.
779 * The MouDrawPtr command effectively cancels the MouRemovePtr command
780 and allows the pointer to be drawn anywhere on the screen, until a new
781 MouRemovePtr command is issued.}
782 function MouRemovePtr(var ProtectArea:TNoPtrRect;MouHandle:word):word; cdecl;
784 {Notify the mouse device driver that an area previously restricted
785 to the pointer image is now available to the mouse device driver.}
786 {MouHandle is the mouse device handle from a previous MouOpen call.}
787 {Possible return codes:
788 0 NO_ERROR
789 385 ERROR_MOUSE_NO_DEVICE
790 466 ERROR_MOU_DETACHED
791 501 ERROR_MOUSE_NO_CONSOLE
792 505 ERROR_MOU_EXTENDED_SG}
793 {Remarks:
794 * The collision area (the pointer image restricted area) is established by
795 MouOpen and by MouRemovePtr. MouDrawPtr nullifies the effect of the
796 MouRemovePtr command. If there was no previous MouDrawPtr command or if a
797 previous MouDrawPtr command has already nullified the collision area, the
798 MouRemovePtr command is effectively a null operation.
799 * This call is required to begin session pointer image drawing. Immediately
800 after MouOpen is issued, the collision area is defined as the size of the
801 display. A MouDrawPtr is issued to begin pointer drawing after the
802 MouOpen.}
803 function MouDrawPtr(MouHandle:word):word; cdecl;
805 {Set the mouse device driver status flags for the installed mouse device
806 driver.}
807 {Status contains the desired status flag settings (2-byte set, only the
808 high-order byte has meaning - see MOUSE_DISABLED and MOUSE_MICKEYS constants;
809 other bits are reserved and set to zero). MouHandle is the mouse device handle
810 from a previous MouOpen call.}
811 {Possible return codes:
812 0 NO_ERROR
813 385 ERROR_MOUSE_NO_DEVICE
814 387 ERROR_MOUSE_INV_PARMS
815 466 ERROR_MOU_DETACHED
816 501 ERROR_MOUSE_NO_CONSOLE
817 505 ERROR_MOU_EXTENDED_SG}
818 {Remarks:
819 * MouSetDevStatus is the complement to MouGetDevStatus. However, not all status
820 flags may be set with MouSetDevStatus. Only the flags corresponding
821 to the following functions may be modified:
822 - Return data in mickeys
823 Normally, mouse data is returned to the application with the absolute
824 display mode coordinates of the pointer image position on the display
825 screen. By setting this status flag, mouse data is returned in relative
826 mickeys, a unit of mouse movement.
827 - Don't call pointer draw device
828 Normally, the pointer draw device driver is called for all drawing
829 operations. By setting this status flag, the mouse device driver does not
830 call the pointer draw device driver. The application must draw any required
831 pointer image on the screen.}
832 function MouSetDevStatus(var Status:word;MouHandle:word):word; cdecl;
834 {Initialize mouse pointer draw support for DOS mode.}
835 {Name of the Pointer Draw Device Driver used as the pointer-image drawing
836 routine for the DOS mode session must sent in DriverName; the name of the
837 device driver must be included in the CONFIG.SYS file at system start-up time.}
838 {Possible return codes:
839 0 NO_ERROR
840 385 ERROR_MOUSE_NO_DEVICE
841 466 ERROR_MOU_DETACHED
842 412 ERROR_MOUSE_SMG_ONLY
843 501 ERROR_MOUSE_NO_CONSOLE
844 505 ERROR_MOU_EXTENDED_SG}
845 {Remarks:
846 * MouInitReal is issued by the Base Video Subsystem at system initialization
847 time.
848 * The DOS mode mouse API (INT 33h), in contrast to the OS/2 mode Mouse API,
849 does not contain an OPEN command. In addition, there is only one session
850 for DOS mode.
851 * The default pointer draw routine for DOS mode is located in the same pointer
852 draw device driver, POINTER$, that is used for OS/2 mode. Establishing
853 addressability to the pointer draw routine must be done during system
854 initialization. This requires passing the entry point of the DOS mode pointer
855 draw routine to the mouse device driver. This is the purpose
856 of the MouInitReal call. It passes the address of the default, power-up
857 pointer draw routine for DOS mode to the mouse device driver. This
858 initialization is transparent to applications.
859 * This call is for use only by the Base Video Subsystem when invoked during
860 system initialization under the shell/session manager PID.
861 * The error code ERROR_MOUSE_SMG_ONLY is valid from shell process only.
862 * When using direct calls to the 16-bit routine, another version of this call
863 is supported as well - if the selector part of the far pointer is zero
864 and the offset portion is non-zero, the offset portion identifies the
865 power-up display configuration. However, this isn't possible in the current
866 implementation (using 32-bit wrap-around function supplied in EMXWRAP.DLL).}
867 function MouInitReal(DriverName:PChar):word; cdecl;
868 function MouInitReal(DriverName:string):word;
870 {Synchronize the mouse subsystem with the mouse device driver.}
871 {WaitFlag specifies whether the routine should wait for the mouse device driver
872 being free - see MOU_NOWAIT and MOU_WAIT constants.}
873 {Possible return codes:
874 0 NO_ERROR
875 121 ERROR_SEM_TIMEOUT}
876 {Remarks:
877 * MouSynch blocks all other threads within a session until the semaphore
878 clears (returns from the subsystem to the router). To ensure proper
879 synchronization, MouSynch should be issued by a mouse subsystem if it intends
880 to access dynamically modifiable shared data for each session or if it
881 intends to issue a DosDevIOCtl. MouSynch does not protect globally shared
882 data from threads in other sessions.}
883 function MouSynch(WaitFlag:word):word; cdecl;
885 function MouGetThreshold(var MouThreshold:TThreshold;MouHandle:word):word;
886 cdecl;
888 function MouSetThreshold(var MouThreshold:TThreshold;MouHandle:word):word;
889 cdecl;
892 following two functions are undocumented and not present within C header files:
894 function MouGetHotKey(var ButtonBits:word;MouHandle:word):word;
896 function MouSetHotKey(var ButtonBits:word;MouHandle:word):word;
899 (* Following routines are not supported
900 (just have a look in some C header
901 file - you probably won't find it there either).
902 MouFree (index 4)
903 MouShellInit (index 12)
906 {***************************************************************************}
907 implementation
908 {***************************************************************************}
911 function MouRegister(ModuleName,ProcName:PChar;FnMask:cardinal):word; cdecl;
912 external 'EMXWRAP' index 324;
913 {external 'MOUCALLS' index 24;}
915 function MouRegister(ModuleName,ProcName:string;FnMask:cardinal):word;
916 begin
917 if byte(ModuleName[0])>8 then byte(ModuleName[0]):=8;
918 ModuleName[Succ(byte(ModuleName[0]))]:=#0;
919 if byte(ProcName[0])>32 then byte(ProcName[0]):=32;
920 ProcName[Succ(byte(ProcName[0]))]:=#0;
921 MouRegister:=MouRegister(@ModuleName[1],@ProcName[1],FnMask);
922 end;
924 function MouDeRegister:word; cdecl;
925 external 'EMXWRAP' index 314;
926 {external 'MOUCALLS' index 14;}
928 function MouFlushQue(MouHandle:word):word; cdecl;
929 external 'EMXWRAP' index 307;
930 {external 'MOUCALLS' index 7;}
932 function MouGetPtrPos(var MouPtr:TPtrLoc;MouHandle:word):word; cdecl;
933 external 'EMXWRAP' index 319;
934 {external 'MOUCALLS' index 19;}
936 function MouSetPtrPos(const MouPtr:TPtrLoc;MouHandle:word):word; cdecl;
937 external 'EMXWRAP' index 321;
938 {external 'MOUCALLS' index 21;}
940 function MouSetPtrShape(ImageBuf:pointer;var ImageInfo:TPtrShape;
941 MouHandle:word):word; cdecl;
942 external 'EMXWRAP' index 302;
943 {external 'MOUCALLS' index 2;}
945 function MouSetPtrShape(var ImageBuf;var ImageInfo:TPtrShape;
946 MouHandle:word):word; cdecl;
947 external 'EMXWRAP' index 302;
948 {external 'MOUCALLS' index 2;}
950 function MouGetPtrShape(var ImageBuf;var ImageInfo:TPtrShape;
951 MouHandle:word):word; cdecl;
952 external 'EMXWRAP' index 301;
953 {external 'MOUCALLS' index 1;}
955 function MouGetPtrShape(ImageBuf:pointer;var ImageInfo:TPtrShape;
956 MouHandle:word):word; cdecl;
957 external 'EMXWRAP' index 301;
958 {external 'MOUCALLS' index 1;}
960 function MouGetDevStatus(var Status:word;MouHandle:word):word; cdecl;
961 external 'EMXWRAP' index 322;
962 {external 'MOUCALLS' index 22;}
964 function MouGetNumButtons(var ButtonCount:word;MouHandle:word):word; cdecl;
965 external 'EMXWRAP' index 308;
966 {external 'MOUCALLS' index 8;}
968 function MouGetNumMickeys(var MickeyCnt:word;MouHandle:word):word; cdecl;
969 external 'EMXWRAP' index 303;
970 {external 'MOUCALLS' index 3;}
972 function MouReadEventQue(var Event:TMouEventInfo;var WaitFlag:word;
973 MouHandle:word):word; cdecl;
974 external 'EMXWRAP' index 320;
975 {external 'MOUCALLS' index 20;}
977 function MouGetNumQueEl(var MouseQInfo:TMouQueInfo;MouHandle:word):word; cdecl;
978 external 'EMXWRAP' index 313;
979 {external 'MOUCALLS' index 13;}
981 function MouGetEventMask(var EventMask:word;MouHandle:word):word; cdecl;
982 external 'EMXWRAP' index 315;
983 {external 'MOUCALLS' index 15;}
985 function MouSetEventMask(var EventMask:word;MouHandle:word):word; cdecl;
986 external 'EMXWRAP' index 316;
987 {external 'MOUCALLS' index 16;}
989 function MouGetScaleFact(var Scale:TScaleFact;MouHandle:word):word; cdecl;
990 external 'EMXWRAP' index 306;
991 {external 'MOUCALLS' index 6;}
993 function MouSetScaleFact(const Scale:TScaleFact;MouHandle:word):word; cdecl;
994 external 'EMXWRAP' index 311;
995 {external 'MOUCALLS' index 11;}
997 function MouOpen(DriverName:PChar;var MouHandle:word):word; cdecl;
998 external 'EMXWRAP' index 317;
999 {external 'MOUCALLS' index 17;}
1001 function MouOpen(DriverName:string;var MouHandle:word):word;
1003 var B:byte;
1005 begin
1006 B:=byte(DriverName[0]);
1007 if B=0 then MouOpen:=MouOpen(nil,MouHandle) else
1008 begin
1009 if B<>255 then
1010 begin
1011 DriverName[Succ(B)]:=#0;
1012 MouOpen:=MouOpen(@DriverName[1],MouHandle);
1013 end else
1014 begin
1015 Move(DriverName[1],DriverName[0],B);
1016 DriverName[B]:=#0;
1017 MouOpen:=MouOpen(@DriverName,MouHandle);
1018 end;
1019 end;
1020 end;
1022 function MouClose(MouHandle:word):word; cdecl;
1023 external 'EMXWRAP' index 309;
1024 {external 'MOUCALLS' index 9;}
1026 function MouRemovePtr(var ProtectArea:TNoPtrRect;MouHandle:word):word; cdecl;
1027 external 'EMXWRAP' index 318;
1028 {external 'MOUCALLS' index 18;}
1030 function MouDrawPtr(MouHandle:word):word; cdecl;
1031 external 'EMXWRAP' index 326;
1032 {external 'MOUCALLS' index 26;}
1034 function MouSetDevStatus(var Status:word;MouHandle:word):word; cdecl;
1035 external 'EMXWRAP' index 326;
1036 {external 'MOUCALLS' index 26;}
1038 function MouInitReal(DriverName:PChar):word; cdecl;
1039 external 'EMXWRAP' index 327;
1040 {external 'MOUCALLS' index 27;}
1042 function MouInitReal(DriverName:string):word;
1044 var B:byte;
1046 begin
1047 B:=byte(DriverName[0]);
1048 if B=0 then MouInitReal:=MouInitReal(nil) else
1049 begin
1050 if B<>255 then
1051 begin
1052 DriverName[Succ(B)]:=#0;
1053 MouInitReal:=MouInitReal(@DriverName[1]);
1054 end else
1055 begin
1056 Move(DriverName[1],DriverName[0],B);
1057 DriverName[B]:=#0;
1058 MouInitReal:=MouInitReal(@DriverName);
1059 end;
1060 end;
1061 end;
1063 function MouSynch(WaitFlag:word):word; cdecl;
1064 external 'EMXWRAP' index 323;
1065 {external 'MOUCALLS' index 23;}
1067 function MouGetThreshold(var MouThreshold:TThreshold;MouHandle:word):word;
1068 cdecl;
1069 external 'EMXWRAP' index 329;
1070 {external 'MOUCALLS' index 29;}
1072 function MouSetThreshold(var MouThreshold:TThreshold;MouHandle:word):word;
1073 cdecl;
1074 external 'EMXWRAP' index 330;
1075 {external 'MOUCALLS' index 30;}
1079 following two functions are undocumented and not present within C header files:
1081 function MouGetHotKey(var ButtonBits:word;MouHandle:word):word;
1082 external 'MOUCALLS' index 4;
1084 function MouSetHotKey(var ButtonBits:word;MouHandle:word):word;
1085 external 'MOUCALLS' index 10;
1089 end.
1092 $Log$
1093 Revision 1.1 2002/02/19 08:25:56 sasu
1094 Initial revision
1096 Revision 1.1 2000/07/13 06:31:06 michael
1097 + Initial import
1099 Revision 1.7 2000/01/09 21:01:59 hajny
1100 * cdecl added