/
mythmainwindow.h
174 lines (127 loc) · 5.39 KB
/
mythmainwindow.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
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
#ifndef MYTHMAINWINDOW_H_
#define MYTHMAINWINDOW_H_
#include <QWidget>
#include "mythuiactions.h"
#include "mythuitype.h"
#include "mythscreenstack.h"
class QEvent;
class MythMediaDevice;
#define REG_KEY(a, b, c, d) GetMythMainWindow()->RegisterKey(a, b, c, d)
#define GET_KEY(a, b) GetMythMainWindow()->GetKey(a, b)
#define REG_JUMP(a, b, c, d) GetMythMainWindow()->RegisterJump(a, b, c, d)
#define REG_JUMPLOC(a, b, c, d, e) GetMythMainWindow()->RegisterJump(a, b, c, d, true, e)
#define REG_JUMPEX(a, b, c, d, e) GetMythMainWindow()->RegisterJump(a, b, c, d, e)
#define REG_MEDIAPLAYER(a,b,c) GetMythMainWindow()->RegisterMediaPlugin(a, b, c)
typedef int (*MediaPlayCallback)(const QString &, const QString &, const QString &, const QString &, const QString &, int, int, const QString &, int, const QString &);
class MythMainWindowPrivate;
class MythPainterWindowGL;
class MythPainterWindowQt;
class MythPainterWindowVDPAU;
class MythPainterWindowD3D9;
class MythRender;
class MUI_PUBLIC MythMainWindow : public QWidget
{
Q_OBJECT
friend class MythPainterWindowGL;
friend class MythPainterWindowQt;
friend class MythPainterWindowVDPAU;
friend class MythPainterWindowD3D9;
public:
void Init(void);
void ReinitDone(void);
void Show(void);
void AddScreenStack(MythScreenStack *stack, bool main = false);
void PopScreenStack();
int GetStackCount(void);
MythScreenStack *GetMainStack();
MythScreenStack *GetStack(const QString &stackname);
MythScreenStack *GetStackAt(int pos);
bool TranslateKeyPress(const QString &context, QKeyEvent *e,
QStringList &actions, bool allowJumps = true)
MUNUSED_RESULT;
void ReloadKeys(void);
void ClearKey(const QString &context, const QString &action);
void ClearKeyContext(const QString &context);
void BindKey(const QString &context, const QString &action,
const QString &key);
void RegisterKey(const QString &context, const QString &action,
const QString &description, const QString &key);
QString GetKey(const QString &context, const QString &action) const;
void ClearJump(const QString &destination);
void BindJump(const QString &destination, const QString &key);
void RegisterJump(const QString &destination, const QString &description,
const QString &key, void (*callback)(void),
bool exittomain = true, QString localAction = "");
void ClearAllJumps();
void RegisterMediaPlugin(const QString &name, const QString &desc,
MediaPlayCallback fn);
void RegisterSystemEventHandler(QObject *eventHandler);
QObject *GetSystemEventHandler(void);
bool HandleMedia(const QString& handler, const QString& mrl,
const QString& plot="", const QString& title="",
const QString& subtitle="", const QString& director="",
int season=0, int episode=0, const QString& inetref="",
int lenMins=120, const QString& year="1895");
void JumpTo(const QString &destination, bool pop = true);
bool DestinationExists(const QString &destination) const;
bool IsExitingToMain(void) const;
static MythMainWindow *getMainWindow(const bool useDB = true);
static void destroyMainWindow();
MythPainter *GetCurrentPainter();
QWidget *GetPaintWindow();
MythRender *GetRenderDevice();
void ShowPainterWindow();
void HidePainterWindow();
void ResizePainterWindow(const QSize &size);
void GrabWindow(QImage &image);
bool SaveScreenShot(const QImage &image, QString filename = "");
bool ScreenShot(int w = 0, int h = 0, QString filename = "");
void RemoteScreenShot(QString filename, int x, int y);
void AllowInput(bool allow);
QRect GetUIScreenRect();
void SetUIScreenRect(QRect &rect);
int NormalizeFontSize(int pointSize);
MythRect NormRect(const MythRect &rect);
QPoint NormPoint(const QPoint &point);
QSize NormSize(const QSize &size);
int NormX(const int x);
int NormY(const int y);
void SetScalingFactors(float wmult, float hmult);
void StartLIRC(void);
/* compatibility functions, to go away once everything's mythui */
void attach(QWidget *child);
void detach(QWidget *child);
QWidget *currentWidget(void);
uint PushDrawDisabled(void);
uint PopDrawDisabled(void);
void SetEffectsEnabled(bool enable);
void draw(void);
public slots:
void mouseTimeout();
void HideMouseTimeout();
protected slots:
void animate();
void doRemoteScreenShot(QString filename, int x, int y);
signals:
void signalRemoteScreenShot(QString filename, int x, int y);
protected:
MythMainWindow(const bool useDB = true);
virtual ~MythMainWindow();
void InitKeys(void);
bool eventFilter(QObject *o, QEvent *e);
void customEvent(QEvent *ce);
void closeEvent(QCloseEvent *e);
void drawScreen();
bool event(QEvent* e);
void ExitToMainMenu();
QObject *getTarget(QKeyEvent &key);
void SetDrawEnabled(bool enable);
void LockInputDevices(bool locked);
void ShowMouseCursor(bool show);
MythMainWindowPrivate *d;
};
MUI_PUBLIC MythMainWindow *GetMythMainWindow();
MUI_PUBLIC bool HasMythMainWindow();
MUI_PUBLIC void DestroyMythMainWindow();
MUI_PUBLIC MythPainter *GetMythPainter();
#endif