mirror of https://github.com/BOINC/boinc.git
New Mac screensaver uses Quartz APIs, not deprecated QuickDraw, works more like Windows saver.
svn path=/trunk/boinc/; revision=14743
This commit is contained in:
parent
87804b8236
commit
560ae25d55
|
@ -1269,7 +1269,7 @@ Rom Feb 7 2008
|
|||
log_flags.C, .h
|
||||
|
||||
Charlie Feb 7 2008
|
||||
- MGR: If use shuts down connected client, don't auto-relaunch it.
|
||||
- MGR: If user shuts down connected client, don't auto-relaunch it.
|
||||
|
||||
clientgui/
|
||||
MainDocument.cpp,h
|
||||
|
@ -1380,3 +1380,19 @@ David Feb 13 2008
|
|||
create_account_action.php
|
||||
create_account_form.php
|
||||
login_form.php
|
||||
|
||||
Charlie Feb 14 2008
|
||||
- MAC SCR: Use Quartz drawing instead of deprecated QuickDraw APIs.
|
||||
Show moving logo with text underneath like Windows screensaver
|
||||
instead of horizontally scrolling banner text.
|
||||
|
||||
clientscr/
|
||||
mac_saver_module.cpp,h
|
||||
Mac_Saver_Module.h
|
||||
screensaver.cpp
|
||||
res/
|
||||
boinc_ss_logo.png (new)
|
||||
gridrepublic_ss_logo.png (new)
|
||||
mac_build/
|
||||
boinc.xcodeproj/
|
||||
project.pbxproj
|
||||
|
|
|
@ -33,9 +33,11 @@ extern "C" {
|
|||
#endif
|
||||
|
||||
int initBOINCSaver(Boolean ispreview);
|
||||
int drawGraphics(GrafPtr aPort);
|
||||
int drawGraphics(char **theMessage);
|
||||
void drawPreview(GrafPtr aPort);
|
||||
void closeBOINCSaver(void);
|
||||
void print_to_log_file(const char *format, ...);
|
||||
void strip_cr(char *buf);
|
||||
|
||||
#ifdef __cplusplus
|
||||
} // extern "C"
|
||||
|
@ -69,7 +71,6 @@ protected:
|
|||
void setBannerText(const char *msg, GrafPtr aPort);
|
||||
void updateBannerText(char *msg, GrafPtr aPort);
|
||||
void drawBanner(GrafPtr aPort);
|
||||
void print_to_log_file(const char *format, ...);
|
||||
void strip_cr(char *buf);
|
||||
char m_gfx_Switcher_Path[MAXPATHLEN];
|
||||
bool m_bErrorMode; // Whether to display an error
|
||||
|
@ -129,10 +130,10 @@ protected:
|
|||
char m_MsgBuf[2048];
|
||||
char m_BannerText[2048];
|
||||
int m_BannerWidth;
|
||||
StringPtr m_CurrentBannerMessage;
|
||||
char* m_CurrentBannerMessage;
|
||||
char* m_BrandText;
|
||||
public:
|
||||
int drawGraphics(GrafPtr aPort);
|
||||
int drawGraphics(char **theMessage);
|
||||
void drawPreview(GrafPtr aPort);
|
||||
void ShutdownSaver();
|
||||
|
||||
|
|
|
@ -45,7 +45,7 @@
|
|||
|
||||
void setFrame(Rect *frame);
|
||||
int initBOINCSaver(Boolean ispreview);
|
||||
int drawGraphics(GrafPtr aPort);
|
||||
int drawGraphics(char **theMessage);
|
||||
void drawPreview(GrafPtr aPort);
|
||||
void closeBOINCSaver(void);
|
||||
void displayText(const unsigned char *s, GrafPtr aPort);
|
||||
|
|
|
@ -23,66 +23,123 @@
|
|||
//
|
||||
|
||||
#import "Mac_Saver_ModuleView.h"
|
||||
#include <Carbon/Carbon.h>
|
||||
|
||||
void print_to_log_file(const char *format, ...);
|
||||
void strip_cr(char *buf);
|
||||
|
||||
int gGoToBlank; // True if we are to blank the screen
|
||||
int gBlankingTime; // Delay in minutes before blanking the screen
|
||||
NSString *gPathToBundleResources;
|
||||
NSImage *gBOINC_Logo;
|
||||
|
||||
NSRect gMovingRect;
|
||||
float gImageXIndent;
|
||||
float gTextBoxHeight;
|
||||
NSPoint gCurrentPosition;
|
||||
NSPoint gCurrentDelta;
|
||||
|
||||
ATSUStyle theStyle;
|
||||
ATSUFontID theFontID;
|
||||
Fixed atsuSize;
|
||||
char myFontName[] = "Helvetica";
|
||||
//char myFontName[] = "Lucida Blackletter";
|
||||
|
||||
ATSUAttributeTag theTags[] = { kATSUFontTag, kATSUSizeTag };
|
||||
ByteCount theSizes[] = { sizeof (ATSUFontID), sizeof(Fixed) };
|
||||
ATSUAttributeValuePtr theValues[] = { &theFontID, &atsuSize };
|
||||
|
||||
CGContextRef myContext;
|
||||
bool isErased;
|
||||
|
||||
#define TEXTBOXMINWIDTH 400.0
|
||||
#define MINTEXTBOXHEIGHT 40.0
|
||||
#define MAXTEXTBOXHEIGHT 300.0
|
||||
#define TEXTBOXTOPBORDER 10
|
||||
#define SAFETYBORDER 20.0
|
||||
#define MINDELTA 8
|
||||
#define MAXDELTA 20
|
||||
|
||||
int signof(float x) {
|
||||
return (x > 0.0 ? 1 : -1);
|
||||
}
|
||||
|
||||
@implementation BOINC_Saver_ModuleView
|
||||
|
||||
- (id)initWithFrame:(NSRect)frame isPreview:(BOOL)isPreview {
|
||||
NSQuickDrawView * myQDView;
|
||||
NSBundle * myBundle;
|
||||
OSStatus err;
|
||||
|
||||
self = [ super initWithFrame:frame isPreview:isPreview ];
|
||||
if (self) {
|
||||
myBundle = [ NSBundle bundleForClass:[self class]];
|
||||
// grab the screensaver defaults
|
||||
mBundleID = [ myBundle bundleIdentifier ];
|
||||
if (gBOINC_Logo == NULL) {
|
||||
if (self) {
|
||||
myBundle = [ NSBundle bundleForClass:[self class]];
|
||||
// grab the screensaver defaults
|
||||
mBundleID = [ myBundle bundleIdentifier ];
|
||||
|
||||
// Path to our copy of switcher utility application in this screensaver bundle
|
||||
gPathToBundleResources = [ myBundle resourcePath ];
|
||||
|
||||
ScreenSaverDefaults *defaults = [ ScreenSaverDefaults defaultsForModuleWithName:mBundleID ];
|
||||
|
||||
// try to load the version key, used to see if we have any saved settings
|
||||
mVersion = [defaults floatForKey:@"version"];
|
||||
if (!mVersion) {
|
||||
// no previous settings so define our defaults
|
||||
mVersion = 1;
|
||||
gGoToBlank = NO;
|
||||
gBlankingTime = 1;
|
||||
// Path to our copy of switcher utility application in this screensaver bundle
|
||||
gPathToBundleResources = [ myBundle resourcePath ];
|
||||
|
||||
// write out the defaults
|
||||
[ defaults setInteger:mVersion forKey:@"version" ];
|
||||
[ defaults setInteger:gGoToBlank forKey:@"GoToBlank" ];
|
||||
[ defaults setInteger:gBlankingTime forKey:@"BlankingTime" ];
|
||||
ScreenSaverDefaults *defaults = [ ScreenSaverDefaults defaultsForModuleWithName:mBundleID ];
|
||||
|
||||
// synchronize
|
||||
[defaults synchronize];
|
||||
// try to load the version key, used to see if we have any saved settings
|
||||
mVersion = [defaults floatForKey:@"version"];
|
||||
if (!mVersion) {
|
||||
// no previous settings so define our defaults
|
||||
mVersion = 1;
|
||||
gGoToBlank = NO;
|
||||
gBlankingTime = 1;
|
||||
|
||||
// write out the defaults
|
||||
[ defaults setInteger:mVersion forKey:@"version" ];
|
||||
[ defaults setInteger:gGoToBlank forKey:@"GoToBlank" ];
|
||||
[ defaults setInteger:gBlankingTime forKey:@"BlankingTime" ];
|
||||
|
||||
// synchronize
|
||||
[defaults synchronize];
|
||||
}
|
||||
|
||||
// set defaults...
|
||||
gGoToBlank = [ defaults integerForKey:@"GoToBlank" ];
|
||||
gBlankingTime = [ defaults integerForKey:@"BlankingTime" ];
|
||||
|
||||
[ self setAutoresizesSubviews:YES ]; // make sure the subview resizes.
|
||||
|
||||
NSString *fileName = [[ NSBundle bundleForClass:[ self class ]] pathForImageResource:@"boinc_ss_logo" ];
|
||||
if (! fileName) {
|
||||
// What should we do in this case?
|
||||
return self;
|
||||
}
|
||||
|
||||
gBOINC_Logo = [[ NSImage alloc ] initWithContentsOfFile:fileName ];
|
||||
gMovingRect.origin.x = 0.0;
|
||||
gMovingRect.origin.y = 0.0;
|
||||
gMovingRect.size = [gBOINC_Logo size];
|
||||
|
||||
if (gMovingRect.size.width < TEXTBOXMINWIDTH) {
|
||||
gImageXIndent = (TEXTBOXMINWIDTH - gMovingRect.size.width) / 2;
|
||||
gMovingRect.size.width = TEXTBOXMINWIDTH;
|
||||
} else {
|
||||
gImageXIndent = 0.0;
|
||||
}
|
||||
gTextBoxHeight = MINTEXTBOXHEIGHT;
|
||||
gMovingRect.size.height += gTextBoxHeight;
|
||||
gCurrentPosition.x = SAFETYBORDER + 1;
|
||||
gCurrentPosition.y = SAFETYBORDER + 1 + gTextBoxHeight;
|
||||
gCurrentDelta.x = 1.0;
|
||||
gCurrentDelta.y = 1.0;
|
||||
|
||||
[ self setAnimationTimeInterval:1/8.0 ];
|
||||
|
||||
ATSUFindFontFromName(myFontName, strlen(myFontName), kFontFamilyName, kFontMacintoshPlatform,
|
||||
kFontNoScriptCode, kFontNoLanguageCode, &theFontID);
|
||||
|
||||
err = ATSUCreateStyle(&theStyle);
|
||||
atsuSize = Long2Fix (24);
|
||||
err = ATSUSetAttributes(theStyle, 2, theTags, theSizes, theValues);
|
||||
}
|
||||
|
||||
// set defaults...
|
||||
gGoToBlank = [ defaults integerForKey:@"GoToBlank" ];
|
||||
gBlankingTime = [ defaults integerForKey:@"BlankingTime" ];
|
||||
|
||||
myQDView = [[ NSQuickDrawView alloc ] initWithFrame:frame ];
|
||||
if (!myQDView) {
|
||||
[ self autorelease ];
|
||||
return nil;
|
||||
}
|
||||
|
||||
[ self setAutoresizesSubviews:YES ]; // make sure the subview resizes.
|
||||
[ self addSubview:myQDView ];
|
||||
[ myQDView release ];
|
||||
if (isPreview)
|
||||
previewQDView = myQDView;
|
||||
else
|
||||
mainQDView = myQDView;
|
||||
|
||||
[ self setAnimationTimeInterval:1/8.0 ];
|
||||
}
|
||||
|
||||
|
||||
return self;
|
||||
}
|
||||
|
||||
|
@ -115,12 +172,17 @@ NSString *gPathToBundleResources;
|
|||
}
|
||||
|
||||
- (void)animateOneFrame {
|
||||
int newFrequency;
|
||||
int newFrequency = 0;
|
||||
NSRect theFrame = [ self frame ];
|
||||
Point p = { 0, 0 };
|
||||
NSRect currentDrawingRect, eraseRect;
|
||||
NSPoint imagePosition;
|
||||
Rect r;
|
||||
char *msg;
|
||||
CFStringRef cf_msg;
|
||||
AbsoluteTime timeToUnblock, frameStartTime = UpTime();
|
||||
OSStatus err;
|
||||
|
||||
if ([ self isPreview ]) {
|
||||
if ([ self isPreview ]) {
|
||||
#if 1 // Currently drawRect just draws our logo in the preview window
|
||||
NSString *fileName = [[ NSBundle bundleForClass:[ self class ]] pathForImageResource:@"boinc" ];
|
||||
if (fileName) {
|
||||
|
@ -132,36 +194,147 @@ NSString *gPathToBundleResources;
|
|||
}
|
||||
[ self setAnimationTimeInterval:1/1.0 ];
|
||||
#else // Code for possible future use if we want to draw more in preview
|
||||
[ previewQDView lockFocus ];
|
||||
drawPreview([ previewQDView qdPort ]);
|
||||
[ previewQDView unlockFocus ];
|
||||
QDFlushPortBuffer([ previewQDView qdPort ], nil);
|
||||
myContext = [[NSGraphicsContext currentContext] graphicsPort];
|
||||
drawPreview(myContext);
|
||||
[ self setAnimationTimeInterval:1/30.0 ];
|
||||
#endif
|
||||
return;
|
||||
}
|
||||
|
||||
[ mainQDView lockFocus ];
|
||||
LocalToGlobal(&p);
|
||||
if ((p.h != 0) || (p.v != 0)) {
|
||||
[ mainQDView unlockFocus ];
|
||||
|
||||
|
||||
myContext = [[NSGraphicsContext currentContext] graphicsPort];
|
||||
// [myContext retain];
|
||||
|
||||
NSWindow *myWindow = [ self window ];
|
||||
NSRect windowFrame = [ myWindow frame ];
|
||||
if ( (windowFrame.origin.x != 0) || (windowFrame.origin.y != 0) ) {
|
||||
// Hide window on second display to aid in debugging
|
||||
// [[[ NSView focusView] window ] setLevel:kCGMinimumWindowLevel ];
|
||||
[[[ NSView focusView] window ] setLevel:kCGMinimumWindowLevel ];
|
||||
return; // We draw only to main screen
|
||||
}
|
||||
|
||||
NSRect viewBounds = [self bounds];
|
||||
|
||||
newFrequency = drawGraphics(&msg);
|
||||
|
||||
// Clear the previous drawing area
|
||||
currentDrawingRect = gMovingRect;
|
||||
currentDrawingRect.origin.x = (float) ((int)gCurrentPosition.x);
|
||||
currentDrawingRect.origin.y += (float) ((int)gCurrentPosition.y - gTextBoxHeight);
|
||||
|
||||
if ( (msg != NULL) && (msg[0] != '\0') ) {
|
||||
|
||||
// Set direction of motion to "bounce" off edges of screen
|
||||
if (currentDrawingRect.origin.x <= SAFETYBORDER) {
|
||||
gCurrentDelta.x = (float)SSRandomIntBetween(MINDELTA, MAXDELTA) / 8.;
|
||||
gCurrentDelta.y = (float)(SSRandomIntBetween(MINDELTA, MAXDELTA) * signof(gCurrentDelta.y)) / 8.;
|
||||
}
|
||||
if ( (currentDrawingRect.origin.x + currentDrawingRect.size.width) >=
|
||||
(viewBounds.origin.x + viewBounds.size.width - SAFETYBORDER) ) {
|
||||
gCurrentDelta.x = -(float)SSRandomIntBetween(MINDELTA, MAXDELTA) / 8.;
|
||||
gCurrentDelta.y = (float)(SSRandomIntBetween(MINDELTA, MAXDELTA) * signof(gCurrentDelta.y)) / 8.;
|
||||
}
|
||||
if (currentDrawingRect.origin.y <= SAFETYBORDER) {
|
||||
gCurrentDelta.y = (float)SSRandomIntBetween(MINDELTA, MAXDELTA) / 8.;
|
||||
gCurrentDelta.x = (float)(SSRandomIntBetween(MINDELTA, MAXDELTA) * signof(gCurrentDelta.x)) / 8.;
|
||||
}
|
||||
if ( (currentDrawingRect.origin.y + currentDrawingRect.size.height) >=
|
||||
(viewBounds.origin.y + viewBounds.size.height - SAFETYBORDER) ) {
|
||||
gCurrentDelta.y = -(float)SSRandomIntBetween(MINDELTA, MAXDELTA) / 8.;
|
||||
gCurrentDelta.x = (float)(SSRandomIntBetween(MINDELTA, MAXDELTA) * signof(gCurrentDelta.x)) / 8.;
|
||||
}
|
||||
|
||||
#if 0
|
||||
// For testing
|
||||
gCurrentDelta.x = 0;
|
||||
gCurrentDelta.y = 0;
|
||||
#endif
|
||||
|
||||
if (!isErased) {
|
||||
[[NSColor blackColor] set];
|
||||
|
||||
imagePosition.x = (float) ((int)gCurrentPosition.x + gImageXIndent);
|
||||
imagePosition.y = (float) (int)gCurrentPosition.y;
|
||||
eraseRect.origin.y = imagePosition.y;
|
||||
eraseRect.size.height = currentDrawingRect.size.height - gTextBoxHeight;
|
||||
|
||||
if (gCurrentDelta.x > 0) {
|
||||
eraseRect.origin.x = imagePosition.x - 1;
|
||||
eraseRect.size.width = gCurrentDelta.x + 1;
|
||||
} else {
|
||||
eraseRect.origin.x = currentDrawingRect.origin.x + currentDrawingRect.size.width - gImageXIndent + gCurrentDelta.x - 1;
|
||||
eraseRect.size.width = -gCurrentDelta.x + 1;
|
||||
}
|
||||
|
||||
eraseRect = NSInsetRect(eraseRect, -1, -1);
|
||||
NSRectFill(eraseRect);
|
||||
|
||||
eraseRect.origin.x = imagePosition.x;
|
||||
eraseRect.size.width = currentDrawingRect.size.width - gImageXIndent - gImageXIndent;
|
||||
|
||||
if (gCurrentDelta.y > 0) {
|
||||
eraseRect.origin.y = imagePosition.y;
|
||||
eraseRect.size.height = gCurrentDelta.y + 1;
|
||||
} else {
|
||||
eraseRect.origin.y = imagePosition.y + currentDrawingRect.size.height - gTextBoxHeight - 1;
|
||||
eraseRect.size.height = -gCurrentDelta.y + 1;
|
||||
}
|
||||
eraseRect = NSInsetRect(eraseRect, -1, -1);
|
||||
NSRectFill(eraseRect);
|
||||
|
||||
eraseRect = currentDrawingRect;
|
||||
eraseRect.size.height = gTextBoxHeight;
|
||||
NSRectFill(eraseRect);
|
||||
|
||||
isErased = true;
|
||||
}
|
||||
|
||||
// Get the new drawing area
|
||||
gCurrentPosition.x += gCurrentDelta.x;
|
||||
gCurrentPosition.y += gCurrentDelta.y;
|
||||
|
||||
imagePosition.x = (float) ((int)gCurrentPosition.x + gImageXIndent);
|
||||
imagePosition.y = (float) (int)gCurrentPosition.y;
|
||||
|
||||
// Calculate QuickDraw Rect for current text box
|
||||
r.left = (float) ((int)gCurrentPosition.x);
|
||||
r.right = r.left + gMovingRect.size.width;
|
||||
r.top = viewBounds.size.height - imagePosition.y;
|
||||
r.bottom = r.top + (int)MAXTEXTBOXHEIGHT;
|
||||
r.top += TEXTBOXTOPBORDER; // Add a few pixels space below image
|
||||
|
||||
TXNTextBoxOptionsData theOptions = {kTXNUseCGContextRefMask, kATSUStartAlignment,
|
||||
kATSUNoJustification, 0, myContext };
|
||||
|
||||
cf_msg = CFStringCreateWithCString(NULL, msg, kCFStringEncodingMacRoman);
|
||||
|
||||
[[NSColor whiteColor] set];
|
||||
|
||||
[ gBOINC_Logo compositeToPoint:imagePosition operation:NSCompositeCopy ];
|
||||
|
||||
err = TXNDrawCFStringTextBox ( cf_msg, &r, theStyle, &theOptions);
|
||||
gTextBoxHeight = r.bottom - r.top + TEXTBOXTOPBORDER;
|
||||
gMovingRect.size.height = [gBOINC_Logo size].height + gTextBoxHeight;
|
||||
|
||||
CFRelease(cf_msg);
|
||||
isErased = false;
|
||||
|
||||
} else { // Empty or NULL message
|
||||
if (!isErased) {
|
||||
eraseRect = NSInsetRect(currentDrawingRect, -1, -1);
|
||||
[[NSColor blackColor] set];
|
||||
isErased = true;
|
||||
NSRectFill(eraseRect);
|
||||
gTextBoxHeight = MAXTEXTBOXHEIGHT;
|
||||
gMovingRect.size.height = [gBOINC_Logo size].height + gTextBoxHeight;
|
||||
}
|
||||
}
|
||||
|
||||
newFrequency = drawGraphics([ mainQDView qdPort ]);
|
||||
[ mainQDView unlockFocus ];
|
||||
QDFlushPortBuffer([ mainQDView qdPort ], nil);
|
||||
if (newFrequency)
|
||||
[ self setAnimationTimeInterval:(1.0/newFrequency) ];
|
||||
// setAnimationTimeInterval does not seem to be working, so we
|
||||
// throttle the screensaver directly here.
|
||||
timeToUnblock = AddDurationToAbsolute(durationSecond/newFrequency,
|
||||
frameStartTime);
|
||||
MPDelayUntil(&timeToUnblock);
|
||||
|
||||
timeToUnblock = AddDurationToAbsolute(durationSecond/newFrequency, frameStartTime);
|
||||
MPDelayUntil(&timeToUnblock);
|
||||
}
|
||||
|
||||
- (BOOL)hasConfigureSheet {
|
||||
|
@ -211,5 +384,4 @@ NSString *gPathToBundleResources;
|
|||
[ NSApp endSheet:mConfigureSheet ];
|
||||
}
|
||||
|
||||
|
||||
@end
|
||||
|
|
|
@ -41,13 +41,6 @@
|
|||
#include "screensaver.h"
|
||||
|
||||
//#include <drivers/event_status_driver.h>
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
#ifdef __cplusplus
|
||||
} // extern "C"
|
||||
#endif
|
||||
|
||||
// It would be nice to always display the scrolled progress info in case the
|
||||
// graphics application fails to show its window, but displaying the scrolled
|
||||
|
@ -57,19 +50,9 @@ extern "C" {
|
|||
// Flags for testing & debugging
|
||||
#define CREATE_LOG 1
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
void print_to_log_file(const char *format, ...);
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
|
||||
void strip_cr(char *buf);
|
||||
#endif
|
||||
|
||||
#define BANNER_GAP 30 /* Space between repeats of banner text */
|
||||
#define BANNERDELTA 2 /* Number of pixels to move banner each frame */
|
||||
#define BANNERFREQUENCY 90 /* Number of times per second to scroll banner */
|
||||
#define BANNERFREQUENCY 30 /* Number of times per second to update text and logo */
|
||||
#define NOBANNERFREQUENCY 4 /* Times per second to call drawGraphics if no banner */
|
||||
#define STATUSUPDATEINTERVAL 5 /* seconds between status display updates */
|
||||
#define TASK_RUN_CHECK_PERIOD 5 /* Seconds between safety check that task is actually running */
|
||||
|
@ -125,8 +108,8 @@ int initBOINCSaver(Boolean ispreview) {
|
|||
return gspScreensaver->Create();
|
||||
}
|
||||
|
||||
int drawGraphics(GrafPtr aPort) {
|
||||
return gspScreensaver->drawGraphics(aPort);
|
||||
int drawGraphics(char **theMessage) {
|
||||
return gspScreensaver->drawGraphics(theMessage);
|
||||
};
|
||||
|
||||
|
||||
|
@ -300,9 +283,10 @@ OSStatus CScreensaver::initBOINCApp() {
|
|||
|
||||
|
||||
// Returns new desired Animation Frequency (per second) or 0 for no change
|
||||
int CScreensaver::drawGraphics(GrafPtr aPort) {
|
||||
CGrafPtr savePort;
|
||||
GDHandle saveGDH;
|
||||
int CScreensaver::drawGraphics(char **theMessage) {
|
||||
CGrafPtr aPort = NULL;
|
||||
// CGrafPtr savePort;
|
||||
// GDHandle saveGDH;
|
||||
int newFrequency = 15;
|
||||
pid_t myPid;
|
||||
OSStatus err;
|
||||
|
@ -407,14 +391,17 @@ int CScreensaver::drawGraphics(GrafPtr aPort) {
|
|||
} // end switch (saverState)
|
||||
|
||||
if (m_BannerText[0]) {
|
||||
#if 0
|
||||
GetGWorld(&savePort, &saveGDH);
|
||||
SetPort(aPort);
|
||||
drawBanner(aPort);
|
||||
SetGWorld(savePort, saveGDH);
|
||||
#endif
|
||||
newFrequency = BANNERFREQUENCY;
|
||||
} else
|
||||
newFrequency = NOBANNERFREQUENCY;
|
||||
|
||||
*theMessage = m_BannerText;
|
||||
return newFrequency;
|
||||
}
|
||||
|
||||
|
@ -570,19 +557,20 @@ void CScreensaver::setBannerText(const char * msg, GrafPtr aPort) {
|
|||
if (msg == 0)
|
||||
m_BannerText[0] = 0;
|
||||
|
||||
if ((char *)m_CurrentBannerMessage != msg)
|
||||
if (m_CurrentBannerMessage != msg)
|
||||
updateBannerText((char *)msg, aPort);
|
||||
}
|
||||
|
||||
|
||||
void CScreensaver::updateBannerText(char *msg, GrafPtr aPort) {
|
||||
CGrafPtr savePort;
|
||||
RGBColor saveBackColor;
|
||||
Rect wRect;
|
||||
// CGrafPtr savePort;
|
||||
// RGBColor saveBackColor;
|
||||
// Rect wRect;
|
||||
char *p, *s;
|
||||
|
||||
m_CurrentBannerMessage = (StringPtr)msg;
|
||||
m_CurrentBannerMessage = msg;
|
||||
|
||||
#if 0
|
||||
if (aPort == NULL)
|
||||
return;
|
||||
|
||||
|
@ -595,10 +583,13 @@ void CScreensaver::updateBannerText(char *msg, GrafPtr aPort) {
|
|||
BackColor ( blackColor );
|
||||
EraseRect(&wRect);
|
||||
RGBBackColor(&saveBackColor);
|
||||
#endif
|
||||
|
||||
if (msg) {
|
||||
#if 0
|
||||
TextSize(24);
|
||||
TextFace(bold);
|
||||
#endif
|
||||
s = msg;
|
||||
m_BannerText[0] = '\0';
|
||||
do {
|
||||
|
@ -612,12 +603,15 @@ void CScreensaver::updateBannerText(char *msg, GrafPtr aPort) {
|
|||
}
|
||||
} while (p);
|
||||
|
||||
#if 0
|
||||
m_BannerWidth = TextWidth(m_BannerText, 0, strlen(m_BannerText)) + BANNER_GAP;
|
||||
// Round up m_BannerWidth to an integral multiple of BANNERDELTA
|
||||
m_BannerWidth = ((m_BannerWidth + BANNERDELTA - 1) / BANNERDELTA) * BANNERDELTA;
|
||||
#endif
|
||||
}
|
||||
|
||||
SetPort(savePort);
|
||||
// SetPort(savePort);
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
@ -791,7 +785,7 @@ OSErr CScreensaver::KillScreenSaver() {
|
|||
}
|
||||
|
||||
|
||||
void CScreensaver::print_to_log_file(const char *format, ...) {
|
||||
void print_to_log_file(const char *format, ...) {
|
||||
#if CREATE_LOG
|
||||
FILE *f;
|
||||
va_list args;
|
||||
|
@ -823,7 +817,7 @@ void CScreensaver::print_to_log_file(const char *format, ...) {
|
|||
}
|
||||
|
||||
#if CREATE_LOG
|
||||
void CScreensaver::strip_cr(char *buf)
|
||||
void strip_cr(char *buf)
|
||||
{
|
||||
char *theCR;
|
||||
|
||||
|
|
Binary file not shown.
After Width: | Height: | Size: 12 KiB |
Binary file not shown.
After Width: | Height: | Size: 7.5 KiB |
|
@ -230,6 +230,7 @@
|
|||
DDA6BD2D0BD4551F008F7921 /* QTaskMemory.c in Sources */ = {isa = PBXBuildFile; fileRef = DDA6BD100BD4551F008F7921 /* QTaskMemory.c */; };
|
||||
DDAEC9FF07FA5A5C00A7BC36 /* SetVersion.C in Sources */ = {isa = PBXBuildFile; fileRef = DDAEC9E707FA58A000A7BC36 /* SetVersion.C */; };
|
||||
DDB693500ABFE9C600689FD8 /* procinfo_mac.C in Sources */ = {isa = PBXBuildFile; fileRef = DDB6934F0ABFE9C600689FD8 /* procinfo_mac.C */; };
|
||||
DDB6E3EF0D5B27AA00ED12B8 /* Carbon.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 20286C33FDCF999611CA2CEA /* Carbon.framework */; };
|
||||
DDB873990C85072500E0DE1F /* mac_saver_module.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DDB873960C85072500E0DE1F /* mac_saver_module.cpp */; };
|
||||
DDB8739A0C85072500E0DE1F /* Mac_Saver_ModuleView.m in Sources */ = {isa = PBXBuildFile; fileRef = DDB873980C85072500E0DE1F /* Mac_Saver_ModuleView.m */; };
|
||||
DDB873EE0C850BC800E0DE1F /* gutil.C in Sources */ = {isa = PBXBuildFile; fileRef = DD40825507D3076400163EF5 /* gutil.C */; };
|
||||
|
@ -242,6 +243,7 @@
|
|||
DDB873F70C850BC800E0DE1F /* str_util.C in Sources */ = {isa = PBXBuildFile; fileRef = DD7BF7D70B8E7A9800A009F7 /* str_util.C */; };
|
||||
DDB874470C850D3000E0DE1F /* graphics2_unix.C in Sources */ = {isa = PBXBuildFile; fileRef = DDB874450C850D3000E0DE1F /* graphics2_unix.C */; };
|
||||
DDB874480C850D3000E0DE1F /* graphics2.C in Sources */ = {isa = PBXBuildFile; fileRef = DDB874460C850D3000E0DE1F /* graphics2.C */; };
|
||||
DDBC6CA50D5D458700564C49 /* boinc_ss_logo.png in Resources */ = {isa = PBXBuildFile; fileRef = DDBC6CA40D5D458700564C49 /* boinc_ss_logo.png */; };
|
||||
DDBD51760C169B770074905B /* LoginItemAPI.c in Sources */ = {isa = PBXBuildFile; fileRef = DD1277BE081F3E73007B5DE1 /* LoginItemAPI.c */; };
|
||||
DDBE74390C03B1C600453BB8 /* cs_platforms.C in Sources */ = {isa = PBXBuildFile; fileRef = DDBE74380C03B1C600453BB8 /* cs_platforms.C */; };
|
||||
DDC3D55E0D507D1700BE6D23 /* BOINCClientManager.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DDC3D55C0D507D1700BE6D23 /* BOINCClientManager.cpp */; };
|
||||
|
@ -796,6 +798,7 @@
|
|||
DDB874450C850D3000E0DE1F /* graphics2_unix.C */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; name = graphics2_unix.C; path = ../api/graphics2_unix.C; sourceTree = SOURCE_ROOT; };
|
||||
DDB874460C850D3000E0DE1F /* graphics2.C */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; name = graphics2.C; path = ../api/graphics2.C; sourceTree = SOURCE_ROOT; };
|
||||
DDB8D5A5081FC8C700A5A1E8 /* postinstall */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = text.script.csh; name = postinstall; path = ../mac_installer/postinstall; sourceTree = SOURCE_ROOT; };
|
||||
DDBC6CA40D5D458700564C49 /* boinc_ss_logo.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = boinc_ss_logo.png; path = ../clientscr/res/boinc_ss_logo.png; sourceTree = SOURCE_ROOT; };
|
||||
DDBDF4A90987091800464F83 /* ValidateEmailAddress.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; name = ValidateEmailAddress.cpp; path = ../clientgui/ValidateEmailAddress.cpp; sourceTree = SOURCE_ROOT; };
|
||||
DDBDF4AA0987091800464F83 /* ValidateEmailAddress.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; name = ValidateEmailAddress.h; path = ../clientgui/ValidateEmailAddress.h; sourceTree = SOURCE_ROOT; };
|
||||
DDBE74380C03B1C600453BB8 /* cs_platforms.C */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; name = cs_platforms.C; path = ../client/cs_platforms.C; sourceTree = SOURCE_ROOT; };
|
||||
|
@ -984,6 +987,7 @@
|
|||
buildActionMask = 2147483647;
|
||||
files = (
|
||||
DD130E740820C422001A0291 /* ScreenSaver.framework in Frameworks */,
|
||||
DDB6E3EF0D5B27AA00ED12B8 /* Carbon.framework in Frameworks */,
|
||||
);
|
||||
runOnlyForDeploymentPostprocessing = 0;
|
||||
};
|
||||
|
@ -1085,6 +1089,7 @@
|
|||
isa = PBXGroup;
|
||||
children = (
|
||||
DD0C5A8A0816711400CEC5D7 /* boinc.jpg */,
|
||||
DDBC6CA40D5D458700564C49 /* boinc_ss_logo.png */,
|
||||
DDF3028907CCCE2C00701169 /* BOINCMgr.icns */,
|
||||
DD531BC50C193D3800742E50 /* MacInstaller.icns */,
|
||||
DD531BC70C193D5200742E50 /* MacUninstaller.icns */,
|
||||
|
@ -1944,6 +1949,7 @@
|
|||
DD616A3008150050006981C1 /* InfoPlist.strings in Resources */,
|
||||
DD0C5A8B0816711400CEC5D7 /* boinc.jpg in Resources */,
|
||||
DD48091F081A66F100A174AA /* BOINCSaver.nib in Resources */,
|
||||
DDBC6CA50D5D458700564C49 /* boinc_ss_logo.png in Resources */,
|
||||
);
|
||||
runOnlyForDeploymentPostprocessing = 0;
|
||||
};
|
||||
|
|
Loading…
Reference in New Issue