void LLVOCacheEntry::setState(U32 state) { if(state > LOW_BITS) //special states { mState |= (HIGH_BITS & state); return; } // //otherwise LOW_BITS states // clearState(LOW_BITS); mState |= (LOW_BITS & state); if(getState() == ACTIVE) { const S32 MIN_INTERVAL = 64 + sMinFrameRange; U32 last_visible = getVisible(); setVisible(); U32 cur_visible = getVisible(); if(cur_visible - last_visible > MIN_INTERVAL || cur_visible < MIN_INTERVAL) { mLastCameraUpdated = 0; //reset } else { mLastCameraUpdated = LLViewerRegion::sLastCameraUpdated; } } }
// actionPerformed //--------------------------------------------------------------------------- void HostOptionsView::actionPerformed(mMouseEvent me) { if (me.getSource()==&checkPublic) { if ( getVisible() ) { GameConfig::server_public = checkPublic.getState(); } } else if (me.getSource()==&checkPowerUp) { if ( getVisible() ) { GameConfig::game_powerups = checkPowerUp.getState(); } } else if (me.getSource()==&choiceWindSpeed) { windSpeed = choiceWindSpeed.getSelectedIndex(); updateWindSpeedString(); } else if (me.getSource()==&choiceCloudCoverage) { cloudCoverageCount = choiceCloudCoverage.getSelectedIndex(); updateGameConfigCloudCoverage(); } else if (me.getSource()==&choiceGameType) { if ( getVisible() ) { gameType = choiceGameType.getSelectedIndex(); updateGameConfigGameType(); } } } // end HostOptionsView::actionPerformed
void CSObject::setVisible(bool v) { m_Visible = v; if (getPrimarySceneNode()) getPrimarySceneNode()->setVisible(getVisible()); if (m_Children) { CSObject* obj = m_Children->getNextObject(true); while (obj) { obj->setVisible(getVisible()); obj = m_Children->getNextObject(false); } } }
void LLProgressView::setVisible(BOOL visible) { if (getVisible() && !visible) { mFadeTimer.start(); } else if (!getVisible() && visible) { gFocusMgr.setTopCtrl(this); setFocus(TRUE); mFadeTimer.stop(); mProgressTimer.start(); LLPanel::setVisible(visible); } }
void LLProgressView::setVisible(BOOL visible) { // hiding progress view if (getVisible() && !visible) { LLPanel::setVisible(FALSE); } // showing progress view else if (visible && (!getVisible() || mFadeToWorldTimer.getStarted())) { setFocus(TRUE); mFadeToWorldTimer.stop(); LLPanel::setVisible(TRUE); } }
// virtual void LLOutputMonitorCtrl::switchIndicator(bool switch_on) { if(getVisible() != (BOOL)switch_on) { setVisible(switch_on); //Let parent adjust positioning of icons adjacent to speaker indicator //(when speaker indicator hidden, adjacent icons move to right and when speaker //indicator visible, adjacent icons move to the left) if (getParent() && getParent()->isInVisibleChain()) { notifyParentVisibilityChanged(); //Ignore toggled state in case it was set when parent visibility was hidden mIndicatorToggled = false; } else { //Makes sure to only adjust adjacent icons when parent becomes visible //(!mIndicatorToggled ensures that changes of TFT and FTF are discarded, real state changes are TF or FT) mIndicatorToggled = !mIndicatorToggled; } } }
//----------------------------------------------------------------------------- // setVisible() //----------------------------------------------------------------------------- void LLMorphView::setVisible(BOOL visible) { if( visible != getVisible() ) { LLView::setVisible(visible); if (visible) { llassert( !gFloaterCustomize ); gFloaterCustomize = new LLFloaterCustomize(); gFloaterCustomize->fetchInventory(); gFloaterCustomize->open(); /*Flawfinder: ignore*/ // Must do this _after_ gFloaterView is initialized. gFloaterCustomize->switchToDefaultSubpart(); initialize(); // First run dialog LLFirstUse::useAppearance(); } else { if( gFloaterCustomize ) { gFloaterView->removeChild( gFloaterCustomize ); delete gFloaterCustomize; gFloaterCustomize = NULL; } shutdown(); } } }
void CBlackGraviArtefact::UpdateCLChild() { VERIFY(!ph_world->Processing()); inherited::UpdateCLChild (); if (getVisible() && m_pPhysicsShell) { if (m_bStrike) { Fvector P; P.set(Position()); feel_touch_update(P,m_fRadius); GraviStrike(); CParticlesObject* pStaticPG; pStaticPG = CParticlesObject::Create(*m_sParticleName,TRUE); Fmatrix pos; pos.set(XFORM()); Fvector vel; //vel.sub(Position(),ps_Element(0).vPosition); //vel.div((Level().timeServer()-ps_Element(0).dwTime)/1000.f); vel.set(0,0,0); pStaticPG->UpdateParent(pos, vel); pStaticPG->Play(); m_bStrike = false; } }else if(H_Parent()) XFORM().set(H_Parent()->XFORM()); }
void wiSPTree::getVisible(Node* node, AABB& frustum, CulledList& objects, SortType sort, CullStrictness type){ if(!node) return; int contain_type = frustum.intersects(node->box); if(!contain_type) return; else{ for(Cullable* object : node->objects) if( type==SP_TREE_LOOSE_CULL || (type==SP_TREE_STRICT_CULL && contain_type==AABB::INSIDE || (contain_type==INTERSECTS && frustum.intersects(object->bounds)) ) ){ #ifdef SORT_SPTREE_CULL object->lastSquaredDistMulThousand=(long)(wiMath::Distance(object->bounds.getCenter(),frustum.getCenter())*1000); if (sort == SP_TREE_SORT_PAINTER) object->lastSquaredDistMulThousand *= -1; #endif objects.insert(object); } if(node->count){ for (unsigned int i = 0; i<node->children.size(); ++i) getVisible(node->children[i],frustum,objects, sort,type); } } }
void PopupMenu::changed(ConstFieldMaskArg whichField, UInt32 origin, BitVector details) { Inherited::changed(whichField, origin, details); if(whichField & VisibleFieldMask) { if(getVisible()) { producePopupMenuWillBecomeVisible(PopupMenuEvent::create(PopupMenuRefPtr(this), getSystemTime())); } else { producePopupMenuWillBecomeInvisible(PopupMenuEvent::create(PopupMenuRefPtr(this), getSystemTime())); if(getSelectionModel() != NULL) { getSelectionModel()->clearSelection(); } removeMousePresenceOnComponents(); } } if(whichField & SizeFieldMask) { updateSeparatorSizes(); } if(whichField & SelectionModelFieldMask && getSelectionModel() != NULL) { getSelectionModel()->addSelectionListener(&_MenuSelectionListener); } }
bool Component::isContained(const Pnt2f& p, bool TestAgainstClipBounds) const { if(!getVisible()) { return false; } Pnt2f PointInCompSpace(DrawingSurfaceToComponent(p,this)); Border* DrawnBorder(getDrawnBorder()); Pnt2f TopLeft, BottomRight; if(TestAgainstClipBounds && getClipping()) { TopLeft = getClipTopLeft(); BottomRight = getClipBottomRight(); } else { TopLeft.setValues(0,0); BottomRight = Pnt2f(getSize()); } if(DrawnBorder == NULL) { return isContainedBounds(PointInCompSpace, TopLeft, BottomRight); } else { return isContainedBounds(PointInCompSpace, TopLeft, BottomRight) && DrawnBorder->isContained(PointInCompSpace,0,0,getSize().x(),getSize().y()); } }
void LLFloaterAuction::draw() { LLFloater::draw(); if(getVisible() && !isMinimized() && mImage.notNull()) { LLRect rect; if (childGetRect("snapshot_icon", rect)) { { LLGLSNoTexture gls_no_texture; gl_rect_2d(rect, LLColor4(0.f, 0.f, 0.f, 1.f)); rect.stretch(-1); } { LLGLSUIDefault gls_ui; glColor3f(1.f, 1.f, 1.f); gl_draw_scaled_image(rect.mLeft, rect.mBottom, rect.getWidth(), rect.getHeight(), mImage); } } } }
void LLVOCacheEntry::calcSceneContribution(const LLVector4a& camera_origin, bool needs_update, U32 last_update, F32 max_dist) { if(!needs_update && getVisible() >= last_update) { return; //no need to update } LLVector4a lookAt; lookAt.setSub(getPositionGroup(), camera_origin); F32 distance = lookAt.getLength3().getF32(); distance -= sNearRadius; if(distance <= 0.f) { //nearby objects, set a large number const F32 LARGE_SCENE_CONTRIBUTION = 1000.f; //a large number to force to load the object. mSceneContrib = LARGE_SCENE_CONTRIBUTION; } else { F32 rad = getBinRadius(); max_dist += rad; if(distance + sNearRadius < max_dist) { mSceneContrib = (rad * rad) / distance; } else { mSceneContrib = 0.f; //out of draw distance, not to load } } setVisible(); }
//--------------------------------------------------------------------------------- void LLSysWellWindow::reshapeWindow() { // save difference between floater height and the list height to take it into account while calculating new window height // it includes height from floater top to list top and from floater bottom and list bottom static S32 parent_list_delta_height = getRect().getHeight() - mMessageList->getRect().getHeight(); if (!mIsReshapedByUser) // Don't reshape Well window, if it ever was reshaped by user. See EXT-5715. { S32 notif_list_height = mMessageList->getItemsRect().getHeight() + 2 * mMessageList->getBorderWidth(); LLRect curRect = getRect(); S32 new_window_height = notif_list_height + parent_list_delta_height; if (new_window_height > MAX_WINDOW_HEIGHT) { new_window_height = MAX_WINDOW_HEIGHT; } S32 newY = curRect.mTop + new_window_height - curRect.getHeight(); S32 newWidth = curRect.getWidth() < MIN_WINDOW_WIDTH ? MIN_WINDOW_WIDTH : curRect.getWidth(); curRect.setLeftTopAndSize(curRect.mLeft, newY, newWidth, new_window_height); reshape(curRect.getWidth(), curRect.getHeight(), TRUE); setRect(curRect); } // update notification channel state // update on a window reshape is important only when a window is visible and docked if(mChannel && getVisible() && isDocked()) { mChannel->updateShowToastsState(); } }
bool GUIImage::render(sf::RenderWindow *window, sf::RenderStates &states) { bool visible = getVisible(); if(!visible)return false; float x = getLocalX(), y = getLocalY(); std::shared_ptr<GUIElement> parent = getParent(); while(parent != NULL) { x += parent->getLocalX(); y += parent->getLocalY(); visible = parent->getVisible(); if(!visible) return false; parent = parent->getParent(); } if(visible) { mSprite.setPosition(x, y); window->draw(mSprite, states); } if(!mChilds.empty()) { for(std::vector<std::shared_ptr<GUIElement> >::size_type i = 0; i < mChilds.size(); ++i) { mChilds[i]->render(window, states); } } return true; }
// assumes GL state is set for 2D void LLResizeHandle::draw() { if( mImage.notNull() && getVisible() && (RIGHT_BOTTOM == mCorner) ) { mImage->draw(0, 0); } }
// virtual void LLModalDialog::draw() { if (getVisible()) { LLColor4 shadow_color = LLUI::sColorsGroup->getColor("ColorDropShadow"); S32 shadow_lines = LLUI::sConfigGroup->getS32("DropShadowFloater"); gl_drop_shadow( 0, mRect.getHeight(), mRect.getWidth(), 0, shadow_color, shadow_lines); LLFloater::draw(); if (mModal) { // If we've lost focus to a non-child, get it back ASAP. if( gFocusMgr.getTopCtrl() != this ) { gFocusMgr.setTopCtrl( this ); } if( !gFocusMgr.childHasKeyboardFocus( this ) ) { setFocus(TRUE); } if( !gFocusMgr.childHasMouseCapture( this ) ) { gFocusMgr.setMouseCapture( this ); } } } }
void Window::setVisibleSmooth(bool _visible) { mAnimateSmooth = true; ControllerManager::getInstance().removeItem(this); if (_visible) { setEnabledSilent(true); if (!getVisible()) { setAlpha(ALPHA_MIN); Base::setVisible(true); } ControllerFadeAlpha* controller = createControllerFadeAlpha(getAlphaVisible(), WINDOW_SPEED_COEF, true); controller->eventPostAction += newDelegate(this, &Window::animateStop); ControllerManager::getInstance().addItem(this, controller); } else { setEnabledSilent(false); ControllerFadeAlpha* controller = createControllerFadeAlpha(ALPHA_MIN, WINDOW_SPEED_COEF, false); controller->eventPostAction += newDelegate(action::actionWidgetHide); ControllerManager::getInstance().addItem(this, controller); } }
bool LLMediaCtrl::ensureMediaSourceExists() { if(mMediaSource.isNull()) { // If we don't already have a media source, try to create one. mMediaSource = LLViewerMedia::newMediaImpl(mMediaTextureID, mTextureWidth, mTextureHeight); if ( mMediaSource ) { mMediaSource->setUsedInUI(true); mMediaSource->setHomeURL(mHomePageUrl, mHomePageMimeType); mMediaSource->setTarget(mTarget); mMediaSource->setVisible( getVisible() ); mMediaSource->addObserver( this ); mMediaSource->setBackgroundColor( getBackgroundColor() ); mMediaSource->setTrustedBrowser(mTrusted); mMediaSource->setPageZoomFactor( LLUI::getScaleFactor().mV[ VX ] ); if(mClearCache) { mMediaSource->clearCache(); mClearCache = false; } } else { llwarns << "media source create failed " << llendl; // return; } } return !mMediaSource.isNull(); }
void GUIButton::render(sf::RenderWindow &window) { bool visible = getVisible(); std::shared_ptr<GUIElement> parent = getParent(); while(parent != NULL) { visible = parent->getVisible(); if(!visible) break; parent = parent->getParent(); } if(visible) { float width = static_cast<float>(getWidth()); float height = static_cast<float>(getHeight()); float xPos = static_cast<float>(mX); float yPos = static_cast<float>(mY); sf::RectangleShape rect(sf::Vector2f(width, height)); rect.setPosition(xPos, yPos); rect.setFillColor(sf::Color::Color(255, 255, 255, 255)); window.draw(rect); } /*if(!mChilds.empty()) { for(std::vector<GUIElement*>::size_type i = 0; i < mChilds.size(); ++i) { mChilds[i]->render(window); } }*/ }
LLPanel* LLFloaterSidePanelContainer::openChildPanel(const std::string& panel_name, const LLSD& params) { LLView* view = findChildView(panel_name, true); if (!view) return NULL; if (!getVisible()) { openFloater(); } LLPanel* panel = NULL; LLSideTrayPanelContainer* container = dynamic_cast<LLSideTrayPanelContainer*>(view->getParent()); if (container) { LLSD new_params = params; new_params[LLSideTrayPanelContainer::PARAM_SUB_PANEL_NAME] = panel_name; container->onOpen(new_params); panel = container->getCurrentPanel(); } else if ((panel = dynamic_cast<LLPanel*>(view)) != NULL) { panel->onOpen(params); } return panel; }
// *NOTE: we assume that setVisible() is called on floater close. // virtual void LLFloaterMove::setVisible(BOOL visible) { // Do nothing with Stand/Stop Flying panel in excessive calls of this method (from LLTransientFloaterMgr?). if (getVisible() == visible) { LLTransientDockableFloater::setVisible(visible); return; } if (visible) { // Attach the Stand/Stop Flying panel. LLPanelStandStopFlying* ssf_panel = LLPanelStandStopFlying::getInstance(); ssf_panel->reparent(this); const LLRect& mode_actions_rect = mModeActionsPanel->getRect(); ssf_panel->setOrigin(mode_actions_rect.mLeft, mode_actions_rect.mBottom); } else { // Detach the Stand/Stop Flying panel. LLPanelStandStopFlying::getInstance()->reparent(NULL); } LLTransientDockableFloater::setVisible(visible); }
void Button::draw(void) { if(getVisible()) { // draw the bkgd of button if(mMouseOver) { if(mNormalTexture == NULL) gGraphics->BlitRect(mX, mY, mWidth, mHeight, D3DCOLOR_ARGB(255, 255, 166, 0)); else { gGraphics->BlitTexture(mHooverTexture, getRect()); } // so it wont be true forever mMouseOver = false; } else { if(mNormalTexture == NULL) gGraphics->BlitRect(mX, mY, mWidth, mHeight, mColor); else gGraphics->BlitTexture(mNormalTexture, getRect()); } // draw the font if(mFont && !getOverlap()) { strcpy(buffer, mDisplayText.c_str()); gGraphics->drawText(buffer, mX-mWidth/2+5, mY-mHeight/2, D3DCOLOR_ARGB(255,0,0,0)); } overlaped(false); } }
STDMETHODIMP MousePointerShapeChangedEventWrap::COMGETTER(Visible)(BOOL *aVisible) { LogRelFlow(("{%p} %s: enter aVisible=%p\n", this, "MousePointerShapeChangedEvent::getVisible", aVisible)); VirtualBoxBase::clearError(); HRESULT hrc; try { CheckComArgOutPointerValidThrow(aVisible); AutoCaller autoCaller(this); if (FAILED(autoCaller.rc())) throw autoCaller.rc(); hrc = getVisible(aVisible); } catch (HRESULT hrc2) { hrc = hrc2; } catch (...) { hrc = VirtualBoxBase::handleUnexpectedExceptions(this, RT_SRC_POS); } LogRelFlow(("{%p} %s: leave *aVisible=%RTbool hrc=%Rhrc\n", this, "MousePointerShapeChangedEvent::getVisible", *aVisible, hrc)); return hrc; }
void executeLook(const char *noun) { if (noun != NULL && strcmp(noun, "around") == 0) { printf("You are in %s.\n", player->location->description); listObjectsAtLocation(player->location); } else { OBJECT *obj = getVisible("what you want to look at", noun); switch (getDistance(player, obj)) { case distHereContained: printf("Hard to see, try to get it first.\n"); break; case distOverthere: printf("Too far away, move closer please.\n"); break; case distNotHere: printf("You don't see any %s here.\n", noun); break; case distUnknownObject: // already handled by getVisible break; default: printf("%s", obj->details); listObjectsAtLocation(obj); } } }
////////////////////////////////////////////////////////////////////////// // PRIVATE SECTION ////////////////////////////////////////////////////////////////////////// void LLOutputMonitorCtrl::notifyParentVisibilityChanged() { LL_DEBUGS("SpeakingIndicator") << "Notify parent that visibility was changed: " << mSpeakerId << ", new_visibility: " << getVisible() << LL_ENDL; LLSD params = LLSD().with("visibility_changed", getVisible()); notifyParent(params); }
void GFlagSelectionView::doDeactivate() { if ( ! getVisible() ) { removeComponents(); loaded = false; } }
void LLScrollingPanelList::draw() { if( getVisible() ) { updatePanelVisiblilty(); } LLUICtrl::draw(); }
// Checked: 2010-04-18 (RLVa-1.3.1c) | Modified: RLVa-1.2.0e void RlvFloaterBehaviours::onAvatarNameLookup(const LLUUID& idAgent, const LLAvatarName& avName) { uuid_vec_t::iterator itLookup = std::find(m_PendingLookup.begin(), m_PendingLookup.end(), idAgent); if (itLookup != m_PendingLookup.end()) m_PendingLookup.erase(itLookup); if (getVisible()) refreshAll(); }
void PopupMenu::cancel(void) { if(getVisible()) { clearSelection(); setVisible(false); producePopupMenuCanceled(PopupMenuEvent::create(PopupMenuRefPtr(this), getSystemTime())); } }