Icons Screensaver: Style fixes only

This commit is contained in:
John Scipione
2014-01-22 20:39:37 -05:00
parent 05cf63e3a7
commit 3cbb1132f8
3 changed files with 27 additions and 17 deletions
@@ -10,6 +10,7 @@
#ifndef ICON_DISPLAY_H #ifndef ICON_DISPLAY_H
#define ICON_DISPLAY_H #define ICON_DISPLAY_H
#include <Rect.h> #include <Rect.h>
#include <View.h> #include <View.h>
@@ -45,4 +46,5 @@ private:
BRect fFrame; BRect fFrame;
}; };
#endif
#endif // ICON_DISPLAY_H
@@ -23,6 +23,7 @@
#include "IconDisplay.h" #include "IconDisplay.h"
#undef B_TRANSLATION_CONTEXT #undef B_TRANSLATION_CONTEXT
#define B_TRANSLATION_CONTEXT "Screensaver Icons" #define B_TRANSLATION_CONTEXT "Screensaver Icons"
@@ -36,16 +37,19 @@
const rgb_color kBackgroundColor = ui_color(B_DESKTOP_COLOR); const rgb_color kBackgroundColor = ui_color(B_DESKTOP_COLOR);
BScreenSaver* instantiate_screen_saver(BMessage* msg, image_id image) BScreenSaver* instantiate_screen_saver(BMessage* msg, image_id image)
{ {
return new IconsSaver(msg, image); return new IconsSaver(msg, image);
} }
IconsSaver::IconsSaver(BMessage* msg, image_id image) // #pragma mark - IconsSaver
IconsSaver::IconsSaver(BMessage* archive, image_id image)
: :
BScreenSaver(msg, image), BScreenSaver(archive, image),
fVectorIconsCount(0),
fIcons(NULL), fIcons(NULL),
fBackBitmap(NULL), fBackBitmap(NULL),
fBackView(NULL), fBackView(NULL),
@@ -142,7 +146,7 @@ IconsSaver::Draw(BView *view, int32 frame)
{ {
static int32 previousFrame = 0; static int32 previousFrame = 0;
// Update drawing // update drawing
if (fBackBitmap->Lock()) { if (fBackBitmap->Lock()) {
for (uint8 i = 0 ; i < MAX_ICONS ; i++) { for (uint8 i = 0 ; i < MAX_ICONS ; i++) {
fIcons[i].ClearOn(fBackView); fIcons[i].ClearOn(fBackView);
@@ -157,7 +161,7 @@ IconsSaver::Draw(BView *view, int32 frame)
fBackBitmap->Unlock(); fBackBitmap->Unlock();
} }
// Sync the view with the back buffer // sync the view with the back buffer
view->DrawBitmap(fBackBitmap); view->DrawBitmap(fBackBitmap);
previousFrame = frame; previousFrame = frame;
+6 -2
View File
@@ -10,6 +10,7 @@
#ifndef ICONS_SAVER_H #ifndef ICONS_SAVER_H
#define ICONS_SAVER_H #define ICONS_SAVER_H
#include <List.h> #include <List.h>
#include <ScreenSaver.h> #include <ScreenSaver.h>
@@ -37,7 +38,10 @@ private:
BBitmap* fBackBitmap; BBitmap* fBackBitmap;
BView* fBackView; BView* fBackView;
uint16 fMinSize, fMaxSize;
uint16 fMinSize;
uint16 fMaxSize;
}; };
#endif
#endif // ICONS_SAVER_H