Ardour  9.0-pre0-582-g084a23a80d
ArdourCanvas::Canvas Class Referenceabstract

#include <canvas.h>

Inheritance diagram for ArdourCanvas::Canvas:
[legend]

Public Member Functions

 Canvas ()
 
virtual ~Canvas ()
 
virtual void request_redraw (Rect const &)=0
 
virtual void request_size (Duple)=0
 
virtual void grab (Item *)=0
 
virtual void ungrab ()=0
 
virtual void queue_resize ()=0
 
virtual void focus (Item *)=0
 
virtual void unfocus (Item *)=0
 
virtual bool have_grab () const
 
virtual bool grab_can_translate () const
 
void render (Rect const &, Cairo::RefPtr< Cairo::Context > const &) const
 
void prepare_for_render (Rect const &) const
 
gint64 get_last_render_start_timestamp () const
 
gint64 get_microseconds_since_render_start () const
 
Itemroot ()
 
void freeze_queue_draw ()
 
void thaw_queue_draw ()
 
void set_background_color (Gtkmm2ext::Color)
 
Gtkmm2ext::Color background_color () const
 
virtual void item_going_away (Item *, Rect)
 
virtual void item_shown_or_hidden (Item *)
 
void item_visual_property_changed (Item *)
 
void item_changed (Item *, Rect)
 
void item_moved (Item *, Rect)
 
Duple canvas_to_window (Duple const &, bool rounded=true) const
 
Duple window_to_canvas (Duple const &) const
 
void canvas_to_window (Coord cx, Coord cy, Coord &wx, Coord &wy)
 
void window_to_canvas (Coord wx, Coord wy, Coord &cx, Coord &cy)
 
void scroll_to (Coord x, Coord y)
 
void add_scroller (ScrollGroup &i)
 
virtual Rect visible_area () const =0
 
virtual Coord width () const =0
 
virtual Coord height () const =0
 
virtual bool get_mouse_position (Duple &winpos) const =0
 
Duple clamp_to_window (Duple const &winpos, Duple border=Duple())
 
void zoomed ()
 
std::string indent () const
 
std::string render_indent () const
 
void dump (std::ostream &) const
 
virtual void re_enter ()=0
 
virtual void start_tooltip_timeout (Item *)
 
virtual void stop_tooltip_timeout ()
 
virtual Glib::RefPtr< Pango::Context > get_pango_context ()=0
 
void use_intermediate_surface (bool yn=true)
 
void set_debug_render (bool yn)
 
bool debug_render () const
 

Static Public Member Functions

static void set_tooltip_timeout (uint32_t msecs)
 

Public Attributes

sigc::signal< void, Duple const & > MouseMotion
 
sigc::signal< void > PreRender
 
bool item_save_restore
 

Protected Member Functions

void queue_draw_item_area (Item *, Rect)
 
Rect compute_draw_item_area (Item *, Rect)
 
virtual void pick_current_item (int state)=0
 
virtual void pick_current_item (Duple const &, int state)=0
 

Protected Attributes

Root _root
 
uint32_t _queue_draw_frozen
 
Rect frozen_area
 
Gtkmm2ext::Color _bg_color
 
bool _debug_render
 
gint64 _last_render_start_timestamp
 
std::list< ScrollGroup * > scrollers
 
bool _use_intermediate_surface
 

Static Protected Attributes

static uint32_t tooltip_timeout_msecs
 

Detailed Description

The base class for our different types of canvas.

A canvas is an area which holds a collection of canvas items, which in turn represent shapes, text, etc.

The canvas has an arbitrarily large area, and is addressed in coordinates of screen pixels, with an origin of (0, 0) at the top left. x increases rightwards and y increases downwards.

Definition at line 72 of file canvas/canvas/canvas.h.

Constructor & Destructor Documentation

◆ Canvas()

ArdourCanvas::Canvas::Canvas ( )

◆ ~Canvas()

