Move common functions for delegate into superclass GormAbstractDelegate

This commit is contained in:
Gregory John Casamento 2023-06-27 18:30:04 -04:00
parent 248d81bf74
commit 17c2d9f9ca
9 changed files with 1225 additions and 1064 deletions

View file

@ -34,33 +34,5 @@
@class NSMutableArray;
@class NSSet;
@interface GormAppDelegate : NSObject <IB, GormAppDelegate, GormServer>
{
IBOutlet id gormMenu;
IBOutlet id guideLineMenuItem;
GormPrefController *preferencesController;
GormClassManager *classManager;
GormInspectorsManager *inspectorsManager;
GormPalettesManager *palettesManager;
GormPluginManager *pluginManager;
id<IBSelectionOwners> selectionOwner;
BOOL isConnecting;
BOOL isTesting;
id testContainer;
NSMenu *mainMenu; // saves the main menu...
NSMenu *servicesMenu; // saves the services menu...
NSMenu *classMenu; // so we can set it for the class view
NSDictionary *menuLocations;
NSImage *linkImage;
NSImage *sourceImage;
NSImage *targetImage;
NSImage *gormImage;
NSImage *testingImage;
id connectSource;
id connectDestination;
NSMutableArray *testingWindows;
NSSet *topObjects;
}
@interface GormAppDelegate : GormAbstractDelegate
@end

File diff suppressed because it is too large Load diff

View file

@ -40,6 +40,7 @@ SUBPROJECTS = Plugins
GormCore_HEADER_FILES = \
GormCore.h \
GormAbstractDelegate.h \
GormBoxEditor.h \
GormClassEditor.h \
GormClassInspector.h \
@ -114,6 +115,7 @@ GormCore_HEADER_FILES = \
GormShelfPref.h \
GormCore_OBJC_FILES = \
GormAbstractDelegate.m \
GormBoxEditor.m \
GormClassEditor.m \
GormClassInspector.m \

View file

@ -0,0 +1,76 @@
/* GormAppDelegate.m
*
* Copyright (C) 2023 Free Software Foundation, Inc.
*
* Author: Gregory John Casamento <greg.casamento@gmail.com>
* Date: 2023
*
* This file is part of GNUstep.
*
* 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
* the Free Software Foundation; either version 3 of the License, or
* (at your option) any later version.
*
* This program 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 General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02111
* USA.
*/
#ifndef GNUSTEP_GormAbstractDelegate_H
#define GNUSTEP_GormAbstractDelegate_H
#import <InterfaceBuilder/InterfaceBuilder.h>
#import <GNUstepBase/GSObjCRuntime.h>
#import <GormCore/GormProtocol.h>
#import <GormCore/GormServer.h>
@class NSDictionary;
@class NSImage;
@class NSMenu;
@class NSMutableArray;
@class NSSet;
@class GormPrefController;
@class GormClassManager;
@class GormPalettesManager;
@class GormPluginManager;
@interface GormAbstractDelegate : NSObject <IB, GormAppDelegate, GormServer>
{
IBOutlet id gormMenu;
IBOutlet id guideLineMenuItem;
GormPrefController *preferencesController;
GormClassManager *classManager;
GormInspectorsManager *inspectorsManager;
GormPalettesManager *palettesManager;
GormPluginManager *pluginManager;
id<IBSelectionOwners> selectionOwner;
BOOL isConnecting;
BOOL isTesting;
id testContainer;
NSMenu *mainMenu; // saves the main menu...
NSMenu *servicesMenu; // saves the services menu...
NSMenu *classMenu; // so we can set it for the class view
NSDictionary *menuLocations;
NSImage *linkImage;
NSImage *sourceImage;
NSImage *targetImage;
NSImage *gormImage;
NSImage *testingImage;
id connectSource;
id connectDestination;
NSMutableArray *testingWindows;
NSSet *topObjects;
}
@end
#endif // import guard

File diff suppressed because it is too large Load diff

View file

@ -35,6 +35,7 @@ FOUNDATION_EXPORT const unsigned char GormCoreVersionString[];
#ifndef INCLUDED_GORMCORE_H
#define INCLUDED_GORMCORE_H
#import <GormCore/GormAbstractDelegate.h>
#import <GormCore/GormBoxEditor.h>
#import <GormCore/GormClassEditor.h>
#import <GormCore/GormClassInspector.h>

View file

@ -1,5 +1,36 @@
#import <Foundation/NSObject.h>
#import <AppKit/NSApplication.h>
/* AppDelegate.m
*
* Copyright (C) 2023 Free Software Foundation, Inc.
*
* Author: Gregory John Casamento <greg.casamento@gmail.com>
* Date: 2023
*
* This file is part of GNUstep.
*
* 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
* the Free Software Foundation; either version 3 of the License, or
* (at your option) any later version.
*
* This program 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 General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02111
* USA.
*/
@interface AppDelegate : NSObject <NSApplicationDelegate>
#include <GormCore/GormCore.h>
#include <GNUstepBase/GSObjCRuntime.h>
@class NSDictionary;
@class NSImage;
@class NSMenu;
@class NSMutableArray;
@class NSSet;
@interface AppDelegate : GormAbstractDelegate
@end

View file

@ -35,11 +35,13 @@
- (void) applicationDidFinishLaunching: (NSNotification *)n
{
puts("== gormtool");
GormDocumentController *dc = [GormDocumentController sharedDocumentController];
puts("== gormtool");
NSLog(@"processInfo: %@", [NSProcessInfo processInfo]);
[self process];
[NSApp terminate: nil];
}

View file

@ -1,3 +1,28 @@
/* main.m
*
* Copyright (C) 2023 Free Software Foundation, Inc.
*
* Author: Gregory John Casamento <greg.casamento@gmail.com>
* Date: 2023
*
* This file is part of GNUstep.
*
* 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
* the Free Software Foundation; either version 3 of the License, or
* (at your option) any later version.
*
* This program 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 General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02111
* USA.
*/
// main.m
#import <Foundation/Foundation.h>
@ -8,17 +33,21 @@
#import "AppDelegate.h"
int main(int argc, char **argv)
{
NSApplication *app = [NSApplication sharedApplication];
AppDelegate *delegate = [[AppDelegate alloc] init];
extern char **environ;
// Don't show icon...
[[NSUserDefaults standardUserDefaults] setBool: YES forKey: @"GSSuppressAppIcon"];
// Initialize process...
[NSProcessInfo initializeWithArguments: (char **)argv
count: argc
environment: environ];
// Run...
[app setDelegate: delegate];
[app run];