Commit graph

5758 commits

Author SHA1 Message Date
33f299e45f Relative-Hook: observe CSS padding and margin
and voilà: now the placeholder buttons appear nicely within
the content area of each track
2020-02-29 00:24:22 +01:00
2bbbcf36bc Relative-Hook: decide on coordinate system usage
...and resolve associated problems with overal canvas size
2020-02-28 23:13:53 +01:00
99d0f0a0ae Relative-Hook: investigate and resolve wrong offset on child tracks
The reason was: each further ViewRefHook added again the full offset.
Need to change the hierarchy and allow for this chained hooking already
starting from the base interface ViewHook onward (with trivial default impl)
2020-02-28 22:11:00 +01:00
c252449388 problem with automatic scrollbar disappearing after focus loss (see #1208) 2020-02-28 01:49:35 +01:00
396bf9d1ec Relative-Hook: investigate wrong offset of attached widgets
...not fully conclusive yet.
However, the split into two canvas controls plays an important role here;
at some point we need to translate into the coordinates shifted by the height
of the first, pinned canvas (track profile "prefix").

This is an attempt to hide that away as a technical detail,
buried within the calculation of the track body height allocation.
2020-02-28 01:32:34 +01:00
1ee2f18d65 Relative-Hook: remove obsolete direct manipulation (test) code
the marked pars are diagnostics code anyway,
however, the first attempt used direct manipulation of the child offsets from "outside".
Now, after switching to the ViewHook-mechanism, such direct manipulation
of view innards is no longer neccessary, as can be verified by removing that test code now.
2020-02-27 21:42:53 +01:00
0837498cc0 Relative-Hook: proof-of-concept based on ViewHook (see #1207)
this draft commit reshifts the (meanwhile broken) test code from:
03c358fe86

Now the marker Buttons are injected again, but without any detailed
positioning code at call site. This demonstrates the viability of the
Structure-Change / ViewHook refactoring.

To make this change viable, it was necessary to remove the ViewHooked<>
marker template from the rehook() callback. As it turns out, this was
added rather for logical reasons, and is in fact not necessary in
any of the existing ViewHook implementations (and I don't expect any
other implementations to come)

BUT the actual positioning coordinates are still wrong (which seems
to re related to other conceptual problems in coordinate offset handling)
2020-02-27 21:03:46 +01:00
7e015f9a7f DOC: detailed start-up sequence of the GUI (closes #1145)
This changeset documents the current known state of UI startup into the TiddlyWiki.
It summarises all information and notes from various places in my mindmap.

Fazit:
 * largely, the startup sequence is sane
 * there are some open gaps and possible races -> see #1192
 * these are rather hard to fix; maybe it's preferrable to rewrite the subsystem runner #1177
2020-02-23 22:45:37 +01:00
cf8c3c27d6 DummySessionConnection: fix structural defect in population diff
...which erroneously assumed the list of timelines to be empty.
When sending a further population diff, this assumption is broken,
since the first diff resulted in adding a timeline element.

This misatke was detected by the new consistency check added with
9f3fe8a88
2020-02-22 19:05:50 +01:00
d0cf027686 UI-Base: expunge the implicit conversion from UI-Element to BusTerm::ID
this conversion seemed to be somewhat cool,
but turned into a nuisance over time.

In the end its better to be explicit about such stuff.
2020-02-22 18:12:23 +01:00
14b6a1e6aa UI-Base: diagnostic self-ID for any "tangible" UI-Element
low hanging fruit, and quite helpful e.g. when a Diff flounders,
since it will automatically show up in the exception message.
2020-02-22 18:09:24 +01:00
b2b5cf0f6d MERGE: upgrade to Debian/Buster and to C++17 2020-02-22 02:16:25 +01:00
421a2ed49a C++17: some related clean-up 2020-02-21 23:55:09 +01:00
beb8406abe Project: switch to C++17 (closes: #1138)
Signed-off-by: Ichthyostega <prg@ichthyostega.de>
2020-02-21 21:10:51 +01:00
00c9ecb659 C++17: fix detector for function signatures
failure was likewise caused by `noexcept` being part of the signature type now
2020-02-21 20:16:59 +01:00
8c12e88fd3 C++17: fix detector for STL container iterability
the reason for the failure, as it turned out,
is that 'noexcept' is part of the function signature since C++17

And, since typically a STL container has const and non-const variants
of the begin() and end() function, the match to a member function pointer
became ambuguous, when probing with a signature without 'noexcept'

However, we deliberately want to support "any STL container like" types,
and this IMHO should include types with a possibly throwing iterator.
The rationale is, sometimes we want to expose some element *generator*
behind a container-like interface.

At this point I did an investigation if we can emulate something
in the way of a Concept -- i.e. rather than checking for the presence
of some functions on the interface, better try to cover the necessary
behaviour, like in a type class.

Unfortunately, while doable, this turns out to become quite technical;
and this highlights why the C++20 concepts are such an important addition
to the language.

So for the time being, we'll amend the existing solution
and look ahead to C++20
2020-02-21 18:57:49 +01:00
577592c66e C++17: isolate problematic code segments (see Ticket #1138)
as it turns out, "almost" the whole codebase compiles in C++17 mode.

with the exception of two metaprogramming-related problems:

 - our "duck detector" for STL containers does not trigger anymore
 - the Metafunction to dissect Function sigantures (meta::_Fun) flounders
2020-02-18 04:16:03 +01:00
3cfe5a13b1 fix failing test - boost::format is getting better
"%broken" is not broken anymore, but renders a boolean,
and we configured the formatter not to complain on missing values.

Fortunately "%madness" is still broken ;-)
2020-02-17 03:32:43 +01:00
38837da65e Timehandling: choose safer representation for fractional seconds (closes #939)
When drafting the time handling framework some years ago,
I foresaw the possible danger of mixing up numbers relating
to fractional seconds, with other plain numbers intended as
frame counts or as micro ticks. Thus I deliberately picked
an incompatible integer type for FSecs = boost::rational<long>

However, using long is problematic in itself, since its actual
bit length is not fixed, and especially on 32bit platforms long
is quite surprisingly defined to be the same as int.

However, meanwhile, using the new C++ features, I have blocked
pretty much any possible implicit conversion path, requiring
explicit conversions in the relevant ctor invocations. So,
after weighting in the alternatives, FSecs is now defined
as boost::rational<int64_t>.
2020-02-17 03:13:36 +01:00
8867ae55ad Clean-up: problematic function signature
GCC8 now spots and warns about such mismatches.

And we should take such warnings seriously;
code produced by the newer GCC versions tends to segfault,
especially under -O2 and above, when a return statement is
actually missing, even if the return value is actually not
used at call site.

Here, a functor to unlock the active "guard" is passed into
a macro construct, which basically allows to abstract the
various kinds of "guards", be it mutex, condition variable
or the like.

Seemingly, the intention was to deal with a failure when
unlocking -- however all the real implementations prefer
to kill the whole application without much ado.
2020-02-16 02:05:42 +01:00
e639558e2c Debian-Buster: compile Fix for GCC-8
Yeah... we are there, finally!
2020-02-16 02:05:42 +01:00
f7967a674f Structure-Change: complete refactoring of the DisplayFrame 2019-12-22 01:43:56 +01:00
e4049534fa Structure-Change: now able to turn the widgets within DisplayFrame into ViewHooked
...and implemented the base case (=Recursion) of the corresponding ViewHook(s)
2019-12-21 23:57:53 +01:00
c5d0ddb01b Structure-Change: push a set of suitable ViewHook-Interfaces into the DisplayFrame
...actual Operations not yet implemented (but trivial to implement in the end)
2019-12-20 22:15:35 +01:00
33a19c404b Structure-Change: introduce a common accessor interface
...to solve the problem with interwoven nested ctor invocation.
This interface also promises to help with nested invcations,
without being overly generic.
2019-12-20 20:06:26 +01:00
c5bffa21f4 Structure-Change: introduce new ViewHook interface into TimelineLayout
...with the goal to supersede the tricky DisplayFrame ctor closure used for this purpose
2019-12-20 00:21:31 +01:00
cef7917d8e Diff-Listener: finished and unit test pass (closes: #1206) 2019-12-15 21:40:09 +01:00
9f3fe8a885 Diff-Framework: add clean-up hook to diff-application
Our diff language requires a diff to handle the complete contents of the target.
Through this clean-up hook this is now in fact enforced.

The actual reason for adding this however was that I need to ensure
listeners are triggered
2019-12-15 15:06:04 +01:00
3e1d0036ed Diff-Listener: resolve template instantiation errors
As it turned out, the reason was a missing move-ctor.
The base of the whole DSL-Stack, TreeMutator, is defined MoveOnly,
and this is also the intended use (build an anonymous instance
through the DSL and move it into the work buffer prior to diff application)

However, C++ does *cease to define* a move ctor implicitly,
whenever /one of the "big five" is defined explicitly/.

So Detector4StructuralChanges was the culprit, it defined a dtor,
but failed to define the move ctor explicitly.


So.... well, this did cost me several hours to track down,
yet I still rather do not want to write all those ctors explicitly all the time,
and so I am still in favour of implicitly generated ctors, even if they hurt sometimes.
2019-12-15 13:54:29 +01:00
854f4eca58 Diff-Listener: investigate weird template errors
with the new decorator layer, we suddenly trigger a chain of template instantiation errors.
At first sight, they are almost undecipherable, yet after some experimentation, it becomes clear
that they relate down to the base class (TreeMutator), which is defined MoveOnly

This seems to indicate that, at some point in the call chain, we are
digressing from the move-construction scheme and switch over to copy construction,
which in the end failst (and shall fail).

Inconclusive, to be investigated further
2019-12-15 04:12:20 +01:00
d8e0ad179b TreeMutator: better invoke the Builder-ctor explicitly
...by relying on an implicit conversion,
the code does not become simpler, just shorter, and even more confusing :-/
2019-12-15 04:06:57 +01:00
d8b20ae497 Diff-Listener: fill in implementation
...basically just need to intercept three TreeMutator-operations
2019-12-15 04:04:25 +01:00
a33e236630 Diff-Listener: define API 2019-12-14 23:35:16 +01:00
806d569e06 Diff-Framework: resolve lurking problems with specific STL containers
basically the solution was a bit too naive and assumed everything is similar to a vector.
It is not, and this leads to some insidious problems with std::map, which hereby
are resolved by introducing ContainerTraits
2019-12-14 01:29:21 +01:00
8a5f1bc8d7 Diff-Listener: add a similar simplistic demo for opaque binding
based on a TreeMutator binding to a STL vector

...because this is probably the most frequently used case
2019-12-13 01:05:04 +01:00
3321e5bc6b Diff-Listener: need a really basic test
All of the existing "simple" tests for the »Diff Framework« are way to much low-level;
they might indeed be elementary, but not introductory and simple to grasp.
We need a very simplistic example to show off the idea of mutation by diff,
and this simple example can then be used to build further usage test cases.

My actual goal for #1206 to have such a very basic usage demonstration and then
to attach a listener to this setup, and verify it is actually triggered.

PS: the name "GenNodeBasic_test" is somewhat pathetic, this test covers a lot
of ground and is anything but "basic". GenNode in fact became a widely used
fundamental data structure within Lumiera, and -- admittedly -- the existing
implementation might be somewhat simplistic, while the whole concept as such
is demanding, and we should accept that as the state of affairs
2019-12-12 23:41:26 +01:00
f6a4ee3f89 Library: no need to log lifecycle of the advice system on each invocation
Basically the advice system is just some further helper component with
a lookup table, which "just works" transparently most of the time.

We'd need those diagnostic messages only when explicitly debugging
for some kind of access-after death, which should not happen as long
as we stick to the general policy not to allow any significant functionality
to be hooked up from dtors
2019-12-12 23:17:43 +01:00
c86f914915 Structure-Change: re-order entity naming
ViewHookable -> ViewHook
ViewHook -> ViewHooked
2019-12-12 17:02:24 +01:00
c501a38590 Structure-Change: fix test after refactoring / add lifecycle warning
now the lifecycle of widget and hook are tightly interwoven.
Indeed the test uncovered a situation where a call into the
already destroyed Canvas might halt the application.
2019-12-09 01:24:51 +01:00
0a20d18242 Structure-Change: implement the changed API and memory layout
NOTE: 2 test failures
2019-12-08 23:57:43 +01:00
99e367f33b Structure-Change: draft other API for hooking up widgets
...basically it occurred to me that in practice we will never have to deal
with isolated ViewHooks, rather with widgets-combinded-with-a-hook.
So the idea is to combine both into a template ViewHooked<W>
2019-12-08 21:09:25 +01:00
ffcac2ea1e Structure-Change: implement a simplistic implementation of re-ordering
...verified by the rather conceptual unit test
2019-12-06 23:19:09 +01:00
305ff8e6cc Structure-Change: draft API for re-ordering attached widgets
basically this attempts to work around an "impedance mismatch" caused by relying on Lumiera's Diff framework.
Applying a diff might alter the structural order of components, without those componets
being aware of the change. If especially those components are attached into some
UI layout, or otherwise delegate to display widgets, we need a dedicated mechanism
to reestablish those display elements in proper order after applying the change.

The typical examples is a sequence of sub-Tracks, which might have been reordert due
to applying rules down in the Steam Layer. The resulting diff will propagate the
new order of sub-Tracks up into the UI, yet now all of the elaborate layout and
space allocation done in the presentation code needs to be adjusted or even
recomputed to accomodate the change.
2019-12-06 21:53:43 +01:00
8ba315561f Structure-Change: in-depth analysis of design alternatives
...leading to the conclusion to use this as a design pattern rather,
without trying to evolve it into a fundamental backbone framework
2019-12-05 22:25:48 +01:00
3bedbd1dff Structure-Change: attempt to solve a problem with cross-type access 2019-12-02 00:35:17 +01:00
ed409c3570 Structure-Change: exapnd on the idea of a generic Visitor
...to form a single framework for view attachment.
Obviously, we have two quite distinct cases to cover
- attaching a widget onto a canvas
- hooking a widget as subtree into a grid/tree control
2019-12-02 00:35:10 +01:00
1bcdf9860c Structure-Change: continue design/analysis 2019-12-02 00:34:41 +01:00
c573630ac1 Structure-Change: draft a design based on ViewHook / ViewHookable
By applying a Diff, the children of some timeline element (track) may be re-ordered.
This imposes specific problems, since these elements hold onto slave-Widgets,
which are already attached into some elaborated and nested widget structure.
To keep complexity under control, we can not allow the TrackPresenter to have
any knowledge regarding the implementation structure of these target widgets.

Thus I am pondering the idea to represent that relation as an abstracted ViewHook link
2019-12-02 00:34:20 +01:00
37d2e52c1e ClipDisplay: also verify invocation of widget relocation via ViewHook
...obviously this is just a dummy implementation and serves only to verify the design
2019-11-08 21:37:09 +01:00
bdf3351f55 ClipDisplay: basic implementation of ViewHook helper 2019-11-08 20:49:37 +01:00