void CGUIControlGroupList::Process(unsigned int currentTime, CDirtyRegionList &dirtyregions) { if (m_scroller.Update(currentTime)) MarkDirtyRegion(); // first we update visibility of all our items, to ensure our size and // alignment computations are correct. for (iControls it = m_children.begin(); it != m_children.end(); ++it) { CGUIControl *control = *it; GUIPROFILER_VISIBILITY_BEGIN(control); control->UpdateVisibility(); GUIPROFILER_VISIBILITY_END(control); } ValidateOffset(); if (m_pageControl && m_lastScrollerValue != m_scroller.GetValue()) { CGUIMessage message(GUI_MSG_LABEL_RESET, GetParentID(), m_pageControl, (int)Size(), (int)m_totalSize); SendWindowMessage(message); CGUIMessage message2(GUI_MSG_ITEM_SELECT, GetParentID(), m_pageControl, (int)m_scroller.GetValue()); SendWindowMessage(message2); m_lastScrollerValue = m_scroller.GetValue(); } // we run through the controls, rendering as we go int index = 0; float pos = GetAlignOffset(); for (iControls it = m_children.begin(); it != m_children.end(); ++it) { // note we render all controls, even if they're offscreen, as then they'll be updated // with respect to animations CGUIControl *control = *it; if (m_orientation == VERTICAL) g_graphicsContext.SetOrigin(m_posX, m_posY + pos - m_scroller.GetValue()); else g_graphicsContext.SetOrigin(m_posX + pos - m_scroller.GetValue(), m_posY); control->DoProcess(currentTime, dirtyregions); if (control->IsVisible()) { if (IsControlOnScreen(pos, control)) { if (control->HasFocus()) m_focusedPosition = index; index++; } pos += Size(control) + m_itemGap; } g_graphicsContext.RestoreOrigin(); } CGUIControl::Process(currentTime, dirtyregions); }
void CGUIControlGroupList::Process(unsigned int currentTime, CDirtyRegionList &dirtyregions) { if (m_scrollSpeed != 0) { MarkDirtyRegion(); m_offset += m_scrollSpeed * (currentTime - m_scrollLastTime); if ((m_scrollSpeed < 0 && m_offset < m_scrollOffset) || (m_scrollSpeed > 0 && m_offset > m_scrollOffset)) { m_offset = m_scrollOffset; m_scrollSpeed = 0; } } m_scrollLastTime = currentTime; // first we update visibility of all our items, to ensure our size and // alignment computations are correct. for (iControls it = m_children.begin(); it != m_children.end(); ++it) { CGUIControl *control = *it; GUIPROFILER_VISIBILITY_BEGIN(control); control->UpdateVisibility(); GUIPROFILER_VISIBILITY_END(control); } ValidateOffset(); if (m_pageControl) { CGUIMessage message(GUI_MSG_LABEL_RESET, GetParentID(), m_pageControl, (int)m_height, (int)m_totalSize); SendWindowMessage(message); CGUIMessage message2(GUI_MSG_ITEM_SELECT, GetParentID(), m_pageControl, (int)m_offset); SendWindowMessage(message2); } // we run through the controls, rendering as we go float pos = GetAlignOffset(); for (iControls it = m_children.begin(); it != m_children.end(); ++it) { // note we render all controls, even if they're offscreen, as then they'll be updated // with respect to animations CGUIControl *control = *it; if (m_orientation == VERTICAL) g_graphicsContext.SetOrigin(m_posX, m_posY + pos - m_offset); else g_graphicsContext.SetOrigin(m_posX + pos - m_offset, m_posY); control->DoProcess(currentTime, dirtyregions); if (control->IsVisible()) pos += Size(control) + m_itemGap; g_graphicsContext.RestoreOrigin(); } CGUIControl::Process(currentTime, dirtyregions); }
void CGUIControlGroup::Process(unsigned int currentTime, CDirtyRegionList &dirtyregions) { CPoint pos(GetPosition()); g_graphicsContext.SetOrigin(pos.x, pos.y); CRect rect; for (iControls it = m_children.begin(); it != m_children.end(); ++it) { CGUIControl *control = *it; control->UpdateVisibility(); unsigned int oldDirty = dirtyregions.size(); control->DoProcess(currentTime, dirtyregions); if (control->IsVisible() || (oldDirty != dirtyregions.size())) // visible or dirty (was visible?) rect.Union(control->GetRenderRegion()); } g_graphicsContext.RestoreOrigin(); CGUIControl::Process(currentTime, dirtyregions); m_renderRegion = rect; }
void CGUIListGroup::Process(unsigned int currentTime, CDirtyRegionList &dirtyregions) { CServiceBroker::GetWinSystem()->GetGfxContext().SetOrigin(m_posX, m_posY); CRect rect; for (iControls it = m_children.begin(); it != m_children.end(); ++it) { CGUIControl *control = *it; control->UpdateVisibility(m_item); unsigned int oldDirty = dirtyregions.size(); control->DoProcess(currentTime, dirtyregions); if (control->IsVisible() || (oldDirty != dirtyregions.size())) // visible or dirty (was visible?) rect.Union(control->GetRenderRegion()); } CServiceBroker::GetWinSystem()->GetGfxContext().RestoreOrigin(); CGUIControl::Process(currentTime, dirtyregions); m_renderRegion = rect; m_item = NULL; }
void CGUIWindowSettingsScreenCalibration::DoProcess(unsigned int currentTime, CDirtyRegionList &dirtyregions) { MarkDirtyRegion(); for (int i = CONTROL_TOP_LEFT; i <= CONTROL_PIXEL_RATIO; i++) SET_CONTROL_HIDDEN(i); m_needsScaling = true; CGUIWindow::DoProcess(currentTime, dirtyregions); m_needsScaling = false; g_graphicsContext.SetRenderingResolution(m_Res[m_iCurRes], false); g_graphicsContext.ResetWindowTransform(); // process the movers etc. for (int i = CONTROL_TOP_LEFT; i <= CONTROL_PIXEL_RATIO; i++) { SET_CONTROL_VISIBLE(i); CGUIControl *control = (CGUIControl *)GetControl(i); if (control) control->DoProcess(currentTime, dirtyregions); } }