~kdub/mir/fix-1301040

« back to all changes in this revision

Viewing changes to include/server/mir/scene/surface_event_source.h

  • Committer: Tarmac
  • Author(s): Alan Griffiths
  • Date: 2014-04-01 17:40:49 UTC
  • mfrom: (1513.3.10 mir1)
  • Revision ID: tarmac-20140401174049-vj1jmakptw9v31qg
scene: Simplify BasicSurface creation by separating out an initial cut of SurfaceObserver.

Approved by Andreas Pokorny, Alexandros Frantzis, Gerry Boland, PS Jenkins bot.

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/*
 
2
 * Copyright © 2014 Canonical Ltd.
 
3
 *
 
4
 * This program is free software: you can redistribute it and/or modify it
 
5
 * under the terms of the GNU General Public License version 3,
 
6
 * as published by the Free Software Foundation.
 
7
 *
 
8
 * This program is distributed in the hope that it will be useful,
 
9
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 
10
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 
11
 * GNU General Public License for more details.
 
12
 *
 
13
 * You should have received a copy of the GNU General Public License
 
14
 * along with this program.  If not, see <http://www.gnu.org/licenses/>.
 
15
 *
 
16
 * Authored by: Alan Griffiths <alan@octopull.co.uk>
 
17
 */
 
18
 
 
19
#ifndef MIR_SCENE_SURFACE_EVENT_SOURCE_H_
 
20
#define MIR_SCENE_SURFACE_EVENT_SOURCE_H_
 
21
 
 
22
#include "mir/scene/surface_observer.h"
 
23
#include "mir/frontend/surface_id.h"
 
24
#include "mir/frontend/event_sink.h"
 
25
 
 
26
#include <memory>
 
27
 
 
28
namespace mir
 
29
{
 
30
namespace scene
 
31
{
 
32
class SurfaceEventSource : public SurfaceObserver
 
33
{
 
34
public:
 
35
    SurfaceEventSource(
 
36
        frontend::SurfaceId id,
 
37
        std::shared_ptr<frontend::EventSink> const& event_sink);
 
38
 
 
39
    void attrib_change(MirSurfaceAttrib attrib, int value);
 
40
    void resize(geometry::Size const& size);
 
41
 
 
42
private:
 
43
    frontend::SurfaceId const id;
 
44
    std::shared_ptr<frontend::EventSink> const event_sink;
 
45
};
 
46
}
 
47
}
 
48
 
 
49
#endif // MIR_SCENE_SURFACE_EVENT_SOURCE_H_