#include "lapi.h"#include "hapi.h"Go to the source code of this file.
Data Structures | |
| struct | MouseData |
Defines | |
| #define | eSuspend 1 |
| #define | eUnSuspend 2 |
| #define | eCleanup 3 |
| #define | SPI_GETMOUSESPEED 112 |
| #define | abs(x) (max((x),-(x))) |
Typedefs | |
| typedef MouseData | MouseData |
Functions | |
| void __cdecl | thehCallback (int number, signed int dx, signed int dy, unsigned int buttons, int suspended) |
| void __cdecl | hLockCanvas () |
| void __cdecl | hUpdateCursors (int useCache) |
| DWORD WINAPI | MainThread (LPVOID lpParameter) |
| int __cdecl | hInitialise (int count, HWND window, HDC getscreen, unsigned int getevents) |
| void __cdecl | hSuspendMouse (int number) |
| void __cdecl | hUnSuspendMouse (int number) |
| void __cdecl | hCleanup (void) |
| void __cdecl | hGetRelativePosition (int number, hPOINT *p) |
| void __cdecl | hGetAbsolutePosition (int number, hPOINT *p) |
| void __cdecl | hSetAbsolutePosition (int number, hPOINT p) |
| void __cdecl | hSetCursor (int number, hPOINT p, HBITMAP cursor, BYTE r, BYTE g, BYTE b) |
| int __cdecl | hGetLastSuspended (void) |
| int __cdecl | hGetLastUnSuspended (void) |
| int __cdecl | hGetLastMoved (void) |
Variables | |
| MouseData * | micedata = NULL |
| int | nummice = -1 |
| HANDLE | child = NULL |
| volatile int | mousecount |
| volatile HWND | mousewindow |
| DWORD | dwThreadId |
| HANDLE | datamutex = NULL |
| HANDLE | canvas = NULL |
| HANDLE | mutex = NULL |
| HANDLE | event = NULL |
| HANDLE | reply = NULL |
| int | lastsuspended |
| int | lastunsuspended |
| int | lastmoved |
| unsigned int | events |
| volatile int | call |
| volatile int | parameter |
| int | accel [3] |
| int | speed |
| int | rx |
| int | ry |
| HDC | tmp = NULL |
| int | mleft |
| int | mright |
| int | mtop |
| int | mbottom |
| HDC | screen |
|
|
Definition at line 55 of file hapi.c. Referenced by hUpdateCursors(), and thehCallback(). |
|
|
Definition at line 7 of file hapi.c. Referenced by hCleanup(), and MainThread(). |
|
|
Definition at line 5 of file hapi.c. Referenced by hSuspendMouse(), and MainThread(). |
|
|
Definition at line 6 of file hapi.c. Referenced by hUnSuspendMouse(), and MainThread(). |
|
|
Definition at line 10 of file hapi.c. Referenced by hInitialise(). |
|
|
|
|
|
Shutdown the API. Takes care of deallocating allocated ressources, including killing listener thread. It also UnGets all acquired mice. |
|
||||||||||||
|
Get the absolute position of the specified mouse. This is affected by the CLIP flag (ie. the position is always within the DC given to hInitialise).
Definition at line 371 of file hapi.c. References datamutex, MouseData::X, hPOINT::x, MouseData::Y, and hPOINT::y. |
|
|
Definition at line 450 of file hapi.c. References lastmoved. |
|
|
Definition at line 438 of file hapi.c. References lastsuspended. |
|
|
Definition at line 444 of file hapi.c. References lastunsuspended. |
|
||||||||||||
|
Get the relative movement of the specified mouse since the last call. This is not affected by the CLIP flag.
Definition at line 359 of file hapi.c. References datamutex, MouseData::dx, MouseData::dy, hPOINT::x, and hPOINT::y. |
|
||||||||||||||||||||
|
Initialise the API. This must be called or all the other functions will return abnormally. After this returns from the first call, it is thread-safe.
Definition at line 237 of file hapi.c. References accel, MouseData::cache, canvas, child, MouseData::cursor, CURSOR, datamutex, dwThreadId, MouseData::dx, MouseData::dy, event, events, MouseData::hx, MouseData::hy, MainThread(), mbottom, mleft, mousecount, mousewindow, mright, mtop, mutex, nummice, parameter, reply, rx, ry, screen, speed, SPI_GETMOUSESPEED, MouseData::suspended, MouseData::X, and MouseData::Y. |
|
|
Lock the canvas on which cursors are drawn. No cursors will be updated when this is called until hUpdateCursors is called manually from within the same thread. Definition at line 146 of file hapi.c. References canvas. |
|
||||||||||||
|
Set the relative position of the specified mouse. This is clipped to the DC given to hInitialise is the CLIP flag was specified. If the CURSOR flag was specified, the cursors are redrawn.
Definition at line 380 of file hapi.c. References datamutex, mbottom, mleft, mright, mtop, hPOINT::x, MouseData::X, hPOINT::y, and MouseData::Y. |
|
||||||||||||||||||||||||||||
|
Set a cursor for a given mouse. If the CURSOR flag is not given this only stores the cursor, but does not display it.
Definition at line 390 of file hapi.c. References MouseData::cache, MouseData::cachebitmap, MouseData::cursor, MouseData::cursorbitmap, MouseData::cx, MouseData::cy, datamutex, hUpdateCursors(), MouseData::hx, MouseData::hy, screen, MouseData::theSize, tmp, hPOINT::x, and hPOINT::y. |
|
|
Suspend the specified mouse
Definition at line 313 of file hapi.c. References call, child, eSuspend, event, lastmoved, lastsuspended, lastunsuspended, mutex, parameter, reply, and MouseData::suspended. |
|
|
UnSuspend the specified mouse
Definition at line 329 of file hapi.c. References call, child, eUnSuspend, event, lastmoved, lastsuspended, lastunsuspended, mutex, parameter, reply, and MouseData::suspended. |
|
|
Redisplay all cursors (only if the CURSOR flag is given)
Definition at line 150 of file hapi.c. References abs, MouseData::cache, canvas, MouseData::cursor, CURSOR, MouseData::cx, MouseData::cy, datamutex, events, MouseData::hx, MouseData::hy, nummice, screen, MouseData::suspended, MouseData::theSize, tmp, MouseData::tx, MouseData::ty, MouseData::wh, MouseData::ww, MouseData::wx, MouseData::wy, MouseData::X, and MouseData::Y. Referenced by hSetCursor(), MainThread(), and thehCallback(). |
|
|
Definition at line 205 of file hapi.c. References eCleanup, eSuspend, eUnSuspend, event, hUpdateCursors(), lGetMice(), lRegisterCallback(), lSuspendMouse(), lUnGetAllMice(), lUnRegisterCallback(), lUnSuspendMouse(), mousecount, parameter, reply, and thehCallback(). Referenced by hInitialise(). |
|
||||||||||||||||||||||||
|
Definition at line 57 of file hapi.c. References abs, accel, ACCELERATE, BUTTON, CLIP, datamutex, MouseData::dx, MouseData::dy, events, hUpdateCursors(), lastmoved, lastsuspended, lastunsuspended, mbottom, mleft, mousewindow, MOVEMENT, mright, mtop, rx, ry, speed, SUSPEND, MouseData::X, and MouseData::Y. Referenced by MainThread(). |
|
|
Definition at line 42 of file hapi.c. Referenced by hInitialise(), and thehCallback(). |
|
|
Definition at line 40 of file hapi.c. Referenced by hCleanup(), hSuspendMouse(), and hUnSuspendMouse(). |
|
|
Definition at line 32 of file hapi.c. Referenced by hInitialise(), hLockCanvas(), and hUpdateCursors(). |
|
|
Definition at line 27 of file hapi.c. Referenced by hCleanup(), hInitialise(), hSuspendMouse(), and hUnSuspendMouse(). |
|
|
Definition at line 31 of file hapi.c. Referenced by hGetAbsolutePosition(), hGetRelativePosition(), hInitialise(), hSetAbsolutePosition(), hSetCursor(), hUpdateCursors(), and thehCallback(). |
|
|
Definition at line 30 of file hapi.c. Referenced by hInitialise(). |
|
|
Definition at line 34 of file hapi.c. Referenced by hCleanup(), hInitialise(), hSuspendMouse(), hUnSuspendMouse(), and MainThread(). |
|
|
Definition at line 39 of file hapi.c. Referenced by hInitialise(), hUpdateCursors(), and thehCallback(). |
|
|
Definition at line 37 of file hapi.c. Referenced by hGetLastMoved(), hSuspendMouse(), hUnSuspendMouse(), and thehCallback(). |
|
|
Definition at line 37 of file hapi.c. Referenced by hGetLastSuspended(), hSuspendMouse(), hUnSuspendMouse(), and thehCallback(). |
|
|
Definition at line 37 of file hapi.c. Referenced by hGetLastUnSuspended(), hSuspendMouse(), hUnSuspendMouse(), and thehCallback(). |
|
|
Definition at line 52 of file hapi.c. Referenced by hInitialise(), hSetAbsolutePosition(), and thehCallback(). |
|
|
|
|
|
Definition at line 52 of file hapi.c. Referenced by hInitialise(), hSetAbsolutePosition(), and thehCallback(). |
|
|
Definition at line 28 of file hapi.c. Referenced by hInitialise(), and MainThread(). |
|
|
Definition at line 29 of file hapi.c. Referenced by hInitialise(), and thehCallback(). |
|
|
Definition at line 52 of file hapi.c. Referenced by hInitialise(), hSetAbsolutePosition(), and thehCallback(). |
|
|
Definition at line 52 of file hapi.c. Referenced by hInitialise(), hSetAbsolutePosition(), and thehCallback(). |
|
|
Definition at line 33 of file hapi.c. Referenced by hCleanup(), hInitialise(), hSuspendMouse(), and hUnSuspendMouse(). |
|
|
Definition at line 25 of file hapi.c. Referenced by hInitialise(), and hUpdateCursors(). |
|
|
Definition at line 40 of file hapi.c. Referenced by hInitialise(), hSuspendMouse(), hUnSuspendMouse(), and MainThread(). |
|
|
Definition at line 35 of file hapi.c. Referenced by hCleanup(), hInitialise(), hSuspendMouse(), hUnSuspendMouse(), and MainThread(). |
|
|
Definition at line 44 of file hapi.c. Referenced by hInitialise(), and thehCallback(). |
|
|
Definition at line 44 of file hapi.c. Referenced by hInitialise(), and thehCallback(). |
|
|
Definition at line 53 of file hapi.c. Referenced by hInitialise(), hSetCursor(), and hUpdateCursors(). |
|
|
Definition at line 43 of file hapi.c. Referenced by hInitialise(), and thehCallback(). |
|
|
Definition at line 46 of file hapi.c. Referenced by hSetCursor(), and hUpdateCursors(). |
1.2.18