Rename to TNCat, add chip chase, G-codes and a Wayland layout
The project is now TNCat, after HEIDENHAIN's TNC controls. Binary, QML module URI, settings path, bundle id and .desktop entry follow; the environment switches are TNCAT_*. Entertainment: a curled steel chip skitters in every minute or two, the cat runs it down and bats it away a few times before sitting back looking pleased. Mood changes flash the matching machine code above its head, G00 for a sprint, G01 for a stroll, M08 while it washes, G28 for a stretch, M30 for a nap. Window handling was split into two layouts. X11 and macOS keep one small window per object, positioned by the app. Wayland gets a screen-filling overlay whose input region is masked down to the cat, since a Wayland client cannot place its own window. Overlay mode is automatic there and available elsewhere via TNCAT_OVERLAY=1. Also adds a ground-line setting so the cat can walk above a softkey row. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
This commit is contained in:
1 parent
acef398f49
commit
0f1df75a1d
19 files changed
+817
-185
No files matched your search
+18
-3
@@ -2,9 +2,12 @@
|
||||
|
||||
#include <QObject>
|
||||
#include <QQmlEngine>
|
||||
#include <QRectF>
|
||||
#include <QString>
|
||||
#include <QQuickWindow>
|
||||
|
||||
// Small facts about the host that QML needs in order to pick window flags.
|
||||
// Small facts about the host that QML needs in order to pick window flags,
|
||||
// plus the input-region call that makes an overlay window click-through.
|
||||
class PlatformInfo : public QObject
|
||||
{
|
||||
Q_OBJECT
|
||||
@@ -14,6 +17,7 @@ class PlatformInfo : public QObject
|
||||
Q_PROPERTY(QString name READ name CONSTANT)
|
||||
Q_PROPERTY(bool isX11 READ isX11 CONSTANT)
|
||||
Q_PROPERTY(bool isWayland READ isWayland CONSTANT)
|
||||
Q_PROPERTY(bool overlayMode READ overlayMode CONSTANT)
|
||||
Q_PROPERTY(bool bypassWindowManager READ bypassWindowManager CONSTANT)
|
||||
Q_PROPERTY(bool opaqueBackground READ opaqueBackground CONSTANT)
|
||||
|
||||
@@ -24,16 +28,27 @@ public:
|
||||
bool isX11() const { return m_name == QLatin1String("xcb"); }
|
||||
bool isWayland() const { return m_name.startsWith(QLatin1String("wayland")); }
|
||||
|
||||
// WORKCAT_X11_BYPASS=1 turns the cat into an override-redirect window.
|
||||
// Wayland forbids a client from placing its own window, so there the cat
|
||||
// lives inside one screen-filling overlay and only moves within it.
|
||||
// TNCAT_OVERLAY=1 forces the same mode elsewhere.
|
||||
bool overlayMode() const { return m_overlay || isWayland(); }
|
||||
|
||||
// TNCAT_X11_BYPASS=1 turns the cat into an override-redirect window.
|
||||
// Useful on window managers that refuse to keep a Qt::Tool window on top.
|
||||
bool bypassWindowManager() const { return m_bypass; }
|
||||
|
||||
// WORKCAT_OPAQUE=1 paints a solid background instead of relying on a
|
||||
// TNCAT_OPAQUE=1 paints a solid background instead of relying on a
|
||||
// compositor. Without compositing X11 renders transparency as black.
|
||||
bool opaqueBackground() const { return m_opaque; }
|
||||
|
||||
// Restricts the window's input region to one rectangle so clicks land on
|
||||
// whatever is behind the rest of the overlay. Implemented by the X11 and
|
||||
// Wayland plugins; a no-op on platforms that ignore the mask.
|
||||
Q_INVOKABLE void setInputRegion(QQuickWindow *window, const QRectF ®ion);
|
||||
|
||||
private:
|
||||
QString m_name;
|
||||
bool m_overlay = false;
|
||||
bool m_bypass = false;
|
||||
bool m_opaque = false;
|
||||
};
|
||||
Reference in new issue
Block a user