diff --git a/ChangeLog b/ChangeLog index 0eda9e8..cc105da 100644 --- a/ChangeLog +++ b/ChangeLog @@ -9,7 +9,9 @@ PCFindController.m, PCMenuController.h, PCMenuController.m, PCPrefController.m, PCPrefController.h * Extracting UI creation into category: PCPrefController+UInterface.h, - PCPrefController+UInterface.m, PCPrefController.m, PCPrefController.h + PCPrefController+UInterface.m, PCPrefController.m, PCPrefController.h, + PCLib/PCProjectDebugger+UInterface.h, PCLib/PCProjectDebugger.h, + PCLib/PCProjectDebugger+UInterface.m, PCLib/PCProjectDebugger.m * Disabling unused menu entries using defines: ProjectCenter_main.m 2003-07-04 Philippe C.D. Robert diff --git a/PCLib/GNUmakefile b/PCLib/GNUmakefile index 06397ea..79fcd49 100644 --- a/PCLib/GNUmakefile +++ b/PCLib/GNUmakefile @@ -10,7 +10,6 @@ include $(GNUSTEP_MAKEFILES)/common.make include Version -GNUSTEP_INSTALLATION_DIR = $(GNUSTEP_SYSTEM_ROOT) # @@ -45,7 +44,6 @@ libProjectCenter_LIBRARIES_DEPEND_UPON += -lgnustep-gui # libProjectCenter_HEADER_FILES= \ -PCButton.h \ PCBrowserController.h \ PCBundleLoader.h \ PCDataSource.h \ @@ -79,14 +77,14 @@ PCEditor+UInterface.h \ PCFileManager+UInterface.h \ PCProjectManager+UInterface.h \ PCProject+UInterface.h \ -PCTextFinder+UInterface.h +PCTextFinder+UInterface.h \ +PCProjectDebugger+UInterface.h # # Class files # libProjectCenter_OBJC_FILES= \ -PCButton.m \ PCBrowserController.m \ PCBundleLoader.m \ PCDataSource.m \ @@ -110,7 +108,8 @@ PCEditor+UInterface.m \ PCFileManager+UInterface.m \ PCProjectManager+UInterface.m \ PCProject+UInterface.m \ -PCTextFinder+UInterface.m +PCTextFinder+UInterface.m \ +PCProjectDebugger+UInterface.m # # C files diff --git a/PCLib/PCProjectDebugger+UInterface.h b/PCLib/PCProjectDebugger+UInterface.h new file mode 100644 index 0000000..ab087bd --- /dev/null +++ b/PCLib/PCProjectDebugger+UInterface.h @@ -0,0 +1,40 @@ +/* + GNUstep ProjectCenter - http://www.gnustep.org + + Copyright (C) 2000-2002 Free Software Foundation + + Author: Philippe C.D. Robert + + 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. + + $Id$ +*/ + +#ifndef __PCPROJECTDEBUGGER_UINTERFACE_H +#define __PCPROJECTDEBUGGER_UINTERFACE_H + +#include "PCProjectDebugger.h" + +@interface PCProjectDebugger (UInterface) + +- (void)_createLaunchPanel; +- (void)_createComponentView; + +@end + +#endif + diff --git a/PCLib/PCProjectDebugger+UInterface.m b/PCLib/PCProjectDebugger+UInterface.m new file mode 100644 index 0000000..5ad448e --- /dev/null +++ b/PCLib/PCProjectDebugger+UInterface.m @@ -0,0 +1,140 @@ +/* + GNUstep ProjectCenter - http://www.gnustep.org + + Copyright (C) 2003 Free Software Foundation + + Author: Philippe C.D. Robert + + 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. + + $Id$ +*/ + +#include "PCProjectDebugger.h" +#include "PCProjectDebugger+UInterface.h" +#include "PCProject.h" +#include "PCButton.h" + +#include + +#ifndef IMAGE +#define IMAGE(X) [[[NSImage alloc] initWithContentsOfFile:[[NSBundle mainBundle] pathForImageResource:(X)]] autorelease] +#endif + +@implementation PCProjectDebugger (UInterface) + +- (void) _createLaunchPanel +{ + launchPanel = [[NSPanel alloc] + initWithContentRect: NSMakeRect (0, 300, 480, 322) + styleMask: (NSTitledWindowMask + | NSClosableWindowMask + | NSResizableWindowMask) + backing: NSBackingStoreRetained + defer: YES]; + [launchPanel setMinSize: NSMakeSize(400, 160)]; + [launchPanel setFrameAutosaveName: @"ProjectLauncher"]; + [launchPanel setReleasedWhenClosed: NO]; + [launchPanel setHidesOnDeactivate: NO]; + [launchPanel setTitle: [NSString + stringWithFormat: @"%@ - Launch", [currentProject projectName]]]; + + if (![launchPanel setFrameUsingName: @"ProjectLauncher"]) + { + [launchPanel center]; + } +} + +- (void)_createComponentView +{ + NSScrollView *scrollView; + NSString *string; + NSAttributedString *attributedString; + + componentView = [[NSBox alloc] initWithFrame:NSMakeRect(8,-1,464,322)]; + [componentView setTitlePosition:NSNoTitle]; + [componentView setBorderType:NSNoBorder]; + [componentView setAutoresizingMask:NSViewWidthSizable | NSViewHeightSizable]; + [componentView setContentViewMargins: NSMakeSize(0.0,0.0)]; + + /* + * Top buttons + */ +// _w_frame = NSMakeRect(0, 270, 88, 44); + + runButton = [[PCButton alloc] initWithFrame: NSMakeRect(0,264,50,50)]; + [runButton setTitle: @"Run"]; + [runButton setImage: IMAGE(@"ProjectCenter_run")]; + [runButton setAlternateImage: IMAGE(@"Stop")]; + [runButton setTarget: self]; + [runButton setAction: @selector(run:)]; + [runButton setAutoresizingMask: (NSViewMaxXMargin | NSViewMinYMargin)]; + [runButton setButtonType: NSToggleButton]; + [componentView addSubview: runButton]; + RELEASE (runButton); + + debugButton = [[PCButton alloc] initWithFrame: NSMakeRect(50,264,50,50)]; + [debugButton setTitle: @"Debug"]; + [debugButton setImage: IMAGE(@"ProjectCenter_debug")]; + [debugButton setAlternateImage: IMAGE(@"Stop")]; + [debugButton setTarget: self]; + [debugButton setAction: @selector(debug:)]; + [debugButton setAutoresizingMask: (NSViewMaxXMargin | NSViewMinYMargin)]; + [debugButton setButtonType: NSToggleButton]; + [componentView addSubview: debugButton]; + RELEASE (debugButton); + + /* + * + */ + scrollView = [[NSScrollView alloc] initWithFrame:NSMakeRect (0,-1,464,253)]; + + [scrollView setHasHorizontalScroller:NO]; + [scrollView setHasVerticalScroller:YES]; + [scrollView setBorderType: NSBezelBorder]; + [scrollView setAutoresizingMask:(NSViewWidthSizable | NSViewHeightSizable)]; + + stdOut=[[NSTextView alloc] initWithFrame:[[scrollView contentView] frame]]; + + [stdOut setMinSize: NSMakeSize(0, 0)]; + [stdOut setMaxSize: NSMakeSize(1e7, 1e7)]; + [stdOut setRichText:YES]; + [stdOut setEditable:NO]; + [stdOut setSelectable:YES]; + [stdOut setVerticallyResizable: YES]; + [stdOut setHorizontallyResizable: NO]; + [stdOut setAutoresizingMask: NSViewWidthSizable | NSViewHeightSizable]; + [[stdOut textContainer] setWidthTracksTextView:YES]; + [[stdOut textContainer] setContainerSize: + NSMakeSize([stdOut frame].size.width, 1e7)]; + + // Font + string = [NSString stringWithString:@"=== Launcher ready ==="]; + attributedString = + [[NSAttributedString alloc] initWithString:string + attributes:textAttributes]; + [[stdOut textStorage] setAttributedString:attributedString]; + + [scrollView setDocumentView:stdOut]; + RELEASE (stdOut); + + [componentView addSubview: scrollView]; + RELEASE(scrollView); +} + +@end + diff --git a/PCLib/PCProjectDebugger.h b/PCLib/PCProjectDebugger.h index aaa4166..48a229e 100644 --- a/PCLib/PCProjectDebugger.h +++ b/PCLib/PCProjectDebugger.h @@ -24,6 +24,9 @@ $Id$ */ +#ifndef __PCPROJECTDEBUGGER_H +#define __PCPROJECTDEBUGGER_H + #include #ifndef GNUSTEP_BASE_VERSION @@ -83,3 +86,6 @@ - (void)logData:(NSData *)data error:(BOOL)yn; @end + +#endif + diff --git a/PCLib/PCProjectDebugger.m b/PCLib/PCProjectDebugger.m index 6f2f01b..cabfe65 100644 --- a/PCLib/PCProjectDebugger.m +++ b/PCLib/PCProjectDebugger.m @@ -25,6 +25,7 @@ */ #include "PCProjectDebugger.h" +#include "PCProjectDebugger+UInterface.h" #include "PCDefines.h" #include "PCProject.h" #include "PCProjectManager.h" @@ -32,10 +33,6 @@ #include -#ifndef IMAGE -#define IMAGE(X) [[[NSImage alloc] initWithContentsOfFile:[[NSBundle mainBundle] pathForImageResource:(X)]] autorelease] -#endif - #ifndef NOTIFICATION_CENTER #define NOTIFICATION_CENTER [NSNotificationCenter defaultCenter] #endif @@ -45,116 +42,6 @@ enum { DEBUG_DEBUG_TARGET = 2 }; -@interface PCProjectDebugger (CreateUI) - -- (void)_createLaunchPanel; -- (void)_createComponentView; - -@end - -@implementation PCProjectDebugger (CreateUI) - -- (void) _createLaunchPanel -{ - launchPanel = [[NSPanel alloc] - initWithContentRect: NSMakeRect (0, 300, 480, 322) - styleMask: (NSTitledWindowMask - | NSClosableWindowMask - | NSResizableWindowMask) - backing: NSBackingStoreRetained - defer: YES]; - [launchPanel setMinSize: NSMakeSize(400, 160)]; - [launchPanel setFrameAutosaveName: @"ProjectLauncher"]; - [launchPanel setReleasedWhenClosed: NO]; - [launchPanel setHidesOnDeactivate: NO]; - [launchPanel setTitle: [NSString - stringWithFormat: @"%@ - Launch", [currentProject projectName]]]; - - if (![launchPanel setFrameUsingName: @"ProjectLauncher"]) - { - [launchPanel center]; - } -} - -- (void)_createComponentView -{ - NSScrollView *scrollView; - NSString *string; - NSAttributedString *attributedString; - - componentView = [[NSBox alloc] initWithFrame:NSMakeRect(8,-1,464,322)]; - [componentView setTitlePosition:NSNoTitle]; - [componentView setBorderType:NSNoBorder]; - [componentView setAutoresizingMask:NSViewWidthSizable | NSViewHeightSizable]; - [componentView setContentViewMargins: NSMakeSize(0.0,0.0)]; - - /* - * Top buttons - */ -// _w_frame = NSMakeRect(0, 270, 88, 44); - - runButton = [[PCButton alloc] initWithFrame: NSMakeRect(0,264,50,50)]; - [runButton setTitle: @"Run"]; - [runButton setImage: IMAGE(@"ProjectCenter_run")]; - [runButton setAlternateImage: IMAGE(@"Stop")]; - [runButton setTarget: self]; - [runButton setAction: @selector(run:)]; - [runButton setAutoresizingMask: (NSViewMaxXMargin | NSViewMinYMargin)]; - [runButton setButtonType: NSToggleButton]; - [componentView addSubview: runButton]; - RELEASE (runButton); - - debugButton = [[PCButton alloc] initWithFrame: NSMakeRect(50,264,50,50)]; - [debugButton setTitle: @"Debug"]; - [debugButton setImage: IMAGE(@"ProjectCenter_debug")]; - [debugButton setAlternateImage: IMAGE(@"Stop")]; - [debugButton setTarget: self]; - [debugButton setAction: @selector(debug:)]; - [debugButton setAutoresizingMask: (NSViewMaxXMargin | NSViewMinYMargin)]; - [debugButton setButtonType: NSToggleButton]; - [componentView addSubview: debugButton]; - RELEASE (debugButton); - - /* - * - */ - scrollView = [[NSScrollView alloc] initWithFrame:NSMakeRect (0,-1,464,253)]; - - [scrollView setHasHorizontalScroller:NO]; - [scrollView setHasVerticalScroller:YES]; - [scrollView setBorderType: NSBezelBorder]; - [scrollView setAutoresizingMask:(NSViewWidthSizable | NSViewHeightSizable)]; - - stdOut=[[NSTextView alloc] initWithFrame:[[scrollView contentView] frame]]; - - [stdOut setMinSize: NSMakeSize(0, 0)]; - [stdOut setMaxSize: NSMakeSize(1e7, 1e7)]; - [stdOut setRichText:YES]; - [stdOut setEditable:NO]; - [stdOut setSelectable:YES]; - [stdOut setVerticallyResizable: YES]; - [stdOut setHorizontallyResizable: NO]; - [stdOut setAutoresizingMask: NSViewWidthSizable | NSViewHeightSizable]; - [[stdOut textContainer] setWidthTracksTextView:YES]; - [[stdOut textContainer] setContainerSize: - NSMakeSize([stdOut frame].size.width, 1e7)]; - - // Font - string = [NSString stringWithString:@"=== Launcher ready ==="]; - attributedString = - [[NSAttributedString alloc] initWithString:string - attributes:textAttributes]; - [[stdOut textStorage] setAttributedString:attributedString]; - - [scrollView setDocumentView:stdOut]; - RELEASE (stdOut); - - [componentView addSubview: scrollView]; - RELEASE(scrollView); -} - -@end - @implementation PCProjectDebugger - (id)initWithProject:(PCProject *)aProject @@ -242,7 +129,9 @@ enum { - (void)debug:(id)sender { - NSRunAlertPanel(@"Attention!",@"Integrated debugging is not yet available...",@"OK",nil,nil); + NSRunAlertPanel(@"Attention!", + @"Integrated debugging is not yet available...", + @"OK",nil,nil); } - (void)run:(id)sender @@ -372,7 +261,7 @@ enum { RELEASE(launchTask); launchTask = nil; - [runButton setNextState]; + [runButton setState:NSOffState]; [componentView display]; } } diff --git a/PCLib/ProjectCenter.pcproj b/PCLib/ProjectCenter.pcproj index e20ae46..36426f6 100644 --- a/PCLib/ProjectCenter.pcproj +++ b/PCLib/ProjectCenter.pcproj @@ -25,7 +25,8 @@ "PCFileManager+UInterface.m", "PCProjectManager+UInterface.m", "PCProject+UInterface.m", - "PCTextFinder+UInterface.m" + "PCTextFinder+UInterface.m", + "PCProjectDebugger+UInterface.m" ); COMPILEROPTIONS = ""; CREATION_DATE = ""; @@ -68,7 +69,8 @@ "PCFileManager+UInterface.h", "PCProjectManager+UInterface.h", "PCProject+UInterface.h", - "PCTextFinder+UInterface.h" + "PCTextFinder+UInterface.h", + "PCProjectDebugger+UInterface.h" ); INSTALLDIR = "$(GNUSTEP_INSTALLATION_DIR)"; LANGUAGE = English; @@ -105,4 +107,4 @@ GNUmakefile, GNUmakefile.postamble ); -} +} \ No newline at end of file