#import <DownAndOutView.h>
Collaboration diagram for DownAndOutView:

It is responsible for drawing the saver content, and for maintaining the state machine that brings the saver through the logout countdown, through application shutdown, to logout.
Definition at line 39 of file DownAndOutView.h.
Public Member Functions | |
| (float) | - clockRadius |
| Getter of the clock-radius property. | |
| (void) | - setClockRadius: |
| Setter for the clock-radius property. | |
| (void) | - setDeadlineForSeconds: [implementation] |
Sets the deadline object, signifying when logout is to begin, for a given number of seconds in the future. | |
| (void) | - resetClock [implementation] |
| Return the clock to the set time-to-logout. | |
| (id) | - initWithFrame:isPreview: [implementation] |
| Designated initializer, inherited from ScreenSaverView. | |
| (void) | - dealloc [implementation] |
| Unremarkable deallocator. | |
| (void) | - fillTextImageWithSeconds: [implementation] |
| Compose the image for the textual portion of the screen-saver content, given a countdown time. | |
| (void) | - fillTextImageWithString: [implementation] |
| Compose the image for the textual portion of the screen-saver content from a string. | |
| (NSRect) | - addedImageRect [implementation] |
| Calculate the size and placement of an image added to the content. | |
| (void) | - startAnimation [implementation] |
| Beginning of the animation cycle. | |
| (void) | - stopAnimation [implementation] |
| Stop the animation timer. | |
| (void) | - drawPieCenter:proportion:radius:color: [implementation] |
| Draw a circle filled clockwise by a given proportion. | |
| (void) | - fillPieImageInner:outer: [implementation] |
| Draw the clock-like device with given inner and outer proportions. | |
| (void) | - drawRect: [implementation] |
| Draw the screen-saver content to the screen. | |
| (void) | - animateOneFrame [implementation] |
| Advance the screen-saver animation by one frame; manage logout tasks. | |
| (BOOL) | - hasConfigureSheet [implementation] |
| Affirms that DownAndOut[tm] has a configuration sheet. | |
| (NSWindow *) | - configureSheet [implementation] |
| Returns the configuration sheet for DownAndOut[tm]. | |
Protected Attributes | |
| NSDate * | deadline |
| when application shutdown is to begin | |
| DownAndOutController * | controller |
| controls the configuration panel, manages logout tasks | |
| NSRect | contentRect |
| size of the nonblack content drawn by this view | |
| NSPoint | velocity |
| random delta of content position between frames | |
| DOState | state |
| what task is being done (countdown, quitting, logout...) | |
| NSImage * | pieImage |
| the stylized-clock subimage of the content | |
| NSImage * | textImage |
| the textual subimage of the content | |
| int | secondsLeft |
| rounded-down countdown, in seconds | |
| float | clockRadius |
| radius of stylized clock, determines size of content | |
|
|
Calculate the size and placement of an image added to the content. It goes on the left end of the content, is the size of the image if that is no taller than the content; otherwise it is the content height, and proportionally wide. If there is no added image, the returned rectangle is of no width.
Definition at line 147 of file DownAndOutView.m. References DownAndOutController::addedImage, contentRect, and controller. Referenced by drawRect:, and startAnimation. |
|
|
Advance the screen-saver animation by one frame; manage logout tasks. initWithFrame:isPreview: sets the animation interval to 0.05 seconds.
This method overrides animateOneFrame in ScreenSaverView, which is a no-op. It does no drawing, but does update the NSImages that are the only things drawRect: puts on the screen. Definition at line 308 of file DownAndOutView.m. References contentRect, controller, DAApplication::countApplications, deadline, fillPieImageInner:outer:, fillTextImageWithSeconds:, fillTextImageWithString:, DownAndOutController::killApplications, DownAndOutController::logOut, DownAndOutController::makeTouchFile, DownAndOutController::quitApplications, resetClock, secondsLeft, setDeadlineForSeconds:, state, and velocity. |
|
|
Getter of the clock-radius property. This property determines the size, in pixels, of the content image. The height of the image is twice the radius; the width is three more than seven times the radius (from which you may infer that the text is allotted five radii in width by two in height).
Referenced by initWithFrame:isPreview:, and setClockRadius:. |
|
|
Returns the configuration sheet for DownAndOut[tm]. Loads DownAndOut.nib from the saver's bundle, and makes the DownAndOutController the owner of the NIB. Overrides the do-nothing method in ScreenSaverView.
Definition at line 396 of file DownAndOutView.m. References controller, and DownAndOutController::panel. |
|
||||||||||||||||||||
|
Draw a circle filled clockwise by a given proportion. The filled area increases clockwise from straight up. The edge of the unfilled area is stroked in the same color as the filled area, and filled with black.
Definition at line 218 of file DownAndOutView.m. Referenced by fillPieImageInner:outer:. |
|
|
Draw the screen-saver content to the screen. This method fills the screen with black, then composites the added image (if any) and the prepared clock and text images in the animated destination.
Definition at line 278 of file DownAndOutView.m. References DownAndOutController::addedImage, addedImageRect, controller, pieImage, and textImage. |
|
||||||||||||
|
Draw the clock-like device with given inner and outer proportions. This method knows how to place drawPieCenter:proportion:radius:color: in the clock image, so that the seconds (outer) circle is drawn first, in blue, and the minutes (inner) circle is drawn second, in red. The result is drawn in the pieImage instance variable.
Definition at line 259 of file DownAndOutView.m. References drawPieCenter:proportion:radius:color:, and pieImage. Referenced by animateOneFrame. |
|
|
Compose the image for the textual portion of the screen-saver content, given a countdown time. Passes the given number of seconds to the controller, which has the chosen template, and access to the necessary substitutions. Renders the text in the attributes chosen in setClockRadius: (half-radius Times italic, light gray).
Definition at line 111 of file DownAndOutView.m. References controller, DownAndOutController::messageTextForSeconds:, and textImage. Referenced by animateOneFrame. |
|
|
Compose the image for the textual portion of the screen-saver content from a string. Renders the string in the attributes chosen in setClockRadius: (half-radius Times italic, light gray).
Definition at line 130 of file DownAndOutView.m. References textImage. Referenced by animateOneFrame. |
|
|
Affirms that DownAndOut[tm] has a configuration sheet. This overrides the default provided in ScreenSaverView.
Definition at line 388 of file DownAndOutView.m. |
|
||||||||||||
|
Designated initializer, inherited from ScreenSaverView. Sets the animation rate to twenty-per-second, and creates a controller object which will load default (or preferred) parameters for the view.
Definition at line 59 of file DownAndOutView.m. References clockRadius, controller, and state. |
|
|
Return the clock to the set time-to-logout. Used when DownAndOut[tm] runs in the System Preferences preview, so that when the countdown timer runs out, it loops back rather than trying to log the user out. Definition at line 48 of file DownAndOutView.m. References controller, DownAndOutController::secondsBeforeLogout, and setDeadlineForSeconds:. Referenced by animateOneFrame, and startAnimation. |
|
|
Setter for the clock-radius property. The document for the getter method clockRadius explains how this property determines the height and width of the drawn element of the screen-saver content.
Definition at line 78 of file DownAndOutView.m. References clockRadius, pieImage, and textImage. |
|
|
Sets the
Definition at line 39 of file DownAndOutView.m. References deadline, and secondsLeft. Referenced by animateOneFrame, and resetClock. |
|
|
Beginning of the animation cycle. Inherited from ScreenSaverView, and the super method must be called. Here, if the content moves, we select the initial position and velocity of the content. Definition at line 177 of file DownAndOutView.m. References addedImageRect, contentRect, controller, resetClock, and velocity. |
|
|
Stop the animation timer. Inherited from ScreenSaverView, and the super method must be called. This method releases the NSDate that marks the beginning of the logout process. Definition at line 204 of file DownAndOutView.m. References deadline. |
1.4.4