Line data Source code
1 :
2 : /* Copyright (c) 2009-2014, Stefan Eilemann <eile@equalizergraphics.com>
3 : *
4 : * This library is free software; you can redistribute it and/or modify it under
5 : * the terms of the GNU Lesser General Public License version 2.1 as published
6 : * by the Free Software Foundation.
7 : *
8 : * This library is distributed in the hope that it will be useful, but WITHOUT
9 : * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
10 : * FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more
11 : * details.
12 : *
13 : * You should have received a copy of the GNU Lesser General Public License
14 : * along with this library; if not, write to the Free Software Foundation, Inc.,
15 : * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
16 : */
17 :
18 : #ifndef EQSERVER_LAYOUT_H
19 : #define EQSERVER_LAYOUT_H
20 :
21 : #include "api.h"
22 : #include "visitorResult.h" // enum
23 : #include "types.h"
24 :
25 : #include <eq/fabric/layout.h> // base class
26 : #include <string>
27 :
28 : namespace eq
29 : {
30 : namespace fabric
31 : {
32 : template< class L, class V, class O > class View;
33 : }
34 : namespace server
35 : {
36 : /** The layout. @sa eq::Layout */
37 : class Layout : public fabric::Layout< Config, Layout, View >
38 : {
39 : public:
40 : /** Construct a new Layout. */
41 : EQSERVER_API Layout( Config* parent );
42 :
43 : /** Destruct this layout. */
44 : virtual ~Layout();
45 :
46 : /** @name Data Access */
47 : //@{
48 : /** @return the Server of this layout. @version 1.0 */
49 : ServerPtr getServer();
50 : //@}
51 :
52 : /** @return true if this layout should be deleted. */
53 110 : bool needsDelete() const { return _state == STATE_DELETE; }
54 :
55 : /** @name Operations */
56 : //@{
57 : /**
58 : * Trigger a layout (de)activation
59 : *
60 : * @param canvas The canvas triggering the (de)activation.
61 : * @param active true to activate, false to deactivate.
62 : */
63 : void trigger( const Canvas* canvas, const bool active );
64 :
65 : /** Schedule deletion of this layout. */
66 : void postDelete();
67 : //@}
68 :
69 : private:
70 : enum State
71 : {
72 : STATE_ACTIVE = 0, // next: DELETE
73 : STATE_DELETE, // next: destructor
74 : }
75 : _state;
76 : };
77 :
78 : std::ostream& operator << ( std::ostream& os, const Layout* layout);
79 : }
80 : }
81 : #endif // EQSERVER_LAYOUT_H
|