13
0
Commit Graph

875 Commits

Author SHA1 Message Date
c5fcdc1119 canvas: more work on table layout, still incomplete 2021-09-14 18:29:39 -06:00
44b11802bf canvas: initial (probably incorrect) implementation of Canvas::Table 2021-09-13 22:00:33 -06:00
d50693b97d cnavas: add lots more debug traces to box, and an explanatory comment 2021-09-10 13:02:01 -06:00
107ff8466a canvas: box should not try to reposition children for a zero-sized allocation 2021-09-10 13:01:26 -06:00
63a74d0911 Canvas: improve behavior of Widget::compute_bounding_box()
Firstly, ::compute_bounding_box() cannot allocate space, so do not try to do that here.
Secondly, if there is no allocation yet, use the CairoWidget's own size_request()
2021-09-10 12:59:29 -06:00
be461e95e1 canvas: remove debug output 2021-09-10 12:57:43 -06:00
300ca3124b canvas; temporarily resurrect ConstraintPacker interactive tests 2021-09-10 12:15:24 -06:00
494bc8da14 canvas: add ::set_size_request_to_display_given_text() analogous to Gtkmm2ext utility 2021-09-10 12:15:24 -06:00
90322399fc canvas: use fwd decl instead of header inclusion for CairoWidget 2021-09-10 12:15:24 -06:00
4bbfc60126 add 2 new canvas debug bits 2021-09-10 12:15:24 -06:00
51110a92d9 canvas: fix computation of Box bounding box 2021-08-31 13:21:12 -06:00
3734277263 canvas: improve box packing - compute child dimensions more correctly 2021-08-30 17:40:06 -06:00
b47fbc91e0 canvas: provide Rect::shrink () with four arguments 2021-08-30 17:39:39 -06:00
10253a6ae4
Fix Windows builds, remove unnecessary srandom() calls
Since fc90c92a49 Gtkmm2ext::random_color () uses g_random_int()
which is implicitly seeded when first used.
2021-08-14 01:29:49 +02:00
bf26be71aa move constraint packing tests out of the way 2021-08-13 17:27:20 -06:00
fc90c92a49
Fix Windows builds (rand/random API) 2021-08-14 01:07:13 +02:00
0095681493 fix cast in call to time(2) 2021-08-13 14:11:41 -06:00
d2b2b73c82 canvas; provide Rectangle::{height,width}() 2021-08-13 12:51:37 -06:00
0296b0b0cb canvas: don't call ::size_allocate() for children unless there is just one child and it is "layout sensitive
the dumb/Item version of ::size_allocate_children() doesn't do anything but give its full allocation to children, and if there
was more than one child, this could not be done in a "dumb" way. Likewise, if the sole child is not layout sensitive, it
doesn't care about size allocation
2021-08-13 12:51:37 -06:00
b416caf1bb canvas: several steps further with box packing and size allocation 2021-08-13 12:51:37 -06:00
88b95bc8f8 canvas: size_allocate() as a way to set position is only for layout-sensitive item trees 2021-08-13 12:51:37 -06:00
a1c67b4ad7 canvas: remove intrinsic size concept, fall back to requested size; converge on gtk style size_request 2021-08-13 12:51:37 -06:00
9698de0212 canvas: missing method 2021-08-13 12:51:37 -06:00
1a70cf5b8e canvasL Item gets packing options similar to GTK 2021-08-13 12:51:37 -06:00
5e3460aaae canvas: start to extend size allocation process for box packing 2021-08-13 12:51:37 -06:00
4a700f270d canvas: remove debug output 2021-08-13 12:51:37 -06:00
dc6a162ca1 canvas: remove Box::render() (it should just use Rectangle::render()) 2021-08-13 12:51:37 -06:00
85edd83338 canvas: correctly set Box _rect after repositioning children 2021-08-13 12:51:37 -06:00
da3ea7e236 canvas: rename variable for clarity 2021-08-13 12:51:37 -06:00
6f883650d8 canvas: use combined outline enum value for clarity 2021-08-13 12:51:37 -06:00
71fe17a241 canvas: impl of Rectangle::dump() 2021-08-13 12:51:37 -06:00
b2aa14a90b canvas; remove already-commented debug output 2021-08-13 12:51:37 -06:00
341a355de4 canvas: remove debug output 2021-08-13 12:51:37 -06:00
a55a004142 canvas: another fix to bounding box computation, this time for Item itself 2021-08-13 12:51:37 -06:00
b8b392f729 canvas: use whoami() instead of whatami() in some debugging output 2021-08-13 12:51:37 -06:00
a36d43c845 canvas: NOOP whitespace/indent a line 2021-08-13 12:51:37 -06:00
16bbf79cae canvas: decl for Rectangle::dump() 2021-08-13 12:51:37 -06:00
dc48f55285 canvas: bounding box changes for Container 2021-08-13 12:51:37 -06:00
9095057675 canvas: call Item::bounding_box() to recompute bounding box when needed
Since 74fe396cc5 compute_bounding_box() by itself does not do the entire computation, so we
must call into Item::bounding_box() to get the result with children added also
2021-08-13 12:51:37 -06:00
c0425ba70f canvas: items should not add child bboxes in their ::compute_bounding_box() method, Item::bounding_box() does that 2021-08-13 12:51:37 -06:00
ad6afbe68a canvas: use Item::bb_clean() to mark _bounding_box_dirty false 2021-08-13 12:51:36 -06:00
5b123441f4 canvas; change operator<<() for Rect to show BIG instead of gigantic 64 bit numbers 2021-08-13 12:51:36 -06:00
ddcd004350 canvas: only reset _bounding_box_dirty in the parent if the child's bbox did change 2021-08-13 12:51:36 -06:00
c1fa1e1a29 canvas: when an item's position is set, its bounding box has changed 2021-08-13 12:51:36 -06:00
f5753dcd07 missing member initialization 2021-08-13 12:51:36 -06:00
7066db16bd remove dangling method from rebase issues 2021-08-13 12:51:36 -06:00
14621f3634 add missing Box::set_homogenous() method 2021-08-13 12:51:36 -06:00
5153124664 change (GUI) Marker objects to accept any Canvas::Item as parent, and use this to draw BBT position markers in the BBT ruler 2021-08-13 12:51:34 -06:00
749a49c278 incorporating new tempo map API 2021-08-13 12:51:29 -06:00
82bad0725a libcanvas: reapply LineSet::add_line -> add_coord change after rebase conflicts with master 2021-08-13 12:51:27 -06:00
54de7c70ee Canvas: print item colors in hex when debugging 2021-08-13 12:51:27 -06:00
86a31e34ba Canvas: fix recursive calling of Item::size_allocate()
ConstraintPacker is the one Item-derivative that should NOT call Item::size_allocate_children()
because it just did the size computation for its children and called their
::constrained() method, which in turns calls size_allocate() with the correct size
2021-08-13 12:51:27 -06:00
dbe37d2752 Canvas: make possible even more debugging of constraint packing 2021-08-13 12:51:27 -06:00
f118b3ab53 Canvas: remove dangling cairo path in Arc or ConstraintPacker if fill was requested but not outline 2021-08-13 12:51:27 -06:00
1d96bad59f Canvas: remove cBox (API fully merged into ConstraintPacker) 2021-08-13 12:51:27 -06:00
1b66890547 Canvas: continuing move of cBox functionality into ConstraintPacker 2021-08-13 12:51:27 -06:00
4e82279ce4 Canvas: next step of merging cBox and ConstraintPacker 2021-08-13 12:51:27 -06:00
af60c50990 first steps in merging cBox into constraint packer 2021-08-13 12:51:27 -06:00
860d43697c Canvas: propagate ::size_allocate() down the item tree
This previously wasn't done because of fear that it would affect the traditional fixed-sized canvas,
but only items that _layout_sensitive (i.e. are packed into a constraint packer directly) will
actually do anything in ::size_allocate().

