1
//--------------------------------------------------------------------------------------
2
// This file is part of the Lomse library.
3
// Copyright (c) 2010 Lomse project
5
// Lomse is free software; you can redistribute it and/or modify it under the
6
// terms of the GNU General Public License as published by the Free Software Foundation,
7
// either version 3 of the License, or (at your option) any later version.
9
// Lomse is distributed in the hope that it will be useful, but WITHOUT ANY
10
// WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A
11
// PARTICULAR PURPOSE. See the GNU General Public License for more details.
13
// You should have received a copy of the GNU General Public License along
14
// with Lomse; if not, see <http://www.gnu.org/licenses/>.
16
// For any comment, suggestion or feature request, please contact the manager of
17
// the project at cecilios@users.sourceforge.net
19
//-------------------------------------------------------------------------------------
21
#ifndef __LOMSE_GM_BASIC_H__
22
#define __LOMSE_GM_BASIC_H__
26
//#include "lomse_observable.h"
33
//forward declarations
43
//------------------------------------------------------------------------------
47
GmoBoxDocument* m_root;
53
inline GmoBoxDocument* get_root() { return m_root; }
58
//void create_shapes();
59
//void layout_model();
60
//void render_model();
65
//Abstract class from which all graphic objects must derive
66
//------------------------------------------------------------------------------
73
GmoObj(GmoObj* owner);
78
//------------------------------------------------------------------------------
79
class GmoBox : public GmoObj
82
std::vector<GmoBox*> m_childBoxes;
85
GmoBox(GmoObj* owner) : GmoObj(owner) {}
89
inline int get_num_children() { return static_cast<int>( m_childBoxes.size() ); }
90
inline void add_child_box(GmoBox* child) { m_childBoxes.push_back(child); }
91
GmoBox* GmoBox::get_child_box(int i); //i = 0..n-1
95
//------------------------------------------------------------------------------
96
class GmoShape : public GmoObj
101
GmoShape(GmoObj* owner) : GmoObj(owner) {}
102
virtual ~GmoShape() {}
106
//------------------------------------------------------------------------------
107
class GmoBoxDocument : public GmoBox
116
GmoBoxDocPage* add_new_page();
117
GmoBoxDocPage* get_page(int i); //i = 0..n-1
118
inline int get_num_pages() { return get_num_children(); }
121
//------------------------------------------------------------------------------
122
class GmoBoxDocPage : public GmoBox
128
GmoBoxDocPage(GmoObj* owner);
131
inline void set_number(int num) { m_numPage = num; }
132
inline int get_number() { return m_numPage; }
136
//------------------------------------------------------------------------------
137
class GmoBoxScore : public GmoBox
142
GmoBoxScore(GmoObj* owner) : GmoBox(owner) {}
151
#endif //__LOMSE_GM_BASIC_H__