Commit Graph

17 Commits

Author SHA1 Message Date
Paul Licameli e6e96de0fd Replace most inclusions of MemoryX.h with <memory> ...
... Most often it was needed for a custom definition of std::make_unique, but
we build C++14 now.
2021-06-02 07:08:19 -04:00
Paul Licameli 406b23cae7 More uses of AUDACITY_DLL_API...
... in many places where the function call will later need to be between
modules (or libraries, or the executable) and the annotation will be a necessity
to keep the linkage working on Windows.

That's all that this sweeping commit does.
2021-05-10 10:46:55 -04:00
Paul Licameli f64bc5a829 Pass non-const AudacityProject to HitTest::Preview...
... because that will be needed for elimination of some GetActiveProject()
calls.  Because some overrides need to find the focused track, but that may
mutate the project by setting the focused track when it wasn't yet defined.
2020-01-04 09:40:33 -05:00
Paul Licameli 4a5abc9e41 Pass AudacityProject* to more methods of UIHandle 2020-01-03 10:09:46 -05:00
Paul Licameli dc216d669b Move drawing code for snap guidelines 2019-06-26 23:39:42 -04:00
Paul Licameli f84d92f0a8 Move drawing code for zoom guidelines 2019-06-26 23:39:42 -04:00
Paul Licameli cb2ea25afc Define drawing function of CellularPanel, which visits nodes 2019-06-26 23:39:42 -04:00
Paul Licameli 7a038c9e51 Remove tab key target cycling and snap escape; reimplement for Esc 2017-07-15 20:37:39 -04:00
Paul Licameli b7ae012ece A single UIHandle can define multiple rotation states 2017-07-13 12:11:25 -04:00
Paul Licameli 4eece4b0b1 Extras like snap guidelines can be drawn for targets not yet clicked 2017-07-13 12:11:13 -04:00
Paul Licameli d7738c403f Handles mark need for highlight in new Enter() method not ctor...
... So this can be called more than once in its lifetime, in response to
TAB key rotation.
2017-07-12 13:03:14 -04:00
Paul Licameli b3d62e2ab6 Simplify by removing class HitTestResult...
... Because all hit tests returned all fields blank, or else, returned a
UIHandle object whose Preview method gives the rest of the information; so
the other fields were redundant.
2017-07-09 07:57:34 -04:00
Paul Licameli f5b0afc2fc Rename TrackPanel::HandleCursor as HandleMotion...
Call HitTest in just one place

Can now preserve repeatedly hit UIHandle objects during pre-click motion

Fields of HitTestResult besides the handle pointer are now unused

The need to repaint a track during mouse movement can be indicated when
constructing a UIHandle or when updating it for move; HitPreview no longer
does this

And the last allows simplifications of LabelTrack glyph highlighting

Also move the temporary state for label glyph dragging out of LabelTrack
2017-07-09 07:56:47 -04:00
Paul Licameli 2c1a16f593 Changed lifetime management of UIHandle objects, no singletons...
... Rather, construct them during hit tests (also capturing more state sooner
rather than at Click time, and adding some accessors for later use)

This also fixes bug 1677 by other means and avoids similar problems.

A cell may be implemented to re-use a previously hit handle object, not yet
clicked, in a later hit test, by remembering a weak pointer, but TrackPanel
holds the strong pointers that determine when the object is destroyed.

And the objects will surely be destroyed after drag-release, or ESC key.

For now they are also destroyed whenever not dragging, and hit-testing is
re-invoked; that will be changed later, so that the re-use mentioned above
becomes effective, but still they will be destroyed when the pointer moves
from one cell to another.
2017-07-09 07:23:28 -04:00
Paul Licameli 3a8280c562 Distinguish TrackPanelMouseState from TrackPanelMouseEvent...
... Let cell hit tests, and handle preview, know states only, not transitions.

Cell hit tests are passed a mouse state that does not always match the current,
but anticipates the button click to come; usually left, but if the Control
[sic] key on Mac is down, then right.

Thus, pressing and releasing Mac Control in multi-tool switches in and out of
the magnifier cursor.
2017-07-09 06:38:55 -04:00
Paul Licameli fa5a742e22 weak_ptr not events to avoid dangling track pointers in UIHandles 2017-06-25 13:35:15 -04:00
Paul Licameli 14d45eda33 Define and use the UIHandle and TrackPanelCell protocols, but...
...no actions reimplemented to them yet.

Later commits will move special cases one at a time from TrackPanel, preserving
all click and drag capabilities at each step.  With a few exceptions, but those
lost abilities are restored in yet later commits.  (Ctrl+Click on the Label
track being one.)
2017-06-15 08:20:56 -04:00