Possibly might want to relax this to cover items that have a constraint packer between them
and a root group.
2021-08-13 12:51:27 -06:00
28f85747ca Canvas: fix behavior of Rectangle when used in a constraint packer
::size_allocate() sets the _position *and* the "self" rect appropriately
2021-08-13 12:51:27 -06:00
3c2bd05750 Canvas: remove debug output 2021-08-13 12:51:27 -06:00
fa2885d2d6 Canvas: do not fill containers by default (added during constraint packing work; badly affects the regular canvas) 2021-08-13 12:51:27 -06:00
9909917976 Canvas: remove unnecessary and conflicting enum 2021-08-13 12:51:27 -06:00
2e4d228f54 manual fixes for constraint-packer -> newbbgui merge 2021-08-13 12:51:27 -06:00
93d2f6f433 remove debug output 2021-08-13 12:51:27 -06:00
b18aaf0c7c Rectangle border/sizing behaves like CSS border-box 2021-08-13 12:51:27 -06:00
27919fec61 items should not round their bounding box when requesting a redraw 2021-08-13 12:51:27 -06:00
9c071cd6ef Canvas::queue_draw_item_area() now expands the passed-in rect appropriately
This means that a request to (re)draw the Rect (0.5,0.5,9.5,9.5)
will actually generate an expose event for (0,0,10,10)

