From bfca473dce814bfcac7382d9468ab96e1d3dfae2 Mon Sep 17 00:00:00 2001 From: Ichthyostega Date: Sat, 13 Oct 2018 02:46:09 +0200 Subject: [PATCH] Timeline: decide upon the diff format expected for creating a timeline other than the regular way of building an object, we do expect a minimal structure to be sent right within the INS message. Rationale: the standard way would allow for too much leeway and created unwanted intermediary states. The non-standard way decided upon here is well within the limits of our diff language --- src/gui/interact/interaction-director.cpp | 42 +- src/gui/timeline/timeline-controller.cpp | 4 +- src/lib/diff/diff-language.hpp | 3 +- src/lib/diff/diff.cpp | 1 + wiki/thinkPad.ichthyo.mm | 725 ++++++++++++++-------- 5 files changed, 512 insertions(+), 263 deletions(-) diff --git a/src/gui/interact/interaction-director.cpp b/src/gui/interact/interaction-director.cpp index 8b7470c2e..bd2092e5e 100644 --- a/src/gui/interact/interaction-director.cpp +++ b/src/gui/interact/interaction-director.cpp @@ -50,6 +50,7 @@ #include "proc/cmd.hpp" #include "backend/real-clock.hpp" #include "lib/diff/tree-mutator.hpp" +#include "lib/format-string.hpp" #include "lib/format-obj.hpp" //#include "gui/ui-bus.hpp" //#include "lib/util.hpp" @@ -58,6 +59,7 @@ //#include //using util::isnil; +using util::_Fmt; //using std::list; //using std::shared_ptr; using lib::idi::EntryID; @@ -65,6 +67,7 @@ using lib::hash::LuidH; using lib::diff::Rec; using lib::diff::TreeMutator; using lib::diff::collection; +using lib::diff::LUMIERA_ERROR_DIFF_STRUCTURE; using std::make_unique; using util::toString; @@ -309,6 +312,38 @@ namespace interact { } + namespace { + /** + * The timeline is actually a front-end to a binding to a root track. + * For that reason, we always create the root-track representation alongside + * the timeline, and thus we need a very special INS message to create a timeline: + * - it must be a record (an "object") + * - a nested attribute with key ATTR_fork is mandatory + * - this nested attribute likewise needs to be a record + * - and must be tagged with TYPE_Fork + * More specifically, the usual way to deliver such a structure is not allowed here, + * which would be first to send an empty record and then to open and populate it. + * All the elements mentioned above need to be present right within the payload + * value of the INS message creating the timeline. This non-standard format is + * perfectly legal in our tree diff language (just requires a heap allocation + * behind the scenes to hold the nested data, but who cares?) + */ + ID + verifyDiffStructure_and_extract_RootTrack (GenNode const& spec) + { + if (not (spec.data.isNested() + and spec.data.get().hasAttribute(string{ATTR_fork}) + and TYPE_Fork == spec.data.get().get(string{ATTR_fork}).data.recordType() + ) ) + throw error::State (_Fmt{"When populating a new Timeline, a root track must be given immediately" + "nested into INS message. We got the following initialisation payload: %s"} + % spec + , LERR_(DIFF_STRUCTURE)); + + return spec.data.get().get(string{ATTR_fork}).idi; + } + } + /** @internal allocate a new TimelineWidget and attach it as child. * @todo is it really necessary to make such strong assumptions * regarding the format of the diff spec provided for @@ -319,11 +354,8 @@ namespace interact { { unimplemented ("allocate a TimelineWidget in some TimelinePanel and attach it's controller as child entity"); - REQUIRE (spec.data.isNested()); - REQUIRE (spec.data.get().hasAttribute(string{ATTR_fork})); - REQUIRE (TYPE_Fork == spec.data.get().get(string{ATTR_fork}).data.recordType()); - - TimelineGui anchorProxy{spec.idi, spec.data.get().get(string{ATTR_fork}).idi}; + ID rootTrack = verifyDiffStructure_and_extract_RootTrack (spec); + TimelineGui anchorProxy{spec.idi, rootTrack}; anchorProxy.buildTimelineWidget (this->uiBus_); ///////////////////////////////////////////TODO really create it right here? return anchorProxy; } diff --git a/src/gui/timeline/timeline-controller.cpp b/src/gui/timeline/timeline-controller.cpp index ede6fef58..f0b359c9e 100644 --- a/src/gui/timeline/timeline-controller.cpp +++ b/src/gui/timeline/timeline-controller.cpp @@ -157,12 +157,12 @@ namespace timeline { return true; })) .mutateAttrib(ATTR_fork, [&](TreeMutator::Handle buff) - { // »Attribute Mutator« : how enter an object field as nested scope + { // »Attribute Mutator« : how to enter an object field as nested scope REQUIRE (fork_); fork_->buildMutator(buff); }) .change(ATTR_name, [&](string val) - { // »Attribute Setter« : how assign a new value to some object field + { // »Attribute Setter« : how to assign a new value to some object field name_ = val; })); } diff --git a/src/lib/diff/diff-language.hpp b/src/lib/diff/diff-language.hpp index c7fe57ceb..511108389 100644 --- a/src/lib/diff/diff-language.hpp +++ b/src/lib/diff/diff-language.hpp @@ -100,7 +100,8 @@ namespace diff{ namespace error = lumiera::error; - LUMIERA_ERROR_DECLARE(DIFF_CONFLICT); ///< Collision in diff application: contents of target not as expected. + LUMIERA_ERROR_DECLARE(DIFF_STRUCTURE); ///< Invalid diff structure: implicit rules and assumptions violated. + LUMIERA_ERROR_DECLARE(DIFF_CONFLICT); ///< Collision in diff application: contents of target not as expected. template diff --git a/src/lib/diff/diff.cpp b/src/lib/diff/diff.cpp index 95de683a0..54d5224df 100644 --- a/src/lib/diff/diff.cpp +++ b/src/lib/diff/diff.cpp @@ -39,6 +39,7 @@ namespace lib { namespace diff{ + LUMIERA_ERROR_DEFINE(DIFF_STRUCTURE, "Invalid diff structure: implicit rules and assumptions violated."); LUMIERA_ERROR_DEFINE(DIFF_CONFLICT, "Collision in diff application: contents of target not as expected."); diff --git a/wiki/thinkPad.ichthyo.mm b/wiki/thinkPad.ichthyo.mm index 72a320157..facc262a9 100644 --- a/wiki/thinkPad.ichthyo.mm +++ b/wiki/thinkPad.ichthyo.mm @@ -5333,7 +5333,7 @@ - + @@ -5363,13 +5363,14 @@ - + + - + @@ -5396,7 +5397,8 @@ - + + @@ -5411,7 +5413,7 @@ - + @@ -5421,7 +5423,8 @@ vorbereitete Grundstrukturen für immer wiederkehrende Setups

