screen_savers/Shelf: Fix build in DEBUG mode.
This commit is contained in:
@@ -57,11 +57,11 @@ class Shelf : public BScreenSaver
|
||||
};
|
||||
|
||||
|
||||
BScreenSaver *instantiate_screen_saver(BMessage *msg, image_id image)
|
||||
{
|
||||
BScreenSaver *instantiate_screen_saver(BMessage *msg, image_id image)
|
||||
{
|
||||
PRINT(("%s()\n", __FUNCTION__));
|
||||
return new Shelf(msg, image);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Shelf::Shelf(BMessage *archive, image_id id)
|
||||
@@ -95,8 +95,8 @@ Shelf::Shelf(BMessage *archive, image_id id)
|
||||
*/}
|
||||
|
||||
|
||||
void
|
||||
Shelf::StartConfig(BView *view)
|
||||
void
|
||||
Shelf::StartConfig(BView *view)
|
||||
{
|
||||
PRINT(("%p:%s()\n", this, __FUNCTION__));
|
||||
fInConfig = true;
|
||||
@@ -134,7 +134,7 @@ Shelf::StartConfig(BView *view)
|
||||
B_UNTYPED_WINDOW, B_NOT_MOVABLE | B_NOT_CLOSABLE | B_NOT_ZOOMABLE
|
||||
| B_NOT_MINIMIZABLE | B_NOT_RESIZABLE | B_AVOID_FRONT | B_AVOID_FOCUS);
|
||||
|
||||
BView *shelfView = new BView(fConfigWindow->Bounds(), "ShelfView",
|
||||
BView *shelfView = new BView(fConfigWindow->Bounds(), "ShelfView",
|
||||
B_FOLLOW_NONE, B_WILL_DRAW | B_FRAME_EVENTS);
|
||||
shelfView->SetViewColor(216, 216, 216, 0);
|
||||
|
||||
@@ -153,12 +153,12 @@ Shelf::StartConfig(BView *view)
|
||||
fConfigWindow->Unlock();
|
||||
|
||||
//"\nDrop replicants on me!"
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
void
|
||||
void
|
||||
Shelf::StopConfig()
|
||||
{
|
||||
{
|
||||
fInConfig = false;
|
||||
PRINT(("%p:%s()\n", this, __FUNCTION__));
|
||||
fConfigWindow->Lock();
|
||||
@@ -166,10 +166,10 @@ Shelf::StopConfig()
|
||||
fShelf = NULL;
|
||||
|
||||
BScreenSaver::StopConfig();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
status_t
|
||||
status_t
|
||||
Shelf::StartSaver(BView *view, bool preview)
|
||||
{
|
||||
PRINT(("%p:%s(, %d)\n", this, __FUNCTION__, preview));
|
||||
@@ -177,13 +177,13 @@ Shelf::StartSaver(BView *view, bool preview)
|
||||
view->SetViewColor(216, 216, 216, 0);
|
||||
fShelfData.Seek(SEEK_SET, 0LL);
|
||||
fShelf = new BShelf(&fShelfData, view);
|
||||
|
||||
|
||||
}
|
||||
BString s;
|
||||
s << "preview: " << preview << " ";
|
||||
s << "BView:Name: " << view->Name() << " ";
|
||||
s << "BApp:Name: " << be_app->Name();
|
||||
|
||||
|
||||
PRINT(("%p:%s:%s\n", this, __FUNCTION__, s.String()));
|
||||
//BAlert *a = new BAlert("debug", s.String(), "Ok");
|
||||
//a->Go();
|
||||
@@ -191,12 +191,12 @@ Shelf::StartSaver(BView *view, bool preview)
|
||||
#if 0
|
||||
float width = view->Bounds().Width();
|
||||
float height = view->Bounds().Height();
|
||||
|
||||
|
||||
BFont font;
|
||||
view->GetFont(&font);
|
||||
font.SetSize(height / 2.5);
|
||||
view->SetFont(&font);
|
||||
|
||||
|
||||
BRect rect;
|
||||
escapement_delta delta;
|
||||
delta.nonspace = 0;
|
||||
@@ -207,7 +207,7 @@ Shelf::StartSaver(BView *view, bool preview)
|
||||
fLine1Start.Set((width - rect.Width()) / 2, y);
|
||||
font.GetBoundingBoxesForStrings(&fLine2, 1, B_SCREEN_METRIC, &delta, &rect);
|
||||
fLine2Start.Set((width - rect.Width()) / 2, y + rect.Height() + height / 10);
|
||||
|
||||
|
||||
#endif
|
||||
return B_OK;
|
||||
}
|
||||
@@ -223,7 +223,7 @@ Shelf::StopSaver()
|
||||
}
|
||||
|
||||
|
||||
status_t
|
||||
status_t
|
||||
Shelf::SaveState(BMessage *state) const
|
||||
{
|
||||
status_t status;
|
||||
@@ -243,7 +243,7 @@ Shelf::SaveState(BMessage *state) const
|
||||
fShelf->UnlockLooper();
|
||||
if (status < B_OK)
|
||||
return status;
|
||||
status = state->AddData(kShelfArchiveName, 'shlf', fShelfData.Buffer(),
|
||||
status = state->AddData(kShelfArchiveName, 'shlf', fShelfData.Buffer(),
|
||||
fShelfData.BufferLength());
|
||||
|
||||
// return B_OK;
|
||||
@@ -257,7 +257,7 @@ Shelf::SaveState(BMessage *state) const
|
||||
fShelf->SetSaveLocation((BDataIO *)NULL);
|
||||
if (status < B_OK)
|
||||
return status;
|
||||
status = state->AddData(kShelfArchiveName, 'shlf', mio.Buffer(),
|
||||
status = state->AddData(kShelfArchiveName, 'shlf', mio.Buffer(),
|
||||
mio.BufferLength());
|
||||
#endif
|
||||
if (status < B_OK)
|
||||
@@ -267,16 +267,16 @@ Shelf::SaveState(BMessage *state) const
|
||||
}
|
||||
|
||||
|
||||
void
|
||||
void
|
||||
Shelf::Draw(BView *view, int32 frame)
|
||||
{
|
||||
PRINT(("%p:%s(, %d)\n", this, __FUNCTION__, frame));
|
||||
PRINT(("%p:%s(, %" B_PRId32 ")\n", this, __FUNCTION__, frame));
|
||||
BScreenSaver::Draw(view, frame);
|
||||
#if 0
|
||||
if (frame == 0) {
|
||||
if (frame == 0) {
|
||||
// fill with blue on first frame
|
||||
view->SetLowColor(kMediumBlue);
|
||||
view->FillRect(view->Bounds(), B_SOLID_LOW);
|
||||
view->SetLowColor(kMediumBlue);
|
||||
view->FillRect(view->Bounds(), B_SOLID_LOW);
|
||||
|
||||
// Set tick size to 500,000 microseconds = 0.5 second
|
||||
SetTickSize(500000);
|
||||
|
||||
Reference in New Issue
Block a user