Note: the above rects are of the form (x0,y0,x1,y1)
2021-08-13 12:51:27 -06:00
35a9bcc409 add Rectangle::size_request() which returns actual rectangle size, not bounding box 2021-08-13 12:51:26 -06:00
12b4807bc9 add a very (very) basic resize/layout design to the canvas
Items call ::queue_resize(), which sets a flag in the canvas; at next idle, we call
Canvas::layout() which walks the item tree and recursively calls layout (depth first)
on all items needing a resize.

Only Container types implement layout, and so far only Box
2021-08-13 12:51:26 -06:00
03e32a22d0 make Item::add() virtual 2021-08-13 12:51:26 -06:00
9869b0266b add support for rounded corners to Canvas::Rectangle 2021-08-13 12:51:26 -06:00
4f671a0950 make ArdourCanvas::Rectangle render its children
it is common to want to pack things inside a rectangle, so make it work
2021-08-13 12:51:26 -06:00
8fb67e15ea steps in the evolution of beatbox 2021-08-13 12:51:26 -06:00
91de7ba60b do not double-translate Canvas::Rectangle by _position; item_to_window() already includes it by calling item_to_canvas() 2021-08-13 12:51:26 -06:00
aca1db2d06 add step_button to wscript 2021-08-13 12:51:26 -06:00
e35e5ff3e5 step button for Canvas (used by BeatBox GUI) 2021-08-13 12:51:26 -06:00
ff6fe51d76 Canvas: improve implementation/design of ConstraintPacker::preferred_size() 2021-08-13 12:51:26 -06:00
502a9e80dc Canvas: add a nice new syntax for constraint packing 2021-08-13 12:51:26 -06:00
d6745f043c Canvas: clean up Constraint expressions to avoid compiler warnings 2021-08-13 12:51:26 -06:00
aa62460081 Canvas: re-use Solver as much as possible, with possible (but not substantive) speedup; remove debug output 2021-08-13 12:51:26 -06:00
815eb82882 Canvas: partially improve/fix cBox rendering 2021-08-13 12:51:26 -06:00
2598bdef2c Canvas: mark constraint-layout containers as layout-sensitive (like their children) 2021-08-13 12:51:26 -06:00
f5d67e6520 Canvas: temporary easy way to get debug output from Canvas::render() in a test program 2021-08-13 12:51:26 -06:00
427998e2d2 Canvas: cleanup first constraint test 2021-08-13 12:51:26 -06:00
be481ec266 Canvas: fix fill/outline area for a cBox 2021-08-13 12:51:26 -06:00
0823a6328b Canvas: third constraint test 2021-08-13 12:51:26 -06:00
a349d7e49b remove debug output 2021-08-13 12:51:26 -06:00
94b44ceb52 Canvas: add second constraint tester 2021-08-13 12:51:26 -06:00
0d5725a63b Canvas; fix rectangle rendering geometry 2021-08-13 12:51:26 -06:00
04d00da461 Canvas: fix text rendering geometry 2021-08-13 12:51:26 -06:00
7153544b52 Canvas: many changes to cBox implementation 2021-08-13 12:51:26 -06:00
d37202585f Canvas: root group should not fill or outline itself 2021-08-13 12:51:26 -06:00
2e993c6f86 Canvas: tweak test script runner 2021-08-13 12:51:26 -06:00
61742ededf Canvas: change behavior of Item::preferred_size() for items without an intrinsic size 2021-08-13 12:51:26 -06:00
ea96798ee9 Canvas: tweak debug output for canvas rendering 2021-08-13 12:51:26 -06:00
0434f00a47 remove debug output 2021-08-13 12:51:26 -06:00
711c1520b5 Revert "towards a very different constraint layout tester"
This reverts commit 7f65ffe57685304f59bb336c9701c3a9d5cdc1a7.
2021-08-13 12:51:26 -06:00
11931f5ffb towards a very different constraint layout tester 2021-08-13 12:51:26 -06:00
f0a0104087 Canvas: add shell scrip to run cnnstraint_test 2021-08-13 12:51:26 -06:00
504d8fdab3 Canvas: size request using preferred_size() callstack 2021-08-13 12:51:26 -06:00
5650d4f5bb Canvas: container supports option to do fill & outline 2021-08-13 12:51:26 -06:00
55deb1261a Canvas: use whomami() not earlier debug_name() API 2021-08-13 12:51:26 -06:00
811a893583 Canvas: some tidying in layout test app 2021-08-13 12:51:26 -06:00
240cb7b98f Canvas: make Rectangle work with layouts 2021-08-13 12:51:26 -06:00
e0c58a2736 Canvas: add aliases to Canvas::Rect for comprehension 2021-08-13 12:51:26 -06:00
2423994029 Canvas: add aliases to Canvas::Rect for comprehension 2021-08-13 12:51:26 -06:00
f47deb717c Canvas: add layout-related methods and members to Item 2021-08-13 12:51:25 -06:00
6d89d3afef Canvas: add Item::whoami() for debugging output 2021-08-13 12:51:25 -06:00
f17160ee0e Canvas: modify Arc to work with layout 2021-08-13 12:51:25 -06:00
ad39faeb3e Canvas: alter RootGroup to work with layout 2021-08-13 12:51:25 -06:00
baea368223 Canvas: initiate size allocation process from GTK-level size allocate event 2021-08-13 12:51:25 -06:00
84afcb62c4 Canvas: child_changed() API fix for Box 2021-08-13 12:51:25 -06:00
fc9840f2a9 Canvas: change API of Item::child_changed() to include bool indicate bounding_box change 2021-08-13 12:51:25 -06:00
d6fa458f3b Canvas: Text item should take position into account when rendering 2021-08-13 12:51:25 -06:00
1baa8d68c7 Canvas: reindent Kiwi code, and provide operator<<(ostream&) for several objects 2021-08-13 12:51:25 -06:00
ba3515e619 NOOP: remove whitespace 2021-08-13 12:51:25 -06:00
b1a6982064 Canvas::Arc obey fill/outline conditionals 2021-08-13 12:51:25 -06:00
a3039d3895 add/update constraint packing containers, test code 2021-08-13 12:51:25 -06:00
606866ea00 add small dev/test utility for working on constraint packer 2021-08-13 12:51:25 -06:00
1c3e743d2a Canvas: continued work on constraint packer 2021-08-13 12:51:25 -06:00
01137cbbf3 Canvas: change container-related methods in Item to be virtual 2021-08-13 12:51:25 -06:00
b90332b439 Canvas: change LineSet::add() to ::add_line()
Preparation for virtualization of Item::add()
2021-08-13 12:51:25 -06:00
539e1a1f1b stub constraint-based packer for canvas 2021-08-13 12:51:25 -06:00
5957e14259
Remove unused #include<> (2/2)
PBD::stacktrace() is not used nor needed by default.
It should be used sparingly.
2021-05-05 17:57:16 +02:00
d04713c0ab
Add missing class to canvas forward declarations 2021-02-14 00:54:17 +01:00
20029ec7e6 canvas/ruler: provide option for a second font to be used for "major" marks 2021-01-03 16:50:18 -07:00
8a14a7a00b
Fix tracking-text offset
If position along a given axis is not tracked, then the
offset was applied repeatedly to the current position.
This caused the coordinate to run away.
2020-12-30 03:26:00 +01:00
d741f01ad0
NO-OP: whitespace 2020-12-30 03:25:57 +01:00
ce8846d13f
Fix polygon redrawing -- #8148
Polygons used PolyLine::render() to render the path.
However since 7bb8ca1e76, the PolyLine path is constrained
(for automation lanes), and closed shaped polygons were not
always completely redrawn.
2020-07-09 02:10:28 +02:00
247bd4d3d9
NO-OP: whitespace 2020-04-10 18:32:18 +02:00
ede0fd3ddf
Remove hardcoded 2^15 cairo-boundary, prefer window-area 2020-04-10 18:28:26 +02:00
2177462b73
NO-OP: consistent function and variable naming 2020-04-10 18:06:42 +02:00
bc4de874dc
NO-OP: whitespace 2020-04-10 18:06:42 +02:00
9bbedcb781
Remove unused function
Cairo::curve_to renders cubic Bézier splines, those are not
generally useful in a DAW context.

