Commit graph

5772 commits

Author SHA1 Message Date
31116fb079 Clip: draft state-switching operation 2020-03-15 17:26:13 +01:00
4015a98d23 Clip: wire the optional startpoint parameter
...to indicate how the setting up the delegate might decide upon the appearance style

WIP: this is more than half baked
 - for one it seems doubtful to pass a hidden hint regarding appearance through that optional argument
 - and then, most importantly, we should be passing a time::TimeSpan
2020-03-15 00:47:55 +01:00
0f6f09180e Lib: simplified optional access to nested record attributes
Yeah, C++17, finally!

...not totally sure if we want to go that route.
However, the noise reduction in terms of code size at call site looks compelling
2020-03-14 23:52:04 +01:00
a9ed0c01db Lib: minor indentation fix
by convention, braces for member functions are only indented within a class body,
not for a stand-alone function definition (even if just inline)
2020-03-14 23:04:52 +01:00
e4db0dbfd1 Clip: draft initialisation of display delegate (see #1038)
...first steps towards a solution to switch the appearence style of clips
2020-03-14 22:02:03 +01:00
f763e90d2d DisplayEvaluation: prefer simpler solution without templates
...while the first solution looked as a nice API, abstracting away
the actual collections (and in fact helped me to sport and fix a problem
with type substitution), in the end I prefer a simpler solution.
Since we're now passing in a lambda for transform anyway, it is
completely pointless to create an abstracted iterator type, just
for the sole purpose of dereferencing an unique_ptr.

As it stands now, this is all tightly interwoven implementation code,
and the DisplayFrame is no longer intended to become an important
interface on it's own (this role has been taken by the ViewHook /
ViewHooked types).

Note: as an asside, this solution also highlights, that our
TreeExplorer framework has gradually turned into a generic
pipeline building framework, rendering the "monadic use" just
one usage scenario amongst others. And since C++20 will bring
us a language based framework for building iteration pipelines,
very similar to what we have here, we can expect to retrofit
this framework eventually. For this reason, I now start using
the simple name `lib::explore(IT)` as a synonym.
2020-03-08 02:31:49 +01:00
c7d157e295 Library: integrate generic min/max function
...built while investigating type deduction problems on PtrDerefIter
...also allow PtrDerefIter to work with std::unique_ptr
2020-03-08 02:05:39 +01:00
4070cc0d83 DisplayEvaluation: draft evaluation invocation per track
...however, running into some type deduction problems...
2020-03-08 01:11:21 +01:00
8d87029fd5 Timeline: make TrackPresenter header-only
...there is no need for yet another indirection here,
since TrackPresenter is not much of an interface and
only included at into two other translation units.
Moreover, header-only code simplifies the use of
templated lambdas, which come in handy when dealing
with the various nested sub-collections.
2020-03-07 18:21:24 +01:00
5ddf426add DisplayEvaluation: skeleton of the evaluation invocation 2020-03-07 00:30:06 +01:00
e9f05e4ac2 DisplayEvaluation: dependency wiring 2020-03-06 23:35:07 +01:00
5ad04edceb DisplayEvaluation: abandon the idea of scheduling batched resizes
- it seems such a feature is not possible to implement in a totally
   sane and safe way, since intermixed other UI messages might cause
   removal of some widgets for which we scheduled a change. And there
   is no simple and performant mechanism available to track the lifecycle
   of all the widgets involved

 - as it stands, it is actually not necessary to schedule the resizing
   for later, since the UI runs single-threaded, and thus GTK has no
   opportunity to act on them while our evaluation pass is running
2020-03-06 21:46:08 +01:00
1ea32c36a1 DisplayEvaluation: draft interfaces 2020-03-06 03:14:33 +01:00
44a56624b2 DispayEvaluation: draft concept (see #1211) 2020-02-29 22:38:57 +01:00
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