-
Notifications
You must be signed in to change notification settings - Fork 135
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
ILXQtTaskbarAbstractBackend: add dummy implementation
This will be used to avoid crashing panel in case no backend could be created. A warning message will be printed in this case.
- Loading branch information
Showing
4 changed files
with
248 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,156 @@ | ||
#include "lxqttaskbardummybackend.h" | ||
|
||
#include <QIcon> | ||
|
||
LXQtTaskBarDummyBackend::LXQtTaskBarDummyBackend(QObject *parent) | ||
: ILXQtTaskbarAbstractBackend(parent) | ||
{ | ||
|
||
} | ||
|
||
|
||
/************************************************ | ||
* Windows function | ||
************************************************/ | ||
bool LXQtTaskBarDummyBackend::supportsAction(WId, LXQtTaskBarBackendAction) const | ||
{ | ||
return false; | ||
} | ||
|
||
bool LXQtTaskBarDummyBackend::reloadWindows() | ||
{ | ||
return false; | ||
} | ||
|
||
QVector<WId> LXQtTaskBarDummyBackend::getCurrentWindows() const | ||
{ | ||
return {}; | ||
} | ||
|
||
QString LXQtTaskBarDummyBackend::getWindowTitle(WId) const | ||
{ | ||
return QString(); | ||
} | ||
|
||
bool LXQtTaskBarDummyBackend::applicationDemandsAttention(WId) const | ||
{ | ||
return false; | ||
} | ||
|
||
QIcon LXQtTaskBarDummyBackend::getApplicationIcon(WId, int) const | ||
{ | ||
return QIcon(); | ||
} | ||
|
||
QString LXQtTaskBarDummyBackend::getWindowClass(WId) const | ||
{ | ||
return QString(); | ||
} | ||
|
||
LXQtTaskBarWindowLayer LXQtTaskBarDummyBackend::getWindowLayer(WId) const | ||
{ | ||
return LXQtTaskBarWindowLayer::Normal; | ||
} | ||
|
||
bool LXQtTaskBarDummyBackend::setWindowLayer(WId, LXQtTaskBarWindowLayer) | ||
{ | ||
return false; | ||
} | ||
|
||
LXQtTaskBarWindowState LXQtTaskBarDummyBackend::getWindowState(WId) const | ||
{ | ||
return LXQtTaskBarWindowState::Normal; | ||
} | ||
|
||
bool LXQtTaskBarDummyBackend::setWindowState(WId, LXQtTaskBarWindowState, bool) | ||
{ | ||
return false; | ||
} | ||
|
||
bool LXQtTaskBarDummyBackend::isWindowActive(WId) const | ||
{ | ||
return false; | ||
} | ||
|
||
bool LXQtTaskBarDummyBackend::raiseWindow(WId, bool) | ||
{ | ||
return false; | ||
} | ||
|
||
bool LXQtTaskBarDummyBackend::closeWindow(WId) | ||
{ | ||
return false; | ||
} | ||
|
||
WId LXQtTaskBarDummyBackend::getActiveWindow() const | ||
{ | ||
return 0; | ||
} | ||
|
||
|
||
/************************************************ | ||
* Workspaces | ||
************************************************/ | ||
int LXQtTaskBarDummyBackend::getWorkspacesCount() const | ||
{ | ||
return 1; // Fake 1 workspace | ||
} | ||
|
||
QString LXQtTaskBarDummyBackend::getWorkspaceName(int) const | ||
{ | ||
return QString(); | ||
} | ||
|
||
int LXQtTaskBarDummyBackend::getCurrentWorkspace() const | ||
{ | ||
return 0; | ||
} | ||
|
||
bool LXQtTaskBarDummyBackend::setCurrentWorkspace(int) | ||
{ | ||
return false; | ||
} | ||
|
||
int LXQtTaskBarDummyBackend::getWindowWorkspace(WId) const | ||
{ | ||
return 0; | ||
} | ||
|
||
bool LXQtTaskBarDummyBackend::setWindowOnWorkspace(WId, int) | ||
{ | ||
return false; | ||
} | ||
|
||
void LXQtTaskBarDummyBackend::moveApplicationToPrevNextMonitor(WId, bool, bool) | ||
{ | ||
//No-op | ||
} | ||
|
||
bool LXQtTaskBarDummyBackend::isWindowOnScreen(QScreen *, WId) const | ||
{ | ||
return false; | ||
} | ||
|
||
/************************************************ | ||
* X11 Specific | ||
************************************************/ | ||
void LXQtTaskBarDummyBackend::moveApplication(WId) | ||
{ | ||
//No-op | ||
} | ||
|
||
void LXQtTaskBarDummyBackend::resizeApplication(WId) | ||
{ | ||
//No-op | ||
} | ||
|
||
void LXQtTaskBarDummyBackend::refreshIconGeometry(WId, QRect const &) | ||
{ | ||
//No-op | ||
} | ||
|
||
bool LXQtTaskBarDummyBackend::isAreaOverlapped(const QRect &) const | ||
{ | ||
return false; | ||
} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,82 @@ | ||
#ifndef LXQTTASKBARDUMMYBACKEND_H | ||
#define LXQTTASKBARDUMMYBACKEND_H | ||
|
||
#include "ilxqttaskbarabstractbackend.h" | ||
|
||
class LXQtTaskBarDummyBackend : public ILXQtTaskbarAbstractBackend | ||
{ | ||
Q_OBJECT | ||
|
||
public: | ||
explicit LXQtTaskBarDummyBackend(QObject *parent = nullptr); | ||
|
||
// Backend | ||
bool supportsAction(WId windowId, LXQtTaskBarBackendAction action) const override; | ||
|
||
// Windows | ||
bool reloadWindows() override; | ||
|
||
QVector<WId> getCurrentWindows() const override; | ||
|
||
QString getWindowTitle(WId windowId) const override; | ||
|
||
bool applicationDemandsAttention(WId windowId) const override; | ||
|
||
QIcon getApplicationIcon(WId windowId, int fallbackDevicePixels) const override; | ||
|
||
QString getWindowClass(WId windowId) const override; | ||
|
||
LXQtTaskBarWindowLayer getWindowLayer(WId windowId) const override; | ||
bool setWindowLayer(WId windowId, LXQtTaskBarWindowLayer layer) override; | ||
|
||
LXQtTaskBarWindowState getWindowState(WId windowId) const override; | ||
bool setWindowState(WId windowId, LXQtTaskBarWindowState state, bool set = true) override; | ||
|
||
bool isWindowActive(WId windowId) const override; | ||
bool raiseWindow(WId windowId, bool onCurrentWorkSpace) override; | ||
|
||
bool closeWindow(WId windowId) override; | ||
|
||
WId getActiveWindow() const override; | ||
|
||
// Workspaces | ||
int getWorkspacesCount() const override; | ||
QString getWorkspaceName(int idx) const override; | ||
|
||
int getCurrentWorkspace() const override; | ||
bool setCurrentWorkspace(int idx) override; | ||
|
||
int getWindowWorkspace(WId windowId) const override; | ||
bool setWindowOnWorkspace(WId windowId, int idx) override; | ||
|
||
void moveApplicationToPrevNextMonitor(WId windowId, bool next, bool raiseOnCurrentDesktop) override; | ||
|
||
bool isWindowOnScreen(QScreen *screen, WId windowId) const override; | ||
|
||
// X11 Specific | ||
void moveApplication(WId windowId) override; | ||
void resizeApplication(WId windowId) override; | ||
|
||
void refreshIconGeometry(WId windowId, const QRect &geom) override; | ||
|
||
// Panel internal | ||
bool isAreaOverlapped(const QRect& area) const override; | ||
|
||
signals: | ||
void reloaded(); | ||
|
||
// Windows | ||
void windowAdded(WId windowId); | ||
void windowRemoved(WId windowId); | ||
void windowPropertyChanged(WId windowId, int prop); | ||
|
||
// Workspaces | ||
void workspacesCountChanged(); | ||
void workspaceNameChanged(int idx); | ||
void currentWorkspaceChanged(int idx); | ||
|
||
// TODO: needed? | ||
void activeWindowChanged(WId windowId); | ||
}; | ||
|
||
#endif // LXQTTASKBARDUMMYBACKEND_H |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters