From 7c741d63e6d6f69c30aa9b37d088c204b6d43892 Mon Sep 17 00:00:00 2001 From: Riccardo Mottola Date: Tue, 29 Jun 2021 23:42:52 +0200 Subject: [PATCH] more work on debuggerWrappe --- Modules/Debuggers/ProjectCenter/GDBWrapper.h | 8 ++--- Modules/Debuggers/ProjectCenter/GDBWrapper.m | 8 ++--- Modules/Debuggers/ProjectCenter/GNUmakefile | 8 ++--- Modules/Debuggers/ProjectCenter/PCDebugger.m | 32 ++++++++--------- .../Debuggers/ProjectCenter/PCDebuggerView.h | 10 +++--- .../Debuggers/ProjectCenter/PCDebuggerView.m | 34 +++++++++---------- .../ProjectCenter/PCDebuggerWrapperProtocol.h | 6 ++-- 7 files changed, 53 insertions(+), 53 deletions(-) diff --git a/Modules/Debuggers/ProjectCenter/GDBWrapper.h b/Modules/Debuggers/ProjectCenter/GDBWrapper.h index 75648ec..3bdef14 100644 --- a/Modules/Debuggers/ProjectCenter/GDBWrapper.h +++ b/Modules/Debuggers/ProjectCenter/GDBWrapper.h @@ -1,7 +1,7 @@ /* -** PipeDelegate +** GDBWrapper ** -** Copyright (c) 2008-2016 +** Copyright (c) 2008-2021 ** ** Author: Gregory Casamento ** Riccardo Mottola @@ -24,7 +24,7 @@ #import #import -#import "PCDebuggerViewDelegateProtocol.h" +#import "PCDebuggerWrapperProtocol.h" typedef enum PCDebuggerOutputType_enum { PCDBNotFoundRecord = 0, @@ -42,7 +42,7 @@ typedef enum PCDebuggerOutputType_enum { PCDBEmptyRecord } PCDebuggerOutputTypes; -@interface PipeDelegate : NSObject +@interface GDBWrapper : NSObject { PCDebugger *debugger; NSTextView *tView; diff --git a/Modules/Debuggers/ProjectCenter/GDBWrapper.m b/Modules/Debuggers/ProjectCenter/GDBWrapper.m index 3e34e0f..b9fea88 100644 --- a/Modules/Debuggers/ProjectCenter/GDBWrapper.m +++ b/Modules/Debuggers/ProjectCenter/GDBWrapper.m @@ -1,7 +1,7 @@ /* -** PipeDelegate.m +** GDBWrapper.m ** -** Copyright (c) 2008-2020 Free Software Foundation +** Copyright (c) 2008-2021 Free Software Foundation ** ** Author: Gregory Casamento ** Riccardo Mottola @@ -35,14 +35,14 @@ #include #include -#import "PipeDelegate.h" +#import "GDBWrapper.h" #import "PCDebugger.h" #ifndef NOTIFICATION_CENTER #define NOTIFICATION_CENTER [NSNotificationCenter defaultCenter] #endif -@implementation PipeDelegate +@implementation GDBWrapper - (id)init diff --git a/Modules/Debuggers/ProjectCenter/GNUmakefile b/Modules/Debuggers/ProjectCenter/GNUmakefile index 5f629d8..e044d63 100644 --- a/Modules/Debuggers/ProjectCenter/GNUmakefile +++ b/Modules/Debuggers/ProjectCenter/GNUmakefile @@ -37,9 +37,9 @@ ProjectCenter_RESOURCE_FILES= \ # ProjectCenter_HEADERS= \ PCDebugger.h \ - PCDebugggerView.h \ - PCDebuggerViewDelegateProtocol.h \ - PipeDelegate.h + PCDebuggerView.h \ + PCDebuggerWrapperProtocol.h \ + GDBWrapper.h # # Class files @@ -47,7 +47,7 @@ ProjectCenter_HEADERS= \ ProjectCenter_OBJC_FILES= \ PCDebugger.m \ PCDebuggerView.m \ - PipeDelegate.m + GDBWrapper.m #ADDITIONAL_OBJC_LIBS= diff --git a/Modules/Debuggers/ProjectCenter/PCDebugger.m b/Modules/Debuggers/ProjectCenter/PCDebugger.m index 2ac5776..52e4b90 100644 --- a/Modules/Debuggers/ProjectCenter/PCDebugger.m +++ b/Modules/Debuggers/ProjectCenter/PCDebugger.m @@ -34,8 +34,8 @@ #import "PCDebuggerView.h" #import "Modules/Preferences/EditorFSC/PCEditorFSCPrefs.h" -#import "PCDebuggerViewDelegateProtocol.h" -#import "PipeDelegate.h" +#import "PCDebuggerWrapperProtocol.h" +#import "GDBWrapper.h" #ifndef NOTIFICATION_CENTER @@ -140,7 +140,7 @@ NSString *PCDBDebuggerStartedNotification = @"PCDBDebuggerStartedNotification"; if((self = [super init]) != nil) { NSLog(@"PCDebugger Init"); - id viewDelegate; + id debuggerWrapper; // initialization here... if([NSBundle loadNibNamed: @"PCDebugger" owner: self] == NO) { @@ -148,11 +148,11 @@ NSString *PCDBDebuggerStartedNotification = @"PCDBDebuggerStartedNotification"; } [(PCDebuggerView *)debuggerView setDebugger:self]; - viewDelegate = [[PipeDelegate alloc] init]; - [debuggerView setDelegate:viewDelegate]; - [viewDelegate setTextView:debuggerView]; - [viewDelegate setDebugger:self]; - [viewDelegate release]; + debuggerWrapper = [[GDBWrapper alloc] init]; + [debuggerView setDebuggerWrapper:debuggerWrapper]; + [debuggerWrapper setTextView:debuggerView]; + [debuggerWrapper setDebugger:self]; + [debuggerWrapper release]; [debuggerView setFont: [self consoleFont]]; subProcessId = 0; @@ -190,15 +190,15 @@ NSString *PCDBDebuggerStartedNotification = @"PCDBDebuggerStartedNotification"; - (void) startDebugger { [debuggerView runProgram: debuggerPath - inCurrentDirectory: [executablePath stringByDeletingLastPathComponent] - withArguments: [[NSArray alloc] initWithObjects: @"--interpreter=mi", @"-f", executablePath, nil] // gdb dependent - should be generalized + inCurrentDirectory: [executablePath stringByDeletingLastPathComponent] + withArguments: [[NSArray alloc] initWithObjects: @"--interpreter=mi", @"-f", executablePath, nil] // FIXME gdb dependent - should be generalized in the wrapepr logStandardError: YES]; } - (void) initBreakpoints { - id viewDelegate; + id debuggerWrapper; breakpoints = [[NSMutableArray alloc] init]; /* CRUDE EXAMPLES * TODO FIXME * @@ -211,15 +211,15 @@ NSString *PCDBDebuggerStartedNotification = @"PCDBDebuggerStartedNotification"; [breakpoints addObject:dP]; */ - viewDelegate = [debuggerView delegate]; - [viewDelegate setBreakpoints:breakpoints]; + debuggerWrapper = [debuggerView debuggerWrapper]; + [debuggerWrapper setBreakpoints:breakpoints]; } - (void) debuggerSetup { - id viewDelegate; - viewDelegate = [debuggerView delegate]; - [viewDelegate debuggerSetup]; + id debuggerWrapper; + debuggerWrapper = [debuggerView debuggerWrapper]; + [debuggerWrapper debuggerSetup]; } - (void) handleNotification: (NSNotification *)notification diff --git a/Modules/Debuggers/ProjectCenter/PCDebuggerView.h b/Modules/Debuggers/ProjectCenter/PCDebuggerView.h index e99e00a..62c0f39 100644 --- a/Modules/Debuggers/ProjectCenter/PCDebuggerView.h +++ b/Modules/Debuggers/ProjectCenter/PCDebuggerView.h @@ -1,7 +1,7 @@ /* ** PCDebuggerView ** -** Copyright (c) 2008-2020 +** Copyright (c) 2008-2021 ** ** Author: Gregory Casamento ** Riccardo Mottola @@ -24,20 +24,20 @@ #import #import -#import "PCDebuggerViewDelegateProtocol.h" +#import "PCDebuggerWrapperProtocol.h" @class PCDebugger; @interface PCDebuggerView : NSTextView { PCDebugger *debugger; - id viewDelegate; + id debuggerWrapper; NSString *currentFile; } - (void) setDebugger:(PCDebugger *)theDebugger; -- (id )delegate; -- (void) setDelegate:(id ) vd; +- (id )debuggerWrapper; +- (void) setDebuggerWrapper:(id ) dw; - (void) setCurrentFile: (NSString *)fileName; - (NSString *) currentFile; diff --git a/Modules/Debuggers/ProjectCenter/PCDebuggerView.m b/Modules/Debuggers/ProjectCenter/PCDebuggerView.m index 642506e..89eed1c 100644 --- a/Modules/Debuggers/ProjectCenter/PCDebuggerView.m +++ b/Modules/Debuggers/ProjectCenter/PCDebuggerView.m @@ -1,7 +1,7 @@ /* ** PCDebuggerView ** -** Copyright (c) 2008-2016 +** Copyright (c) 2008-2021 ** ** Author: Gregory Casamento ** Riccardo Mottola @@ -41,25 +41,25 @@ debugger = theDebugger; } -- (id )delegate +- (id )debuggerWrapper { - return viewDelegate; + return debuggerWrapper; } -- (void) setDelegate:(id ) vd +- (void) setDebuggerWrapper:(id ) dw { - if (viewDelegate != vd) + if (debuggerWrapper != dw) { - [viewDelegate release]; - viewDelegate = vd; - [viewDelegate retain]; + [debuggerWrapper release]; + debuggerWrapper = dw; + [debuggerWrapper retain]; } } - (void)setFont:(NSFont *)aFont { - [viewDelegate setFont:aFont]; + [debuggerWrapper setFont:aFont]; } /** @@ -68,7 +68,7 @@ - (void) logString:(NSString *)str newLine:(BOOL)newLine { - [viewDelegate logString: str newLine: newLine withColor:[viewDelegate debuggerColor]]; + [debuggerWrapper logString: str newLine: newLine withColor:[debuggerWrapper debuggerColor]]; } - (void) setCurrentFile: (NSString *)fileName @@ -83,7 +83,7 @@ - (void) terminate { - [viewDelegate terminate]; + [debuggerWrapper terminate]; } - (void) mouseDown: (NSEvent *)event @@ -99,10 +99,10 @@ withArguments: (NSArray *)array logStandardError: (BOOL)logError { - [viewDelegate runProgram: path - inCurrentDirectory: directory - withArguments: array - logStandardError: logError]; + [debuggerWrapper runProgram: path + inCurrentDirectory: directory + withArguments: array + logStandardError: logError]; } - (void) putString: (NSString *)string @@ -110,12 +110,12 @@ NSAttributedString* attr = [[NSAttributedString alloc] initWithString:string]; [[self textStorage] appendAttributedString:attr]; [self scrollRangeToVisible:NSMakeRange([[self string] length], 0)]; - [viewDelegate putString:string]; + [debuggerWrapper putString:string]; } - (void) keyDown: (NSEvent*)theEvent { - [viewDelegate keyDown:theEvent]; + [debuggerWrapper keyDown:theEvent]; } @end diff --git a/Modules/Debuggers/ProjectCenter/PCDebuggerWrapperProtocol.h b/Modules/Debuggers/ProjectCenter/PCDebuggerWrapperProtocol.h index 8debdae..1ce53cb 100644 --- a/Modules/Debuggers/ProjectCenter/PCDebuggerWrapperProtocol.h +++ b/Modules/Debuggers/ProjectCenter/PCDebuggerWrapperProtocol.h @@ -1,7 +1,7 @@ /* -** PCDebuggerViewDelegateProtocol.h +** PCDebuggerWrapperProtocol.h ** -** Copyright (c) 2016-2020 +** Copyright (c) 2016-2021 ** ** Author: Riccardo Mottola ** @@ -28,7 +28,7 @@ @class NSString; @class PCDebugger; -@protocol PCDebuggerViewDelegateProtocol +@protocol PCDebuggerWrapperProtocol - (void)setFont:(NSFont *)font;