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();
125 const int32_t value );
132 EQFABRIC_INL
static const std::string&
137 EQFABRIC_INL WindowPath getPath()
const;
141 EQFABRIC_INL
virtual void backup();
142 EQFABRIC_INL
virtual void restore();
143 void create( C** channel );
144 void release( C* channel );
145 virtual void output( std::ostream& )
const {}
147 EQFABRIC_INL
virtual uint128_t commit(
const uint32_t incarnation =
155 EQFABRIC_INL
virtual ~
Window();
157 virtual void attach(
const uint128_t&
id,
158 const uint32_t instanceID );
161 EQFABRIC_INL
virtual void serialize( co::DataOStream& os,
162 const uint64_t dirtyBits );
164 EQFABRIC_INL
virtual void deserialize( co::DataIStream& is,
165 const uint64_t dirtyBits );
167 EQFABRIC_INL
virtual void notifyDetach();
170 EQFABRIC_INL
virtual void setDirty(
const uint64_t bits );
173 void _setDrawableConfig(
const DrawableConfig& drawableConfig );
176 EQFABRIC_INL Settings& _getSettings();
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 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.