diff options
author | andreas 'randy' weinberger <vdr@smue.org> | 2010-02-21 19:58:27 +0100 |
---|---|---|
committer | andreas 'randy' weinberger <vdr@smue.org> | 2010-02-21 19:58:27 +0100 |
commit | 10ab31fa86dbf9875b5f6baa6ac59fefaaf86be3 (patch) | |
tree | 60ad7c856565f03e145b2996d1bb5f9cd64c0532 /glcddrivers/config.h | |
download | graphlcd-base-10ab31fa86dbf9875b5f6baa6ac59fefaaf86be3.tar.gz graphlcd-base-10ab31fa86dbf9875b5f6baa6ac59fefaaf86be3.tar.bz2 |
initial git upload, based on graphlcd-base-0.1.5
Diffstat (limited to 'glcddrivers/config.h')
-rw-r--r-- | glcddrivers/config.h | 85 |
1 files changed, 85 insertions, 0 deletions
diff --git a/glcddrivers/config.h b/glcddrivers/config.h new file mode 100644 index 0000000..8caa77e --- /dev/null +++ b/glcddrivers/config.h @@ -0,0 +1,85 @@ +/* + * GraphLCD driver library + * + * config.h - config file classes + * + * This file is released under the GNU General Public License. Refer + * to the COPYING file distributed with this package. + * + * (c) 2004 Andreas Regel <andreas.regel AT powarman.de> + */ + +#ifndef _GLCDDRIVERS_CONFIG_H_ +#define _GLCDDRIVERS_CONFIG_H_ + +#include <string> +#include <vector> + + +namespace GLCD +{ + +const int kWaitUsleep = 0; +const int kWaitNanosleep = 1; +const int kWaitNanosleepRR = 2; +const int kWaitGettimeofday = 3; + + +struct tOption +{ + std::string name; + std::string value; +}; + +class cDriverConfig +{ +public: + std::string name; + std::string driver; + int id; + std::string device; + int port; + int width; + int height; + bool upsideDown; + bool invert; + int brightness; + int contrast; + bool backlight; + int adjustTiming; + int refreshDisplay; + std::vector <tOption> options; + +public: + cDriverConfig(); + cDriverConfig(const cDriverConfig & rhs); + ~cDriverConfig(); + cDriverConfig & operator=(const cDriverConfig & rhs); + bool Parse(const std::string & line); + int GetInt(const std::string & value); + bool GetBool(const std::string & value); +}; + +class cConfig +{ +public: + int waitMethod; + int waitPriority; + std::vector <cDriverConfig> driverConfigs; + +public: + cConfig(); + ~cConfig(); + bool Load(const std::string & filename); + bool Save(const std::string & filename); + bool Parse(const std::string & line); + int GetInt(const std::string & value); + bool GetBool(const std::string & value); + int GetConfigIndex(const std::string & name); +}; + +extern cConfig Config; + +} // end of namespace + +#endif |