slop.hpp 1.4KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556
  1. /* glslop.hpp: exposes an opengl selection interface
  2. *
  3. * Copyright (C) 2014: Dalton Nell, Slop Contributors (https://github.com/naelstrof/slop/graphs/contributors).
  4. *
  5. * This file is part of Slop.
  6. *
  7. * Slop is free software: you can redistribute it and/or modify
  8. * it under the terms of the GNU General Public License as published by
  9. * the Free Software Foundation, either version 3 of the License, or
  10. * (at your option) any later version.
  11. *
  12. * Slop is distributed in the hope that it will be useful,
  13. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  14. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  15. * GNU General Public License for more details.
  16. *
  17. * You should have received a copy of the GNU General Public License
  18. * along with Slop. If not, see <http://www.gnu.org/licenses/>.
  19. */
  20. #ifndef N_SLOP_H_
  21. #define N_SLOP_H_
  22. #include <string>
  23. class SlopOptions {
  24. public:
  25. SlopOptions();
  26. float borderSize;
  27. float padding;
  28. float tolerance;
  29. bool highlight;
  30. bool nokeyboard;
  31. int nodecorations;
  32. std::string shader;
  33. float r;
  34. float g;
  35. float b;
  36. float a;
  37. std::string xdisplay;
  38. };
  39. class SlopSelection {
  40. public:
  41. SlopSelection( float x, float y, float w, float h, int id );
  42. float x;
  43. float y;
  44. float w;
  45. float h;
  46. // This is an X11 Window ID
  47. int id;
  48. };
  49. SlopSelection SlopSelect( SlopOptions* options = NULL, bool* cancelled = NULL, bool quiet = false );
  50. #endif // N_SLOP_H_