Added Create/DeletePicture to ServerApp
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@15802 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
@@ -2536,7 +2536,20 @@ ServerApp::CountPictures() const
|
|||||||
|
|
||||||
|
|
||||||
ServerPicture *
|
ServerPicture *
|
||||||
ServerApp::FindPicture(int32 token) const
|
ServerApp::CreatePicture(int32 *token)
|
||||||
|
{
|
||||||
|
ServerPicture *picture = new (nothrow) ServerPicture();
|
||||||
|
if (picture != NULL) {
|
||||||
|
fPictureList.AddItem(picture);
|
||||||
|
if (token != NULL)
|
||||||
|
*token = picture->Token();
|
||||||
|
}
|
||||||
|
return picture;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
ServerPicture *
|
||||||
|
ServerApp::FindPicture(const int32 &token) const
|
||||||
{
|
{
|
||||||
// TODO: we need to make sure the picture is ours?!
|
// TODO: we need to make sure the picture is ours?!
|
||||||
ServerPicture* picture;
|
ServerPicture* picture;
|
||||||
@@ -2547,6 +2560,22 @@ ServerApp::FindPicture(int32 token) const
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
bool
|
||||||
|
ServerApp::DeletePicture(const int32 &token)
|
||||||
|
{
|
||||||
|
ServerPicture *picture = FindPicture(token);
|
||||||
|
if (picture == NULL)
|
||||||
|
return false;
|
||||||
|
|
||||||
|
if (!fPictureList.RemoveItem(picture))
|
||||||
|
return false;
|
||||||
|
|
||||||
|
delete picture;
|
||||||
|
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
team_id
|
team_id
|
||||||
ServerApp::ClientTeam() const
|
ServerApp::ClientTeam() const
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -71,7 +71,9 @@ class ServerApp : public MessageLooper {
|
|||||||
ServerBitmap *FindBitmap(int32 token) const;
|
ServerBitmap *FindBitmap(int32 token) const;
|
||||||
|
|
||||||
int32 CountPictures() const;
|
int32 CountPictures() const;
|
||||||
ServerPicture *FindPicture(int32 token) const;
|
ServerPicture *CreatePicture(int32 *token = NULL);
|
||||||
|
ServerPicture *FindPicture(const int32 &token) const;
|
||||||
|
bool DeletePicture(const int32 &token);
|
||||||
|
|
||||||
AreaPool *AppAreaPool() { return &fSharedMem; }
|
AreaPool *AppAreaPool() { return &fSharedMem; }
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user