virtual ArdourCanvas::Canvas::~Canvas ( )
inlinevirtual

Definition at line 76 of file canvas/canvas/canvas.h.

Member Function Documentation

◆ add_scroller()

void ArdourCanvas::Canvas::add_scroller ( ScrollGroup i)

◆ background_color()

Gtkmm2ext::Color ArdourCanvas::Canvas::background_color ( ) const
inline

Definition at line 114 of file canvas/canvas/canvas.h.

◆ canvas_to_window() [1/2]

void ArdourCanvas::Canvas::canvas_to_window ( Coord  cx,
Coord  cy,
Coord wx,
Coord wy 
)
inline

Definition at line 126 of file canvas/canvas/canvas.h.

◆ canvas_to_window() [2/2]

Duple ArdourCanvas::Canvas::canvas_to_window ( Duple const &  ,
bool  rounded = true 
) const

◆ clamp_to_window()

Duple ArdourCanvas::Canvas::clamp_to_window ( Duple const &  winpos,
Duple  border = Duple() 
)

Ensures that the position given by winpos (in window coordinates) is within the current window area, possibly reduced by border.

◆ compute_draw_item_area()

Rect ArdourCanvas::Canvas::compute_draw_item_area ( Item ,
Rect   
)
protected

◆ debug_render()

bool ArdourCanvas::Canvas::debug_render ( ) const
inline

Definition at line 190 of file canvas/canvas/canvas.h.

◆ dump()

void ArdourCanvas::Canvas::dump ( std::ostream &  ) const

◆ focus()

virtual void ArdourCanvas::Canvas::focus ( Item )
pure virtual

called to ask the canvas' host to keyboard focus on an item

Implemented in ArdourCanvas::GtkCanvas, ArdourSurface::Push2Canvas, and ArdourSurface::Maschine2Canvas.

◆ freeze_queue_draw()

void ArdourCanvas::Canvas::freeze_queue_draw ( )

◆ get_last_render_start_timestamp()

gint64 ArdourCanvas::Canvas::get_last_render_start_timestamp ( ) const
inline

Definition at line 101 of file canvas/canvas/canvas.h.

◆ get_microseconds_since_render_start()

gint64 ArdourCanvas::Canvas::get_microseconds_since_render_start ( ) const

◆ get_mouse_position()

virtual bool ArdourCanvas::Canvas::get_mouse_position ( Duple winpos) const
pure virtual

Store the coordinates of the mouse pointer in window coordinates in winpos . Return true if the position was within the window, false otherwise.

Implemented in ArdourCanvas::GtkCanvas, ArdourSurface::Push2Canvas, and ArdourSurface::Maschine2Canvas.

◆ get_pango_context()

virtual Glib::RefPtr<Pango::Context> ArdourCanvas::Canvas::get_pango_context ( )
pure virtual

◆ grab()

virtual void ArdourCanvas::Canvas::grab ( Item )
pure virtual

called to ask the canvas' host to ‘grab’ an item

Implemented in ArdourCanvas::GtkCanvas, ArdourSurface::Push2Canvas, and ArdourSurface::Maschine2Canvas.

◆ grab_can_translate()

virtual bool ArdourCanvas::Canvas::grab_can_translate ( ) const
inlinevirtual

Reimplemented in ArdourCanvas::GtkCanvas.

Definition at line 95 of file canvas/canvas/canvas.h.

◆ have_grab()

virtual bool ArdourCanvas::Canvas::have_grab ( ) const
inlinevirtual

Reimplemented in ArdourCanvas::GtkCanvas.

Definition at line 94 of file canvas/canvas/canvas.h.

◆ height()

virtual Coord ArdourCanvas::Canvas::height ( ) const
pure virtual

◆ indent()

std::string ArdourCanvas::Canvas::indent ( ) const

◆ item_changed()

void ArdourCanvas::Canvas::item_changed ( Item ,
Rect   
)

◆ item_going_away()

