home *** CD-ROM | disk | FTP | other *** search
/ Nebula 1995 August / NEBULA.bin / SourceCode / Starter / Source / RemoteServer.m < prev    next >
Encoding:
Text File  |  1995-02-13  |  1.1 KB  |  59 lines

  1.  
  2. /*     RemoteServer.m - written by Robert Vasvari 8/94 */
  3. #import <foundation/NSString.h>
  4. #import "Controller.h"
  5.  
  6. #import "RemoteServer.h"
  7. #import "defs.h"
  8.  
  9. @implementation RemoteServer
  10.  
  11. /* the three utility methods */
  12. - init
  13. {    
  14. id conn;
  15. NSString *n=[[NSString stringWithFormat:@"%sServer",
  16.                 [NXApp appName]] autorelease];
  17.     [super init];
  18.     
  19.     /* advertise ourselves to whoever wants it 
  20.        through the nameserver */
  21.     conn = [NXConnection registerRoot: self withName:[n cString]];
  22.     [conn runFromAppKit];
  23.     return self;
  24. }
  25.  
  26. - doesNotRecognize:(SEL)aSelector
  27. {    /* if an unknown message comes we should not blow up */
  28.     [self error:"  %s objects should not be sent '%s' messages\n",
  29.       [[self class] name], sel_getName(_cmd)];
  30.     return self;
  31. }
  32.  
  33. - senderIsInvalid:sender
  34. {
  35.    /* the server ran into a dead client */
  36.     return self;
  37. }
  38.  
  39. /* the remote methods */
  40. - hide:sender
  41. {    
  42.     [NXApp hide:sender];
  43.     return self;
  44. }
  45.  
  46. - newDocument:sender
  47. {    
  48.     [[NXApp delegate] newDocument:sender];
  49.     return self;
  50. }
  51.  
  52. - openDocument:(const char *)aPath
  53. {    
  54.     [[NXApp delegate] openDocument:aPath];
  55.     return self;
  56. }
  57.  
  58. @end
  59.