20 #ifndef EQFABRIC_WINDOW_H
21 #define EQFABRIC_WINDOW_H
23 #include <eq/fabric/object.h>
25 #include <eq/fabric/drawableConfig.h>
26 #include <eq/fabric/paths.h>
27 #include <eq/fabric/pixelViewport.h>
28 #include <eq/fabric/viewport.h>
29 #include <eq/fabric/windowSettings.h>
36 template<
class P,
class W,
class C,
class Settings = WindowSettings >
37 class Window :
public Object
51 const P*
getPipe()
const {
return _pipe; }
60 {
return _data.drawableConfig; }
74 EQFABRIC_INL
void setName(
const std::string& name )
final;
102 virtual void notifyViewportChanged();
121 EQFABRIC_INL
void setSettings(
const Settings& settings );
128 const int32_t value );
135 EQFABRIC_INL
static const std::string&
140 EQFABRIC_INL WindowPath getPath()
const;
144 EQFABRIC_INL
virtual void backup();
145 EQFABRIC_INL
virtual void restore();
146 void create( C** channel );
147 void release( C* channel );
148 virtual void output( std::ostream& )
const {}
150 EQFABRIC_INL
virtual uint128_t commit(
const uint32_t incarnation =
156 explicit Window( P* parent );
158 EQFABRIC_INL
virtual ~
Window();
160 virtual void attach(
const uint128_t&
id,
161 const uint32_t instanceID );
164 EQFABRIC_INL
virtual void serialize( co::DataOStream& os,
165 const uint64_t dirtyBits );
167 EQFABRIC_INL
virtual void deserialize( co::DataIStream& is,
168 const uint64_t dirtyBits );
170 EQFABRIC_INL
virtual void notifyDetach();
173 EQFABRIC_INL
virtual void setDirty(
const uint64_t bits );
176 void _setDrawableConfig(
const DrawableConfig& drawableConfig );
179 virtual ChangeType getChangeType()
const {
return UNBUFFERED; }
181 C* _findChannel(
const uint128_t&
id );
186 DIRTY_SETTINGS = Object::DIRTY_CUSTOM << 0,
187 DIRTY_CHANNELS = Object::DIRTY_CUSTOM << 1,
188 DIRTY_VIEWPORT = Object::DIRTY_CUSTOM << 2,
189 DIRTY_DRAWABLECONFIG = Object::DIRTY_CUSTOM << 3,
191 DIRTY_SETTINGS | DIRTY_CHANNELS | DIRTY_VIEWPORT |
192 DIRTY_DRAWABLECONFIG | DIRTY_OBJECT_BITS
196 virtual uint64_t getRedistributableBits()
const
197 {
return DIRTY_WINDOW_BITS; }
211 Settings windowSettings;
214 DrawableConfig drawableConfig;
231 friend class Channel< W, C >;
233 void _addChannel( C* channel );
236 EQFABRIC_INL
bool _removeChannel( C* channel );
239 bool _mapNodeObjects() {
return _pipe->_mapNodeObjects(); }
241 typedef co::CommandFunc< Window< P, W, C, Settings > > CmdFunc;
242 bool _cmdNewChannel( co::ICommand& command );
243 bool _cmdNewChannelReply( co::ICommand& command );
246 template<
class P,
class W,
class C,
class Settings > EQFABRIC_INL
247 std::ostream& operator << ( std::ostream& os,
248 const Window< P, W, C, Settings >& window );
252 #endif // EQFABRIC_WINDOW_H
virtual EQFABRIC_INL void setPixelViewport(const PixelViewport &pvp)
Set the window's pixel viewport wrt its parent pipe.
ElementVisitor< W, LeafVisitor< C > > Visitor
The Window visitor type.
EQFABRIC_INL void setName(const std::string &name) final
Set the window's name/caption.
IAttribute
Window attributes.
A fractional viewport with methods for manipulation.
EQFABRIC_INL void setViewport(const Viewport &vp)
Set the window's viewport wrt its parent pipe.
std::vector< C * > Channels
A vector of pointers to channels.
const Viewport & getViewport() const
EQFABRIC_INL const PixelViewport & getPixelViewport() const
const Channels & getChannels() const
EQFABRIC_INL void setIAttribute(const WindowSettings::IAttribute attr, const int32_t value)
Set a window attribute.
A visitor to traverse non-leaf elements and their children in a tree.
virtual EQFABRIC_INL void setDirty(const uint64_t bits)
const DrawableConfig & getDrawableConfig() const
A Window represents an on-screen or off-screen drawable.
EQFABRIC_INL const Settings & getSettings() const
EQFABRIC_INL void setSettings(const Settings &settings)
Set the settings of this window.
EQFABRIC_INL int32_t getIAttribute(const WindowSettings::IAttribute attr) const
bool hasFixedViewport() const
const P * getPipe() const
EQFABRIC_INL VisitorResult accept(Visitor &visitor)
Perform a depth-first traversal of this window.
Stores the characteristics of a window's frame buffer configuration.
Holds a 2D pixel viewport with methods for manipulation.