Screen Saver Functions Reference

Framework
ScreenSaver/ScreenSaver.h
Declared in
ScreenSaverView.h

Overview

This chapter describes functions and function-like macros available in the Screen Saver framework.

Several of the functions produce random values. These make use of the C random number generator, random(), which the screen saver framework will automatically seed.

Functions by Task

Random Numbers

Rectangles

Functions

SSCenteredRectInRect

This function returns a rectangle.

static NSRect SSCenteredRectInRect (
   NSRect innerRect,
   NSRect outerRect
);
Discussion

Returns a rectangle, based on centering innerRect within outerRect.

Availability
  • Available in OS X v10.0 and later.
Declared In
ScreenSaverView.h

SSRandomFloatBetween

This function returns a random float value.

static float SSRandomFloatBetween (
   CGFloat a,
   CGFloat b
);
Discussion

Returns a random float value between the values a and b, inclusive.

Availability
  • Available in OS X v10.0 and later.
Declared In
ScreenSaverView.h

SSRandomIntBetween

This function returns a random integer value.

static int SSRandomIntBetween (
   int a,
   int b
);
Discussion

Returns a random integer value between the values a and b, inclusive.

Availability
  • Available in OS X v10.0 and later.
Declared In
ScreenSaverView.h

SSRandomPointForSizeWithinRect

This function returns a random point.

static NSPoint SSRandomPointForSizeWithinRect (
   NSSize size,
   NSRect rect
);
Discussion

Returns a random point within rect, constrained within (rect.size - size) from rect’s origin.

Availability
  • Available in OS X v10.0 and later.
Declared In
ScreenSaverView.h