1 /* 2 * Copyright 2019, Haiku, Inc. 3 * Distributed under the terms of the MIT License. 4 * 5 * Author: 6 * Preetpal Kaur <preetpalok123@gmail.com> 7 */ 8 9 10 #ifndef TOUCHPAD_PREF_H 11 #define TOUCHPAD_PREF_H 12 13 14 #include <Debug.h> 15 #include <Input.h> 16 #include <Path.h> 17 18 #include "touchpad_settings.h" 19 20 21 #if DEBUG 22 # define LOG(text...) PRINT((text)) 23 #else 24 # define LOG(text...) 25 #endif 26 27 28 class TouchpadPref { 29 public: 30 TouchpadPref(BInputDevice* device); 31 virtual ~TouchpadPref(); 32 33 void Revert(); 34 void Defaults(); 35 WindowPosition()36 BPoint WindowPosition() 37 { return fWindowPosition; } SetWindowPosition(BPoint position)38 void SetWindowPosition(BPoint position) 39 { fWindowPosition = position; } 40 Settings()41 touchpad_settings& Settings() 42 { return fSettings; } 43 status_t UpdateSettings(); 44 45 private: 46 status_t GetSettingsPath(BPath& path); 47 status_t LoadSettings(); 48 status_t SaveSettings(); 49 50 BInputDevice* fTouchPad; 51 52 touchpad_settings fSettings; 53 touchpad_settings fStartSettings; 54 BPoint fWindowPosition; 55 }; 56 57 58 #endif // TOUCHPAD_PREF_H 59