You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
56 lines
1.5 KiB
56 lines
1.5 KiB
#ifndef APPPROFILE_HPP
|
|
#define APPPROFILE_HPP
|
|
|
|
#include "event.hpp"
|
|
|
|
struct ApiAppProfile ;
|
|
|
|
// ---------------------------------------------------------------------
|
|
|
|
// An AppProfile is the configuration that is to be used for each application (identified by EXE path).
|
|
// This lets us have different events and actions, sensitivity tuning, etc. for different programs.
|
|
|
|
class AppProfile
|
|
{
|
|
|
|
// constructors/destructor:
|
|
public:
|
|
AppProfile(
|
|
const ApiAppProfile* pAppProfile ,
|
|
const ApiEvent* pEvents , int nEvents ,
|
|
const ApiAction* pActions , int nActions
|
|
) ;
|
|
DISABLE_COPY_ASSIGNMENT( AppProfile ) ;
|
|
|
|
// access methods:
|
|
public:
|
|
const std::string& app() const ;
|
|
int sensitivity( Event::eEventType eventType ) const ;
|
|
int sensitivityX() const ;
|
|
int sensitivityY() const ;
|
|
bool fallbackToDefaultAppProfile() const ;
|
|
const EventPtrVector& events() const ;
|
|
public:
|
|
const Event* findEvent( Event::eEventType eventType , const KeyboardState& keyboardState ) const ;
|
|
|
|
// miscellaneous methods:
|
|
public:
|
|
void dumpAppProfile( std::ostream& os , const char* pPrefix="" ) const ;
|
|
|
|
// data members:
|
|
private:
|
|
std::string mApp ;
|
|
int mSensitivityX ;
|
|
int mSensitivityY ;
|
|
bool mFallbackToDefaultAppProfile ;
|
|
EventPtrVector mEvents ;
|
|
} ;
|
|
|
|
typedef PtrVector<AppProfile> AppProfilePtrVector ;
|
|
|
|
// inserter
|
|
std::ostream& operator<<( std::ostream& , const AppProfile& ) ;
|
|
|
|
// ---------------------------------------------------------------------
|
|
|
|
#endif // APPPROFILE_HPP
|
|
|