Ejemplo n.º 1
0
/// Update the specified region of the widget.
/// \param widget The target Qt widget.
/// \param rect The region inside the widget.
/// \param waveform The waveform used to update screen. If it's INVALID, the default
/// waveform is applied.
/// \param update_whole Update whole screen or not.
/// \param wait The synchronous way between ScreenProxy and server.
void ScreenProxy::updateWidgetRegion(const QWidget *widget,
                                     const QRect &rect,
                                     Waveform waveform,
                                     bool update_whole,
                                     ScreenCommand::WaitMode wait)
{
    if (!isUpdateEnabled() && waveform != onyx::screen::ScreenProxy::DW)
    {
        return;
    }

    QRect & rc = screenRegion(widget, &rect);
    if (waveform == INVALID)
    {
        waveform = waveform_;
    }

    // Construct command.
    command_.type = ScreenCommand::SYNC_AND_UPDATE;
    command_.top = rc.top();
    command_.left = rc.left();
    command_.width = rc.width();
    command_.height = rc.height();
    command_.waveform = waveform;
    if (update_whole)
    {
        command_.update_flags = ScreenCommand::FULL_UPDATE;
    }
    else
    {
        command_.update_flags = ScreenCommand::PARTIAL_UPDATE;
    }
    sendCommand(command_, wait);
}
Ejemplo n.º 2
0
void UIWidget::updateChildrenUILayer(UILayer* uiLayer)
{
    setUILayer(uiLayer);
    setUpdateEnabled(isUpdateEnabled());
    int childrenCount = m_children->data->num;
    ccArray* arrayChildren = m_children->data;
    for (int i=0; i<childrenCount; i++)
    {
        UIWidget* child = (UIWidget*)(arrayChildren->arr[i]);
        child->updateChildrenUILayer(m_pUILayer);
    }
}