-
+ + @@ -5616,7 +5619,7 @@ - + @@ -5629,7 +5632,8 @@ Im Zweifelsfall den GTK+ Inspector verwenden!

-
+ +
@@ -5648,7 +5652,7 @@
- + @@ -5658,7 +5662,8 @@ CSS genügt

-
+ +
@@ -5671,7 +5676,7 @@ - + @@ -5706,7 +5711,8 @@ }

-
+ +
@@ -5780,7 +5786,7 @@
- + @@ -5793,10 +5799,11 @@ daß die alte, obsolete Timeline zurückgebaut ist

-
+ +
- + @@ -5812,7 +5819,8 @@ bevor die Notification-Facade geöffnet werden konnte

-
+ +
@@ -5864,7 +5872,7 @@ - + @@ -5895,7 +5903,8 @@ Allerdings habe ich an der Stelle immer noch GTK-Assertions

-
+ +
@@ -5943,7 +5952,7 @@ - + @@ -5971,7 +5980,8 @@ ist, daß Gio::Application sofort auch gleich eine dBus-Verbindung hochfährt.

-
+ +
@@ -16491,6 +16501,20 @@ + + + + + + + + + + + + + + @@ -16525,38 +16549,42 @@ - + - + - + - + + + - - - - + + + + + + - + - + - + - + - + @@ -16576,10 +16604,10 @@ - + - + @@ -16964,7 +16992,7 @@ - + @@ -16974,7 +17002,8 @@ ...denn das ist das vereinfachte Setup für "einfache" Applikationen

