Mir
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Public Member Functions | List of all members
mir::scene::BasicSurface Class Reference

#include <basic_surface.h>

Inheritance diagram for mir::scene::BasicSurface:
Inheritance graph
[legend]

Public Member Functions

 BasicSurface (std::string const &name, geometry::Rectangle rect, bool nonrectangular, std::shared_ptr< compositor::BufferStream > const &buffer_stream, std::shared_ptr< input::InputChannel > const &input_channel, std::shared_ptr< SurfaceConfigurator > const &configurator, std::shared_ptr< SceneReport > const &report)
 
 ~BasicSurface () noexcept
 
std::string name () const override
 
void move_to (geometry::Point const &top_left) override
 
float alpha () const override
 
void set_hidden (bool is_hidden)
 
geometry::Size size () const override
 
MirPixelFormat pixel_format () const
 
std::shared_ptr< graphics::Buffersnapshot_buffer () const
 
void swap_buffers (graphics::Buffer *old_buffer, std::function< void(graphics::Buffer *new_buffer)> complete)
 
void force_requests_to_complete ()
 
bool supports_input () const
 
int client_input_fd () const
 
void allow_framedropping (bool)
 
std::shared_ptr
< input::InputChannel
input_channel () const override
 
void on_change (std::function< void()> change_notification) override
 
void set_input_region (std::vector< geometry::Rectangle > const &input_rectangles) override
 
std::shared_ptr
< compositor::BufferStream
buffer_stream () const
 
void resize (geometry::Size const &size) override
 
geometry::Point top_left () const override
 
bool contains (geometry::Point const &point) const override
 
void frame_posted ()
 
void set_alpha (float alpha) override
 
void set_transformation (glm::mat4 const &) override
 
glm::mat4 transformation () const override
 Transformation returns the transformation matrix that should be applied to the surface. More...
 
bool visible () const
 TODO: Its a bit questionable that we have this member function, why not just trim the renderable from the RenderableList? Its convenient to have this function temporarily while refactoring –kdub. More...
 
bool shaped () const override
 
std::shared_ptr< graphics::Bufferbuffer (void const *) const override
 Return the next buffer that should be composited/rendered. More...
 
bool alpha_enabled () const override
 
geometry::Rectangle screen_position () const override
 
int buffers_ready_for_compositor () const override
 
void with_most_recent_buffer_do (std::function< void(graphics::Buffer &)> const &exec) override
 
MirSurfaceType type () const override
 
MirSurfaceState state () const override
 
void take_input_focus (std::shared_ptr< shell::InputTargeter > const &targeter) override
 
int configure (MirSurfaceAttrib attrib, int value) override
 
void hide () override
 
void show () override
 
void add_observer (std::shared_ptr< SurfaceObserver > const &observer) override
 
void remove_observer (std::shared_ptr< SurfaceObserver > const &observer) override
 
- Public Member Functions inherited from mir::shell::Surface
virtual void take_input_focus (std::shared_ptr< InputTargeter > const &targeter)=0
 
- Public Member Functions inherited from mir::frontend::Surface
virtual ~Surface ()
 
void swap_buffers_blocking (graphics::Buffer *&buffer)
 swap_buffers_blocking() is a convenience wrapper around swap_buffers() it forces the current thread to block until complete() is called. More...
 
- Public Member Functions inherited from mir::shell::SurfaceBufferAccess
virtual ~SurfaceBufferAccess ()=default
 

Additional Inherited Members

- Protected Member Functions inherited from mir::graphics::Renderable
 Renderable ()=default
 
virtual ~Renderable ()=default
 
 Renderable (Renderable const &)=delete
 
Renderableoperator= (Renderable const &)=delete
 
- Protected Member Functions inherited from mir::input::Surface
 Surface ()=default
 
virtual ~Surface ()=default
 
 Surface (const Surface &)=delete
 
Surfaceoperator= (const Surface &)=delete
 
- Protected Member Functions inherited from mir::frontend::Surface
 Surface ()=default
 
 Surface (Surface const &)=delete
 
Surfaceoperator= (Surface const &)=delete
 
- Protected Member Functions inherited from mir::shell::SurfaceBufferAccess
 SurfaceBufferAccess ()=default
 
 SurfaceBufferAccess (SurfaceBufferAccess const &)=delete
 
SurfaceBufferAccessoperator= (SurfaceBufferAccess const &)=delete
 

Constructor & Destructor Documentation

mir::scene::BasicSurface::BasicSurface ( std::string const &  name,
geometry::Rectangle  rect,
bool  nonrectangular,
std::shared_ptr< compositor::BufferStream > const &  buffer_stream,
std::shared_ptr< input::InputChannel > const &  input_channel,
std::shared_ptr< SurfaceConfigurator > const &  configurator,
std::shared_ptr< SceneReport > const &  report 
)
mir::scene::BasicSurface::~BasicSurface ( )
noexcept

Member Function Documentation

void mir::scene::BasicSurface::add_observer ( std::shared_ptr< SurfaceObserver > const &  observer)
overridevirtual

Implements mir::scene::Surface.

void mir::scene::BasicSurface::allow_framedropping ( bool  allow)
virtual

