
/* 	STAppServer.m - written by Phillip Zakhour/Robert Vasvari 1/95
 */

#import <appkit/appkit.h>
#import <foundation/NSString.h>
#import "STAppServer.h"
#import "STAppController.h"
#import "STRemoteMethodCategory.h"

@implementation STAppServer

- init
{	
id conn;
NSString *n=[NSString stringWithFormat:@"%s",[(Application *)NXApp appName]];
	[super init];
	
	/* export ourselves to whoever wants it */
	conn = [NXConnection registerRoot: self withName:[n cString]];
    [conn runFromAppKit];
	return self;
}


- (oneway)hide
{	[NXApp hide:self];
}

- (oneway)quit
{	[NXApp terminate:self];
}

- (NSString *)appName;		
{	return [NSString stringWithCString:[(Application *)NXApp appName]];
}


/*
 * Methods that implement the NXSenderIsInvalid protocol
 */
- senderIsInvalid:sender
{
   /* the server ran into a dead client */
    return self;
}

@end
