screenutils.h 1.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758
  1. #ifndef DESKTOPBOX_H
  2. #define DESKTOPBOX_H
  3. #include "common.h"
  4. #include <QWidget>
  5. #define base_style "border: 2px solid rbg(0,0,0);"
  6. class ScreenIdentifier;
  7. class DesktopBox
  8. : public QWidget {
  9. Q_OBJECT
  10. int screen;
  11. ScreenIdentifier *ident;
  12. public:
  13. explicit DesktopBox(int screen, int w, int h);
  14. void mousePressEvent(QMouseEvent *event);
  15. void mouseDoubleClickEvent(QMouseEvent *event);
  16. void paintEvent(QPaintEvent *);
  17. void setIdentifier(QRect dimensions);
  18. public slots:
  19. void highlight(bool h);
  20. void highlight();
  21. void identify();
  22. signals:
  23. void clicked();
  24. void clicked(int);
  25. void doubleClicked();
  26. };
  27. #endif // DESKTOPBOX_H
  28. #ifndef SCREENIDENTIFIER_H
  29. #define SCREENIDENTIFIER_H
  30. #include <QWidget>
  31. class QLabel;
  32. class QTimer;
  33. class QRect;
  34. class ScreenIdentifier : public QWidget {
  35. Q_OBJECT
  36. QLabel *label;
  37. QTimer *timer;
  38. int timeout;
  39. public:
  40. explicit ScreenIdentifier(int number, QRect dimensions, int timeout = 1500, QWidget *parent = 0);
  41. public slots:
  42. void show();
  43. };
  44. #endif // SCREENIDENTIFIER_H