RC_PAGEINFO* CRollupCtrl::GetPageInfo(int idx) { if (!FindPage(idx)) return (RC_PAGEINFO*)0; return FindPage(idx); }
void CRollupCtrl::ExpandPage(int idx, BOOL bExpand,BOOL bScroll,BOOL bFromUI) { if (!FindPage(idx)) return; //Expand-collapse _ExpandPage( FindPage(idx), bExpand,bFromUI); //Update RecalLayout(); //Scroll to this page (Automatic page visibility) if (bExpand && bScroll) ScrollToPage(idx, FALSE); if (GetOwner()) { CRollupCtrlNotify n; n.hdr.hwndFrom = m_hWnd; n.hdr.idFrom = GetDlgCtrlID(); n.hdr.code = ROLLUPCTRLN_EXPAND; n.nPageId = idx; n.bExpand = bExpand == TRUE; GetOwner()->SendMessage( WM_NOTIFY,(WPARAM)GetDlgCtrlID(),(LPARAM)&n ); } }
int CRollupCtrl::MovePageAt(int id, int newidx) { if (!FindPage(id)) return -1; int idx = FindPageIndex(id); if (idx==newidx) return -1; if (newidx>0 && newidx>= (int)m_PageList.size()) newidx=-1; //Remove page from its old position RC_PAGEINFO* pi = FindPage(id); m_PageList.erase( m_PageList.begin() + FindPageIndex(id) ); //Insert at its new position int retidx; if (newidx<0) { m_PageList.push_back(pi); retidx = m_PageList.size()-1; } else { m_PageList.insert( m_PageList.begin()+newidx, pi); retidx=newidx; } //Update RecalLayout(); return retidx; }
bool MainBook::ClosePage(const wxString& text) { int numPageClosed(0); bool closed = ClosePage(FindPage(text)); while(closed) { ++numPageClosed; closed = ClosePage(FindPage(text)); } return numPageClosed > 0; }
void CRollupCtrl::EnablePage(int idx, BOOL bEnable) { if (!FindPage(idx)) return; //Enable-Disable _EnablePage(FindPage(idx), bEnable); //Update RecalLayout(); }
void CDVBSub::Render(SubPicDesc& spd, REFERENCE_TIME rt, RECT& bbox) { DVB_PAGE* pPage = FindPage(rt); if (pPage != NULL) { pPage->rendered = true; TRACE_DVB(_T("DVB - Renderer - %s - %s\n"), ReftimeToString(pPage->rtStart), ReftimeToString(pPage->rtStop)); for (int i = 0; i < pPage->regionCount; i++) { DVB_REGION* pRegion = &pPage->regions[i]; DVB_CLUT* pCLUT = FindClut(pPage, pRegion->CLUT_id); if (pCLUT) { for (int j = 0; j < pRegion->objectCount; j++) { CompositionObject* pObject = FindObject(pPage, pRegion->objects[j].object_id); if (pObject) { short nX, nY; nX = pRegion->horizAddr + pRegion->objects[j].object_horizontal_position; nY = pRegion->vertAddr + pRegion->objects[j].object_vertical_position; pObject->m_width = pRegion->width; pObject->m_height = pRegion->height; pObject->SetPalette(pCLUT->size, pCLUT->palette, m_Display.width > 720); pObject->RenderDvb(spd, nX, nY); TRACE_DVB(_T(" --> %d/%d - %d/%d\n"), i + 1, pPage->regionCount, j + 1, pRegion->objectCount); } } } } bbox.left = 0; bbox.top = 0; bbox.right = m_Display.width; bbox.bottom = m_Display.height; } }
void CDVBSub::Render(SubPicDesc& spd, REFERENCE_TIME rt, RECT& bbox) { DVB_PAGE* pPage = FindPage(rt); if (pPage != NULL) { pPage->Rendered = true; for (int i = 0; i < pPage->RegionCount; i++) { CDVBSub::DVB_REGION* pRegion = &pPage->Regions[i]; for (int j = 0; j < pRegion->ObjectCount; j++) { CompositionObject* pObject = FindObject(pPage, pRegion->Objects[j].object_id); if (pObject) { short nX, nY; nX = pRegion->HorizAddr + pRegion->Objects[j].object_horizontal_position; nY = pRegion->VertAddr + pRegion->Objects[j].object_vertical_position; pObject->m_width = pRegion->width; pObject->m_height = pRegion->height; pObject->SetPalette(pRegion->Clut.Size, pRegion->Clut.Palette, m_Display.width > 720); pObject->RenderDvb(spd, nX, nY); } } } bbox.left = 0; bbox.top = 0; bbox.right = m_Display.width; bbox.bottom = m_Display.height; } }
void TabMenuControl::SetCurrentPage(unsigned page) { assert(page < buttons.size()); if (!pager.ClickPage(page)) return; if (page == GetMenuPage()) { form.SetCaption(caption); const MenuTabIndex di = FindPage(last_content_page); this->GetTabMenuDisplay()->SetSelectedIndex(di); } else { const PageItem& theitem = GetPageItem(page); SetLastContentPage(page); const MainMenuButton &main_button = GetMainMenuButton(theitem.main_menu_index); StaticString<128> caption; caption.Format(_T("%s > %s"), gettext(main_button.caption), gettext(theitem.menu_caption)); form.SetCaption(caption); } }
void CRollupCtrl::_RemovePage(int idx) { // Find page RC_PAGEINFO* pi = FindPage(idx); //Remove page from array m_PageList.erase( m_PageList.begin() + FindPageIndex(idx) ); //Get Page Rect CRect tr; pi->pwndTemplate->GetWindowRect(&tr); //Update PageHeight m_nPageHeight-=RC_PGBUTTONHEIGHT+(RC_GRPBOXINDENT*2); if (pi->bExpanded) m_nPageHeight-=tr.Height(); //Remove wnds if (pi->pwndButton) delete pi->pwndButton; if (pi->pwndGroupBox) delete pi->pwndGroupBox; // fix ::SetWindowLongPtr(pi->pwndTemplate->m_hWnd, DWLP_DLGPROC, (LONG_PTR)pi->pOldDlgProc); if (pi->pwndTemplate && pi->bAutoDestroyTpl) { pi->pwndTemplate->DestroyWindow(); delete pi->pwndTemplate; } else { pi->pwndTemplate->ShowWindow(SW_HIDE); } //Delete pageinfo delete pi; }
plRegistryPageNode* plPluginResManager::INameToPage(const char* age, const char* page, int32_t sequenceNumber, bool itinerant) { // Find the location first, to see if it already exists plRegistryPageNode* pageNode = FindPage(age, page); if (pageNode == nil) { // This page does not yet exist, so create a new page if (sequenceNumber != uint32_t(-1)) { const plLocation& newLoc = ICreateLocation(age, page, sequenceNumber, itinerant); pageNode = CreatePage(newLoc, age, page); } else { const plLocation& newLoc = ICreateLocation(age, page, itinerant); pageNode = CreatePage(newLoc, age, page); } // Still preload textures on this guy. This should be a no-op for this page since it's new, but won't be // for the shared textures page IPreLoadTextures(pageNode, sequenceNumber); } else if (!pageNode->IsNewPage()) { // Node's already in our registry (i.e. already stored somewhere), so make sure it loads so // we can update from that LoadPageKeys(pageNode); // Now clear out all the unwanted keys. IPreLoadTextures(pageNode, sequenceNumber); } return pageNode; }
void CPreferencesDlg::AddPage(CPreferencesPageBase* pPage, UINT nIDPath, UINT nIDSection) { CEnString sPath(nIDPath); if (FindPage(pPage) != -1) { HTREEITEM htiParent = TVI_ROOT; // default CString sParent(sPath); while (Misc::Split(sParent, sPath, PATHDELIM)) { // see if parent already exists HTREEITEM htiParentParent = htiParent; htiParent = m_tcPages.GetChildItem(htiParentParent); while (htiParent) { if (sParent.CompareNoCase(m_tcPages.GetItemText(htiParent)) == 0) break; htiParent = m_tcPages.GetNextItem(htiParent, TVGN_NEXT); } if (!htiParent) { htiParent = m_tcPages.InsertItem(sParent, htiParentParent); // embolden root items if (htiParentParent == TVI_ROOT) m_tcPages.SetItemState(htiParent, TVIS_BOLD, TVIS_BOLD); } // next sParent = sPath; } HTREEITEM hti = m_tcPages.InsertItem(sPath, htiParent); // whatever's left m_tcPages.EnsureVisible(hti); // embolden root items if (htiParent == TVI_ROOT) m_tcPages.SetItemState(hti, TVIS_BOLD, TVIS_BOLD); // map both ways m_tcPages.SetItemData(hti, (DWORD)pPage); // don't remap the page if already done HTREEITEM htiMap = NULL; if (!m_mapPP2HTI.Lookup(pPage, htiMap)) m_mapPP2HTI[pPage] = hti; // map the treeitem to its section if it has one if (nIDSection) m_mapHTIToSection[hti] = nIDSection; // set page background to window back pPage->SetBackgroundColor(GetSysColor(COLOR_WINDOW)); } }
//-------------------------------------------------------------------------- // Add a page to the hash table. If the page is already in the hash table // it is updated and a new time stamp is given. If the page is new then // it is added to the table. The data in buf is put in the page and the // Space location number is returned. // // portnum the port number of the port being used for the // 1-Wire Network. // SNum the serial number for the part that the read is // to be done on. // pg the page to add // buf the buffer of the page data // len len of data for the page // // return the space number for the new page // uchar AddPage(int portnum, uchar *SNum, PAGE_TYPE pg, uchar *buf, int len) { uchar hs,p=0xFF; short i=0,m; PAGE_TYPE page; int tlen; uchar cache_page[32]; page = pg; // attempt to see if page already there if(!FindPage(portnum,SNum,&page,(uchar)(len & 0x80),FALSE, &cache_page[0],&tlen,&p)) return FALSE; if (p == 0xFF) { // page not found so add one hs = HashFunction(SNum,page); p = FindNew(hs); // attach the device to the chain (if there is one) // no other page in hash location if (Hash[hs] == 0xFF) { Hash[hs] = p; // hash p to new page Space[p].Fptr = 0xFF; // np front p to nothing Space[p].Bptr = 0xFF; // np back p to nothing Space[p].Hptr = hs; // np hash p to hash location } // some other page already there else { // insert as first page Space[p].Fptr = Hash[hs]; // np front p to old first page Space[Hash[hs]].Bptr = p; // old first page back p to np Hash[hs] = p; // hash p to np Space[p].Hptr = hs; // np hash p to hash location } // set the page number Space[p].Page = page; // set the rom for (i = 0; i < 8; i++) Space[p].ROM[i] = SNum[i]; } // set the data Space[p].Data[0] = (uchar)len; m = ((len & 0x1F) <= 0x1D) ? (len & 0x1F) : 0; for (i = 0; i < m; i++) Space[p].Data[i+1] = buf[i]; // set the time stamp limit of X seconds Space[p].Tstamp = msGettick() + CACHE_TIMEOUT; // (3.10) // return the Space number of the new page return p; }
bool TiledImage::LoadTiledTexture(Size2I tileSize) { auto textureAtlas=TextureAtlasFactory::Instance().CreateTiledAtlas(mSource, mSize, tileSize); RETURN_FALSE_IF_NULL(textureAtlas); mTexturePage = textureAtlas->FindPage(0); mTextureAtlas = textureAtlas; return true; }
BOOL COXCustomizeManager::ActivatePage(COXCustomizePage* pCustomizePage) { HSHBGROUP hGroup=NULL; int nIndex=-1; if(!FindPage(pCustomizePage,hGroup,nIndex)) return FALSE; ASSERT(hGroup!=NULL && nIndex!=-1); return ActivatePage(hGroup,nIndex); }
BOOL COXCustomizeManager::ActivatePage(LPCTSTR lpszTitle, LPCTSTR lpszGroup) { HSHBGROUP hGroup=NULL; int nIndex=-1; if(!FindPage(lpszTitle,lpszGroup,hGroup,nIndex)) return FALSE; ASSERT(hGroup!=NULL && nIndex!=-1); return ActivatePage(hGroup,nIndex); }
void CRollupCtrl::RemovePage(int idx) { if (!FindPage(idx)) return; _RemovePage(idx); RecalLayout(); }
// TODO: change return type to page, and use null for error handling. move index result into args. uintptr_t p_index(void *ptr, size_t type_id) { size_t index; struct p_page *page = FindPage(ptr, type_id, &index, 0); assert(page); if (!page) return -1; return index; }
STDMETHODIMP CDVBSub::Render(SubPicDesc& spd, REFERENCE_TIME rt, double fps, RECT& bbox) { CAutoLock cAutoLock(&m_csCritSec); rt -= m_rtCurrentSegmentStart; // Make sure the timing are relative to the current segment start RemoveOldPages(rt); if (POSITION posPage = FindPage(rt)) { const auto& pPage = m_pages.GetAt(posPage); bool BT709 = m_infoSourceTarget.sourceMatrix == BT_709 ? true : m_infoSourceTarget.sourceMatrix == NONE ? (m_displayInfo.width > 720) : false; pPage->rendered = true; TRACE_DVB(_T("DVB - Renderer - %s - %s\n"), ReftimeToString(pPage->rtStart + m_rtCurrentSegmentStart), ReftimeToString(pPage->rtStop + m_rtCurrentSegmentStart)); int nRegion = 1, nObject = 1; for (POSITION pos = pPage->regionsPos.GetHeadPosition(); pos; nRegion++) { DVB_REGION_POS regionPos = pPage->regionsPos.GetNext(pos); if (POSITION posRegion = FindRegion(pPage, regionPos.id)) { const auto& pRegion = pPage->regions.GetAt(posRegion); if (POSITION posCLUT = FindClut(pPage, pRegion->CLUT_id)) { const auto& pCLUT = pPage->CLUTs.GetAt(posCLUT); for (POSITION posO = pRegion->objects.GetHeadPosition(); posO; nObject++) { DVB_OBJECT objectPos = pRegion->objects.GetNext(posO); if (POSITION posObject = FindObject(pPage, objectPos.object_id)) { const auto& pObject = pPage->objects.GetAt(posObject); short nX = regionPos.horizAddr + objectPos.object_horizontal_position; short nY = regionPos.vertAddr + objectPos.object_vertical_position; pObject->m_width = pRegion->width; pObject->m_height = pRegion->height; pObject->SetPalette(pCLUT->size, pCLUT->palette, BT709, m_infoSourceTarget.sourceBlackLevel, m_infoSourceTarget.sourceWhiteLevel, m_infoSourceTarget.targetBlackLevel, m_infoSourceTarget.targetWhiteLevel); pObject->RenderDvb(spd, nX, nY); TRACE_DVB(_T(" --> %d/%d - %d/%d\n"), nRegion, pPage->regionsPos.GetCount(), nObject, pRegion->objects.GetCount()); } } } } } bbox.left = 0; bbox.top = 0; bbox.right = m_displayInfo.width; bbox.bottom = m_displayInfo.height; } return S_OK; }
BOOL COXCustomizeManager::SetPageTooltip(COXCustomizePage* pCustomizePage, LPCTSTR lpszTooltip) { HSHBGROUP hGroup=NULL; int nIndex=-1; if(!FindPage(pCustomizePage,hGroup,nIndex)) return FALSE; ASSERT(hGroup!=NULL && nIndex!=-1); m_mapTooltips.SetAt(pCustomizePage,lpszTooltip); return TRUE; }
BOOL COXTabViewContainer::DeletePage(CWnd* pWnd, BOOL bDestroy/*=TRUE*/) { ASSERT(pWnd!=NULL); ASSERT(IsPage(pWnd)); int nIndex=-1; if(FindPage(pWnd,nIndex)) { return DeletePage(nIndex,bDestroy); } return FALSE; }
void wxBookCtrlBase::OnHelp(wxHelpEvent& event) { // determine where does this even originate from to avoid redirecting it // back to the page which generated it (resulting in an infinite loop) // notice that we have to check in the hard(er) way instead of just testing // if the event object == this because the book control can have other // subcontrols inside it (e.g. wxSpinButton in case of a notebook in wxUniv) wxWindow *source = wxStaticCast(event.GetEventObject(), wxWindow); while ( source && source != this && source->GetParent() != this ) { source = source->GetParent(); } if ( source && FindPage(source) == wxNOT_FOUND ) { // this event is for the book control itself, redirect it to the // corresponding page wxWindow *page = NULL; if ( event.GetOrigin() == wxHelpEvent::Origin_HelpButton ) { // show help for the page under the mouse const int pagePos = HitTest(ScreenToClient(event.GetPosition())); if ( pagePos != wxNOT_FOUND) { page = GetPage((size_t)pagePos); } } else // event from keyboard or unknown source { // otherwise show the current page help page = GetCurrentPage(); } if ( page ) { // change event object to the page to avoid infinite recursion if // we get this event ourselves if the page doesn't handle it event.SetEventObject(page); if ( page->GetEventHandler()->ProcessEvent(event) ) { // don't call event.Skip() return; } } } //else: event coming from one of our pages already event.Skip(); }
const plLocation& plPluginResManager::GetCommonPage(const plLocation &sisterPage, int whichPage) { if (sisterPage.IsReserved()) return sisterPage; // Reserved pages have no common pages plRegistryPageNode* page = FindPage(sisterPage); if (page == nil) { hsAssert(false, "Trying to find the sister common page to a page that doesn't exist!"); return sisterPage; } // Find the common page in the same age as this one plRegistryPageNode* commonPage = FindPage(page->GetPageInfo().GetAge(), plAgeDescription::GetCommonPage(whichPage)); if (commonPage == nil) { hsAssert(false, "Unable to find sister common page to this page"); return sisterPage; } return commonPage->GetPageInfo().GetLocation(); }
void CRollupCtrl::ScrollToPage(int idx, BOOL bAtTheTop) { if (!FindPage(idx)) return; //Get page infos RC_PAGEINFO* pi = FindPage(idx); //Get windows rect CRect r; GetWindowRect(&r); CRect tr; pi->pwndTemplate->GetWindowRect(&tr); //Check page visibility if (bAtTheTop || ((tr.bottom>r.bottom) || (tr.top<r.top))) { //Compute new m_nStartYPos pi->pwndButton->GetWindowRect(&tr); m_nStartYPos-= (tr.top-r.top); //Update RecalLayout(); } }
BOOL COXCustomizeManager::FindPage(CustomizeManagerPage pageType, HSHBGROUP& hGroupTest, int& nIndexTest) const { POSITION pos=m_mapObjects.GetStartPosition(); while(pos!=NULL) { DWORD dwType=0; COXCustomizePage* pCustomizePage=NULL; m_mapObjects.GetNextAssoc(pos,pCustomizePage,dwType); ASSERT(pCustomizePage!=NULL); if((CustomizeManagerPage)dwType==pageType) return FindPage(pCustomizePage,hGroupTest,nIndexTest); } return FALSE; }
/* ARGSUSED */ static Boolean SetValues (Widget wcurrent, Widget wrequest, Widget wnew, ArgList args, Cardinal *num_args) { Boolean redisplay = FALSE; char *new_map; int cur, req; DviWidget current = (DviWidget)wcurrent; DviWidget request = (DviWidget)wrequest; DviWidget new_wd = (DviWidget)wnew; if (current->dvi.font_map_string != request->dvi.font_map_string) { new_map = XtMalloc (strlen (request->dvi.font_map_string) + 1); if (new_map) { redisplay = TRUE; strcpy (new_map, request->dvi.font_map_string); new_wd->dvi.font_map_string = new_map; if (current->dvi.font_map_string) XtFree (current->dvi.font_map_string); current->dvi.font_map_string = 0; ParseFontMap (new_wd); } } req = request->dvi.requested_page; cur = current->dvi.requested_page; if (cur != req) { if (!request->dvi.file) req = 0; else { if (req < 1) req = 1; if (current->dvi.last_page != 0 && req > current->dvi.last_page) req = current->dvi.last_page; } if (cur != req) redisplay = TRUE; new_wd->dvi.requested_page = req; if (current->dvi.last_page == 0 && req > cur) FindPage (new_wd); } args = args; /* unused; suppress compiler warning */ num_args = num_args; return redisplay; }
//�鿴ϵͳ�¼� //���RegIDΪ0�����ص�ǰҳ����¼���־ INSPECT_SYSEVT_RET Q_InspectPeripEvt(PAGE_RID RegID,PERIP_EVT PeripEvt) { u8 PageIdx; if(RegID) { if(FindPage("",RegID,&PageIdx)!=SM_State_OK) return NoHasSysEvt;//�˴�״̬��ʧ�� } else //���RegIDΪ0�����ص�ǰҳ����¼���־ { PageIdx=GetPageIdxByTrack(0); } if(ReadBit(gPagePeripEvtFlag[PageIdx],PeripEvt)) return HasPagePeripEvt; if(ReadBit(gGobalPeripEvtBitFlag,PeripEvt)) return HasGobalSysEvt; return NoHasSysEvt; }
void find_last_page_GP(const unsigned char *data, UInt32 data_size, ogg_int64_t *gp, long *serialno) { unsigned char *ptr = (unsigned char *) data; const unsigned char *end = data + data_size; ogg_page op; *gp = -1; *serialno = 0; while (FindPage(&ptr, end, &op)) { if (ogg_page_granulepos(&op) > 0) { *gp = ogg_page_granulepos(&op); *serialno = ogg_page_serialno(&op); } } }
//�ر�ϵͳ�¼���־ void Q_DisablePeripEvt(PAGE_RID RegID,PERIP_EVT PeripEvt) { u8 PageIdx; OS_DeclareCritical(); if(RegID) { if(FindPage("",RegID,&PageIdx)!=SM_State_OK) return;//�˴�״̬��ʧ�� } else //���RegIDΪ0�����ص�ǰҳ����¼���־ { PageIdx=GetPageIdxByTrack(0); } OS_EnterCritical(); ClrBit(gPagePeripEvtFlag[PageIdx],PeripEvt); OS_ExitCritical(); }
BOOL COXCustomizeManager::DeletePage(COXCustomizePage* pCustomizePage) { HSHBGROUP hGroup=NULL; int nIndex=-1; if(!FindPage(pCustomizePage,hGroup,nIndex)) { return FALSE; } ASSERT(hGroup!=NULL && nIndex!=-1); if(!m_shb.DeleteLCItem(hGroup,nIndex)) { return FALSE; } m_mapTooltips.RemoveKey(pCustomizePage); return TRUE; }
//���ϵͳ�¼���Ӧλ void Q_ClrPeripEvt(PAGE_RID RegID,u32 PeripEvtCon) { u8 PageIdx; OS_DeclareCritical(); if(RegID) { if(FindPage("",RegID,&PageIdx)!=SM_State_OK) return;//�˴�״̬��ʧ�� } else //���RegIDΪ0�����ص�ǰҳ����¼���־ { PageIdx=GetPageIdxByTrack(0); } OS_EnterCritical(); gPagePeripEvtFlag[PageIdx]&=PeripEvtCon; OS_ExitCritical(); }