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_SHAPES_H__ //to avoid nested includes
22
#define __LOMSE_SHAPES_H__
24
#include "lomse_shape_base.h"
26
//using namespace std;
31
////forward declarations
35
//class GmoShapeFBLine;
38
//---------------------------------------------------------------------------------------
39
// a shape drawn by using a single glyph from LenMus font
40
class GmoShapeGlyph : public GmoSimpleShape
47
virtual ~GmoShapeGlyph() {}
49
//implementation of virtual methods from base class
50
virtual void on_draw(Drawer* pDrawer, RenderOptions& opt, UPoint& origin);
51
// void RenderHighlighted(wxDC* pDC, Color colorC);
53
// wxString Dump(int nIndent);
54
// void Shift(LUnits xIncr, LUnits yIncr);
55
// virtual wxBitmap* OnBeginDrag(double rScale, wxDC* pDC);
56
// virtual UPoint OnDrag(lmPaper* pPaper, const UPoint& uPos);
57
// virtual void OnEndDrag(lmPaper* pPaper, lmController* pCanvas, const UPoint& uPos);
58
// UPoint GetObjectOrigin();
61
GmoShapeGlyph(GmoBox* owner, int type, int nShapeIdx, int nGlyph, UPoint pos);
63
// wxBitmap* GetBitmapFromShape(double rScale, Color colorF, Color colorB = *wxWHITE);
64
// virtual double GetPointSize();
68
//---------------------------------------------------------------------------------------
69
class GmoShapeClef : public GmoShapeGlyph
72
GmoShapeClef(GmoBox* owner, int nShapeIdx, int nGlyph, UPoint pos, bool fSmallClef);
76
// UPoint OnDrag(lmPaper* pPaper, const UPoint& uPos);
77
// void OnEndDrag(lmPaper* pPaper, lmController* pCanvas, const UPoint& uPos);
78
// double GetPointSize();
84
////---------------------------------------------------------------------------------------
85
//class GmoShapeSimpleLine : public GmoSimpleShape
88
// GmoShapeSimpleLine(GmoBox* owner, LUnits xStart, LUnits yStart,
89
// LUnits xEnd, LUnits yEnd, LUnits uWidth,
90
// LUnits uBoundsExtraWidth, Color nColor, wxString sName = _T("Line"),
91
// ELineEdges nEdge = lm_eEdgeNormal);
92
// ~GmoShapeSimpleLine() {}
94
// //implementation of virtual methods from base class
95
// void on_draw(Drawer* pDrawer, RenderOptions& opt, UPoint& origin);
96
// wxString Dump(int nIndent);
97
// void Shift(LUnits xIncr, LUnits yIncr);
100
// void Create(LUnits xStart, LUnits yStart, LUnits xEnd, LUnits yEnd,
101
// LUnits uWidth, LUnits uBoundsExtraWidth, Color nColor,
102
// ELineEdges nEdge);
105
// LUnits m_xStart, m_yStart;
106
// LUnits m_xEnd, m_yEnd;
108
// LUnits m_uBoundsExtraWidth;
109
// ELineEdges m_nEdge;
113
////---------------------------------------------------------------------------------------
114
//class GmoShapeRectangle : public GmoSimpleShape
117
// //TODO: remove this backwards compatibility constructor
118
// GmoShapeRectangle(GmoBox* owner, LUnits xLeft, LUnits yTop,
119
// LUnits xRight, LUnits yBottom, LUnits uWidth,
120
// Color color = *wxBLACK, wxString sName = _T("Rectangle"),
121
// bool fDraggable = true, bool fSelectable = true,
122
// bool fVisible = true);
124
// //new rectangle constructor
125
// GmoShapeRectangle(GmoBox* owner,
126
// //position and size
127
// LUnits uxLeft, LUnits uyTop, LUnits uxRight, LUnits uyBottom,
129
// LUnits uBorderWidth, Color nBorderColor,
131
// Color nBgColor = *wxWHITE,
133
// int nShapeIdx = 0, wxString sName = _T("Rectangle"),
134
// bool fDraggable = true, bool fSelectable = true,
135
// bool fVisible = true);
137
// virtual ~GmoShapeRectangle();
139
// //implementation of virtual methods from base class
140
// void on_draw(Drawer* pDrawer, RenderOptions& opt, UPoint& origin);
141
// void RenderNormal(lmPaper* pPaper, Color color);
142
// void RenderWithHandlers(lmPaper* pPaper);
143
// wxString Dump(int nIndent);
144
// void Shift(LUnits uxIncr, LUnits uyIncr);
146
// //Handler IDs. AWARE: Used also as array indexes
149
// lmID_TOP_LEFT = 0,
151
// lmID_BOTTOM_RIGHT,
156
// lmID_RIGHT_CENTER,
157
// lmID_BOTTOM_CENTER,
163
// void SetCornerRadius(LUnits uRadius);
164
// inline void SetBorderStyle(ELineStyle nBorderStyle) { m_nBorderStyle = nBorderStyle; }
167
// wxBitmap* OnBeginDrag(double rScale, wxDC* pDC);
168
// UPoint OnDrag(lmPaper* pPaper, const UPoint& uPos);
169
// void OnEndDrag(lmPaper* pPaper, lmController* pCanvas, const UPoint& uPos);
171
// //handlers dragging
172
// UPoint OnHandlerDrag(lmPaper* pPaper, const UPoint& uPos, long nHandlerID);
173
// void OnHandlerEndDrag(lmController* pCanvas, const UPoint& uPos, long nHandlerID);
176
// void MovePoints(int nNumPoints, int nShapeIdx, UPoint* pShifts, bool fAddShifts);
180
// void Create(LUnits xLeft, LUnits yTop, LUnits xRight, LUnits yBottom,
181
// LUnits uBorderWidth, Color nBorderColor, Color nBgColor);
182
// void DrawRectangle(lmPaper* pPaper, Color colorC, bool fSketch);
183
// void ComputeNewPointsAndHandlersPositions(const UPoint& uPos, long nHandlerID);
184
// void ComputeCenterPoints();
185
// void UpdateBounds();
186
// void SavePoints();
190
// LUnits m_uCornerRadius;
193
// LUnits m_uBorderWidth;
194
// Color m_nBorderColor;
195
// ELineStyle m_nBorderStyle;
197
// //rectangle points and handlers
198
// UPoint m_uPoint[lmID_NUM_HANDLERS]; //four corners + anchor point + centers of rectangle sides
199
// UPoint m_uSavePoint[lmID_NUM_HANDLERS]; //to save start and end points when dragging/moving
200
// lmHandlerSquare* m_pHandler[lmID_NUM_HANDLERS]; //handlers
204
////---------------------------------------------------------------------------------------
205
//class GmoShapeInvisible : public GmoSimpleShape
208
// GmoShapeInvisible(GmoBox* owner, int nShapeIdx, UPoint uPos, lmUSize uSize,
209
// wxString sName=_T("Invisible"));
210
// ~GmoShapeInvisible() {}
213
// wxString Dump(int nIndent);
214
// void Render(lmPaper* pPaper, Color color);
219
////---------------------------------------------------------------------------------------
220
//class GmoShapeStem : public GmoShapeSimpleLine
223
// GmoShapeStem(GmoBox* owner, LUnits xPos, LUnits yStart, LUnits uExtraLength,
224
// LUnits yEnd, bool fStemDown, LUnits uWidth, Color nColor);
225
// ~GmoShapeStem() {}
227
// //specific methods
228
// void SetLength(LUnits uLenght, bool fModifyTop);
229
// inline bool StemDown() const { return m_fStemDown; }
230
// void Adjust(LUnits xPos, LUnits yStart, LUnits yEnd, bool fStemDown);
231
// LUnits GetYStartStem();
232
// LUnits GetYEndStem();
233
// LUnits GetXCenterStem();
234
// inline LUnits GetExtraLenght() { return m_uExtraLength; }
238
// LUnits m_uExtraLength;
242
////---------------------------------------------------------------------------------------
243
//class GmoShapeFiguredBass : public lmCompositeShape
246
// GmoShapeFiguredBass(GmoBox* owner, int nShapeIdx, Color nColor)
247
// : lmCompositeShape(pOwner, nShapeIdx, nColor, _T("Figured bass"), true) //true= lmDRAGGABLE
248
// { m_nType = GmoObj::k_shape_FiguredBass; }
249
// ~GmoShapeFiguredBass() {}
251
// //info about related shapes
252
// inline void OnFBLineAttached(int nLine, GmoShapeLine* pShapeFBLine)
253
// { m_pFBLineShape[nLine] = pShapeFBLine; }
256
// void Shift(LUnits uxIncr, LUnits uyIncr);
259
// GmoShapeLine* m_pFBLineShape[2]; //The two lines of a FB line. This is the end FB of the line
263
////---------------------------------------------------------------------------------------
264
//class GmoShapeWindow : public GmoShapeRectangle
267
// GmoShapeWindow(GmoBox* owner, int nShapeIdx,
268
// //position and size
269
// LUnits uxLeft, LUnits uyTop, LUnits uxRight, LUnits uyBottom,
271
// LUnits uBorderWidth, Color nBorderColor,
273
// Color nBgColor = *wxWHITE,
275
// wxString sName = _T("Window"),
276
// bool fDraggable = true, bool fSelectable = true,
277
// bool fVisible = true);
278
// virtual ~GmoShapeWindow() {}
281
// void on_draw(Drawer* pDrawer, RenderOptions& opt, UPoint& origin);
283
// //specific methods
287
// wxWindow* m_pWidget; //the window to embbed
290
////global functions defined in this module
291
//extern wxBitmap* GetBitmapForGlyph(double rScale, int nGlyph, double rPointSize,
292
// Color colorF, Color colorB);
298
#endif // __LOMSE_SHAPES_H__