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

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

/******************************************************************************
FILE
    SqPreference.h
DESCRIPTION
	NeXTstep user Interface for Squeak.
	This class reifies Squeak options/preferences.

	The preferences are loaded from the NeXT defaults, and then 
	overriden with the values from the UNIX environment, and then
	overriden with the values from the UNIX arguments.
	
	When changes in Preference Panel are validated, the new preference
	values are saved into the NeXT defaults.
AUTHOR
	<PJB> Pascal J. Bourguignon
MODIFICATIONS
	1998/08/25 <PJB> Creation.
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 "SqButton.h"


@interface SqPreference:Object
{
// Preference values:
	int                 squeakArgc;
	const char**        squeakArgv;

	char                imagePath[MAXPATHLEN+1];
	int                 heapSize;
	int                 stackCacheEntries;
	BOOL                noTitle;
	BOOL                fullScreen;
	BOOL                sleepWhenUnmapped;
	
	SqButton*           redButton;
	SqButton*           yellowButton;
	SqButton*           blueButton;
	
// Preference Panel:
	id                  imagePathButton;
	id                  initialHeapSizeText;
	id                  initialHeapSizeSlider;
	id                  redMatrix;
	id                  yellowMatrix;
	id                  blueMatrix;
	id                  noTitleSwitch;
	id                  fullScreenSwitch;
	id                  sleepWhenUnmappedSwitch;
	id                  stackCacheEntriesText;

// Working attributes:
	BOOL                preferencePanelIsModal;
	
}

// Object methods:

	-(id)init;
		/*
			The new instance is initialized with the preferences that
			are loaded from the NeXT defaults, and then 
			overriden with the values from the UNIX environment, and then
			overriden with the values from the UNIX arguments.
		*/
		
	-(id)free;
	
// NXNibNotification methods:

	-awakeFromNib;

// SqPreference values:

	-(int)squeakArgc;
	-(const char**)squeakArgv;
	
	-(int)heapSize;
	-(int)stackCacheEntries;
	-(BOOL)noTitle;
	-(BOOL)fullScreen;
	-(BOOL)sleepWhenUnmapped;
	-(void)getImagePath:(char*)path;
	-(const char*)imagePath;
	
	
	-(const char*)redButtonString;
	-(const char*)yellowButtonString;
	-(const char*)blueButtonString;
	
	-(void)setHeapSize:(int)size;
	-(void)setStackCacheEntries:(int)value;
	-(void)setNoTitle:(BOOL)flag;
	-(void)setFullScreen:(BOOL)flag;
	-(void)setSleepWhenUnmapped:(BOOL)flag;
	-(void)setImagePath:(const char*)path;

	-(void)setRedButton:(SqButton*)button;	
	-(void)setYellowButton:(SqButton*)button;	
	-(void)setBlueButton:(SqButton*)button;	
		/*
			These method let the preference know the button for later updating.
		*/

// SqPreference methods:
	
	-(void)openDialog;
	-(void)runModalDialog;

// SqPreference protected methods:

	-(void)registerDefaults;
	-(void)loadValuesFromDefaults;

	-(void)configurePreference;
	
	-changeImagePath:sender;
		/*
			DO:		Let the user select a new image and store its path
					into the image path button title.
		*/
	-cancelPreferences:sender;
		/*
			DO:		Close the Preference panel, not changing any value.
		*/
	-changePreferences:sender;
		/*
			DO:		Close the Preference panel, updating the preference 
					values with the new values in the panel.
		*/
	
	-(void)parseSqueakArguments;
	
	
@end // SqPreference.

/*** SqPreference.h / Thu Aug 27 23:20:26 MET 1998 / PJB ***/


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