source: trunk/include/win/zmouse.h@ 10367

Last change on this file since 10367 was 5647, checked in by sandervl, 24 years ago

added

File size: 3.9 KB
Line 
1/* $Id: zmouse.h,v 1.1 2001-05-03 18:06:46 sandervl Exp $ */
2
3/*
4 * MOUSE driver interface
5 *
6 * Copyright 1998 Ulrich Weigand
7 */
8
9#ifndef __WINE_MOUSE_H
10#define __WINE_MOUSE_H
11
12#include "windef.h"
13
14struct tagCURSORICONINFO;
15
16#include "pshpack1.h"
17typedef struct _MOUSEINFO
18{
19 BYTE msExist;
20 BYTE msRelative;
21 WORD msNumButtons;
22 WORD msRate;
23 WORD msXThreshold;
24 WORD msYThreshold;
25 WORD msXRes;
26 WORD msYRes;
27 WORD msMouseCommPort;
28} MOUSEINFO, *LPMOUSEINFO;
29#include "poppack.h"
30
31typedef BOOL (CALLBACK *LPMOUSE_EVENT_PROC)(DWORD,DWORD,DWORD,DWORD,DWORD);
32
33WORD WINAPI MOUSE_Inquire(LPMOUSEINFO lpMouseInfo);
34VOID WINAPI MOUSE_Enable(LPMOUSE_EVENT_PROC lpMouseEventProc);
35VOID WINAPI MOUSE_Disable(VOID);
36
37/* Wine internals */
38
39typedef struct tagMOUSE_DRIVER {
40 VOID (*pSetCursor)(struct tagCURSORICONINFO *);
41 VOID (*pMoveCursor)(WORD, WORD);
42 BOOL (*pEnableWarpPointer)(BOOL);
43} MOUSE_DRIVER;
44
45extern MOUSE_DRIVER *MOUSE_Driver;
46
47#define WINE_MOUSEEVENT_MAGIC ( ('M'<<24)|('A'<<16)|('U'<<8)|'S' )
48typedef struct _WINE_MOUSEEVENT
49{
50 DWORD magic;
51 DWORD keyState;
52 DWORD time;
53 HWND hWnd;
54
55} WINE_MOUSEEVENT;
56
57void MOUSE_SendEvent( DWORD mouseStatus, DWORD posX, DWORD posY,
58 DWORD keyState, DWORD time, HWND hWnd );
59
60/***********************************
61 * MouseWheel support (defines)
62 */
63
64#define MSH_MOUSEWHEEL "MSWHEEL_ROLLMSG"
65
66#define WHEEL_DELTA 120
67
68#ifndef WM_MOUSEWHEEL
69#define WM_MOUSEWHEEL (WM_MOUSELAST+1)
70#endif
71
72#define MOUSEZ_CLASSNAME "MouseZ"
73#define MOUSEZ_TITLE "Magellan MSWHEEL"
74
75#define MSH_WHEELMODULE_CLASS (MOUSEZ_CLASSNAME)
76#define MSH_WHEELMODULE_TITLE (MOUSEZ_TITLE)
77
78#define MSH_WHEELSUPPORT "MSH_WHEELSUPPORT_MSG"
79
80#define MSH_SCROLL_LINES "MSH_SCROLL_LINES_MSG"
81
82#ifndef WHEEL_PAGESCROLL
83#define WHEEL_PAGESCROLL (UINT_MAX)
84#endif
85
86#ifndef SPI_SETWHEELSCROLLLINES
87#define SPI_SETWHEELSCROLLLINES 105
88#endif
89
90/*********************************************************************
91* INLINE FUNCTION: HwndMsWheel
92* Purpose : Get a reference to MSWheel Window, the registered messages,
93* wheel support active setting, and number of scrollLines
94* Params : PUINT puiMsh_MsgMouseWheel - address of UINT to contain returned registered wheel message
95* PUINT puiMsh_Msg3DSupport - address of UINT to contain wheel support registered message
96* PUINT puiMsh_MsgScrollLines - address of UINT to contain Scroll lines registered message
97* PBOOL pf3DSupport - address of BOOL to contain returned flag for wheel support active
98* PINT piScrollLines - address of int to contain returned scroll lines
99* Returns : HWND handle to the MsWheel window
100* Note : The return value for pf3DSupport and piScrollLines is dependant
101* on the POINT32 module. If POINT32 module is not running then
102* the values returned for these parameters will be
103* FALSE and 3, respectively.
104*********************************************************************/
105inline HWND HwndMSWheel(
106 PUINT puiMsh_MsgMouseWheel,
107 PUINT puiMsh_Msg3DSupport,
108 PUINT puiMsh_MsgScrollLines,
109 PBOOL pf3DSupport,
110 PINT piScrollLines
111)
112{
113 HWND hdlMsWheel;
114
115 hdlMsWheel = FindWindow(MSH_WHEELMODULE_CLASS, MSH_WHEELMODULE_TITLE);
116
117 *puiMsh_MsgMouseWheel = RegisterWindowMessage(MSH_MOUSEWHEEL);
118 *puiMsh_Msg3DSupport = RegisterWindowMessage(MSH_WHEELSUPPORT);
119 *puiMsh_MsgScrollLines = RegisterWindowMessage(MSH_SCROLL_LINES);
120
121 if (*puiMsh_Msg3DSupport)
122 *pf3DSupport = (BOOL)SendMessage(hdlMsWheel, *puiMsh_Msg3DSupport, 0, 0);
123 else
124 *pf3DSupport = FALSE; // default to FALSE
125
126 if (*puiMsh_MsgScrollLines)
127 *piScrollLines = (int)SendMessage(hdlMsWheel, *puiMsh_MsgScrollLines, 0, 0);
128 else
129 *piScrollLines = 3; // default
130
131 return(hdlMsWheel);
132}
133
134/* MouseWheel support
135***********************************/
136
137#endif /* __WINE_MOUSE_H */
138
Note: See TracBrowser for help on using the repository browser.