Shinya Kitaoka 810553
#pragma once
Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
#ifndef SCREEN_PICKER_H
Toshihiro Shimizu 890ddd
#define SCREEN_PICKER_H
Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
#include "toonzqt/screenboard.h"
Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
#include <qwidget></qwidget>
Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
//----------------------------------------------------------------------
Toshihiro Shimizu 890ddd
Shinya Kitaoka d1f6c4
class ScreenPicker final : public QObject, public DVGui::ScreenBoard::Drawing {
Shinya Kitaoka 120a6e
  Q_OBJECT
Toshihiro Shimizu 890ddd
Shinya Kitaoka 120a6e
  QPoint m_start;
Shinya Kitaoka 120a6e
  QRect m_geometry;
Toshihiro Shimizu 890ddd
Shinya Kitaoka 120a6e
  bool m_mousePressed, m_mouseGrabbed;
Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
public:
Shinya Kitaoka 120a6e
  ScreenPicker(QWidget *parent = 0);
Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
protected:
Shinya Kitaoka 473e70
  void event(QWidget *widget, QEvent *e) override;
Toshihiro Shimizu 890ddd
Shinya Kitaoka 120a6e
  void mousePressEvent(QWidget *widget, QMouseEvent *me);
Shinya Kitaoka 120a6e
  void mouseMoveEvent(QWidget *widget, QMouseEvent *me);
Shinya Kitaoka 120a6e
  void mouseReleaseEvent(QWidget *widget, QMouseEvent *me);
Toshihiro Shimizu 890ddd
Shinya Kitaoka 473e70
  void paintEvent(QWidget *widget, QPaintEvent *pe) override;
Toshihiro Shimizu 890ddd
Shinya Kitaoka 473e70
  bool acceptScreenEvents(const QRect &screenRect) const override;
Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
public slots:
Toshihiro Shimizu 890ddd
Shinya Kitaoka 120a6e
  void startGrab();
Shinya Kitaoka 120a6e
  void pick();
Toshihiro Shimizu 890ddd
};
Toshihiro Shimizu 890ddd
Shinya Kitaoka 120a6e
#endif  // SCREEN_PICKER_H