From b6f2751ba254b088f15822bd8899ad33b2628ff2 Mon Sep 17 00:00:00 2001 From: Marco Martin Date: Tue, 22 Feb 2011 13:23:36 +0100 Subject: [PATCH] possible to set drawWallpaper and containmentType --- .../javascript/plasmoid/appletinterface.cpp | 20 +++++++++++++++++++ .../javascript/plasmoid/appletinterface.h | 17 +++++++++++++++- 2 files changed, 36 insertions(+), 1 deletion(-) diff --git a/scriptengines/javascript/plasmoid/appletinterface.cpp b/scriptengines/javascript/plasmoid/appletinterface.cpp index c25c5b65f..668faae00 100644 --- a/scriptengines/javascript/plasmoid/appletinterface.cpp +++ b/scriptengines/javascript/plasmoid/appletinterface.cpp @@ -448,6 +448,26 @@ QScriptValue ContainmentInterface::applets() return list; } +void ContainmentInterface::setDrawWallpaper(bool drawWallpaper) +{ + m_appletScriptEngine->setDrawWallpaper(drawWallpaper); +} + +bool ContainmentInterface::drawWallpaper() +{ + return m_appletScriptEngine->drawWallpaper(); +} + +ContainmentInterface::Type ContainmentInterface::containmentType() const +{ + return (ContainmentInterface::Type)m_appletScriptEngine->containmentType(); +} + +void ContainmentInterface::setContainmentType(ContainmentInterface::Type type) +{ + m_appletScriptEngine->setContainmentType((Plasma::Containment::Type)type); +} + void ContainmentInterface::appletAddedForward(Plasma::Applet *applet, const QPointF &pos) { emit appletAdded(applet, pos); diff --git a/scriptengines/javascript/plasmoid/appletinterface.h b/scriptengines/javascript/plasmoid/appletinterface.h index da7c810dc..de638f7f7 100644 --- a/scriptengines/javascript/plasmoid/appletinterface.h +++ b/scriptengines/javascript/plasmoid/appletinterface.h @@ -357,13 +357,28 @@ class ContainmentInterface : public APPLETSUPERCLASS { Q_OBJECT Q_PROPERTY(QScriptValue applets READ applets) + Q_PROPERTY(bool drawWallpaper READ drawWallpaper WRITE setDrawWallpaper) + Q_ENUMS(ContainmentType) public: + enum Type { + NoContainmentType = -1, /**< @internal */ + DesktopContainment = 0, /**< A desktop containment */ + PanelContainment, /**< A desktop panel */ + CustomContainment = 127, /**< A containment that is neither a desktop nor a panel + but something application specific */ + CustomPanelContainment = 128 /**< A customized desktop panel */ + }; ContainmentInterface(AbstractJsAppletScript *parent); inline Plasma::Containment *containment() const { return static_cast(m_appletScriptEngine->applet()); } - QScriptValue applets() ; + QScriptValue applets(); + + void setDrawWallpaper(bool drawWallpaper); + bool drawWallpaper(); + Type containmentType() const; + void setContainmentType(Type type); Q_SIGNALS: void appletAdded(QGraphicsWidget *applet, const QPointF &pos);