--appletChain.. did this on the wrong system, am committing so i can
test on the dev box svn path=/trunk/KDE/kdebase/workspace/plasma/lib/; revision=637812
This commit is contained in:
parent
b5a36666ab
commit
ecee37b67c
@ -6,7 +6,6 @@
|
||||
set(plasma_LIB_SRCS
|
||||
plasma.cpp
|
||||
applet.cpp
|
||||
appletChain.cpp
|
||||
interface.cpp
|
||||
theme.cpp
|
||||
)
|
||||
|
17
applet.cpp
17
applet.cpp
@ -38,8 +38,7 @@ class Applet::Private
|
||||
: id(uniqueID),
|
||||
globalConfig(0),
|
||||
appletConfig(0),
|
||||
appletDescription(appletDescription),
|
||||
chain(appletChain)
|
||||
appletDescription(appletDescription)
|
||||
{ }
|
||||
|
||||
~Private()
|
||||
@ -55,16 +54,14 @@ class Applet::Private
|
||||
KSharedConfig::Ptr appletConfig;
|
||||
KService::Ptr appletDescription;
|
||||
QList<QObject*> watchedForFocus;
|
||||
AppletChain::Ptr chain;
|
||||
QStringList loadedEngines;
|
||||
};
|
||||
|
||||
Applet::Applet(QWidget* parent,
|
||||
KService::Ptr appletDescription,
|
||||
const AppletChain::Ptr chain,
|
||||
int id)
|
||||
: QWidget(parent),
|
||||
d(new Private(appletDescription, id, chain))
|
||||
d(new Private(appletDescription, id))
|
||||
{
|
||||
}
|
||||
|
||||
@ -114,16 +111,6 @@ bool Applet::loadDataEngine(const QString& name)
|
||||
return false;
|
||||
}
|
||||
|
||||
const AppletChain::Ptr Applet::chain() const
|
||||
{
|
||||
return d->chain;
|
||||
}
|
||||
|
||||
void Applet::setChain(const AppletChain::Ptr appletChain)
|
||||
{
|
||||
d->chain = appletChain;
|
||||
}
|
||||
|
||||
void Applet::constraintsUpdated()
|
||||
{
|
||||
}
|
||||
|
4
applet.h
4
applet.h
@ -39,7 +39,6 @@ class KDE_EXPORT Applet : public QWidget
|
||||
|
||||
Applet(QWidget* parent,
|
||||
KService::Ptr appletDescription,
|
||||
const AppletChain::Ptr chain,
|
||||
int id);
|
||||
~Applet();
|
||||
|
||||
@ -69,9 +68,6 @@ class KDE_EXPORT Applet : public QWidget
|
||||
*/
|
||||
bool loadDataEngine(const QString& name);
|
||||
|
||||
const AppletChain::Ptr chain() const;
|
||||
void setChain(const AppletChain::Ptr);
|
||||
|
||||
/**
|
||||
* called when any of the geometry constraints have been updated
|
||||
* this is always called prior to painting and should be used as an
|
||||
|
133
appletChain.cpp
133
appletChain.cpp
@ -1,133 +0,0 @@
|
||||
/*
|
||||
* Copyright (C) 2005 by Aaron Seigo <aseigo@kde.org>
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU Library General Public License version 2 as
|
||||
* published by the Free Software Foundation
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details
|
||||
*
|
||||
* You should have received a copy of the GNU Library General Public
|
||||
* License along with this program; if not, write to the
|
||||
* Free Software Foundation, Inc.,
|
||||
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
||||
*/
|
||||
|
||||
#include <QApplication>
|
||||
#include <QDesktopWidget>
|
||||
|
||||
#include <kdebug.h>
|
||||
|
||||
#include "applet.h"
|
||||
#include "appletChain.h"
|
||||
|
||||
#include <kdebug.h>
|
||||
|
||||
#include <QApplication>
|
||||
#include <QDesktopWidget>
|
||||
|
||||
namespace Plasma
|
||||
{
|
||||
|
||||
class AppletChain::Private
|
||||
{
|
||||
public:
|
||||
Private()
|
||||
: popupDirection(Up),
|
||||
constraint(Plasma::NoConstraint),
|
||||
screen(0),
|
||||
screenEdge(BottomEdge)
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
Direction popupDirection;
|
||||
AppletConstraint constraint;
|
||||
int screen;
|
||||
ScreenEdge screenEdge;
|
||||
Applet::List applets;
|
||||
|
||||
// configuration items kept in the display widget:
|
||||
// - start coordinates and length for docked chain
|
||||
// - dimensions for floating chain
|
||||
// - display order of applets
|
||||
};
|
||||
|
||||
AppletChain::AppletChain(QObject* parent)
|
||||
: QObject(parent),
|
||||
d(new Private())
|
||||
{
|
||||
}
|
||||
|
||||
AppletChain::~AppletChain()
|
||||
{
|
||||
}
|
||||
|
||||
Plasma::AppletConstraint AppletChain::constraint()
|
||||
{
|
||||
return d->constraint;
|
||||
}
|
||||
|
||||
void AppletChain::setConstraint(Plasma::AppletConstraint constraint)
|
||||
{
|
||||
if (d->constraint == constraint)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
d->constraint = constraint;
|
||||
|
||||
foreach (Applet* applet, d->applets)
|
||||
{
|
||||
applet->constraintsUpdated();
|
||||
}
|
||||
}
|
||||
|
||||
void AppletChain::setXineramaScreen(int screen)
|
||||
{
|
||||
if (screen < 0 || screen > qApp->desktop()->numScreens() - 1)
|
||||
{
|
||||
kDebug() << "tried to set a bad screen for AppletChain" << endl;
|
||||
return;
|
||||
}
|
||||
|
||||
d->screen = screen;
|
||||
}
|
||||
|
||||
void AppletChain::loadApplet(KService::Ptr)
|
||||
{
|
||||
//TODO: load the buggers from a KService pointer!
|
||||
}
|
||||
|
||||
void AppletChain::addApplet(Plasma::Applet* applet)
|
||||
{
|
||||
d->applets.append(applet);
|
||||
emit appletAdded(applet);
|
||||
}
|
||||
|
||||
int AppletChain::xineramaScreen()
|
||||
{
|
||||
return d->screen;
|
||||
}
|
||||
|
||||
void AppletChain::setScreenEdge(Plasma::ScreenEdge edge)
|
||||
{
|
||||
d->screenEdge = edge;
|
||||
}
|
||||
|
||||
Plasma::ScreenEdge AppletChain::screenEdge()
|
||||
{
|
||||
return d->screenEdge;
|
||||
}
|
||||
|
||||
Plasma::Direction AppletChain::popupDirection() const
|
||||
{
|
||||
return Plasma::edgeToPopupDirection(d->screenEdge);
|
||||
}
|
||||
|
||||
} // Plasma namespace
|
||||
|
||||
#include "appletChain.moc"
|
@ -1,69 +0,0 @@
|
||||
/*
|
||||
* Copyright (C) 2005 by Aaron Seigo <aseigo@kde.org>
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU Library General Public License version 2 as
|
||||
* published by the Free Software Foundation
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details
|
||||
*
|
||||
* You should have received a copy of the GNU Library General Public
|
||||
* License along with this program; if not, write to the
|
||||
* Free Software Foundation, Inc.,
|
||||
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
||||
*/
|
||||
|
||||
#ifndef PLASMA_APPLETCHAIN_H
|
||||
#define PLASMA_APPLETCHAIN_H
|
||||
|
||||
#include <ksharedptr.h>
|
||||
|
||||
#include "plasma.h"
|
||||
|
||||
namespace Plasma
|
||||
{
|
||||
|
||||
class Applet;
|
||||
|
||||
class KDE_EXPORT AppletChain : public QObject, public KShared
|
||||
{
|
||||
Q_OBJECT
|
||||
Q_PROPERTY(AppletConstraint constraint READ constraint WRITE setConstraint)
|
||||
Q_PROPERTY(ScreenEdge screenEdge READ screenEdge WRITE setScreenEdge)
|
||||
Q_PROPERTY(int XineramaScreen READ screenEdge WRITE setXineramaScreen)
|
||||
|
||||
public:
|
||||
typedef KSharedPtr<AppletChain> Ptr;
|
||||
|
||||
AppletChain(QObject* parent);
|
||||
~AppletChain();
|
||||
|
||||
Plasma::AppletConstraint constraint();
|
||||
void setConstraint(Plasma::AppletConstraint constraint);
|
||||
Plasma::Direction popupDirection() const;
|
||||
|
||||
Plasma::ScreenEdge screenEdge();
|
||||
void setScreenEdge(Plasma::ScreenEdge edge);
|
||||
|
||||
int xineramaScreen();
|
||||
void setXineramaScreen(int screen);
|
||||
|
||||
public Q_SLOTS:
|
||||
void loadApplet(KService::Ptr);
|
||||
void addApplet(Plasma::Applet*);
|
||||
|
||||
Q_SIGNALS:
|
||||
void appletAdded(Applet*);
|
||||
void appletRemoved(Applet*);
|
||||
|
||||
private:
|
||||
class Private;
|
||||
Private* d;
|
||||
};
|
||||
|
||||
} // Plasma namespace
|
||||
|
||||
#endif // multiple inclusion guard
|
Loading…
Reference in New Issue
Block a user