本文整理汇总了C++中MovieClip::get_root方法的典型用法代码示例。如果您正苦于以下问题:C++ MovieClip::get_root方法的具体用法?C++ MovieClip::get_root怎么用?C++ MovieClip::get_root使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类MovieClip
的用法示例。
在下文中一共展示了MovieClip::get_root方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: baseURL
int
main(int /*argc*/, char** /*argv*/)
{
gnash::LogFile& dbglogfile = gnash::LogFile::getDefaultInstance();
dbglogfile.setVerbosity(1);
string filename = string(TGTDIR) + string("/") + string(INPUT_FILENAME);
tester.reset(new MovieTester(filename));
URL baseURL(filename);
gnash::RcInitFile& rc = gnash::RcInitFile::getDefaultInstance();
rc.addLocalSandboxPath(MEDIADIR);
root = tester->getRootMovie();
assert(root);
check_equals(root->get_frame_count(), 2);
check_equals(root->get_current_frame(), 0);
tester->advance();
check_equals(root->get_current_frame(), 1);
// Verify that 'coverart' exists and is empty
MovieClip* coverart = getCoverArt();
check(coverart);
std::string url = coverart->get_root()->url();
check_equals(coverart->get_root()->url(), baseURL.str());
// Check scribbling on the empty canvas
checkScribbling();
clickCycle(coverart); // MovieClip::loadMovie
clickCycle(coverart); // GETURL _level0.cont.coverart
clickCycle(coverart); // GETURL /cont/coverart
//clickCycle(coverart); // GETURL _level0.coverart
// Consistency checking
VM& vm = getVM(*getObject(root));
as_value eot;
// It's an swf6, so lowercase 'END_OF_TEST'
bool endOfTestFound = getObject(root)->get_member(getURI(vm, "end_of_test"), &eot);
check(endOfTestFound);
if ( endOfTestFound )
{
check_equals(eot.to_bool(8), true);
}
}
示例2: baseURL
int
main(int /*argc*/, char** /*argv*/)
{
gnash::LogFile& dbglogfile = gnash::LogFile::getDefaultInstance();
dbglogfile.setVerbosity(1);
string filename = string(TGTDIR) + string("/") + string(INPUT_FILENAME);
tester.reset(new MovieTester(filename));
URL baseURL(filename);
URL mediaURL(MEDIADIR"/");
URL lynchURL("lynch.swf", mediaURL);
URL greenURL("green.jpg", mediaURL);
URL offspringURL("offspring.swf", mediaURL);
std::string url;
gnash::RcInitFile& rc = gnash::RcInitFile::getDefaultInstance();
rc.addLocalSandboxPath(MEDIADIR);
root = tester->getRootMovie();
assert(root);
check_equals(root->get_frame_count(), 2);
check_equals(root->get_current_frame(), 0);
tester->advance();
check_equals(root->get_current_frame(), 1);
// Verify that 'coverart' exists and is empty
DisplayObject* coverartch = const_cast<DisplayObject*>(tester->findDisplayItemByName(*root, "coverart"));
MovieClip* coverart = coverartch->to_movie();
check(coverart);
url = coverart->get_root()->url();
check_equals(coverart->get_root()->url(), baseURL.str());
// Check scribbling on the empty canvas
checkScribbling();
// Click on the first (lynch)
tester->movePointerTo(80, 80);
check(tester->isMouseOverMouseEntity());
tester->pressMouseButton();
// Wait for the movie to load
// TODO: drop this test and use a self-containment instead
do {
usleep(500); // give it some time...
tester->advance(); // loads (should) happen on next advance
coverartch = const_cast<DisplayObject*>(tester->findDisplayItemByName(*root, "coverart"));
} while (coverartch->to_movie() == coverart);
coverart = coverartch->to_movie();
check_equals(coverart->get_root()->url(), lynchURL.str());
tester->depressMouseButton();
// Check scribbling on the lynch
checkScribbling();
// Run 'coverart' tests..
tester->movePointerTo(640,180);
tester->click(); tester->advance();
// Click on the second (green)
tester->movePointerTo(280, 80);
check(tester->isMouseOverMouseEntity());
tester->click();
// Wait for the movie to load
// TODO: drop this test and use a self-containment instead
do {
usleep(500); // give it some time...
tester->advance(); // loads (should) happen on next advance
coverartch = const_cast<DisplayObject*>(tester->findDisplayItemByName(*root, "coverart"));
} while (coverartch->to_movie() == coverart);
coverart = coverartch->to_movie();
check_equals(coverart->get_root()->url(), greenURL.str());
// TODO: find a way to test if the jpeg is really displayed
// (like turn it into a mouse-event-handling char and use isMouseOverActiveEntity ?)
// Check scribbling on the jpeg
checkScribbling();
// Run 'coverart' tests..
tester->movePointerTo(640,180);
tester->click(); tester->advance();
// Click on the third (offspring)
tester->movePointerTo(480, 80);
check(tester->isMouseOverMouseEntity());
tester->click();
// Wait for the movie to load
// TODO: drop this test and use a self-containment instead
do {
usleep(500); // give it some time...
tester->advance(); // loads (should) happen on next advance
//.........这里部分代码省略.........