Implements mir::shell::Surface.

float mir::scene::BasicSurface::alpha ( ) const
overridevirtual

Implements mir::scene::Surface.

bool mir::scene::BasicSurface::alpha_enabled ( ) const
overridevirtual
std::shared_ptr< mg::Buffer > mir::scene::BasicSurface::buffer ( void const *  user_id) const
overridevirtual

Return the next buffer that should be composited/rendered.

Parameters
[in]user_idAn arbitrary unique identifier used to distinguish separate threads/monitors/components which need to concurrently receive the same buffer. Calling with the same user_id will return a new (different) buffer to that user each time. For consistency, all callers need to determine their user_id in the same way (e.g. always use "this" pointer).

Implements mir::graphics::Renderable.

std::shared_ptr< mc::BufferStream > mir::scene::BasicSurface::buffer_stream ( ) const
int mir::scene::BasicSurface::buffers_ready_for_compositor ( ) const
overridevirtual
int mir::scene::BasicSurface::client_input_fd ( ) const
virtual
int mir::scene::BasicSurface::configure ( MirSurfaceAttrib  attrib,
int  value 
)
overridevirtual
bool mir::scene::BasicSurface::contains ( geometry::Point const &  point) const
overridevirtual

Implements mir::input::Surface.

void mir::scene::BasicSurface::force_requests_to_complete ( )
virtual
void mir::scene::BasicSurface::frame_posted ( )
void mir::scene::BasicSurface::hide ( )
overridevirtual

Implements mir::shell::Surface.

std::shared_ptr< mi::InputChannel > mir::scene::BasicSurface::input_channel ( ) const
overridevirtual

Implements mir::scene::Surface.

void mir::scene::BasicSurface::move_to ( geometry::Point const &  top_left)
overridevirtual

Implements mir::shell::Surface.

std::string mir::scene::BasicSurface::name ( ) const
overridevirtual

Implements mir::scene::Surface.

void mir::scene::BasicSurface::on_change ( std::function< void()>  change_notification)
overridevirtual

Implements mir::scene::Surface.

MirPixelFormat mir::scene::BasicSurface::pixel_format ( ) const
virtual
void mir::scene::BasicSurface::remove_observer ( std::shared_ptr< SurfaceObserver > const &  observer)
overridevirtual

Implements mir::scene::Surface.

void mir::scene::BasicSurface::resize ( geometry::Size const &  size)
overridevirtual

Implements mir::shell::Surface.

geom::Rectangle mir::scene::BasicSurface::screen_position ( ) const
overridevirtual
void mir::scene::BasicSurface::set_alpha ( float  alpha)
overridevirtual

Implements mir::shell::Surface.

void mir::scene::BasicSurface::set_hidden ( bool  is_hidden)
void mir::scene::BasicSurface::set_input_region ( std::vector< geometry::Rectangle > const &  input_rectangles)
overridevirtual

Implements mir::shell::Surface.

void mir::scene::BasicSurface::set_transformation ( glm::mat4 const &  t)
overridevirtual

Implements mir::shell::Surface.

bool mir::scene::BasicSurface::shaped ( ) const
overridevirtual
void mir::scene::BasicSurface::show ( )
overridevirtual

Implements mir::shell::Surface.

mir::geometry::Size mir::scene::BasicSurface::size ( ) const
overridevirtual

Implements mir::scene::Surface.

std::shared_ptr< mg::Buffer > mir::scene::BasicSurface::snapshot_buffer ( ) const
MirSurfaceState mir::scene::BasicSurface::state ( ) const
overridevirtual

Implements mir::shell::Surface.

bool mir::scene::BasicSurface::supports_input ( ) const
virtual
void mir::scene::BasicSurface::swap_buffers ( graphics::Buffer old_buffer,
std::function< void(graphics::Buffer *new_buffer)>  complete 
)
virtual
void mir::scene::BasicSurface::take_input_focus ( std::shared_ptr< shell::InputTargeter > const &  targeter)
override
geom::Point mir::scene::BasicSurface::top_left ( ) const
overridevirtual

Implements mir::scene::Surface.

glm::mat4 mir::scene::BasicSurface::transformation ( ) const
overridevirtual

Transformation returns the transformation matrix that should be applied to the surface.

By default when there are no transformations this will be the identity matrix.

Warning
As this functionality is presently only used by mir_demo_standalone_render_surfaces for rotations it may be deprecated in future. It is expected that real transformations may become more transient things (e.g. applied by animation logic externally instead of being a semi-permanent attribute of the surface itself).

Implements mir::graphics::Renderable.

MirSurfaceType mir::scene::BasicSurface::type ( ) const
overridevirtual

Implements mir::shell::Surface.

bool mir::scene::BasicSurface::visible ( ) const
virtual

TODO: Its a bit questionable that we have this member function, why not just trim the renderable from the RenderableList? Its convenient to have this function temporarily while refactoring –kdub.

Implements mir::graphics::Renderable.

void mir::scene::BasicSurface::with_most_recent_buffer_do ( std::function< void(graphics::Buffer &)> const &  exec)
overridevirtual

The documentation for this class was generated from the following files:

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