diff --git a/headers/private/interface/TPicture.h b/headers/private/interface/TPicture.h index 0fd876ab5f..98c472e624 100644 --- a/headers/private/interface/TPicture.h +++ b/headers/private/interface/TPicture.h @@ -1,28 +1,14 @@ -//------------------------------------------------------------------------------ -// Copyright (c) 2001-2002, OpenBeOS -// -// Permission is hereby granted, free of charge, to any person obtaining a -// copy of this software and associated documentation files (the "Software"), -// to deal in the Software without restriction, including without limitation -// the rights to use, copy, modify, merge, publish, distribute, sublicense, -// and/or sell copies of the Software, and to permit persons to whom the -// Software is furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in -// all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING -// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER -// DEALINGS IN THE SOFTWARE. -// -// File Name: TPicture.h -// Author: Marc Flerackers (mflerackers@androme.be) -// Description: TPicture is used to create and play picture data. -//------------------------------------------------------------------------------ +/* + * Copyright 2001-2006, Haiku Inc. + * Distributed under the terms of the MIT License. + * + * Authors: + * Marc Flerackers (mflerackers@androme.be) + * Stefano Ceccherini (burton666@libero.it) + */ + +/** PicturePlayer is used to create and play picture data. */ + #ifndef _TPICTURE_H #define _TPICTURE_H @@ -33,11 +19,11 @@ #include -class TPicture { +class PicturePlayer { public: - TPicture(); - TPicture(void *data, int32 size, BList *pictures); -virtual ~TPicture(); + PicturePlayer(); + PicturePlayer(void *data, int32 size, BList *pictures); +virtual ~PicturePlayer(); int16 GetOp(); bool GetBool(); diff --git a/src/kits/interface/Picture.cpp b/src/kits/interface/Picture.cpp index 16e1e54ee9..be9ee87de2 100644 --- a/src/kits/interface/Picture.cpp +++ b/src/kits/interface/Picture.cpp @@ -584,9 +584,9 @@ status_t do_playback(void * data, int32 size, BList* pictures, void **callBackTable, int32 tableEntries, void *user) { - TPicture picture(data, size, pictures); + PicturePlayer player(data, size, pictures); - return picture.Play(callBackTable, tableEntries, user); + return player.Play(callBackTable, tableEntries, user); } diff --git a/src/kits/interface/TPicture.cpp b/src/kits/interface/TPicture.cpp index f3c981a4d9..8d5b8c6437 100644 --- a/src/kits/interface/TPicture.cpp +++ b/src/kits/interface/TPicture.cpp @@ -1,43 +1,19 @@ -//------------------------------------------------------------------------------ -// Copyright (c) 2001-2002, OpenBeOS -// -// Permission is hereby granted, free of charge, to any person obtaining a -// copy of this software and associated documentation files (the "Software"), -// to deal in the Software without restriction, including without limitation -// the rights to use, copy, modify, merge, publish, distribute, sublicense, -// and/or sell copies of the Software, and to permit persons to whom the -// Software is furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in -// all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING -// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER -// DEALINGS IN THE SOFTWARE. -// -// File Name: TPicture.cpp -// Author: Marc Flerackers (mflerackers@androme.be) -// Description: TPicture is used to create and play picture data. -//------------------------------------------------------------------------------ +/* + * Copyright 2001-2006, Haiku Inc. + * Distributed under the terms of the MIT License. + * + * Authors: + * Marc Flerackers (mflerackers@androme.be) + * Stefano Ceccherini (burton666@libero.it) + */ + +/** PicturePlayer is used to create and play picture data. */ -// Standard Includes ----------------------------------------------------------- #include -// System Includes ------------------------------------------------------------- #include #include -// Project Includes ------------------------------------------------------------ - -// Local Includes -------------------------------------------------------------- - -// Local Defines --------------------------------------------------------------- - -// Globals --------------------------------------------------------------------- typedef void (*fnc)(void*); typedef void (*fnc_BPoint)(void*, BPoint); @@ -60,19 +36,21 @@ typedef void (*fnc_PBRecti)(void*, BRect*, int32); typedef void (*fnc_DrawPixels)(void *, BRect, BRect, int32, int32, int32, int32, int32, void*); -//------------------------------------------------------------------------------ -TPicture::TPicture(void *data, int32 size, BList *pictures) + +PicturePlayer::PicturePlayer(void *data, int32 size, BList *pictures) : fData(data, size), fPictures(pictures) { - } -//------------------------------------------------------------------------------ -TPicture::~TPicture() + + +PicturePlayer::~PicturePlayer() { } -//------------------------------------------------------------------------------ -int16 TPicture::GetOp() + + +int16 +PicturePlayer::GetOp() { int16 data; @@ -80,8 +58,10 @@ int16 TPicture::GetOp() return data; } -//------------------------------------------------------------------------------ -bool TPicture::GetBool() + + +bool +PicturePlayer::GetBool() { bool data; @@ -89,8 +69,10 @@ bool TPicture::GetBool() return data; } -//------------------------------------------------------------------------------ -int16 TPicture::GetInt16() + + +int16 +PicturePlayer::GetInt16() { int16 data; @@ -98,8 +80,10 @@ int16 TPicture::GetInt16() return data; } -//------------------------------------------------------------------------------ -int32 TPicture::GetInt32() + + +int32 +PicturePlayer::GetInt32() { int32 data; @@ -107,8 +91,10 @@ int32 TPicture::GetInt32() return data; } -//------------------------------------------------------------------------------ -float TPicture::GetFloat() + + +float +PicturePlayer::GetFloat() { float data; @@ -116,8 +102,10 @@ float TPicture::GetFloat() return data; } -//------------------------------------------------------------------------------ -BPoint TPicture::GetCoord() + + +BPoint +PicturePlayer::GetCoord() { BPoint data; @@ -125,8 +113,10 @@ BPoint TPicture::GetCoord() return data; } -//------------------------------------------------------------------------------ -BRect TPicture::GetRect() + + +BRect +PicturePlayer::GetRect() { BRect data; @@ -134,8 +124,10 @@ BRect TPicture::GetRect() return data; } -//------------------------------------------------------------------------------ -rgb_color TPicture::GetColor() + + +rgb_color +PicturePlayer::GetColor() { rgb_color data; @@ -143,13 +135,17 @@ rgb_color TPicture::GetColor() return data; } -//------------------------------------------------------------------------------ -void TPicture::GetData(void *data, int32 size) + + +void +PicturePlayer::GetData(void *data, int32 size) { fData.Read(data, size); } -//------------------------------------------------------------------------------ -status_t TPicture::Play(void **callBackTable, int32 tableEntries, void *userData) + + +status_t +PicturePlayer::Play(void **callBackTable, int32 tableEntries, void *userData) { // TODO: we should probably check if the functions in the table are not 0 // before calling them. @@ -482,6 +478,3 @@ status_t TPicture::Play(void **callBackTable, int32 tableEntries, void *userData return B_OK; } -//------------------------------------------------------------------------------ - - diff --git a/src/servers/app/ServerPicture.cpp b/src/servers/app/ServerPicture.cpp index 36f30828b6..e48eff0464 100644 --- a/src/servers/app/ServerPicture.cpp +++ b/src/servers/app/ServerPicture.cpp @@ -611,6 +611,6 @@ ServerPicture::SyncState(ViewLayer *view) void ServerPicture::Play(ViewLayer *view) { - TPicture picture(const_cast(fData.Buffer()), fData.BufferLength(), NULL); - picture.Play(const_cast(tableEntries), sizeof(tableEntries) / sizeof(void *), view); + PicturePlayer player(const_cast(fData.Buffer()), fData.BufferLength(), NULL); + player.Play(const_cast(tableEntries), sizeof(tableEntries) / sizeof(void *), view); }