void BrowserExtensionSymbian::createNewWindow(
    const ResourceRequest& request,
    const WindowArgs& winArgs,
    Frame*& part)
    {
    createNewWindow(request, winArgs, &part);
    }
Exemplo n.º 2
0
static Frame* createWindowHelper(LocalFrame& openerFrame, LocalFrame& activeFrame, LocalFrame& lookupFrame, const FrameLoadRequest& request, const WindowFeatures& features, NavigationPolicy policy, bool& created)
{
    ASSERT(!features.dialog || request.frameName().isEmpty());
    ASSERT(request.resourceRequest().requestorOrigin() || openerFrame.document()->url().isEmpty());
    ASSERT(request.resourceRequest().frameType() == WebURLRequest::FrameTypeAuxiliary);

    created = false;

    Frame* window = reuseExistingWindow(activeFrame, lookupFrame, request.frameName(), policy);

    if (!window) {
        // Sandboxed frames cannot open new auxiliary browsing contexts.
        if (openerFrame.document()->isSandboxed(SandboxPopups)) {
            // FIXME: This message should be moved off the console once a solution to https://bugs.webkit.org/show_bug.cgi?id=103274 exists.
            openerFrame.document()->addConsoleMessage(ConsoleMessage::create(SecurityMessageSource, ErrorMessageLevel, "Blocked opening '" + request.resourceRequest().url().elidedString() + "' in a new window because the request was made in a sandboxed frame whose 'allow-popups' permission is not set."));
            return nullptr;
        }

        if (openerFrame.settings() && !openerFrame.settings()->supportsMultipleWindows())
            window = openerFrame.tree().top();
    }

    if (window) {
        if (request.getShouldSetOpener() == MaybeSetOpener)
            window->client()->setOpener(&openerFrame);
        return window;
    }

    return createNewWindow(openerFrame, request, features, policy, created);
}
Exemplo n.º 3
0
void ProfilerMaster::createNewWindow()
{
  ProfilerWindow* win = new ProfilerWindow(&db_);

  QObject::connect(win, SIGNAL(createNewWindow()),
                   this, SLOT(createNewWindow()));
  QObject::connect(&ros_source_, SIGNAL(connected(bool, QString)),
                   win, SLOT(rosConnected(bool, QString)));

  // We only see signals on change, so we need to manually initialize
  // the window properly if we're already connected.
  if (ros_source_.isConnected()) {
    win->rosConnected(true, ros_source_.masterUri());
  }
  
  win->show();
}
void KonqSidebarTree::slotOpenTab()
{
    if (!m_currentTopLevelItem) return;
    KParts::BrowserArguments browserArgs;
    browserArgs.setNewTab(true);
    emit createNewWindow(m_currentTopLevelItem->externalURL(),
                         KParts::OpenUrlArguments(),
                         browserArgs);
}
Exemplo n.º 5
0
void ConsoleView::initView() {
	initscr();
	raw();
	keypad(stdscr, TRUE);
	start_color();
	init_pair(1, COLOR_WHITE, COLOR_BLACK);
	getmaxyx(stdscr, m_height, m_width);
	attron(A_BOLD);
	printw("Welcome");
	mvchgat(0, 0, -1, A_BLINK, 1, NULL);
	attroff(A_BOLD);
	refresh();
	m_UARTState = createNewWindow(4, m_width, 0, 0);
	m_RtFinderView = createNewWindow(m_height - 10, (m_width >> 1) - 1, 5, 0);
	m_ObjFinderView = createNewWindow(m_height - 10, (m_width >> 1) - 1, 5,
			(m_width >> 1) + 1);
	m_ControllerView = createNewWindow(4, m_width, m_height - 5, 0);
	refresh();
}
Exemplo n.º 6
0
	void DemoKeeper::createScene()
	{
		//MyGUI::ResourceManager::getInstance().load("WindowSkin.xml");

		MyGUI::FactoryManager::getInstance().registerFactory<WobbleNodeAnimator>("NodeAnimator");
		MyGUI::FactoryManager::getInstance().registerFactory<FadeNodeAnimator>("NodeAnimator");

		MyGUI::FactoryManager::getInstance().registerFactory<MyGUI::RTTLayer>("Layer");

		MyGUI::ResourceManager::getInstance().load("Layers.xml");

		createNewWindow();
	}
