mirror of
https://git.dev.opencascade.org/repos/occt.git
synced 2025-04-04 18:06:22 +03:00
0032220: Configuration, Aspect_VKeySet - eliminate name collision with X11 macros
Aspect_VKeySet::KeyState::Status field has been renamed to KStatus.
This commit is contained in:
parent
58210e5983
commit
442850c032
@ -49,9 +49,9 @@ void Aspect_VKeySet::KeyDown (Aspect_VKey theKey,
|
||||
double thePressure)
|
||||
{
|
||||
Standard_Mutex::Sentry aLock (myLock);
|
||||
if (myKeys[theKey].Status != KeyStatus_Pressed)
|
||||
if (myKeys[theKey].KStatus != KeyStatus_Pressed)
|
||||
{
|
||||
myKeys[theKey].Status = KeyStatus_Pressed;
|
||||
myKeys[theKey].KStatus = KeyStatus_Pressed;
|
||||
myKeys[theKey].TimeDown = theTime;
|
||||
}
|
||||
myKeys[theKey].Pressure = thePressure;
|
||||
@ -68,9 +68,9 @@ void Aspect_VKeySet::KeyUp (Aspect_VKey theKey,
|
||||
double theTime)
|
||||
{
|
||||
Standard_Mutex::Sentry aLock (myLock);
|
||||
if (myKeys[theKey].Status == KeyStatus_Pressed)
|
||||
if (myKeys[theKey].KStatus == KeyStatus_Pressed)
|
||||
{
|
||||
myKeys[theKey].Status = KeyStatus_Released;
|
||||
myKeys[theKey].KStatus = KeyStatus_Released;
|
||||
myKeys[theKey].TimeUp = theTime;
|
||||
}
|
||||
|
||||
@ -97,18 +97,18 @@ void Aspect_VKeySet::KeyFromAxis (Aspect_VKey theNegative,
|
||||
const Aspect_VKey aKeyUp = thePressure < 0 ? thePositive : theNegative;
|
||||
|
||||
KeyDown (aKeyDown, theTime, Abs (thePressure));
|
||||
if (myKeys[aKeyUp].Status == KeyStatus_Pressed)
|
||||
if (myKeys[aKeyUp].KStatus == KeyStatus_Pressed)
|
||||
{
|
||||
KeyUp (aKeyUp, theTime);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
if (myKeys[theNegative].Status == KeyStatus_Pressed)
|
||||
if (myKeys[theNegative].KStatus == KeyStatus_Pressed)
|
||||
{
|
||||
KeyUp (theNegative, theTime);
|
||||
}
|
||||
if (myKeys[thePositive].Status == KeyStatus_Pressed)
|
||||
if (myKeys[thePositive].KStatus == KeyStatus_Pressed)
|
||||
{
|
||||
KeyUp (thePositive, theTime);
|
||||
}
|
||||
@ -125,7 +125,7 @@ bool Aspect_VKeySet::HoldDuration (Aspect_VKey theKey,
|
||||
double& thePressure)
|
||||
{
|
||||
Standard_Mutex::Sentry aLock (myLock);
|
||||
switch (myKeys[theKey].Status)
|
||||
switch (myKeys[theKey].KStatus)
|
||||
{
|
||||
case KeyStatus_Free:
|
||||
{
|
||||
@ -134,7 +134,7 @@ bool Aspect_VKeySet::HoldDuration (Aspect_VKey theKey,
|
||||
}
|
||||
case KeyStatus_Released:
|
||||
{
|
||||
myKeys[theKey].Status = KeyStatus_Free;
|
||||
myKeys[theKey].KStatus = KeyStatus_Free;
|
||||
theDuration = myKeys[theKey].TimeUp - myKeys[theKey].TimeDown;
|
||||
thePressure = myKeys[theKey].Pressure;
|
||||
return true;
|
||||
|
@ -55,14 +55,14 @@ public:
|
||||
bool IsFreeKey (Aspect_VKey theKey) const
|
||||
{
|
||||
Standard_Mutex::Sentry aLock (myLock);
|
||||
return myKeys[theKey].Status == KeyStatus_Free;
|
||||
return myKeys[theKey].KStatus == KeyStatus_Free;
|
||||
}
|
||||
|
||||
//! Return TRUE if key is in Pressed state.
|
||||
bool IsKeyDown (Aspect_VKey theKey) const
|
||||
{
|
||||
Standard_Mutex::Sentry aLock (myLock);
|
||||
return myKeys[theKey].Status == KeyStatus_Pressed;
|
||||
return myKeys[theKey].KStatus == KeyStatus_Pressed;
|
||||
}
|
||||
|
||||
//! Return mutex for thread-safe updates.
|
||||
@ -131,10 +131,10 @@ private:
|
||||
//! Structure defining key state.
|
||||
struct KeyState
|
||||
{
|
||||
KeyState() : TimeDown (0.0), TimeUp (0.0), Pressure (1.0), Status (KeyStatus_Free) {}
|
||||
KeyState() : TimeDown (0.0), TimeUp (0.0), Pressure (1.0), KStatus (KeyStatus_Free) {}
|
||||
void Reset()
|
||||
{
|
||||
Status = KeyStatus_Free;
|
||||
KStatus = KeyStatus_Free;
|
||||
TimeDown = 0.0;
|
||||
TimeUp = 0.0;
|
||||
Pressure = 1.0;
|
||||
@ -143,7 +143,7 @@ private:
|
||||
double TimeDown; //!< time of key press event
|
||||
double TimeUp; //!< time of key release event
|
||||
double Pressure; //!< key pressure
|
||||
KeyStatus Status; //!< key status
|
||||
KeyStatus KStatus; //!< key status
|
||||
};
|
||||
|
||||
private:
|
||||
|
Loading…
x
Reference in New Issue
Block a user