-
+ +
@@ -17350,7 +17379,7 @@ - + @@ -17360,9 +17389,10 @@ das Diff wird auf den Platzhalter angewendet

-
+ +
- + @@ -17375,7 +17405,8 @@ dann muß dieses automatisch deregistriert werden

-
+ +
@@ -17620,7 +17651,7 @@ - + @@ -17633,7 +17664,8 @@ und welchen Teil des Verhaltens überlassen wir GTK

-
+ +
@@ -17674,7 +17706,7 @@ - + @@ -17690,7 +17722,8 @@ Details im  TiddlyWiki....

-
+ +
@@ -17743,7 +17776,7 @@ - + @@ -17753,7 +17786,8 @@ braucht feste Speicher-Addresse

-
+ +
@@ -17762,7 +17796,7 @@ - + @@ -17775,7 +17809,8 @@ und sei es auch bloß über ein Interface!

-
+ +
@@ -17790,7 +17825,7 @@ - + @@ -17824,7 +17859,8 @@ - + + @@ -17912,6 +17948,37 @@ + + + + + + +

+ Problem: alle Timelines der Session repräsentieren? +

+ + +
+ + + + + + + + + + + + + + + + + + +
@@ -17964,7 +18031,7 @@ - + @@ -17980,9 +18047,10 @@ Implementiert würde sie vom jeweiligen Widget

-
+ +
- + @@ -18010,9 +18078,10 @@ Der Dekorator würde also auf dem TreeMutator sitzen...

-
+ +
- + @@ -18031,9 +18100,10 @@ Daher gibt es die matchSrc-Operation. Effektiv wird die aber nur bei einem Delete aufgerufen...

-
+ +
- + @@ -18054,7 +18124,8 @@ - + + @@ -18132,7 +18203,7 @@ - + @@ -18142,7 +18213,8 @@ d.h. eine LUID

-
+ +
@@ -18175,7 +18247,7 @@ - + @@ -18188,7 +18260,8 @@ Irgend eine BareEntryID genügt

-
+ +
@@ -18217,7 +18290,7 @@ - + @@ -18227,13 +18300,14 @@ ...abstraktes Interface

-
+ + - + @@ -18249,7 +18323,8 @@ um die Bindung herzustellen

-
+ +
@@ -18257,7 +18332,7 @@ - + @@ -18270,7 +18345,8 @@ oder eine Sequenz ohne root-Fork zulassen

-
+ + @@ -18280,7 +18356,7 @@ - + @@ -18301,7 +18377,8 @@ - + + @@ -18320,7 +18397,7 @@ - + @@ -18348,7 +18425,8 @@ typischerweise wird es das in einem Populationsdiff sofort als Nächstes machen.

-
+ +
@@ -18370,7 +18448,7 @@ - + @@ -18390,7 +18468,8 @@ "was kann denn schon passieren??"

-
+ +
@@ -18408,7 +18487,7 @@
- + @@ -18429,9 +18508,10 @@ - + + - + @@ -18441,7 +18521,8 @@ einen Fall, der praktisch nie auftritt

-
+ +
@@ -18450,7 +18531,7 @@
- + @@ -18468,12 +18549,13 @@ - + + - + @@ -18486,9 +18568,10 @@ und auch über ihre APIs dem Nutzer diese Unterscheidnung mit aufzwingen

-
+ + - + @@ -18513,13 +18596,14 @@ heimlich in den "wird schon nix passieren" Fall zu geraten.

-
+ +
- + @@ -18535,9 +18619,10 @@ Es ist keine weitere Argumentation notwendig.

-
+ +
- + @@ -18556,7 +18641,8 @@ "fokussiere Dich"

-
+ +
@@ -18575,7 +18661,7 @@ - + @@ -18598,12 +18684,13 @@ wenn ich mich überhaupt entscheiden konnte...

