~dandrader/qtmir/surfaceDrawn

« back to all changes in this revision

Viewing changes to src/platforms/mirserver/screenscontroller.h

  • Committer: CI Train Bot
  • Author(s): Gerry Boland, Michał Sawicz, Nick Dedekind
  • Date: 2016-04-29 20:04:51 UTC
  • mfrom: (434.5.64 set-display-config)
  • Revision ID: ci-train-bot@canonical.com-20160429200451-v0bjc4pcypynt83b
Enhance ScreenController & the DisplayConfigurationPolicy to implement dynamic grid units.

- Rename ScreenController to ScreenModel, as it just reflects current screen state, does not offer means to configure it
- ScreenController can update state of existing Screens, based on Mir DisplayConfiguration changes.
- Expand Screen to include scale & form factor properties, with getter/notifier in NativeInterface. This enables the dynamic grid units in the shell
- Add a Unity.Screens qml module to give QML better information about connected screens, and allow basic reconfiguring.
- Implement a basic display configuration policy to set suitable scale and form factor on an external display (needed for dynamic grid units) Fixes: #1573532
Approved by: Unity8 CI Bot, Daniel d'Andrada

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/*
 
2
 * Copyright (C) 2016 Canonical, Ltd.
 
3
 *
 
4
 * This program is free software: you can redistribute it and/or modify it under
 
5
 * the terms of the GNU Lesser General Public License version 3, as published by
 
6
 * the Free Software Foundation.
 
7
 *
 
8
 * This program is distributed in the hope that it will be useful, but WITHOUT
 
9
 * ANY WARRANTY; without even the implied warranties of MERCHANTABILITY,
 
10
 * SATISFACTORY QUALITY, or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
 
11
 * Lesser General Public License for more details.
 
12
 *
 
13
 * You should have received a copy of the GNU Lesser General Public License
 
14
 * along with this program.  If not, see <http://www.gnu.org/licenses/>.
 
15
 */
 
16
 
 
17
#ifndef SCREENSCONTROLLER_H
 
18
#define SCREENSCONTROLLER_H
 
19
 
 
20
// Qt
 
21
#include <QObject>
 
22
#include <QSharedPointer>
 
23
#include <QVector>
 
24
 
 
25
// local
 
26
#include "customscreenconfiguration.h"
 
27
#include "screensmodel.h"
 
28
 
 
29
namespace mir {
 
30
    namespace graphics { class Display; }
 
31
    namespace shell { class DisplayConfigurationController; }
 
32
}
 
33
 
 
34
 
 
35
class ScreensController : public QObject
 
36
{
 
37
    Q_OBJECT
 
38
 
 
39
public:
 
40
    explicit ScreensController(const QSharedPointer<ScreensModel> &model,
 
41
                               const std::shared_ptr<mir::graphics::Display> &display,
 
42
                               const std::shared_ptr<mir::shell::DisplayConfigurationController> &controller,
 
43
                               QObject *parent = 0);
 
44
 
 
45
    CustomScreenConfigurationList configuration();
 
46
    bool setConfiguration(CustomScreenConfigurationList newConfig);
 
47
 
 
48
private:
 
49
    const QSharedPointer<ScreensModel> m_screensModel;
 
50
    const std::shared_ptr<mir::graphics::Display> m_display;
 
51
    const std::shared_ptr<mir::shell::DisplayConfigurationController> m_displayConfigurationController;
 
52
};
 
53
 
 
54
#endif // SCREENSCONTROLLER_H