示例#1
0
void BaseRender::resizeGL(int w, int h)
{
    d->width = w;
    d->height = h;
    resetViewport(w, h);
    resetOverlay(w, h);
}
示例#2
0
void MVScrollBar::update()
/****************************************************************************
*
* Function:		MVScrollBar::update
*
* Description:	Updates the state of the scroll bar thumb, if the scroll
*				bar is visible.
*
****************************************************************************/
{
	if ((flags & sbInteracting) || !(flags & sbDirty))
		return;

	if ((state & sfVisible) && (state & sfExposed)) {
		setupOwnerViewport();
		MS_obscure();
		if (flags & sbDirtyLeft)
			drawLeftArrow(false);
		if (flags & sbDirtyRight)
			drawRightArrow(false);
		if (flags & sbDirtyThumb)
			drawThumb(-1);
		MS_show();
		resetViewport();
		}
}
示例#3
0
Response InspectorEmulationAgent::disable() {
  setScriptExecutionDisabled(false);
  setTouchEmulationEnabled(false, Maybe<String>());
  setEmulatedMedia(String());
  setCPUThrottlingRate(1);
  resetViewport();
  return Response::OK();
}
示例#4
0
void MVListBase::vScrollTo(int j,ibool redraw)
/****************************************************************************
*
* Function:     MVListBase::vScrollTo
* Parameters:   j       - New cell to scroll to in vertical direction
*               redraw  - True if list should be redrawn
*
* Description:  Scrolls the list to start at the new cell 'j' in the
*               vertical direction, redrawing all necessary cells to do
*               this.
*
]****************************************************************************/
{
    if (visible.top() != j) {
        // Setup the viewport for redrawing the list directly, and redraw
        // it.
        MVRect   v(visible & range);
        MVRect  b(bounds.left()+leftIndent,
                  bounds.top()+topIndent,
                  bounds.left()+leftIndent+cellSize.x*(visible.right()-visible.left()),
                  bounds.top()+topIndent+cellSize.y*(visible.bottom()-visible.top()));
        int     dy = (v.top() - j) * cellSize.y;

        if (b.right() > (bounds.right()-rightIndent))
            b.right() = bounds.right()-rightIndent;
        if (b.bottom() > (bounds.bottom()-botIndent))
            b.bottom() = bounds.bottom()-botIndent;

        visible.moveTo(hScroll ? hScroll->getValue() : 0,j);
        vScroll->setValue(j);

        if (redraw) {
            CHECK(owner != NULL);
            setupOwnerViewport();
            MS_obscure();

            if (j < v.top()) {
                b.bottom() -= dy;
                if (!b.isEmpty())
                    dc.bitBlt(dc,b,b.left(),bounds.top()+topIndent+dy,MGL_REPLACE_MODE);
                for (int y = j; y < v.top(); y++)
                    for (int x = v.left(); x < v.right(); x++)
                        drawCell(x,y);
                }
            else {
                b.top() -= dy;
                if (!b.isEmpty())
                    dc.bitBlt(dc,b,b.left(),bounds.top()+topIndent,MGL_REPLACE_MODE);
                j -= v.top();
                for (int y = 0; y < j; y++)
                    for (int x = v.left(); x < v.right(); x++)
                        drawCell(x,v.bottom()+y);
                }
            MS_show();
            resetViewport();
            }
        }
}
示例#5
0
void MVListBase::hScrollTo(int i,ibool redraw)
/****************************************************************************
*
* Function:     MVListBase::hScrollTo
* Parameters:   i       - New cell to scroll to in horizontal direction
*               redraw  - True if list should be redrawn
*
* Description:  Scrolls the list to start at the new cell 'i' in the
*               horizontal direction, redrawing all necessary cells to do
*               this.
*
****************************************************************************/
{
    if (visible.left() != i) {
        // Setup the viewport for redrawing the list directly, and redraw
        // it.
        MVRect  v(visible & range);
        MVRect  b(bounds.left()+leftIndent,
                  bounds.top()+topIndent,
                  bounds.right()-rightIndent,
                  bounds.bottom()-botIndent);
        int     dx = (v.left() - i) * cellSize.x;

        visible.moveTo(i,vScroll ? vScroll->getValue() : 0);
        hScroll->setValue(i);

        if (redraw) {
            CHECK(owner != NULL);
            setupOwnerViewport();
            MS_obscure();

            if (i < v.left()) {
                b.right() -= dx;
                if (!b.isEmpty())
                    dc.bitBlt(dc,b,bounds.left()+leftIndent+dx,b.top(),MGL_REPLACE_MODE);
                for (int y = v.top(); y < v.bottom(); y++)
                    for (int x = i; x < v.left(); x++)
                        drawCell(x,y);
                }
            else {
                b.left() -= dx;
                if (!b.isEmpty())
                    dc.bitBlt(dc,b,bounds.left()+leftIndent,b.top(),MGL_REPLACE_MODE);
                i -= v.left();
                for (int y = v.top(); y < v.bottom(); y++)
                    for (int x = 0; x < i; x++)
                        drawCell(v.right() + x,y);
                }
            MS_show();
            resetViewport();
            }
        }
}
示例#6
0
void MVRenderArea::paint()
/****************************************************************************
*
* Function:     MVRenderArea::paint
*
* Description:  This function paints the view with the current clip
*               region. We set the viewport to the coordinate space for
*               the view and then call the render function clipping to
*               each of the clip rectangles in the clip region.
*
****************************************************************************/
{
    MS_obscure();
    setupViewport();
    clipAndRenderView = this;
    clipRgn.traverse(clipAndRender);
    resetViewport();
    MS_show();
}
StatusIndicatorMenuDropDownView::StatusIndicatorMenuDropDownView(StatusIndicatorMenu *controller) :
    MSceneWindowView(controller),
    controller(controller),
    settingsPluginsExtensionArea(NULL),
    statusIndicatorExtensionArea(NULL),
    pannableViewport(NULL),
    closeButtonOverlay(NULL),
    backgroundWidget(new MStylableWidget)
{
    // Create close button overlay
    closeButtonOverlay = createCloseButtonOverlay();

    // Create the pannable area background widget
    backgroundWidget->setStyleName("StatusIndicatorMenuWindowBackground");

    connect(controller, SIGNAL(hideRequested()), this, SLOT(resetViewport()));
    connect(controller, SIGNAL(displayEntered()), SLOT(ensureIsViewable()));

    // Schedule the view to be initialized
    QTimer::singleShot(VIEW_INITIALIZATION_DELAY, this, SLOT(ensureIsViewable()));
}
示例#8
0
void BaseRender::paintEvent(QPaintEvent * event)
{
    QPainter p;
    p.begin(this);
    p.setRenderHint(QPainter::Antialiasing);
    glPushAttrib(GL_ALL_ATTRIB_BITS);
    glMatrixMode(GL_PROJECTION);
    glPushMatrix();
    glMatrixMode(GL_MODELVIEW);
    glPushMatrix();
    qglClearColor(QColor::fromCmykF(0.70, 1.0, 1.0, 0.0));
    glShadeModel(GL_SMOOTH);
    glEnable(GL_DEPTH_TEST);
    glEnable(GL_CULL_FACE);
    glEnable(GL_LIGHTING);
    glEnable(GL_LIGHT0);
    glEnable(GL_MULTISAMPLE);
    static GLfloat lightPosition[4] = { 1.5, 5.0, 7.0, 1.0 };
    glLightfv(GL_LIGHT0, GL_POSITION, lightPosition);
    resetViewport(width(), height());
    glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
    glMatrixMode(GL_MODELVIEW);
    glLoadIdentity();
    //glTranslatef(0.0, 0.0, -3.0);
    //glTranslated(0.0, 0.0, -10.0);
    glColor3f(1.0, 1.0, 1.0);
    //TODO
    //GL DRAW COMMANDS
    glPopAttrib();
    glMatrixMode(GL_MODELVIEW);
    glPopMatrix();
    glMatrixMode(GL_PROJECTION);
    glPopMatrix();
    p.drawImage((width() - d->image.width()) / 2, 0, d->image);
    p.end();
}
示例#9
0
void Render_SW_SDL::setWindowSize(int w, int h)
{
    window_w=w;
    window_h=h;
    resetViewport();
}
示例#10
0
void Render_OpenGL31::setWindowSize(int w, int h)
{
    window_w = static_cast<float>(w);
    window_h = static_cast<float>(h);
    resetViewport();
}