ftp.nice.ch/pub/next/developer/languages/smalltalk/squeak-2.0-0.3d109.s.tar.gz#/squeak-2.0/nextstep/SqView.h

This is SqView.h in view mode; [Download] [Up]

/******************************************************************************
FILE
    SqView.h
DESCRIPTION
	NeXTstep user Interface for Squeak.
AUTHOR
	<PJB> Pascal J. Bourguignon
MODIFICATIONS
	1992/12/24 <PJB> Creation (as UiView for SFS).
	1998/06/12 <PJB> Modified for Squeak.
LEGAL
	Copyright Pascal J. Bourguignon 1998 - 1998

	This program is free software; you can redistribute it and/or
	modify it under the terms of the version 2 of the GNU General Public 
	License as published by the Free Software Foundation.
	
	This program is distributed in the hope that it will be useful, but 
	WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY 
	or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License 
	hereafter for more details.
******************************************************************************/
#import <appkit/appkit.h>
#import "BoTypes.h"
#import "SqButton.h"


	
	
@interface SqView:View
{
	NXCursor*           cursor;
	NXCursor*           transparentCursor;
/*
	NXRect              savedWindowPlace; // not valid when !isFullScreen.
	const NXScreen*     savedScreen;      // not valid when !isFullScreen.
	int                 savedLevel;       // not valid when !isFullScreen.
*/
	BOOL                isFullScreen;
#define KeyMax	    	(80)
	int		    		keyBuffer[KeyMax];
	int	    			butBuffer[KeyMax];
	int    				keyHead;
	int				    keyTail;
	int                 eventFlags;   // NeXT mouse button and modifier state.
	int                 buttonState;  // Sq mouse button and modifier state.
	SqButton*           redButton;
	SqButton*           yellowButton;
	SqButton*           blueButton;
	

	// This colorMap is used to map the Squeak 2-bit to NEXTSTEP 2-bit colors.
	unsigned char*      Two_to_Two;
	// These colorMaps are used only when Squeak depth is 8, to convert to
	// 2-bit, 8-bit, 16-bit or 32-bit maps.
	unsigned char*      colorMap2Gray;
	unsigned char*      colorMap8Gray;
	unsigned short*     colorMap16;
	unsigned long*      colorMap32;

	int                 lastBitsIndex; // used by updateWholeDisplay.
	int                 lastWidth;
	int                 lastHeight;
	int                 lastDepth;
@private
	NXImage*            cachedImage;
	unsigned long*      bitsRgb;
	long                bitsRgbSize;
}

	-(id)initFrame:(const NXRect*)frameRect;
	-(id)free;

// Responder methods:

	-(BOOL)acceptsFirstResponder;
	-(BOOL)acceptsFirstMouse;
	-(id)mouseDown:(NXEvent*)event;
	-(id)mouseUp:(NXEvent*)event;
	-(id)rightMouseDown:(NXEvent*)event;
	-(id)rightMouseUp:(NXEvent*)event;
	-(id)keyDown:(NXEvent*)event;
	-(BOOL)performKeyEquivalent:(NXEvent*)event;

// SqView methods:
	
	-(void)layoutInWindow;
	
	
	-(void)initializeTransparentCursor;
	-(void)initializeSqueakColorMap;
		/*
			May be overriden by subclasses. Set up the color maps.
		*/
	-(void)setColorEntry:(int)i red:(int)r green:(int)g blue:(int)b;
		/*
			May be overriden by subclasses. Set up one entry in the color maps.
		*/
	-(void)redisplayAfterUnhide;
		/*
			Sent from appDidUnhide:.  Do nothing.
			Subclasses may override to send updateWholeDisplay.
		*/
	-(void)updateWholeDisplay;

	-(SqButton*)redButton;
	-(SqButton*)yellowButton;
	-(SqButton*)blueButton;
	
/* display,mouse,keyboard,time i/o */

	-(int)ioForceDisplayUpdate;
	-(int)ioFormPrintBitsAddr:(int)bAdr width:(int)w height:(int)h depth:(int)d 
			hScale:(double)hs vScale:(double)vs landscapeFlag:(int)lf;
	-(int)ioSetFullScreen:(int)fullScreen;
	-(int)ioGetButtonState;
	-(int)ioGetKeystroke;
	-(int)ioMousePoint;
	-(int)ioPeekKeystroke;
	-(int)ioScreenSize;
	-(int)ioSetCursorBitsIndex:(int)cursorBitsIndex 
			withMask:(int)cursorMaskIndex
			offsetX:(int)x offsetY:(int)y;
	-(int)ioSetCursorBitsIndex:(int)cursorBitsIndex 
			offsetX:(int)x offsetY:(int)y;
	-(int)ioShowDisplayBitsIndex:(int)bInd 
			width:(int)w height:(int)h depth:(int)d 
			affectedLeft:(int)l affectedRight:(int)r 
			affectedTop:(int)t affectedBottom:(int)b;

@end // SqView.

/*** SqView.h / Thu Aug 27 23:20:56 MET 1998 / PJB ***/

These are the contents of the former NiCE NeXT User Group NeXTSTEP/OpenStep software archive, currently hosted by Netfuture.ch.