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