-
Notifications
You must be signed in to change notification settings - Fork 0
/
screenshot.h
81 lines (67 loc) · 1.79 KB
/
screenshot.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
#ifndef SCREENSHOT_H
#define SCREENSHOT_H
#include <QPixmap>
#include <QWidget>
#include <QPainter>
#include <QKeyEvent>
#include <QSystemTrayIcon>
#include <QHotkey>
#include <tesseract/baseapi.h>
#include <tesseract/strngs.h>
#include <leptonica/allheaders.h>
#include <iostream>
#include "options.h"
class QCheckBox;
class QGridLayout;
class QGroupBox;
class QHBoxLayout;
class QLabel;
class QPushButton;
class QSpinBox;
class QVBoxLayout;
class Screenshot : public QWidget
{
Q_OBJECT
public:
Screenshot();
int mousex = -1;
int mousey = -1;
int mousex1 = -1;
int mousey1 = -1;
int mousex2 = -1;
int mousey2 = -1;
bool mousepressed;
void takeNewScreenshot();
void setOptions(Options* o);
protected:
void resizeEvent(QResizeEvent *event);
private slots:
//void newScreenshot();
void saveScreenshot();
void shootScreen();
void quit();
void exit();
void on_show_hide();
//void on_show_hide(QSystemTrayIcon::ActivationReason reason);
private:
void createButtonsLayout();
QPushButton *createButton(const QString &text, QWidget *receiver,
const char *member);
std::string OCRImage();
void paintEvent(QPaintEvent*);
QPixmap originalPixmap;
//QLabel *screenshotLabel;
//QPushButton *newScreenshotButton;
//QPushButton *saveScreenshotButton;
//QPushButton *quitScreenshotButton;
QPainter* SelectionScreen;
QSystemTrayIcon* trayIcon;
Options* options = 0;
void mousePressEvent(QMouseEvent* event);
void mouseMoveEvent(QMouseEvent* event);
void mouseReleaseEvent(QMouseEvent* event);
void keyPressEvent(QKeyEvent* event);
QVBoxLayout *mainLayout;
//QHBoxLayout *buttonsLayout;
};
#endif