Mir
Classes | Public Member Functions | List of all members
mir::shell::PersistentSurfaceStore Class Referenceabstract

A store for Surface information divorced from the lifetime of any given Session. More...

#include <persistent_surface_store.h>

Classes

class  Id
 

Public Member Functions

virtual ~PersistentSurfaceStore ()=default
 
virtual Id id_for_surface (std::shared_ptr< scene::Surface > const &surface)=0
 Acquire ID for a Surface. More...
 
virtual std::shared_ptr< scene::Surfacesurface_for_id (Id const &id) const =0
 Lookup Surface by ID. More...
 

Detailed Description

A store for Surface information divorced from the lifetime of any given Session.

This provides the backing for persistent references to Surface objects, both across client Sessions and across shell restarts, for features such as surface position/size restoration.

Todo:
Persistence across shell restarts is as-yet unimplemented.

Constructor & Destructor Documentation

virtual mir::shell::PersistentSurfaceStore::~PersistentSurfaceStore ( )
virtualdefault

Member Function Documentation

virtual Id mir::shell::PersistentSurfaceStore::id_for_surface ( std::shared_ptr< scene::Surface > const &  surface)
pure virtual

Acquire ID for a Surface.

Parameters
[in]surfaceSurface to query or generate an ID for
Returns
The ID for this surface.
Note
If
  • surface has not yet had an ID generated, this generates its ID.
This does not extend the lifetime of
  • surface.
virtual std::shared_ptr<scene::Surface> mir::shell::PersistentSurfaceStore::surface_for_id ( Id const &  id) const
pure virtual

Lookup Surface by ID.

Parameters
[in]idID of surface to lookup
Returns
The surface with ID
  • id. If this surface has been destroyed, but the store retains a reference, returns nullptr.
Exceptions
std::out_of_rangeif the store has no reference for a surface with
  • id.

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

Copyright © 2012-2016 Canonical Ltd.
Generated on Fri Dec 20 06:52:43 UTC 2019