aboutsummaryrefslogtreecommitdiff
path: root/SrcShared/Palm/Platform/Incs/Core/System/PenMgr.h
blob: 538c9acd0fdc0b40112bf3a735a006a10251c2c4 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
/******************************************************************************
 *
 * Copyright (c) 1994-1999 Palm Computing, Inc. or its subsidiaries.
 * All rights reserved.
 *
 * File: PenMgr.h
 *
 * Description:
 *		Include file for Pen manager
 *
 * History:
 *   	6/5/96 Created by Ron Marianetti
 *
 *****************************************************************************/

#ifndef __PEN_MGR_H
#define __PEN_MGR_H

// Pilot common definitions
#include <PalmTypes.h>
#include <CoreTraps.h>
#include <ErrorBase.h>
#include <Rect.h>


/********************************************************************
 * Pen Manager Errors
 * the constant serErrorClass is defined in ErrorBase.h
 ********************************************************************/
#define	penErrBadParam				(penErrorClass | 1)
#define	penErrIgnorePoint			(penErrorClass | 2)



/********************************************************************
 * Pen manager Routines
 ********************************************************************/
#ifdef REMOVE_FOR_EMULATOR
#ifdef __cplusplus
extern "C" {
#endif


// Initializes the Pen Manager
Err	PenOpen(void)
				SYS_TRAP(sysTrapPenOpen);

// Closes the Pen Manager and frees whatever memory it allocated
Err 	PenClose(void)
				SYS_TRAP(sysTrapPenClose);
				

// Put pen to sleep
Err	PenSleep(void)
				SYS_TRAP(sysTrapPenSleep);

// Wake pen
Err	PenWake(void)
				SYS_TRAP(sysTrapPenWake);
				

// Get the raw pen coordinates from the hardware. 
Err 	PenGetRawPen(PointType *penP)
				SYS_TRAP(sysTrapPenGetRawPen);
				
// Reset calibration in preparation for setting it again
Err	PenResetCalibration (void)
				SYS_TRAP(sysTrapPenResetCalibration);

// Set calibration settings for the pen
Err	PenCalibrate (PointType *digTopLeftP, PointType *digBotRightP,
					PointType *scrTopLeftP, PointType *scrBotRightP)
				SYS_TRAP(sysTrapPenCalibrate);

// Scale a raw pen coordinate into screen coordinates
Err 	PenRawToScreen(PointType *penP)
				SYS_TRAP(sysTrapPenRawToScreen);
				
// Scale a screen pen coordinate back into a raw coordinate
Err 	PenScreenToRaw(PointType *penP)
				SYS_TRAP(sysTrapPenScreenToRaw);
				

#ifdef __cplusplus
}
#endif
#endif

	
/************************************************************
 * Assembly Function Prototypes
 *************************************************************/
#define	_PenGetRawPen		\
				ASM_SYS_TRAP(sysTrapPenGetRawPen)



#endif	//__PEN_MGR_H