virtual void ArdourCanvas::Canvas::item_going_away ( Item ,
Rect   
)
inlinevirtual

Called when an item is being destroyed

Reimplemented in ArdourCanvas::GtkCanvas.

Definition at line 117 of file canvas/canvas/canvas.h.

◆ item_moved()

void ArdourCanvas::Canvas::item_moved ( Item ,
Rect   
)

◆ item_shown_or_hidden()

virtual void ArdourCanvas::Canvas::item_shown_or_hidden ( Item )
virtual

Reimplemented in ArdourCanvas::GtkCanvas.

◆ item_visual_property_changed()

void ArdourCanvas::Canvas::item_visual_property_changed ( Item )

◆ pick_current_item() [1/2]

virtual void ArdourCanvas::Canvas::pick_current_item ( Duple const &  ,
int  state 
)
protectedpure virtual

◆ pick_current_item() [2/2]

virtual void ArdourCanvas::Canvas::pick_current_item ( int  state)
protectedpure virtual

◆ prepare_for_render()

void ArdourCanvas::Canvas::prepare_for_render ( Rect const &  ) const

◆ queue_draw_item_area()

void ArdourCanvas::Canvas::queue_draw_item_area ( Item ,
Rect   
)
protected

◆ queue_resize()

virtual void ArdourCanvas::Canvas::queue_resize ( )
pure virtual

called to ask for a resize/relayout of all or part of the canvas

Implemented in ArdourSurface::Push2Canvas, ArdourSurface::Maschine2Canvas, and ArdourCanvas::GtkCanvas.

◆ re_enter()

virtual void ArdourCanvas::Canvas::re_enter ( )
pure virtual

Ask the canvas to pick the current item again, and generate an enter event for it.

Implemented in ArdourSurface::Push2Canvas, ArdourSurface::Maschine2Canvas, and ArdourCanvas::GtkCanvas.

◆ render()

void ArdourCanvas::Canvas::render ( Rect const &  ,
Cairo::RefPtr< Cairo::Context > const &   
) const

◆ render_indent()

std::string ArdourCanvas::Canvas::render_indent ( ) const

◆ request_redraw()

virtual void ArdourCanvas::Canvas::request_redraw ( Rect const &  )
pure virtual

called to request a redraw of an area of the canvas in WINDOW coordinates

Implemented in ArdourCanvas::GtkCanvas, ArdourSurface::Push2Canvas, and ArdourSurface::Maschine2Canvas.

◆ request_size()

virtual void ArdourCanvas::Canvas::request_size ( Duple  )
pure virtual

called to ask the canvas to request a particular size from its host

Implemented in ArdourCanvas::GtkCanvas, ArdourSurface::Push2Canvas, and ArdourSurface::Maschine2Canvas.

◆ root()

Item* ArdourCanvas::Canvas::root ( )
inline
Returns
root group

Definition at line 106 of file canvas/canvas/canvas.h.

◆ scroll_to()

void ArdourCanvas::Canvas::scroll_to ( Coord  x,
Coord  y 
)

◆ set_background_color()

void ArdourCanvas::Canvas::set_background_color ( Gtkmm2ext::Color  )

◆ set_debug_render()

void ArdourCanvas::Canvas::set_debug_render ( bool  yn)
inline

Definition at line 189 of file canvas/canvas/canvas.h.

◆ set_tooltip_timeout()

static void ArdourCanvas::Canvas::set_tooltip_timeout ( uint32_t  msecs)
static

Set the timeout used to display tooltips, in milliseconds

◆ start_tooltip_timeout()

virtual void ArdourCanvas::Canvas::start_tooltip_timeout ( Item )
inlinevirtual

Reimplemented in ArdourCanvas::GtkCanvas.

Definition at line 175 of file canvas/canvas/canvas.h.

◆ stop_tooltip_timeout()

virtual void ArdourCanvas::Canvas::stop_tooltip_timeout ( )
inlinevirtual

