Commit graph

4796 commits

Author SHA1 Message Date
f913f30499 UI-top-level: reshape Actions
start with drilling down unnecessary includes
2017-02-02 20:51:03 +01:00
fb8923036d reduce unnecessary header includes 2017-02-02 19:57:01 +01:00
04cb0790e8 fix missing initialisation 2017-02-02 19:41:58 +01:00
0f5280a4f0 UI-top-level: draft a concept how to attach actions to the current window (#1069)
This is a very pervasive change and basically turns the whole top-level
of the GTK-UI bottom-up. If this change turns out right, it would likely
solve #1048

WARNING: in parts not implemented, breaks UI
2017-02-01 03:55:20 +01:00
865ee11621 UI-top-level: push down Config access to actual usage site (#1067)
...allows us to get rid of the access key constants and the
accessor functions in GtkLumiera
2017-02-01 03:46:30 +01:00
4e1641f192 sketchy workaround for access to the PlayController (#1072)
...which itself is obsolete and needs to be redesigned from scratch.
For now we create a local instance of this obsolete PlaybackController
in each viewer panel and we use a static accessor function to just some
instance. Which would break if we start playback with multiple viewer
panels. But we can't anyway, since the Player itself is also a broken
leftover from an obsoleted design study from the early days.

so why care...
2017-01-28 01:11:04 +01:00
6aec1adb38 resolve ambiguity with std::ref vs boost::ref
unfortunately boost/program-options make the boost reference-wrapper visible
And it doesn't help to alias to std::ref at the definition site of the
problematic function (in TimeControl), because this itself is picked up
via ADL

So this is not really a solution, rather a workaround, in the hope
that boost will clean-up this ambiguity eventually
2017-01-28 01:09:16 +01:00
c09eb3e1ed remove the obsolete Project and Controler from ctor arguments
...this (finally) allows us to get rid of these elements within GtkLumiera.
Our Model will be represented in a quite different way (via UI-Bus).
2017-01-27 23:30:38 +01:00
0bdc4e1bb4 QA: mark all wildcard includes in the GUI code (#1071)
as a rule, one should not rely on "using namespace xyz",
since this makes organisation of minimal header includes near impossible.
You end up with mass includes in some "top level" headers, resulting
in painfully slow compilation turnaround times.

In exceptional cases, using namespace foo might be adequate though
2017-01-27 22:47:01 +01:00
d49983d4cb identify items which force GtkLumiera to be a singleton
- WindowList (ex WindowManager)
- Project & Controller

the latter ones are defunct and can be replicated down into each
of the old timeline pannel instances. They just serve the purpose
to keep this old code barely functional, so it can be used as reference
for building the new timeline
2017-01-27 22:17:58 +01:00
86d6e11505 demote the WindowManager to be a petty window list (#1964)
the only adequate thing you can do with managers is to demote them.
2017-01-27 20:48:01 +01:00
a6fb10b9e0 clean-up the WindowManager source (#1064)
in one of the preceding refactorings, I've extracted most of the
functionality from WindowManager, to make it more focussed
2017-01-27 20:22:52 +01:00
1cb2567557 Ui-top-level: use a sincle UiManager instance
instead of letting each window create its own "private interface"
2017-01-26 22:02:45 +01:00
43bd5c3f57 further decisions regarting the UI top-level 2017-01-26 20:51:43 +01:00
7a51a0bd18 split functionality according to concerns (#1067)
window handling -> WindowManager
styles, icons, themes  -> UiManager
2017-01-23 01:13:38 +01:00
735563ebc5 Rectify UI top-level -- introduce a global UiManager (#1067)
There seems to be a mismatch in the arrangement of the top-level entities
 * we support multiple windows, yet from reading the code, you'd ge the impression we aren't really aware we have multiple top-level windows
 * the `WindowManager` is the core UI manager, which feels like a mix-up in concerns
 * the `WorkspaceWindow::createUI()` does the global UI initialisation. Again, we have multiple workspace windows.
 * `GtkLumiera::main()` creates a `Model` and a `Controller` in local function scope, but stores the `WindowManager` in an object field.
 * it seems, for that very reason, `GtlLumiera` needed to be a singleton, to allow by-name access to "the" `WindowManager`
 * needless to say, this causes a host of problems when shutting down the UI.

The idea is to introduce a dedicated UiManager, to deal with the central
framework induced concerns solely, and to demote the WindowManager and the
WorkspaceWindows to care only for their local concerns
2017-01-23 00:40:17 +01:00
6baff38beb GuiNotification: actually pass the calls through the interface system 2017-01-20 04:23:00 +01:00
ffd2b079df GuiNotification: use placeholder for the yet unsolved diff passing problem
see Ticket #1066
2017-01-20 03:46:48 +01:00
0d5ca55019 GuiNotification: define outline of this service interface 2017-01-20 03:27:32 +01:00
8105be399e GuiNotification: demote this service to be just a BusTerm
in fact it just does not fulfil any of the behavioural properties
of a full-fledged UI-Element. All it needs is an uplink bus connection,
so let's just keep it as that

Sidenote: I've realised today that such a "free standing" BusTerm
without registration in Nexus is a good idea and acceptable solution.
2017-01-20 02:40:38 +01:00
8f2023dea3 Nexus/CoreService: verify shutdown cycle
yes, it's a cycle and indeed quite tricky.
Just verified it (again) with the debugger and saw all
dtor calls happening in the expected order. Also the number
of Nexus registration is sane
2017-01-20 02:23:24 +01:00
06a61773fa Nexus/CoreService: consider handling of bus connections.
Now I've realised that there are two degrees of connectedness.
It is very much possible to have a "free standing" BusTerm, which
only allows to send uplink messages. In fact, this is how CoreService
is implemented, and probably it should also the way how to connect
the GuiNotification service...
2017-01-20 01:54:49 +01:00
cb31b145c3 GuiStart: further streamlined the invocation code
due to investigating that Heisenbug, I understand the storage layout
more clearly. It occured to me that there is no reason to copy the
terminationHandler (functor) into an instance variable, since it is
easily possible to keep all of the invocation and error handling
confined within the scope of the run function, i.e. on stack.

So the effective memory layout does not change, but the legibility
of the code is improved, since we're able to remove the dtor and
simplyfy the ctor and avoid most of the member fields.
2017-01-19 23:52:30 +01:00
2354c53a50 GuiStart / Shutdown: nailed the Heisenbug
Reason was some insideous detail regarding Lambdas:
When a Lambda captures context, a *closure* is created.
And while the Lambda itself is generated code, pretty much
like an anonymous function, the closure depends on the context
that was captured. In our case here, the Lambda used to start
the thread was the problem: it captured the termCallback functor
from the argument of the enclosing function. In fact it did not
help or change anything if we successively package that lambda
into a function objet and store this by value, because the
lambda still refers to the transient function context present
on stack at the moment it was captured.

The solution is to revert back to a bind expression, since this
creates a dedicated storage for the bound function arguments
managed within the bind-functor. This makes us independent
from the call context
2017-01-19 23:41:32 +01:00
22be990631 GuiStart / shutdown: chasing a Heisenbug 2017-01-19 23:08:09 +01:00
4ba8032a60 Nexus/CoreService: fix sanity check on shutdown
...because some Bus connections stem from elements which are
member of CoreService, thus the'll still be connected when the
sanity check in the dtor runs

But even with this fix, we still get a SEGFAULT
2017-01-19 23:08:09 +01:00
aec700f1b1 GuiNotification: connect to UI-Bus by inheriting from Controller
TODO
 - is this actually a sensible idea, from a design viewpoint?
 - in which way to bind GuiNotification for receiving diff messages?
 - Problem with disconnnecting from Nexus on shutdown
2017-01-19 23:08:09 +01:00
1bd3eabe7d GUI-start: replace the chained termination functors with a lambda
This is the solution I found out when implementing the ProcDispatcher;
looks way more readable to me
2017-01-19 23:08:08 +01:00
df84de2e81 Library: remove the dispatchSequenced helper
...such can be done way more succinctly with Lambdas now
2017-01-19 23:08:08 +01:00
2045132d3e SessionCommand: multithreaded stress test PASS (closes #1046)
Writing and debugging such tests is always an interesting challenge...

Fortunately this exercise didn't unveil any problem in the newly written
code, only some insidious problems in the test fixture itself. Which
again highlights the necessity, that each *command instance* needs
to be an independent clone from the original *command prototype*,
since argument binding messages and trigger messages can appear
in arbitrary order.
2017-01-14 08:37:46 +01:00
1bebb0ef8d SessionCommand: draft a massive multithreaded stress test 2017-01-14 04:19:58 +01:00
3395d002bd Library: helper to produce threadsafe member-IDs for a family of objects
This is a little bit of functionality needed again and again;
first I thought to use the TypedCounter, but this would be overkill,
since we do not actually need different instances, and we do not need
to select by type when incrementing the counter. In fact, we do not
even need anything beyond just allocating a number.

So I made a new class, which can be used RAII style
2017-01-14 03:07:48 +01:00
0b0575050d SessionCommand: second function test PASS 2017-01-13 09:01:05 +01:00
b52ab62caf SessionCommand: define function test for message based invocation
the intention is to cover more of the full invocation path,
without running all of the application infrastructure. So this
second test cases simulates how messages are handled in CoreService,
where the CommandHandler (visitor) actually invokes the SessionCommand
facade
2017-01-13 08:26:41 +01:00
2d5ef968a8 CommandFramework: fill in a simplified function(integration) test
Start the ProcDispatcher and schedule a command into the session loop thread
2017-01-13 06:13:22 +01:00
edcf503da1 Command-Framework: enable the use of immutable types as state memento 2017-01-13 01:10:05 +01:00
c799c7644c Library: finish adapter to snapshot non-assignable values
this was a spin-off activity from writing the SessionCommand
function(integration) test, where I noted that we can't just
capture "a time value" as command memento
2017-01-12 23:41:20 +01:00
963524254b better provide a dedicated equality operator
basically this is not necessary, since the compiler figures out
to use the conversion to target type when attempting to resolve
an equality comparison. But it helps to avoid ambiguities in cases
where several conversion paths do exist, e.g. when comparing string
with C-string
2017-01-12 20:09:09 +01:00
625787fbba combine instance management with both code paths
for assignable / not assignable types
2017-01-12 08:41:58 +01:00
b6e0497f8b verify instance management
..including the singleton instance in NullValue<Tracker>
2017-01-12 08:02:55 +01:00
f4cd96428c verify a case with indeed non-assignable entities (lumiera Time)
explicitly observed with the debugger that the call path is sane;
the code looks innocuous, but it is quite magic how the compiler
picks precisely the right ctors and inserts conversions apropriately
2017-01-12 07:30:33 +01:00
e60abf66c0 get this wrapper basically to compile
the simple case of an embedded pointer actualy works already
2017-01-12 06:27:31 +01:00
9ba2618844 Library: draft a wrapper to snapshot a non assignable value 2017-01-12 05:21:29 +01:00
3a5790e422 add preliminary magic to dispatch test commands without much ado
command processing against the session is not yet implemented,
so to allow for unit testing, we magically recognise all commands
starting with "test." and invoke them directly within the Dispatcher.

With this addition, the basic functionality of the dispatcher works now
2017-01-11 06:09:34 +01:00
bfebb08015 define test for simple direct dispatching of the command 2017-01-11 05:26:53 +01:00
8a0f26c787 start and stop the Dispatcher for running the function(integration) test
need also to start and stop the interface registry,
since by policy we do not run the application framework itself
for execution of the test suite; thus if some test actually needs
an application service, it must be started/stopped manually
2017-01-11 05:01:47 +01:00
3cc3f69471 SessionCommand: draft the idea of a function(integration) test 2017-01-11 04:19:43 +01:00
104b71e8aa Timehandling: allow default initialisation for Offset values
From a purely logical viewpoint, it looked sensible to require an actual
value for an offset, especially since our time values are immutable.
But this has the unfortunate consequence that we'd be unable to use
an offset value as parameter for any command, since we store the arguments
as tuple and the tuple type has a default constructor. We might be able
to get around that problem, but such looks brittle to me; it is just
plain surprising for anyone not familiar with the internals of the
command system.

For that reason, I've now added a default ctor to the Offset type
2017-01-11 04:09:32 +01:00
2e9bd78791 consider to extend the command handling protocol on UI-Bus (#1058) 2017-01-09 03:24:17 +01:00
38b908d510 CoreService: simple (and obvious) implementation of command handling (#1046)
disregarding all doubts due to the massive indirection
and deferring the question where command-IDs are actually to be allocated....
2017-01-09 02:32:56 +01:00