rename: QuickShell => Quickshell

This commit is contained in:
outfoxxed 2024-02-26 00:57:47 -08:00
parent 307e6c05be
commit 4ae7ff8c72
Signed by untrusted user: outfoxxed
GPG key ID: 4C88A185FB89301E
19 changed files with 78 additions and 78 deletions

2
docs

@ -1 +1 @@
Subproject commit cc201afd3a352a28f5daddbe00d7aed974d52d30
Subproject commit 5aaacb9a1eea9086d6da9e21eed6e30456c6c5d6

View file

@ -17,4 +17,4 @@ qt_add_executable(quickshell
panelinterface.cpp
)
qt_add_qml_module(quickshell URI QuickShell)
qt_add_qml_module(quickshell URI Quickshell)

View file

@ -52,7 +52,7 @@ QQuickItem* FloatingWindowInterface::contentItem() const { return this->window->
proxyPair(bool, isVisible, setVisible);
proxyPair(qint32, width, setWidth);
proxyPair(qint32, height, setHeight);
proxyPair(QuickShellScreenInfo*, screen, setScreen);
proxyPair(QuickshellScreenInfo*, screen, setScreen);
proxyPair(QColor, color, setColor);
proxyPair(PendingRegion*, mask, setMask);

View file

@ -39,8 +39,8 @@ public:
[[nodiscard]] qint32 height() const override;
void setHeight(qint32 height) override;
[[nodiscard]] QuickShellScreenInfo* screen() const override;
void setScreen(QuickShellScreenInfo* screen) override;
[[nodiscard]] QuickshellScreenInfo* screen() const override;
void setScreen(QuickshellScreenInfo* screen) override;
[[nodiscard]] QColor color() const override;
void setColor(QColor color) override;

View file

@ -1,5 +1,5 @@
name = "QuickShell"
description = "Core QuickShell types"
name = "Quickshell"
description = "Core Quickshell types"
headers = [
"qmlglobal.hpp",
"qmlscreen.hpp",

View file

@ -124,7 +124,7 @@ void ProxyWindowBase::setHeight(qint32 height) {
} else this->window->setHeight(height);
}
void ProxyWindowBase::setScreen(QuickShellScreenInfo* screen) {
void ProxyWindowBase::setScreen(QuickshellScreenInfo* screen) {
if (this->mScreen != nullptr) {
QObject::disconnect(this->mScreen, nullptr, this, nullptr);
}
@ -140,7 +140,7 @@ void ProxyWindowBase::setScreen(QuickShellScreenInfo* screen) {
void ProxyWindowBase::onScreenDestroyed() { this->mScreen = nullptr; }
QuickShellScreenInfo* ProxyWindowBase::screen() const {
QuickshellScreenInfo* ProxyWindowBase::screen() const {
QScreen* qscreen = nullptr;
if (this->window == nullptr) {
@ -149,7 +149,7 @@ QuickShellScreenInfo* ProxyWindowBase::screen() const {
qscreen = this->window->screen();
}
return new QuickShellScreenInfo(
return new QuickshellScreenInfo(
const_cast<ProxyWindowBase*>(this), // NOLINT
qscreen
);

View file

@ -38,7 +38,7 @@ class ProxyWindowBase: public Reloadable {
Q_PROPERTY(bool visible READ isVisible WRITE setVisible NOTIFY visibleChanged);
Q_PROPERTY(qint32 width READ width WRITE setWidth NOTIFY widthChanged);
Q_PROPERTY(qint32 height READ height WRITE setHeight NOTIFY heightChanged);
Q_PROPERTY(QuickShellScreenInfo* screen READ screen WRITE setScreen NOTIFY screenChanged);
Q_PROPERTY(QuickshellScreenInfo* screen READ screen WRITE setScreen NOTIFY screenChanged);
Q_PROPERTY(QColor color READ color WRITE setColor NOTIFY colorChanged);
Q_PROPERTY(PendingRegion* mask READ mask WRITE setMask NOTIFY maskChanged);
Q_PROPERTY(QQmlListProperty<QObject> data READ data);
@ -73,8 +73,8 @@ public:
[[nodiscard]] virtual qint32 height() const;
virtual void setHeight(qint32 height);
[[nodiscard]] virtual QuickShellScreenInfo* screen() const;
virtual void setScreen(QuickShellScreenInfo* screen);
[[nodiscard]] virtual QuickshellScreenInfo* screen() const;
virtual void setScreen(QuickshellScreenInfo* screen);
[[nodiscard]] QColor color() const;
virtual void setColor(QColor color);

View file

@ -14,40 +14,40 @@
#include "qmlscreen.hpp"
#include "rootwrapper.hpp"
QuickShellGlobal::QuickShellGlobal(QObject* parent): QObject(parent) {
QuickshellGlobal::QuickshellGlobal(QObject* parent): QObject(parent) {
auto* app = QCoreApplication::instance();
auto* guiApp = qobject_cast<QGuiApplication*>(app);
if (guiApp != nullptr) {
// clang-format off
QObject::connect(guiApp, &QGuiApplication::primaryScreenChanged, this, &QuickShellGlobal::updateScreens);
QObject::connect(guiApp, &QGuiApplication::screenAdded, this, &QuickShellGlobal::updateScreens);
QObject::connect(guiApp, &QGuiApplication::screenRemoved, this, &QuickShellGlobal::updateScreens);
QObject::connect(guiApp, &QGuiApplication::primaryScreenChanged, this, &QuickshellGlobal::updateScreens);
QObject::connect(guiApp, &QGuiApplication::screenAdded, this, &QuickshellGlobal::updateScreens);
QObject::connect(guiApp, &QGuiApplication::screenRemoved, this, &QuickshellGlobal::updateScreens);
// clang-format on
this->updateScreens();
}
}
qsizetype QuickShellGlobal::screensCount(QQmlListProperty<QuickShellScreenInfo>* prop) {
return static_cast<QuickShellGlobal*>(prop->object)->mScreens.size(); // NOLINT
qsizetype QuickshellGlobal::screensCount(QQmlListProperty<QuickshellScreenInfo>* prop) {
return static_cast<QuickshellGlobal*>(prop->object)->mScreens.size(); // NOLINT
}
QuickShellScreenInfo*
QuickShellGlobal::screenAt(QQmlListProperty<QuickShellScreenInfo>* prop, qsizetype i) {
return static_cast<QuickShellGlobal*>(prop->object)->mScreens.at(i); // NOLINT
QuickshellScreenInfo*
QuickshellGlobal::screenAt(QQmlListProperty<QuickshellScreenInfo>* prop, qsizetype i) {
return static_cast<QuickshellGlobal*>(prop->object)->mScreens.at(i); // NOLINT
}
QQmlListProperty<QuickShellScreenInfo> QuickShellGlobal::screens() {
return QQmlListProperty<QuickShellScreenInfo>(
QQmlListProperty<QuickshellScreenInfo> QuickshellGlobal::screens() {
return QQmlListProperty<QuickshellScreenInfo>(
this,
nullptr,
&QuickShellGlobal::screensCount,
&QuickShellGlobal::screenAt
&QuickshellGlobal::screensCount,
&QuickshellGlobal::screenAt
);
}
void QuickShellGlobal::reload(bool hard) {
void QuickshellGlobal::reload(bool hard) {
auto* rootobj = QQmlEngine::contextForObject(this)->engine()->parent();
auto* root = qobject_cast<RootWrapper*>(rootobj);
@ -59,7 +59,7 @@ void QuickShellGlobal::reload(bool hard) {
root->reloadGraph(hard);
}
void QuickShellGlobal::updateScreens() {
void QuickshellGlobal::updateScreens() {
auto screens = QGuiApplication::screens();
this->mScreens.resize(screens.size());
@ -69,7 +69,7 @@ void QuickShellGlobal::updateScreens() {
this->mScreens[i]->setParent(nullptr); // delete if not owned by the js engine
}
this->mScreens[i] = new QuickShellScreenInfo(this, screens[i]);
this->mScreens[i] = new QuickshellScreenInfo(this, screens[i]);
}
emit this->screensChanged();

View file

@ -9,7 +9,7 @@
#include "qmlscreen.hpp"
class QuickShellGlobal: public QObject {
class QuickshellGlobal: public QObject {
Q_OBJECT;
/// All currently connected screens.
///
@ -24,25 +24,25 @@ class QuickShellGlobal: public QObject {
/// }
///
/// // see Variants for details
/// variants: QuickShell.screens.map(screen => ({ screen }))
/// variants: Quickshell.screens.map(screen => ({ screen }))
/// }
/// }
/// ```
///
/// This creates an instance of your window once on every screen.
/// As screens are added or removed your window will be created or destroyed on those screens.
Q_PROPERTY(QQmlListProperty<QuickShellScreenInfo> screens READ screens NOTIFY screensChanged);
Q_PROPERTY(QQmlListProperty<QuickshellScreenInfo> screens READ screens NOTIFY screensChanged);
QML_SINGLETON;
QML_NAMED_ELEMENT(QuickShell);
QML_NAMED_ELEMENT(Quickshell);
public:
QuickShellGlobal(QObject* parent = nullptr);
QuickshellGlobal(QObject* parent = nullptr);
QQmlListProperty<QuickShellScreenInfo> screens();
QQmlListProperty<QuickshellScreenInfo> screens();
/// Reload the shell from the [ShellRoot].
///
/// `hard` - perform a hard reload. If this is false, QuickShell will attempt to reuse windows
/// `hard` - perform a hard reload. If this is false, Quickshell will attempt to reuse windows
/// that already exist. If true windows will be recreated.
///
/// See [Reloadable] for more information on what can be reloaded and how.
@ -57,8 +57,8 @@ public slots:
void updateScreens();
private:
static qsizetype screensCount(QQmlListProperty<QuickShellScreenInfo>* prop);
static QuickShellScreenInfo* screenAt(QQmlListProperty<QuickShellScreenInfo>* prop, qsizetype i);
static qsizetype screensCount(QQmlListProperty<QuickshellScreenInfo>* prop);
static QuickshellScreenInfo* screenAt(QQmlListProperty<QuickshellScreenInfo>* prop, qsizetype i);
QVector<QuickShellScreenInfo*> mScreens;
QVector<QuickshellScreenInfo*> mScreens;
};

View file

@ -7,33 +7,33 @@
#include <qscreen.h>
#include <qtypes.h>
QuickShellScreenInfo::QuickShellScreenInfo(QObject* parent, QScreen* screen)
QuickshellScreenInfo::QuickshellScreenInfo(QObject* parent, QScreen* screen)
: QObject(parent)
, screen(screen) {
if (this->screen != nullptr) {
// clang-format off
QObject::connect(this->screen, &QScreen::geometryChanged, this, &QuickShellScreenInfo::geometryChanged);
QObject::connect(this->screen, &QScreen::physicalDotsPerInchChanged, this, &QuickShellScreenInfo::physicalPixelDensityChanged);
QObject::connect(this->screen, &QScreen::logicalDotsPerInchChanged, this, &QuickShellScreenInfo::logicalPixelDensityChanged);
QObject::connect(this->screen, &QScreen::orientationChanged, this, &QuickShellScreenInfo::orientationChanged);
QObject::connect(this->screen, &QScreen::primaryOrientationChanged, this, &QuickShellScreenInfo::primaryOrientationChanged);
QObject::connect(this->screen, &QObject::destroyed, this, &QuickShellScreenInfo::screenDestroyed);
QObject::connect(this->screen, &QScreen::geometryChanged, this, &QuickshellScreenInfo::geometryChanged);
QObject::connect(this->screen, &QScreen::physicalDotsPerInchChanged, this, &QuickshellScreenInfo::physicalPixelDensityChanged);
QObject::connect(this->screen, &QScreen::logicalDotsPerInchChanged, this, &QuickshellScreenInfo::logicalPixelDensityChanged);
QObject::connect(this->screen, &QScreen::orientationChanged, this, &QuickshellScreenInfo::orientationChanged);
QObject::connect(this->screen, &QScreen::primaryOrientationChanged, this, &QuickshellScreenInfo::primaryOrientationChanged);
QObject::connect(this->screen, &QObject::destroyed, this, &QuickshellScreenInfo::screenDestroyed);
// clang-format on
}
}
bool QuickShellScreenInfo::operator==(QuickShellScreenInfo& other) const {
bool QuickshellScreenInfo::operator==(QuickshellScreenInfo& other) const {
return this->screen == other.screen;
}
void QuickShellScreenInfo::warnDangling() const {
void QuickshellScreenInfo::warnDangling() const {
if (this->dangling) {
qWarning() << "attempted to use dangling screen object";
}
}
QString QuickShellScreenInfo::name() const {
QString QuickshellScreenInfo::name() const {
if (this->screen == nullptr) {
this->warnDangling();
return "{ NULL SCREEN }";
@ -42,7 +42,7 @@ QString QuickShellScreenInfo::name() const {
return this->screen->name();
}
qint32 QuickShellScreenInfo::width() const {
qint32 QuickshellScreenInfo::width() const {
if (this->screen == nullptr) {
this->warnDangling();
return 0;
@ -51,7 +51,7 @@ qint32 QuickShellScreenInfo::width() const {
return this->screen->size().width();
}
qint32 QuickShellScreenInfo::height() const {
qint32 QuickshellScreenInfo::height() const {
if (this->screen == nullptr) {
this->warnDangling();
return 0;
@ -60,7 +60,7 @@ qint32 QuickShellScreenInfo::height() const {
return this->screen->size().height();
}
qreal QuickShellScreenInfo::physicalPixelDensity() const {
qreal QuickshellScreenInfo::physicalPixelDensity() const {
if (this->screen == nullptr) {
this->warnDangling();
return 0.0;
@ -69,7 +69,7 @@ qreal QuickShellScreenInfo::physicalPixelDensity() const {
return this->screen->physicalDotsPerInch() / 25.4;
}
qreal QuickShellScreenInfo::logicalPixelDensity() const {
qreal QuickshellScreenInfo::logicalPixelDensity() const {
if (this->screen == nullptr) {
this->warnDangling();
return 0.0;
@ -78,7 +78,7 @@ qreal QuickShellScreenInfo::logicalPixelDensity() const {
return this->screen->logicalDotsPerInch() / 25.4;
}
qreal QuickShellScreenInfo::devicePixelRatio() const {
qreal QuickshellScreenInfo::devicePixelRatio() const {
if (this->screen == nullptr) {
this->warnDangling();
return 0.0;
@ -87,7 +87,7 @@ qreal QuickShellScreenInfo::devicePixelRatio() const {
return this->screen->devicePixelRatio();
}
Qt::ScreenOrientation QuickShellScreenInfo::orientation() const {
Qt::ScreenOrientation QuickshellScreenInfo::orientation() const {
if (this->screen == nullptr) {
this->warnDangling();
return Qt::PrimaryOrientation;
@ -96,7 +96,7 @@ Qt::ScreenOrientation QuickShellScreenInfo::orientation() const {
return this->screen->orientation();
}
Qt::ScreenOrientation QuickShellScreenInfo::primaryOrientation() const {
Qt::ScreenOrientation QuickshellScreenInfo::primaryOrientation() const {
if (this->screen == nullptr) {
this->warnDangling();
return Qt::PrimaryOrientation;
@ -105,7 +105,7 @@ Qt::ScreenOrientation QuickShellScreenInfo::primaryOrientation() const {
return this->screen->primaryOrientation();
}
void QuickShellScreenInfo::screenDestroyed() {
void QuickshellScreenInfo::screenDestroyed() {
this->screen = nullptr;
this->dangling = true;
}

View file

@ -20,10 +20,10 @@
///
/// [ShellWindow]: ../shellwindow
/// [Screen]: https://doc.qt.io/qt-6/qml-qtquick-screen.html
class QuickShellScreenInfo: public QObject {
class QuickshellScreenInfo: public QObject {
Q_OBJECT;
QML_NAMED_ELEMENT(ShellScreen);
QML_UNCREATABLE("ShellScreen can only be obtained via QuickShell.screens");
QML_UNCREATABLE("ShellScreen can only be obtained via Quickshell.screens");
// clang-format off
/// The name of the screen as seen by the operating system.
///
@ -42,9 +42,9 @@ class QuickShellScreenInfo: public QObject {
// clang-format on
public:
QuickShellScreenInfo(QObject* parent, QScreen* screen); //: QObject(parent), screen(screen) {}
QuickshellScreenInfo(QObject* parent, QScreen* screen); //: QObject(parent), screen(screen) {}
bool operator==(QuickShellScreenInfo& other) const;
bool operator==(QuickshellScreenInfo& other) const;
[[nodiscard]] QString name() const;
[[nodiscard]] qint32 width() const;

View file

@ -41,7 +41,7 @@ void RootWrapper::reloadGraph(bool hard) {
auto* newRoot = qobject_cast<ShellRoot*>(obj);
if (newRoot == nullptr) {
qWarning() << "root component was not a QuickShell.ShellRoot";
qWarning() << "root component was not a Quickshell.ShellRoot";
delete obj;
return;
}

View file

@ -25,10 +25,10 @@ public:
///! Creates instances of a component based on a given set of variants.
/// Creates and destroys instances of the given component when the given property changes.
///
/// See [QuickShell.screens] for an example of using `Variants` to create copies of a window per
/// See [Quickshell.screens] for an example of using `Variants` to create copies of a window per
/// screen.
///
/// [QuickShell.screens]: ../quickshell#prop.screens
/// [Quickshell.screens]: ../quickshell#prop.screens
class Variants: public Reloadable {
Q_OBJECT;
/// The component to create instances of

View file

@ -23,7 +23,7 @@ class WindowInterface: public Reloadable {
/// The screen that the window currently occupies.
///
/// > [!INFO] This cannot be changed after windowConnected.
Q_PROPERTY(QuickShellScreenInfo* screen READ screen WRITE setScreen NOTIFY screenChanged);
Q_PROPERTY(QuickshellScreenInfo* screen READ screen WRITE setScreen NOTIFY screenChanged);
/// The background color of the window. Defaults to white.
///
/// > [!WARNING] This seems to behave weirdly when using transparent colors on some systems.
@ -102,8 +102,8 @@ public:
[[nodiscard]] virtual qint32 height() const = 0;
virtual void setHeight(qint32 height) = 0;
[[nodiscard]] virtual QuickShellScreenInfo* screen() const = 0;
virtual void setScreen(QuickShellScreenInfo* screen) = 0;
[[nodiscard]] virtual QuickshellScreenInfo* screen() const = 0;
virtual void setScreen(QuickshellScreenInfo* screen) = 0;
[[nodiscard]] virtual QColor color() const = 0;
virtual void setColor(QColor color) = 0;

View file

@ -10,7 +10,7 @@ add_library(quickshell-wayland-init OBJECT init.cpp)
target_link_libraries(quickshell PRIVATE ${QT_DEPS} quickshell-waylandplugin quickshell-wayland-init)
qt_add_qml_module(quickshell-wayland URI QuickShell.Wayland)
qt_add_qml_module(quickshell-wayland URI Quickshell.Wayland)
find_package(PkgConfig REQUIRED)
pkg_check_modules(wayland REQUIRED IMPORTED_TARGET wayland-client wayland-protocols)

View file

@ -10,15 +10,15 @@ class WaylandPlugin: public QuickshellPlugin {
bool applies() override { return QGuiApplication::platformName() == "wayland"; }
void registerTypes() override {
qmlRegisterType<WaylandPanelInterface>("QuickShell._WaylandOverlay", 1, 0, "PanelWindow");
qmlRegisterType<WaylandPanelInterface>("Quickshell._WaylandOverlay", 1, 0, "PanelWindow");
// If any types are defined inside a module using QML_ELEMENT then all QML_ELEMENT types
// will not be registered. This can be worked around with a module import which makes
// the QML_ELMENT module import the old register-type style module.
qmlRegisterModuleImport(
"QuickShell",
"Quickshell",
QQmlModuleImportModuleAny,
"QuickShell._WaylandOverlay",
"Quickshell._WaylandOverlay",
QQmlModuleImportLatest
);
}

View file

@ -1,5 +1,5 @@
name = "QuickShell.Wayland"
description = "Wayland specific QuickShell types"
name = "Quickshell.Wayland"
description = "Wayland specific Quickshell types"
headers = [
"layershell.hpp",
"waylandlayershell.hpp",

View file

@ -79,7 +79,7 @@ void WaylandLayershell::setHeight(qint32 height) {
}
}
void WaylandLayershell::setScreen(QuickShellScreenInfo* screen) {
void WaylandLayershell::setScreen(QuickshellScreenInfo* screen) {
this->ProxyWindowBase::setScreen(screen);
this->ext->setUseWindowScreen(screen != nullptr);
}
@ -197,7 +197,7 @@ QQuickItem* WaylandPanelInterface::contentItem() const { return this->layer->con
proxyPair(bool, isVisible, setVisible);
proxyPair(qint32, width, setWidth);
proxyPair(qint32, height, setHeight);
proxyPair(QuickShellScreenInfo*, screen, setScreen);
proxyPair(QuickshellScreenInfo*, screen, setScreen);
proxyPair(QColor, color, setColor);
proxyPair(PendingRegion*, mask, setMask);

View file

@ -41,7 +41,7 @@ public:
void setWidth(qint32 width) override;
void setHeight(qint32 height) override;
void setScreen(QuickShellScreenInfo* screen) override;
void setScreen(QuickshellScreenInfo* screen) override;
[[nodiscard]] Layer::Enum layer() const;
void setLayer(Layer::Enum layer); // NOLINT
@ -107,8 +107,8 @@ public:
[[nodiscard]] qint32 height() const override;
void setHeight(qint32 height) override;
[[nodiscard]] QuickShellScreenInfo* screen() const override;
void setScreen(QuickShellScreenInfo* screen) override;
[[nodiscard]] QuickshellScreenInfo* screen() const override;
void setScreen(QuickshellScreenInfo* screen) override;
[[nodiscard]] QColor color() const override;
void setColor(QColor color) override;