diff --git a/ChangeLog b/ChangeLog index 1824d20..8cdf8f4 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,15 @@ +2010-06-03 Riccardo Mottola + + * Headers/Protocols/CodeEditorView.h: + Declare new view protocol + + * Modules/Editors/ProjectCenter/PCEditorView.h + * Modules/Editors/ProjectCenter/PCEditorView.m: + Conform to CodeEditorView protocol and add accessor to the editor. + + * Framework/PCProjectWindow.m: + Return the view's editor undo manager. + 2010-06-01 Riccardo Mottola * Modules\Editors\ProjectCenter\PCEditor.m, diff --git a/Framework/PCProjectWindow.m b/Framework/PCProjectWindow.m index 395c432..6dd1e74 100644 --- a/Framework/PCProjectWindow.m +++ b/Framework/PCProjectWindow.m @@ -1,7 +1,7 @@ /* GNUstep ProjectCenter - http://www.gnustep.org/experience/ProjectCenter.html - Copyright (C) 2000-2004 Free Software Foundation + Copyright (C) 2000-2010 Free Software Foundation Authors: Philippe C.D. Robert Serg Stoyan @@ -38,10 +38,12 @@ #import #import +#import #import #import "Modules/Preferences/Misc/PCMiscPrefs.h" + #import @implementation PCProjectWindow @@ -756,6 +758,18 @@ { } +- (NSUndoManager *)windowWillReturnUndoManager:(NSWindow *)window +{ + id responder; + + responder = [window firstResponder]; + if ([responder conformsToProtocol: @protocol(CodeEditorView)]) + { + return [[responder editor] windowWillReturnUndoManager: window]; + } + return nil; +} + // ============================================================================ // ==== SplitView delegate // ============================================================================ diff --git a/GNUmakefile b/GNUmakefile index 1014726..84f7343 100644 --- a/GNUmakefile +++ b/GNUmakefile @@ -16,7 +16,7 @@ include $(GNUSTEP_MAKEFILES)/common.make # # Main application # -VERSION = 0.5.3 +VERSION = 0.6.0 APP_NAME = ProjectCenter ProjectCenter_APPLICATION_ICON = Images/ProjectCenter.tiff diff --git a/Headers/Protocols/CodeEditorView.h b/Headers/Protocols/CodeEditorView.h new file mode 100644 index 0000000..c59ce36 --- /dev/null +++ b/Headers/Protocols/CodeEditorView.h @@ -0,0 +1,33 @@ +/* + GNUstep ProjectCenter - http://www.gnustep.org/experience/ProjectCenter.html + + Copyright (C) 2010 Free Software Foundation + + Authors: Riccardo Mottola + + This file is part of GNUstep. + + This application is free software; you can redistribute it and/or + modify it under the terms of the GNU General Public + License as published by the Free Software Foundation; either + version 2 of the License, or (at your option) any later version. + + This application is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Library General Public License for more details. + + You should have received a copy of the GNU General Public + License along with this library; if not, write to the Free + Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111 USA. +*/ + +#import + +#import + +@protocol CodeEditorView + +- (id )editor; + +@end diff --git a/Modules/Editors/ProjectCenter/PCEditorView.h b/Modules/Editors/ProjectCenter/PCEditorView.h index 3f52e60..d58efd4 100644 --- a/Modules/Editors/ProjectCenter/PCEditorView.h +++ b/Modules/Editors/ProjectCenter/PCEditorView.h @@ -4,7 +4,9 @@ Interface declaration of the EditorTextView class for the ProjectManager application. - Copyright (C) 2005 Saso Kiselkov + Copyright (C) 2005-2010 Free Software Foundation + Saso Kiselkov + Riccardo Mottola This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -23,11 +25,13 @@ #import +#import + @class NSColor; @class PCEditor; @class SyntaxHighlighter; -@interface PCEditorView : NSTextView +@interface PCEditorView : NSTextView { PCEditor *editor; SyntaxHighlighter *highlighter; diff --git a/Modules/Editors/ProjectCenter/PCEditorView.m b/Modules/Editors/ProjectCenter/PCEditorView.m index 7a99824..40eaeb8 100644 --- a/Modules/Editors/ProjectCenter/PCEditorView.m +++ b/Modules/Editors/ProjectCenter/PCEditorView.m @@ -4,7 +4,10 @@ Implementation of the PCEditorView class for the ProjectManager application. - Copyright (C) 2005 Saso Kiselkov, Serg Stoyan + Copyright (C) 2005-2010 Free Software Foundation + Saso Kiselkov + Serg Stoyan + Riccardo Mottola This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -441,6 +444,11 @@ static int ComputeIndentingOffset(NSString * string, unsigned int start) editor = anEditor; } +- (PCEditor *)editor +{ + return editor; +} + - (void)awakeFromNib { /* NSData * data;