Up

# STEnvironment class reference

### Authors

Stefan Urbanek(`urbanek@host.sk` )

Copyright: (C) 2002 Free Software Foundation

# Software documentation for the STEnvironment class

## STEnvironment : NSObject

> Declared in:
>   StepTalk/STEnvironment.h

Description forthcoming.

Method summary

- +defaultScriptingEnvironment
- +environmentWithDescription:
- +environmentWithDescriptionName:
- -addClassesWithNames:
- -addNamedObjectsFromDictionary:
- -createsUnknownObjects
- -fullScriptingEnabled
- -includeBundle:
- -includeFramework:
- -initDefault
- -initWithDescription:
- -initWithDescriptionName:
- -knownObjectNames
- -loadModule:
- -objectDictionary
- -objectReferenceForObjectWithName:
- -objectWithName:
- -registerObjectFinder:name:
- -registerObjectFinderNamed:
- -removeObjectFinderWithName:
- -removeObjectWithName:
- -setCreatesUnknownObjects:
- -setFullScriptingEnabled:
- -setObject:forName:
- -translateSelector:forReceiver:

### defaultScriptingEnvironment

+ (STEnvironment*) defaultScriptingEnvironment;

Creating environment
Creates and initialises scripting environment using standard description.

### environmentWithDescription:

+ (id) environmentWithDescription: (STEnvironmentDescription*)aDescription;

Creates and initialises scripting environment using environment description description.

### environmentWithDescriptionName:

+ (id) environmentWithDescriptionName: (NSString*)descName;

Creates and initialises scripting environment using description with name descName.

### addClassesWithNames:

- (void) addClassesWithNames: (NSArray*)names;

Add classes specified by the names in the names array. This method is used internally to add classes provided by modules.

### addNamedObjectsFromDictionary:

- (void) addNamedObjectsFromDictionary: (NSDictionary*)dict;

Description forthcoming.

### createsUnknownObjects

- (BOOL) createsUnknownObjects;

Returns `YES` if unknown objects are being created.

### fullScriptingEnabled

- (BOOL) fullScriptingEnabled;

Returns `YES` if full scripting is enabled.

### includeBundle:

- (BOOL) includeBundle: (NSBundle*)aBundle;

Include scripting capabilities advertised by the bundle

### includeFramework:

- (void) includeFramework: (NSString*)frameworkName;

Include scripting capabilities advertised by the framework with name

### initDefault

- (id) initDefault;
This is a designated initialiser for the class.

Initialises scripting environment using default description.

### initWithDescription:

- (id) initWithDescription: (STEnvironmentDescription*)aDescription;

Initialises scripting environment using scripting description aDescription.

### initWithDescriptionName:

- (id) initWithDescriptionName: (NSString*)descName;
This is a designated initialiser for the class.

Initialises scripting environment using description with name descName.

### knownObjectNames

- (NSArray*) knownObjectNames;

Description forthcoming.

### loadModule:

- (void) loadModule: (NSString*)moduleName;

Modules
Load StepTalk module with the name moduleName. Modules are stored in the Library/StepTalk/Modules directory.

### objectDictionary

- (NSMutableDictionary*) objectDictionary;

Named objects and object references
Returns a dictionary of all named objects in the environment.

### objectReferenceForObjectWithName:

- (STObjectReference*) objectReferenceForObjectWithName: (NSString*)name;

Description forthcoming.

### objectWithName:

- (id) objectWithName: (NSString*)objName;

Return object with name objName. If object is not found int the object dictionary, then object finders are used to try to find the object. If object is found by an object finder, then it is put into the object dicitonary. If there is no object with given name, `nil` is returned.

### registerObjectFinder:name:

- (void) registerObjectFinder: (id)finder name: (NSString*)name;

Distributed objects
Register object finder finder under the name name

### registerObjectFinderNamed:

- (void) registerObjectFinderNamed: (NSString*)name;

Register object finder named name. This method will try to find an object finder bundle in Library/StepTalk/Finders directories.

### removeObjectFinderWithName:

- (void) removeObjectFinderWithName: (NSString*)name;

Remove object finder with name name

### removeObjectWithName:

- (void) removeObjectWithName: (NSString*)objName;

Remove object named objName.

### setCreatesUnknownObjects:

- (void) setCreatesUnknownObjects: (BOOL)flag;

Enable or disable creation of unknown objects. Normally you get `nil` if you request for non-existant object. If flag is `YES` then by requesting non-existant object, name for that object is created and it is set no STNil.

Note: This method will be probably removed (moved to Smalltalk language bundle).

### setFullScriptingEnabled:

- (void) setFullScriptingEnabled: (BOOL)flag;

Full scripting
Enable or disable full scripting. When full scripting is enabled, you may send any message to any object.

### setObject:forName:

- (void) setObject: (id)anObject forName: (NSString*)objName;

Register object anObject with name objName.

### translateSelector:forReceiver:

- (NSString*) translateSelector: (NSString*)aString forReceiver: (id)anObject;

Selector translation

Up