declare new code editor view protocol, make the PCEditorView return the editor with a n accessor, make the project window access the undo manager that way

git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/apps/projectcenter/trunk@30551 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
Riccardo Mottola 2010-06-02 23:55:29 +00:00
parent 7928e2b4e5
commit 43211ec2b7
6 changed files with 76 additions and 5 deletions

View file

@ -1,3 +1,15 @@
2010-06-03 Riccardo Mottola <rmottola@users.sf.net>
* 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 <rmottola@users.sf.net>
* Modules\Editors\ProjectCenter\PCEditor.m,

View file

@ -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 <ProjectCenter/PCProjectInspector.h>
#import <Protocols/Preferences.h>
#import <Protocols/CodeEditorView.h>
#import <ProjectCenter/PCLogController.h>
#import "Modules/Preferences/Misc/PCMiscPrefs.h"
#import <math.h>
@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
// ============================================================================

View file

@ -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

View file

@ -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 <Foundation/Foundation.h>
#import <Protocols/CodeEditor.h>
@protocol CodeEditorView
- (id <CodeEditor>)editor;
@end

View file

@ -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 <AppKit/NSTextView.h>
#import <Protocols/CodeEditorView.h>
@class NSColor;
@class PCEditor;
@class SyntaxHighlighter;
@interface PCEditorView : NSTextView
@interface PCEditorView : NSTextView <CodeEditorView>
{
PCEditor *editor;
SyntaxHighlighter *highlighter;

View file

@ -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;