Reimplemented in ArdourCanvas::GtkCanvas.

Definition at line 176 of file canvas/canvas/canvas.h.

◆ thaw_queue_draw()

void ArdourCanvas::Canvas::thaw_queue_draw ( )

◆ unfocus()

virtual void ArdourCanvas::Canvas::unfocus ( Item )
pure virtual

called to ask the canvas' host to drop keyboard focus on an item

Implemented in ArdourCanvas::GtkCanvas, ArdourSurface::Push2Canvas, and ArdourSurface::Maschine2Canvas.

◆ ungrab()

virtual void ArdourCanvas::Canvas::ungrab ( )
pure virtual

called to ask the canvas' host to ‘ungrab’ any grabbed item

Implemented in ArdourSurface::Push2Canvas, ArdourSurface::Maschine2Canvas, and ArdourCanvas::GtkCanvas.

◆ use_intermediate_surface()

void ArdourCanvas::Canvas::use_intermediate_surface ( bool  yn = true)

Redirect drawing to an intermediate (image) surface. see also https://www.cairographics.org/manual/cairo-cairo-t.html#cairo-push-group

◆ visible_area()

virtual Rect ArdourCanvas::Canvas::visible_area ( ) const
pure virtual

◆ width()

virtual Coord ArdourCanvas::Canvas::width ( ) const
pure virtual

◆ window_to_canvas() [1/2]

void ArdourCanvas::Canvas::window_to_canvas ( Coord  wx,
Coord  wy,
Coord cx,
Coord cy 
)
inline

Definition at line 132 of file canvas/canvas/canvas.h.

◆ window_to_canvas() [2/2]

Duple ArdourCanvas::Canvas::window_to_canvas ( Duple const &  ) const

◆ zoomed()

void ArdourCanvas::Canvas::zoomed ( )

Member Data Documentation

◆ _bg_color

Gtkmm2ext::Color ArdourCanvas::Canvas::_bg_color
protected

Definition at line 198 of file canvas/canvas/canvas.h.

◆ _debug_render

bool ArdourCanvas::Canvas::_debug_render
protected

Definition at line 199 of file canvas/canvas/canvas.h.

◆ _last_render_start_timestamp

gint64 ArdourCanvas::Canvas::_last_render_start_timestamp
mutableprotected

Definition at line 201 of file canvas/canvas/canvas.h.

◆ _queue_draw_frozen

uint32_t ArdourCanvas::Canvas::_queue_draw_frozen
protected

Definition at line 196 of file canvas/canvas/canvas.h.

◆ _root

Root ArdourCanvas::Canvas::_root
protected

Definition at line 195 of file canvas/canvas/canvas.h.

◆ _use_intermediate_surface

bool ArdourCanvas::Canvas::_use_intermediate_surface
protected

Definition at line 213 of file canvas/canvas/canvas.h.

◆ frozen_area

Rect ArdourCanvas::Canvas::frozen_area
protected

Definition at line 197 of file canvas/canvas/canvas.h.

◆ item_save_restore

bool ArdourCanvas::Canvas::item_save_restore

Definition at line 192 of file canvas/canvas/canvas.h.

◆ MouseMotion

sigc::signal<void,Duple const&> ArdourCanvas::Canvas::MouseMotion

Signal to be used by items that need to track the mouse position within the window.

Definition at line 154 of file canvas/canvas/canvas.h.

◆ PreRender

sigc::signal<void> ArdourCanvas::Canvas::PreRender

Definition at line 156 of file canvas/canvas/canvas.h.

◆ scrollers

std::list<ScrollGroup*> ArdourCanvas::Canvas::scrollers
protected

Definition at line 211 of file canvas/canvas/canvas.h.

◆ tooltip_timeout_msecs

uint32_t ArdourCanvas::Canvas::tooltip_timeout_msecs
staticprotected

Definition at line 203 of file canvas/canvas/canvas.h.


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