void compzillaWindow::Resized (PRInt32 x, PRInt32 y, PRInt32 width, PRInt32 height, PRInt32 border) { if (width != mAttr.width || height != mAttr.height || border != mAttr.border_width || mAttr.override_redirect) { if (mIsRedirected) { ReleaseWindow (); mPixmap = XCompositeNameWindowPixmap (mDisplay, mWindow); if (mPixmap == None) return; for (PRUint32 i = mContentNodes.Count() - 1; i != PRUint32(-1); --i) { nsIDOMHTMLCanvasElement *aContent = mContentNodes.ObjectAt (i); aContent->SetWidth (width); aContent->SetHeight (height); } Damaged (NULL); } } mAttr.x = x; mAttr.y = y; mAttr.width = width; mAttr.height = height; mAttr.border_width = border; }
bool ObjectLayer::onContactBegin(PhysicsContact& contact) { auto objectA = static_cast<custom::Object*>(contact.getShapeA()->getBody()->getNode()); auto objectB = static_cast<custom::Object*>(contact.getShapeB()->getBody()->getNode()); if (!objectA || !objectB || !objectA->GetOwner() || !objectB->GetOwner()) { return false; } if (objectA->GetOwner()->GetType() != objectB->GetOwner()->GetType()) { objectA->Damaged(objectB->GetDefInfo().m_Damage); objectB->Damaged(objectA->GetDefInfo().m_Damage); } return true; }
void compzillaWindow::Damaged (XRectangle *rect) { BindWindow (); if (!rect) { XRectangle allrect = { mAttr.x, mAttr.y, mAttr.width, mAttr.height }; Damaged (&allrect); return; } for (PRUint32 i = mContentNodes.Count() - 1; i != PRUint32(-1); --i) { RedrawContentNode (mContentNodes.ObjectAt(i), rect); } }