/* * Copyright 2001-2019, Haiku. * Distributed under the terms of the MIT License. * * Authors: * DarkWyrm * Stefano Ceccherini * Julian Harnath * Stephan Aßmus */ #ifndef SERVER_PICTURE_H #define SERVER_PICTURE_H #include #include #include #include class BFile; class Canvas; class ServerApp; class ServerFont; class View; namespace BPrivate { class LinkReceiver; class PortLink; } class BList; class ServerPicture : public BReferenceable, public PictureDataWriter { public: ServerPicture(); ServerPicture(const ServerPicture& other); ServerPicture(const char* fileName, int32 offset); virtual ~ServerPicture(); int32 Token() { return fToken; } bool SetOwner(ServerApp* owner); ServerApp* Owner() const { return fOwner; } bool ReleaseClientReference(); void EnterStateChange(); void ExitStateChange(); void SyncState(Canvas* canvas); void WriteFontState(const ServerFont& font, uint16 mask); void Play(Canvas* target); void PushPicture(ServerPicture* picture); ServerPicture* PopPicture(); void AppendPicture(ServerPicture* picture); bool NestPicture(ServerPicture* picture); off_t DataLength() const; status_t ImportData(BPrivate::LinkReceiver& link); status_t ExportData(BPrivate::PortLink& link); private: friend class PictureBoundingBoxPlayer; typedef BObjectList PictureList; int32 fToken; BFile* fFile; BPositionIO* fData; PictureList* fPictures; ServerPicture* fPushed; ServerApp* fOwner; }; #endif // SERVER_PICTURE_H