Commit graph

4633 commits

Author SHA1 Message Date
e4bf84657c Inv(#1020): erase arbitrary child widgets 2016-10-29 16:05:37 +02:00
8348696a56 Inv(#1020): add function to align all widgets in a single row
...which allows us to verify consistency of z-order
2016-10-29 15:40:23 +02:00
03a9611608 Inv(#1020): iteration and moving of children 2016-10-29 03:26:07 +02:00
94a0adcb5b Inv(#1020): place widgets irregularily
- partially overlapping
- beyond the scrollable area
2016-10-29 00:51:28 +02:00
e7d284783b Inv(#1020): place widgets on canvas
- randomly
- partially overlapping
- event dispatch works as expected
2016-10-28 17:32:43 +02:00
5897d1ffad clean-up: unnecessary includes
they'll hamper the investigation by causing extended compilation round-trip
2016-10-28 16:54:03 +02:00
f3e791d1ac Ticket #1034 : leave note at dlclose() call 2016-10-28 16:54:02 +02:00
12f1165765 Inv(#1020): add code to monitor clean-up by GTK
I am still suspicious the cleanup mechanism for child widgets works as expected...
But right now, we can't verify that, since on shutdown we get an assertion failure
from ld.so "dl-close.c: 762: _dl_close: Assertion `map->l_init_called' failed!"
Seems we're loading the GUI plugin not properly
2016-10-27 23:36:20 +02:00
dd9f34e93a Inv(#1020): prepare Investigation
- define tasks to be addressed during investigation
- read documentation, identify problematic aspects
- prepare a child widget class to be placed on the canvas
2016-10-27 22:57:46 +02:00
2350998fdb setup layout for experiments (closes #1021) 2016-10-27 04:15:20 +02:00
0888e0afe7 new empty dock for research and experiments (#1020)
My intention is to use this space for experiments first,
and then as a construction site for a rewrite of the
custom timeline widget.

We really need a rewrite here, in order to be properly
aligned to the standard way of writing such a custom widget,
and also to build our first connection to the UI-Bus and then
remove the old placeholder UI model
2016-10-27 02:57:23 +02:00
3bb76f2f2c move asside old code to make room for investigation
...goal is to have a new dockable panel,
where we'll build the new timeline widget eventually.

Signed-off-by: Ichthyostega <prg@ichthyostega.de>
2016-10-26 18:44:27 +02:00
c8b6e7a699 mark some code smells (#1026) 2016-10-26 18:44:27 +02:00
5981f35650 consider the next steps (#1020) 2016-10-14 20:21:29 +02:00
9f1c57b560 Research: canvas widget in GTK-3 2016-10-13 18:47:20 +02:00
2d8a595038 Finish AbstractTangible_test and the basic UI-Element protocol
closes #975 and #992
2016-10-04 03:50:44 +02:00
22f06dca23 Bugfix: must init TreeMutator explicitly now
as consequence of previous fix.
Also, when building the preconfigured TreeMutator for GenNode,
the init hook must be called explicitly now.
2016-10-04 03:24:44 +02:00
1725a31df1 Bugfix: insidious dangling pointer caused by move after construction
Damn sideeffect of the suppport for move-only types: since we're
moving our binding now into place /after/ construction, in some cases
the end() iterator (embedded in RangeIter) becomes invalid. Indeed this
was always broken, but didn't hurt, as long as we only used vectors.

Solution: use a dedicated init() hook, which needs to be invoked
*after* the TreeMutator has been constructed and moved into the final
location in the stack buffer.
2016-10-03 23:54:09 +02:00
bada8ecffd TreeMutator binding: fix collection binding to support move-only types
unintentionally we used copy construction in the builder expression,
wenn passing in the CollectionBinding to the ChildCollectionMutator.

The problem is that CollectionBinding owns a shaddow buffer, where
the contents of the target collection are moved temporarily while
applying the diff. The standard implementation of copy construction
would cause a copy of that shaddow buffer, which boils down to
a copy of the storage of the target collection.

If we want to support move-only types in the collection, most notably
std::unique_ptr, we can thus only use the move constructor. Beyond that
there is no problem, since we're only ever moving elements, and new
elements will be move constructed via emplace() or emplace_back()
2016-10-03 20:08:54 +02:00
d58f8c853a TreeMutator binding: extend collection binding to support std::map
actually this is a pragmatic extension for some special use cases,
and in general rather discurraged, since it contradicts the
established diff semantics. Yet with some precaution, it should
be possible to transport information via an intermediary ETD

Map -> ETD -> Map
2016-10-03 19:31:59 +02:00
15ac0d6310 clean-up: remove one leftover of Ref::THIS (#996)
for the record: while it is indeed sweet-and-simple to support Ref::THIS
here, it is near impossible to represent it in general, in a setup with
multiple "onion-layers". The reason is, we'd have to incorporate such
special treatment into the /selector predicate/, which in turn undermines
the ability to pick the right onion layer to handle a given diff verb,
since "Ref::THIS" is a generic marker and we have no other data to base
the decision in the selector on.
2016-10-03 17:33:30 +02:00
ffcfa7afd4 WIP: draft a concrete TreeMutator binding for MockElm
...this is the first attempt to integrate the Diff-Framework into (mock) UI code.
Right now there is a conceptual problem with the representation of attributes;
I tend to reject idea of binding to an "attribute map"
2016-10-03 01:59:47 +02:00
c8ad698ac4 MutationMessage: limit to treating of gui::model::Tangible
the generic typing to DiffMutatble does not make much sense,
since the desired implementation within gui::ctrl::Nexus
is bound to work on Tangibles only, since that is what
the UI-Bus stores in the routing table
2016-10-02 23:51:45 +02:00
b251b9a022 MutationMessage: generic implementation based on the DiffMutable interface 2016-10-02 23:34:07 +02:00
76fc444437 MutationMessage: implementation draft 2016-10-02 22:21:17 +02:00
f0de986399 Library: allow to immediately emplace a subclass type into InPlaceBuffer
Up to now, InPlaceBuffer used to default construct an instance of the
Interface class, and then you'd need to invoke the `create()` function
to actually create the desired subclass. This is not only inefficient,
but rules out the use of abstract interfaces / base classes.

Unfortunately, there is no way in C++ to specify an explicit template argument list
on ctor calls, so we resort to the trick of passing an additional dummy marker argument
2016-10-02 22:15:55 +02:00
c9a8b82dff WIP: draft a test to cover mutation via UI-Bus 2016-10-02 02:57:27 +02:00
d2e4f826ed UI-Bus/mutation: expand on draft for mutation message 2016-10-01 23:09:08 +02:00
d87111f703 DOC: MutationMessage 2016-10-01 22:36:52 +02:00
27ba8d5896 UI-Bus/mutation: draft idea for mutation message on UI-Bus 2016-09-30 22:23:55 +02:00
6c3024adcd UI-Bus/mutation: search for ways how to integrate Diff processing 2016-09-30 18:13:04 +02:00
e6223a80b9 UI-Bus/mutation: re-read documentation and code
seems I've mostly forgotten what is built and ready to use
2016-09-08 18:49:27 +02:00
2a26cef010 remove leftovers of first diff-applicator implementation
...obsoleted by new generic implementation
2016-09-08 18:30:27 +02:00
89bfbcab43 merge work on UI-Bus and diff framework to Master
a lot of important work done during Spring and Summer 2016
now mature enough to be considered official
2016-09-05 04:46:12 +02:00
4267d3d1d7 application via TreeMutator is now the default
remove the intermediary header
2016-09-05 04:36:07 +02:00
a066650eb7 remove the now obsolete, dedicated first diff implementation
yay! this piece of code has served its purpose:
it was the blueprint to build a way better design and implementation,
which can now cover this "generic tree" case as a special case as well
2016-09-05 04:05:31 +02:00
7a29e260e9 tree-diff-language: remove the magic _THIS_ and _CHILD_ construct
at first, this seemed like a good idea, but it caused already
numerous quirks and headache all over the place. And now, with
the intent to switch to the TreeMutator based implementation,
it would be damn hard to retain these features, if at all
possible.

Thus let's ditch those in time and forget about it!
2016-09-05 04:04:02 +02:00
840d9e4397 make Rec::Mutator as such diff mutable
this adds kind of an extension point to diff::Record<GenNode>::Mutator,
which is then actually defined (implemented) within the diff framework.

This allows the TreeDiffTraits automatically to use this function
to get a TreeMutator for a given Rec::Mutator. Which in turn allows
the generic version of DiffApplicator automatically to attach and
bind to a Record<GenNode>

together this allows us to ditch the explicit specialisation
and dedicated, hand-written implementation of DiffApplication
to GenNode in favour of using the TreeMutator and friends.
2016-09-05 02:25:07 +02:00
ebb3ccb589 clean-up: move PlantingHandle over to the OpaqueHolder facility
...where it belongs; it is entirely generic
and we'd expect more usage on APIs for callbacks
2016-09-04 23:21:15 +02:00
5c0baba2eb finish implementation of GenNode - TreeMutator binding
some minor code clean-up and comments;
the solution dafted yesterday is the way to go.
2016-09-04 20:55:21 +02:00
17f8922775 solution (draft) for the type field problem
unit test PASS

but the resulting code is hard to understand
should refactor it to use a binding class
similar to the other binding cases
2016-09-03 22:34:36 +02:00
8530d50b7c complete unit test definition
...but this uncovers problem with handling of the type field
2016-09-03 21:41:12 +02:00
e5f25d8453 third part of unit-test: value assignment 2016-09-03 20:17:46 +02:00
f8e98919fe second part of unit-test for GenNode TreeMutator-binding PASS
...out of the box!
2016-09-03 19:54:54 +02:00
5fed637909 investigate size of the generated TreeMutator (#1007) 2016-09-03 18:15:19 +02:00
a73e5ffffe TreeMutator binding: change handling of AFTER(Ref::ATTRIBS)
this is a subtle change in the semantics of the diff language,
actually IMHO a change towards the better. It was prompted by the
desire to integrate diff application onto GenNode-trees into the
implementation framework based on TreeMutator, and do away with
the dedicated implementation.

Now it is a matter of the *selector* to decide if a given layer
is responsible for "attributes". If so, then *all* elements within
this layer count as "attribute" and an after(Ref::ATTRIBS) verb
will fast forward behind *the end of this layer*

Note that the meta token Ref::ATTRIBS is a named GenNode,
and thus trivially responds to isNamed() == true
2016-09-02 18:40:16 +02:00
05768e4ac5 first part of unit-test for GenNode TreeMutator-binding PASS
needed to use a forward function declaration within the
lambda for recursive scope mutator building, since otherwise
everything is inline and thus the compilation fails when it
comes to deducing the auto return type of the builder.

Other than that, the whole mechanics seem to work out of the box!
2016-09-02 03:10:27 +02:00
e00d6c2a4c reorganise inclusion of TreeMutator-DSL builders
previously they where included in the middle of tree-mutator.hpp
This was straight forward, since the builder relies on the classes
defined in the detail headers.

However, the GenNode-binding needs to use a specifically configured
collection binding, and this in turn requires writing a recursive
lambda to deal with nested scopes. This gets us into trouble with
circular definition dependencies.

As a workaround we now only *declare* the DSL builder functions
in the tree-mutator-builder object, and additionally use auto on
all return types. This allows us to spell out the complete builder
definition, without mentioning any of the implementation classes.
Obviously, the detail headers have then to be included *after*
the builder definition, at bottom of tree-mutator.hpp
This also allows us to turn these implementation headers into
completely normal headers, with namespaces and transitive #includes

In the end, the whole setup looks much more "innocent" now.

But beware: the #include of the implementation headers at bottom
of tree-mutator.hpp needs to be given in reverse dependency order,
due to the circular inclusion (back to tree-mutator.hpp) in
conjunction with the inclusion guards!
2016-09-02 01:29:32 +02:00
f907ff05d6 WIP: define binding behaviour for diff->GenNode
...need still to solve a problem with circular definition dependencies
2016-09-01 22:58:08 +02:00
c791763890 implement builder setup for Rec<GenNode>
this compiles just fine.
But we still need to define the concrete closures
to make it work with the actual contents of GenNode
2016-08-31 18:40:09 +02:00