Removed PicturePlayer, it only contains code duplicated from TPicture. Some cleanups for BPicture. This commit also completes previous commit for BMenu
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@16002 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
parent
ffa2503b55
commit
9e8d2dd28b
@ -23,31 +23,20 @@
|
||||
// Author: Marc Flerackers (mflerackers@androme.be)
|
||||
// Description: TPicture is used to create and play picture data.
|
||||
//------------------------------------------------------------------------------
|
||||
|
||||
#ifndef _TPICTURE_H
|
||||
#define _TPICTURE_H
|
||||
|
||||
// Standard Includes -----------------------------------------------------------
|
||||
|
||||
// System Includes -------------------------------------------------------------
|
||||
#include <GraphicsDefs.h>
|
||||
#include <Point.h>
|
||||
#include <Rect.h>
|
||||
#include <DataIO.h>
|
||||
|
||||
// Project Includes ------------------------------------------------------------
|
||||
|
||||
// Local Includes --------------------------------------------------------------
|
||||
|
||||
// Local Defines ---------------------------------------------------------------
|
||||
|
||||
// Globals ---------------------------------------------------------------------
|
||||
|
||||
// TPicture class --------------------------------------------------------------
|
||||
class TPicture {
|
||||
public:
|
||||
TPicture();
|
||||
TPicture(void *data, int32 size, BList &pictures);
|
||||
TPicture(void *data, int32 size, BList *pictures);
|
||||
virtual ~TPicture();
|
||||
|
||||
int16 GetOp();
|
||||
@ -109,10 +98,10 @@ virtual ~TPicture();
|
||||
private:
|
||||
BMemoryIO fData;
|
||||
int32 fSize;
|
||||
BList &fPictures;
|
||||
BList *fPictures;
|
||||
};
|
||||
//------------------------------------------------------------------------------
|
||||
|
||||
//status_t do_playback(void *, long, BArray<BPicture *> &, void **, long, void *)
|
||||
status_t do_playback(void *, long, BList *, void **, long, void *);
|
||||
|
||||
#endif // _TPICTURE_H
|
||||
|
@ -196,11 +196,14 @@ BMenuItem::SetLabel(const char *string)
|
||||
void
|
||||
BMenuItem::SetEnabled(bool state)
|
||||
{
|
||||
if (fSubmenu != NULL)
|
||||
fSubmenu->SetEnabled(state);
|
||||
if (fEnabled == state)
|
||||
return;
|
||||
|
||||
fEnabled = state;
|
||||
|
||||
if (fSubmenu != NULL)
|
||||
fSubmenu->SetEnabled(state);
|
||||
|
||||
BMenu *menu = Menu();
|
||||
if (menu != NULL && menu->LockLooper()) {
|
||||
menu->Invalidate(fBounds);
|
||||
|
@ -71,10 +71,6 @@ private:
|
||||
};
|
||||
|
||||
|
||||
status_t do_playback(void * data, int32 size, BList& pictures,
|
||||
void **callBackTable, int32 tableEntries, void *user);
|
||||
|
||||
|
||||
BPicture::BPicture()
|
||||
:
|
||||
token(-1),
|
||||
@ -265,7 +261,8 @@ BPicture::Play(void **callBackTable, int32 tableEntries, void *user)
|
||||
if (!assert_local_copy())
|
||||
return B_ERROR;
|
||||
|
||||
return do_playback(const_cast<void *>(extent->Data()), extent->Size(), extent->Pictures(),
|
||||
BList &pictures = extent->Pictures();
|
||||
return do_playback(const_cast<void *>(extent->Data()), extent->Size(), &pictures,
|
||||
callBackTable, tableEntries, user);
|
||||
}
|
||||
|
||||
@ -584,7 +581,7 @@ BPicture::step_down()
|
||||
|
||||
|
||||
status_t
|
||||
do_playback(void * data, int32 size, BList& pictures,
|
||||
do_playback(void * data, int32 size, BList* pictures,
|
||||
void **callBackTable, int32 tableEntries, void *user)
|
||||
{
|
||||
TPicture picture(data, size, pictures);
|
||||
|
@ -61,7 +61,7 @@ typedef void (*fnc_DrawPixels)(void *, BRect, BRect, int32, int32, int32,
|
||||
int32, int32, void*);
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
TPicture::TPicture(void *data, int32 size, BList &pictures)
|
||||
TPicture::TPicture(void *data, int32 size, BList *pictures)
|
||||
: fData(data, size),
|
||||
fPictures(pictures)
|
||||
{
|
||||
|
@ -36,7 +36,6 @@ Server app_server :
|
||||
OffscreenServerWindow.cpp
|
||||
OffscreenWindowLayer.cpp
|
||||
PNGDump.cpp
|
||||
PicturePlayer.cpp
|
||||
RAMLinkMsgReader.cpp
|
||||
RGBColor.cpp
|
||||
ScreenManager.cpp
|
||||
|
@ -611,6 +611,6 @@ ServerPicture::SyncState(ViewLayer *view)
|
||||
void
|
||||
ServerPicture::Play(ViewLayer *view)
|
||||
{
|
||||
//TPicture picture((void *)fData.Buffer(), fData.BufferLength(), NULL);
|
||||
//picture.Play((void *)tableEntries, sizeof(tableEntries) / sizeof(void*), view);
|
||||
TPicture picture(const_cast<void *>(fData.Buffer()), fData.BufferLength(), NULL);
|
||||
picture.Play(const_cast<void **>(tableEntries), sizeof(tableEntries) / sizeof(void *), view);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user