Commit graph

5842 commits

Author SHA1 Message Date
acaeb330c3 ElementBox: Analysis and design for layout strategy...
identify the various dimensions, which require flexibility
to support the intended use cases; try to come up with a
design draft, allowing to settle on a preliminary version
soon, while not hampering further development later on.

Obviously this is a very deep and challenging topic,
and we're far from even remotely addressing it adequately;
we just need to get to the point to use this drafted version
as building block, since these usages will then push us further
into the right direction...
2022-09-25 01:16:10 +02:00
c439ade3da ElementBox: detailed survey of GTK layout code (see #1235)
Investigate how the GTK implementation allocates size extension
to widgets and child widgets; identify possible extensions points
and work out a solution strategy to make GTK observe our specific
size constraints, which are derived from a time calibrated canvas.
2022-09-24 02:41:11 +02:00
0f3298f004 ElementBox: push Icon spec into the Strategy helper
...the actual selection strategy remains to be implemented
...decision to stick to the Stock-ID scheme until we consider
   migration to GTK-4
2022-09-23 02:53:52 +02:00
01740619f1 Code Review with Benny 2022-09-08 14:24:36 +02:00
4977d75014 ElementBox: support CSS selectors
The CSS class .background ensures there is an opaque backgdrop;
adding ID names to allow direct addressing in the stylesheet
2022-09-02 01:29:17 +02:00
38b6228fac ElementBox: working draft of ElementBoxWidget, establishing ctor framework
The flexible custom styling yet needs to be definied.
Just adding a stock icon and a standard sized label field for now.

Widget can be constructed and successfully attached to a track.
2022-09-01 19:34:38 +02:00
ed7e3b4b32 ElementBox: extract builder qualifier support as library implementation
Complete the investigation and turn the solution into a generic
mix-in-template, which can be used in flexible ways to support
this qualifier notation.

Moreover, recapitulate requirements for the ElementBoxWidget
2022-08-28 23:36:27 +02:00
ff6234829a ElementBox: investigate ctor syntax possibilites
Basically we want to create ElementBoxWidgets according to a
preconfigured layout scheme, yet we'll need to pass some additional
qualifiers and optional features, and these need to be checked
and used in accordance with the chosen flavour...

Investigating a possible solution based on additional ctor parameters,
which are given as "algebraic terms", and actually wrap a functor
to manipulate a builder configuration record
2022-08-28 01:02:10 +02:00
a0fe89689c private.mm: planning ElementBoxWidget (see #1185) 2022-06-05 19:35:24 +02:00
0622ddece8 private.mm: infos noted while debugging Yoshimi 2021-11-05 21:19:10 +01:00
e15e893a01 Util: use case-insensitive matching for parsing bool values 2021-08-20 14:33:59 +02:00
ae10442cf2 some whitespace clean-up 2021-08-20 14:33:21 +02:00
6c63e5e3c0 Clip-Widget: considerations how to build it 2021-07-11 02:41:26 +02:00
5b1dfe4534 Clip-Drag: further investigation and clean-up
Seems to work solid now, after switching to the root coordinates provided by GDK.
With local relative coordinates, the subject fidgets while being dragged,
for obvious reasons, since we're shifting the relative point of reference.

Also clarified a strange behaviour of the test drawing code:
Cairo is "turtle graphics", so we need to set the starting point explicitly.
2021-06-19 17:12:02 +02:00
b9657320ed Clip-Drag: Yay! dummy clip moves in the timeline when dragged
...well, the metric translation is not quite correct,
so it doesn't yet stick to the mouse. But all the challenging
problems within the framework for implementing such a generic
gesture seem to be solved now.
2021-05-14 19:42:20 +02:00
526f1d09e7 Clip-Drag: integrate indirectly with the TimelineLayout for metric translation
The ClipPresenter can access the CanvasHook wired into its actual ClipDelegate (widget).
And this in turn exposes the DisplayMetric, with the ability to transform
presentation coordinates (pixels) into a model representation (Time)

The actual translation is still hardwired placeholder code,
since it is planned to build an generic component "ZoomWindow"
to provide all the typical zomming and view window translations
found in every timeline editor
2021-05-13 18:29:37 +02:00
3e9aae30b3 Clip-Drag: switch implementation to the new observer/adapter 2021-05-13 16:14:11 +02:00
aad4087e26 Clip-Drag: reshape the Subject API to use a delegate/adapter
...for tracking and updating while the gesture is in formation
2021-05-09 15:14:14 +02:00
4caf790339 Library: verify PlantingHandle's extended capabilities
- move construct into the buffer
- directly invoke the payload constructor through PlantingHandle
- reconsider type signature and size constraint
- extend the unit test
- document a corner case of c++ "perfect forwarding",
  which caused me some grief here
2021-05-07 22:50:13 +02:00
5a37bce855 Lib/Diff: extend PlantingHandle to allow for placment-new
...this extension was spurred by the previeous refactoring.
Since 'emplace' now clearly denotes an operation to move-embed an existing object,
we could as well offer a separate 'create' API, which would take forwarding
arguments as usual and just delegates to the placement-new operation 'create'
already available in the InPlaceBuffer class.

Such would be a convenience shortcut and is not strictly necessary,
since move-construction is typically optimised away; yet it would also
allow to support strictly non-copyable payload types.

This refactoring also highlights a fuzziness in the existing design,
where we just passed the interface type, while being sloppy about the
DEFAULT type. In fact this *is* relevant, since any kind of construction
might fail, necessitating to default-construct a placeholder, since
InPlaceBuffer was intended for zero-overhead usage and thus has in itself
no means to know about the state of its buffer's contents. Thus the
only sane contract is that there is always a valid object emplaced
into the buffer, which in turn forces us to provide a loophole for
class hierarchies with an abstract base class -- in such a case the
user has to provide a fallback type explicitly.
2021-05-02 19:40:11 +02:00
5aa41accfc Lib/Diff: prefer the name "emplace" over "build"
...for the operation on a PlantingHandle, which allows
to implant a sub type instance into the opaque buffer.

 * "create" should be used for a constructor invocation
 * "emplace" takes an existing object and move-constructs
2021-05-02 18:31:47 +02:00
73740a24e3 Clip-Drag: refactor into sub-component of TimelineLayout
this allows to avoid multi-step indirection
when translating mouse dragging pixel coordinates
into a time offset for the dragged clip widget.

Moreover this also improves the design,
since the handling of canvas metric is pretty much
a self contained, separate concern
2021-04-30 19:46:32 +02:00
0fb3aab95b Clip-Drag: introduce sub-interface for canvas metric
...previously this was modelled as part of the CanvasHook abstraction,
and in fact it will in any case be implemented by delegation to the
TimelineLayout or some kind of display manager.

We need this to tanslate mouse pixel movements into a time change
2021-04-30 18:44:10 +02:00
910a521ded Clip-Drag: investigate how to approach metric translation
while dragging, effectively we have to translate a mouse position delta
into a TimeValue delta, and we want to avoid direct coupling to some
timeline display manager, to keep the gesture logic mostly generic.
2021-04-29 14:41:02 +02:00
db3a525d6e Clip-Drag: get the gesture logic to work
some bugfixes,
but also a notable change: detect the completion of the gesture
directly when the button is released; this is necessary, because
seemingly we do not get motion_events when no button is pressed,
at least not in this test setup based on a Gtk::Button widget.
2021-04-17 22:32:26 +02:00
b5cf8b2303 Clip-Drag: draft the dragging controller logic
direct implementation with state flags in-class
Intention is to refactor this into a state machine eventually
2021-04-17 19:43:29 +02:00
8b5f6b0dea DOC: update and rework documentation regarding command access
In 2017, I did a first design draft, followed by a design critique,
which partially obsoleted some ideas regarding command binding.

Mostly, the reason to abandon parts of that initial design was
due to the fact, that to many actual construction details of the
UI framework were not worked out at that time.

Thus I rather focussed on (re)-building a backbone for the timeline display,
in order to support that kind of flexibility aspired within the session model.


Now, when re-visiting the topic of an UI gesture (using simple dragging
of a clip in the timeline as an example for a first draft), I picked up
some of those planned structures, but tend to bind them together in
a slightly different way -- more akin to a state machine and less
in the way of an LR-parser.

This chagneset updates the relevant part within the TiddlyWiki
and the corresponding UML drawing to better reflect my actual thinking.
2021-04-16 18:14:33 +02:00
e8d29b8093 Tooling: Upgrade to Umbrello 4.17 (UML drawing tool)
..just open the existing uml/Lumiera.xmi and store it again
2021-04-16 15:50:22 +02:00
9796a8ebd0 Clip-Drag: requirements analysis in wider scope
...because this is a prototype, but should fit in
with a future frameworks to handle complex interactions and gestures.

And no, we can not afford to rely on a UI toolkit for such a core concern
It is impossible that a framework like e.g. GTK will allow us to
support a custom made hardware controller and integrate it seamlessly
into getsture handling, thereby following a design philosophy that
is in accordance with our fundamental decisions.
2021-04-15 18:46:49 +02:00
0e98a1a940 Clip-Drag: investigate how to deal with motion events
...found out that GTK already implements an "implicit grab",
and thus the tricky situation that the mouse slides off the widget
can not happen at all; so in the end it's rather easy to build a trigger
for a dragging gesture.

The demo code is now activated only after the button is down
and just prints the position...


PS: did some research regarding the new Coroutines in C++
2021-04-09 00:18:38 +02:00
b1f739115b move some common helpers into central UI headers 2021-04-04 15:46:40 +02:00
e72df5c02d Clip-Drag: successfully hook up a signal binding for the trigger condition
Setup the scaffolding necessary to get at the actual clip widget
and to establish a signal connection to the button_pressed signal.
The intention is to watch this in conjunction with mouse movements
for detection of the actual gesture.

At the moment, I am using button widgets as placeholder for the actual
clip widgets (not yet implemented...). And, as a tiny little success,
these buttons now invoke the gesture controller on right click
(left click is seemingly consumed by the button itself)
2021-04-03 19:49:30 +02:00
1187a81943 Clip-Drag: hook up the access point to the gesture definition
thus far my implementation concept seems to work as intended....


note: when populating the timeline with actual Clips,
the not-yet implemented linkSubject()-Function of the DragRelocateController
gets invoked (as it should), thereby killing Lumiera
2021-04-02 17:39:42 +02:00
6578b3cf1c Clip-Drag: wire access to the actual InteractionState for dragging 2021-04-02 16:57:18 +02:00
91273e5931 Clip-Drag: consider translation of command ctxID into a InteractionState implementation
...actually postpone to build a generic translation system and use hard wired relations for now;
it is acknowledged that we'll need some kind of translation system eventually,
once the GUI has to handle a lot of possibly configurable gestures.
2021-03-28 18:03:40 +02:00
65f16d54fa Clip-Drag: setup access-front-end via dependency injection
Decision to use a dedicated holder service (GestureState),
maintained as sub-service within InteractionDirector
2021-03-27 16:47:22 +01:00
451673dd09 Clip-Drag: now able to detect creation of a new clip widget
..and thus there is now one dedicated source location,
where configuration of new clip widgets can be done reliably.

So all prerequisites are solved and we can start
building a prototypical drag-gesture implementation
2021-03-27 14:42:08 +01:00
d4b1735013 define the ClipPresenter header-only (no change)
A separate translation unit turns out to be unnecessary here,
since this is implementation level code included into one single
other translation unit (timeline-controller.cpp). In such a situation,
having the whole class definition at one code location improves
readability.

Moreover, there clearly is now another abstraction barrier,
insofar all of the clip widget's implementation technicalities
are buried within clip-widget.cpp
2021-03-27 13:47:43 +01:00
98a675e54c Clip-Drag: refactoring to establish prerequisites for dragging support
The specific twist with the clip display lies in the fact
that there might or might not be a dedicated clip widget,
based on the current presentation style and zoom level.

Consequently we need hook up the widget for dragging,
only when, and whenever a new clip widget is actually created.
This boils down to the requirement to detect whenever a state change
creates a dedicated widget -- and this can only be sensibly implemented
when all display state transitions are handled by a single function.

Previously, we had two specialised functions for this purpose:
one to initially create the delegate and one to switch the
implementation type for an already existing delegate.

This refactoring attempts to merge all this logic into a single function,
which now unfortunately became quite complex and hard to understand.
2021-03-27 01:30:06 +01:00
e2292e0239 Clip-Drag: start prototypical implementation of a gesture controller (see #1218)
My planning thus far seems solid enough to start fleshing out one concrete gesture handling,
which can serve as a blueprint for a generic scheme to be worked out later.
Moreover, the implementation is limited to mouse interaction for the time being,
while the goal remains to treat "gestures" in a way to span several
Interaction-Schemes eventually (mouse, key sequence, pen...).
2021-03-26 01:21:46 +01:00
e3f64d1c3c Clip-Drag: reshape that solution to avoid abundance of cross-links
...since it would be problematic, so store the prospective context data
for any conceivable gesture within each Widget possibly addressed by that gesture.

After some mulling over, today it finally occurred to me,
that I already solved a similar problem for the layout management,
and the very structure of ViewModel vs. Widget vs. Canvas settles
around that solution. Thus we could try to expand that structure --
which means that the gesture context is only created *late*, when the
gesture starts; and then the *subject* should be reponsible to collect
and establish the context for the gesture and feed it to the
gesture-controller, not the other way round
2021-03-12 16:54:19 +01:00
a64dc9c05f Clip-Drag: draft a solution for handling gestures
...even while keeping the focus to the actual problem at hand,
this solution must be built with the larger goal in mind, which
is the ability to support various editing gestures, transmitted
possibly through several control-systems (mouse, keybindings, pen...)

It is obvious that we'll need a dedicated controller for each kind of gesture;
what turns out as tricky is to maintain and bind a stateful context
and find the correct participants while a specific gesture is under way.
2021-02-28 23:04:06 +01:00
154868e8e2 Clip-Drag: reconsider the state of the command invocation scheme
As it turned out, I drafted a rather elaborate vision in 2017,
leading to the conclusion to better just implement the very simple
"point and shot" command invocation and to postpone anything more
advanced to a later point, when the properties of the actual UI
are defined more clearly.

Thus, what I have to build now is a first step in the direction
of the more elaborate vision, but only that, namely a first draft,
which should fit into the more complete solution later.
2021-02-22 00:21:53 +01:00
7e946fa1cc Clip-Drag: investigate the problem...
Can we build a simple feature to allow dragging clips in the timeline display?

Well... not really, at least not "simple".
As it turns out, the GTK-framework only supports classic "drag-n-drop",
which translates into sending an action to a drag target to receive a "document".

And, even worse, dragging clips must be implemented as a UI gesture,
and as such overlaps with the other gestures for editing, trimming.

In 2017, I did an comprehensive analysis of this problem, and then
concluded to postpone it. Thus the task now would be to build a
*simplified preview*, while being aware of the danger of creating
oversimplified structures, and the danger to hamper a complete
solution for implementing UI gestures...
2021-02-21 15:40:08 +01:00
ab718ed6aa DisplayEvaluation: get corrdinated vertical size roughly to work
Now basically the header labels are aligned with the start of the corresponding body area.

However, there still seems to be some minor glitch hidden somewhere,
and the labels seem to be off by one pixel per track. Also the allocated
canvas size is to small after first evaluation, but somehow gets
corrected whenever the window is resized.
2021-02-08 01:09:16 +01:00
8f572fc122 DisplayEvaluation: draft coordinated vertical layout (see #1211)
a first rather simplistic attempt to establish a vertically
synchronised layout between track header and body.

TODO: doesn't yet work as intended
2021-02-07 20:45:28 +01:00
34725afaa8 Clip: try out some solution to enforce a fixed extension
..now this more or less works and indeed crops the button widget
used here for a proof-of concept; however the label within that button
emits a lot of layout warnings on each event handling and drawing routine,
indicating that we violated its fundamental assumptions.

Not sure how to proceed from here; also not sure if this actually
becomes turns into a relevant issue in practice, since maybe in most cases
we'll rather increase the size, and all we really have to do is handle
the Clip's textual label properly. A clip smaller than some drop-down icon
should probably not be rendered explicitly, just as overview
2021-02-06 15:30:59 +01:00
453ee08803 Clip: investigate how to enforce a fixed horizontal extension
GTK doesn't expose a first-class API for this,
since -- by design -- the extension of a widget is negotiated.
Thus I'm looking for some kind of workaround for our specific use-case,
where a clip widget must be rendered with a well defined horizontal size,
corresponding to its length.

Thus far, we're only able to increase the size of the Button widget
used as placeholder, but we can not forcibly shrink that button,
probably because the embedded Gtk::Lable requires additional extension.
2021-02-05 00:21:08 +01:00
5570850377 Clip: review ClipDelegate creation
implement the special convention for Time::NEVER to hide such clips
2021-01-30 19:36:47 +01:00
c4634837a3 DisplayEvaluation: further testing and bugfixes
- fix a regression introduced with the 3rd DisplayEvaluation pass
- use references to pass the timings more efficiently to the ClipDelegate
- DisplayEvalutation in fact has a real LifeCycle and is not disposable
- generate the population diff for this test in canonical form
2021-01-30 19:01:56 +01:00