options.hpp 1.0KB

123456789101112131415161718192021222324252627282930313233343536373839
  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. std::string m_version;
  11. int m_borderSize;
  12. int m_padding;
  13. int m_tolerance;
  14. int m_minimumsize;
  15. float m_red;
  16. float m_green;
  17. float m_blue;
  18. std::string m_xdisplay;
  19. float m_gracetime;
  20. bool m_keyboard;
  21. bool m_decorations;
  22. private:
  23. int parseInt( std::string arg, int* returnInt );
  24. int parseFloat( std::string arg, float* returnFloat );
  25. int parseString( std::string arg, std::string* returnString );
  26. int parseGeometry( std::string arg, int* x, int* y, int* w, int* h );
  27. int parseColor( std::string arg, float* r, float* g, float* b );
  28. bool matches( std::string arg, std::string shorthand, std::string longhand );
  29. };
  30. }
  31. extern slop::Options* options;
  32. #endif // IS_OPTIONS_H_