Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Changes: Separating the lock screen to an application extension, part 1

RevBy: TrustMe
  • Loading branch information...
commit 78812a62dc9f78f5c09c3f873296e5c3d8c0b3f9 1 parent 10398a3
Vesa Halttunen authored
Showing with 2,138 additions and 1,489 deletions.
  1. +0 −9 .gitignore
  2. +14 −1 debian/.gitignore
  3. +5 −0 debian/control
  4. +4 −0 debian/system-ui-screenlock.install
  5. +0 −2  demos/plugins/call/call.pro
  6. +3 −1 demos/plugins/call/callplugin.cpp
  7. +0 −8 demos/plugins/check.pri
  8. +0 −2  demos/plugins/profile/profile.pro
  9. +3 −1 demos/plugins/profile/profileplugin.cpp
  10. +2 −0  src/extensions/extensions.pro
  11. +1 −1  src/{systemui/lockscreen → extensions/screenlock}/date.cpp
  12. +3 −0  src/{systemui/lockscreen → extensions/screenlock}/date.h
  13. 0  src/{systemui/lockscreen → extensions/screenlock}/datestyle.h
  14. +2 −4 src/{systemui/lockscreen → extensions/screenlock}/lockscreen.cpp
  15. +2 −2 src/{systemui/lockscreen → extensions/screenlock}/lockscreen.h
  16. 0  src/{systemui/lockscreen → extensions/screenlock}/lockscreenheaderstyle.h
  17. 0  src/{systemui/lockscreen → extensions/screenlock}/lockscreenheaderview.cpp
  18. 0  src/{systemui/lockscreen → extensions/screenlock}/lockscreenheaderview.h
  19. 0  src/{systemui/lockscreen → extensions/screenlock}/lockscreenheaderwithpadlockstyle.h
  20. 0  src/{systemui/lockscreen → extensions/screenlock}/lockscreenheaderwithpadlockview.cpp
  21. 0  src/{systemui/lockscreen → extensions/screenlock}/lockscreenheaderwithpadlockview.h
  22. 0  src/{systemui/lockscreen → extensions/screenlock}/lockscreenstatusareastyle.h
  23. +2 −1  src/{systemui/lockscreen → extensions/screenlock}/lockscreenstatusareaview.cpp
  24. 0  src/{systemui/lockscreen → extensions/screenlock}/lockscreenstatusareaview.h
  25. +36 −0 src/extensions/screenlock/lockscreenstyle.h
  26. +4 −4 src/{systemui/lockscreen → extensions/screenlock}/lockscreenview.cpp
  27. +8 −7 src/{systemui/lockscreen → extensions/screenlock}/lockscreenview.h
  28. +3 −1 src/{systemui/lockscreen → extensions/screenlock}/lockscreenwithoutpadlockview.cpp
  29. +3 −4 src/{systemui/lockscreen → extensions/screenlock}/lockscreenwithoutpadlockview.h
  30. +2 −3 src/{systemui/lockscreen → extensions/screenlock}/lockscreenwithpadlockview.cpp
  31. +3 −4 src/{systemui/lockscreen → extensions/screenlock}/lockscreenwithpadlockview.h
  32. +50 −0 src/extensions/screenlock/screenlock.pri
  33. +110 −0 src/extensions/screenlock/screenlock.pro
  34. +56 −0 src/extensions/screenlock/screenlockextension.cpp
  35. +48 −0 src/extensions/screenlock/screenlockextension.h
  36. +7 −0 src/extensions/screenlock/sysuid-screenlock.desktop
  37. +57 −0 src/extensions/screenlock/themes/libsysuid-screenlock.conf
  38. +262 −0 src/extensions/screenlock/themes/style/libsysuid-screenlock.css
  39. +13 −0 src/extensions/screenlock/themes/style/style.pro
  40. +23 −0 src/extensions/screenlock/themes/themes.pro
  41. 0  src/{systemui/lockscreen → extensions/screenlock}/unlockarea.cpp
  42. 0  src/{systemui/lockscreen → extensions/screenlock}/unlockarea.h
  43. 0  src/{systemui/lockscreen → extensions/screenlock}/unlockmissedevents.cpp
  44. 0  src/{systemui/lockscreen → extensions/screenlock}/unlockmissedevents.h
  45. 0  src/{systemui/lockscreen → extensions/screenlock}/unlocknotifications.cpp
  46. 0  src/{systemui/lockscreen → extensions/screenlock}/unlocknotifications.h
  47. 0  src/{systemui/lockscreen → extensions/screenlock}/unlocknotificationsink.cpp
  48. 0  src/{systemui/lockscreen → extensions/screenlock}/unlocknotificationsink.h
  49. +0 −52 src/libnotificationsystem/notifications.pro
  50. +2 −1  src/src.pro
  51. +0 −50 src/systemui/lockscreen/lockscreen.pri
  52. +0 −95 src/systemui/lockscreen/lockscreenwindow.cpp
  53. +2 −0  src/systemui/main.cpp
  54. +0 −2  src/systemui/notifications/notifications.pri
  55. 0  src/systemui/{lockscreen → screenlock}/eventeater.cpp
  56. 0  src/systemui/{lockscreen → screenlock}/eventeater.h
  57. +17 −0 src/systemui/screenlock/screenlock.pri
  58. +27 −27 src/systemui/{lockscreen/lockscreenbusinesslogic.cpp → screenlock/screenlockbusinesslogic.cpp}
  59. +7 −7 src/systemui/{lockscreen/lockscreenbusinesslogic.h → screenlock/screenlockbusinesslogic.h}
  60. +12 −15 ...stemui/{lockscreen/lockscreenbusinesslogicadaptor.cpp → screenlock/screenlockbusinesslogicadaptor.cpp}
  61. +9 −13 src/systemui/{lockscreen/lockscreenbusinesslogicadaptor.h → screenlock/screenlockbusinesslogicadaptor.h}
  62. +50 −0 src/systemui/screenlock/screenlockextensioninterface.h
  63. +132 −0 src/systemui/screenlock/screenlockwindow.cpp
  64. +34 −8 src/systemui/{lockscreen/lockscreenwindow.h → screenlock/screenlockwindow.h}
  65. +6 −6 src/systemui/{lockscreen/lockscreenwindowstyle.h → screenlock/screenlockwindowstyle.h}
  66. 0  src/systemui/{notifications → statusarea}/notificationstatusindicator.cpp
  67. 0  src/systemui/{notifications → statusarea}/notificationstatusindicator.h
  68. +2 −0  src/systemui/statusarea/statusarea.pri
  69. +2 −0  src/systemui/statusarea/statusareaview.cpp
  70. +2 −1  src/systemui/statusarea/statusareaview.h
  71. +0 −2  src/systemui/statusarea/statusindicator.cpp
  72. +12 −10 src/systemui/statusindicatormenu/notificationarea.cpp
  73. +8 −1 src/systemui/statusindicatormenu/notificationarea.h
  74. +2 −0  src/systemui/statusindicatormenu/statusindicatormenudropdownview.cpp
  75. +1 −1  src/systemui/systemui.pro
  76. +3 −19 src/systemui/sysuid.cpp
  77. +7 −7 src/systemui/sysuidrequest.cpp
  78. +4 −4 src/systemui/sysuidrequest.h
  79. +17 −17 tests/ft_lockscreenbusinesslogic/ft_lockscreenbusinesslogic.cpp
  80. +2 −2 tests/ft_lockscreenbusinesslogic/ft_lockscreenbusinesslogic.h
  81. +17 −17 tests/ft_lockscreenbusinesslogic/ft_lockscreenbusinesslogic.pro
  82. +2 −2 tests/ft_lockscreenui/ft_lockscreenui.cpp
  83. +2 −2 tests/ft_lockscreenui/ft_lockscreenui.h
  84. +17 −17 tests/ft_lockscreenui/ft_lockscreenui.pro
  85. +0 −93 tests/stubs/lockscreenbusinesslogic_stub.cpp
  86. +0 −34 tests/stubs/lockscreenbusinesslogic_stub.h
  87. +31 −21 tests/stubs/lockscreenwindow_stub.h
  88. +17 −4 tests/stubs/notificationarea_stub.h
  89. +114 −0 tests/stubs/screenlockbusinesslogic_stub.h
  90. +6 −6 tests/stubs/sysuidrequest_stub.h
  91. +5 −5 tests/ut_date/ut_date.pro
  92. +3 −3 tests/ut_eventeater/ut_eventeater.pro
  93. +3 −3 tests/ut_lockscreen/ut_lockscreen.pro
  94. +16 −17 tests/ut_lockscreenbusinesslogic/ut_lockscreenbusinesslogic.cpp
  95. +5 −6 tests/ut_lockscreenbusinesslogic/ut_lockscreenbusinesslogic.pro
  96. +23 −23 tests/ut_lockscreenbusinesslogicadaptor/ut_lockscreenbusinesslogicadaptor.cpp
  97. +5 −6 tests/ut_lockscreenbusinesslogicadaptor/ut_lockscreenbusinesslogicadaptor.h
  98. +5 −5 tests/ut_lockscreenbusinesslogicadaptor/ut_lockscreenbusinesslogicadaptor.pro
  99. +6 −7 tests/ut_lockscreenstatusareaview/ut_lockscreenstatusareaview.pro
  100. +1 −1  tests/ut_lockscreenview/ut_lockscreenview.cpp
  101. +1 −1  tests/ut_lockscreenview/ut_lockscreenview.h
  102. +3 −3 tests/ut_lockscreenview/ut_lockscreenview.pro
  103. +11 −8 tests/ut_lockscreenwindow/ut_lockscreenwindow.cpp
  104. +2 −3 tests/ut_lockscreenwindow/ut_lockscreenwindow.h
  105. +5 −6 tests/ut_lockscreenwindow/ut_lockscreenwindow.pro
  106. +6 −6 tests/ut_lockscreenwithoutpadlockview/ut_lockscreenwithoutpadlockview.pro
  107. +8 −8 tests/ut_lockscreenwithpadlockview/ut_lockscreenwithpadlockview.pro
  108. +2 −2 tests/ut_notificationstatusindicator/ut_notificationstatusindicator.pro
  109. +1 −0  tests/ut_statusareaview/ut_statusareaview.cpp
  110. +3 −3 tests/ut_statusareaview/ut_statusareaview.pro
  111. +0 −2  tests/ut_statusindicator/ut_statusindicator.cpp
  112. +1 −2  tests/ut_statusindicator/ut_statusindicator.pro
  113. +2 −1  tests/ut_statusindicatormenudropdownview/ut_statusindicatormenudropdownview.cpp
  114. +2 −1  tests/ut_statusindicatormenudropdownview/ut_statusindicatormenudropdownview.pro
  115. +1 −0  tests/ut_statusindicatormenuwindow/ut_statusindicatormenuwindow.cpp
  116. +1 −0  tests/ut_statusindicatormenuwindow/ut_statusindicatormenuwindow.pro
  117. +14 −14 tests/ut_sysuid/ut_sysuid.pro
  118. +3 −3 tests/ut_unlockarea/ut_unlockarea.pro
  119. +3 −3 tests/ut_unlockmissedevents/ut_unlockmissedevents.pro
  120. +4 −4 tests/ut_unlocknotifications/ut_unlocknotifications.pro
  121. +4 −4 tests/ut_unlocknotificationsink/ut_unlocknotificationsink.pro
  122. +4 −748 themes/style/default.css
  123. +57 −0 themes/style/notificationarea.css
  124. +35 −0 themes/style/screenlock.css
  125. +512 −0 themes/style/statusarea.css
  126. +89 −0 themes/style/statusindicatormenu.css