-
+ +
- + @@ -18627,7 +18714,8 @@ - + + @@ -18681,7 +18769,7 @@ - + @@ -18691,7 +18779,8 @@ ...sie verwenden dann ein LabelWidget zur Darstellung

-
+ +
@@ -18712,7 +18801,7 @@ - + @@ -18728,7 +18817,8 @@ Verwende das als Leitgedanke, um das Layout zu entwickeln

-
+ + @@ -19321,7 +19411,7 @@ - + @@ -20179,9 +20269,31 @@ - + + + + + + + + + + + + + + + + + + + + + + + @@ -20383,7 +20495,7 @@ - + @@ -20402,7 +20514,8 @@ erfordert bereits Kenntnis der Innereien

-
+ +
@@ -27460,7 +27573,7 @@ - + @@ -27473,11 +27586,12 @@ Implementierung der real-world-Variante fehlt!

-
+ + - + @@ -27493,7 +27607,8 @@ wie Session- und State-Managment, Commands etc.

-
+ +
@@ -32779,7 +32894,7 @@
- + @@ -32800,7 +32915,8 @@ - + + @@ -35173,7 +35289,7 @@ - + @@ -38173,7 +38289,7 @@ - + @@ -38189,14 +38305,15 @@ Ganz prominent fehlt hier also z.B: MIDI

-
+ +
- + @@ -38209,7 +38326,8 @@ die Aufgrund von Klassifikationen automatisch bereits existieren

-
+ +
@@ -38391,7 +38509,7 @@
- + @@ -38399,7 +38517,34 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -38410,7 +38555,7 @@ - + @@ -38904,7 +39049,7 @@ - + @@ -39038,7 +39183,7 @@ - + @@ -39051,7 +39196,8 @@ sofern das Widget mit entsprechendem Modus eingefügt wurde

-
+ +
@@ -39084,7 +39230,7 @@ - + @@ -39097,7 +39243,8 @@ context->add_class("ohMy");

-
+ + @@ -39176,7 +39323,7 @@ - + @@ -39192,7 +39339,8 @@ oder ist es eine Vererbungs-Hierarchie, wie sie für das CSS-Styling benötigt wird?

-
+ +
@@ -39213,7 +39361,7 @@ - + @@ -39237,7 +39385,8 @@ - + + @@ -39288,7 +39437,7 @@ - + @@ -39307,7 +39456,8 @@ Alles in ein Framework zwingen. Alternativlos, capisce?

-
+ +
@@ -39332,7 +39482,7 @@ - + @@ -39345,7 +39495,8 @@ welche ggfs C++ - Exceptions fängt

-
+ +
@@ -39358,7 +39509,7 @@ - + @@ -39377,11 +39528,12 @@ Nur das ist der Grund. Es geht gar nicht um die Event-Loop

-
+ +
- + @@ -39402,11 +39554,12 @@ - + + - + @@ -39434,7 +39587,8 @@ - + + @@ -39500,7 +39654,7 @@ - + @@ -39555,7 +39709,8 @@ }

-
+ + @@ -39569,7 +39724,7 @@ - + @@ -39636,7 +39791,8 @@ }

-
+ + @@ -39696,7 +39852,7 @@ - + @@ -39709,9 +39865,10 @@ aber macht in etwa die gleichen Operationen

-
+ +
- + @@ -39730,7 +39887,8 @@ Gtk-Main verwendet inzwischen den gleichen Mechanismus

-
+ +
@@ -39743,7 +39901,7 @@ - + @@ -39765,7 +39923,8 @@ Das ist eine subtile Falle.

-
+ +
@@ -39784,7 +39943,7 @@ - + @@ -39807,7 +39966,8 @@ alles das nicht aus dem GUI-Thread heraus geschieht

-
+ +
@@ -39863,7 +40023,7 @@ - + @@ -39873,9 +40033,10 @@ ...ob beim Expand/Collapse das umschließende Widget resized werden soll

-
+ +
- + @@ -39885,12 +40046,13 @@ ob eingeklappt oder ausgeklappt

-
+ +
- + @@ -39903,7 +40065,8 @@ was dazu führt, daß das Kind stets allen verfügbaren Platz nimmt

