mirror of
https://github.com/gnustep/apps-projectcenter.git
synced 2025-03-14 06:31:31 +00:00
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:
parent
7928e2b4e5
commit
43211ec2b7
6 changed files with 76 additions and 5 deletions
12
ChangeLog
12
ChangeLog
|
@ -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,
|
||||
|
|
|
@ -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
|
||||
// ============================================================================
|
||||
|
|
|
@ -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
|
||||
|
||||
|
|
33
Headers/Protocols/CodeEditorView.h
Normal file
33
Headers/Protocols/CodeEditorView.h
Normal 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
|
|
@ -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;
|
||||
|
|
|
@ -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;
|
||||
|
|
Loading…
Reference in a new issue