Class

ScreenSaverView

An abstract class that defines the interface for subclassers to interact with the screen saver infrastructure.

Declaration

@interface ScreenSaverView : NSView

Overview

Screen savers are subclasses of ScreenSaverView, packaged up in bundles and loaded by the screen saver application. (These bundles have a suffix of .saver and are located in the Library/Screen Savers directories of the various file system domains. See File System Overview for information about domains.) ScreenSaverView defines an interface for animating screen savers, instantiating small preview versions of the screen saver view (for display in System Preferences, for example), and for providing a configuration sheet to set various properties of the screen saver. In addition, subclasses can set the animation interval, the backing store of their window, and how the screen transitions to the animation.

There are two main ways to do drawing in a screen saver. You can either do your drawing in the NSView method drawRect:, or you can do your drawing in the ScreenSaverView method animateOneFrame. If you do drawing in drawRect:, you should call setNeedsDisplayInRect: with an argument of YES in animateOneFrame.

Topics

Initializing a ScreenSaverView

- initWithFrame:isPreview:

Initializes a newly allocated ScreenSaverView with frame as its frame rectangle, and sets the value returned by preview to isPreview.

Getting the preferred window behavior

+ backingStoreType

Returns the desired backing store for windows in which the screen saver view will be instantiated.

+ performGammaFade

Indicates whether the screen saver application should perform a gradual screen fade when it starts and stops the animation.

Setting and getting the animation time interval

animationTimeInterval

Sets the time interval between animation frames.

Animating the ScreenSaverView

- startAnimation

Activates the periodic timer that animates the screen saver.

- animateOneFrame

Advances the screen saver’s animation by a single frame.

- stopAnimation

Deactivates the timer that advances the animation.

animating

A Boolean value that indicates if the screen saver is currently animating.

Drawing the ScreenSaverView

- drawRect:

Draws the screen saver view.

preview

A Boolean value that indicates if the screen saver view was created in a size appropriate for use as a preview.

Accessing the configuration sheet

hasConfigureSheet

Returns whether the screen saver has an associated configuration sheet.

configureSheet

Returns the window containing all of the controls to be used for configuring the screen saver.

Relationships

Inherits From