void HFAEntry::SetName( const char *pszNodeName ) { memset( szName, 0, 64 ); strncpy( szName, pszNodeName, 64 ); MarkDirty(); }
/** make SourceRGB go closer to DestRGB */ void Button::CloseUpColor() { if (!starttime) return; //using the realtime timer, because i don't want to //handle Game at this point unsigned long newtime; newtime = GetTickCount(); if (newtime<starttime) { return; } MarkDirty(); Color nc; nc.r = (SourceRGB.r + DestRGB.r) / 2; nc.g = (SourceRGB.g + DestRGB.g) / 2; nc.b = (SourceRGB.b + DestRGB.b) / 2; nc.a = (SourceRGB.a + DestRGB.a) / 2; if (SourceRGB.r == nc.r && SourceRGB.g == nc.g && SourceRGB.b == nc.b && SourceRGB.a == nc.a) { SourceRGB = DestRGB; starttime = 0; return; } SourceRGB = nc; starttime = newtime + 40; }
nsresult CacheFileMetadata::SetHash(uint32_t aIndex, CacheHash::Hash16_t aHash) { LOG(("CacheFileMetadata::SetHash() [this=%p, idx=%d, hash=%x]", this, aIndex, aHash)); MarkDirty(); MOZ_ASSERT(aIndex <= mHashCount); if (aIndex > mHashCount) { return NS_ERROR_INVALID_ARG; } else if (aIndex == mHashCount) { if ((aIndex + 1) * sizeof(CacheHash::Hash16_t) > mHashArraySize) { // reallocate hash array buffer if (mHashArraySize == 0) { mHashArraySize = kInitialHashArraySize * sizeof(CacheHash::Hash16_t); } else { mHashArraySize *= 2; } mHashArray = static_cast<CacheHash::Hash16_t *>( moz_xrealloc(mHashArray, mHashArraySize)); } mHashCount++; } NetworkEndian::writeUint16(&mHashArray[aIndex], aHash); DoMemoryReport(MemoryUsage()); return NS_OK; }
nsLineBox::nsLineBox(nsIFrame* aFrame, int32_t aCount, bool aIsBlock) : mFirstChild(aFrame) // NOTE: memory is already zeroed since we allocate with AllocateByObjectID. { MOZ_COUNT_CTOR(nsLineBox); #ifdef DEBUG ++ctorCount; NS_ASSERTION(!aIsBlock || aCount == 1, "Blocks must have exactly one child"); nsIFrame* f = aFrame; for (int32_t n = aCount; n > 0; f = f->GetNextSibling(), --n) { NS_ASSERTION(aIsBlock == f->IsBlockOutside(), "wrong kind of child frame"); } #endif static_assert(NS_STYLE_CLEAR_LAST_VALUE <= 15, "FlagBits needs more bits to store the full range of " "break type ('clear') values"); #if NS_STYLE_CLEAR_NONE > 0 mFlags.mBreakType = NS_STYLE_CLEAR_NONE; #endif mChildCount = aCount; MarkDirty(); mFlags.mBlock = aIsBlock; }
nsLineBox::nsLineBox(nsIFrame* aFrame, PRInt32 aCount, PRBool aIsBlock) : mFirstChild(aFrame), mBounds(0, 0, 0, 0), mAscent(0), mData(nsnull) { MOZ_COUNT_CTOR(nsLineBox); #ifdef DEBUG ++ctorCount; NS_ASSERTION(!aIsBlock || aCount == 1, "Blocks must have exactly one child"); nsIFrame* f = aFrame; for (PRInt32 n = aCount; n > 0; f = f->GetNextSibling(), --n) { NS_ASSERTION(aIsBlock == f->GetStyleDisplay()->IsBlockOutside(), "wrong kind of child frame"); } #endif mAllFlags = 0; #if NS_STYLE_CLEAR_NONE > 0 mFlags.mBreakType = NS_STYLE_CLEAR_NONE; #endif SetChildCount(aCount); MarkDirty(); mFlags.mBlock = aIsBlock; }
/** Special Key Press */ bool TextEdit::OnSpecialKeyPress(unsigned char Key) { MarkDirty(); switch (Key) { case GEM_HOME: CurPos = 0; break; case GEM_END: CurPos = Text.length(); break; case GEM_LEFT: if (CurPos > 0) CurPos--; break; case GEM_RIGHT: if (CurPos < Text.length()) { CurPos++; } break; case GEM_DELETE: if (CurPos < Text.length()) { Text.erase(CurPos, 1); } break; case GEM_BACKSP: if (CurPos != 0) { Text.erase(--CurPos, 1); } break; case GEM_RETURN: RunEventHandler( EditOnDone ); } RunEventHandler( EditOnChange ); return true; }
/** Sets the Text of the current control */ void TextEdit::SetText(const char* string) { int len = strlcpy( ( char * ) Buffer, string, max + 1 ); if (len > max) CurPos = max + 1; else CurPos = len; MarkDirty(); }
static void MonCbStreamReplace(mon_stream_t *ms, unsigned int new_sid) { assert( ms != NULL ); ms->state = ST_REPLACED; ms->sid = new_sid; MarkDirty(ms); }
void Node::SetScale(const Vector3& scale) { scale_ = scale.Abs(); MarkDirty(); MarkNetworkUpdate(); }
void Node::Scale(const Vector3& scale) { scale_ *= scale; MarkDirty(); MarkNetworkUpdate(); }
void Node::TranslateRelative(const Vector3& delta) { position_ += rotation_ * delta; MarkDirty(); MarkNetworkUpdate(); }
/** Sets the Text of the current control */ void TextEdit::SetText(const String& string) { Text = string; if (Text.length() > max) CurPos = max + 1; else CurPos = Text.length(); MarkDirty(); }
void Node::SetPosition(const Vector3& position) { position_ = position; MarkDirty(); MarkNetworkUpdate(); }
void HFAEntry::SetName( const char *pszNodeName ) { memset( szName, 0, sizeof(szName) ); strncpy( szName, pszNodeName, sizeof(szName) ); szName[sizeof(szName)-1] = '\0'; MarkDirty(); }
/** Sets the Picture */ void Button::SetPicture(Sprite2D* newpic) { Sprite2D::FreeSprite( Picture ); ClearPictureList(); Picture = newpic; MarkDirty(); Flags |= IE_GUI_BUTTON_PICTURE; }
/** Set Cursor */ void TextEdit::SetCursor(Sprite2D* cur) { core->GetVideoDriver()->FreeSprite( Cursor ); if (cur != NULL) { Cursor = cur; } MarkDirty(); }
void Sprite::SetHotSpot(const IntVector2& hotSpot) { if (hotSpot != hotSpot_) { hotSpot_ = hotSpot; MarkDirty(); } }
/** * @pre ms != NULL */ static void MonCbStreamWriteFinish(mon_stream_t *ms) { assert( ms != NULL ); ms->counter++; ms->strevt_flags |= ST_MOVED; MarkDirty(ms); }
/** * @pre ms != NULL */ static void MonCbStreamClose(mon_stream_t *ms) { assert( ms != NULL ); ms->state = ST_CLOSED; MarkDirty(ms); /* do not free ms, as it will be kept until its monintoring information has been output via dirty list upon TaskStop() */ }
void Sprite::SetRotation(float angle) { if (angle != rotation_) { rotation_ = angle; MarkDirty(); } }
void Node::SetRotation(const Quaternion& rotation) { rotation_ = rotation; rotateCount_ = 0; MarkDirty(); MarkNetworkUpdate(); }
void Sprite::SetScale(const Vector2& scale) { if (scale != scale_) { scale_ = scale; MarkDirty(); } }
/** Clears the list of Pictures */ void Button::ClearPictureList() { for (std::list<Sprite2D*>::iterator iter = PictureList.begin(); iter != PictureList.end(); ++iter) Sprite2D::FreeSprite( *iter ); PictureList.clear(); MarkDirty(); }
/** Set BackGround */ void TextEdit::SetBackGround(Sprite2D* back) { //if 'back' is NULL then no BackGround will be drawn if (Back) core->GetVideoDriver()->FreeSprite(Back); Back = back; MarkDirty(); }
/** Sets the Picture */ void Button::SetPicture(Sprite2D* newpic) { core->GetVideoDriver()->FreeSprite( Picture ); ClearPictureList(); Picture = newpic; MarkDirty(); Flags |= IE_GUI_BUTTON_PICTURE; }
/** Sets the actual Progressbar Position trimming to the Max and Min Values */ void Progressbar::SetPosition(unsigned int pos) { if(pos>100) pos=100; if (Value == pos) return; Value = pos; MarkDirty(); }
/** Set BackGround */ void TextEdit::SetBackGround(Sprite2D* back) { //if 'back' is NULL then no BackGround will be drawn if (Back) Sprite2D::FreeSprite(Back); Back = back; MarkDirty(); }
/** Set Cursor */ void TextEdit::SetCursor(Sprite2D* cur) { Sprite2D::FreeSprite( Cursor ); if (cur != NULL) { Cursor = cur; } MarkDirty(); }
/** Clears the list of Pictures */ void Button::ClearPictureList() { Video* video = core->GetVideoDriver(); for (std::list<Sprite2D*>::iterator iter = PictureList.begin(); iter != PictureList.end(); ++iter) video->FreeSprite( *iter ); PictureList.clear(); MarkDirty(); }
/** Set Font */ void TextEdit::SetFont(Font* f) { if (f != NULL) { font = f; MarkDirty(); return; } Log(ERROR, "TextEdit", "Invalid font set!"); }