Commit Graph

373 Commits

Author SHA1 Message Date
Robin Gareus
4866baacf5 Release NSGLView, fixes heap-use-after-free 2024-12-06 18:52:04 +01:00
Robin Gareus
ac6c00da26 Add support for Touch events to Ardour Canvas 2024-12-02 21:13:16 +01:00
Alejandro Domínguez
5223b176f3 Replace boost::shared_array<T> with std::shared_ptr<T[]> 2024-11-06 23:03:19 +01:00
Alejandro Domínguez
9544855fdd Remove unused headers 2024-11-06 22:50:35 +01:00
Paul Davis
c1ad49a411 skeleton for a canvas button 2024-11-05 13:27:22 -07:00
Mads Kiilerich
b4ff4f356c Make header files more self-contained - add missing Ardour and lib includes 2024-10-20 03:30:46 +02:00
Robin Gareus
ff95d81612 Reduce reliance on boost - the easy part
* boost::unordered_map -> std::unordered_map
* BOOST_STATIC_ASSERT/static_assert
* BOOST_FOREACH -> for
* boost::tuple -> std::tuple/g
* boost::math::isnormal -> std::isnormal
* boost::container::set -> std::set
* boost::none -> std::nullopt
* boost::optional -> std::optional
2024-10-19 03:41:16 +02:00
Alejandro Domínguez
2436b4df06 Replace boost::noncopyable with C++11 deleted copy constructors 2024-10-19 01:04:15 +02:00
Robin Gareus
2d7cce44f1 Replace PBD::Signals (1/2) 2024-10-18 20:41:08 +02:00
Paul Davis
adfba3d39d allow runtime control over cairo save/restore around item rendering
This is to allow easier debugging of whether a given item's render method fails to leave a cairo
context in the same state it received it in
2024-03-22 13:39:03 -06:00
Paul Davis
e64af8e4ed add a test for an environment variable before switching canvas single-expose off 2024-03-18 11:28:16 -06:00
Paul Davis
4b563ae518 move CairoCanvas::render() implementation for ArdourCanvas::Canvas into source
Note that this implementation only redraws a single (cairo_rectangle_t-defined) rect, and cannot
provide sub-rects the way that a normal GDK/GTK expose-driven redraw can
2024-03-18 10:50:36 -06:00
Paul Davis
71e085d825 ensure that the canvas fully redraws after style/visibility events 2024-03-18 10:49:15 -06:00
Robin Gareus
92d6cb9933 Fix alloc-dealloc-mismatch (video image) 2023-12-12 20:36:55 +01:00
Paul Davis
cd99fed7cd canvas: add PolyItem::clear() 2023-09-30 11:09:58 -06:00
Paul Davis
de67226c90 provide PolyItem::pop_back() 2023-07-09 20:41:36 -06:00
Paul Davis
91500795d8 canvas: extend PolyItem API with ::add_point() 2023-06-26 14:18:18 -06:00
Paul Davis
8a204bcf51 lollis: draw stems in fill color (optionally) 2023-06-26 14:18:18 -06:00
Paul Davis
a6c1a3d9d0 lollis: potentially clip circle with a bounding parent 2023-06-26 14:18:18 -06:00
Paul Davis
96c9f2ee19 canvas: add velocity() method to Note 2023-06-26 14:18:18 -06:00
Paul Davis
279e648a43 canvas: ArdourCanvas::Lollipop to not (mis)use _position 2023-06-26 14:18:18 -06:00
Paul Davis
f7e97be115 canvas lollipops: object redesign and reimplementation 2023-06-26 14:18:17 -06:00
Paul Davis
7e4a3dce01 lollipop pixel pushing 2023-06-26 14:18:17 -06:00
Paul Davis
4bafadc419 steps to an ecology of lollipops 2023-06-26 14:18:17 -06:00
Paul Davis
187569dcbc new Lollipop canvas item 2023-06-26 14:18:17 -06:00
Paul Davis
4f87506e5c do not sort lineset every time a coord is added; use RAII to create scope and sort at end 2023-04-09 14:36:03 -06:00
Paul Davis
b35518e212 switch from boost::{shared,weak}_ptr to std::{shared,weak}_ptr
This is mostly a simple lexical search+replace but the absence of operator< for
std::weak_ptr<T> leads to some complications, particularly with Evoral::Sequence
and ExportPortChannel.
2023-03-24 14:19:15 -06:00
Paul Davis
39ed528e25 std-ize: convert all boost shared/weak ptr includes to <memory>
Also fix stdint.h -> cstdint and alphabetically order std includes
2023-03-24 14:19:15 -06:00
Robin Gareus
509504acf2 Add API to set openGL backing scale 2023-02-04 22:25:52 +01:00
Robin Gareus
d12dd4015d Revert canvas debugging
This reverts commit 8359311849.
This reverts commit f377822891.
This reverts commit 859d6ebe4a.
This reverts commit 4cd7de7a6f.
2023-02-04 18:23:18 +01:00
Paul Davis
4cd7de7a6f debugging: allow selection no-draw for canvas fill, outline, text, lineset and waveview 2023-01-20 18:13:12 -07:00
Paul Davis
ab34861388 canvas: provide a means of blocking change notifications from Item propagating up the object tree 2022-12-10 13:37:16 -07:00
Robin Gareus
70b00f5201 Canvas: allow to group rendering of child items
> This group functionality can be convenient for performing
> intermediate compositing. One common use of a group is to
> render objects as opaque within the group, (so that they
> occlude each other), and then blend the result with
> translucence onto the destination.
https://www.cairographics.org/manual/cairo-cairo-t.html#cairo-push-group

