Commit graph

4980 commits

Author SHA1 Message Date
d8c19c7a32 UI-Dispatch: complete implementation of the hand-over (closes #1098)
...by integrating and wiring a Glib::Dispatcher
2017-08-10 20:57:43 +02:00
768a07f181 UI-Dispatch: draft the dispatcher invocation 2017-08-10 17:14:44 +02:00
07c9ed15e8 UI-Dispatch: how to integrate into the NotificationService
WIP setup of an empty framework
2017-08-10 16:24:36 +02:00
46fc900980 UI-Dispatch: get the multithreded test to work (#1098)
the (trivial) implementation turned out to be correct as written,
but it was (again) damn challenging to get the mulithreaded chaotic
test fixture and especially the lambda captures to work correct.
2017-08-07 05:19:58 +02:00
a7ad82c935 Library: can optimise IterStack pop()
...by moving out the element to be extracted;
because of RVO it will in fact be move constructed into
the storage of the caller
2017-08-07 00:20:55 +02:00
70e1a5b922 convert ScopedCollection to rely on C++11
- variadic templates
- type traits
- use uniqe_ptr to manage storage (instead of boost::scoped_array)
2017-08-06 18:21:25 +02:00
0b621e71c5 Library: fix a suptle misconception in the design of IterAdapter
again surprising how such fundamental bugs can hide for years...

Here the reason is that IterAdapter leaves the representation of "NIL" to
its instantiation / users; some users (here in for example the ScopedCollection)
can choose to allow for different representations of "NIL", but the comparison
provided by IterAdapter just compares the embedded pos by face value.
2017-08-06 16:58:22 +02:00
908d1a8faa test need to be linked against liblumierabackend
...while tests in the library subdirectory are linked only against
liblumierasupport, which does not provide the multithreading support

In this special case here the actual facility to be tested does not rely
on thread support, only on locking. But the stress test obviously needs
to create several threads. Simple workaround is to move the test into
a test collection linked against all of the application core...
2017-08-06 15:30:01 +02:00
4095cd8cf3 Ui-Dispatch: draft multithreaded stress test for call dispatcher queue
for the simplistic implementation we're using right now this effort might look
exaggerated, but we should consider using a lock-free implementation at some
point in the future, at which point it is good to have a stress test in place
2017-08-06 15:21:31 +02:00
87dc04f324 UI-Dispatch: verify consistency of argument data handling 2017-08-05 18:44:25 +02:00
c96fcc1c6a UI-Dispatch: basic CallQueue implementation PASS 2017-08-05 17:59:55 +02:00
56def9f6d7 Library: expose some diagnostics on IterStack / IterQueue by default
seems like most usages will want to expose this kind of diagnostics for unit testing
and in fact the queue or stack nature is the primary nature of this entity,
while iterability comes as additional trait
2017-08-05 17:57:25 +02:00
3dea3c0fa0 UI-Dispatch: draft basic interface of a queue helper (#1098) 2017-08-05 17:36:32 +02:00
9b285a95c0 UI-Integration: plan the next steps to drive this topic ahead (#1099, #1098)
- concept for a first preliminary implementation of dispatch into the UI thread
 - define an integration effort to build a complete working communication chain
2017-08-05 17:36:32 +02:00
1e81b8d61a Settle proper activation of the external UI interfaces (#1098)
This change was caused by investigation of UI event loop dispatch;
since the GTK UI is designed to run single threaded, any invocation
from other threads need to be diepatched explicitly.

A possible way to achieve this is to use Glib::Dispatcher, which
in turn requires that the current thread (which is in this case the UI thread)
already holds a Glib::MainContext

This prompted me to create a tight link between the external facade interfaces
of the UI and the event loop itself. What remains to be settled is how
to hand over arguments to the action in the main loop
2017-08-05 17:36:32 +02:00
74ca087cd3 Remove the public C++ interface of the GUI-starter plugin
This plugin is essentially an implementation detail, and there is no
mechanism yet to use several different implementations of the interface.

Thus it is pointless to expose the lifecycle methods on a public interface,
while there is no way to obtain an instance of this interface, since the
latter is confined to the internals of the UI subsystem lifecycle
2017-08-03 23:11:01 +02:00
9cf868c9cd after a long break: find my way back into what has to be done.... 2017-08-03 20:34:42 +02:00
c96845ab65 GTK evolution: abandon Gtk::Main and start event loop directly (closes #1032)
After investigation of current GTK and GIO code, I came to the conclusion
that we do *not* want to rely on the shiny new Gtk::Application, which
provides a lot of additional "convenience" functionality we do neither
need nor want. Most notably, we do not want extended desktop integration
like automatically connecting to D-Bus or exposing application actions
as desktop events.

After stripping away all those optional functions and extensions, it turns
out the basic code to operate the GTK main event loop is quite simple.
This changeset extracts this code from the (deprecated) Gtk::Main and
integrates it directly in Lumiera's UI framework object (UiManager).
2017-05-19 23:42:55 +02:00
f089a34934 UI-Lifecycle: tie UI-Bus and UI-Manager directly to GtkLumiera
this is just a tiny change to make things more othogonal.
Now the unwinding and calls to any GTK / Widget dtors happen *after*
emitting the term signal from UI shutdown. Which means, the other subsystems
are shutting down (in their dedicated threads) as well, thus lowering
the probability of some action still using the UI and triggering an exception
2017-05-19 18:12:58 +02:00
5e172ff6a0 UI-top-level: reactivate the updateActionState function as NOP
as it turned out, the former functionality was deactivated in 2009
with changeset 6151415

The whole concept seems to be unfinished, and needs to be reworked
and integrated with "Views and Perspectives" (whatever that is...)

See also #1097
2017-05-19 17:00:41 +02:00
a3ed982da4 UI-top-level: fix GTK framework initialisation order 2017-05-19 17:00:41 +02:00
09dec65950 UI-top-level: drop the UI Application singleton
integrate the remaining functionality of GtkLumiera into the GUI starter plug-in
2017-05-19 17:00:37 +02:00
1ed4bd2c4c UI-top-level: the former Application Object (GtkLumiera) is obsoleted now
All the backbone functionality has been factored out into dedicated facilities
2017-05-19 16:57:16 +02:00
e59e8d0ab5 UI-top-level: consider how to rework the UI main object (#1067)
Gtk::Main is deprecated, but the new solution, instantiating a
Gtk::Application object does not match our use case, since we handle
all application concerns already and just need a Gtk main loop to run.

Anyway, it became clear that the "main object" will be the new UiManager.
As a first step, I've now moved the (deprecated) Gtk::Main object
down there. Next step (planned) will be to inherit from Gio::Application
and clone some functionality from Gtk::Application
2017-05-03 02:37:48 +02:00
0c073ad6e2 fix diagnostic type formatting
...again to make it work with GCC-5,
also to allow more leeway using various compilers

Explanation: we use a helper function to abbreviate the
demangled type names to make diagnostic ouput more readable.
Obviously such a function needs to be adjusted to the
way concrete compilers generate their type output; GCC-5
slightly differs to GCC-4.9 here, so I've made the regular
expressions a bit more flexible
2017-05-02 21:01:41 +02:00
46192cadbf fix some issues with static initialisation order
...also uncovered by compiling with GCC-5
2017-05-02 21:01:41 +02:00
d29e4e2d6f GCC-5 compatibility: ambiguity in overload resolution
we have a catch-all template operator to get a string converted
or pretty printed output from "any object". Unfortunately
this overload counts equivalent to another overload by
the IO manipulators. Solution is to define both operarators
similar in the first argument, thus turing the overload
for the IO manipulators into the more specific overload
due to the explicitly given second argument
2017-05-02 00:09:48 +02:00
37cdfaba54 GCC-5 compatibility: remove the last remaining auto_ptrs 2017-05-01 21:43:10 +02:00
9262af1346 GCC-5 compatibility: remove unnecessary forward declaration
a bit over the top anyway: string will inevitably be included sooner or later
2017-05-01 18:38:52 +02:00
5cb5ad3507 Menu-Actions: just log unimplemented actions for now (closes #1085)
this topic is basically settled by now.
Mostly by delegating to other entites not-yet-implemented :-D
2017-04-23 18:46:58 +02:00
e29a31a32a Menu-Actions: relocate some further global operations
...which do not really belong into the Actions class,
but can be delegated within the global context
2017-04-23 18:28:32 +02:00
790530bc2d Menu-Actions: inline the directly forwarded actions (#1085)
as a result of the preceding refactorings, we have created a
top level UI context, and most actions are now just forwarede
to a dedicated entity within this globalCtx, mostly to the
InteractionDirector.

Thus we're able to get rid of the one-liner functions in
the Actions class by directly delegating to the respective
entity from within the menu definition lambda.

Is this safe?
Under the assumption that the global context outlives the
GTK main loop, this is safe.
2017-04-23 18:26:23 +02:00
216fd9d882 Menu-Actions: write action definition more compact with helper lambda
- get rid of some syntactic noise
- move the defining closure to the begin and the varargs to the end
2017-04-23 16:24:56 +02:00
1ccf54fa41 CmdAccess: draft some further command invocations
...which opens more questions than it solves at the moment.
Especially note #1096, the question how to refer to object-IDs
Maybe we need to enable sending EntryIDs via GenNode?

Anyway, the magic spell is broken now: we have a way how to
establish commands and how to issue them from the UI, with full integration
of UI-Bus, layer separation facade, instance management and ProcDispatcher

Looks like a stepping stone
2017-04-17 23:16:57 +02:00
4e7c64bf39 CmdAccess: **Big Bang** wire the first real command from UI down into the Session
...just the implementation within SessManagerImpl is not yet there P-)
So everything remains as defunct as before, but at least: "yes we can"
2017-04-17 21:54:36 +02:00
6a80053395 CmdAccess: reworked draft for context-bound commands and resolver expressions 2017-04-17 21:20:51 +02:00
10c2e4b9a9 CmdAccess: rename the front-end to CmdContext to clarify the purpose 2017-04-17 20:00:07 +02:00
82d66cef73 CmdAccess: discard the InvocationTrail concept
after extended analysis, it turned out to be a "placeholder concept"
and introduces an indirection, which can be removed altogether

- simple command invocation happens at gui::model::Tangible
- it is based on the command (definition) ID
- instance management happens automatically and transparently
- the extended case of context-bound commands will be treated later,
  and is entirely self-contained
2017-04-17 18:21:52 +02:00
8c7ac997de CmdAccess: replace existing usages of InvocationTrail 2017-04-17 16:57:09 +02:00
876c1dd1fd Commands: change implementation frame to include the command-ID
while the initial design treated the commands in a strictly top-down manner,
where the ID is known solely to the CommandRegistry, this change and information
duplication became necessary now, since by default we now always enqueue and
dispatch anonymous clone copies from the original command definition (prototype).

This implementation uses the trick to tag this command-ID when a command-hanlde
is activated, which is also the moment when it is tracked in the registry.
2017-04-17 03:09:12 +02:00
471fa5b9c4 CommandInstanceManager: fix error check accidentally killing the local instance
due to the refactorings, the instance was moved out prior to checking for
bound arguments. This is ammended now, albeit at the price of passing an
additional flagn and some tricky boolean conditions
2017-04-17 01:51:27 +02:00
3922bb58e1 Commands: fix and adapt instance management test 2017-04-17 01:51:27 +02:00
cfe192f8c6 Commands: some unit test coverage for unbinding arguments
...just to make sure it is properly integrated with the state predicates
2017-04-16 19:38:56 +02:00
bb7bba5dc2 Commands: add API to unbind and discard command arguments
this seems like an obvious functionality and basically harmless,
since commands are designed to be inherently stateful, which is reflected
in all the internal storage holders to expos an assignment operator
(even while the actual implementation is based on placement new instead
of assigning values into the storage, and thus even supports immutable
values). The only possible ramification is that argument values must
be default constructible
2017-04-16 19:21:29 +02:00
410c36d2c3 Commands: change semantics of command instance management (#1089)
in accordance to the design changes concluded yesterday.
 - in the standard cases we now check the global registry first
 - automatically create anonymous clone copy from global commands
 - reorganise code internally to use common tail implementation
2017-04-16 18:27:05 +02:00
079ad715b0 Commands: change API to allow moving commands into the dispatcher queue 2017-04-16 16:16:26 +02:00
67e1032f7d Commands: draft the changes to be done with command instance management
...as consequence to be drawn from the design critique
2017-04-16 02:51:38 +02:00
730f559ab2 CmdAccess: design critique 2017-04-15 23:48:42 +02:00
5f6854621e Command-Cycle: remove the separate 'bang!' message
as it turns out, we can always trigger commands right away,
the moment all arguments are known. Thus it is sufficient to
send a single argument binding message, which allows us to
get rid of a lot or ugly complexities (payload visitor).
2017-04-14 23:45:35 +02:00
35a4e7705b CmdAccess: expand on the DSL draft 2017-04-14 03:22:08 +02:00