Exemplo n.º 7
0
void ConsoleMaster::createNewWindow()
{
  ConsoleWindow* win = new ConsoleWindow(&db_);
  windows_.append(win);

  QSettings settings;
  window_font_ = settings.value(SettingsKeys::FONT, QFont("Ubuntu Mono", 9)).value<QFont>();
  win->setFont(window_font_);
  QObject::connect(win, SIGNAL(createNewWindow()),
                   this, SLOT(createNewWindow()));

  QObject::connect(&ros_thread_, SIGNAL(connected(bool)),
                   win, SLOT(connected(bool)));

  QObject::connect(this,
                   SIGNAL(fontChanged(const QFont &)),
                   win, SLOT(setFont(const QFont &)));

  QObject::connect(win, SIGNAL(selectFont()),
                   this, SLOT(selectFont()));

  QObject::connect(win, SIGNAL(readBagFile()),
                   &bag_reader_, SLOT(promptForBagFile()));


  if (!ros_thread_.isRunning())
  {
    // There's only one ROS thread, and it services every window.  We need to initialize
    // it and its connections to the LogDatabase when we first create a window, but
    // after that it doesn't need to be modified again.
    QObject::connect(&ros_thread_, SIGNAL(logReceived(const rosgraph_msgs::LogConstPtr& )),
                     &db_, SLOT(queueMessage(const rosgraph_msgs::LogConstPtr&) ));

    QObject::connect(&ros_thread_, SIGNAL(spun()),
                     &db_, SLOT(processQueue()));

    ros_thread_.start();
  }
Exemplo n.º 8
0
	void DemoKeeper::createScene()
	{
		base::BaseDemoManager::createScene();
		//MyGUI::ResourceManager::getInstance().load("WindowSkin.xml");

		MyGUI::FactoryManager::getInstance().registerFactory<WobbleNodeAnimator>("NodeAnimator");
		MyGUI::FactoryManager::getInstance().registerFactory<FadeNodeAnimator>("NodeAnimator");

		std::string layerCategory = MyGUI::LayerManager::getInstance().getCategoryName();
		MyGUI::FactoryManager::getInstance().registerFactory<MyGUI::RTTLayer>(layerCategory);

		MyGUI::ResourceManager::getInstance().load("Layers.xml");

		createNewWindow();
	}
Exemplo n.º 9
0
	void DemoKeeper::injectKeyPress(MyGUI::KeyCode _key, MyGUI::Char _text)
	{
		if (_key == MyGUI::KeyCode::W)
		{
			createNewWindow();
		}
		else if (_key == MyGUI::KeyCode::V)
		{
			for (SetWidget::iterator item=mWidgets.begin(); item!=mWidgets.end(); ++item)
			{
				const MyGUI::IntCoord coord(0, 0, 1024, 768);
				const MyGUI::IntSize size(300, 300);

				if ((*item)->getCoord().width != coord.width)
				{
					(*item)->setCoord(coord);
				}
				else
				{
					(*item)->setCoord(coord.width / 2 - size.width / 2, coord.height / 2 - size.height / 2, size.width, size.height);
				}
			}
		}
		else if (_key == MyGUI::KeyCode::Four)
		{
			MyGUI::LayerManager::EnumeratorLayer layer = MyGUI::LayerManager::getInstance().getEnumerator();
			while (layer.next())
			{
				if (layer->getName() == "RTT_Test")
				{
					//layer->castType<MyGUI::RTTLayer>()->setLayerNodeAnimation(&gCustomLayerNodeAnimation);
				}
			}
		}
		else if (_key == MyGUI::KeyCode::Space)
		{
			MyGUI::LayerManager::EnumeratorLayer layer = MyGUI::LayerManager::getInstance().getEnumerator();
			while (layer.next())
			{
				if (layer->getName() == "RTT_Test")
				{
					MyGUI::EnumeratorILayerNode node = layer->getEnumerator();
					while (node.next())
					{
						MyGUI::RTTLayerNode* rttnode = node->castType<MyGUI::RTTLayerNode>(false);
						if (rttnode != nullptr)
						{
							bool rtt = !rttnode->getCacheUsing();
							rttnode->setCacheUsing(rtt);

							//MyGUI::Widget* widget = rttnode->castType<MyGUI::Widget>(false);
							//if (widget != nullptr)
							//	widget->setCaption(rtt ? "RTT mode" : "Vertex mode");


							/*for (SetWidget::iterator item=mWidgets.begin(); item!=mWidgets.end(); ++item)
							{
								(*item)->setCaption(mIsRTT ? "RTT mode" : "Vertex mode");
							}*/
						}
					}
				}
			}
		}

		return BaseManager::injectKeyPress( _key, _text );
	}
Exemplo n.º 10
0
void KonqSideBarWebModule::urlNewWindow(const QString& url, const KParts::OpenUrlArguments& args, const KParts::BrowserArguments& browserArgs, const KParts::WindowArgs& windowArgs)
{
    emit createNewWindow(KUrl(url), args, browserArgs, windowArgs);
}
Exemplo n.º 11
0
    //-------------------------------------------------------------------------------------------------//
    void OSXCarbonWindow::create( const String& name, unsigned int width, unsigned int height,
                    bool fullScreen, const NameValuePairList *miscParams )
    {
        bool hasDepthBuffer = false;
        String title = name;
        size_t fsaa_samples = 0;
        int left = 0;
        int top = 0;
        bool vsync = false;
        bool hidden = false;
        int depth = 32;

        if( miscParams )
        {
            NameValuePairList::const_iterator opt(NULL);
            NameValuePairList::const_iterator end = miscParams->end();

            // Full screen anti aliasing
            if((opt = miscParams->find("FSAA")) != end) 
                fsaa_samples = StringConverter::parseUnsignedInt( opt->second );

            if((opt = miscParams->find("left")) != end) 
                left = StringConverter::parseUnsignedInt( opt->second );

            if((opt = miscParams->find("top")) != end) 
                top = StringConverter::parseUnsignedInt( opt->second );

            if((opt = miscParams->find("title")) != end) 
                title = opt->second;

            if((opt = miscParams->find("vsync")) != end) 
                vsync = StringConverter::parseBool(opt->second);

            if((opt = miscParams->find("hidden")) != end) 
                hidden = StringConverter::parseBool(opt->second);

            if((opt = miscParams->find("gamma")) != end) 
				mHwGamma = StringConverter::parseBool(opt->second);

            if((opt = miscParams->find("depthBuffer")) != end) 
                hasDepthBuffer = StringConverter::parseBool( opt->second );
            
            if((opt = miscParams->find("colourDepth")) != end) 
                depth = StringConverter::parseUnsignedInt( opt->second );

            if((opt = miscParams->find("Full Screen")) != end) 
                fullScreen = StringConverter::parseBool( opt->second );
        }

        if(fullScreen)
        {
            setFullscreen(fullScreen, width, height);
        }
        else
        {
            createAGLContext(fsaa_samples, depth);

            NameValuePairList::const_iterator opt(NULL);
            if(miscParams)
                opt = miscParams->find("externalWindowHandle");

            if(!miscParams || opt == miscParams->end())
                createNewWindow(width, height, title.c_str());
            else
                createWindowFromExternal((HIViewRef)StringConverter::parseUnsignedLong(opt->second));

            // Set the drawable, and current context
            // If you do this last, there is a moment before the rendering window pops-up
            // This could go once inside each case above, before the window is displayed,
            // if desired.
    #if defined(MAC_OS_X_VERSION_10_4) && MAC_OS_X_VERSION_MAX_ALLOWED <= MAC_OS_X_VERSION_10_4
            aglSetDrawable(mAGLContext, GetWindowPort(mWindow));
    #else
            aglSetWindowRef(mAGLContext, mWindow);
    #endif
            aglSetCurrentContext(mAGLContext);

            // Give a copy of our context to the render system
            if(!mCarbonContext)
            {
                mCarbonContext = OGRE_NEW OSXCarbonContext(mAGLContext, mAGLPixelFormat);
                mContext = mCarbonContext;
            }
        }

        // Apply vsync settings. call setVSyncInterval first to avoid 
		// setting vsync more than once.
        setVSyncEnabled(vsync);
        setHidden(hidden);

        mName = name;
        mWidth = width;
        mHeight = height;
        mColourDepth = depth;
        mFSAA = fsaa_samples;
        mIsFullScreen = fullScreen;
        mActive = true;
        mClosed = false;
        mCreated = true;
    }
Exemplo n.º 12
0
    void OSXCarbonWindow::setFullscreen(bool fullScreen, unsigned int width, unsigned int height)
    {
        if (mIsFullScreen != fullScreen || width != mWidth || height != mHeight)
        {
            // Set the full screen flag
            mIsFullScreen = fullScreen;

            createAGLContext(mFSAA, mColourDepth);

            if (mIsFullScreen)
            {
                GLRenderSystem *rs = static_cast<GLRenderSystem*>(Root::getSingleton().getRenderSystem());

                CGLContextObj share = NULL;
                aglGetCGLContext(mAGLContext, (void**)&share);

                // Create the CGL context object if it doesn't already exist, sharing the AGL context.
                if(!mCGLContext)
                {
                    void *cglPixFormat;
                    aglGetCGLPixelFormat(mAGLPixelFormat, (void **)&cglPixFormat);
                    mCGLContext = OGRE_NEW OSXCGLContext(mCGLContextObj, (CGLPixelFormatObj) cglPixFormat);
                }

                // Create the context, keeping the current colour depth and FSAA settings
                createCGLFullscreen(width, height, getColourDepth(), getFSAA(), share);
                rs->_switchContext(mContext);

                // Hide the Carbon window
                HideWindow(mWindow);

                // And tell the rendersystem to stop rendering to it too
                WindowEventUtilities::_removeRenderWindow(this);
            }
            else
            {
                // Create a new AGL context and pixel format if necessary
                createAGLContext(mFSAA, mColourDepth);

                // Create a window if we haven't already, existence check is done within the functions
                if(!mWindow)
                {
                    if(mIsExternal)
                        createWindowFromExternal(mView);
                    else
                        createNewWindow(width, height, mWindowTitle);
                }

                // Destroy the current CGL context, we will create a new one when/if we go back to full screen
                destroyCGLFullscreen();

                // Set the drawable, and current context
                // If you do this last, there is a moment before the rendering window pops-up
                #if defined(MAC_OS_X_VERSION_10_4) && MAC_OS_X_VERSION_MAX_ALLOWED <= MAC_OS_X_VERSION_10_4
                    aglSetDrawable(mAGLContext, GetWindowPort(mWindow));
                #else
                    aglSetWindowRef(mAGLContext, mWindow);
                #endif
                aglSetCurrentContext(mAGLContext);

                if(!mCarbonContext)
                {
                    mCarbonContext = OGRE_NEW OSXCarbonContext(mAGLContext, mAGLPixelFormat);
                }
                
                GLRenderSystem *rs = static_cast<GLRenderSystem*>(Root::getSingleton().getRenderSystem());
                mContext = mCarbonContext;
                rs->_switchContext(mContext);

                WindowEventUtilities::_addRenderWindow(this);

                ShowWindow(mWindow);
                SelectWindow(mWindow);
                RepositionWindow(mWindow, NULL, kWindowCenterOnMainScreen);
            }
            mWidth = width;
            mHeight = height;
        }
    }
Exemplo n.º 13
0
void KonqSideBarWebModule::urlNewWindow(const TQString& url, KParts::URLArgs args)
{
	emit createNewWindow(KURL(url), args);
}
Exemplo n.º 14
0
void Manitou::onOpenWindow()
{
    BrowserWindow *window = createNewWindow();
    window->show();
}
void BrowserExtensionSymbian::createNewWindow(const ResourceRequest& request)
    {
    createNewWindow(request, WindowArgs(), NULL);
    }
Exemplo n.º 16
0
Arquivo: main.c Projeto: macrat/rusk
gboolean onKeyPress(GtkWidget *widget, GdkEventKey *key, RuskWindow *rusk)
{
	gboolean proceed = TRUE;

	char *script = g_strdup_printf(
			"onKeyPress({ctrlKey: %d, shiftKey: %d, superKey: %d, hyperKey: %d, metaKey: %d, string: '%s'})",
			(key->state & GDK_CONTROL_MASK)?1:0,
			(key->state & GDK_SHIFT_MASK)?1:0,
			(key->state & GDK_SUPER_MASK)?1:0,
			(key->state & GDK_HYPER_MASK)?1:0,
			(key->state & GDK_META_MASK)?1:0,
			gdk_keyval_name(key->keyval));
	webkit_web_view_run_javascript(rusk->webview, script, NULL, NULL, NULL);
	g_free(script);

	if(key->state & GDK_CONTROL_MASK)
	{
		switch(gdk_keyval_to_upper(key->keyval))
		{
			case GDK_KEY_S:
				inSiteSearchToggle(rusk);
				break;
			case GDK_KEY_N:
				if(key->state & GDK_SHIFT_MASK)
				{
					openURI(createNewWindow(rusk), HOMEPAGE);
				}else
				{
					inSiteSearchNext(rusk);
				}
				break;
			case GDK_KEY_P:
				if(key->state & GDK_SHIFT_MASK)
				{
					togglePrivateBrowsing(rusk);
				}else
				{
					inSiteSearchPrev(rusk);
				}
				break;

			case GDK_KEY_U:
				addressbarToggle(rusk);
				break;

			case GDK_KEY_G:
				globalSearchToggle(rusk, "google");
				break;
			case GDK_KEY_M:
				globalSearchToggle(rusk, "maps");
				break;
			case GDK_KEY_I:
				if(key->state & GDK_SHIFT_MASK)
				{
					toggleInspector(rusk);
				}else
				{
					globalSearchToggle(rusk, "images");
				}
				break;

			default:
				proceed = FALSE;
		}
	}else
	{
		proceed = FALSE;
	}

	return proceed;
}
Exemplo n.º 17
0
void KonqSidebarTree::slotOpenNewWindow()
{
    if (!m_currentTopLevelItem) return;
    emit createNewWindow( m_currentTopLevelItem->externalURL() );
}