-
+ +
@@ -39975,7 +40138,7 @@
- + @@ -39988,7 +40151,8 @@ Siehe Beschreibung im Beispiel/Tutorial

-
+ +
@@ -40017,7 +40181,7 @@ - + @@ -40027,9 +40191,10 @@ ....how does the event dispatching deal with partially covered widgets

-
+ +
- + @@ -40039,7 +40204,8 @@ ...for embedded widgets

-
+ +
@@ -40072,7 +40238,7 @@ - + @@ -40085,7 +40251,8 @@ i.e. the enclosing parent widget also gets a chance to redraw itself

-
+ +
@@ -40106,7 +40273,7 @@ - + @@ -40116,13 +40283,14 @@ asked on stackoverflow...

-
+ +
- + @@ -40135,7 +40303,8 @@ by printing values from the on_draw() callback

-
+ +
@@ -40271,7 +40440,7 @@ - + @@ -40299,7 +40468,8 @@ Kind-Widgets noch gar nicht festgelegt war (denn das passiert erst beim draw).

-
+ +
@@ -40337,7 +40507,7 @@ - + @@ -40353,7 +40523,8 @@ und auch ein Signal für Parse-Fehler anschließt

-
+ +
@@ -40380,7 +40551,7 @@ - + @@ -40398,7 +40569,8 @@ Beachte: der Text-Cursor (Marker "insert") hat right gravity

-
+ +
@@ -40473,7 +40645,7 @@ - + @@ -40495,7 +40667,8 @@ The grip is implemented as a GdlDockItemGrip

-
+ +
@@ -40576,7 +40749,7 @@

- + @@ -40586,9 +40759,10 @@ kann eines der Templates im Zyklus vorrübergehend als "incomplete" gelten.

-
+ +
- + @@ -40610,7 +40784,8 @@ Konsequenz: man wählt dann z.B. eine subtil falsche Spezialisierung.

-
+ +
@@ -40636,7 +40811,7 @@ - + @@ -40664,13 +40839,14 @@ selber aus einem statischen Initialisierungs-Kontext heraus erfolgt.

-
+ +
- + @@ -40866,7 +41042,8 @@   }

-
+ +
@@ -41108,7 +41285,7 @@ - + @@ -41133,9 +41310,10 @@ Query<RES>::resolveBy

-
+ +
- + @@ -41170,14 +41348,15 @@ sonst kommt Doxygen durcheinander

-
+ +
- + @@ -41199,7 +41378,8 @@ wird hier kein Link erzeugt

-
+ +
@@ -41215,7 +41395,7 @@ - + @@ -41231,7 +41411,8 @@ Die Icon-Größen ergeben sich aus den Boxes auf 'plate'

-
+ +
@@ -41246,7 +41427,7 @@ - + @@ -41256,7 +41437,8 @@ ...im Besonderen die guten Diagramme für Pulse, ALSA und Jack

-
+ +
@@ -41381,7 +41563,7 @@
- + @@ -41404,10 +41586,11 @@ "-Wl,-rpath-link=target/modules"

-
+ +
- + @@ -41417,14 +41600,15 @@ laufen wieder alle

-
+ + - + @@ -41434,7 +41618,8 @@ test.sh Zeile 138

-
+ +
@@ -41478,7 +41663,7 @@ - + @@ -41488,12 +41673,13 @@ und wir verbringen unsere Zeit mit contention

-
+ +
- + @@ -41503,7 +41689,8 @@ ist klar, hab ich gebrochen

-
+ + @@ -41519,7 +41706,7 @@ - + @@ -41532,7 +41719,8 @@ Vorher hatte ich erste Kollisionen nach 25000 Nummern

-
+ +
@@ -41571,7 +41759,7 @@
- + @@ -41584,7 +41772,8 @@ Aug 10 04:51:39 flaucher kernel: traps: test-suite[8249] trap int3 ip:7ffff7deb241 sp:7fffffffe5c8 error:0

-
+ + @@ -41641,7 +41830,7 @@ - + @@ -41651,7 +41840,8 @@ bison dejagnu flex gobjc libncurses5-dev libreadline-dev liblzma-dev libbabeltrace-dev libbabeltrace-ctf-dev python3-dev