Canvas::Curve implements centripetal catmull-rom spline drawing
which can be used for fades and automation interpolation.
2020-04-10 18:06:42 +02:00
7bb8ca1e76
Interpolate poly-line with view-point #6481 2020-04-10 18:06:41 +02:00
6cc1e5e75d
NO-OP: whitespace 2020-04-10 18:06:39 +02:00
f744b5fc12 change velocity bar inside notes to extend to edges of note
Having the velocity bar inset from note causes distracting space at beginning of note
when viewing a MIDI note that is zoomed out
2020-03-26 10:12:54 -06:00
4151ec1907 remove accumulated debug output 2020-03-25 15:12:30 -06:00
dbcf7dd666 more playhead-drag/click locate debugging 2020-03-25 13:50:23 -06:00
André Nusser
0a1ed004f2
Remove unused forward declaration. 2020-02-24 23:01:15 +01:00
06b2eb1c27
Explicitly use OSX
Previously this was inherited via PBD.

On MacOS/X,  this adds
  "-undefined dynamic_lookup -flat_namespace"
and various "-framework .." options to linkflags

Without this flag, .dylibs fail to link usually because
of missing `-lintl` (Undefined symbols: "_libintl_dgettext")

On other systems this is a NO-OP:
CFLAGS_OSX, CXXFLAGS_OSX and LINKFLAGS_OSX
are only set on the darwin platform.
2020-01-25 04:07:41 +01:00
bca825e515
NO-OP: whitespace 2020-01-14 00:52:24 +01:00
John Emmas
45dd6a8ed3 Add a missing semicolon 2020-01-05 10:29:35 +00:00
0b266a54f0
Return of image-surface backed canvas (windows graphics performance)
This partially reverts 2edbda2526.

