New Plasma Export: org.kde.plasma.extras

Provides functionality beyond PlasmaComponent's API, currently just a
Title.
This commit is contained in:
Sebastian Kügler 2012-03-15 19:57:43 +01:00
parent c67938106b
commit 4b9a633c73
6 changed files with 179 additions and 1 deletions

View File

@ -3,4 +3,5 @@ add_subdirectory(draganddrop)
add_subdirectory(graphicslayouts)
add_subdirectory(graphicswidgets)
add_subdirectory(qtextracomponents)
add_subdirectory(plasmacomponents)
add_subdirectory(plasmacomponents)
add_subdirectory(plasmaextracomponents)

View File

@ -0,0 +1,36 @@
project(plasmaextracomponents)
set(plasmaextracomponents_SRCS
#../core/declarativeitemcontainer.cpp
plasmaextracomponentsplugin.cpp
)
INCLUDE_DIRECTORIES(
${CMAKE_SOURCE_DIR}
${CMAKE_BINARY_DIR}
${KDE4_INCLUDES}
)
qt4_automoc(${plasmaextracomponents_SRCS})
add_library(plasmaextracomponentsplugin SHARED ${plasmaextracomponents_SRCS})
target_link_libraries(plasmaextracomponentsplugin ${QT_QTCORE_LIBRARY} ${QT_QTDECLARATIVE_LIBRARY} ${QT_QTGUI_LIBRARY} ${KDE4_KDEUI_LIBRARY} ${KDE4_PLASMA_LIBS})
install(TARGETS plasmaextracomponentsplugin DESTINATION ${IMPORTS_INSTALL_DIR}/org/kde/plasma/extras)
install(DIRECTORY qml/ DESTINATION ${IMPORTS_INSTALL_DIR}/org/kde/plasma/extras)
# The platform specific stuff, overwrites a copy of the desktop one
# it does install some files on top of the old ones, has to be done
# file by file since if some component from the generic set is more
# recent than the specifc ones, it wouldn't be overwritten
install(TARGETS plasmaextracomponentsplugin DESTINATION ${PLUGIN_INSTALL_DIR}/platformimports/touch/org/kde/plasma/extras)
install(FILES qml/Title.qml DESTINATION ${PLUGIN_INSTALL_DIR}/platformimports/touch/org/kde/plasma/extras)
#install platform overrides
install(DIRECTORY platformcomponents/touch/ DESTINATION ${PLUGIN_INSTALL_DIR}/platformimports/touch/org/kde/plasma/extras)

View File

@ -0,0 +1,48 @@
/*
* Copyright 2011 by Marco Martin <mart@kde.org>
* Copyright 2012 by Sebastian Kügler <sebas@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 as
* published by the Free Software Foundation; either version 2, or
* (at your option) any later version.
*
* 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 "plasmaextracomponentsplugin.h"
#include <QtDeclarative/qdeclarative.h>
#include <QtDeclarative/QDeclarativeEngine>
#include <QtDeclarative/QDeclarativeContext>
#include <QtDeclarative/QDeclarativeItem>
#include <KSharedConfig>
#include <KConfigGroup>
#include <KDebug>
void PlasmaExtraComponentsPlugin::registerTypes(const char *uri)
{
Q_ASSERT(uri == QLatin1String("org.kde.plasma.extras"));
QString componentsPlatform = getenv("KDE_PLASMA_COMPONENTS_PLATFORM");
if (componentsPlatform.isEmpty()) {
KConfigGroup cg(KSharedConfig::openConfig("kdeclarativerc"), "Components-platform");
componentsPlatform = cg.readEntry("name", "desktop");
}
// Register types...
}
#include "plasmaextracomponentsplugin.moc"

View File

@ -0,0 +1,37 @@
/*
* Copyright 2011 by Marco Martin <mart@kde.org>
* Copyright 2012 by Sebastian Kügler <sebas@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 as
* published by the Free Software Foundation; either version 2, or
* (at your option) any later version.
*
* 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 PLASMAEXTRACOMPONENTSPLUGIN_H
#define PLASMAEXTRACOMPONENTSPLUGIN_H
#include <QDeclarativeExtensionPlugin>
class PlasmaExtraComponentsPlugin : public QDeclarativeExtensionPlugin
{
Q_OBJECT
public:
void registerTypes(const char *uri);
};
Q_EXPORT_PLUGIN2(plasmaexracomponentsplugin, PlasmaExtraComponentsPlugin);
#endif

View File

@ -0,0 +1,53 @@
/*
* Copyright (C) 2011 by Marco Martin <mart@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 as
* published by the Free Software Foundation; either version 2, or
* (at your option) any later version.
*
* 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 Library 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.
*/
/**Documented API
Inherits:
Text
Imports:
QtQuick 1.1
org.kde.plasma.core
Description:
This is a label which uses the plasma theme.
The characteristics of the text will be automatically seted
according to the plasma theme. If you need a more customized
text,then you can use the Text component from QtQuick.
Properties:
string text:
The most important property is "text".
For the other ones see the primitive QML Text element
Methods:
See the primitive QML Text element
Signals:
See the primitive QML Text element
**/
import QtQuick 1.1
import org.kde.plasma.components 0.1
Label {
id: root
font.pointSize: theme.defaultFont.pointSize*2
}

View File

@ -0,0 +1,3 @@
plugin plasmaextracomponentsplugin
Title 0.1 Title.qml