File:  [NeXTSTEP 3.3 examples] / Examples / AppKit / Backspace / BoinkViewPart.h
Revision 1.1.1.1 (vendor branch): download - view: text, annotated - select for diffs
Tue Apr 24 17:48:30 2018 UTC (8 years, 1 month ago) by root
Branches: NeXT, MAIN
CVS tags: NeXTSTEP33, HEAD
Sample Programs from NeXSTEP 3.3


#import <appkit/View.h>
#import "Thinker.h"

typedef struct { float l,b,r,t;	} BRECT;

typedef struct { 
	float hue;
	float pos;
	} LineInfo;

// maximum number number of grid lines
#define NVERT 8
#define NHORIZ 10

#define DECREASING 0
#define INCREASING 1

void horizLineWithAvoidance(float x1, float y1, float x2,float y2,
			float hue,float brightness, const NXRect *r);

void verticalLineWithAvoidance(float x1, float y1, float x2,float y2,
			float hue,float brightness, const NXRect *r);

@interface BoinkView:View
{
	float	xpos;
	float	xspeed;
	float	ypos;
	float	yspeed;
	float	accel;
	int	ballNum;
	int	spinDir;
	int rebound;

	float viewHeight;
	float viewWidth;

	BRECT old;
	NXPoint ballTo;
	NXPoint redrawTo;
	NXRect redraw;
	NXSize oldSize;
	
	id buffer;
	id balls;
	
	int nvert, nhoriz;
	int vcount, hcount;
	LineInfo vertLines[NVERT];
	LineInfo horizLines[NHORIZ];
	int toggle;
	int reboundMode;
	float lastLaunchSpeed;

	BStimeval now, then;
	BStimeval nextRotationTime;
	BStimeval nextLineDrawTime;
}

- oneStep;
- newSpeed;
- initFrame:(const NXRect *)frameRect;
- setAccel:(float)val;
- sizeTo:(NXCoord)width :(NXCoord)height;
- drawSelf:(const NXRect *)rects :(int)rectCount;
- newViewSize;
- incrementBallNumber;
- (float) getRandomXspeed;
- (float) timeCorrectedXSpeed;
- checkXspeed:(float *)speed;
- (const char *)windowTitle;
- updateGrid;
- drawGrid;
- drawLinesInBuffer;

@end

unix.superglobalmegacorp.com

This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.