2 // Keeps track of the user's mouse location at a certain point in time.
4 // Can store a integer x, y coordinate and/or a normalized floating
5 // point x, y pair where (1.0, 1.0) is the lower right corener of the
8 // Copyright 2005 by Keith Vertanen
10 #ifndef __USER_LOCATION_H__
11 #define __USER_LOCATION_H__
13 #include "FileLogger.h"
22 extern CFileLogger
* g_pLogger
;
26 typedef vector
<CUserLocation
> VECTOR_USER_LOCATION
;
27 typedef vector
<CUserLocation
>::iterator VECTOR_USER_LOCATION_ITER
;
28 typedef vector
<CUserLocation
*> VECTOR_USER_LOCATION_PTR
;
29 typedef vector
<CUserLocation
*>::iterator VECTOR_USER_LOCATION_PTR_ITER
;
36 CUserLocation(int iX
, int iY
, float dNats
);
37 CUserLocation(float iX
, float iY
, float dNats
);
38 CUserLocation(int iX1
, int iY1
, float iX2
, float iY2
, float dNats
);
39 CUserLocation(int iX
, int iY
, int iTop
, int iLeft
, int iBottom
, int iRight
, bool bStoreIntegerRep
, float dNats
);
42 string
GetXML(const string
& strPrefix
= "");
43 static double ComputeNormalizedX(int iX
, int iLeft
, int iRight
);
44 static double ComputeNormalizedY(int iY
, int iTop
, int iBottom
);
46 // Used when we want to post-process a XML log file:
47 CUserLocation(const string
& strXML
);
48 string
GetTabMouseXY(bool bReturnNormalized
);
49 void GetMouseGridLocation(int iGridSize
, int* pRow
, int* pCol
);
55 float m_dNormalizedLocationX
;
56 float m_dNormalizedLocationY
;
57 bool m_bHasNormalized
; // Are we storing a normalized representation?
58 bool m_bHasInteger
; // Are we storing an integer representation?
61 void InitMemeberVars();