From 5fd3fb3d7b02ae72b5ac3eca5c65284c5ccefb9e Mon Sep 17 00:00:00 2001 From: Ichthyostega Date: Sat, 29 Sep 2018 17:34:25 +0200 Subject: [PATCH] DemoGuiRoundtrip: first successful complete roundtrip GUI->Proc->GUI (see #1099) A communication chain, triggered from a button in a non-modal dialog box, passing invocation into another thread, dispatched by the ProcDispatcher, then again passing thread boundaries to push a response back into the UI. This is a milestone, and integrates several components built during the last years. --- src/common/notification-interface-proxy.cpp | 10 +++--- src/gui/notification-service.cpp | 12 +++---- src/include/gui-notification-facade.h | 6 ++-- wiki/thinkPad.ichthyo.mm | 36 +++++++++++++++++++-- 4 files changed, 48 insertions(+), 16 deletions(-) diff --git a/src/common/notification-interface-proxy.cpp b/src/common/notification-interface-proxy.cpp index cb8951562..e6d1160f1 100644 --- a/src/common/notification-interface-proxy.cpp +++ b/src/common/notification-interface-proxy.cpp @@ -62,11 +62,11 @@ namespace facade { //----Proxy-Implementation-of-GuiNotification-------- - void displayInfo (Level level, string const& text) override { _i_.displayInfo (level, cStr(text)); } - void markError (ID uiElement, string const& text) override { _i_.markError(uiElement.getHash().get(), cStr(text)); } - void markNote (ID uiElement, string const& text) override { _i_.markNote (uiElement.getHash().get(), cStr(text)); } - void mutate (ID uiElement, MutationMessage&& diff) override { _i_.mutate (uiElement.getHash().get(), &diff); } - void triggerGuiShutdown (string const& cause) override { _i_.triggerGuiShutdown (cStr(cause)); } + void displayInfo (Level level, string const& text) override { _i_.displayInfo (level, cStr(text)); } + void markError (ID uiElement, string const& text) override { _i_.markError(&uiElement, cStr(text)); } + void markNote (ID uiElement, string const& text) override { _i_.markNote (&uiElement, cStr(text)); } + void mutate (ID uiElement, MutationMessage&& diff) override { _i_.mutate (&uiElement, &diff); } + void triggerGuiShutdown (string const& cause) override { _i_.triggerGuiShutdown (cStr(cause)); } public: diff --git a/src/gui/notification-service.cpp b/src/gui/notification-service.cpp index 2862a1fb2..73251c88d 100644 --- a/src/gui/notification-service.cpp +++ b/src/gui/notification-service.cpp @@ -232,27 +232,27 @@ namespace gui { } ) , LUMIERA_INTERFACE_INLINE (markError, - void, (LumieraUid element, const char* text), + void, (const void* element, const char* text), { if (!_instance) lumiera_error_set (LUMIERA_ERROR_LIFECYCLE, text); else - _instance().markError (reinterpret_cast (*element), text); + _instance().markError (*static_cast (element), text); } ) , LUMIERA_INTERFACE_INLINE (markNote, - void, (LumieraUid element, const char* text), + void, (const void* element, const char* text), { if (!_instance) lumiera_error_set (LUMIERA_ERROR_LIFECYCLE, text); else - _instance().markNote (reinterpret_cast (*element), text); + _instance().markNote (*static_cast (element), text); } ) , LUMIERA_INTERFACE_INLINE (mutate, - void, (LumieraUid element, void* diff), + void, (const void* element, void* diff), { if (!_instance) lumiera_error_set (LUMIERA_ERROR_LIFECYCLE, "passing diff message"); else - _instance().mutate (reinterpret_cast (*element), move(*reinterpret_cast (diff))); + _instance().mutate (*static_cast (element), move(*reinterpret_cast (diff))); } ) , LUMIERA_INTERFACE_INLINE (triggerGuiShutdown, diff --git a/src/include/gui-notification-facade.h b/src/include/gui-notification-facade.h index f85f00fc1..6babf13f7 100644 --- a/src/include/gui-notification-facade.h +++ b/src/include/gui-notification-facade.h @@ -129,9 +129,9 @@ extern "C" { LUMIERA_INTERFACE_DECLARE (lumieraorg_GuiNotification, 0, LUMIERA_INTERFACE_SLOT (void, displayInfo, (uint, const char*)), - LUMIERA_INTERFACE_SLOT (void, markError, (LumieraUid, const char*)), - LUMIERA_INTERFACE_SLOT (void, markNote, (LumieraUid, const char*)), - LUMIERA_INTERFACE_SLOT (void, mutate, (LumieraUid, void*)), + LUMIERA_INTERFACE_SLOT (void, markError, (const void*, const char*)), ////////////TICKET #1175 : need a way to pass EntryID + LUMIERA_INTERFACE_SLOT (void, markNote, (const void*, const char*)), + LUMIERA_INTERFACE_SLOT (void, mutate, (const void*, void*)), LUMIERA_INTERFACE_SLOT (void, triggerGuiShutdown, (const char*)), ); diff --git a/wiki/thinkPad.ichthyo.mm b/wiki/thinkPad.ichthyo.mm index 880cff9e8..70f4b52e4 100644 --- a/wiki/thinkPad.ichthyo.mm +++ b/wiki/thinkPad.ichthyo.mm @@ -2835,8 +2835,8 @@ - - + + @@ -2865,11 +2865,43 @@ + + + + + + + + + + + + +

+ ...und zwar an dem Punkt, an dem ich eine DiffMessage in das GUI schicke. +

+

+ DiffMessage repräsentiert einen für den User verdeckten Callback +

+ + +
+
+ + + +
+ + + + + +