Lumiera  0.pre.03
»edit your freedom«
notification-interface-proxy.cpp
Go to the documentation of this file.
1 /*
2  Notification(Proxy) - public service to push information into the GUI
3 
4  Copyright (C) Lumiera.org
5  2008, Hermann Vosseler <Ichthyostega@web.de>
6 
7  This program is free software; you can redistribute it and/or
8  modify it under the terms of the GNU General Public License as
9  published by the Free Software Foundation; either version 2 of
10  the License, or (at your option) any later version.
11 
12  This program is distributed in the hope that it will be useful,
13  but WITHOUT ANY WARRANTY; without even the implied warranty of
14  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15  GNU General Public License for more details.
16 
17  You should have received a copy of the GNU General Public License
18  along with this program; if not, write to the Free Software
19  Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
20 
21 * *****************************************************/
22 
23 
24 
37 
38 namespace stage {
41 }
42 namespace lumiera {
43 namespace facade {
44  using stage::ID;
45  using lib::diff::GenNode;
47 
48 
49 
50  /* ==================== SessionCommand =================================== */
51 
52  using Interface = LUMIERA_INTERFACE_INAME(lumieraorg_GuiNotification, 0);
53  using Facade = stage::GuiNotification;
54 
55  using IHandle = InstanceHandle<Interface, Facade>;
56 
57 
58  template<>
59  class Proxy<IHandle>
60  : public Binding<IHandle>
61  {
62  using Level = stage::NotifyLevel;
63 
64  //----Proxy-Implementation-of-GuiNotification--------
65 
66  void displayInfo (Level level, string const& text) override { _i_.displayInfo (level, cStr(text)); }
67  void markError (ID uiElement, string const& text) override { _i_.markError(&uiElement, cStr(text)); }
68  void markNote (ID uiElement, string const& text) override { _i_.markNote (&uiElement, cStr(text)); }
69  void mark (ID uiElement, GenNode&& stateMark) override { _i_.mark (&uiElement, &stateMark); }
70  void mutate (ID uiElement, MutationMessage&& diff) override { _i_.mutate (&uiElement, &diff); }
71  void triggerGuiShutdown (string const& cause) override { _i_.triggerGuiShutdown (cStr(cause)); }
72 
73 
74  public:
75  using Binding<IHandle>::Binding;
76  };
77 
78 
80  template
81  class Link<Interface,Facade>;
82 
83 }} //namespace facade::lumiera
Major public Interface of the Lumiera GUI.
CStr cStr(std::string const &rendered)
convenience shortcut: forced conversion to c-String via string.
Definition: symbol.hpp:68
Opaque message to effect a structural change on a target, which is likewise only known in an abstract...
Access point to singletons and other kinds of dependencies designated by type.
Definition: depend.hpp:289
Lumiera GTK UI implementation root.
Definition: guifacade.cpp:46
Implementation of C++ binding proxies on top of the (plain-C based) interface system.
Global access point to push state update and notification of events from the lower layers into the Lu...
#define LUMIERA_INTERFACE_INAME(name, version)
Construct a type identifier for an interface.
Definition: interface.h:102
Lumiera public interface.
Definition: advice.cpp:113
static lib::Depend< GuiNotification > facade
static storage for the facade access front-end
generic data element node within a tree
Definition: gen-node.hpp:231