本文整理汇总了C++中Navigator类的典型用法代码示例。如果您正苦于以下问题:C++ Navigator类的具体用法?C++ Navigator怎么用?C++ Navigator使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了Navigator类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: qDebug
void EventLog::show() {
qDebug() << "EventLog: show()";
qDebug() << "finding NavigationPane object from cache";
Navigator* nav = Navigator::getInstance();
NavigationPane* navpane = nav->getNavigationPane();
// refresh _root
_root = _qml->createRootNode<AbstractPane>();
navpane->push(_root);
//find and reconnect all the controls again, because we had to refresh the root pointer
findAndConnectControls();
}
示例2: vibrate
bool NavigatorVibration::vibrate(Navigator& navigator, const VibrationPattern& pattern)
{
if (!navigator.frame())
return false;
Page* page = navigator.frame()->page();
if (!page)
return false;
if (page->visibilityState() != PageVisibilityStateVisible)
return false;
return NavigatorVibration::from(*page).vibrate(pattern);
}
示例3: URL
void NavigatorContentUtils::unregisterProtocolHandler(Navigator& navigator, const String& scheme, const String& url, ExceptionCode& ec)
{
if (!navigator.frame())
return;
URL baseURL = navigator.frame()->document()->baseURL();
if (!verifyCustomHandlerURL(baseURL, url, ec))
return;
if (!verifyProtocolHandlerScheme(scheme, ec))
return;
NavigatorContentUtils::from(navigator.frame()->page())->client()->unregisterProtocolHandler(scheme, baseURL, URL(ParsedURLString, url));
}
示例4: URL
ExceptionOr<void> NavigatorContentUtils::registerProtocolHandler(Navigator& navigator, const String& scheme, const String& url, const String& title)
{
if (!navigator.frame())
return { };
URL baseURL = navigator.frame()->document()->baseURL();
if (!verifyCustomHandlerURL(baseURL, url))
return Exception { SyntaxError };
if (!verifyProtocolHandlerScheme(scheme))
return Exception { SecurityError };
NavigatorContentUtils::from(navigator.frame()->page())->client()->registerProtocolHandler(scheme, baseURL, URL({ }, url), navigator.frame()->displayStringModifiedByEncoding(title));
return { };
}
示例5: declined
String NavigatorContentUtils::isProtocolHandlerRegistered(Navigator& navigator, const String& scheme, const String& url, ExceptionCode& ec)
{
static NeverDestroyed<String> declined(ASCIILiteral("declined"));
if (!navigator.frame())
return declined;
URL baseURL = navigator.frame()->document()->baseURL();
if (!verifyCustomHandlerURL(baseURL, url, ec))
return declined;
if (!verifyProtocolHandlerScheme(scheme, ec))
return declined;
return customHandlersStateString(NavigatorContentUtils::from(navigator.frame()->page())->client()->isProtocolHandlerRegistered(scheme, baseURL, URL(ParsedURLString, url)));
}
示例6: declined
ExceptionOr<String> NavigatorContentUtils::isProtocolHandlerRegistered(Navigator& navigator, const String& scheme, const String& url)
{
static NeverDestroyed<String> declined(MAKE_STATIC_STRING_IMPL("declined"));
if (!navigator.frame())
return String { declined };
URL baseURL = navigator.frame()->document()->baseURL();
if (!verifyCustomHandlerURL(baseURL, url))
return Exception { SyntaxError };
if (!verifyProtocolHandlerScheme(scheme))
return Exception { SecurityError };
return customHandlersStateString(NavigatorContentUtils::from(navigator.frame()->page())->client()->isProtocolHandlerRegistered(scheme, baseURL, URL({ }, url)));
}
示例7: getMediaDevices
void NavigatorMediaStream::getMediaDevices(Navigator& navigator, PassOwnPtr<MediaDeviceInfoCallback> callback, ExceptionState& exceptionState)
{
UserMediaController* userMedia = UserMediaController::from(navigator.frame());
if (!userMedia) {
exceptionState.throwDOMException(NotSupportedError, "No media device controller available; is this a detached window?");
return;
}
MediaDevicesRequest* request = MediaDevicesRequest::create(navigator.frame()->document(), userMedia, callback, exceptionState);
if (!request) {
if (!exceptionState.hadException())
exceptionState.throwDOMException(NotSupportedError, "Failed to request media devices.");
return;
}
request->start();
}
示例8: webkitGetUserMedia
void NavigatorMediaStream::webkitGetUserMedia(Navigator& navigator, const MediaStreamConstraints& options, NavigatorUserMediaSuccessCallback* successCallback, NavigatorUserMediaErrorCallback* errorCallback, ExceptionState& exceptionState)
{
if (!successCallback)
return;
UserMediaController* userMedia = UserMediaController::from(navigator.frame());
if (!userMedia) {
exceptionState.throwDOMException(NotSupportedError, "No user media controller available; is this a detached window?");
return;
}
String errorMessage;
if (navigator.frame()->document()->isPrivilegedContext(errorMessage)) {
UseCounter::count(navigator.frame(), UseCounter::GetUserMediaSecureOrigin);
} else {
UseCounter::countDeprecation(navigator.frame(), UseCounter::GetUserMediaInsecureOrigin);
OriginsUsingFeatures::countAnyWorld(*navigator.frame()->document(), OriginsUsingFeatures::Feature::GetUserMediaInsecureOrigin);
if (navigator.frame()->settings()->strictPowerfulFeatureRestrictions()) {
exceptionState.throwSecurityError(ExceptionMessages::failedToExecute("webkitGetUserMedia", "Navigator", errorMessage));
return;
}
}
UserMediaRequest* request = UserMediaRequest::create(navigator.frame()->document(), userMedia, options, successCallback, errorCallback, exceptionState);
if (!request) {
ASSERT(exceptionState.hadException());
return;
}
request->start();
}
示例9: ToRotated
m2::AnyRectD ToRotated(m2::RectD const & rect, Navigator const & navigator)
{
double const dx = rect.SizeX();
double const dy = rect.SizeY();
return m2::AnyRectD(rect.Center(),
navigator.Screen().GetAngle(),
m2::RectD(-dx/2, -dy/2, dx/2, dy/2));
}
示例10: vibrate
bool NavigatorVibration::vibrate(Navigator& navigator, const VibrationPattern& pattern)
{
if (!navigator.frame())
return false;
UseCounter::count(navigator.frame(), UseCounter::NavigatorVibrate);
if (!navigator.frame()->isMainFrame())
UseCounter::count(navigator.frame(), UseCounter::NavigatorVibrateSubFrame);
Page* page = navigator.frame()->page();
if (!page)
return false;
if (!page->isPageVisible())
return false;
return NavigatorVibration::from(*page).vibrate(pattern);
}
示例11: webkitGetUserMedia
void NavigatorMediaStream::webkitGetUserMedia(Navigator& navigator, const Dictionary& options, PassOwnPtr<NavigatorUserMediaSuccessCallback> successCallback, PassOwnPtr<NavigatorUserMediaErrorCallback> errorCallback, ExceptionState& exceptionState)
{
if (!successCallback)
return;
UserMediaController* userMedia = UserMediaController::from(navigator.frame());
if (!userMedia) {
exceptionState.throwDOMException(NotSupportedError, "No user media controller available; is this a detached window?");
return;
}
UserMediaRequest* request = UserMediaRequest::create(navigator.frame()->document(), userMedia, options, successCallback, errorCallback, exceptionState);
if (!request) {
ASSERT(exceptionState.hadException());
return;
}
request->start();
}
示例12: run
void Menu::run()
{
Navigator<ContinuousRobotDriver> navigator;
Orientation* orientation = Orientation::getInstance();
gUserInterface.waitForHand();
startMelody();
enc_left_front_write(0);
enc_right_front_write(0);
enc_left_back_write(0);
enc_right_back_write(0);
orientation->resetHeading();
navigator.findBox(PersistantStorage::getTargetXLocation(),
PersistantStorage::getTargetYLocation());
searchFinishMelody();
navigator.findBox(0, 0);
stopMelody();
}
示例13: mouse
void
mouse(int button, int state, int x, int y)
{
if ( state == 0 )
{
switch ( button )
{
case GLUT_LEFT_BUTTON: trackball.buttonPress(Navigator::LEFT_MOUSE,x,y);
break;
case GLUT_MIDDLE_BUTTON:trackball.buttonPress(Navigator::MIDDLE_MOUSE,x,y);
break;
case GLUT_RIGHT_BUTTON: trackball.buttonPress(Navigator::RIGHT_MOUSE,x,y);
break;
}
mouseb |= 1 << button;
buttonPressed=true;
}
else if ( state == 1 )
{
switch ( button )
{
case GLUT_LEFT_BUTTON: trackball.buttonRelease(Navigator::LEFT_MOUSE,x,y);
break;
case GLUT_MIDDLE_BUTTON:trackball.buttonRelease(Navigator::MIDDLE_MOUSE,x,y);
break;
case GLUT_RIGHT_BUTTON: trackball.buttonRelease(Navigator::RIGHT_MOUSE,x,y);
break;
}
mouseb &= ~(1 << button);
buttonPressed=false;
}
lastx = x;
lasty = y;
}
示例14: main
int main(int argc, char **argv)
{
osgInit(argc,argv);
int winid = setupGLUT(&argc, argv);
GLUTWindowPtr gwin= GLUTWindow::create();
gwin->setId(winid);
gwin->init();
scene =createScenegraph();
mgr = new SimpleSceneManager;
mgr->setWindow(gwin );
mgr->setRoot (scene);
mgr->showAll();
Navigator * nav = mgr->getNavigator();
nav->setFrom(nav->getFrom()+Vec3f(0,50,0));
glutMainLoop();
return 0;
}
示例15: configure
virtual bool configure(yarp::os::ResourceFinder &rf)
{
yarp::os::Time::turboBoost();
mNavThread=new Navigator(&rf);
if (!mNavThread->start())
{
delete mNavThread;
return false;
}
std::string local=rf.check("local",yarp::os::Value("/ikartnav")).asString().c_str();
mHandlerPort.open(local.c_str());
attach(mHandlerPort);
//attachTerminal();
return true;
}