~lukas-kde/qtmir/betterSessionManagement

« back to all changes in this revision

Viewing changes to src/modules/Unity/Application/surfacemanager.h

  • Committer: Lukáš Tinkl
  • Date: 2017-03-24 11:51:00 UTC
  • mfrom: (590.1.35 qtmir)
  • Revision ID: lukas.tinkl@canonical.com-20170324115100-n0itqdupc26qe6g6
merge trunk, resolve conflicts

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
1
/*
2
 
 * Copyright (C) 2016 Canonical, Ltd.
 
2
 * Copyright (C) 2016,2017 Canonical, Ltd.
3
3
 *
4
4
 * This program is free software: you can redistribute it and/or modify it under
5
5
 * the terms of the GNU Lesser General Public License version 3, as published by
31
31
namespace qtmir {
32
32
 
33
33
class MirSurface;
34
 
class SessionManager;
 
34
class SessionMapInterface;
35
35
class WindowControllerInterface;
36
36
 
37
37
class SurfaceManager : public unity::shell::application::SurfaceManagerInterface
39
39
    Q_OBJECT
40
40
 
41
41
public:
42
 
    explicit SurfaceManager(QObject *parent = 0);
 
42
    explicit SurfaceManager();
 
43
    SurfaceManager(WindowControllerInterface *windowController,
 
44
                   WindowModelNotifier *windowModel,
 
45
                   SessionMapInterface *sessionMap);
43
46
    virtual ~SurfaceManager() {}
44
47
 
45
48
    void raise(unity::shell::application::MirSurfaceInterface *surface) override;
46
49
    void activate(unity::shell::application::MirSurfaceInterface *surface) override;
47
50
 
 
51
    // mainly for test usage
 
52
    MirSurface* find(const miral::WindowInfo &needle) const;
 
53
 
48
54
private Q_SLOTS:
49
55
    void onWindowAdded(const qtmir::NewWindow &windowInfo);
50
56
    void onWindowRemoved(const miral::WindowInfo &windowInfo);
59
65
    void connectToWindowModelNotifier(WindowModelNotifier *notifier);
60
66
    void rememberMirSurface(MirSurface *surface);
61
67
    void forgetMirSurface(const miral::Window &window);
62
 
    MirSurface* find(const miral::WindowInfo &needle) const;
63
68
    MirSurface* find(const miral::Window &needle) const;
64
 
    MirSurface* find(const std::shared_ptr<mir::scene::Surface> &needle) const;
65
69
 
66
70
    QVector<MirSurface*> m_allSurfaces;
67
71
 
68
72
    WindowControllerInterface *m_windowController;
69
 
    SessionManager* m_sessionManager;
 
73
    SessionMapInterface *m_sessionMap;
70
74
};
71
75
 
72
76
} // namespace qtmir