Commit graph

4964 commits

Author SHA1 Message Date
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
08d332c70f CmdAccess: initial draft for a framework and DSL to use commands (#1090) 2017-04-13 18:55:07 +02:00
aecef2a8f4 Commands: refactor integration into SessionCommandService (#1089)
It seems more adequate to push the somewhat intricate mechanics
for the "fall back" onto generic commands down into the implementation
level of CommandInstanceManager. The point is, we know the standard
usage situation is to rely on the instance manager, and thus we want
to avoid redundant table lookups, only to support the rare case of
fallback to global commands. The latter is currently used only from
unit-tests, but might in future also be used by scripts.

Due to thread safety considerations, I have refrained from handing
out a direct reference to the command token sitting in the registry,
even while not doing so incurs a small runtime penalty (accessing
the shared ref-count for creating a copy of the smart-handle).
This is the typical situation where you'd be tempted to sacrifice
sanity for the sake of an imaginary performance benefit, which
in fact is dwarfed by all the machinery of UI-Bus and argument
passing via GenNode.
2017-04-09 19:11:40 +02:00
45f86e42e4 Commands: Instance management integrated in SessionCommandService
but I am not happy with the implementation yet: the maybeGet just
doesn't feel right. Likely it will be a better idea to push that
fallback mechanism generally down into the CommandInstanceManager?
2017-04-09 03:58:38 +02:00
0dad15209d Commands: add new slot into SessionCommand facade
for the operation to start a new command cycle and open a new instance
2017-04-09 03:01:12 +02:00
a53032cfc5 Analysis regarding the next step, integration of InstanceManagement into SessionCommand facade 2017-04-09 01:34:18 +02:00
22c1a1d189 Commands: rename some of the planned components for command access
...to make the names more handy
2017-04-08 16:24:36 +02:00
a4527c5e75 Commands: Instance management implementation finished (#1089) 2017-04-08 15:42:51 +02:00
f495a069aa Symbol: also document usage as (tree)map key
especially note the absence of an comparison operator,
which causes std::map to fall back on pointer comparison.
2017-04-08 03:50:29 +02:00
dd0656e812 Symbol: add more test coverage for comparisons 2017-04-08 03:30:12 +02:00
32a76a5703 SymbolTable: needs proper locking (#158)
this might turn into lock contention problem, but better optimise
a correct implementation than fix a fast yet broken one.

Hint: SessionCommandFunction_test demonstrates that the
symbol table can be corrupted by creating Symbol instances
in parallel without proper locking. So yes, this is for real.
2017-04-08 02:27:51 +02:00
3f17e6558e Symbol: clean-up of some occasional usages
hereby overlooking the elephant in the room: EntryID could switch to Symbol now
2017-04-08 00:40:04 +02:00
baa4111358 Symbol: use a dedicated hash function
since Symbol instance are now backed by a symbol table,
we can use a much faster hash function by just hashing the
pointer into the symbol table, since the Symbol string content
is already checked at initialisation.
2017-04-07 23:34:35 +02:00
2204066a94 Symbol: test coverage for empty and bool
oh yeah
yet another opportunity for mistakes
2017-04-07 20:06:19 +02:00
4df59678a3 Symbol: rework initialisation and introduce a "bottom" Symbol
Up to now, we tolerated null pointers in Literal instances.
But we can not tolerate passing a null cString to Symbol initialisation.
Rather, hereby we introduce a dedicated "bottom" Symbol, a valid "null object"
2017-04-07 19:25:21 +02:00
23c412bc42 Symbol: rework equality comparisons (#417)
For this task, I've also investigated to use boost::operators
This would only incur a negligible penalty on build times and executable sizes,
however, I don't consider the boost based solution to improve readability,
since many of these comparisons are tricky or subtly different.

Moreover, since boost::operators needs to be mixed-in, the initialisation
of Symbol objects becomes difficult, not to mention the additional base class
information visible in the debugger when inspecting Symbol or Literal objects

For that reason, I decided *against* using Boost here and coded up
all the operators in all combinations manually
2017-04-07 18:04:49 +02:00
29b8b2b8bc Symbol: switch to using the symbol-table as backing implementation (#158)
...which means, from now on identical input strings
will produce the same Symbol object (embedded pointer).

TODO: does not handle null pointers passed in as c-String properly
2017-04-07 06:34:41 +02:00