Using cairo-groups increases performance on MacOS, and retains
retina-resolution.
However it adds a performance regression for MS Windows graphics
rendering. cairo-groups use a "similar" surface, not an image surface.
Empirically this adds significant overhead compared to rendering
using the CPU and using bitblt.
2020-01-04 00:30:07 +01:00
2edbda2526
Replace explicit image-surface with cairo pattern/group
For MacOS/X this is equivalent, rendering happens using a
CGBitmapContext + image-surface. Windows and Linux needs profiling
for respective equivalent surfaces.
2019-12-27 19:35:02 +01:00
c3ab63a2ea
Allow for per-widget image-surface backing
This is an intermediate commit, before replacing image surfaces with
cairo pattern groups.

The eventual goal is to reduce flickering and/or use
CPU + bitblt for specific widgets instead of cairo
graphics-cards accel.

This also removes excessive calls to getenv() for every rendering
operation.
2019-12-27 19:34:56 +01:00
ecc2597870
Fix remaining doxygen warnings (!) 2019-09-30 21:03:29 +02:00
bfec73b8c3
NO-OP: whitespace, indent 2019-09-30 21:03:20 +02:00
5ec5bc4523 goodbye USE_TRACKS_CODE_FEATURES and is_tracks_build 2019-09-25 12:16:13 -06:00