Commit graph

949 commits

Author SHA1 Message Date
Robin Gareus
58f1d46e31
One font to rule the rulers.
Remove bold fonts for Bar/beats and font-size
inconsistency on macOS (VerySmall, SmallBold).

This reverts commit e3dc0a24f2.
and 14318dd342
and a76afae0e9
and 7c27f617dc
and 20029ec7e6
2025-01-23 19:43:26 +01:00
Paul Davis
7c892d7286 avoid crash when using -D canvasenterleave
This only happens when the canvas finds zero items to deliver
events too, which should never really happen but did while working on pianoroll
stuff.
2025-01-08 14:26:29 -07:00
Paul Davis
24a1fd9dbe NO-OP: whitespace 2024-12-26 09:28:06 -07:00
Robin Gareus
05f3ac50cc Focus grab pointer to receive motion events for 1st touch
X11 emulates MotionEvents for the 1st finger on a touch-screen
(no explicit touch events are sent) IFF the pointer is grabbed.
So let's do that.

Note 1st finger touch uncnditionally creates press and release events
2024-12-12 17:34:44 +01:00
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
Ben Loftis
23ba0f8338 fix for 'green' canvas redraws: cairo expects x,y,w,h not x,y,x+,y+ 2024-11-23 08:43:44 -06: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
ea64eb87c5 canvas; fix thinko and typo in Rectangle size_request() 2024-11-05 15:02:06 -07:00
Paul Davis
a3deba207e Canvas: auto-fy a couple of lops in Box::reposition_children() 2024-11-05 14:58:44 -07:00
Paul Davis
e6758b6ba8 Canvas; make button handle dynamic size allocation 2024-11-05 14:56:37 -07:00
Paul Davis
b500eeb36e canvas; fix indent in Text::dump() 2024-11-05 14:56:11 -07:00
Paul Davis
5808c6e78f Canvas: fix logic bug when setting child items to be layout sensitive
Also, auto-fy the loop
2024-11-05 14:55:37 -07:00
Paul Davis
ba782dd097 Canvas; items added to a box become layout sensitive 2024-11-05 14:54:39 -07:00
Paul Davis
370b045715 canvas: fix typo in using explicit size request 2024-11-05 14:53:54 -07:00
Paul Davis
75177f3ef8 canvas: honor explicit size request for Rectangle 2024-11-05 14:53:22 -07:00
Paul Davis
d260b1d4c0 Canvas::Button improvements 2024-11-05 13:27:22 -07: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
74c4ca3e52
Reduce reliance on boost - the hard part
the rest from `tools/convert_boost.sh`.

* replace boost::function, boost::bind with std::function and std::bind.

This required some manual fixes, notably std::placeholders,
some static_casts<>, and boost::function::clear -> = {}.
2024-10-19 03:47:21 +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
Robin Gareus
168b917730
Prepare for std::optional 2024-10-19 03:40:04 +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
c8924f4133 fix lollipop drawing
Cairo coordinate/argument limits are much smaller than the canvas. Trying
to clip to a gigantic rectangle throws cairo into a weird state, so
make sure we only clip to a part an exposed area
2024-10-17 07:44:31 -06:00
Paul Davis
59ed3d7138 cleanup canvas piano roll header so that it can exist with no current MidiView 2024-10-17 07:44:30 -06:00
Paul Davis
10244c0360 tempo bar and BBT ruler in MIDI cue editor 2024-10-17 07:44:30 -06:00
Paul Davis
e3205bded0 do something to make MIDI bindings accessible in any EditingContext 2024-10-17 07:44:29 -06:00
Paul Davis
10b48d2cc4 lock in some major steps for the midi cue/pianoroll editor 2024-10-17 07:44:29 -06:00
Paul Davis
69d63bac92 do not plot ruler marks that are left of the current (scroll-adjusted) canvas edge 2024-05-29 14:13:47 -06:00
Paul Davis
e7b3b61dbc fix bad redraws caused by TrackingText on canvas
Probably Item::set_position() should call Item::set_bbox_dirty() but
this will do as a first pass at that
2024-04-12 18:50:03 -06: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
Paul Davis
802d9fa487 correctly implement canvas expose redraw for both single- and multi-expose contexts 2024-03-18 10:47:31 -06:00
Robin Gareus
ad51c7c2ba
Localize stripped down gtk2
This is intended mainly for GNU/Linux distros who will remove
GTK2 support in the near future.
2024-01-06 21:52:48 +01:00
Robin Gareus
92d6cb9933
Fix alloc-dealloc-mismatch (video image) 2023-12-12 20:36:55 +01:00
Mads Kiilerich
6b61b03434 wscript: drop traces of shutdown() handling
autowaf has no real shutdown functionality anyway. The automatic
shutdown function that could have been called wouldn't work anyway, as
it takes an argument.

