2 // Copyright (C) 2007, 2008, 2009, 2010, 2011 Free Software Foundation, Inc.
4 // This program is free software; you can redistribute it and/or modify
5 // it under the terms of the GNU General Public License as published by
6 // the Free Software Foundation; either version 3 of the License, or
7 // (at your option) any later version.
9 // This program is distributed in the hope that it will be useful,
10 // but WITHOUT ANY WARRANTY; without even the implied warranty of
11 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 // GNU General Public License for more details.
14 // You should have received a copy of the GNU General Public License
15 // along with this program; if not, write to the Free Software
16 // Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
19 #include "gnashconfig.h"
22 #include "DisplayList.h"
23 #include "movie_root.h"
25 #include "DisplayObject.h"
28 #include "DummyMovieDefinition.h"
29 #include "DummyCharacter.h"
30 #include "movie_definition.h"
31 #include "ManualClock.h"
32 #include "RunResources.h"
33 #include "StreamProvider.h"
43 using namespace gnash
;
46 main(int /*argc*/, char** /*argv*/)
48 gnash::LogFile
& dbglogfile
= gnash::LogFile::getDefaultInstance();
49 dbglogfile
.setVerbosity();
51 // Initialize gnash lib
56 boost::shared_ptr
<StreamProvider
>(new StreamProvider(url
, url
)));
59 boost::intrusive_ptr
<movie_definition
> md5(new DummyMovieDefinition(ri
, 5));
60 boost::intrusive_ptr
<movie_definition
> md6(new DummyMovieDefinition(ri
, 6));
63 movie_root
stage(*md5
, clock
, ri
);
65 MovieClip::MovieVariables v
;
66 stage
.init(md5
.get(), v
);
70 check_equals(dlist1
, dlist1
);
72 DisplayList dlist2
= dlist1
;
74 check_equals(dlist1
, dlist2
);
76 MovieClip
* root
= const_cast<Movie
*>(&stage
.getRootMovie());
78 // just a couple of DisplayObjects
79 as_object
* ob1
= createObject(getGlobal(*getObject(root
)));
80 as_object
* ob2
= createObject(getGlobal(*getObject(root
)));
82 DisplayObject
* ch1 ( new DummyCharacter(ob1
, root
) );
83 DisplayObject
* ch2 ( new DummyCharacter(ob2
, root
) );
85 dlist1
.placeDisplayObject(ch1
, 1);
86 dlist1
.placeDisplayObject(ch2
, 2);
88 check(dlist1
!= dlist2
);
90 dlist2
.placeDisplayObject(ch2
, 1);
91 dlist2
.placeDisplayObject(ch1
, 2);