This is NewSpaceView.h in view mode; [Download] [Up]
#import <appkit/appkit.h>
#import <appkit/View.h>
#import "StarShipProtocol.h"
#define NSTARS (200)
#define STARSPERIT (100)
typedef struct STAR {
float theta; // angle
float distance;
float delta; // change in distance
float ddelta; // change in delta, a constant multiplier
int changemode;
char c;
float changepoint[6];
NXPoint r1, r2;
NXPoint *draw;
NXPoint *erase;
} STAR;
@interface NewSpaceView:View
{
STAR stars[NSTARS];
id starShip;
id bodyController;
int nstars;
int radius; // min radius of this view
float stopDelta;
NXRect smallScreenRect; //for small screen info
BOOL firstState;
float lightColor;
float l_x_lightMin;
float r_x_lightMax;
float r_x_lightStart;
float l_x_lightStart;
float lightInc;
struct screenLights{
float l_x_pos;
float r_x_pos;
float y_pos;
}lights;
BOOL stopped,stopping;
BOOL hidden; //whether stars are hidden or not - disables stars
float speed;
float currentSpeed;
int lightLimit; // time to start lights over
int lightChangeTime;
int screenChangeTime;
int screenResizeLimit;
int screenResizeDir; // 0 = bigger , 1 = smaller
NXPoint b[NSTARS];
NXPoint bOffsets[NSTARS];
char bc [NSTARS+1];
NXPoint w[NSTARS];
NXPoint wOffsets[NSTARS];
char wc [NSTARS+1];
NXRect voidRect; //avoid the void!
Storage *avoidStorage;
int toggle;
NXSize oldSize;
float starSpeed;
}
- convertToXY:(STAR *)p;
- oneStep;
- (BOOL) allowBStars:(const STAR *)p;
- (BOOL) allowWStars:(const STAR *)p;
- drawSelf:(const NXRect *)rects :(int)rectCount;
- sizeTo:(NXCoord)width :(NXCoord)height;
- addStar;
- replaceStarAt:(int)index;
- setRadius;
- (const char *)windowTitle;
- didLockFocus;
- (BOOL)useBufferedWindow;
- setSmallScreenRect:(const NXRect *)newRect;
- setStarShipOutlet:(id)outlet;
- setBodyControllerOutlet:(id)outlet;
- drawScreen;
- drawScreenLights;
- stopStars; //gradual stop
- startStars;
- setStarsStopped; //instant stop
- (BOOL)isStopped;
- (BOOL)isStopping;
- setStarSpeed:sender;
- (BOOL)ignoreMouseMovement;
- inspector:sender;
- inspectorWillBeRemoved;
- inspectorInstalled;
@end
@interface View(nonretainedFillMethod)
- fillBoundsWithBlack;
@end
These are the contents of the former NiCE NeXT User Group NeXTSTEP/OpenStep software archive, currently hosted by Netfuture.ch.