Mir
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
surface.h
Go to the documentation of this file.
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_H_
20 #define MIR_SCENE_SURFACE_H_
21 
23 #include "mir/input/surface.h"
24 #include "mir/shell/surface.h"
25 
26 namespace mir
27 {
28 namespace input { class InputChannel; }
29 
30 namespace scene
31 {
32 class SurfaceObserver;
33 
34 class Surface :
35  public graphics::Renderable,
36  public input::Surface,
37  public shell::Surface
38 {
39 public:
40  // resolve ambiguous member function names
41  std::string name() const = 0;
42  geometry::Size size() const = 0;
43  geometry::Point top_left() const = 0;
44  float alpha() const = 0;
45 
46  // member functions that don't exist in base classes
47  // TODO input_channel() and on_change() relate to
48  // TODO adding and removing the surface from the scene and are probably not
49  // TODO cleanest interface for this.
50  virtual std::shared_ptr<input::InputChannel> input_channel() const = 0;
51  virtual void on_change(std::function<void()> change_notification) = 0;
52 
53  virtual void add_observer(std::shared_ptr<SurfaceObserver> const& observer) = 0;
54  virtual void remove_observer(std::shared_ptr<SurfaceObserver> const& observer) = 0;
55 };
56 }
57 }
58 
59 #endif // MIR_SCENE_SURFACE_H_
Definition: size.h:30
geometry::Point top_left() const =0
virtual void on_change(std::function< void()> change_notification)=0
virtual std::shared_ptr< input::InputChannel > input_channel() const =0
Definition: point.h:30
Definition: surface.h:30
virtual void add_observer(std::shared_ptr< SurfaceObserver > const &observer)=0
Definition: surface.h:37
geometry::Size size() const =0
float alpha() const =0
Definition: renderable.h:33
std::string name() const =0
Definition: surface.h:34
virtual void remove_observer(std::shared_ptr< SurfaceObserver > const &observer)=0

Copyright © 2012,2013 Canonical Ltd.
Generated on Fri Apr 11 21:14:53 UTC 2014