Exemplo n.º 1
0
// >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
bool
FrameWindow::doesHierarchyContain(Window* aWindow) const
{
    bool ret = false;
    if(clientWindow() != 0)
        ret = clientWindow()->doesHierarchyContain(aWindow);
    return (ret || Window::doesHierarchyContain(aWindow));
}
Exemplo n.º 2
0
// >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
FrameWindow&
FrameWindow::clientWindowChanged()
{
    if(clientWindow() != 0)
        clientWindow()->setWindowRectangle(clientRectangle());

    return *this;
}
Exemplo n.º 3
0
// >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
Window*
FrameWindow::windowBelow(const Core::Vector2& p)
{
    Window* ret = Window::windowBelow(p);
    if(ret == (Window*)(this) && clientWindow())
    {
        Window* cw = clientWindow()->windowBelow(p);
        if(cw != 0) ret = cw;
    }
    return ret;
}
Exemplo n.º 4
0
// >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
bool
FrameWindow::process(const Message& message)
{
    bool ret = false;
    if(isVisible() && isEnabled())
    {
        if(clientWindow() != 0)
            ret = clientWindow()->process(message);
        if(!ret) ret = Window::process(message);
    }

    return ret;
}
Exemplo n.º 5
0
// >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
Window&
FrameWindow::draw()
{
    FrameWindowDesc* renderDesc = renderDesc_;
    if(renderDesc == 0)
        renderDesc = &WindowManager::instance().propertyScheme().frameWindowDesc_;

    renderDesc->setFrameWindow(this);

    const Core::Vector2 topLeft = position();
    const Core::Vector2 bottomRight = position() + size();

    renderDesc->draw(Core::Rectangle(topLeft, bottomRight));

    if(clientWindow() != 0)
    {
        Renderer::enableClipRectangle(clientRectangle());
        clientWindow()->render();
        Renderer::disableClipRectangle();
    }


    return *this;
}
Exemplo n.º 6
0
rfbBool ConnectionWindow::rfbResize(rfbClient *client)
{
    ConnectionWindow *connectionWindow = clientWindow(client);
    if ( connectionWindow ) {
        uint8_t *oldFB = client->frameBuffer;
        client->frameBuffer = (uint8_t *)malloc(client->width * client->height * QVNCVIEWER_BYTES_PER_PIXEL);
        free(oldFB);
        switch ( connectionWindow->surfaceType() ) {
        case QVNCVIEWER_SURFACE_RASTER:
        default:
            connectionWindow->surfaceWidget()->setSurfaceSize(QSize(client->width, client->height));
            break;
        }
        return true;
    } else
        return false;
}
Exemplo n.º 7
0
void ConnectionWindow::rfbUpdate(rfbClient *client, int x, int y, int w, int h)
{
    QImage image = QImage(w, h, QImage::Format_ARGB32);
    for (int xx = x; xx < x + w; xx++) {
        for (int yy = y; yy < y + h; yy++) {
            qint32 pos = (yy * client->width * QVNCVIEWER_BYTES_PER_PIXEL) + (xx * QVNCVIEWER_BYTES_PER_PIXEL);
            image.setPixel(xx - x, yy - y, qRgb((quint8)client->frameBuffer[pos + 0], (quint8)client->frameBuffer[pos + 1], (quint8)client->frameBuffer[pos + 2]));
        }
    }
    m_updatePixmaps[client] << QPixmap::fromImage(image);
    m_updateRects[client] << QRect(x, y, w, h);
    ConnectionWindow *connectionWindow = clientWindow(client);
    if ( connectionWindow ) {
        switch ( connectionWindow->surfaceType() ) {
        case QVNCVIEWER_SURFACE_RASTER:
        default:
            connectionWindow->surfaceWidget()->update();
            break;
        }
    }
}
Exemplo n.º 8
0
// >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
void
FrameWindow::onMove()
{
    if(clientWindow() != 0)
        clientWindow()->setWindowRectangle(clientRectangle());
}