options.hpp 924B

123456789101112131415161718192021222324252627282930313233343536
  1. #ifndef IS_OPTIONS_H_
  2. #include <string>
  3. #include <cstdio>
  4. namespace slop {
  5. class Options {
  6. public:
  7. Options();
  8. int parseOptions( int argc, char** argv );
  9. void printHelp();
  10. int m_borderSize;
  11. int m_padding;
  12. int m_tolerance;
  13. float m_red;
  14. float m_green;
  15. float m_blue;
  16. std::string m_xdisplay;
  17. float m_gracetime;
  18. bool m_keyboard;
  19. bool m_window;
  20. private:
  21. int parseInt( std::string arg, int* returnInt );
  22. int parseFloat( std::string arg, float* returnFloat );
  23. int parseString( std::string arg, std::string* returnString );
  24. int parseColor( std::string arg, float* r, float* g, float* b );
  25. bool matches( std::string arg, std::string shorthand, std::string longhand );
  26. };
  27. }
  28. extern slop::Options* options;
  29. #endif // IS_OPTIONS_H_