-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathcmds.cpp
More file actions
executable file
·38 lines (30 loc) · 857 Bytes
/
cmds.cpp
File metadata and controls
executable file
·38 lines (30 loc) · 857 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
// cmds.cpp
#include "cmds.h"
#include "cmdsubject.h"
#include "mgspfactory.h"
#include "HitTestCmd.h"
#include "mgshapet.h"
#include "VGDimCmd.h"
#include "VGDimExample.h"
#include "mgnote.h"
class DemoCmdsObserver : public CmdObserverDefault
{
public:
DemoCmdsObserver() {}
};
static DemoCmdsObserver _observer;
int DemoCmdsImpl::registerCmds(long mgView)
{
MgView* view = MgView::fromHandle(mgView);
view->getCmdSubject()->registerObserver(&_observer);
MgShapeT<VGDimExample>::registerCreator(view->getShapeFactory());
MgShapeT<MgNote>::registerCreator(view->getShapeFactory());
int n = 0;
n += mgRegisterCommand<HitTestCmd>(view);
n += mgRegisterCommand<VGDimCmd>(view);
return n;
}
int DemoCmdsImpl::getDimensions(long, float*, char*, int)
{
return 0;
}