version 1.1, 2006/03/03 23:31:12 |
version 1.10, 2016/09/30 01:13:38 |
Line 18 static int myDocumentSaidTheMessageAboutX = 0; |
|
Line 18 static int myDocumentSaidTheMessageAboutX = 0; |
|
|
|
|
|
@implementation MyDocument |
@implementation MyDocument |
|
static int NoEngine = 0; // experimental. |
|
static NSMenuItem *menuItemNoEngine = nil; // NoEngine |
|
// For OnState or OffState in the execution menu |
|
static NSMenuItem *menuItemNotebookMode = nil; |
|
static NSMenuItem *menuItemBasicMode = nil; |
|
static NSMenuItem *menuItemRisaAsir = nil; |
|
static NSMenuItem *menuItemKanSm1 = nil; |
|
static NSMenuItem *menuItemOutputDebugMessages = nil; //cf. debugMyTunnel; |
|
static NSMenuItem *menuItemPrettyPrint = nil; // prettyPrint. |
|
|
|
|
- (void)dealloc { |
- (void)dealloc { |
MyOutputWindowController *mowc; |
MyOutputWindowController *mowc; |
if (myDebug) NSLog(@"dealloc of MyDocument.\n"); |
if (myDebug) NSLog(@"dealloc of MyDocument.\n"); |
Line 63 static int myDocumentSaidTheMessageAboutX = 0; |
|
Line 73 static int myDocumentSaidTheMessageAboutX = 0; |
|
} |
} |
[self addMenuExec]; // adding the execution menu. |
[self addMenuExec]; // adding the execution menu. |
[textViewIn setAllowsUndo:YES]; |
[textViewIn setAllowsUndo:YES]; |
|
if ([textViewIn isContinuousSpellCheckingEnabled]) [textViewIn toggleContinuousSpellChecking: self]; // Turn off the spell checking. |
|
if ([textViewIn isAutomaticQuoteSubstitutionEnabled]) [textViewIn toggleAutomaticQuoteSubstitution: self]; // Turn off the smart quote. |
|
if ([MyEnvironment isX11Installed] != 1) |
|
[self messageDialog: NSLocalizedString(@"X11 is not installed. To install it, insert MacOS DVD1 and open Optional install->Applications->X11",nil) with: 0]; |
|
// if ([MyEnvironment isGccInstalled] != 1) |
|
// [self messageDialog: NSLocalizedString(@"gcc is not installed. To install it, insert MacOS DVD1 and open Xcode Tools->XcodeTools.mpkg",nil) with: 0]; |
[self sayTheMessageAboutX]; |
[self sayTheMessageAboutX]; |
[self initAux]; |
[self initAux]; |
} |
} |
Line 139 static int myDocumentSaidTheMessageAboutX = 0; |
|
Line 155 static int myDocumentSaidTheMessageAboutX = 0; |
|
myDecoder = [[MyDecoder alloc] init]; [myDecoder retain]; |
myDecoder = [[MyDecoder alloc] init]; [myDecoder retain]; |
|
|
[self openMyModel: myEnvironment ]; |
[self openMyModel: myEnvironment ]; |
|
[MyOpenGLController initMyOpenGLController]; // For the second execution, it will do nothing. |
} |
} |
-(int) getMyDocumentKey { return myDocumentKey; } |
-(NSString *) getMyDocumentKey { return myDocumentKey; } |
|
|
-(id) openMyModel: (MyEnvironment *) myEnvironment { |
-(id) openMyModel: (MyEnvironment *) myEnvironment { |
[myEnvironment showForDebug]; // for debug. |
[myEnvironment showForDebug]; // for debug. |
Line 155 static int myDocumentSaidTheMessageAboutX = 0; |
|
Line 172 static int myDocumentSaidTheMessageAboutX = 0; |
|
[peerEndEvaluteMark retain]; |
[peerEndEvaluteMark retain]; |
|
|
[self stopIndicator]; |
[self stopIndicator]; |
|
if (NoEngine && (!restartMode)) { task = nil; return self; } |
|
|
// Initialization to call /bin/bash |
// Initialization to call /bin/bash |
outboundPipe = [NSPipe pipe]; // since autorelease is called in pipe. |
outboundPipe = [NSPipe pipe]; // since autorelease is called in pipe. |
inboundPipe = [NSPipe pipe]; |
inboundPipe = [NSPipe pipe]; |
Line 217 static int myDocumentSaidTheMessageAboutX = 0; |
|
Line 236 static int myDocumentSaidTheMessageAboutX = 0; |
|
|
|
-(id) restartMyModel: (enum peer_type) peerType { |
-(id) restartMyModel: (enum peer_type) peerType { |
MyEnvironment *myEnvironment; |
MyEnvironment *myEnvironment; |
|
restartMode = 1; |
[self closeMyModel]; |
[self closeMyModel]; |
myEnvironment = [[MyEnvironment alloc] initFor: peerType]; //BUG. leak memory? |
myEnvironment = [[MyEnvironment alloc] initFor: peerType]; //BUG. leak memory? |
[myEnvironment retain]; |
[myEnvironment retain]; |
Line 230 static int myDocumentSaidTheMessageAboutX = 0; |
|
Line 250 static int myDocumentSaidTheMessageAboutX = 0; |
|
NSLog(@"myDocumentSaidTheMessageAboutX=%d\n",myDocumentSaidTheMessageAboutX); |
NSLog(@"myDocumentSaidTheMessageAboutX=%d\n",myDocumentSaidTheMessageAboutX); |
if (!myDocumentSaidTheMessageAboutX) { |
if (!myDocumentSaidTheMessageAboutX) { |
if ([MyEnvironment checkX] != 1) |
if ([MyEnvironment checkX] != 1) |
[self messageDialog: |
// [self messageDialog: |
NSLocalizedString(@"A few commands (plot, ...) cannot be used, because X11 is not running.",nil) with: 0]; |
// NSLocalizedString(@"A few commands (plot, ...) cannot be used, because X11 is not running.",nil) with: 0]; |
|
[self changeOutputCounterFieldWithString: |
|
[NSLocalizedString(@"Output mini-view: ",nil) stringByAppendingString: |
|
NSLocalizedString(@"A few commands (plot, ...) cannot be used, because X11 is not running.",nil)]]; |
myDocumentSaidTheMessageAboutX = 1; |
myDocumentSaidTheMessageAboutX = 1; |
} |
} |
} |
} |
Line 241 static int myDocumentSaidTheMessageAboutX = 0; |
|
Line 264 static int myDocumentSaidTheMessageAboutX = 0; |
|
NSMutableString *cmd; |
NSMutableString *cmd; |
NSRange r; |
NSRange r; |
|
|
|
if (!task) return; |
if (inEvaluation) { |
if (inEvaluation) { |
NSLog(@"In evaluatioin. "); |
NSLog(@"In evaluatioin. "); |
[self messageDialog: NSLocalizedString(@"Evaluating...",nil) with: 0]; |
[self messageDialog: NSLocalizedString(@"Evaluating...",nil) with: 0]; |
Line 273 static int myDocumentSaidTheMessageAboutX = 0; |
|
Line 297 static int myDocumentSaidTheMessageAboutX = 0; |
|
[textViewIn replaceCharactersInRange: NSMakeRange(pos,0) withString: @"\n"]; |
[textViewIn replaceCharactersInRange: NSMakeRange(pos,0) withString: @"\n"]; |
} |
} |
cmd0 = [cmd0 substringWithRange:r ]; |
cmd0 = [cmd0 substringWithRange:r ]; |
} |
} |
|
[self outputBorderLine: [NSColor magentaColor]]; |
|
[self outputString: cmd0]; |
|
if ([cmd0 length] > 0) { |
|
if ([cmd0 characterAtIndex: ([cmd0 length]-1)] != 0xa) [self outputString: @"\n"]; |
|
} |
|
[self outputBorderLine: [NSColor yellowColor]]; |
}else{ |
}else{ |
cmd0 = [textViewIn string]; |
cmd0 = [textViewIn string]; |
MyOutputWindowController *mc; |
MyOutputWindowController *mc; |
Line 303 static int myDocumentSaidTheMessageAboutX = 0; |
|
Line 333 static int myDocumentSaidTheMessageAboutX = 0; |
|
[alert release]; |
[alert release]; |
|
|
fprintf(stderr,"Trying to interrupt.\n"); |
fprintf(stderr,"Trying to interrupt.\n"); |
[task interrupt]; |
if (task) [task interrupt]; |
inputCounter = outputCounter = 0; |
inputCounter = outputCounter = 0; |
[self stopIndicator]; |
[self stopIndicator]; |
[myDecoder reset]; |
[myDecoder reset]; |
Line 360 static int myDocumentSaidTheMessageAboutX = 0; |
|
Line 390 static int myDocumentSaidTheMessageAboutX = 0; |
|
NSLog(@"Evaluating... "); |
NSLog(@"Evaluating... "); |
NSLog(@"%@",cmd); |
NSLog(@"%@",cmd); |
// Evaluation is here. |
// Evaluation is here. |
|
if (!task) return -1; |
cmdInData = [cmd dataUsingEncoding: NSUTF8StringEncoding]; |
cmdInData = [cmd dataUsingEncoding: NSUTF8StringEncoding]; |
@try { |
@try { |
//todo if (yes) [outboundFileHandle writeData: peerStartEvaluateMark]; |
//todo if (yes) [outboundFileHandle writeData: peerStartEvaluateMark]; |
Line 387 static int myDocumentSaidTheMessageAboutX = 0; |
|
Line 418 static int myDocumentSaidTheMessageAboutX = 0; |
|
else { |
else { |
MyOutputWindowController *mc; |
MyOutputWindowController *mc; |
mc = [MyOutputWindowController sharedMyOutputWindowController: self]; |
mc = [MyOutputWindowController sharedMyOutputWindowController: self]; |
[mc outputStringToOutputWindow: amt]; |
if (prettyPrint) [mc outputStringToOutputWindow: amt withColor: [NSColor blueColor]]; |
|
else [mc outputStringToOutputWindow: amt]; |
} |
} |
} |
} |
|
-(void)outputBorderLine: (NSColor *)color { |
|
MyOutputWindowController *mc; |
|
mc = [MyOutputWindowController sharedMyOutputWindowController: self]; |
|
[mc outputStringToOutputWindow: @"----------------------------------------\n" withColor: color]; |
|
} |
- (void) outputErrorString: (NSString *) amt { |
- (void) outputErrorString: (NSString *) amt { |
int oldEnd; |
int oldEnd; |
int newEnd; |
int newEnd; |
Line 481 static int myDocumentSaidTheMessageAboutX = 0; |
|
Line 518 static int myDocumentSaidTheMessageAboutX = 0; |
|
//bug. temporary. |
//bug. temporary. |
path = [OpenXM_HOME stringByAppendingString: @"/doc/cfep/intro-ja.html"]; |
path = [OpenXM_HOME stringByAppendingString: @"/doc/cfep/intro-ja.html"]; |
|
|
ans = [[NSWorkspace sharedWorkspace] openFile:path withApplication: @"Help Viewer"]; |
ans = [[NSWorkspace sharedWorkspace] openFile:path withApplication: @"Safari"]; //We do not use Help Viewer |
if (ans != YES) { |
if (ans != YES) { |
[self messageDialog: NSLocalizedString(@"Help file is not found at cfep.app/OpenXM/doc/cfep",nil) with: 0]; |
[self messageDialog: NSLocalizedString(@"Help file is not found at cfep.app/OpenXM/doc/cfep",nil) with: 0]; |
} |
} |
Line 575 int debugInbound = 0; |
|
Line 612 int debugInbound = 0; |
|
if (debugMyTunnel) [self outputErrorString: act]; // for debug. |
if (debugMyTunnel) [self outputErrorString: act]; // for debug. |
channel = [myDecoder getChannel]; |
channel = [myDecoder getChannel]; |
if (channel == 0) [self errorActionFor: act]; |
if (channel == 0) [self errorActionFor: act]; |
|
// cf. MyDecode.h for the list of channel numbers. |
else if (channel == 1) [self openGLActionFor: act]; |
else if (channel == 1) [self openGLActionFor: act]; |
else if (channel == 2) [self openGLInitActionFor: act]; |
else if (channel == 2) [self openGLInitActionFor: act]; |
|
else if (channel == 10) [self pngActionFor: act]; |
} |
} |
state = 0; break; |
state = 0; break; |
default: |
default: |
Line 973 int debugInbound = 0; |
|
Line 1012 int debugInbound = 0; |
|
NSRange r; |
NSRange r; |
NSRange r3; |
NSRange r3; |
int currentLine,i; |
int currentLine,i; |
|
[self outputErrorString: NSLocalizedString(@"Move to the line ",nil)]; |
|
[self outputErrorString: [NSString stringWithFormat: @"%d\n",line]]; |
// move the selection to the line line. |
// move the selection to the line line. |
s = [textViewIn string]; |
s = [textViewIn string]; |
if (onlySelectedArea || notebookMode) r = [textViewIn selectedRange]; |
if (onlySelectedArea || notebookMode) r = [textViewIn selectedRange]; |
Line 993 int debugInbound = 0; |
|
Line 1034 int debugInbound = 0; |
|
} |
} |
-(int) gotoNextError: (id) sender{ |
-(int) gotoNextError: (id) sender{ |
int n; |
int n; |
|
if (onlySelectedArea || notebookMode) |
|
[self outputErrorString: NSLocalizedString(@"The next error action will not work properly in this mode.\n",nil)]; |
n = [self nextLine: 0]; |
n = [self nextLine: 0]; |
if (n >= 0) { [self gotoLine: n]; return n;} |
if (n >= 0) { [self gotoLine: n]; return n;} |
else return -1; |
else return -1; |
Line 1008 int debugInbound = 0; |
|
Line 1051 int debugInbound = 0; |
|
return -1; |
return -1; |
} |
} |
gid = [[a objectAtIndex: 0] intValue]; |
gid = [[a objectAtIndex: 0] intValue]; |
|
if ([[a objectAtIndex: 1] hasPrefix: @"meta"]) {[self openGLMeta: [a objectAtIndex: 1] to: gid]; return 0; } |
[MyOpenGLController addOglComm: [a objectAtIndex: 1] to: gid from: self]; |
[MyOpenGLController addOglComm: [a objectAtIndex: 1] to: gid from: self]; |
return 0; |
return 0; |
} |
} |
Line 1023 int debugInbound = 0; |
|
Line 1067 int debugInbound = 0; |
|
[MyOpenGLController addOglInitComm: [a objectAtIndex: 1] to: gid from: self]; |
[MyOpenGLController addOglInitComm: [a objectAtIndex: 1] to: gid from: self]; |
return 0; |
return 0; |
} |
} |
|
-(void)openGLMeta: (NSString *) cmd to: (int) gid{ |
|
MyOpenGLController *oglc; |
|
oglc = [MyOpenGLController getOglWindow: gid]; |
|
if (!oglc) {[self printErrorMessage: |
|
[NSString stringWithFormat: @"Invalid gid %d in openGLMeta command %@\n",gid,cmd]]; return; } |
|
if ([cmd hasPrefix: @"meta_showListOfOglComm"]) { |
|
[self showListOfOglComm: gid]; return ; |
|
}else if ([cmd hasPrefix: @"meta_removeAllInit"]) { // longer command must come first, because we use prefix. |
|
[oglc removeAllOfOglInitComm]; |
|
}else if ([cmd hasPrefix: @"meta_removeLastInit"]) { |
|
[oglc removeLastOfOglInitComm]; |
|
}else if ([cmd hasPrefix: @"meta_removeAll"]) { |
|
[oglc removeAllOfOglComm]; |
|
}else if ([cmd hasPrefix: @"meta_removeLast"]) { |
|
[oglc removeLastOfOglComm]; |
|
}else{ |
|
[self printErrorMessage: [NSString stringWithFormat: @"Unknown OpenGL meta command %@\n",cmd]]; |
|
} |
|
} |
|
-(void) showListOfOglComm: (int) gid { |
|
MyDocument *md; |
|
MyOpenGLController *oglc; |
|
NSMutableArray *comm; |
|
int i,n; |
|
md = self; |
|
oglc = [MyOpenGLController getOglWindow: gid]; |
|
if (!oglc) {[self outputErrorString: @"Invalid gid in showListOfOglComm\n"]; return; } |
|
comm = [oglc getListOfOglInitComm]; |
|
n = [comm count]; |
|
[md outputString: NSLocalizedString(@"OpenGL init commands\n",nil)]; |
|
for (i=0; i<n; i++) { |
|
[md outputString: [NSString stringWithFormat: @"%04d: ",i]]; |
|
[md outputString: [[comm objectAtIndex: i] toString]]; |
|
[md outputString: @"\n"]; |
|
} |
|
comm = [oglc getListOfOglComm]; |
|
n = [comm count]; |
|
[md outputString: NSLocalizedString(@"OpenGL redraw commands\n",nil)]; |
|
for (i=0; i<n; i++) { |
|
[md outputString: [NSString stringWithFormat: @"%04d: ",i]]; |
|
[md outputString: [[comm objectAtIndex: i] toString]]; |
|
[md outputString: @"\n"]; |
|
} |
|
} |
|
|
|
|
|
-(void) pngActionFor: (NSString *)act { |
|
NSArray *a; |
|
id typesetExpression; |
|
MyOutputWindowController *mowc; |
|
NSString *path; |
|
int n; |
|
a=[act componentsSeparatedByString: @","]; |
|
n = [a count]; |
|
if (n < 1) { |
|
[self printErrorMessage: @"Invalid format in pngActionFor: \n"]; |
|
return; |
|
} |
|
// NSLog(@"%@",a); |
|
if ([[a objectAtIndex: 0] hasPrefix: @"notAvailable"]) { |
|
[self messageDialog: |
|
NSLocalizedString(@"Typeset the output by TeX is not available. latex and dvipng must be installed.",nil) with: 0]; |
|
prettyPrint = 1; [self setPrettyPrint: nil]; |
|
return; |
|
} else if ([[a objectAtIndex: 0] compare: @"showFile"] == NSOrderedSame) { |
|
if (n < 2) [self printErrorMessage: @"showFile,filename filename is missing.\n"]; |
|
path = [MyUtil pruneThings: [a objectAtIndex: 1]]; // for buggy componentsSeparatedByString |
|
typesetExpression = [MyUtil attributedStringWithPath: path]; |
|
if (typesetExpression) { |
|
if (notebookMode) [textViewIn insertText: typesetExpression]; |
|
else { |
|
mowc = [MyOutputWindowController sharedMyOutputWindowController: self]; |
|
[mowc insertText: typesetExpression]; |
|
} |
|
} |
|
return; |
|
} else { |
|
NSLog(@"pngActionFor: %@\n",act); |
|
[self printErrorMessage: @"Unknown command for pngActionFor:\n"]; |
|
} |
|
} |
|
|
-(void) setBasicStyle: (id) sender { |
-(void) setBasicStyle: (id) sender { |
notebookMode = 0; |
notebookMode = 0; |
[self updateInterfaceStyleMenu]; |
[self updateInterfaceStyleMenu]; |
Line 1054 int debugInbound = 0; |
|
Line 1179 int debugInbound = 0; |
|
[self updateSelectEngineMenu]; |
[self updateSelectEngineMenu]; |
[self oxEvaluateString: @"!sm1;" withMark: TRUE]; |
[self oxEvaluateString: @"!sm1;" withMark: TRUE]; |
} |
} |
|
// BUG: update* must be called when the focus is changed to "setState:" |
-(void) updateSelectEngineMenu { |
-(void) updateSelectEngineMenu { |
if (!menuItemRisaAsir) return; |
if (!menuItemRisaAsir) return; |
if (!menuItemKanSm1) return; |
if (!menuItemKanSm1) return; |
Line 1075 int debugInbound = 0; |
|
Line 1201 int debugInbound = 0; |
|
} |
} |
[MyUtil setDebugMyUtil]; |
[MyUtil setDebugMyUtil]; |
} |
} |
|
|
|
//BUG: [self setPrettyPrint: nil] or update must be called when focus is changed to "setState:" |
|
-(void) setPrettyPrint: (id) sender { |
|
if (prettyPrint) { |
|
prettyPrint = 0; |
|
[self oxEvaluateString: @"!verbatim;" withMark: TRUE]; |
|
if (menuItemPrettyPrint) [menuItemPrettyPrint setState: NSOffState]; |
|
} else { |
|
prettyPrint = 1; |
|
if (!asir_contrib) [self loadAsirContrib: nil]; |
|
[self oxEvaluateString: @"!cfep_png;" withMark: TRUE]; |
|
if (menuItemPrettyPrint) [menuItemPrettyPrint setState: NSOnState]; |
|
} |
|
} |
|
-(void) setNoEngine: (id) sender { |
|
if (NoEngine) { |
|
NoEngine = 0; |
|
if (menuItemNoEngine) [menuItemNoEngine setState: NSOffState]; |
|
} else { |
|
NoEngine = 1; |
|
if (menuItemNoEngine) [menuItemNoEngine setState: NSOnState]; |
|
} |
|
} |
|
|
|
-(void) loadAsirContrib: (id) sender { |
|
NSString *com; |
|
if (inEvaluation) { |
|
[self messageDialog: NSLocalizedString(@"Evaluating...",nil) with: 0]; |
|
return; |
|
} |
|
asir_contrib = 1; |
|
com = [@"load(\"" stringByAppendingString: OpenXM_HOME]; |
|
com = [com stringByAppendingString: @"/rc/asirrc\")$"]; |
|
if (notebookMode) { doInsertNewInputCell=0; [self getContentsOfInputCell]; [self prepareOutputCell];} |
|
[self oxEvaluateString: com withMark: TRUE]; |
|
} |
-(void) mytest: (id) sender { |
-(void) mytest: (id) sender { |
// Add code here for testing. |
// Add any code here for testing. |
int n; |
id typesetExpression; |
n=[self gotoNextError: nil]; |
typesetExpression = [MyUtil attributedStringWithPath: @"/Users/nobuki/OpenXM_tmp/1/work1.png"]; |
NSLog(@"error line=%d\n",n); |
if (typesetExpression) [textViewIn insertText: typesetExpression]; |
|
else NSLog(@"typesetExpression is nil.\n"); |
} |
} |
|
|
|
-(NSMenuItem *) menuItemLoadLibrary: (int) oxengine { |
|
NSMenuItem *menuItemAsirContrib; |
|
NSMenuItem *menuItemCohom; |
|
NSMenu *submenuLoadLibrary = [[[NSMenu alloc] init] autorelease]; |
|
switch(oxengine) { |
|
case 0: /* asir */ |
|
menuItemAsirContrib = [[[NSMenuItem alloc] init] autorelease]; |
|
[menuItemAsirContrib setTitle: NSLocalizedString(@"Load asir-contrib",nil)]; |
|
[menuItemAsirContrib setAction: @selector(loadAsirContrib:)]; |
|
[menuItemAsirContrib setTarget: [[NSApp mainWindow] document]]; |
|
[submenuLoadLibrary addItem: menuItemAsirContrib]; |
|
break; |
|
case 1: /* sm1 */ |
|
menuItemCohom = [[[NSMenuItem alloc] init] autorelease]; |
|
[menuItemCohom setTitle: NSLocalizedString(@"Load cohom.sm1",nil)]; |
|
[menuItemCohom setAction: @selector(loadCohom:)]; |
|
[menuItemCohom setTarget: [[NSApp mainWindow] document]]; |
|
[submenuLoadLibrary addItem: menuItemCohom]; |
|
break; |
|
default: |
|
break; |
|
} |
|
|
|
NSMenuItem *menuItemLoadLibrary = [[[NSMenuItem alloc] init] autorelease]; |
|
[menuItemLoadLibrary setTitle: NSLocalizedString(@"Load library",nil)]; |
|
[menuItemLoadLibrary setSubmenu: submenuLoadLibrary]; |
|
return menuItemLoadLibrary; |
|
} |
-(void) addMenuExec { |
-(void) addMenuExec { |
static int done=0; |
static int done=0; |
NSMenu *menuItem; |
NSMenu *menuItem; |
Line 1091 int debugInbound = 0; |
|
Line 1283 int debugInbound = 0; |
|
NSMenuItem *menuItemSelectEngine; |
NSMenuItem *menuItemSelectEngine; |
NSMenuItem *menuItemGotoNextError; |
NSMenuItem *menuItemGotoNextError; |
NSMenuItem *menuItemForTest; |
NSMenuItem *menuItemForTest; |
|
NSMenuItem *menuItemLoadLibrary; |
if (done) return; |
if (done) return; |
done = 1; |
done = 1; |
// oxEvalute |
// oxEvalute |
Line 1117 int debugInbound = 0; |
|
Line 1310 int debugInbound = 0; |
|
[menuItemGotoNextError setTarget: [[NSApp mainWindow] document]]; |
[menuItemGotoNextError setTarget: [[NSApp mainWindow] document]]; |
[menuExec addItem: menuItemGotoNextError]; |
[menuExec addItem: menuItemGotoNextError]; |
|
|
// gotoNextError |
// pretty print |
menuItemOutputDebugMessages = [[[NSMenuItem alloc] init] autorelease]; |
menuItemPrettyPrint = [[[NSMenuItem alloc] init] autorelease]; [menuItemPrettyPrint retain]; // it is the static variable. |
[menuItemOutputDebugMessages setTitle: NSLocalizedString(@"Output debug messages",nil)]; |
[menuItemPrettyPrint setTitle: NSLocalizedString(@"Typeset the output by TeX",nil)]; |
[menuItemOutputDebugMessages setAction: @selector(setDebugMyTunnel:)]; |
[menuItemPrettyPrint setAction: @selector(setPrettyPrint:)]; |
[menuItemOutputDebugMessages setTarget: [[NSApp mainWindow] document]]; |
[menuItemPrettyPrint setTarget: [[NSApp mainWindow] document]]; |
[menuExec addItem: menuItemOutputDebugMessages]; |
[menuExec addItem: menuItemPrettyPrint]; |
|
|
|
// loadLibrary |
|
[menuExec addItem: [self menuItemLoadLibrary: oxEngine]]; //bug. dynamic change. |
|
|
// interface style |
// interface style |
NSMenu *submenuInterfaceItem = [[[NSMenu alloc] init] autorelease]; |
NSMenu *submenuInterfaceItem = [[[NSMenu alloc] init] autorelease]; |
// basic-like |
// basic-like |
Line 1131 int debugInbound = 0; |
|
Line 1327 int debugInbound = 0; |
|
[menuItemBasicLike setTitle: NSLocalizedString(@"BASIC-like",nil)]; |
[menuItemBasicLike setTitle: NSLocalizedString(@"BASIC-like",nil)]; |
[menuItemBasicLike setAction: @selector(setBasicStyle:)]; |
[menuItemBasicLike setAction: @selector(setBasicStyle:)]; |
[menuItemBasicLike setTarget: [[NSApp mainWindow] document]]; |
[menuItemBasicLike setTarget: [[NSApp mainWindow] document]]; |
menuItemBasicMode = menuItemBasicLike; |
menuItemBasicMode = menuItemBasicLike; [menuItemBasicMode retain]; |
[submenuInterfaceItem addItem: menuItemBasicLike]; |
[submenuInterfaceItem addItem: menuItemBasicLike]; |
// notebook-like |
// notebook-like |
NSMenuItem *menuItemNotebookLike = [[[NSMenuItem alloc] init] autorelease]; |
NSMenuItem *menuItemNotebookLike = [[[NSMenuItem alloc] init] autorelease]; |
[menuItemNotebookLike setTitle: NSLocalizedString(@"Notebook-like",nil)]; |
[menuItemNotebookLike setTitle: NSLocalizedString(@"Notebook-like",nil)]; |
[menuItemNotebookLike setAction: @selector(setNotebookStyle:)]; |
[menuItemNotebookLike setAction: @selector(setNotebookStyle:)]; |
[menuItemNotebookLike setTarget: [[NSApp mainWindow] document]]; |
[menuItemNotebookLike setTarget: [[NSApp mainWindow] document]]; |
menuItemNotebookMode = menuItemNotebookLike; |
menuItemNotebookMode = menuItemNotebookLike; [menuItemNotebookMode retain]; |
[submenuInterfaceItem addItem: menuItemNotebookLike]; |
[submenuInterfaceItem addItem: menuItemNotebookLike]; |
|
|
menuItemInterfaceStyle = [[[NSMenuItem alloc] init] autorelease]; |
menuItemInterfaceStyle = [[[NSMenuItem alloc] init] autorelease]; |
Line 1150 int debugInbound = 0; |
|
Line 1346 int debugInbound = 0; |
|
// select engine |
// select engine |
NSMenu *submenuSelectEngineItem = [[[NSMenu alloc] init] autorelease]; |
NSMenu *submenuSelectEngineItem = [[[NSMenu alloc] init] autorelease]; |
// asir |
// asir |
menuItemRisaAsir = [[[NSMenuItem alloc] init] autorelease]; |
menuItemRisaAsir = [[[NSMenuItem alloc] init] autorelease]; [menuItemRisaAsir retain]; |
[menuItemRisaAsir setTitle: NSLocalizedString(@"Risa/Asir",nil)]; |
[menuItemRisaAsir setTitle: NSLocalizedString(@"Risa/Asir",nil)]; |
[menuItemRisaAsir setAction: @selector(setEngineRisaAsir:)]; |
[menuItemRisaAsir setAction: @selector(setEngineRisaAsir:)]; |
[menuItemRisaAsir setTarget: [[NSApp mainWindow] document]]; |
[menuItemRisaAsir setTarget: [[NSApp mainWindow] document]]; |
[submenuSelectEngineItem addItem: menuItemRisaAsir]; |
[submenuSelectEngineItem addItem: menuItemRisaAsir]; |
// notebook-like |
// notebook-like |
menuItemKanSm1 = [[[NSMenuItem alloc] init] autorelease]; |
menuItemKanSm1 = [[[NSMenuItem alloc] init] autorelease]; [menuItemKanSm1 retain]; |
[menuItemKanSm1 setTitle: NSLocalizedString(@"Kan/sm1",nil)]; |
[menuItemKanSm1 setTitle: NSLocalizedString(@"Kan/sm1",nil)]; |
[menuItemKanSm1 setAction: @selector(setEngineKanSm1:)]; |
[menuItemKanSm1 setAction: @selector(setEngineKanSm1:)]; |
[menuItemKanSm1 setTarget: [[NSApp mainWindow] document]]; |
[menuItemKanSm1 setTarget: [[NSApp mainWindow] document]]; |
Line 1168 int debugInbound = 0; |
|
Line 1364 int debugInbound = 0; |
|
[menuExec addItem: menuItemSelectEngine]; |
[menuExec addItem: menuItemSelectEngine]; |
[self updateSelectEngineMenu]; |
[self updateSelectEngineMenu]; |
|
|
|
// outputDebugMessage |
|
menuItemOutputDebugMessages = [[[NSMenuItem alloc] init] autorelease]; [menuItemOutputDebugMessages retain]; |
|
[menuItemOutputDebugMessages setTitle: NSLocalizedString(@"Output debug messages",nil)]; |
|
[menuItemOutputDebugMessages setAction: @selector(setDebugMyTunnel:)]; |
|
[menuItemOutputDebugMessages setTarget: [[NSApp mainWindow] document]]; |
|
[menuExec addItem: menuItemOutputDebugMessages]; |
|
|
|
// NoEngine |
|
menuItemNoEngine = [[[NSMenuItem alloc] init] autorelease]; [menuItemNoEngine retain]; // it is the static variable. |
|
[menuItemNoEngine setTitle: NSLocalizedString(@"Do not start engine at startup",nil)]; |
|
[menuItemNoEngine setAction: @selector(setNoEngine:)]; |
|
[menuItemNoEngine setTarget: [[NSApp mainWindow] document]]; |
|
[menuExec addItem: menuItemNoEngine]; |
|
|
// test |
// test |
menuItemForTest = [[[NSMenuItem alloc] init] autorelease]; |
menuItemForTest = [[[NSMenuItem alloc] init] autorelease]; |