summaryrefslogtreecommitdiffstats
path: root/src/qlibwindowmanager.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/qlibwindowmanager.h')
-rw-r--r--src/qlibwindowmanager.h41
1 files changed, 40 insertions, 1 deletions
diff --git a/src/qlibwindowmanager.h b/src/qlibwindowmanager.h
index 8fb653d..3a720a1 100644
--- a/src/qlibwindowmanager.h
+++ b/src/qlibwindowmanager.h
@@ -21,6 +21,42 @@
#include <QObject>
#include <string>
+class AGLScreenInfo : public QObject
+{
+ Q_OBJECT
+
+ public:
+ AGLScreenInfo(double scale = 1.0) { _scale_factor = scale; };
+
+ Q_INVOKABLE double scale_factor() const { return _scale_factor; };
+
+ private:
+ double _scale_factor;
+};
+
+class AGLScreenInfoPrivate
+{
+ public:
+ unsigned long width_dp(void) const { return _width_dp; };
+ unsigned long height_dp(void) const { return _height_dp; };
+ unsigned long width_mm(void) const { return _width_mm; };
+ unsigned long height_mm(void) const { return _height_mm; };
+ double scale_factor(void) const { return _scale; };
+
+ void set_width_dp(unsigned long w) { _width_dp = w; };
+ void set_height_dp(unsigned long h) { _height_dp = h; };
+ void set_width_mm(unsigned long w) { _width_mm = w; };
+ void set_height_mm(unsigned long h) { _height_mm = h; };
+ void set_scale_factor(double scale) { _scale = scale; };
+
+ private:
+ unsigned long _width_dp;
+ unsigned long _height_dp;
+ unsigned long _width_mm;
+ unsigned long _height_mm;
+ double _scale = 1.0;
+};
+
class QLibWindowmanager : public QObject{
Q_OBJECT
public:
@@ -58,8 +94,11 @@ public:
Q_INVOKABLE int activateWindow(const QString &label, const QString &drawing_area);
Q_INVOKABLE int deactivateWindow(const QString &label);
Q_INVOKABLE int endDraw(const QString &label);
+
void set_event_handler(enum QEventType et, handler_fun f);
+ double get_scale_factor() const { return screen_info->scale_factor(); };
+
// These APIs are deprecated, please use new API
THIS_FUNCTION_IS_DEPRECATED(Q_INVOKABLE int activateSurface(const QString &label));
THIS_FUNCTION_IS_DEPRECATED(Q_INVOKABLE int activateSurface(const QString &label, const QString &drawing_area));
@@ -75,6 +114,6 @@ private:
LibWindowmanager* wm;
const char* applabel;
bool isActive;
-
+ AGLScreenInfoPrivate* screen_info;
};
#endif // LIBWINDOWMANAGER_H