Inkscape
Vector Graphics Editor
Loading...
Searching...
No Matches
Inkscape::UI::Widget::Stores Class Reference

#include <stores.h>

Classes

struct  Store
 

Public Types

enum class  Mode { None , Normal , Decoupled }
 
enum class  Action { None , Recreated , Shifted }
 

Public Member Functions

 Stores (Prefs const &prefs)
 Construct a blank object with no stores.
 
void set_graphics (Graphics *g)
 Set the pointer to the graphics object.
 
void reset ()
 Discards all stores. (The actual operation on the graphics is performed on the next update().)
 
Action update (Fragment const &view)
 Respond to a viewport change. (Requires a valid graphics.)
 
Action finished_draw (Fragment const &view)
 Respond to drawing of the backing store having finished. (Requires a valid graphics.)
 
void mark_drawn (Geom::IntRect const &rect)
 Record a rectangle as being drawn to the store.
 
Store const & store () const
 
Store const & snapshot () const
 
Mode mode () const
 

Private Member Functions

Geom::IntRect centered (Fragment const &view) const
 
void recreate_store (Fragment const &view)
 
void shift_store (Fragment const &view)
 
void take_snapshot (Fragment const &view)
 
void snapshot_combine (Fragment const &view)
 

Private Attributes

Mode _mode
 
Store _store
 
Store _snapshot
 
Graphics_graphics
 
Prefs const & _prefs
 

Detailed Description

Definition at line 23 of file stores.h.

Member Enumeration Documentation

◆ Action

Enumerator
None 
Recreated 

The backing store was not changed.

Shifted 

The backing store was completely recreated.

The backing store was shifted into a new rectangle.

Definition at line 33 of file stores.h.

◆ Mode

Enumerator
None 
Normal 

Not initialised or just reset; no stores exist yet.

Decoupled 

Normal mode consisting of just a backing store.

Decoupled mode consisting of both a backing store and a snapshot store.

Definition at line 26 of file stores.h.

Constructor & Destructor Documentation

◆ Stores()

Inkscape::UI::Widget::Stores::Stores ( Prefs const &  prefs)
inline

Construct a blank object with no stores.

Definition at line 50 of file stores.h.

Member Function Documentation

◆ centered()

Geom::IntRect Inkscape::UI::Widget::Stores::centered ( Fragment const &  view) const
private

◆ finished_draw()

auto Inkscape::UI::Widget::Stores::finished_draw ( Fragment const &  view)

Respond to drawing of the backing store having finished. (Requires a valid graphics.)

Definition at line 346 of file stores.cpp.

◆ mark_drawn()

void Inkscape::UI::Widget::Stores::mark_drawn ( Geom::IntRect const &  rect)
inline

Record a rectangle as being drawn to the store.

Definition at line 68 of file stores.h.

References _store, Inkscape::UI::Widget::Stores::Store::drawn, and geom_to_cairo().

◆ mode()

Mode Inkscape::UI::Widget::Stores::mode ( ) const
inline

Definition at line 73 of file stores.h.

References _mode.

Referenced by Inkscape::UI::Widget::CairoGraphics::paint_widget().

◆ recreate_store()

◆ reset()

void Inkscape::UI::Widget::Stores::reset ( )

Discards all stores. (The actual operation on the graphics is performed on the next update().)

Definition at line 249 of file stores.cpp.

References _mode, _snapshot, _store, Inkscape::UI::Widget::Stores::Store::drawn, and None.

◆ set_graphics()

void Inkscape::UI::Widget::Stores::set_graphics ( Graphics g)
inline

Set the pointer to the graphics object.

Definition at line 56 of file stores.h.

References _graphics.

◆ shift_store()

◆ snapshot()

Store const & Inkscape::UI::Widget::Stores::snapshot ( ) const
inline

◆ snapshot_combine()

◆ store()

◆ take_snapshot()

◆ update()

auto Inkscape::UI::Widget::Stores::update ( Fragment const &  view)

Respond to a viewport change. (Requires a valid graphics.)

Definition at line 257 of file stores.cpp.

References cairo_to_geom(), Geom::Parallelogram::contains(), expandedBy(), and result.

Member Data Documentation

◆ _graphics

Graphics* Inkscape::UI::Widget::Stores::_graphics
private

Definition at line 81 of file stores.h.

Referenced by recreate_store(), set_graphics(), shift_store(), snapshot_combine(), and take_snapshot().

◆ _mode

Mode Inkscape::UI::Widget::Stores::_mode
private

Definition at line 77 of file stores.h.

Referenced by mode(), and reset().

◆ _prefs

Prefs const& Inkscape::UI::Widget::Stores::_prefs
private

Definition at line 84 of file stores.h.

Referenced by centered(), and snapshot_combine().

◆ _snapshot

Store Inkscape::UI::Widget::Stores::_snapshot
private

Definition at line 78 of file stores.h.

Referenced by reset(), snapshot(), snapshot_combine(), and take_snapshot().

◆ _store

Store Inkscape::UI::Widget::Stores::_store
private

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