2 |
andreas |
1 |
/*
|
258 |
andreas |
2 |
* Copyright (C) 2020 to 2023 by Andreas Theofilu <andreas@theosys.at>
|
2 |
andreas |
3 |
*
|
|
|
4 |
* This program is free software; you can redistribute it and/or modify
|
|
|
5 |
* it under the terms of the GNU General Public License as published by
|
|
|
6 |
* the Free Software Foundation; either version 3 of the License, or
|
|
|
7 |
* (at your option) any later version.
|
|
|
8 |
*
|
|
|
9 |
* This program is distributed in the hope that it will be useful,
|
|
|
10 |
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
11 |
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
12 |
* GNU General Public License for more details.
|
|
|
13 |
*
|
|
|
14 |
* You should have received a copy of the GNU General Public License
|
|
|
15 |
* along with this program; if not, write to the Free Software Foundation,
|
|
|
16 |
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
|
|
|
17 |
*/
|
|
|
18 |
#ifndef __TQTMAIN_H__
|
|
|
19 |
#define __TQTMAIN_H__
|
|
|
20 |
|
|
|
21 |
#include <QMainWindow>
|
14 |
andreas |
22 |
#include <QMetaType>
|
264 |
andreas |
23 |
#if QT_VERSION >= QT_VERSION_CHECK(6, 0, 0)
|
252 |
andreas |
24 |
#include <QGeoPositionInfoSource>
|
254 |
andreas |
25 |
#endif
|
3 |
andreas |
26 |
#include "tpagemanager.h"
|
5 |
andreas |
27 |
#include "tobject.h"
|
61 |
andreas |
28 |
#include "tqemitqueue.h"
|
279 |
andreas |
29 |
#include "tpagelist.h"
|
323 |
andreas |
30 |
#include "tqgesturefilter.h"
|
2 |
andreas |
31 |
|
21 |
andreas |
32 |
extern bool prg_stopped;
|
34 |
andreas |
33 |
extern std::atomic<bool> killed;
|
21 |
andreas |
34 |
|
2 |
andreas |
35 |
QT_BEGIN_NAMESPACE
|
|
|
36 |
class QAction;
|
|
|
37 |
class QMenu;
|
|
|
38 |
class QSessionManager;
|
5 |
andreas |
39 |
class QLabel;
|
|
|
40 |
class QWidget;
|
14 |
andreas |
41 |
class QByteArray;
|
10 |
andreas |
42 |
class QMouseEvent;
|
15 |
andreas |
43 |
class QMoveEvent;
|
190 |
andreas |
44 |
class QGestureEvent;
|
15 |
andreas |
45 |
class QEvent;
|
141 |
andreas |
46 |
class QSound;
|
|
|
47 |
class QMediaPlayer;
|
254 |
andreas |
48 |
class QOrientationSensor;
|
264 |
andreas |
49 |
class QStackedWidget;
|
289 |
andreas |
50 |
class QListWidgetItem;
|
254 |
andreas |
51 |
#ifdef Q_OS_IOS
|
252 |
andreas |
52 |
class QGeoPositionInfo;
|
254 |
andreas |
53 |
#endif
|
264 |
andreas |
54 |
#if QT_VERSION >= QT_VERSION_CHECK(6, 0, 0)
|
181 |
andreas |
55 |
class QAudioOutput;
|
|
|
56 |
#endif
|
23 |
andreas |
57 |
class TQtSettings;
|
63 |
andreas |
58 |
class TQKeyboard;
|
|
|
59 |
class TQKeypad;
|
120 |
andreas |
60 |
class TQBusy;
|
179 |
andreas |
61 |
class TqDownload;
|
140 |
andreas |
62 |
class TQtPhone;
|
289 |
andreas |
63 |
class TBitmap;
|
296 |
andreas |
64 |
class TQScrollArea;
|
2 |
andreas |
65 |
QT_END_NAMESPACE
|
247 |
andreas |
66 |
#ifdef Q_OS_IOS
|
|
|
67 |
class TIOSBattery;
|
252 |
andreas |
68 |
class TIOSRotate;
|
247 |
andreas |
69 |
#endif
|
260 |
andreas |
70 |
class TQtWait;
|
2 |
andreas |
71 |
|
14 |
andreas |
72 |
Q_DECLARE_METATYPE(size_t)
|
|
|
73 |
|
3 |
andreas |
74 |
int qtmain(int argc, char **argv, TPageManager *pmanager);
|
2 |
andreas |
75 |
|
277 |
andreas |
76 |
class MainWindow : public QMainWindow, TQManageQueue, public TObject
|
2 |
andreas |
77 |
{
|
14 |
andreas |
78 |
Q_OBJECT
|
2 |
andreas |
79 |
|
5 |
andreas |
80 |
public:
|
88 |
andreas |
81 |
typedef enum J_ORIENTATION
|
|
|
82 |
{
|
|
|
83 |
O_UNDEFINED = -1,
|
|
|
84 |
O_LANDSCAPE = 0,
|
130 |
andreas |
85 |
O_PORTRAIT = 1,
|
|
|
86 |
O_REVERSE_LANDSCAPE = 8,
|
134 |
andreas |
87 |
O_REVERSE_PORTRAIT = 9,
|
|
|
88 |
O_FACE_UP = 15,
|
|
|
89 |
O_FACE_DOWN = 16
|
88 |
andreas |
90 |
}J_ORIENTATION;
|
|
|
91 |
|
5 |
andreas |
92 |
MainWindow();
|
34 |
andreas |
93 |
~MainWindow();
|
22 |
andreas |
94 |
void setConfigFile(const std::string& file) { mFileConfig = file; }
|
23 |
andreas |
95 |
void setSetChange(bool state) { settingsChanged = state; }
|
38 |
andreas |
96 |
void setScaleFactor(double scale) { mScaleFactor = scale; }
|
198 |
andreas |
97 |
void setSetupScaleFactor(double scale) { mSetupScaleFactor = scale; }
|
38 |
andreas |
98 |
double getScaleFactor() { return mScaleFactor; }
|
264 |
andreas |
99 |
void setOrientation(Qt::ScreenOrientation ori) { mOrientation = ori; }
|
296 |
andreas |
100 |
void disconnectArea(TQScrollArea *area);
|
|
|
101 |
void disconnectList(QListWidget *list);
|
297 |
andreas |
102 |
void reconnectArea(TQScrollArea *area);
|
|
|
103 |
void reconnectList(QListWidget *list);
|
270 |
andreas |
104 |
#if defined(QT_DEBUG) && (defined(Q_OS_IOS) || defined(Q_OS_ANDROID))
|
264 |
andreas |
105 |
static std::string orientationToString(Qt::ScreenOrientation ori);
|
263 |
andreas |
106 |
#endif
|
2 |
andreas |
107 |
|
14 |
andreas |
108 |
signals:
|
298 |
andreas |
109 |
void sigDisplayButton(ulong handle, ulong parent, TBitmap buffer, int width, int height, int left, int top, bool passthrough);
|
289 |
andreas |
110 |
void sigDisplayViewButton(ulong handle, ulong parent, bool vertical, TBitmap buffer, int width, int height, int left, int top, int space, TColor::COLOR_T fillColor);
|
285 |
andreas |
111 |
void sigAddViewButtonItems(ulong parent, std::vector<PGSUBVIEWITEM_T> items);
|
300 |
andreas |
112 |
void sigUpdateViewButton(ulong handle, ulong parent, TBitmap buffer, TColor::COLOR_T fillColor);
|
|
|
113 |
void sigUpdateViewButtonItem(PGSUBVIEWITEM_T& item, ulong parent);
|
|
|
114 |
void sigShowViewButtonItem(ulong handle, ulong parent, int position, int timer);
|
318 |
andreas |
115 |
void sigToggleViewButtonItem(ulong handle, ulong parent, int position, int timer);
|
|
|
116 |
void sigHideAllViewItems(ulong handle);
|
|
|
117 |
void sigHideViewItem(ulong handle, ulong parent);
|
|
|
118 |
void sigSetSubViewPadding(ulong handle, int padding);
|
98 |
andreas |
119 |
void sigSetVisible(ulong handle, bool state);
|
14 |
andreas |
120 |
void sigSetPage(ulong handle, int width, int height);
|
217 |
andreas |
121 |
void sigSetSubPage(ulong handle, ulong parent, int left, int top, int width, int height, ANIMATION_t animate);
|
263 |
andreas |
122 |
#ifndef _OPAQUE_SKIA_
|
289 |
andreas |
123 |
void sigSetBackground(ulong handle, TBitmap image, int width, int height, ulong color, int opacity=255);
|
263 |
andreas |
124 |
#else
|
289 |
andreas |
125 |
void sigSetBackground(ulong handle, TBitmap image, int width, int height, ulong color);
|
262 |
andreas |
126 |
#endif
|
14 |
andreas |
127 |
void sigDropPage(ulong handle);
|
|
|
128 |
void sigDropSubPage(ulong handle);
|
98 |
andreas |
129 |
void sigDropButton(ulong handle);
|
21 |
andreas |
130 |
void sigPlayVideo(ulong handle, ulong parent, int left, int top, int width, int height, const std::string& url, const std::string& user, const std::string& pw);
|
291 |
andreas |
131 |
void sigInputText(Button::TButton *button, QByteArray buffer, int width, int height, int frame, size_t pixline);
|
|
|
132 |
void sigListBox(Button::TButton *button, QByteArray buffer, int width, int height, int frame, size_t pixline);
|
63 |
andreas |
133 |
void sigKeyboard(const std::string& init, const std::string& prompt, bool priv);
|
|
|
134 |
void sigKeypad(const std::string& init, const std::string& prompt, bool priv);
|
|
|
135 |
void sigResetKeyboard();
|
64 |
andreas |
136 |
void sigShowSetup();
|
71 |
andreas |
137 |
void sigPlaySound(const std::string& file);
|
141 |
andreas |
138 |
void sigStopSound();
|
|
|
139 |
void sigMuteSound(bool state);
|
335 |
andreas |
140 |
void sigSetVolume(int volume);
|
111 |
andreas |
141 |
void sigSendVirtualKeys(const std::string& str);
|
140 |
andreas |
142 |
void sigShowPhoneDialog(bool state);
|
|
|
143 |
void sigSetPhoneNumber(const std::string& number);
|
|
|
144 |
void sigSetPhoneStatus(const std::string& msg);
|
141 |
andreas |
145 |
void sigSetPhoneState(int state, int id);
|
142 |
andreas |
146 |
void sigRepaintWindows();
|
151 |
andreas |
147 |
void sigToFront(ulong handle);
|
206 |
andreas |
148 |
void sigDownloadSurface(const std::string& file, size_t size);
|
179 |
andreas |
149 |
void sigOnProgressChanged(int percent);
|
206 |
andreas |
150 |
void sigDisplayMessage(const std::string& msg, const std::string& title);
|
209 |
andreas |
151 |
void sigFileDialog(ulong handle, const std::string& path, const std::string& extension, const std::string& suffix);
|
197 |
andreas |
152 |
void sigSetSizeMainWindow(int width, int height);
|
260 |
andreas |
153 |
void sigStartWait(const std::string& text);
|
|
|
154 |
void sigStopWait();
|
271 |
andreas |
155 |
void sigPageFinished(uint handle);
|
279 |
andreas |
156 |
void sigListViewArea(ulong handle, ulong parent, Button::TButton& button, SUBVIEWLIST_T& list);
|
266 |
andreas |
157 |
#if defined(Q_OS_ANDROID) || defined(Q_OS_IOS)
|
259 |
andreas |
158 |
void sigActivateSettings(const std::string& oldNetlinx, int oldPort, int oldChannelID, const std::string& oldSurface, bool oldToolbarSuppress, bool oldToolbarForce);
|
|
|
159 |
#endif
|
5 |
andreas |
160 |
protected:
|
57 |
andreas |
161 |
bool event(QEvent *event) override;
|
5 |
andreas |
162 |
void closeEvent(QCloseEvent *event) override;
|
10 |
andreas |
163 |
void mousePressEvent(QMouseEvent* event) override;
|
|
|
164 |
void mouseReleaseEvent(QMouseEvent* event) override;
|
311 |
andreas |
165 |
void mouseMoveEvent(QMouseEvent* event) override;
|
319 |
andreas |
166 |
void keyPressEvent(QKeyEvent *event) override;
|
|
|
167 |
void keyReleaseEvent(QKeyEvent *event) override;
|
2 |
andreas |
168 |
|
5 |
andreas |
169 |
private slots:
|
|
|
170 |
void settings();
|
|
|
171 |
void about();
|
2 |
andreas |
172 |
#ifndef QT_NO_SESSIONMANAGER
|
5 |
andreas |
173 |
void commitData(QSessionManager &);
|
2 |
andreas |
174 |
#endif
|
298 |
andreas |
175 |
void displayButton(ulong handle, ulong parent, TBitmap buffer, int width, int height, int left, int top, bool passthrough);
|
289 |
andreas |
176 |
void displayViewButton(ulong handle, ulong parent, bool vertical, TBitmap buffer, int width, int height, int left, int top, int space, TColor::COLOR_T fillColor);
|
285 |
andreas |
177 |
void addViewButtonItems(ulong parent, std::vector<PGSUBVIEWITEM_T> items);
|
300 |
andreas |
178 |
void updateViewButton(ulong handle, ulong parent, TBitmap buffer, TColor::COLOR_T fillColor);
|
|
|
179 |
void updateViewButtonItem(PGSUBVIEWITEM_T& item, ulong parent);
|
|
|
180 |
void showViewButtonItem(ulong handle, ulong parent, int position, int timer);
|
318 |
andreas |
181 |
void toggleViewButtonItem(ulong handle, ulong parent, int position, int timer);
|
|
|
182 |
void hideAllViewItems(ulong handle);
|
|
|
183 |
void hideViewItem(ulong handle, ulong parent);
|
|
|
184 |
void setSubViewPadding(ulong handle, int padding);
|
98 |
andreas |
185 |
void SetVisible(ulong handle, bool state);
|
5 |
andreas |
186 |
void setPage(ulong handle, int width, int height);
|
217 |
andreas |
187 |
void setSubPage(ulong hanlde, ulong parent, int left, int top, int width, int height, ANIMATION_t animate);
|
262 |
andreas |
188 |
#ifdef _OPAQUE_SKIA_
|
289 |
andreas |
189 |
void setBackground(ulong handle, TBitmap image, int width, int height, ulong color);
|
262 |
andreas |
190 |
#else
|
289 |
andreas |
191 |
void setBackground(ulong handle, TBitnap image, int width, int height, ulong color, int opacity=255);
|
271 |
andreas |
192 |
#endif // _OPAQUE_SKIA_
|
11 |
andreas |
193 |
void dropPage(ulong handle);
|
|
|
194 |
void dropSubPage(ulong handle);
|
98 |
andreas |
195 |
void dropButton(ulong handle);
|
21 |
andreas |
196 |
void playVideo(ulong handle, ulong parent, int left, int top, int width, int height, const std::string& url, const std::string& user, const std::string& pw);
|
291 |
andreas |
197 |
void inputText(Button::TButton *button, QByteArray buffer, int width, int height, int frame, size_t pixline);
|
|
|
198 |
void listBox(Button::TButton *button, QByteArray buffer, int width, int height, int frame, size_t pixline);
|
63 |
andreas |
199 |
void showKeyboard(const std::string& init, const std::string& prompt, bool priv);
|
|
|
200 |
void showKeypad(const std::string& init, const std::string& prompt, bool priv);
|
111 |
andreas |
201 |
void sendVirtualKeys(const std::string& str);
|
63 |
andreas |
202 |
void resetKeyboard();
|
64 |
andreas |
203 |
void showSetup();
|
71 |
andreas |
204 |
void playSound(const std::string& file);
|
141 |
andreas |
205 |
void stopSound();
|
|
|
206 |
void muteSound(bool state);
|
335 |
andreas |
207 |
void setVolume(int volume);
|
213 |
andreas |
208 |
void onAppStateChanged(Qt::ApplicationState state);
|
130 |
andreas |
209 |
void onScreenOrientationChanged(Qt::ScreenOrientation ori);
|
252 |
andreas |
210 |
void onCurrentOrientationChanged(int currentOrientation);
|
266 |
andreas |
211 |
#if defined(Q_OS_ANDROID) || defined(Q_OS_IOS)
|
259 |
andreas |
212 |
void activateSettings(const std::string& oldNetlinx, int oldPort, int oldChannelID, const std::string& oldSurface, bool oldToolbarSuppress, bool oldToolbarForce);
|
254 |
andreas |
213 |
#ifdef Q_OS_IOS
|
252 |
andreas |
214 |
void onPositionUpdated(const QGeoPositionInfo &update);
|
|
|
215 |
void onErrorOccurred(QGeoPositionInfoSource::Error positioningError);
|
266 |
andreas |
216 |
#endif // Q_OS_IOS
|
|
|
217 |
#endif // defined(Q_OS_ANDROID) || defined(Q_OS_IOS)
|
213 |
andreas |
218 |
void onTListCallbackCurrentItemChanged(QListWidgetItem *current, QListWidgetItem *previous);
|
197 |
andreas |
219 |
void setSizeMainWindow(int width, int height);
|
140 |
andreas |
220 |
// Slots for the phone dialog
|
|
|
221 |
void showPhoneDialog(bool state);
|
|
|
222 |
void setPhoneNumber(const std::string& number);
|
|
|
223 |
void setPhoneStatus(const std::string& msg);
|
141 |
andreas |
224 |
void setPhoneState(int state, int id);
|
130 |
andreas |
225 |
// Slots for the toolbar buttons.
|
32 |
andreas |
226 |
void arrowLeft();
|
|
|
227 |
void arrowRight();
|
|
|
228 |
void arrowUp();
|
|
|
229 |
void arrowDown();
|
|
|
230 |
void selectOk();
|
33 |
andreas |
231 |
void volumeUpPressed();
|
|
|
232 |
void volumeUpReleased();
|
|
|
233 |
void volumeDownPressed();
|
|
|
234 |
void volumeDownReleased();
|
38 |
andreas |
235 |
// void volumeMute();
|
130 |
andreas |
236 |
// Slots for widget actions and button element actions
|
42 |
andreas |
237 |
void animationFinished();
|
295 |
andreas |
238 |
void animationInFinished();
|
142 |
andreas |
239 |
void repaintWindows();
|
151 |
andreas |
240 |
void toFront(ulong handle);
|
206 |
andreas |
241 |
void downloadSurface(const std::string& file, size_t size);
|
|
|
242 |
void displayMessage(const std::string& msg, const std::string& title);
|
209 |
andreas |
243 |
void fileDialog(ulong handle, const std::string& path, const std::string& extension, const std::string& suffix);
|
179 |
andreas |
244 |
// Progress bar (busy indicator)
|
|
|
245 |
void onProgressChanged(int percent);
|
260 |
andreas |
246 |
void startWait(const std::string& text);
|
|
|
247 |
void stopWait();
|
273 |
andreas |
248 |
void pageFinished(ulong handle);
|
44 |
andreas |
249 |
|
14 |
andreas |
250 |
private:
|
57 |
andreas |
251 |
bool gestureEvent(QGestureEvent *event);
|
14 |
andreas |
252 |
void createActions();
|
|
|
253 |
void writeSettings();
|
31 |
andreas |
254 |
void playShowList();
|
38 |
andreas |
255 |
int scale(int value);
|
198 |
andreas |
256 |
int scaleSetup(int value);
|
259 |
andreas |
257 |
bool isScaled();
|
198 |
andreas |
258 |
bool isSetupScaled();
|
298 |
andreas |
259 |
bool startAnimation(TObject::OBJECT_t *obj, ANIMATION_t& ani, bool in = true);
|
179 |
andreas |
260 |
void downloadBar(const std::string& msg, QWidget *parent);
|
120 |
andreas |
261 |
void runEvents();
|
289 |
andreas |
262 |
void onSubViewItemClicked(ulong handle, bool pressed);
|
303 |
andreas |
263 |
void onInputChanged(ulong handle, std::string& text);
|
309 |
andreas |
264 |
void onFocusChanged(ulong handle, bool in);
|
|
|
265 |
void onCursorChanged(ulong handle, int oldPos, int newPos);
|
323 |
andreas |
266 |
void onGestureEvent(QObject *obj, QGestureEvent *event);
|
285 |
andreas |
267 |
QPixmap scaleImage(QPixmap& pix);
|
|
|
268 |
QPixmap scaleImage(unsigned char *buffer, int width, int height, int pixline);
|
14 |
andreas |
269 |
|
298 |
andreas |
270 |
void _displayButton(ulong handle, ulong parent, TBitmap buffer, int width, int height, int left, int top, bool passthrough);
|
289 |
andreas |
271 |
void _displayViewButton(ulong handle, ulong parent, bool vertical, TBitmap buffer, int width, int height, int left, int top, int space, TColor::COLOR_T fillColor);
|
285 |
andreas |
272 |
void _addViewButtonItems(ulong parent, std::vector<PGSUBVIEWITEM_T> items);
|
300 |
andreas |
273 |
void _updateViewButton(ulong handle, ulong parent, TBitmap buffer, TColor::COLOR_T fillColor);
|
|
|
274 |
void _updateViewButtonItem(PGSUBVIEWITEM_T& item, ulong parent);
|
|
|
275 |
void _showViewButtonItem(ulong handle, ulong parent, int position, int timer);
|
318 |
andreas |
276 |
void _toggleViewButtonItem(ulong handle, ulong parent, int position, int timer);
|
|
|
277 |
void _hideAllViewItems(ulong handle);
|
|
|
278 |
void _hideViewItem(ulong handle, ulong parent);
|
|
|
279 |
void _setSubViewPadding(ulong handle, int padding);
|
98 |
andreas |
280 |
void _setVisible(ulong handle, bool state);
|
14 |
andreas |
281 |
void _setPage(ulong handle, int width, int height);
|
217 |
andreas |
282 |
void _setSubPage(ulong handle, ulong parent, int left, int top, int width, int height, ANIMATION_t animate);
|
262 |
andreas |
283 |
#ifdef _OPAQUE_SKIA_
|
289 |
andreas |
284 |
void _setBackground(ulong handle, TBitmap image, int width, int height, ulong color);
|
262 |
andreas |
285 |
#else
|
289 |
andreas |
286 |
void _setBackground(ulong handle, TBitmap image, int width, int height, ulong color, int opacity=255);
|
271 |
andreas |
287 |
#endif // _OPAQUE_SKIA_
|
14 |
andreas |
288 |
void _dropPage(ulong handle);
|
|
|
289 |
void _dropSubPage(ulong handle);
|
98 |
andreas |
290 |
void _dropButton(ulong handle);
|
21 |
andreas |
291 |
void _playVideo(ulong handle, ulong parent, int left, int top, int width, int height, const std::string& url, const std::string& user, const std::string& pw);
|
291 |
andreas |
292 |
void _inputText(Button::TButton *button, Button::BITMAP_t& bm, int frame);
|
|
|
293 |
void _listBox(Button::TButton *button, Button::BITMAP_t& bm, int frame);
|
63 |
andreas |
294 |
void _showKeyboard(const std::string& init, const std::string& prompt, bool priv=false);
|
|
|
295 |
void _showKeypad(const std::string& init, const std::string& prompt, bool priv=false);
|
|
|
296 |
void _resetKeyboard();
|
64 |
andreas |
297 |
void _showSetup();
|
44 |
andreas |
298 |
void _resetSurface();
|
64 |
andreas |
299 |
void _shutdown();
|
71 |
andreas |
300 |
void _playSound(const std::string& file);
|
141 |
andreas |
301 |
void _stopSound();
|
|
|
302 |
void _muteSound(bool state);
|
335 |
andreas |
303 |
void _setVolume(int volume);
|
88 |
andreas |
304 |
void _setOrientation(J_ORIENTATION ori);
|
111 |
andreas |
305 |
void _sendVirtualKeys(const std::string& str);
|
140 |
andreas |
306 |
void _showPhoneDialog(bool state);
|
|
|
307 |
void _setPhoneNumber(const std::string& number);
|
|
|
308 |
void _setPhoneStatus(const std::string& msg);
|
141 |
andreas |
309 |
void _setPhoneState(int state, int id);
|
179 |
andreas |
310 |
void _onProgressChanged(int percent);
|
206 |
andreas |
311 |
void _displayMessage(const std::string& msg, const std::string& title);
|
209 |
andreas |
312 |
void _fileDialog(ulong handle, const std::string& path, const std::string& extension, const std::string& suffix);
|
197 |
andreas |
313 |
void _setSizeMainWindow(int width, int height);
|
235 |
andreas |
314 |
#if defined(Q_OS_ANDROID) || defined(Q_OS_IOS)
|
93 |
andreas |
315 |
void _signalState(Qt::ApplicationState state);
|
130 |
andreas |
316 |
void _orientationChanged(int orientation);
|
259 |
andreas |
317 |
void _activateSettings(const std::string& oldNetlinx, int oldPort, int oldChannelID, const std::string& oldSurface, bool oldToolbarSuppress, bool oldToolbarForce);
|
264 |
andreas |
318 |
#if QT_VERSION < QT_VERSION_CHECK(6, 0, 0)
|
217 |
andreas |
319 |
void _freezeWorkaround();
|
266 |
andreas |
320 |
#endif // QT_VERSION < QT_VERSION_CHECK(6, 0, 0)
|
271 |
andreas |
321 |
#endif // defined(Q_OS_ANDROID) || defined(Q_OS_IOS)
|
142 |
andreas |
322 |
void _repaintWindows();
|
151 |
andreas |
323 |
void _toFront(ulong handle);
|
206 |
andreas |
324 |
void _downloadSurface(const std::string& file, size_t size);
|
260 |
andreas |
325 |
void _startWait(const std::string& text);
|
|
|
326 |
void _stopWait();
|
271 |
andreas |
327 |
void _pageFinished(uint handle);
|
279 |
andreas |
328 |
void _listViewArea(ulong handle, ulong parent, Button::TButton& button, SUBVIEWLIST_T& list);
|
70 |
andreas |
329 |
void doReleaseButton();
|
142 |
andreas |
330 |
void repaintObjects();
|
297 |
andreas |
331 |
void refresh(ulong handle);
|
141 |
andreas |
332 |
int calcVolume(int value);
|
224 |
andreas |
333 |
std::string convertMask(const std::string& mask);
|
270 |
andreas |
334 |
#ifdef Q_OS_ANDROID
|
266 |
andreas |
335 |
void hideAndroidBars();
|
271 |
andreas |
336 |
#endif // Q_OS_ANDROID
|
252 |
andreas |
337 |
#ifdef Q_OS_IOS
|
|
|
338 |
void setNotch();
|
|
|
339 |
void initGeoLocation();
|
264 |
andreas |
340 |
Qt::ScreenOrientation getRealOrientation();
|
271 |
andreas |
341 |
#endif // Q_OS_IOS
|
70 |
andreas |
342 |
|
293 |
andreas |
343 |
std::mutex draw_mutex; // We're using threads and need to block execution sometimes
|
|
|
344 |
std::mutex click_mutex;
|
296 |
andreas |
345 |
std::mutex anim_mutex;
|
293 |
andreas |
346 |
|
142 |
andreas |
347 |
bool mWasInactive{false}; // If the application was inactive this is set to true until everything was repainted.
|
|
|
348 |
bool mDoRepaint{false}; // This is set to TRUE whenever a reconnection to the controller happened.
|
23 |
andreas |
349 |
TQtSettings *mSettings{nullptr}; // The pointer to the settings dialog
|
22 |
andreas |
350 |
bool settingsChanged{false}; // true = settings have changed
|
218 |
andreas |
351 |
|
88 |
andreas |
352 |
QToolBar *mToolbar{nullptr}; // The toolbar, if there is any
|
266 |
andreas |
353 |
QStackedWidget *mCentralWidget{nullptr}; // A stacked widget where all pages are stored
|
264 |
andreas |
354 |
bool mCentralInitialized{false}; // True = The central widget and all dependencies are initialized
|
21 |
andreas |
355 |
std::string mVideoURL; // If the button is a video, this is the URL where it plays from.
|
22 |
andreas |
356 |
std::string mFileConfig; // Path and file name of the config file
|
31 |
andreas |
357 |
bool mHasFocus{true}; // If this is FALSE, no output to sceen is allowed.
|
38 |
andreas |
358 |
std::atomic<double> mScaleFactor{1.0}; // The actual scale factor
|
198 |
andreas |
359 |
std::atomic<double> mSetupScaleFactor{1.0}; // The scale factor for the setup pages
|
300 |
andreas |
360 |
OBJECT_t *mLastObject{nullptr}; // This is for the hide effect of widgets.
|
296 |
andreas |
361 |
std::map<ulong, OBJECT_t *> mAnimObjects; // List of started animations
|
213 |
andreas |
362 |
ulong mActualPageHandle{0}; // Holds the handle of the active page.
|
120 |
andreas |
363 |
std::atomic<bool> mBusy{false}; // If TRUE the busy indicator is active
|
179 |
andreas |
364 |
TqDownload *mDownloadBar{nullptr}; // Pointer to a dialog showing a progress bar
|
63 |
andreas |
365 |
TQKeyboard *mQKeyboard{nullptr}; // Pointer to an active virtual keyboard
|
|
|
366 |
TQKeypad *mQKeypad{nullptr}; // Pointer to an active virtual keypad
|
65 |
andreas |
367 |
bool mKeyboard{false}; // TRUE = keyboard is visible
|
|
|
368 |
bool mKeypad{false}; // TRUE = keypad is visible
|
140 |
andreas |
369 |
TQtPhone *mPhoneDialog{nullptr}; // Points to the internal phone dialog
|
70 |
andreas |
370 |
// Mouse
|
|
|
371 |
int mLastPressX{-1}; // Remember the last mouse press X coordinate
|
|
|
372 |
int mLastPressY{-1}; // Remember the last mouse press Y coordinate
|
264 |
andreas |
373 |
Qt::ScreenOrientation mOrientation{Qt::PrimaryOrientation};
|
252 |
andreas |
374 |
QOrientationSensor *mSensor{nullptr}; // Basic sensor for orientation
|
141 |
andreas |
375 |
QMediaPlayer *mMediaPlayer{nullptr};// Class to play sound files.
|
260 |
andreas |
376 |
TQtWait *mWaitBox{nullptr}; // This is a wait dialog.
|
323 |
andreas |
377 |
TQGestureFilter *mGestureFilter{nullptr}; // This handles the pinch and swipe gestures
|
264 |
andreas |
378 |
#if QT_VERSION >= QT_VERSION_CHECK(6, 0, 0)
|
252 |
andreas |
379 |
QGeoPositionInfoSource *mSource{nullptr}; // The geo location is used on IOS to keep app running in background
|
181 |
andreas |
380 |
QAudioOutput *mAudioOutput{nullptr};
|
|
|
381 |
#endif
|
247 |
andreas |
382 |
#ifdef Q_OS_IOS
|
|
|
383 |
TIOSBattery *mIosBattery{nullptr}; // Class to retrive the battery status on an iPhone or iPad
|
252 |
andreas |
384 |
TIOSRotate *mIosRotate{nullptr}; // Class to control rotation
|
259 |
andreas |
385 |
bool mIOSSettingsActive{false}; // TRUE: IOS settings are active.
|
263 |
andreas |
386 |
QMargins mNotchPortrait; // The margins (notch, if any) for portrait orientation
|
|
|
387 |
QMargins mNotchLandscape; // The margins (notch, if any) for landscape orientation
|
|
|
388 |
bool mHaveNotchPortrait{false}; // TRUE = Notch was already fetched for portrait orientation
|
|
|
389 |
bool mHaveNotchLandscape{false}; // TRUE = Notch was already fetched for landscape orientation
|
247 |
andreas |
390 |
#endif
|
213 |
andreas |
391 |
std::chrono::steady_clock::time_point mTouchStart; // Time in micro seconds of the start of a touch event
|
153 |
andreas |
392 |
int mTouchX{0}; // The X coordinate of the mouse pointer
|
|
|
393 |
int mTouchY{0}; // The Y coordinate of the mouse pointer
|
2 |
andreas |
394 |
};
|
|
|
395 |
|
|
|
396 |
#endif
|