OP_STATUS SVGHighlightUpdateIterator::TestElement(HTML_Element* test_elm, HTML_Element* layouted_elm) { if(!m_doc_ctx->GetSVGImage()->IsInteractive()) return OpSVGStatus::SKIP_SUBTREE; if(!m_current_hit) return OpSVGStatus::SKIP_ELEMENT; if (layouted_elm->IsText()) { if(layouted_elm == m_current_hit->GetSelection()->GetStartElement()) { m_current_hit = (SelectionElm*)m_current_hit->Suc(); return OpStatus::OK; } } RETURN_IF_ERROR(TestRelevantForDisplay(layouted_elm)); SVGElementContext* elm_ctx = AttrValueStore::GetSVGElementContext(test_elm); if (!elm_ctx) return OpSVGStatus::SKIP_ELEMENT /* SUBTREE ? */; if (!SVGUtils::IsTextClassType(layouted_elm->Type()) && !SVGUtils::IsContainerElement(test_elm)) return OpSVGStatus::SKIP_SUBTREE; RETURN_IF_ERROR(TestVisible(test_elm, layouted_elm)); return OpSVGStatus::SKIP_ELEMENT; }
/* * WindowIsVisible - check if given window id is visible */ bool WindowIsVisible( window_id id ) { wind *w; w = Windows[id]; return( TestVisible( w ) ); } /* WindowIsVisible */
OP_STATUS SVGAreaIterator::TestElement(HTML_Element* test_elm, HTML_Element* layouted_elm) { if (layouted_elm->IsText()) return OpSVGStatus::SKIP_ELEMENT; RETURN_IF_ERROR(TestRelevantForDisplay(layouted_elm)); return TestVisible(test_elm, layouted_elm); }
OP_STATUS SVGFocusIterator::TestElement(HTML_Element* test_elm, HTML_Element* layouted_elm) { if (layouted_elm->IsText()) return OpSVGStatus::SKIP_ELEMENT; RETURN_IF_ERROR(TestRelevantForDisplay(layouted_elm)); if (!g_svg_manager_impl->IsFocusableElement(m_doc_ctx->GetDocument(), layouted_elm)) return OpSVGStatus::SKIP_ELEMENT; return TestVisible(test_elm, layouted_elm); }
/* * SwapAllWindows - swap any window data we can */ void SwapAllWindows( void ) { info *cinfo; wind *w; windowSwapFileOpen(); if( swapHandle < 0 ) { return; } if( EditFlags.Verbose ) { Message1( "Swapping window data" ); } for( cinfo = InfoHead; cinfo != NULL; cinfo = cinfo->next ) { w = Windows[cinfo->CurrentWindow]; if( !TestVisible( w ) && !w->isswapped && w->accessed == 0 ) { windowSwap( w ); } } } /* SwapAllWindows */
OP_STATUS SVGReservedRegionIterator::TestElement(HTML_Element* test_elm, HTML_Element* layouted_elm) { if (layouted_elm->IsText()) return OpSVGStatus::SKIP_ELEMENT; RETURN_IF_ERROR(TestRelevantForDisplay(layouted_elm)); HLDocProfile* hld_profile = m_doc_ctx->GetHLDocProfile(); if (!hld_profile) return OpStatus::ERR; BOOL has_reserved_handler = FALSE; for (int i = 0; g_reserved_region_types[i] != DOM_EVENT_NONE && !has_reserved_handler; i++) if (layouted_elm->HasEventHandler(hld_profile->GetFramesDocument(), g_reserved_region_types[i], FALSE)) has_reserved_handler = TRUE; if (!has_reserved_handler) return OpSVGStatus::SKIP_ELEMENT; return TestVisible(test_elm, layouted_elm); }
void glutMainLoop(void) { int idleiters; if(ReshapeFunc) ReshapeFunc(VarInfo.xres, VarInfo.yres); if(!DisplayFunc) { sprintf(exiterror, "Fatal Error: No Display Function registered\n"); exit(0); } for(;;) { ProcessTimers(); if(Active) ReceiveInput(); else if(VisiblePoll) TestVisible(); if(IdleFunc) IdleFunc(); if(VisibleSwitch) { VisibleSwitch = 0; if(VisibilityFunc) VisibilityFunc(Visible ? GLUT_VISIBLE : GLUT_NOT_VISIBLE); } if(Resized) { SetVideoMode(); CreateBuffer(); if(!glFBDevMakeCurrent( Context, Buffer, Buffer )) { sprintf(exiterror, "Failure to Make Current\n"); exit(0); } InitializeMenus(); if(ReshapeFunc) ReshapeFunc(VarInfo.xres, VarInfo.yres); Redisplay = 1; Resized = 0; } if(Visible && Redisplay) { Redisplay = 0; EraseCursor(); DisplayFunc(); if(!(DisplayMode & GLUT_DOUBLE)) { if(ActiveMenu) DrawMenus(); DrawCursor(); } idleiters = 0; } else { /* we sleep if not receiving redisplays, and the main loop is running faster than 2khz */ static int lasttime; int time = glutGet(GLUT_ELAPSED_TIME); if(time > lasttime) { if(idleiters >= 2) usleep(100); idleiters = 0; lasttime = time; } idleiters++; } } }