Lumiera  0.pre.03
»edityourfreedom«
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages
display-facade.h
Go to the documentation of this file.
1 /*
2  DISPLAY-FACADE.h - accessing 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 
43 #ifndef GUI_INTERFACE_DISPLAY_H
44 #define GUI_INTERFACE_DISPLAY_H
45 
47 
48 
49 
50 
51 
52 #ifdef __cplusplus /* ============== C++ Interface ================= */
53 
54 #include "lib/depend.hpp"
55 #include "lib/handle.hpp"
56 
57 
58 
59 
60 namespace lumiera {
61 
62 
63  /**************************************************************/
86  class Display
87  {
88  public:
91 
92 
99  class Sink
100  : public lib::Handle<lumiera_displaySlot>
101  {
102 
103  public:
107  inline void
109  {
110  impl().put_ (&impl(),frame);
111  }
112  };
113 
114 
115 
118  virtual Sink getHandle(LumieraDisplaySlot) =0;
119 
120 
121  virtual ~Display();
122  };
123 
124 
125 
126 
127 } // namespace lumiera
128 
129 
130 
131 extern "C" {
132 #endif /* =========================== CL Interface ===================== */
133 
134 
135 #include "common/interface.h"
136 
137 LUMIERA_INTERFACE_DECLARE (lumieraorg_Display, 0
138  , LUMIERA_INTERFACE_SLOT (void, allocate,(LumieraDisplaySlot) )
139  , LUMIERA_INTERFACE_SLOT (void, release,(LumieraDisplaySlot) )
140  , LUMIERA_INTERFACE_SLOT (void, put,(LumieraDisplaySlot, LumieraDisplayFrame))
141 );
142 
143 
144 #ifdef __cplusplus
145 }
146 #endif
147 #endif
Generic opaque reference counting handle, for accessing a service and managing its lifecycle...
Definition: handle.hpp:72
Interface for outputting frames to an (already allocated) viewer or display.
static lib::Depend< Display > facade
get an implementation instance of this service
lumiera_displaySlot * LumieraDisplaySlot
virtual ~Display()
this is an interface
unsigned char * LumieraDisplayFrame
void operator()(LumieraDisplayFrame frame)
push a frame up to the display, calling through the CL Interface.
Access point to singletons and other kinds of dependencies designated by type.
Definition: depend.hpp:275
Lumiera interface macros and structures.
lumiera_displaySlot & impl() const
Definition: handle.hpp:149
virtual Sink getHandle(LumieraDisplaySlot)=0
allocate an already existing display/viewer for output
Singleton services and Dependency Injection.
Lumiera public interface.
A generic opaque handle to an implementation entity, including lifecycle management.
LUMIERA_INTERFACE_DECLARE(lumieraorg_Display, 0, LUMIERA_INTERFACE_SLOT(void, allocate,(LumieraDisplaySlot)), LUMIERA_INTERFACE_SLOT(void, release,(LumieraDisplaySlot)), LUMIERA_INTERFACE_SLOT(void, put,(LumieraDisplaySlot, LumieraDisplayFrame)))
Opaque handles and similar typedefs used to communicate via the lumiera::Display and lumiera::DummyPl...
Functor for pushing frames to the display.