View
9 .gitignore
@@ -20,15 +20,6 @@ lib
.cproject
core
doc/html
-debian/system-ui
-debian/system-ui-dbg*
-debian/system-ui-dev*
-debian/system-ui-doc*
-debian/system-ui-tests*
-debian/systemui-l10n-engineering-english*
-debian/files
-debian/tmp
-debian/system-ui.substvars
build-stamp
configure-stamp
localconfig.pri
View
15 debian/.gitignore
@@ -1 +1,14 @@
-libnotificationsystem*
+system-ui
+system-ui-dbg
+system-ui-dev
+system-ui-doc
+system-ui-tests
+systemui-l10n-engineering-english
+libnotificationsystem0
+libnotificationsystem-dev
+files
+tmp
+system-ui-screenlock
+*.substvars
+*.log
+*.debhelper
View
5 debian/control
@@ -78,3 +78,8 @@ Section: devel
Architecture: all
Description: Engineering English translations for system-ui daemon.
+Package: system-ui-screenlock
+Architecture: any
+Section: libs
+Depends: ${shlibs:Depends}
+Description: Screen lock extension for system-ui
View
4 debian/system-ui-screenlock.install
@@ -0,0 +1,4 @@
+usr/share/themes/base/meegotouch/libsysuid-screenlock/style/*.css
+usr/share/themes/base/meegotouch/libsysuid-screenlock/*.conf
+usr/lib/meegotouch/applicationextensions/libsysuid-screenlock.so
+usr/share/meegotouch/applicationextensions/sysuid-screenlock.desktop
View
2  demos/plugins/call/call.pro
@@ -28,5 +28,3 @@ desktop_entry.files = *.desktop
INSTALLS += \
target \
desktop_entry
-
-include(../check.pri)
View
4 demos/plugins/call/callplugin.cpp
@@ -17,12 +17,12 @@
**
****************************************************************************/
+#include <MLibrary>
#include "callplugin.h"
#include "call.h"
Q_EXPORT_PLUGIN2(call, CallPlugin)
-
CallPlugin::CallPlugin() : statusIndicatorMenu(0), call(0)
{
}
@@ -49,3 +49,5 @@ QGraphicsWidget *CallPlugin::widget()
{
return call;
}
+
+M_LIBRARY
View
8 demos/plugins/check.pri
@@ -1,8 +0,0 @@
-QMAKE_EXTRA_TARGETS += check
-# check.depends = $$QMAKE_TARGET
-check.commands = $$system(true)
-
-QMAKE_EXTRA_TARGETS += check-xml
-# check-xml.depends = $$QMAKE_TARGET
-check-xml.commands = $$system(true)
-
View
2  demos/plugins/profile/profile.pro
@@ -28,5 +28,3 @@ desktop_entry.files = *.desktop
INSTALLS += \
target \
desktop_entry
-
-include(../check.pri)
View
4 demos/plugins/profile/profileplugin.cpp
@@ -17,12 +17,12 @@
**
****************************************************************************/
+#include <MLibrary>
#include "profileplugin.h"
#include "profile.h"
Q_EXPORT_PLUGIN2(profile, ProfilePlugin)
-
ProfilePlugin::ProfilePlugin() : statusIndicatorMenu(0), profile(0)
{
}
@@ -49,3 +49,5 @@ QGraphicsWidget *ProfilePlugin::widget()
{
return profile;
}
+
+M_LIBRARY
View
2  src/extensions/extensions.pro
@@ -0,0 +1,2 @@
+TEMPLATE = subdirs
+SUBDIRS = screenlock screenlock/themes
View
2  src/systemui/lockscreen/date.cpp → src/extensions/screenlock/date.cpp
@@ -62,6 +62,7 @@ void Date::applyStyle()
MStylableWidget::applyStyle();
label->setAlignment(style()->horizontalAlign());
+ dateFormat = style()->dateFormat();
updateDate();
}
@@ -69,7 +70,6 @@ void Date::updateDate()
{
// Set current time in the labels
QDateTime currentTime = QDateTime::currentDateTime();
- QString dateFormat = style()->dateFormat();
if (dateFormat.isEmpty()) {
label->setText(locale->formatDateTime(currentTime, MLocale::DateFull, MLocale::TimeNone));
} else {
View
3  src/systemui/lockscreen/date.h → src/extensions/screenlock/date.h
@@ -76,6 +76,9 @@ private slots:
//! Update timer
QTimer timer;
+ //! Date format string
+ QString dateFormat;
+
#ifdef HAVE_QMSYSTEM
//! QmTime object for listening date changes
MeeGo::QmTime qmTime;
View
0  src/systemui/lockscreen/datestyle.h → src/extensions/screenlock/datestyle.h
File renamed without changes
View
6 src/systemui/lockscreen/lockscreen.cpp → src/extensions/screenlock/lockscreen.cpp
@@ -19,9 +19,8 @@
#include "lockscreen.h"
LockScreen::LockScreen(QGraphicsItem *parent) :
- MSceneWindow(parent),
+ MWidgetController(parent),
displayOn(true)
-
{
connect(this, SIGNAL(displayExited()), this, SLOT(sliderUnlocked()));
@@ -46,8 +45,7 @@ void LockScreen::updateDisplayState(MeeGo::QmDisplayState::DisplayState state)
void LockScreen::sliderUnlocked()
{
- if(displayOn)
- {
+ if(displayOn) {
emit unlocked();
}
}
View
4 src/systemui/lockscreen/lockscreen.h → src/extensions/screenlock/lockscreen.h
@@ -19,13 +19,13 @@
#ifndef LOCKSCREEN_H
#define LOCKSCREEN_H
-#include <MSceneWindow>
+#include <MWidgetController>
#ifdef HAVE_QMSYSTEM
#include <qmdisplaystate.h>
#endif
-class LockScreen : public MSceneWindow
+class LockScreen : public MWidgetController
{
Q_OBJECT
View
0  src/systemui/lockscreen/lockscreenheaderstyle.h → src/extensions/screenlock/lockscreenheaderstyle.h
File renamed without changes
View
0  src/systemui/lockscreen/lockscreenheaderview.cpp → src/extensions/screenlock/lockscreenheaderview.cpp
File renamed without changes
View
0  src/systemui/lockscreen/lockscreenheaderview.h → src/extensions/screenlock/lockscreenheaderview.h
File renamed without changes
View
0  ...mui/lockscreen/lockscreenheaderwithpadlockstyle.h → ...ons/screenlock/lockscreenheaderwithpadlockstyle.h
File renamed without changes
View
0  ...ui/lockscreen/lockscreenheaderwithpadlockview.cpp → ...ns/screenlock/lockscreenheaderwithpadlockview.cpp
File renamed without changes
View
0  ...emui/lockscreen/lockscreenheaderwithpadlockview.h → ...ions/screenlock/lockscreenheaderwithpadlockview.h
File renamed without changes
View
0  src/systemui/lockscreen/lockscreenstatusareastyle.h → ...extensions/screenlock/lockscreenstatusareastyle.h
File renamed without changes
View
3  src/systemui/lockscreen/lockscreenstatusareaview.cpp → ...xtensions/screenlock/lockscreenstatusareaview.cpp
@@ -52,7 +52,8 @@ LockScreenStatusAreaView::LockScreenStatusAreaView(StatusArea *controller) :
connect(phoneNetworkTypeIndicator, SIGNAL(networkAvailabilityChanged(bool)), phoneSignalStrengthIndicator, SLOT(setDisplay(bool)));
// Connect notification signals
- connect(&Sysuid::instance()->notifierNotificationSink(), SIGNAL(notifierSinkActive(bool)), notifierIndicator, SLOT(setActive(bool)));
+ // TODO
+ //connect(&Sysuid::instance()->notifierNotificationSink(), SIGNAL(notifierSinkActive(bool)), notifierIndicator, SLOT(setActive(bool)));
// Put indicators into the layout
QGraphicsLinearLayout *layout = new QGraphicsLinearLayout(Qt::Horizontal);
View
0  src/systemui/lockscreen/lockscreenstatusareaview.h → src/extensions/screenlock/lockscreenstatusareaview.h
File renamed without changes
View
36 src/extensions/screenlock/lockscreenstyle.h
@@ -0,0 +1,36 @@
+/****************************************************************************
+**
+** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (directui@nokia.com)
+**
+** This file is part of systemui.
+**
+** If you have questions regarding the use of this file, please contact
+** Nokia at directui@nokia.com.
+**
+** This library is free software; you can redistribute it and/or
+** modify it under the terms of the GNU Lesser General Public
+** License version 2.1 as published by the Free Software Foundation
+** and appearing in the file LICENSE.LGPL included in the packaging
+** of this file.
+**
+****************************************************************************/
+
+#ifndef LOCKSCREENSTYLE_H
+#define LOCKSCREENSTYLE_H
+
+#include <mwidgetstyle.h>
+
+class LockScreenStyle : public MWidgetStyle
+{
+ Q_OBJECT
+ M_STYLE(LockScreenStyle)
+};
+
+class LockScreenStyleContainer : public MWidgetStyleContainer
+{
+ M_STYLE_CONTAINER(LockScreenStyle)
+};
+
+#endif
View
8 src/systemui/lockscreen/lockscreenview.cpp → src/extensions/screenlock/lockscreenview.cpp
@@ -17,11 +17,11 @@
**
****************************************************************************/
#include <QGraphicsLinearLayout>
-#include "lockscreenview.h"
#include <MGConfItem>
#include <MViewCreator>
#include <MSceneManager>
#include "lockscreen.h"
+#include "lockscreenview.h"
const QString GCONF_KEY_LANDSCAPE = "/desktop/meego/background/landscape/picture_filename";
const QString GCONF_KEY_PORTRAIT = "/desktop/meego/background/portrait/picture_filename";
@@ -76,10 +76,10 @@ void LockScreenBackgroundPixmap::destroyPixmap()
}
}
-LockScreenView::LockScreenView(MSceneWindow* controller) : MSceneWindowView(controller),
+LockScreenView::LockScreenView(MWidgetController* controller) : MWidgetView(controller),
+ controller(controller),
layout(new QGraphicsLinearLayout(Qt::Vertical)),
lockScreenHeader(new MWidgetController),
- controller(controller),
landscapePixmap(GCONF_KEY_LANDSCAPE),
portraitPixmap(GCONF_KEY_PORTRAIT)
{
@@ -109,7 +109,7 @@ void LockScreenView::drawBackground(QPainter *painter, const QStyleOptionGraphic
if (pixmap == NULL || pixmap->isNull()) {
// If no specific pixmap has been loaded or the pixmap is not valid, use the default
- MSceneWindowView::drawBackground(painter, option);
+ MWidgetView::drawBackground(painter, option);
} else {
// Otherwise draw the specific pixmap
painter->drawPixmap(QRectF(QPointF(), controller->geometry().size()), *pixmap, QRectF(0, 0, pixmap->width(), pixmap->height()));
View
15 src/systemui/lockscreen/lockscreenview.h → src/extensions/screenlock/lockscreenview.h
@@ -19,7 +19,8 @@
#ifndef LOCKSCREENVIEW_H
#define LOCKSCREENVIEW_H
-#include <mscenewindowview.h>
+#include <MWidgetView>
+#include "lockscreenstyle.h"
class QGraphicsLinearLayout;
class MGConfItem;
@@ -74,10 +75,10 @@ private slots:
/*!
* LockScreenView renders the background image of the lock screen.
*/
-class LockScreenView : public MSceneWindowView
+class LockScreenView : public MWidgetView
{
Q_OBJECT
- M_VIEW(MSceneWindowModel, MSceneWindowStyle)
+ M_VIEW(MWidgetModel, LockScreenStyle)
public:
/*!
@@ -85,7 +86,7 @@ class LockScreenView : public MSceneWindowView
*
* \param controller controller for the view
*/
- LockScreenView(MSceneWindow* controller);
+ LockScreenView(MWidgetController* controller);
/*!
* Destroys the lock screen view.
@@ -97,6 +98,9 @@ class LockScreenView : public MSceneWindowView
virtual void drawBackground(QPainter *painter, const QStyleOptionGraphicsItem *option) const;
//! \reimp_end
+ //! Controller for the view
+ MWidgetController *controller;
+
//! Layout for the view
QGraphicsLinearLayout *layout;
@@ -108,9 +112,6 @@ private slots:
void updateStyleName();
private:
- //! Controller for the view
- MSceneWindow *controller;
-
//! Data for the landscape pixmap
LockScreenBackgroundPixmap landscapePixmap;
View
4 ...temui/lockscreen/lockscreenwithoutpadlockview.cpp → ...sions/screenlock/lockscreenwithoutpadlockview.cpp
@@ -22,12 +22,14 @@
#include "lockscreen.h"
#include "notificationarea.h"
-LockScreenWithoutPadlockView::LockScreenWithoutPadlockView(MSceneWindow* controller) :
+LockScreenWithoutPadlockView::LockScreenWithoutPadlockView(MWidgetController* controller) :
LockScreenView(controller)
{
notificationArea = new NotificationArea(controller, false);
notificationArea->setObjectName("LockScreenNotificationArea");
notificationArea->setHonorPrivacySetting(true);
+ // TODO
+ //notificationArea->setNotificationManager(Sysuid::instance()->notifierNotificationSink());
layout->addStretch();
layout->addItem(notificationArea);
}
View
7 ...ystemui/lockscreen/lockscreenwithoutpadlockview.h → ...ensions/screenlock/lockscreenwithoutpadlockview.h
@@ -26,7 +26,7 @@ class NotificationArea;
class LockScreenWithoutPadlockView : public LockScreenView
{
Q_OBJECT
- M_VIEW(MSceneWindowModel, MSceneWindowStyle)
+ M_VIEW(MWidgetModel, LockScreenStyle)
public:
/*!
@@ -34,15 +34,14 @@ class LockScreenWithoutPadlockView : public LockScreenView
*
* \param controller the controller this is a view for
*/
- LockScreenWithoutPadlockView (MSceneWindow* controller);
+ LockScreenWithoutPadlockView(MWidgetController *controller);
/*!
* \brief Destroys the LockScreenWithoutPadlockView.
*/
- ~LockScreenWithoutPadlockView ();
+ ~LockScreenWithoutPadlockView();
private:
-
//! Notification area
NotificationArea* notificationArea;
};
View
5 ...systemui/lockscreen/lockscreenwithpadlockview.cpp → ...tensions/screenlock/lockscreenwithpadlockview.cpp
@@ -30,15 +30,14 @@
#include "lockscreen.h"
#include "unlockarea.h"
-LockScreenWithPadlockView::LockScreenWithPadlockView(MSceneWindow* controller) :
+LockScreenWithPadlockView::LockScreenWithPadlockView(MWidgetController* controller) :
LockScreenView(controller),
dragAndDropWindow(dynamic_cast<MWindow*>(controller->parent())),
dragAndDropIcon(0),
dragAndDropState(STATE_NONE),
lockLandArea(new UnlockArea),
drawPending(false),
- notificationArea(new UnlockNotifications),
- controller(controller)
+ notificationArea(new UnlockNotifications)
{
lockScreenHeader->setObjectName("LockLiftAreaWithPadlock");
View
7 src/systemui/lockscreen/lockscreenwithpadlockview.h → ...extensions/screenlock/lockscreenwithpadlockview.h
@@ -30,11 +30,11 @@ class UnlockNotifications;
class LockScreenWithPadlockView : public LockScreenView
{
Q_OBJECT
- M_VIEW(MSceneWindowModel, MSceneWindowStyle)
+ M_VIEW(MWidgetModel, LockScreenStyle)
public:
- LockScreenWithPadlockView (MSceneWindow* controller);
- ~LockScreenWithPadlockView ();
+ LockScreenWithPadlockView(MWidgetController *controller);
+ ~LockScreenWithPadlockView();
enum dnd_state {
STATE_NONE = 0,
@@ -72,7 +72,6 @@ private slots:
bool drawPending;
QPointF dragAndDropPosition;
UnlockNotifications *notificationArea;
- MSceneWindow* controller;
#ifdef UNIT_TEST
friend class Ut_LockScreenWithPadlockView;
View
50 src/extensions/screenlock/screenlock.pri
@@ -0,0 +1,50 @@
+include(../../mconfig.pri)
+INCLUDEPATH += screenlock statusarea
+
+STYLE_HEADERS += screenlock/screenlockheaderstyle.h \
+ screenlock/screenlockheaderwithpadlockstyle.h \
+ screenlock/screenlockstatusareastyle.h \
+ screenlock/screenlockwindowstyle.h \
+ screenlock/datestyle.h
+
+HEADERS += \
+ screenlock/screenlockbusinesslogic.h \
+ screenlock/screenlockwindow.h \
+ screenlock/screenlockwindowstyle.h \
+ screenlock/eventeater.h \
+ screenlock/screenlockbusinesslogicadaptor.h \
+ screenlock/unlocknotifications.h \
+ screenlock/unlocknotificationsink.h \
+ screenlock/unlockmissedevents.h \
+ screenlock/unlockarea.h \
+ screenlock/screenlockview.h \
+ screenlock/screenlockwithpadlockview.h \
+ screenlock/screenlockwithoutpadlockview.h \
+ screenlock/screenlock.h \
+ screenlock/screenlockheaderview.h \
+ screenlock/screenlockheaderstyle.h \
+ screenlock/screenlockheaderwithpadlockview.h \
+ screenlock/screenlockheaderwithpadlockstyle.h \
+ screenlock/screenlockstatusareaview.h \
+ screenlock/screenlockstatusareastyle.h \
+ screenlock/date.h \
+ screenlock/datestyle.h
+
+SOURCES += \
+ screenlock/screenlockbusinesslogic.cpp \
+ screenlock/screenlockwindow.cpp \
+ screenlock/eventeater.cpp \
+ screenlock/screenlockbusinesslogicadaptor.cpp \
+ screenlock/unlocknotifications.cpp \
+ screenlock/unlocknotificationsink.cpp \
+ screenlock/unlockmissedevents.cpp \
+ screenlock/unlockarea.cpp \
+ screenlock/screenlockview.cpp \
+ screenlock/screenlockwithpadlockview.cpp \
+ screenlock/screenlockwithoutpadlockview.cpp \
+ screenlock/screenlock.cpp \
+ screenlock/screenlockheaderview.cpp \
+ screenlock/screenlockheaderwithpadlockview.cpp \
+ screenlock/screenlockstatusareaview.cpp \
+ screenlock/date.cpp
+
View
110 src/extensions/screenlock/screenlock.pro
@@ -0,0 +1,110 @@
+MOC_DIR = .moc
+M_MGEN_OUTDIR = .gen
+OBJECTS_DIR = .obj
+
+include(../../../mconfig.pri)
+include(../../../localconfig.pri)
+
+TEMPLATE = lib
+CONFIG += plugin gui meegotouch system-ui link_pkgconfig
+INCLUDEPATH += \
+ ../../libnotificationsystem \
+ ../../systemui/statusindicatormenu \
+ ../../systemui/statusarea \
+ ../../systemui/notifications \
+ ../../systemui/screenlock \
+ ../../systemui
+
+QMAKE_LIBDIR += ../../lib
+LIBS += -lnotificationsystem
+
+STYLE_HEADERS += lockscreenheaderstyle.h \
+ lockscreenheaderwithpadlockstyle.h \
+ lockscreenstatusareastyle.h \
+ lockscreenstyle.h \
+ datestyle.h
+
+HEADERS += \
+ screenlockextension.h \
+ unlocknotifications.h \
+ unlocknotificationsink.h \
+ unlockmissedevents.h \
+ unlockarea.h \
+ lockscreenview.h \
+ lockscreenwithpadlockview.h \
+ lockscreenwithoutpadlockview.h \
+ lockscreenstyle.h \
+ lockscreen.h \
+ lockscreenheaderview.h \
+ lockscreenheaderstyle.h \
+ lockscreenheaderwithpadlockview.h \
+ lockscreenheaderwithpadlockstyle.h \
+ lockscreenstatusareaview.h \
+ lockscreenstatusareastyle.h \
+ date.h \
+ datestyle.h
+
+SOURCES += \
+ screenlockextension.cpp \
+ unlocknotifications.cpp \
+ unlocknotificationsink.cpp \
+ unlockmissedevents.cpp \
+ unlockarea.cpp \
+ lockscreenview.cpp \
+ lockscreenwithpadlockview.cpp \
+ lockscreenwithoutpadlockview.cpp \
+ lockscreen.cpp \
+ lockscreenheaderview.cpp \
+ lockscreenheaderwithpadlockview.cpp \
+ lockscreenstatusareaview.cpp \
+ date.cpp
+
+HEADERS += ../../systemui/contextframeworkcontext.h \
+ ../../systemui/applicationcontext.h \
+ ../../systemui/x11wrapper.h \
+ ../../systemui/statusarea/statusindicator.h \
+ ../../systemui/statusarea/statusindicatormodel.h \
+ ../../systemui/statusarea/clock.h \
+ ../../systemui/statusarea/clockmodel.h \
+ ../../systemui/statusarea/statusarea.h \
+ ../../systemui/statusarea/notificationstatusindicator.h \
+ ../../systemui/statusindicatormenu/notificationarea.h \
+ ../../systemui/statusindicatormenu/notificationareamodel.h \
+ ../../systemui/notifications/notificationareasink.h \
+ ../../systemui/notifications/widgetnotificationsink.h \
+
+SOURCES += ../../systemui/contextframeworkcontext.cpp \
+ ../../systemui/x11wrapper.cpp \
+ ../../systemui/statusarea/statusindicator.cpp \
+ ../../systemui/statusarea/clock.cpp \
+ ../../systemui/statusarea/statusarea.cpp \
+ ../../systemui/statusarea/notificationstatusindicator.cpp \
+ ../../systemui/statusindicatormenu/notificationarea.cpp \
+ ../../systemui/notifications/notificationareasink.cpp \
+ ../../systemui/notifications/widgetnotificationsink.cpp \
+
+MODEL_HEADERS += ../../systemui/statusarea/clockmodel.h \
+ ../../systemui/statusarea/statusindicatormodel.h \
+ ../../systemui/statusindicatormenu/notificationareamodel.h \
+
+TARGET = $$qtLibraryTarget(sysuid-screenlock)
+DESTDIR = ../../../lib
+
+contains(DEFINES, HAVE_CONTEXTSUBSCRIBER) {
+ PKGCONFIG += contextsubscriber-1.0
+}
+
+contains(DEFINES, HAVE_QMSYSTEM) {
+ PKGCONFIG += qmsystem2
+}
+
+PKGCONFIG += xcomposite
+
+target.path += $$M_APPLICATION_EXTENSION_DIR
+
+desktop_entry.path = $$M_APPLICATION_EXTENSION_DATA_DIR
+desktop_entry.files = *.desktop
+
+INSTALLS += \
+ target \
+ desktop_entry
View
56 src/extensions/screenlock/screenlockextension.cpp
@@ -0,0 +1,56 @@
+/****************************************************************************
+**
+** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (directui@nokia.com)
+**
+** This file is part of systemui.
+**
+** If you have questions regarding the use of this file, please contact
+** Nokia at directui@nokia.com.
+**
+** This library is free software; you can redistribute it and/or
+** modify it under the terms of the GNU Lesser General Public
+** License version 2.1 as published by the Free Software Foundation
+** and appearing in the file LICENSE.LGPL included in the packaging
+** of this file.
+**
+****************************************************************************/
+
+#include <MLibrary>
+#include "screenlockextension.h"
+#include "lockscreen.h"
+#include <cstdio>
+
+Q_EXPORT_PLUGIN2(sysuid-screenlock, ScreenLockExtension)
+
+ScreenLockExtension::ScreenLockExtension() : lockScreen(NULL)
+{
+ printf("SCREEN LOCK EXTENSION INITIALIZING\n");
+}
+
+ScreenLockExtension::~ScreenLockExtension()
+{
+ delete lockScreen;
+}
+
+void ScreenLockExtension::reset()
+{
+ if (lockScreen != NULL) {
+ lockScreen->reset();
+ }
+}
+
+bool ScreenLockExtension::initialize(const QString &)
+{
+ lockScreen = new LockScreen;
+
+ return true;
+}
+
+QGraphicsWidget *ScreenLockExtension::widget()
+{
+ return lockScreen;
+}
+
+M_LIBRARY
View
48 src/extensions/screenlock/screenlockextension.h
@@ -0,0 +1,48 @@
+/****************************************************************************
+**
+** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (directui@nokia.com)
+**
+** This file is part of systemui.
+**
+** If you have questions regarding the use of this file, please contact
+** Nokia at directui@nokia.com.
+**
+** This library is free software; you can redistribute it and/or
+** modify it under the terms of the GNU Lesser General Public
+** License version 2.1 as published by the Free Software Foundation
+** and appearing in the file LICENSE.LGPL included in the packaging
+** of this file.
+**
+****************************************************************************/
+
+#ifndef SCREENLOCKEXTENSION_H
+#define SCREENLOCKEXTENSION_H
+
+#include "screenlockextensioninterface.h"
+#include <QObject>
+
+class LockScreen;
+
+class ScreenLockExtension : public QObject, public ScreenLockExtensionInterface
+{
+ Q_OBJECT
+ Q_INTERFACES(ScreenLockExtensionInterface MApplicationExtensionInterface)
+
+public:
+ ScreenLockExtension();
+ virtual ~ScreenLockExtension();
+
+ // Methods derived from ScreenLockExtensionInterface
+ virtual void reset();
+
+ // Methods derived from MApplicationExtensionInterface
+ virtual bool initialize(const QString &interface);
+ virtual QGraphicsWidget *widget();
+
+private:
+ LockScreen *lockScreen;
+};
+
+#endif // SCREENLOCKEXTENSION_H
View
7 src/extensions/screenlock/sysuid-screenlock.desktop
@@ -0,0 +1,7 @@
+[Desktop Entry]
+Type=X-MeeGoApplicationExtension
+Name=Screen Lock Extension
+
+[X-MeeGoApplicationExtension]
+Interface=com.meego.core.ScreenLockExtensionInterface/1.0
+Extension=libsysuid-screenlock.so
View
57 src/extensions/screenlock/themes/libsysuid-screenlock.conf
@@ -0,0 +1,57 @@
+[NotificationArea]
+default = NotificationAreaView
+
+[Clock]
+default = ClockView
+
+[StatusArea]
+default = StatusAreaView
+lockScreen = LockScreenStatusAreaView
+
+[StatusIndicator]
+default = StatusIndicatorIconView
+
+[StatusIndicatorMenu]
+default = StatusIndicatorMenuDropDownView
+
+[ProfileStatusIndicator]
+default = StatusIndicatorLabelView
+
+[PhoneNetworkSignalStrengthStatusIndicator]
+default = StatusIndicatorIconView
+
+[PhoneNetworkTypeStatusIndicator]
+default = StatusIndicatorIconView
+
+[PhoneNetworkStatusIndicator]
+default = StatusIndicatorLabelView
+
+[BatteryStatusIndicator]
+default = StatusIndicatorIconView
+
+[ClockAlarmStatusIndicator]
+default = StatusIndicatorIconView
+
+[BlueToothStatusIndicator]
+default = StatusIndicatorIconView
+
+[GPSStatusIndicator]
+default = StatusIndicatorIconView
+
+[InternetConnectionStatusIndicator]
+default = StatusIndicatorIconView
+
+[InputMethodStatusIndicator]
+default = StatusIndicatorAnimationView
+
+[CallStatusIndicator]
+default = StatusIndicatorIconView
+
+[ProfileStatusIndicator]
+default = StatusIndicatorIconView
+
+[LockScreen]
+default = LockScreenWithPadlockView
+
+[MWidgetController]
+lockScreenHeader = LockScreenHeaderWithPadlockView
View
262 src/extensions/screenlock/themes/style/libsysuid-screenlock.css
@@ -0,0 +1,262 @@
+@import "../../sysuid/style/notificationarea.css";
+@import "../../sysuid/style/statusarea.css";
+
+/* Common view styles */
+LockScreenStyle {
+ background-color: #00ff00;
+ padding-top: 0;
+ padding-bottom: 0;
+ padding-left: 0;
+ padding-right: 0;
+ margin-top: 0;
+ margin-bottom: 0;
+ margin-left: 0;
+ margin-right: 0;
+ minimum-size: 100% 100%;
+ preferred-size: 100% 100%;
+ maximum-size: 100% 100%;
+}
+
+LockScreenStyle#LockScreenWithDefaultBackground.Landscape {
+ background-image: "meegotouch-wallpaper-landscape";
+}
+
+LockScreenStyle#LockScreenWithDefaultBackground.Portrait {
+ background-image: "meegotouch-wallpaper-portrait";
+}
+
+LockScreenStyle#LockScreenWithCustomBackground {
+ background-image: ;
+}
+
+/* Padlock view styles */
+MWidgetStyle#LockMostRecentArea {
+ background-image: "lockscreen-recent-event-area-background" 12 12 12 12;
+ background-opacity: 1.0;
+
+ padding-top: 1.0mm;
+ minimum-size: 100% 7.9mm;
+ preferred-size: 100% 7.9mm;
+ maximum-size: 100% 7.9mm;
+}
+
+MWidgetStyle#LockMostRecentLabel {
+ color: $COLOR_INVERTED_FOREGROUND;
+ font: "Nokia Standard Bold" 28;
+ /* or "Nokia Standard Light" ??? */
+ margin-top: 1.4mm;
+ margin-right: $MARGIN_XLARGE;
+}
+
+MImageWidgetStyle#LockMostRecentIcon {
+ margin-top: 1.2mm;
+ margin-left: 2.9mm;
+ margin-right: $MARGIN_DOUBLE;
+
+ minimum-size: 3.6mm 3.6mm;
+ preferred-size: 3.6mm 3.6mm;
+ maximum-size: 3.6mm 3.6mm;
+}
+
+MWidgetStyle#LockOtherEventsArea {
+ background-image: "lockscreen-notification-area-background" 12 12 12 12;
+ background-opacity: 1.0;
+
+ padding-top: 0.5mm;
+ minimum-size: 100% 4.9mm;
+ maximum-size: 100% 7mm;
+}
+
+MImageWidgetStyle#LockNotifierIcon {
+ margin-top: 1.2mm;
+ margin-left: 2.9mm;
+
+ minimum-size: 3.6mm 3.6mm;
+ preferred-size: 3.6mm 3.6mm;
+ maximum-size: 3.6mm 3.6mm;
+}
+
+MLabelStyle#LockNotifierLabel {
+ color: $COLOR_INVERTED_FOREGROUND;
+ font: "Nokia Standard Light" 28;
+
+ margin-top: 1.4mm;
+ margin-left: $MARGIN_LARGE;
+ margin-right: $MARGIN_DOUBLE;
+}
+
+LockScreenHeaderWithPadlockStyle {
+ background-image: "lockscreen-lock-lift-area-background" 0 380 0 0;
+ background-opacity: 0.9;
+
+ minimum-size: 100% 14mm;
+ preferred-size: 100% 14mm;
+ maximum-size: 100% 14mm;
+
+ padlock-visible: false;
+}
+
+LockScreenHeaderWithPadlockStyle#LockLiftAreaWithPadlock {
+ padlock-visible: true;
+}
+
+#lockscreenTimeLabel {
+ margin-top: 2mm;
+ margin-left: 2mm;
+
+ color: white;
+ font: "Nokia Standard Light" 81;
+}
+
+#lockscreenDateLabel {
+ margin-left: 2mm;
+
+ color: white;
+ font: "Nokia Standard Light" 20;
+}
+
+MImageWidgetStyle#lockscreenIconLocked {
+ background-image: "lockscreen-lock";
+ background-opacity: 1.0;
+
+ margin-right: 2mm;
+ margin-top: 2mm;
+
+ preferred-size: 10mm 10mm;
+ minimum-size: 10mm 10mm;
+ maximum-size: 10mm 10mm;
+}
+
+MWidgetStyle#LockLandArea {
+ background-image: none;
+
+ minimum-size: 100% 100;
+}
+
+MWidgetStyle#LockLandAreaDragged {
+ background-image: "lockscreen-lock-land-area-background-dragged" 25 25 25 25;
+
+ minimum-size: 100% 100;
+}
+
+MWidgetStyle#LockLandAreaActive {
+ background-image: "lockscreen-lock-land-area-background-active" 25 25 25 25;
+
+ minimum-size: 100% 100;
+}
+
+#LockScreenDnDIcon {
+ background-image: "lockscreen-lock";
+ background-opacity: 1.0;
+
+ minimum-size: 13.8mm 13.8mm;
+ preferred-size: 13.8mm 13.8mm;
+ maximum-size: 13.8mm 13.8mm;
+}
+
+#LockScreenDnDIconActive {
+ background-image: "lockscreen-lock-active";
+ background-opacity: 1.0;
+
+ minimum-size: 13.8mm 13.8mm;
+ preferred-size: 13.8mm 13.8mm;
+ maximum-size: 13.8mm 13.8mm;
+}
+
+MImageWidgetStyle#LockScreenUnlockIcon {
+ background-image: "lockscreen-lock-land-area-center-background";
+ background-opacity: 1.0;
+
+ preferred-size: 10mm 10mm;
+ minimum-size: 10mm 10mm;
+ maximum-size: 10mm 10mm;
+}
+
+MAbstractLayoutPolicyStyle#NotificationAreaBannerLayoutPolicy {
+ vertical-spacing: 0.8mm;
+ margin-left: 0.8mm;
+ margin-right: 0.8mm;
+ margin-bottom: 0.8mm;
+}
+
+NotificationArea#LockScreenNotificationArea MBannerStyle {
+ minimum-size: 0 0;
+}
+
+/* Padlockless view styles */
+LockScreenHeaderStyle {
+ background-color: #00ff00;
+ minimum-size: 100% -1;
+ preferred-size: 100% -1;
+ maximum-size: 100% -1;
+}
+
+LockScreenStatusAreaStyle {
+ minimum-size: 100% 3mm;
+ preferred-size: 100% 3mm;
+ maximum-size: 100% 3mm;
+ background-color: #000000;
+ margin-left: 0;
+ margin-right: 0;
+ margin-top: 0;
+ margin-bottom: 0;
+ padding-left: 0;
+ padding-right: 0;
+ padding-top: 0;
+ padding-bottom: 0;
+}
+
+ClockStyle#LockScreenHeaderClock {
+ margin-left: 1.2mm;
+ margin-right: 0;
+ margin-top: 1.2mm;
+ margin-bottom: 0;
+ padding-left: 0;
+ padding-right: 0;
+ padding-top: 0;
+ padding-bottom: 0;
+ time-format: "%R";
+ short-remove-am-pm-indicator: false;
+ horizontal-align: left;
+}
+ClockStyle#LockScreenHeaderClock:twelve-hour {
+ time-format: "%r";
+ short-remove-am-pm-indicator: true;
+}
+MLabelStyle#LockScreenHeaderClockLabel {
+ font: $FONT_FAMILY light 8.1mm;
+ color: #FFFFFF;
+ margin-left: 0;
+ margin-right: 0;
+ margin-top: 0;
+ margin-bottom: 0;
+ padding-left: 0;
+ padding-right: 0;
+ padding-top: 0;
+ padding-bottom: 0;
+ preferred-size: -1 9mm;
+ minimum-size: -1 9mm;
+ maximum-size: -1 9mm;
+}
+
+DateStyle {
+ date-format:;
+ horizontal-align: left;
+}
+
+MLabelStyle#DateLabel {
+ font: $FONT_SMALL;
+ color: #ffffff;
+ margin-left: 2.2mm;
+ margin-right: 0;
+ margin-top: 0;
+ margin-bottom: 0;
+ padding-left: 0;
+ padding-right: 0;
+ padding-top: 0;
+ padding-bottom: 0;
+ preferred-size: -1 2.4mm;
+ minimum-size: -1 2.4mm;
+ maximum-size: -1 2.4mm;
+}
+
View
13 src/extensions/screenlock/themes/style/style.pro
@@ -0,0 +1,13 @@
+include(../../../../../mconfig.pri)
+
+TEMPLATE = subdirs
+
+INSTALLS += style
+
+style.files = *.css
+style.path = /usr/share/themes/base/meegotouch/libsysuid-screenlock/style
+
+QMAKE_EXTRA_TARGETS += check
+check.commands = $$system(true)
+QMAKE_EXTRA_TARGETS += check-xml
+check-xml.commands = $$system(true)
View
23 src/extensions/screenlock/themes/themes.pro
@@ -0,0 +1,23 @@
+include(../../../../mconfig.pri)
+
+TEMPLATE = subdirs
+SUBDIRS = style
+
+INSTALLS += conf
+
+#
+# We just need an extra target so that the recursive make will pass, we don't
+# need to do anything else.
+#
+contains(BUILD_FEATURES,coverage) {
+ QMAKE_EXTRA_TARGETS += coverage
+ coverage.commands = $$system(true)
+}
+
+conf.files = *.conf
+conf.path = /usr/share/themes/base/meegotouch/libsysuid-screenlock
+
+QMAKE_EXTRA_TARGETS += check
+check.commands = $$system(true)
+QMAKE_EXTRA_TARGETS += check-xml
+check-xml.commands = $$system(true)
View
0  src/systemui/lockscreen/unlockarea.cpp → src/extensions/screenlock/unlockarea.cpp
File renamed without changes
View
0  src/systemui/lockscreen/unlockarea.h → src/extensions/screenlock/unlockarea.h
File renamed without changes
View
0  src/systemui/lockscreen/unlockmissedevents.cpp → src/extensions/screenlock/unlockmissedevents.cpp
File renamed without changes
View
0  src/systemui/lockscreen/unlockmissedevents.h → src/extensions/screenlock/unlockmissedevents.h
File renamed without changes
View
0  src/systemui/lockscreen/unlocknotifications.cpp → src/extensions/screenlock/unlocknotifications.cpp
File renamed without changes
View
0  src/systemui/lockscreen/unlocknotifications.h → src/extensions/screenlock/unlocknotifications.h
File renamed without changes
View
0  src/systemui/lockscreen/unlocknotificationsink.cpp → src/extensions/screenlock/unlocknotificationsink.cpp
File renamed without changes
View
0  src/systemui/lockscreen/unlocknotificationsink.h → src/extensions/screenlock/unlocknotificationsink.h
File renamed without changes
View
52 src/libnotificationsystem/notifications.pro
@@ -1,52 +0,0 @@
-
-
-TEMPLATE = lib
-TARGET = notificationsystem
-CONFIG += meegotouch
-SYSTEMUI_NOTIFICATIONS_SRC_DIR = $$SYSTEMUI_SOURCE_DIR/notifications
-INCLUDEPATH += $$SYSTEMUI_SOURCE_DIR/notifications
-HEADERS += $$SYSTEMUI_NOTIFICATIONS_SRC_DIR/notificationmanagerinterface.h \
- $$SYSTEMUI_NOTIFICATIONS_SRC_DIR/notificationmanager.h \
- $$SYSTEMUI_NOTIFICATIONS_SRC_DIR/notificationparameter.h \
- $$SYSTEMUI_NOTIFICATIONS_SRC_DIR/notificationparameters.h \
- $$SYSTEMUI_NOTIFICATIONS_SRC_DIR/notification.h \
- $$SYSTEMUI_NOTIFICATIONS_SRC_DIR/notificationgroup.h \
- $$SYSTEMUI_NOTIFICATIONS_SRC_DIR/notificationsource.h \
- $$SYSTEMUI_NOTIFICATIONS_SRC_DIR/dbusinterfacenotificationsource.h \
- $$SYSTEMUI_NOTIFICATIONS_SRC_DIR/dbusinterfacenotificationsourceadaptor.h \
- $$SYSTEMUI_NOTIFICATIONS_SRC_DIR/notificationsink.h \
- $$SYSTEMUI_NOTIFICATIONS_SRC_DIR/notificationareasink.h \
- $$SYSTEMUI_NOTIFICATIONS_SRC_DIR/widgetnotificationsink.h \
- $$SYSTEMUI_NOTIFICATIONS_SRC_DIR/mcompositornotificationsink.h \
- $$SYSTEMUI_NOTIFICATIONS_SRC_DIR/ngfnotificationsink.h \
- $$SYSTEMUI_NOTIFICATIONS_SRC_DIR/ngfadapter.h \
- $$SYSTEMUI_NOTIFICATIONS_SRC_DIR/notifiernotificationsink.h \
- $$SYSTEMUI_NOTIFICATIONS_SRC_DIR/eventtypestore.h \
- $$SYSTEMUI_NOTIFICATIONS_SRC_DIR/notificationstatusindicator.h
-
-SOURCES += $$SYSTEMUI_NOTIFICATIONS_SRC_DIR/notificationmanager.cpp \
- $$SYSTEMUI_NOTIFICATIONS_SRC_DIR/notificationparameter.cpp \
- $$SYSTEMUI_NOTIFICATIONS_SRC_DIR/notificationparameters.cpp \
- $$SYSTEMUI_NOTIFICATIONS_SRC_DIR/notification.cpp \
- $$SYSTEMUI_NOTIFICATIONS_SRC_DIR/notificationgroup.cpp \
- $$SYSTEMUI_NOTIFICATIONS_SRC_DIR/notificationsource.cpp \
- $$SYSTEMUI_NOTIFICATIONS_SRC_DIR/dbusinterfacenotificationsource.cpp \
- $$SYSTEMUI_NOTIFICATIONS_SRC_DIR/dbusinterfacenotificationsourceadaptor.cpp \
- $$SYSTEMUI_NOTIFICATIONS_SRC_DIR/notificationsink.cpp \
- $$SYSTEMUI_NOTIFICATIONS_SRC_DIR/notificationareasink.cpp \
- $$SYSTEMUI_NOTIFICATIONS_SRC_DIR/widgetnotificationsink.cpp \
- $$SYSTEMUI_NOTIFICATIONS_SRC_DIR/mcompositornotificationsink.cpp \
- $$SYSTEMUI_NOTIFICATIONS_SRC_DIR/ngfnotificationsink.cpp \
- $$SYSTEMUI_NOTIFICATIONS_SRC_DIR/ngfadapter.cpp \
- $$SYSTEMUI_NOTIFICATIONS_SRC_DIR/notifiernotificationsink.cpp \
- $$SYSTEMUI_NOTIFICATIONS_SRC_DIR/eventtypestore.cpp \
- $$SYSTEMUI_NOTIFICATIONS_SRC_DIR/notificationstatusindicator.cpp
-
-DEPENDPATH += .
-
-# For setting the coverage flag ON
-contains(COV_OPTION, on) {
- LIBS += -lgcov
- QMAKE_CXXFLAGS += -ftest-coverage \
- -fprofile-arcs
-}
View
3  src/src.pro
@@ -2,4 +2,5 @@ CONFIG += ordered
TEMPLATE = subdirs
SUBDIRS = \
libnotificationsystem \
- systemui
+ systemui \
+ extensions
View
50 src/systemui/lockscreen/lockscreen.pri
@@ -1,50 +0,0 @@
-include(../../mconfig.pri)
-INCLUDEPATH += lockscreen statusarea
-
-STYLE_HEADERS += lockscreen/lockscreenheaderstyle.h \
- lockscreen/lockscreenheaderwithpadlockstyle.h \
- lockscreen/lockscreenstatusareastyle.h \
- lockscreen/lockscreenwindowstyle.h \
- lockscreen/datestyle.h
-
-HEADERS += \
- lockscreen/lockscreenbusinesslogic.h \
- lockscreen/lockscreenwindow.h \
- lockscreen/lockscreenwindowstyle.h \
- lockscreen/eventeater.h \
- lockscreen/lockscreenbusinesslogicadaptor.h \
- lockscreen/unlocknotifications.h \
- lockscreen/unlocknotificationsink.h \
- lockscreen/unlockmissedevents.h \
- lockscreen/unlockarea.h \
- lockscreen/lockscreenview.h \
- lockscreen/lockscreenwithpadlockview.h \
- lockscreen/lockscreenwithoutpadlockview.h \
- lockscreen/lockscreen.h \
- lockscreen/lockscreenheaderview.h \
- lockscreen/lockscreenheaderstyle.h \
- lockscreen/lockscreenheaderwithpadlockview.h \
- lockscreen/lockscreenheaderwithpadlockstyle.h \
- lockscreen/lockscreenstatusareaview.h \
- lockscreen/lockscreenstatusareastyle.h \
- lockscreen/date.h \
- lockscreen/datestyle.h
-
-SOURCES += \
- lockscreen/lockscreenbusinesslogic.cpp \
- lockscreen/lockscreenwindow.cpp \
- lockscreen/eventeater.cpp \
- lockscreen/lockscreenbusinesslogicadaptor.cpp \
- lockscreen/unlocknotifications.cpp \
- lockscreen/unlocknotificationsink.cpp \
- lockscreen/unlockmissedevents.cpp \
- lockscreen/unlockarea.cpp \
- lockscreen/lockscreenview.cpp \
- lockscreen/lockscreenwithpadlockview.cpp \
- lockscreen/lockscreenwithoutpadlockview.cpp \
- lockscreen/lockscreen.cpp \
- lockscreen/lockscreenheaderview.cpp \
- lockscreen/lockscreenheaderwithpadlockview.cpp \
- lockscreen/lockscreenstatusareaview.cpp \
- lockscreen/date.cpp
-
View
95 src/systemui/lockscreen/lockscreenwindow.cpp
@@ -1,95 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
-** All rights reserved.
-** Contact: Nokia Corporation (directui@nokia.com)
-**
-** This file is part of systemui.
-**
-** If you have questions regarding the use of this file, please contact
-** Nokia at directui@nokia.com.
-**
-** This library is free software; you can redistribute it and/or
-** modify it under the terms of the GNU Lesser General Public
-** License version 2.1 as published by the Free Software Foundation
-** and appearing in the file LICENSE.LGPL included in the packaging
-** of this file.
-**
-****************************************************************************/
-#include "lockscreenwindow.h"
-#include "lockscreenwindowstyle.h"
-#include "lockscreen.h"
-#include <QX11Info>
-#include "x11wrapper.h"
-
-LockScreenWindow::LockScreenWindow(QWidget *parent) :
- MWindow(parent),
- lockScreen(new LockScreen)
-{
- setWindowTitle("LockScreenUI");
- setObjectName("LockScreenWindow");
-
- connect(lockScreen, SIGNAL(unlocked()), this, SIGNAL(unlocked()));
- lockScreen->setObjectName("LockScreen");
- lockScreen->appear(this);
-}
-
-LockScreenWindow::~LockScreenWindow()
-{
- delete lockScreen;
-}
-
-void LockScreenWindow::applyStyle()
-{
- const LockScreenWindowStyle *style = static_cast<const LockScreenWindowStyle *>(MTheme::style("LockScreenWindowStyle", "", "", "", M::Landscape, NULL));
- if (style->lockedOrientation() == "landscape") {
- setLandscapeOrientation();
- setOrientationLocked(true);
- } else if (style->lockedOrientation() == "portrait") {
- setPortraitOrientation();
- setOrientationLocked(true);
- } else {
- setOrientationLocked(false);
- }
-}
-
-void LockScreenWindow::reset()
-{
- lockScreen->reset();
-
- // Ask the lock screen to redraw itself since it may be necessary if the display used to be turned off
- lockScreen->update();
-}
-
-void LockScreenWindow::showEvent(QShowEvent *event)
-{
- MWindow::showEvent(event);
-
- // Set the stacking layer
- Display *display = QX11Info::display();
- Atom stackingLayerAtom = X11Wrapper::XInternAtom(display, "_MEEGO_STACKING_LAYER", False);
- if (stackingLayerAtom != None) {
- long layer = 2;
- X11Wrapper::XChangeProperty(display, internalWinId(), stackingLayerAtom, XA_CARDINAL, 32, PropModeReplace, (unsigned char*)&layer, 1);
- }
-
- excludeFromTaskBar();
- applyStyle();
-}
-
-void LockScreenWindow::excludeFromTaskBar()
-{
- // Tell the window to not to be shown in the switcher
- Display *display = QX11Info::display();
- XEvent e;
- memset(&e, 0, sizeof(XEvent));
- e.xclient.type = ClientMessage;
- e.xclient.display = display;
- e.xclient.window = internalWinId();
- e.xclient.message_type = X11Wrapper::XInternAtom(display, "_NET_WM_STATE", False);
- e.xclient.format = 32;
- e.xclient.data.l[0] = 1;
- e.xclient.data.l[1] = X11Wrapper::XInternAtom(display, "_NET_WM_STATE_SKIP_TASKBAR", False);
- X11Wrapper::XSendEvent(display, RootWindow(display, x11Info().screen()), False, (SubstructureNotifyMask | SubstructureRedirectMask), &e);
- X11Wrapper::XSync(display, False);
-}
View
2  src/systemui/main.cpp
@@ -20,6 +20,8 @@
#include <MApplication>
#include <MApplicationService>
#include <signal.h>
+#include <dlfcn.h>
+#include <cstdio>
sighandler_t originalSigIntHandler = NULL;
sighandler_t originalSigTermHandler = NULL;
View
2  src/systemui/notifications/notifications.pri
@@ -17,7 +17,6 @@ HEADERS += \
$$SYSTEMUI_NOTIFICATIONS_SRC_DIR/ngfadapter.h \
$$SYSTEMUI_NOTIFICATIONS_SRC_DIR/notifiernotificationsink.h \
$$SYSTEMUI_NOTIFICATIONS_SRC_DIR/eventtypestore.h \
- $$SYSTEMUI_NOTIFICATIONS_SRC_DIR/notificationstatusindicator.h \
$$SYSTEMUI_NOTIFICATIONS_SRC_DIR/notificationmanagerinterface.h \
$$SYSTEMUI_NOTIFICATIONS_SRC_DIR/notificationmanager.h \
$$SYSTEMUI_NOTIFICATIONS_SRC_DIR/notificationsource.h \
@@ -36,7 +35,6 @@ SOURCES += \
$$SYSTEMUI_NOTIFICATIONS_SRC_DIR/ngfadapter.cpp \
$$SYSTEMUI_NOTIFICATIONS_SRC_DIR/notifiernotificationsink.cpp \
$$SYSTEMUI_NOTIFICATIONS_SRC_DIR/eventtypestore.cpp \
- $$SYSTEMUI_NOTIFICATIONS_SRC_DIR/notificationstatusindicator.cpp \
$$SYSTEMUI_NOTIFICATIONS_SRC_DIR/notificationmanager.cpp \
$$SYSTEMUI_NOTIFICATIONS_SRC_DIR/notificationsource.cpp \
$$SYSTEMUI_NOTIFICATIONS_SRC_DIR/mnotificationproxy.cpp \
View
0  src/systemui/lockscreen/eventeater.cpp → src/systemui/screenlock/eventeater.cpp
File renamed without changes
View
0  src/systemui/lockscreen/eventeater.h → src/systemui/screenlock/eventeater.h
File renamed without changes
View
17 src/systemui/screenlock/screenlock.pri
@@ -0,0 +1,17 @@
+include(../../mconfig.pri)
+INCLUDEPATH += screenlock statusarea
+
+STYLE_HEADERS += screenlock/screenlockwindowstyle.h
+
+HEADERS += \
+ screenlock/screenlockbusinesslogic.h \
+ screenlock/screenlockbusinesslogicadaptor.h \
+ screenlock/screenlockwindow.h \
+ screenlock/screenlockwindowstyle.h \
+ screenlock/eventeater.h
+
+SOURCES += \
+ screenlock/screenlockbusinesslogic.cpp \
+ screenlock/screenlockbusinesslogicadaptor.cpp \
+ screenlock/screenlockwindow.cpp \
+ screenlock/eventeater.cpp
View
54 src/systemui/lockscreen/lockscreenbusinesslogic.cpp → src/systemui/screenlock/screenlockbusinesslogic.cpp
@@ -16,23 +16,23 @@
** of this file.
**
****************************************************************************/
-#include "lockscreenbusinesslogic.h"
-#include "lockscreenwindow.h"
+#include "screenlockbusinesslogic.h"
+#include "screenlockwindow.h"
#include "eventeater.h"
#include "closeeventeater.h"
-LockScreenBusinessLogic::LockScreenBusinessLogic(QObject* parent) :
+ScreenLockBusinessLogic::ScreenLockBusinessLogic(QObject* parent) :
QObject(parent),
- lockScreenWindow(new LockScreenWindow),
+ screenLockWindow(new ScreenLockWindow),
eventEaterWindow(new EventEater)
{
// Install a close event eater for the windows
CloseEventEater *closeEventEater = new CloseEventEater(this);
- lockScreenWindow->installEventFilter(closeEventEater);
+ screenLockWindow->installEventFilter(closeEventEater);
eventEaterWindow->installEventFilter(closeEventEater);
- connect(lockScreenWindow, SIGNAL(unlocked()), this, SLOT(unlockScreen()));
- connect(lockScreenWindow, SIGNAL(unlocked()), this, SIGNAL(unlockConfirmed()));
+ connect(screenLockWindow, SIGNAL(unlocked()), this, SLOT(unlockScreen()));
+ connect(screenLockWindow, SIGNAL(unlocked()), this, SIGNAL(unlockConfirmed()));
// Hide the event eater when it is clicked
connect(eventEaterWindow, SIGNAL(inputEventReceived()), this, SLOT(hideEventEater()));
@@ -44,52 +44,52 @@ LockScreenBusinessLogic::LockScreenBusinessLogic(QObject* parent) :
}
-LockScreenBusinessLogic::~LockScreenBusinessLogic()
+ScreenLockBusinessLogic::~ScreenLockBusinessLogic()
{
- delete lockScreenWindow;
+ delete screenLockWindow;
delete eventEaterWindow;
}
-void LockScreenBusinessLogic::unlockScreen()
+void ScreenLockBusinessLogic::unlockScreen()
{
toggleScreenLockUI(false);
}
#ifdef HAVE_QMSYSTEM
-void LockScreenBusinessLogic::displayStateChanged(MeeGo::QmDisplayState::DisplayState state)
+void ScreenLockBusinessLogic::displayStateChanged(MeeGo::QmDisplayState::DisplayState state)
{
- // When the screen is unlocked, the lockscreen is visible the lock screen needs to be reset
- if (state == MeeGo::QmDisplayState::On && lockScreenWindow->isVisible()) {
- lockScreenWindow->reset();
- lockScreenWindow->setFocus();
+ // When the screen is unlocked, the screenlock is visible the lock screen needs to be reset
+ if (state == MeeGo::QmDisplayState::On && screenLockWindow->isVisible()) {
+ screenLockWindow->reset();
+ screenLockWindow->setFocus();
}
}
#endif
-void LockScreenBusinessLogic::hideEventEater()
+void ScreenLockBusinessLogic::hideEventEater()
{
toggleEventEater(false);
}
-void LockScreenBusinessLogic::toggleScreenLockUI(bool toggle)
+void ScreenLockBusinessLogic::toggleScreenLockUI(bool toggle)
{
if (toggle) {
// Whenever we're showing the lock screen we need to reset its state
- lockScreenWindow->reset();
+ screenLockWindow->reset();
- if (!lockScreenWindow->isVisible()) {
- lockScreenWindow->show();
+ if (!screenLockWindow->isVisible()) {
+ screenLockWindow->show();
}
- lockScreenWindow->raise();
+ screenLockWindow->raise();
} else {
- if (lockScreenWindow->isVisible()) {
- lockScreenWindow->hide();
+ if (screenLockWindow->isVisible()) {
+ screenLockWindow->hide();
}
}
}
-void LockScreenBusinessLogic::toggleEventEater(bool toggle)
+void ScreenLockBusinessLogic::toggleEventEater(bool toggle)
{
if (toggle) {
if (!eventEaterWindow->isVisible()) {
@@ -103,7 +103,7 @@ void LockScreenBusinessLogic::toggleEventEater(bool toggle)
}
}
-bool LockScreenBusinessLogic::displayIsOn()
+bool ScreenLockBusinessLogic::displayIsOn()
{
#if !defined(__i386__) && defined(HAVE_QMSYSTEM)
return displayState.get() == MeeGo::QmDisplayState::On;
@@ -112,8 +112,8 @@ bool LockScreenBusinessLogic::displayIsOn()
#endif
}
-#if HAVE_QMSYSTEM
-void LockScreenBusinessLogic::locksChanged(MeeGo::QmLocks::Lock what, MeeGo::QmLocks::State how)
+#ifdef HAVE_QMSYSTEM
+void ScreenLockBusinessLogic::locksChanged(MeeGo::QmLocks::Lock what, MeeGo::QmLocks::State how)
{
if (what == MeeGo::QmLocks::TouchAndKeyboard) {
switch (how) {
View
14 src/systemui/lockscreen/lockscreenbusinesslogic.h → src/systemui/screenlock/screenlockbusinesslogic.h
@@ -16,8 +16,8 @@
** of this file.
**
****************************************************************************/
-#ifndef LOCKSCREENBUSINESSLOGIC_H
-#define LOCKSCREENBUSINESSLOGIC_H
+#ifndef SCREENLOCKBUSINESSLOGIC_H
+#define SCREENLOCKBUSINESSLOGIC_H
#include <QObject>
@@ -26,16 +26,16 @@
#include <qmdisplaystate.h>
#endif
-class LockScreenWindow;
+class ScreenLockWindow;
class EventEater;
-class LockScreenBusinessLogic : public QObject
+class ScreenLockBusinessLogic : public QObject
{
Q_OBJECT
public:
- LockScreenBusinessLogic(QObject* parent = 0);
- virtual ~LockScreenBusinessLogic();
+ ScreenLockBusinessLogic(QObject* parent = 0);
+ virtual ~ScreenLockBusinessLogic();
public slots:
void toggleScreenLockUI(bool toggle);
@@ -58,7 +58,7 @@ private slots:
private:
bool displayIsOn();
- LockScreenWindow *lockScreenWindow;
+ ScreenLockWindow *screenLockWindow;
EventEater *eventEaterWindow;
#ifdef HAVE_QMSYSTEM
View
27 ...mui/lockscreen/lockscreenbusinesslogicadaptor.cpp → ...mui/screenlock/screenlockbusinesslogicadaptor.cpp
@@ -19,11 +19,11 @@
#include <QDBusInterface>
#include <QTimer>
-#include "lockscreenbusinesslogicadaptor.h"
+#include "screenlockbusinesslogicadaptor.h"
-LockScreenBusinessLogicAdaptor::LockScreenBusinessLogicAdaptor (
+ScreenLockBusinessLogicAdaptor::ScreenLockBusinessLogicAdaptor (
QObject *obj,
- LockScreenBusinessLogic *logic) :
+ ScreenLockBusinessLogic *logic) :
QDBusAbstractAdaptor (obj),
m_LockScreenBusinessLogic (logic),
m_CallbackDbusIf (0)
@@ -34,7 +34,7 @@ LockScreenBusinessLogicAdaptor::LockScreenBusinessLogicAdaptor (
this, SLOT(unlockConfirmed ()));
}
-LockScreenBusinessLogicAdaptor::~LockScreenBusinessLogicAdaptor ()
+ScreenLockBusinessLogicAdaptor::~ScreenLockBusinessLogicAdaptor ()
{
if (m_CallbackDbusIf)
delete m_CallbackDbusIf;
@@ -45,14 +45,14 @@ LockScreenBusinessLogicAdaptor::~LockScreenBusinessLogicAdaptor ()
* \param path DBus path to call when unlock is performed.
* \param interface DBus interface to call when unlock is performed.
* \param method DBus method to call when unlock is performed.
- * \param mode The LockScreenBusinessLogicAdaptor::TkLockMode opcode.
+ * \param mode The ScreenLockBusinessLogicAdaptor::TkLockMode opcode.
* \param silent Whether to show a notification or not (deprecated)
* \param flicker Deprecated/not used
*
* DBus method to show the lock screen ui or the event eater window.
*/
int
-LockScreenBusinessLogicAdaptor::tklock_open (
+ScreenLockBusinessLogicAdaptor::tklock_open (
const QString &service,
const QString &path,
const QString &interface,
@@ -83,11 +83,8 @@ LockScreenBusinessLogicAdaptor::tklock_open (
* Show the visual earliest...
* in this way we can avoid the full-screen window
* creation time when EnableVisual requested later...
- *
- * XXX: Previously window-creation when screen off
- * caused X11 crashes... now it seems to work.
*/
- QTimer::singleShot (100, this, SLOT (enableVisual ()));
+ QTimer::singleShot (0, this, SLOT (enableVisual ()));
break;
case TkLockModeHelp:
@@ -128,20 +125,20 @@ LockScreenBusinessLogicAdaptor::tklock_open (
}
void
-LockScreenBusinessLogicAdaptor::enableVisual ()
+ScreenLockBusinessLogicAdaptor::enableVisual ()
{
m_LockScreenBusinessLogic->toggleScreenLockUI (true);
m_LockScreenBusinessLogic->toggleEventEater (false);
}
void
-LockScreenBusinessLogicAdaptor::enableEater ()
+ScreenLockBusinessLogicAdaptor::enableEater ()
{
m_LockScreenBusinessLogic->toggleEventEater (true);
}
void
-LockScreenBusinessLogicAdaptor::hideVisualAndEater ()
+ScreenLockBusinessLogicAdaptor::hideVisualAndEater ()
{
/*
* This functions will hides both page,
@@ -157,7 +154,7 @@ LockScreenBusinessLogicAdaptor::hideVisualAndEater ()
* DBus method that is called to hide the lock screen UI.
*/
int
-LockScreenBusinessLogicAdaptor::tklock_close (
+ScreenLockBusinessLogicAdaptor::tklock_close (
bool silent)
{
Q_UNUSED (silent);
@@ -168,7 +165,7 @@ LockScreenBusinessLogicAdaptor::tklock_close (
}
void
-LockScreenBusinessLogicAdaptor::unlockConfirmed ()
+ScreenLockBusinessLogicAdaptor::unlockConfirmed ()
{
if (m_CallbackDbusIf)
delete m_CallbackDbusIf;
View
22 ...temui/lockscreen/lockscreenbusinesslogicadaptor.h → ...temui/screenlock/screenlockbusinesslogicadaptor.h
@@ -16,22 +16,18 @@
** of this file.
**
****************************************************************************/
-#ifndef LOCKSCREENBUSINESSLOGICADAPTOR_H
-#define LOCKSCREENBUSINESSLOGICADAPTOR_H
+#ifndef SCREENLOCKBUSINESSLOGICADAPTOR_H
+#define SCREENLOCKBUSINESSLOGICADAPTOR_H
-#if defined (UNIT_TEST) && defined (ADAPTOR_TEST)
-#include "lockscreenbusinesslogic_stub.h"
-#else
-#include "lockscreenbusinesslogic.h"
-#endif
+#include "screenlockbusinesslogic.h"
+#include <QDBusAbstractAdaptor>
class QDBusInterface;
-#include <QDBusAbstractAdaptor>
/*!
* Implements the DBus API interface for the screen locking mechanism.
*/
-class LockScreenBusinessLogicAdaptor : public QDBusAbstractAdaptor
+class ScreenLockBusinessLogicAdaptor : public QDBusAbstractAdaptor
{
Q_OBJECT
#ifndef UNIT_TEST
@@ -39,10 +35,10 @@ class LockScreenBusinessLogicAdaptor : public QDBusAbstractAdaptor
#endif
public:
- LockScreenBusinessLogicAdaptor (
+ ScreenLockBusinessLogicAdaptor (
QObject * obj,
- LockScreenBusinessLogic *logic);
- ~LockScreenBusinessLogicAdaptor();
+ ScreenLockBusinessLogic *logic);
+ ~ScreenLockBusinessLogicAdaptor();
/*
* I have no information about these, copyed from osso-systemui-tklock.
@@ -84,7 +80,7 @@ private slots:
void hideVisualAndEater ();
private:
- LockScreenBusinessLogic *m_LockScreenBusinessLogic;
+ ScreenLockBusinessLogic *m_LockScreenBusinessLogic;
QString m_MCECallbackService;
QString m_MCECallbackPath;
QString m_MCECallbackInterface;
View
50 src/systemui/screenlock/screenlockextensioninterface.h
@@ -0,0 +1,50 @@
+/****************************************************************************
+**
+** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (directui@nokia.com)
+**
+** This file is part of systemui.
+**
+** If you have questions regarding the use of this file, please contact
+** Nokia at directui@nokia.com.
+**
+** This library is free software; you can redistribute it and/or
+** modify it under the terms of the GNU Lesser General Public
+** License version 2.1 as published by the Free Software Foundation
+** and appearing in the file LICENSE.LGPL included in the packaging
+** of this file.
+**
+****************************************************************************/
+
+#ifndef SCREENLOCKEXTENSIONINTERFACE_H
+#define SCREENLOCKEXTENSIONINTERFACE_H
+
+#include <QObject>
+#include <mapplicationextensioninterface.h>
+
+/**
+ * ScreenLockExtensionInterface is the base class for screen lock extension classes.
+ *
+ * Extension developers need to implement this interface in their extension binary
+ * and export their implementation from the binary. The host application will maintain
+ * an inventory of available extensions and instantiate them using this interface
+ * when needed.
+ */
+class ScreenLockExtensionInterface : public MApplicationExtensionInterface
+{
+public:
+ /*!
+ * Destructor.
+ */
+ virtual ~ScreenLockExtensionInterface() {}
+
+ /*!
+ * Resets the screen lock extension to its initial state.
+ */
+ virtual void reset() = 0;
+};
+
+Q_DECLARE_INTERFACE(ScreenLockExtensionInterface, "com.meego.core.ScreenLockExtensionInterface/1.0")
+
+#endif // SCREENLOCKEXTENSIONINTERFACE_H
View
132 src/systemui/screenlock/screenlockwindow.cpp
@@ -0,0 +1,132 @@
+/****************************************************************************
+**
+** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (directui@nokia.com)
+**
+** This file is part of systemui.
+**
+** If you have questions regarding the use of this file, please contact
+** Nokia at directui@nokia.com.
+**
+** This library is free software; you can redistribute it and/or
+** modify it under the terms of the GNU Lesser General Public
+** License version 2.1 as published by the Free Software Foundation
+** and appearing in the file LICENSE.LGPL included in the packaging
+** of this file.
+**
+****************************************************************************/
+
+#include "screenlockwindow.h"
+#include "screenlockwindowstyle.h"
+#include "screenlockextensioninterface.h"
+#include <MApplicationExtensionArea>
+#include <MSceneWindow>
+#include <QGraphicsLinearLayout>
+#include <QX11Info>
+#include "x11wrapper.h"
+
+ScreenLockWindow::ScreenLockWindow(QWidget *parent) :
+ MWindow(parent)
+{
+ setWindowTitle("Screen Lock");
+
+ // Create an extension area for the screen lock
+ MApplicationExtensionArea *extensionArea = new MApplicationExtensionArea("com.meego.core.ScreenLockExtensionInterface/1.0");
+ connect(extensionArea, SIGNAL(extensionInstantiated(MApplicationExtensionInterface*)), this, SLOT(registerExtension(MApplicationExtensionInterface*)));
+ connect(extensionArea, SIGNAL(extensionRemoved(MApplicationExtensionInterface*)), this, SLOT(unregisterExtension(MApplicationExtensionInterface*)));
+ extensionArea->setStyleName("ScreenLockExtensionArea");
+ extensionArea->setInProcessFilter(QRegExp("/sysuid-screenlock.desktop$"));
+ extensionArea->setOutOfProcessFilter(QRegExp("$^"));
+ extensionArea->init();
+
+ MSceneWindow *screenLockWindow = new MSceneWindow;
+ screenLockWindow->setStyleName("ScreenLockWindow");
+ screenLockWindow->appear(this);
+
+ QGraphicsLinearLayout *layout = new QGraphicsLinearLayout(Qt::Vertical);
+ layout->setSpacing(0);
+ layout->setContentsMargins(0, 0, 0, 0);
+ layout->addItem(extensionArea);
+ screenLockWindow->setLayout(layout);
+}
+
+ScreenLockWindow::~ScreenLockWindow()
+{
+}
+
+void ScreenLockWindow::applyStyle()
+{
+ const ScreenLockWindowStyle *style = static_cast<const ScreenLockWindowStyle *>(MTheme::style("ScreenLockWindowStyle", "", "", "", M::Landscape, NULL));
+ if (style->lockedOrientation() == "landscape") {
+ setLandscapeOrientation();
+ setOrientationLocked(true);
+ } else if (style->lockedOrientation() == "portrait") {
+ setPortraitOrientation();
+ setOrientationLocked(true);
+ } else {
+ setOrientationLocked(false);
+ }
+}
+
+void ScreenLockWindow::reset()
+{
+ foreach (ScreenLockExtensionInterface *screenLockExtension, screenLockExtensions) {
+ screenLockExtension->reset();
+
+ // Ask the lock screen to redraw itself since it may be necessary if the display used to be turned off
+ screenLockExtension->widget()->update();
+ }
+}
+
+void ScreenLockWindow::registerExtension(MApplicationExtensionInterface *extension)
+{
+ ScreenLockExtensionInterface *screenLockExtension = dynamic_cast<ScreenLockExtensionInterface *>(extension);
+
+ if (screenLockExtension != NULL) {
+ screenLockExtensions.append(screenLockExtension);
+ connect(screenLockExtension->widget(), SIGNAL(unlocked()), this, SIGNAL(unlocked()));
+ }
+}
+
+void ScreenLockWindow::unregisterExtension(MApplicationExtensionInterface *extension)
+{
+ ScreenLockExtensionInterface *screenLockExtension = dynamic_cast<ScreenLockExtensionInterface *>(extension);
+
+ if (screenLockExtension != NULL) {
+ screenLockExtensions.removeAll(screenLockExtension);
+ }
+}
+
+void ScreenLockWindow::showEvent(QShowEvent *event)
+{
+ MWindow::showEvent(event);
+
+ // Set the stacking layer
+ Display *display = QX11Info::display();
+ Atom stackingLayerAtom = X11Wrapper::XInternAtom(display, "_MEEGO_STACKING_LAYER", False);
+ if (stackingLayerAtom != None) {
+ long layer = 2;
+ X11Wrapper::XChangeProperty(display, internalWinId(), stackingLayerAtom, XA_CARDINAL, 32, PropModeReplace, (unsigned char*)&layer, 1);
+ }
+
+ excludeFromTaskBar();
+ applyStyle();
+}
+
+void ScreenLockWindow::excludeFromTaskBar()
+{
+ // Tell the window to not to be shown in the switcher
+ Display *display = QX11Info::display();
+ XEvent e;
+ memset(&e, 0, sizeof(XEvent));
+ e.xclient.type = ClientMessage;
+ e.xclient.display = display;
+ e.xclient.window = internalWinId();
+ e.xclient.message_type = X11Wrapper::XInternAtom(display, "_NET_WM_STATE", False);
+ e.xclient.format = 32;
+ e.xclient.data.l[0] = 1;
+ e.xclient.data.l[1] = X11Wrapper::XInternAtom(display, "_NET_WM_STATE_SKIP_TASKBAR", False);
+ X11Wrapper::XSendEvent(display, RootWindow(display, x11Info().screen()), False, (SubstructureNotifyMask | SubstructureRedirectMask), &e);
+ X11Wrapper::XSync(display, False);
+}
View
42 src/systemui/lockscreen/lockscreenwindow.h → src/systemui/screenlock/screenlockwindow.h
@@ -16,21 +16,38 @@
** of this file.
**
****************************************************************************/
-#ifndef LOCKSCREENWINDOW_H
-#define LOCKSCREENWINDOW_H
+#ifndef SCREENLOCKWINDOW_H
+#define SCREENLOCKWINDOW_H
#include <MWindow>
#include <X11/Xdefs.h>
-class LockScreen;
+class MApplicationExtensionInterface;
+class ScreenLockExtensionInterface;
-class LockScreenWindow : public MWindow
+/*!
+ * Screen lock window is a window for the screen lock.
+ */
+class ScreenLockWindow : public MWindow
{
Q_OBJECT
public:
- LockScreenWindow(QWidget *parent = NULL);
- virtual ~LockScreenWindow();
+ /*!
+ * Creates a screen lock window.
+ *
+ * \param parent the parent widget for the window
+ */
+ ScreenLockWindow(QWidget *parent = NULL);
+
+ /*!
+ * Destroys the screen lock window.
+ */
+ virtual ~ScreenLockWindow();
+
+ /*!
+ * Resets the screen lock to its normal state.
+ */
void reset();
protected:
@@ -40,11 +57,17 @@ class LockScreenWindow : public MWindow
virtual void showEvent(QShowEvent *event);
signals:
+ //! Signal emitted when the screen is unlocked
void unlocked();
-private:
- LockScreen *lockScreen;
+private slots:
+ //! Registers an screen lock extension
+ void registerExtension(MApplicationExtensionInterface *extension);
+ //! Unregisters an screen lock extension
+ void unregisterExtension(MApplicationExtensionInterface *extension);
+
+private:
//! Set window properties to not show the window in the switcher
void excludeFromTaskBar();
void changeNetWmState(bool set, Atom one, Atom two = 0);
@@ -52,6 +75,9 @@ class LockScreenWindow : public MWindow
//! Applies the lock screen orientation and locking from the style
void applyStyle();
+ //! A list of registered screen lock extensions
+ QList<ScreenLockExtensionInterface *> screenLockExtensions;
+
#ifdef UNIT_TEST
friend class Ut_LockScreenWindow;
#endif
View
12 src/systemui/lockscreen/lockscreenwindowstyle.h → src/systemui/screenlock/screenlockwindowstyle.h
@@ -17,23 +17,23 @@
**
****************************************************************************/
-#ifndef LOCKSCREENWINDOWSTYLE_H
-#define LOCKSCREENWINDOWSTYLE_H
+#ifndef SCREENLOCKWINDOWSTYLE_H
+#define SCREENLOCKWINDOWSTYLE_H
#include <MStyle>
-class LockScreenWindowStyle : public MStyle
+class ScreenLockWindowStyle : public MStyle
{
Q_OBJECT
- M_STYLE(LockScreenWindowStyle)
+ M_STYLE(ScreenLockWindowStyle)
// The locked orientation: "landscape", "portrait" or any other value for unlocked
M_STYLE_ATTRIBUTE(QString, lockedOrientation, LockedOrientation)