2009-02-09 01:21:01 +01:00
|
|
|
/*
|
2016-12-12 02:20:58 +01:00
|
|
|
Notification(Proxy) - public service to push information into the GUI
|
2010-12-17 23:28:49 +01:00
|
|
|
|
2009-02-09 01:21:01 +01:00
|
|
|
Copyright (C) Lumiera.org
|
|
|
|
|
2008, Hermann Vosseler <Ichthyostega@web.de>
|
2010-12-17 23:28:49 +01:00
|
|
|
|
2009-02-09 01:21:01 +01:00
|
|
|
This program is free software; you can redistribute it and/or
|
|
|
|
|
modify it under the terms of the GNU General Public License as
|
2010-12-17 23:28:49 +01:00
|
|
|
published by the Free Software Foundation; either version 2 of
|
|
|
|
|
the License, or (at your option) any later version.
|
|
|
|
|
|
2009-02-09 01:21:01 +01:00
|
|
|
This program is distributed in the hope that it will be useful,
|
|
|
|
|
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
|
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
|
GNU General Public License for more details.
|
2010-12-17 23:28:49 +01:00
|
|
|
|
2009-02-09 01:21:01 +01:00
|
|
|
You should have received a copy of the GNU General Public License
|
|
|
|
|
along with this program; if not, write to the Free Software
|
|
|
|
|
Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
2010-12-17 23:28:49 +01:00
|
|
|
|
2009-02-09 01:21:01 +01:00
|
|
|
* *****************************************************/
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2018-04-03 03:14:55 +02:00
|
|
|
/** @file notification-interface-proxy.cpp
|
2018-11-15 23:59:23 +01:00
|
|
|
** Interface-Proxy for the stage::GuiNotification facade.
|
|
|
|
|
** The purpose is to define a proxy implementation of stage::GuiNotification, in order to
|
2009-02-09 01:21:01 +01:00
|
|
|
** redirect any calls through the associated C Language Interface "lumieraorg_GuiNotification"
|
2015-05-29 04:44:58 +02:00
|
|
|
**
|
2016-12-12 02:10:52 +01:00
|
|
|
** @see gui-notification-facade.hpp
|
2015-05-29 04:44:58 +02:00
|
|
|
** @see notification-service.hpp actual implementation within the GUI
|
2009-02-09 01:21:01 +01:00
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
|
2016-12-12 02:10:52 +01:00
|
|
|
#include "include/gui-notification-facade.h"
|
2016-11-04 22:29:24 +01:00
|
|
|
#include "include/interfaceproxy.hpp"
|
2009-02-09 01:21:01 +01:00
|
|
|
|
2018-11-15 23:55:13 +01:00
|
|
|
namespace stage {
|
2018-04-03 04:58:22 +02:00
|
|
|
/** static storage for the facade access front-end */
|
|
|
|
|
lib::Depend<GuiNotification> GuiNotification::facade;
|
|
|
|
|
}
|
2009-02-09 01:21:01 +01:00
|
|
|
namespace lumiera {
|
2015-05-29 04:44:58 +02:00
|
|
|
namespace facade {
|
2018-11-15 23:59:23 +01:00
|
|
|
using stage::ID;
|
2018-09-29 19:04:27 +02:00
|
|
|
using lib::diff::GenNode;
|
2017-08-13 07:09:06 +02:00
|
|
|
using lib::diff::MutationMessage;
|
2015-05-29 04:44:58 +02:00
|
|
|
|
|
|
|
|
|
2018-04-03 07:45:13 +02:00
|
|
|
|
|
|
|
|
/* ==================== SessionCommand =================================== */
|
|
|
|
|
|
|
|
|
|
using Interface = LUMIERA_INTERFACE_INAME(lumieraorg_GuiNotification, 0);
|
2018-11-15 23:59:23 +01:00
|
|
|
using Facade = stage::GuiNotification;
|
2018-04-03 07:45:13 +02:00
|
|
|
|
|
|
|
|
using IHandle = InstanceHandle<Interface, Facade>;
|
|
|
|
|
|
|
|
|
|
|
2018-04-03 04:58:22 +02:00
|
|
|
template<>
|
|
|
|
|
class Proxy<IHandle>
|
|
|
|
|
: public Binding<IHandle>
|
2015-05-29 04:44:58 +02:00
|
|
|
{
|
2018-11-15 23:59:23 +01:00
|
|
|
using Level = stage::NotifyLevel;
|
2017-01-20 04:18:57 +01:00
|
|
|
|
2015-05-29 04:44:58 +02:00
|
|
|
//----Proxy-Implementation-of-GuiNotification--------
|
|
|
|
|
|
2018-09-29 17:34:25 +02:00
|
|
|
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)); }
|
2018-09-29 19:04:27 +02:00
|
|
|
void mark (ID uiElement, GenNode&& stateMark) override { _i_.mark (&uiElement, &stateMark); }
|
2018-09-29 17:34:25 +02:00
|
|
|
void mutate (ID uiElement, MutationMessage&& diff) override { _i_.mutate (&uiElement, &diff); }
|
|
|
|
|
void triggerGuiShutdown (string const& cause) override { _i_.triggerGuiShutdown (cStr(cause)); }
|
2015-05-29 04:44:58 +02:00
|
|
|
|
|
|
|
|
|
|
|
|
|
public:
|
2018-04-03 07:45:13 +02:00
|
|
|
using Binding<IHandle>::Binding;
|
2015-05-29 04:44:58 +02:00
|
|
|
};
|
|
|
|
|
|
2018-04-03 07:45:13 +02:00
|
|
|
|
|
|
|
|
/** emit proxy code here... */
|
|
|
|
|
template
|
|
|
|
|
class Link<Interface,Facade>;
|
|
|
|
|
|
|
|
|
|
}} //namespace facade::lumiera
|