-
+ +
@@ -41667,7 +41857,7 @@ - + @@ -41701,7 +41891,8 @@ au weia LEUTE!

-
+ +
@@ -41725,7 +41916,7 @@
- + @@ -41741,10 +41932,11 @@ und tatsächlich: das ist daneben, GCC hat Recht!

-
+ +
- + @@ -41754,7 +41946,8 @@ aktualisieren und neu bauen

-
+ +
@@ -41774,7 +41967,7 @@ - + @@ -41784,7 +41977,8 @@ wähle Kompatibiltät genau so, daß Ubuntu-Trusty noch unterstützt wird.

-
+ + @@ -41818,7 +42012,7 @@ - + @@ -41831,9 +42025,10 @@ Ich meine also: zu Beginn vom Build sollte das Buildsystem einmal eine Infozeile ausgeben

-
+ +
- + @@ -41843,7 +42038,8 @@ ...denn die stören jeweils beim erzeugen eines Hotfix/Patch im Paketbau per dpkg --commit

-
+ +
@@ -41890,7 +42086,7 @@
- + @@ -41900,11 +42096,12 @@ Doku durchkämmen nach Müll

-
+ + - + @@ -41917,10 +42114,11 @@ WICHTIG: keine vorgreifende Infor publizieren!!!!!

-
+ +
- + @@ -41936,7 +42134,8 @@ insgesamt sorgfältig durchlesen

-
+ + @@ -41946,7 +42145,7 @@ - + @@ -41956,7 +42155,8 @@ knappe Kennzeichnung des Releases in den Kommentar

-
+ + @@ -41964,7 +42164,7 @@ - + @@ -41983,7 +42183,8 @@ denn wir wollen keine DEB-Info im Master haben!

-
+ + @@ -41996,7 +42197,7 @@
- + @@ -42009,7 +42210,8 @@ die unmittelbaren Release-Dokumente durchgehen

-
+ + @@ -42023,7 +42225,7 @@ - + @@ -42036,7 +42238,8 @@ Sollte konfliktfrei sein

-
+ +
@@ -42059,7 +42262,7 @@
- + @@ -42069,7 +42272,8 @@ ...das heißt bauen und hochladen

-
+ + @@ -42123,7 +42327,7 @@ - + @@ -42136,9 +42340,10 @@ unter Debian/Jessie wird das ignoriert

-
+ +
- + @@ -42164,7 +42369,8 @@ Die Wahrscheinlichkeit, daß irgend jemand Lumiera unter Ubuntu/Trusty installieren möchte, erscheint mir akademisch

-
+ +
@@ -42190,7 +42396,7 @@ - + @@ -42200,7 +42406,8 @@ in lib/hash-standard.hpp

-
+ +
@@ -42215,7 +42422,7 @@ - + @@ -42235,7 +42442,8 @@ es gibt Probleme beim Linken mit den Boost-Libraries, die auf Ubuntu/wily mit gcc-5 gebaut sind.

-
+ +
@@ -42243,7 +42451,7 @@ - + @@ -42253,7 +42461,8 @@ Wichtig: hier nur was wirklich gebaut ist und funktioniert!

-
+ +
@@ -42277,7 +42486,7 @@ - + @@ -42293,7 +42502,8 @@ bestehen, aber irgendwann müssen wir das schon glattziehen

-
+ +
@@ -42331,7 +42541,7 @@ - + @@ -42341,7 +42551,8 @@ seit gcc-4.8 ist kein static_assert mehr in der STDlib

-
+ +
@@ -42383,7 +42594,7 @@ - + @@ -42429,10 +42640,11 @@ END

-
+ + - + @@ -42442,11 +42654,12 @@ for I in `seq 1 50`; do target/test-suite CallQueue_test; done

-
+ +
- + @@ -42462,7 +42675,8 @@ und eine Doxygen-Seite im Browser geladen

-
+ +
@@ -42483,7 +42697,7 @@ - + @@ -42493,7 +42707,8 @@ weil sich die Threads gegenseitig ihre Counter inkrementieren.

-
+ +