The main use case where will be to render opaque layered
[MIDI] regions transparently onto a grid.
2022-12-10 02:37:04 +01:00
Robin Gareus
34e7c2ffc5 Remove cruft (unused CANVAS_COMPATIBILITY - 1/3) 2022-11-19 21:49:01 +01:00
David Robillard
bdacfb8724 Fix invalid use of Doxygen "@param" command
This is never for inline references to parameters, only for starting parameter
documentation blocks.  The "@p" command is for this, although unfortunately
Doxygen doesn't actually do anything with it and it's just an alias for code
text.
2022-10-30 20:44:28 -04:00
Paul Davis
384530984a canvas: make "debug_render" into a per-canvas member variable
This allows us to debug rendering in specific canvases, rather
than all of them.
2022-09-03 16:46:41 -06:00
Paul Davis
02b05f295a use selected (outline) color for MIDI note velocity bar (thanks, cooltehno, for the idea) 2022-08-31 13:53:43 -06:00
Paul Davis
5a0019f9a6 canvas: comment out unimplemented method 2022-08-03 12:08:57 -06:00
luz paz
36226cfd0a Fix various typos in libs/canvas 2022-08-03 12:07:46 -06:00
Paul Davis
ef07fb601a libcanvas: FramedCanvas::covers() method is ill-conceived. Use PolyItem::covers() 2022-05-29 14:19:02 -06:00
Paul Davis
f913373351 canvas: change Item::bb_clean() to better named Item::set_bbox_clean() 2022-04-26 22:04:08 -06:00
Paul Davis
c75ceb31ab canvas: when an item has its bbox marked dirty, this should propagate to all parents 2022-04-26 22:04:08 -06:00
Paul Davis
b6d0f8f661 canvas: add a drawing-request-freeze/thaw API
If queue_draw is "frozen", we simply accumulate drawing
requests in a (union) rectangle, and when finally "thawed"
the canvas submits a single redraw request for the entire
accumulated rect.

Although in theory this is all that GTK/GDK does for
draw requests, callgrind reveals significant costs
associated with the actual calltree for GtkWidget::queue_draw_area().

One potential cost is that GDK also maintains a list of
invalidated rectangles in addition to the union, and
for MIDI regions with thousands of notes, this can represent
real overhead. This approach dispenses with the rect list,
since our Canvas drawing model only uses the union rectangle
anyway.
2022-04-05 20:52:09 -06:00
Paul Davis
993c7c4bec canvas: manually remove changes from 6f91dc0799 and implement same goal in a different way
The AudioClipEditor features a scroll bar that is a part of the canvas. Because scroll
groups are at the top level of a canvas, the scroll bar is necessary within a scroll
group, which causes it to get confused about the difference between its own
position within the canvas and that of the scroll group. This commit introduces
a per-Item flag, _scroll_translation, which is true by default. If false, the
item will not have coordinates translated to reflect scroll group position.
2022-01-20 09:45:47 -07:00
Paul Davis
b2bd748672 ruler: make ::set_metric() API consistent with constructor by using ptr 2021-12-24 15:34:18 -07:00
Paul Davis
753d1c9754 rulers: change API to accept a pointer instead of a reference to a Metric
We need to be able to construct Metrics after the ruler is constructed
in order to deal with Triggers which are potentially short-lived. We
stored the reference as a pointer anyway, so it's not as much of a change
as it appears.
2021-12-24 14:17:23 -07:00
Paul Davis
6f91dc0799 canvas: fix an issue with event coordinate translation by ScrollGroup
If there's a grabbed item (GtkCanvas only at present) then unless it belongs to the scroll
group used for scroll offset translation, the event coordinates should not be translated,
even if the mouse pointer moves into the scroll group.
2021-12-10 18:17:58 -07:00
Ben Loftis
dc826c6521 ArdourCanvas Rectangle: allow subclasses access to _rect 2021-12-07 16:32:49 -06:00
Paul Davis
0f0c5c7039 remove Kiwi constraint-based packing code from canvas library and users (library version) 2021-11-04 11:25:30 -06:00
Paul Davis
211b3ea668 canvas text: generalize ::font_size_for_height() to handle different font families 2021-10-19 10:54:27 -06:00