Inkscape
Vector Graphics Editor
Loading...
Searching...
No Matches
Inkscape::CanvasPage Class Reference

#include <canvas-page.h>

Public Member Functions

 CanvasPage ()
 
 ~CanvasPage ()
 
void update (Geom::Rect size, Geom::OptRect margin, Geom::OptRect bleed, const char *txt, bool outline, bool is_yaxisdown)
 Update the visual representation of a page on screen.
 
void add (Geom::Rect size, CanvasItemGroup *background_group, CanvasItemGroup *foreground_group)
 Add the page canvas to the given canvas item groups (canvas view is implicit)
 
void remove (UI::Widget::Canvas *canvas)
 Hide the page in the given canvas widget.
 
void show ()
 
void hide ()
 
void set_guides_visible (bool show)
 
bool setOnTop (bool on_top)
 
bool setShadow (int shadow)
 
bool setPageColor (Color const &border, Color const &bg, Color const &canvas, Color const &margin, Color const &bleed)
 
bool setLabelStyle (const std::string &style)
 

Public Attributes

bool is_selected = false
 

Private Member Functions

void _updateTextItem (CanvasItemText *label, Geom::Rect page, std::string txt, bool is_yaxisdown)
 Update the page's textual label.
 

Private Attributes

std::vector< CanvasItemPtr< CanvasItem > > canvas_items
 
int _shadow_size = 0
 
bool _border_on_top = true
 
Color _background_color {0xffffffff}
 
Color _border_color {0x00000040}
 
Color _canvas_color {0xffffffff}
 
Color _margin_color {0x1699d771}
 
Color _bleed_color {0xbe310e62}
 
std::string _label_style = "default"
 

Detailed Description

Definition at line 30 of file canvas-page.h.

Constructor & Destructor Documentation

◆ CanvasPage()

Inkscape::CanvasPage::CanvasPage ( )
default

◆ ~CanvasPage()

Inkscape::CanvasPage::~CanvasPage ( )
default

References add().

Member Function Documentation

◆ _updateTextItem()

void Inkscape::CanvasPage::_updateTextItem ( CanvasItemText label,
Geom::Rect  page,
std::string  txt,
bool  is_yaxisdown 
)
private

Update the page's textual label.

Definition at line 188 of file canvas-page.cpp.

References _canvas_color, _label_style, Inkscape::Colors::get_perceptual_lightness(), is_selected, label, and page.

Referenced by update().

◆ add()

void Inkscape::CanvasPage::add ( Geom::Rect  size,
CanvasItemGroup background_group,
CanvasItemGroup foreground_group 
)

Add the page canvas to the given canvas item groups (canvas view is implicit)

Definition at line 26 of file canvas-page.cpp.

References _bleed_color, _margin_color, canvas_items, item, label, Inkscape::size, and Inkscape::Colors::Color::toRGBA().

Referenced by SPPage::showPage(), and ~CanvasPage().

◆ hide()

void Inkscape::CanvasPage::hide ( )

Definition at line 88 of file canvas-page.cpp.

References canvas_items, and item.

Referenced by SPPage::hidePage(), and SPNamedView::SPNamedView().

◆ remove()

void Inkscape::CanvasPage::remove ( UI::Widget::Canvas canvas)

Hide the page in the given canvas widget.

Definition at line 69 of file canvas-page.cpp.

References canvas_items.

Referenced by SPPage::hidePage().

◆ set_guides_visible()

void Inkscape::CanvasPage::set_guides_visible ( bool  show)

Definition at line 95 of file canvas-page.cpp.

References canvas_items, item, and show().

Referenced by SPPage::set_guides_visible().

◆ setLabelStyle()

bool Inkscape::CanvasPage::setLabelStyle ( const std::string &  style)

Definition at line 260 of file canvas-page.cpp.

References _label_style.

◆ setOnTop()

bool Inkscape::CanvasPage::setOnTop ( bool  on_top)

Definition at line 229 of file canvas-page.cpp.

References _border_on_top.

◆ setPageColor()

bool Inkscape::CanvasPage::setPageColor ( Color const &  border,
Color const &  bg,
Color const &  canvas,
Color const &  margin,
Color const &  bleed 
)

◆ setShadow()

bool Inkscape::CanvasPage::setShadow ( int  shadow)

Definition at line 238 of file canvas-page.cpp.

References _shadow_size.

◆ show()

void Inkscape::CanvasPage::show ( )

Definition at line 81 of file canvas-page.cpp.

References canvas_items, and item.

Referenced by set_guides_visible(), and SPPage::showPage().

◆ update()

void Inkscape::CanvasPage::update ( Geom::Rect  size,
Geom::OptRect  margin,
Geom::OptRect  bleed,
const char *  txt,
bool  outline,
bool  is_yaxisdown 
)

Update the visual representation of a page on screen.

Parameters
size- The size of the page in desktop units
txt- An optional label for the page
outline- Disable normal rendering and show as an outline.

Definition at line 110 of file canvas-page.cpp.

References _background_color, _bleed_color, _border_color, _border_on_top, _margin_color, _shadow_size, _updateTextItem(), canvas_items, is_selected, item, label, margin, Inkscape::outline(), Inkscape::size, and Inkscape::Colors::Color::toRGBA().

Referenced by SPPage::update().

Member Data Documentation

◆ _background_color

Color Inkscape::CanvasPage::_background_color {0xffffffff}
private

Definition at line 59 of file canvas-page.h.

Referenced by setPageColor(), and update().

◆ _bleed_color

Color Inkscape::CanvasPage::_bleed_color {0xbe310e62}
private

Definition at line 63 of file canvas-page.h.

Referenced by add(), setPageColor(), and update().

◆ _border_color

Color Inkscape::CanvasPage::_border_color {0x00000040}
private

Definition at line 60 of file canvas-page.h.

Referenced by setPageColor(), and update().

◆ _border_on_top

bool Inkscape::CanvasPage::_border_on_top = true
private

Definition at line 58 of file canvas-page.h.

Referenced by setOnTop(), and update().

◆ _canvas_color

Color Inkscape::CanvasPage::_canvas_color {0xffffffff}
private

Definition at line 61 of file canvas-page.h.

Referenced by _updateTextItem(), and setPageColor().

◆ _label_style

std::string Inkscape::CanvasPage::_label_style = "default"
private

Definition at line 65 of file canvas-page.h.

Referenced by _updateTextItem(), and setLabelStyle().

◆ _margin_color

Color Inkscape::CanvasPage::_margin_color {0x1699d771}
private

Definition at line 62 of file canvas-page.h.

Referenced by add(), setPageColor(), and update().

◆ _shadow_size

int Inkscape::CanvasPage::_shadow_size = 0
private

Definition at line 57 of file canvas-page.h.

Referenced by setShadow(), and update().

◆ canvas_items

std::vector<CanvasItemPtr<CanvasItem> > Inkscape::CanvasPage::canvas_items
private

Definition at line 55 of file canvas-page.h.

Referenced by add(), hide(), remove(), set_guides_visible(), show(), and update().

◆ is_selected

bool Inkscape::CanvasPage::is_selected = false

Definition at line 48 of file canvas-page.h.

Referenced by _updateTextItem(), SPPage::setSelected(), and update().


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