Made Layer::RequestDraw actually request a screen update
Added a second method for ServerFont::SetFamilyAndStyle and added return codes Removed a couple memory leaks git-svn-id: file:///srv/svn/repos/haiku/trunk/current@11262 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
@@ -579,6 +579,7 @@ void Layer::RequestDraw(const BRegion ®, Layer *startFrom)
|
|||||||
fDriver->ConstrainClippingRegion(&fUpdateReg);
|
fDriver->ConstrainClippingRegion(&fUpdateReg);
|
||||||
fDriver->FillRect(fUpdateReg.Frame(), fLayerData->viewcolor);
|
fDriver->FillRect(fUpdateReg.Frame(), fLayerData->viewcolor);
|
||||||
fDriver->ConstrainClippingRegion(NULL);
|
fDriver->ConstrainClippingRegion(NULL);
|
||||||
|
SendUpdateMsg();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
|||||||
@@ -173,9 +173,28 @@ void ServerFont::Height(font_height *fh)
|
|||||||
|
|
||||||
/*!
|
/*!
|
||||||
\brief Sets the ServerFont instance to whatever font is specified
|
\brief Sets the ServerFont instance to whatever font is specified
|
||||||
\param fontID the combination of family and style ID numbers
|
\param familyID ID number of the family to set
|
||||||
|
\param styleID ID number of the style to set
|
||||||
|
\return B_OK if successful, B_ERROR if not
|
||||||
*/
|
*/
|
||||||
void ServerFont::SetFamilyAndStyle(const uint32 &fontID)
|
status_t ServerFont::SetFamilyAndStyle(const uint16 &familyID,const uint16 &styleID)
|
||||||
|
{
|
||||||
|
fontserver->Lock();
|
||||||
|
FontStyle *sty=fontserver->GetStyle(familyID,styleID);
|
||||||
|
fontserver->Unlock();
|
||||||
|
if(!sty)
|
||||||
|
return B_ERROR;
|
||||||
|
|
||||||
|
fStyle=sty;
|
||||||
|
return B_OK;
|
||||||
|
}
|
||||||
|
|
||||||
|
/*!
|
||||||
|
\brief Sets the ServerFont instance to whatever font is specified
|
||||||
|
\param fontID the combination of family and style ID numbers
|
||||||
|
\return B_OK if successful, B_ERROR if not
|
||||||
|
*/
|
||||||
|
status_t ServerFont::SetFamilyAndStyle(const uint32 &fontID)
|
||||||
{
|
{
|
||||||
uint16 style = fontID & 0xFFFF;
|
uint16 style = fontID & 0xFFFF;
|
||||||
uint16 family = (fontID & 0xFFFF0000) >> 16;
|
uint16 family = (fontID & 0xFFFF0000) >> 16;
|
||||||
@@ -183,8 +202,11 @@ void ServerFont::SetFamilyAndStyle(const uint32 &fontID)
|
|||||||
fontserver->Lock();
|
fontserver->Lock();
|
||||||
FontStyle *sty=fontserver->GetStyle(family,style);
|
FontStyle *sty=fontserver->GetStyle(family,style);
|
||||||
fontserver->Unlock();
|
fontserver->Unlock();
|
||||||
if(sty)
|
if(!sty)
|
||||||
fStyle=sty;
|
return B_ERROR;
|
||||||
|
|
||||||
|
fStyle=sty;
|
||||||
|
return B_OK;
|
||||||
}
|
}
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
|
|||||||
@@ -2295,7 +2295,7 @@ void ServerWindow::SendMessageToClient(const BMessage* msg) const
|
|||||||
else
|
else
|
||||||
printf("PANIC: ServerWindow %s: can't flatten message in 'SendMessageToClient()'\n", fTitle.String());
|
printf("PANIC: ServerWindow %s: can't flatten message in 'SendMessageToClient()'\n", fTitle.String());
|
||||||
|
|
||||||
delete buffer;
|
delete [] buffer;
|
||||||
}
|
}
|
||||||
//------------------------------------------------------------------------------
|
//------------------------------------------------------------------------------
|
||||||
|
|
||||||
|
|||||||
@@ -53,7 +53,7 @@ void SendMessage(port_id port, BMessage *message, int32 target)
|
|||||||
if(message->Flatten(buffer,flatsize)==B_OK)
|
if(message->Flatten(buffer,flatsize)==B_OK)
|
||||||
write_port(port, message->what, buffer,flatsize);
|
write_port(port, message->what, buffer,flatsize);
|
||||||
|
|
||||||
delete buffer;
|
delete [] buffer;
|
||||||
delete message;
|
delete message;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user