FDOSTUI
FreeDOS Text User Interface
mouse.h
Go to the documentation of this file.
1 /*
2  MOUSE.H
3 
4  License CC0 PUBLIC DOMAIN
5 
6  To the extent possible under law, Mark J. Olesen has waived all copyright
7  and related or neighboring rights to FDOSTUI Library. This work is published
8  from: United States.
9 */
10 #ifndef __mouse_h__
11 
12 #ifndef __FAR
13 # if defined(__FLAT__) || defined(__LARGE__)
14 # define __FAR
15 # else
16 # define __FAR __far
17 # endif
18 #endif
19 
20 #if defined(__DOS__) || defined(__DJGPP__)
21 
22 #if defined(__WATCOMC__)
23 #pragma pack(push, 1);
24 #endif
25 
26 struct mouse_event
27 {
28  short int m_btn_state;
29  short int m_curs_col;
30  short int m_curs_row;
31 };
32 
33 #if defined(__WATCOMC__)
34 #pragma pack(pop);
35 #endif
36 
37 #endif
38 
39 #ifdef __cplusplus
40 extern "C" {
41 #endif
42 
43 #if defined(__DOS__) || defined(__DJGPP__)
44 
45 extern short int mouse_initialized;
46 
47 extern int mouse_get_event(struct mouse_event __FAR* o_event);
48 
49 extern int mouse_init();
50 
51 extern void mouse_deinit();
52 
53 extern void mouse_show();
54 
55 extern void mouse_hide();
56 
57 #if defined(__WATCOMC__)
58 
59 #pragma aux mouse_hide= \
60  "mov ax, [mouse_initialized]" \
61  "or ax, ax" \
62  "jz mhnomouse" \
63  "mov ax, 02h" \
64  "int 33h" \
65  "mhnomouse:" \
66  modify [ AX ];
67 
68 #pragma aux mouse_show= \
69  "mov ax, [mouse_initialized]" \
70  "or ax, ax" \
71  "jz msnomouse" \
72  "mov ax, 01h" \
73  "int 33h" \
74  "msnomouse:" \
75  modify [ AX ];
76 
77 #endif
78 
79 #endif
80 
81 
82 #if defined(__NT__) || defined(__CURSES__)
83 
84 #define mouse_init() 0
85 #define mouse_deinit()
86 #define mouse_hide()
87 #define mouse_show()
88 
89 #endif
90 
91 #ifdef __cplusplus
92 }
93 #endif
94 
95 #define __mouse_h__
96 #endif
int mouse_init()
initializes the mouse
Definition: mouse.c:92
short int m_curs_row
Definition: mouse.h:30
int mouse_get_event(struct mouse_event __FAR *o_event)
retrieves a mouse event from the queue
Definition: mouse.c:64
short int mouse_initialized
Definition: mouse.c:18
short int m_curs_col
Definition: mouse.h:29
void mouse_deinit()
clean up the mouse handler
Definition: mouse.c:148
void mouse_hide()
hides the mouse cursor
Definition: mouse.c:181
contianer for mouse event
Definition: mouse.h:26
short int m_btn_state
Definition: mouse.h:28
void mouse_show()
shows the mouse cursor
Definition: mouse.c:166