"Fossies" - the Fresh Open Source Software Archive  

Source code changes of the file "src/Plugins/Cocoa/TMView.mm" between
TeXmacs-1.99.4-src.tar.gz and TeXmacs-1.99.5-src.tar.gz

About: GNU TeXmacs is a what-you-see-is-what-you-get scientific text editor, which was both inspired by TeX and GNU Emacs.

TMView.mm  (TeXmacs-1.99.4-src):TMView.mm  (TeXmacs-1.99.5-src)
skipping to change at line 163 skipping to change at line 163
} }
- (id)initWithFrame:(NSRect)frame { - (id)initWithFrame:(NSRect)frame {
self = [super initWithFrame:frame]; self = [super initWithFrame:frame];
if (self) { if (self) {
// Initialization code here. // Initialization code here.
wid = NULL; wid = NULL;
processingCompose = NO; processingCompose = NO;
workingText = nil; workingText = nil;
delayed_rects = [[NSMutableArray arrayWithCapacity:100] retain]; delayed_rects = [[NSMutableArray arrayWithCapacity:100] retain];
} }
return self; return self;
} }
-(void) dealloc -(void) dealloc
{ {
[delayed_rects release]; [delayed_rects release];
[self deleteWorkingText]; [self deleteWorkingText];
[[NSNotificationCenter defaultCenter] removeObserver: self [[NSNotificationCenter defaultCenter] removeObserver: self
name: @"NSWindowDidBecomeKeyNo tification" name: @"NSWindowDidBecomeKeyNo tification"
skipping to change at line 273 skipping to change at line 272
{ {
NSRect bounds = [self bounds]; NSRect bounds = [self bounds];
[[NSColor blackColor] set]; [[NSColor blackColor] set];
[NSBezierPath strokeRect:NSInsetRect(bounds,1,1)]; [NSBezierPath strokeRect:NSInsetRect(bounds,1,1)];
// return; // return;
} }
// debug_events << "DRAWING : " << rect.origin.x << ","<< rect.origin.x << " ,"<< rect.size.width<< "," << rect.size.height << "\n"; // debug_events << "DRAWING : " << rect.origin.x << ","<< rect.origin.x << " ,"<< rect.size.width<< "," << rect.size.height << "\n";
// NSRect bounds = [self bounds]; // NSRect bounds = [self bounds];
{ {
basic_renderer r = the_aqua_renderer(); aqua_renderer_rep* r = the_aqua_renderer();
int x1 = rect.origin.x; int x1 = rect.origin.x;
int y1 = rect.origin.y+rect.size.height; int y1 = rect.origin.y+rect.size.height;
int x2 = rect.origin.x+rect.size.width; int x2 = rect.origin.x+rect.size.width;
int y2 = rect.origin.y; int y2 = rect.origin.y;
r -> begin([NSGraphicsContext currentContext]); r -> begin ([NSGraphicsContext currentContext]);
// r -> set_origin(0,0); r -> view = self;
r -> set_origin (0,0);
r -> encode (x1,y1); r -> encode (x1,y1);
r -> encode (x2,y2); r -> encode (x2,y2);
// debug_events << "DRAWING RECT " << x1 << "," << y1 << "," << x2 << "," << // debug_events << "DRAWING RECT " << x1 << "," << y1 << "," << x2 << "," <<
y2 << LF; y2 << LF;
r -> set_clipping (x1,y1,x2,y2); r -> set_clipping (x1, y1, x2, y2);
wid->handle_repaint (x1,y1,x2,y2); wid->handle_repaint (r, x1, y1, x2, y2);
r->end(); r -> end ();
if (gui_interrupted()) if (gui_interrupted ())
aqua_update_flag= true; aqua_update_flag= true;
} }
// debug_events << "END DRAWING" << "\n"; // debug_events << "END DRAWING" << "\n";
if (aqua_update_flag) { if (aqua_update_flag) {
if (DEBUG_EVENTS) if (DEBUG_EVENTS)
debug_events << "Postponed redrawing\n"; debug_events << "Postponed redrawing\n";
[self performSelector:@selector(delayedUpdate) withObject: nil afterDelay: 1 0]; [self performSelector:@selector(delayedUpdate) withObject: nil afterDelay: 1 0];
} }
} }
skipping to change at line 367 skipping to change at line 367
- (void)keyDown:(NSEvent *)theEvent - (void)keyDown:(NSEvent *)theEvent
{ {
if (!wid) return; if (!wid) return;
time_credit= 25; time_credit= 25;
timeout_time= texmacs_time () + time_credit; timeout_time= texmacs_time () + time_credit;
static bool fInit = false; static bool fInit = false;
if (!fInit) { if (!fInit) {
if (DEBUG_EVENTS) if (DEBUG_EVENTS)
debug_events << "Initializing keymap\n"; debug_events << "Initializing keymap\n";
initkeymap(); initkeymap ();
fInit= true; fInit = true;
} }
{ {
// char str[256]; // char str[256];
string r; string r;
NSString *nss = [theEvent charactersIgnoringModifiers]; NSString *nss = [theEvent charactersIgnoringModifiers];
unsigned int mods = [theEvent modifierFlags]; unsigned int mods = [theEvent modifierFlags];
string modstr; string modstr;
skipping to change at line 522 skipping to change at line 522
- (BOOL)isOpaque - (BOOL)isOpaque
{ {
return YES; return YES;
} }
- (void)resizeWithOldSuperviewSize:(NSSize)oldBoundsSize - (void)resizeWithOldSuperviewSize:(NSSize)oldBoundsSize
{ {
[super resizeWithOldSuperviewSize:oldBoundsSize]; [super resizeWithOldSuperviewSize:oldBoundsSize];
if (wid) { if (wid) {
NSSize size = [self bounds].size; NSSize size = [self bounds].size;
scaleSize(size); scaleSize (size);
wid-> handle_notify_resize (size.width, size.height); wid-> handle_notify_resize (size.width, size.height);
} }
} }
- (BOOL)acceptsFirstResponder - (BOOL)acceptsFirstResponder
{ {
return YES; return YES;
} }
- (void) deleteWorkingText - (void) deleteWorkingText
{ {
if (workingText == nil) if (workingText == nil) return;
return;
[workingText release]; [workingText release];
workingText = nil; workingText = nil;
processingCompose = NO; processingCompose = NO;
} }
#pragma mark NSTextInput protocol implementation #pragma mark NSTextInput protocol implementation
- (void) insertText:(id)aString - (void) insertText:(id)aString
// instead of keyDown: aString can be NSString or NSAttributedString // instead of keyDown: aString can be NSString or NSAttributedString
{ {
processingCompose = NO; processingCompose = NO;
NSLog(@"insertText: <%@>",aString); NSLog(@"insertText: <%@>",aString);
skipping to change at line 588 skipping to change at line 585
workingText = [str copy]; workingText = [str copy];
processingCompose = YES; processingCompose = YES;
NSLog(@"setMarkedText: <%@>",workingText); NSLog(@"setMarkedText: <%@>",workingText);
} }
- (void) unmarkText - (void) unmarkText
{ {
[self deleteWorkingText]; [self deleteWorkingText];
} }
- (BOOL) hasMarkedText - (BOOL) hasMarkedText
{ {
return workingText != nil; return workingText != nil;
} }
- (NSInteger) conversationIdentifier - (NSInteger) conversationIdentifier
{ {
return (NSInteger)self; return (NSInteger)self;
} }
/* Returns attributed string at the range. This allows input mangers to query a ny range in backing-store. May return nil. /* Returns attributed string at the range. This allows input mangers to query a ny range in backing-store. May return nil.
*/ */
- (NSAttributedString *) attributedSubstringFromRange:(NSRange)theRange - (NSAttributedString *) attributedSubstringFromRange:(NSRange)theRange
{ {
static NSAttributedString *str = nil; static NSAttributedString *str = nil;
 End of changes. 12 change blocks. 
19 lines changed or deleted 18 lines changed or added

Home  |  About  |  All  |  Newest  |  Fossies Dox  |  Screenshots  |  Comments  |  Imprint  |  Privacy  |  HTTPS