Lumiera  0.pre.03
»edit your freedom«
display-interface-proxy.cpp
Go to the documentation of this file.
1 /*
2  Display(Proxy) - service providing access to a display for outputting frames
3 
4  Copyright (C) Lumiera.org
5  2009, 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 #include "include/display-facade.h"
39 
40 namespace lumiera {
41 
44 
47 
48 } // namespace lumiera
49 
50 
51 
52 namespace lumiera {
53 namespace facade {
54 
55 
56 
57  /* ==================== stage::Display ====================================== */
58 
59  using Interface = LUMIERA_INTERFACE_INAME(lumieraorg_Display, 0);
60  using Facade = lumiera::Display;
61 
62  using IHandle = InstanceHandle<Interface, Facade>;
63 
64 
65  template<>
66  class Proxy<IHandle>
67  : public Binding<IHandle>
68  {
69  //----Proxy-Implementation-of-lumiera::Display--------
70 
72  getHandle (LumieraDisplaySlot display) override
73  {
74  _i_.allocate (display);
75  Sink sinkHandle;
76  sinkHandle.activate (display, _i_.release);
77  if (lumiera_error_peek() || !sinkHandle)
78  throw lumiera::error::State("failed to allocate output DisplayerSlot",
79  lumiera_error());
80  return sinkHandle;
81  }
82 
83 
84  public:
86  };
87 
88 
90  template
92 
93 }} //namespace facade::lumiera
Interface for outputting frames to an (already allocated) viewer or display.
lumiera_err lumiera_error_peek(void)
Check current error state without clearing it Please avoid this function and use lumiera_error() if p...
Definition: error-state.c:142
static lib::Depend< Display > facade
get an implementation instance of this service
virtual ~Display()
this is an interface
Access point to singletons and other kinds of dependencies designated by type.
Definition: depend.hpp:289
Experimental Interface, allowing the Dummy-Player to access the video display widget in the GUI...
Derived specific exceptions within Lumiera&#39;s exception hierarchy.
Definition: error.hpp:199
to be specialised and implemented for each individual interface and facade interface.
Implementation Base for building Facade Proxy implementations.
lumiera_err lumiera_error(void)
Get and clear current error state.
Definition: error-state.c:124
virtual Sink getHandle(LumieraDisplaySlot)=0
allocate an already existing display/viewer for output
Implementation of C++ binding proxies on top of the (plain-C based) interface system.
Handle tracking the registration of an interface, deregistering it on deletion.
#define LUMIERA_INTERFACE_INAME(name, version)
Construct a type identifier for an interface.
Definition: interface.h:102
Handle & activate(IMP *impl, DEL whenDead)
Activation of the handle by the managing service.
Definition: handle.hpp:121
Lumiera public interface.
Definition: advice.cpp:113
Functor for pushing frames to the display.