The only reason it doesn't fail is that the top level wscript has no
shutdown handling and doesn't recurse to other scripts, so it is all
dead code.
2023-10-15 10:47:16 -06:00
Mads Kiilerich
88cecdfaef wscript: drop repeated autowaf.set_options - it is enough to set at top level 2023-10-15 10:47:16 -06:00
Paul Davis
cd99fed7cd canvas: add PolyItem::clear() 2023-09-30 11:09:58 -06:00
Paul Davis
0a6ac2678a canvas: if LineSet does the 0.5 pixel shift, make it the right direction 2023-09-25 20:01:21 -06:00
Paul Davis
5fa5c5d202 canvas: NOOP fix comment about docs on single pixel lines 2023-09-25 19:52:10 -06:00
Paul Davis
bc78694a1a canvas: fix bounding box of a LineSet (lower edge was not lower enough) 2023-09-25 19:51:33 -06:00
Mads Kiilerich
f1bb18ae53 wscript: drop unused path_prefix
It is not referenced anywhere, and also not set consistently.
2023-09-17 07:34:55 -06:00
Mads Kiilerich
d220f477ed wscript: drop unused "mandatory variables" 'top' and 'out' in libs
Variables by these names are only used from the local wscript and when
running "waf configure", which already for other reasons only can run at
the top-level.

These variables are thus not mandatory and not used.
2023-09-17 07:34:55 -06:00
Mads Kiilerich
a0916ef368 wscript: drop unused APPNAME assignment in libs
https://waf.io/book/ says
  By default, the project name and version are set to noname and 1.0. To
  change them, it is necessary to provide two additional variables in
  the top-level project file

- and waf code inspection confirms that waf itself only will use the top
level APPNAME.

Also, the 'waf dist' comment doesn't seem relevant - especially after
this change - and is removed too.

(Note: libs/evoral/wscript and libs/temporal/wscript still use APPNAME
for other purposes.)
2023-09-17 07:34:55 -06:00
Mads Kiilerich
3b4cf9191c wscript: drop unused VERSION assignment in libs
https://waf.io/book/ says
  By default, the project name and version are set to noname and 1.0. To
  change them, it is necessary to provide two additional variables in the
  top-level project file

- and waf code inspection confirms that waf itself only will use the top
  level VERSION.

Some wscripts will use
  bld.env['VERSION']
but that will also just use the value set in the top wscript.
2023-09-17 07:34:55 -06:00
Mads Kiilerich
7737c17d52 wscript: drop unused imports, scripted
Done with ad hoc scripting hacks processing unused imports found by pyflakes:

for f in $( find * -name wscript ); do echo; pyflakes $f; done | grep 'waflib.Logs.* but unused' | cut -d: -f1 | while read f; do sed -i 's/^import waflib.Logs as Logs,/import/g' $f; done
for f in $( find * -name wscript ); do echo; pyflakes $f; done | grep 'waflib.Options.* but unused' | cut -d: -f1 | while read f; do sed -i 's/import waflib.Options as Options, /import /g' $f; done
for f in $( find * -name wscript ); do echo; pyflakes $f; done | grep 'waflib.Options.* but unused' | cut -d: -f1 | while read f; do sed -i 's/^from waflib import Options,/from waflib import/g' $f; done
for f in $( find * -name wscript ); do echo; pyflakes $f; done | grep ' imported but unused$' | sed "s/^\([^:]*\):[0-9]*:[0-9]* '\(.*\)'.*/\1 \2/g" | while read f lib; do sed -i "/^import $lib$/d" $f; done
for f in $( find * -name wscript ); do echo; pyflakes $f; done | grep 'waflib.Options.* but unused' | cut -d: -f1 | while read f; do sed -i '/from waflib import Options$/d' $f; done
for f in $( find * -name wscript ); do echo; pyflakes $f; done | grep 'waflib.TaskGen.* but unused' | cut -d: -f1 | while read f; do sed -i '/from waflib import TaskGen$/d' $f; done
for f in $( find * -name wscript ); do echo; pyflakes $f; done | grep 'waflib.Task.Task.* but unused' | cut -d: -f1 | while read f; do sed -i '/^from waflib.Task import Task$/d' $f; done
for f in $( find * -name wscript ); do echo; pyflakes $f; done | grep 'waflib.Tools.winres.* but unused' | cut -d: -f1 | while read f; do sed -i '/^from waflib.Tools import winres$/d' $f; done
for f in $( find * -name wscript ); do echo; pyflakes $f; done | grep 'waflib.Utils.* but unused' | cut -d: -f1 | while read f; do sed -i '/^import waflib.Utils as Utils$/d' $f; done
2023-09-17 07:34:55 -06:00