mirror of
https://github.com/gnustep/libs-gui.git
synced 2025-06-01 08:41:54 +00:00
Several changes to support porting of an OPENSTEP application to GNUstep.
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gui/trunk@2689 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
parent
6fd062e7c6
commit
d3217ea5ac
26 changed files with 365 additions and 29 deletions
46
ChangeLog
46
ChangeLog
|
@ -1,3 +1,49 @@
|
||||||
|
Fri Jan 9 12:25:41 1998 Ovidiu Predescu <ovidiu@net-community.com>
|
||||||
|
|
||||||
|
* Headers/gnustep/gui/NSImageView.h: New file.
|
||||||
|
* Source/NSImageView.m: New file.
|
||||||
|
* Headers/gnustep/gui/NSApplication.h
|
||||||
|
(NSApplicationWillTerminateNotification): New notification.
|
||||||
|
(NSApplicationMain): New function.
|
||||||
|
(NSOpenStepRootDirectory): Likewise.
|
||||||
|
|
||||||
|
* Model/GMAppKit.h: New categories for NSCStringText and NSPopUpButton.
|
||||||
|
* Model/GMAppKit.m: Likewise.
|
||||||
|
(-[NSImage createObjectForModelUnarchiver:]): Return a dummy image in
|
||||||
|
case the image requested does not exist. This prevents a crash later.
|
||||||
|
* Model/IBClasses.h: Define the NSWindowTemplate class, which is used
|
||||||
|
internally by the NeXT's IB. I simply remove it from the generated
|
||||||
|
model file since it has no equivalent.
|
||||||
|
* Model/IBClasses.m (NSWindowTemplate): Remove all the instances that
|
||||||
|
appear in the NIB file and encode the window it points to.
|
||||||
|
* Model/IMConnectors.m: When assigning an object to an instance
|
||||||
|
variable directly retain the object automatically so it doesn't get
|
||||||
|
released accidentally.
|
||||||
|
* Model/IMLoading.m: Search for model files in the Resources directory
|
||||||
|
of the app wrapper. Automatically append the gmodel extension if not
|
||||||
|
present.
|
||||||
|
* Source/NSApplication.m (finishLaunching): Load the main model file if
|
||||||
|
any. Define the NSOpenStepRootDirectory to be the value of
|
||||||
|
GNUSTEP_SYSTEM_ROOT.
|
||||||
|
* Model/GNUmakefile: Define the GNUSTEP_INSTALLATION_DIR to be the
|
||||||
|
system root. Define the header files that get installed (in the AppKit
|
||||||
|
directory).
|
||||||
|
|
||||||
|
* Source/externs.m: Define the NSApplicationWillTerminateNotification
|
||||||
|
notification.
|
||||||
|
* Source/libgnustep-gui.m: Changed the name of the GNUstepMain function
|
||||||
|
to NSApplicationMain. Implement the NSApplicationMain function to do
|
||||||
|
something useful ;-).
|
||||||
|
|
||||||
|
Mon Jan 5 15:15:34 1998 Ovidiu Predescu <ovidiu@net-community.com>
|
||||||
|
|
||||||
|
* Headers/gnustep/DPSClient/DPSOperators.h: Moved to the AppKit header
|
||||||
|
directory.
|
||||||
|
* Headers/gnustep/DPSClient/NSDPSContext.h: Likewise.
|
||||||
|
* Headers/gnustep/DPSClient/TypesandConstants.h: Removed.
|
||||||
|
* Headers/gnustep/AppKit/NSApplication.h (NSOpenStepRootDirectory):
|
||||||
|
New function.
|
||||||
|
|
||||||
Wed Dec 3 14:12:35 1997 Ovidiu Predescu <ovidiu@net-community.com>
|
Wed Dec 3 14:12:35 1997 Ovidiu Predescu <ovidiu@net-community.com>
|
||||||
|
|
||||||
Added the code to support the loading of model files (similar to nib
|
Added the code to support the loading of model files (similar to nib
|
||||||
|
|
|
@ -32,7 +32,7 @@
|
||||||
//
|
//
|
||||||
// Display Postscript System
|
// Display Postscript System
|
||||||
//
|
//
|
||||||
#include <DPSClient/DPSOperators.h>
|
#include <AppKit/DPSOperators.h>
|
||||||
|
|
||||||
//
|
//
|
||||||
// GNUstep GUI Library functions
|
// GNUstep GUI Library functions
|
||||||
|
@ -103,6 +103,7 @@
|
||||||
#include <AppKit/NSHelpPanel.h>
|
#include <AppKit/NSHelpPanel.h>
|
||||||
#include <AppKit/NSImage.h>
|
#include <AppKit/NSImage.h>
|
||||||
#include <AppKit/NSImageRep.h>
|
#include <AppKit/NSImageRep.h>
|
||||||
|
#include <AppKit/NSImageView.h>
|
||||||
#include <AppKit/NSMatrix.h>
|
#include <AppKit/NSMatrix.h>
|
||||||
#include <AppKit/NSMenu.h>
|
#include <AppKit/NSMenu.h>
|
||||||
#include <AppKit/NSMenuItem.h>
|
#include <AppKit/NSMenuItem.h>
|
||||||
|
|
|
@ -314,6 +314,7 @@ extern NSString *NSApplicationDidUnhideNotification;
|
||||||
extern NSString *NSApplicationDidUpdateNotification;
|
extern NSString *NSApplicationDidUpdateNotification;
|
||||||
extern NSString *NSApplicationWillBecomeActiveNotification;
|
extern NSString *NSApplicationWillBecomeActiveNotification;
|
||||||
extern NSString *NSApplicationWillFinishLaunchingNotification;
|
extern NSString *NSApplicationWillFinishLaunchingNotification;
|
||||||
|
extern NSString* NSApplicationWillTerminateNotification;
|
||||||
extern NSString *NSApplicationWillHideNotification;
|
extern NSString *NSApplicationWillHideNotification;
|
||||||
extern NSString *NSApplicationWillResignActiveNotification;
|
extern NSString *NSApplicationWillResignActiveNotification;
|
||||||
extern NSString *NSApplicationWillUnhideNotification;
|
extern NSString *NSApplicationWillUnhideNotification;
|
||||||
|
@ -335,4 +336,9 @@ BOOL NSPerformService(NSString *item, NSPasteboard *pboard);
|
||||||
//
|
//
|
||||||
void NSUpdateDynamicServices(void);
|
void NSUpdateDynamicServices(void);
|
||||||
|
|
||||||
|
|
||||||
|
int NSApplicationMain(int argc, const char **argv);
|
||||||
|
|
||||||
|
NSString *NSOpenStepRootDirectory(void);
|
||||||
|
|
||||||
#endif // _GNUstep_H_NSApplication
|
#endif // _GNUstep_H_NSApplication
|
||||||
|
|
|
@ -29,9 +29,8 @@
|
||||||
#ifndef _GNUstep_H_NSDPSContext
|
#ifndef _GNUstep_H_NSDPSContext
|
||||||
#define _GNUstep_H_NSDPSContext
|
#define _GNUstep_H_NSDPSContext
|
||||||
|
|
||||||
#include <DPSClient/TypesandConstants.h>
|
|
||||||
#include <DPSClient/DPSOperators.h>
|
|
||||||
#include <Foundation/NSObject.h>
|
#include <Foundation/NSObject.h>
|
||||||
|
#include <AppKit/DPSOperators.h>
|
||||||
|
|
||||||
@class NSData;
|
@class NSData;
|
||||||
@class NSMutableData;
|
@class NSMutableData;
|
||||||
|
|
|
@ -29,7 +29,7 @@
|
||||||
#ifndef _GNUstep_H_NSFontPanel
|
#ifndef _GNUstep_H_NSFontPanel
|
||||||
#define _GNUstep_H_NSFontPanel
|
#define _GNUstep_H_NSFontPanel
|
||||||
|
|
||||||
#include <DPSClient/TypesandConstants.h>
|
#include <AppKit/NSDPSContext.h>
|
||||||
#include <AppKit/NSPanel.h>
|
#include <AppKit/NSPanel.h>
|
||||||
|
|
||||||
@class NSFont;
|
@class NSFont;
|
||||||
|
|
|
@ -29,7 +29,7 @@
|
||||||
#ifndef _GNUstep_H_NSImage
|
#ifndef _GNUstep_H_NSImage
|
||||||
#define _GNUstep_H_NSImage
|
#define _GNUstep_H_NSImage
|
||||||
|
|
||||||
#include <DPSClient/TypesandConstants.h>
|
#include <AppKit/NSDPSContext.h>
|
||||||
#include <Foundation/NSBundle.h>
|
#include <Foundation/NSBundle.h>
|
||||||
#include <Foundation/NSCoder.h>
|
#include <Foundation/NSCoder.h>
|
||||||
#include <AppKit/NSBitmapImageRep.h>
|
#include <AppKit/NSBitmapImageRep.h>
|
||||||
|
|
75
Headers/gnustep/gui/NSImageView.h
Normal file
75
Headers/gnustep/gui/NSImageView.h
Normal file
|
@ -0,0 +1,75 @@
|
||||||
|
/*
|
||||||
|
NSImageView.h
|
||||||
|
|
||||||
|
Copyright (C) 1996 Free Software Foundation, Inc.
|
||||||
|
|
||||||
|
Author: Ovidiu Predescu <ovidiu@net-community.com>
|
||||||
|
Date: January 1998
|
||||||
|
|
||||||
|
This file is part of the GNUstep GUI Library.
|
||||||
|
|
||||||
|
This library is free software; you can redistribute it and/or
|
||||||
|
modify it under the terms of the GNU Library General Public
|
||||||
|
License as published by the Free Software Foundation; either
|
||||||
|
version 2 of the License, or (at your option) any later version.
|
||||||
|
|
||||||
|
This library 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 Library General Public
|
||||||
|
License along with this library; if not, write to the Free
|
||||||
|
Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
||||||
|
*/
|
||||||
|
|
||||||
|
#ifndef _GNUstep_H_NSImageView
|
||||||
|
#define _GNUstep_H_NSImageView
|
||||||
|
|
||||||
|
#include <AppKit/NSControl.h>
|
||||||
|
|
||||||
|
typedef enum {
|
||||||
|
NSScaleProportionally = 0, // Fit propoRtionally
|
||||||
|
NSScaleToFit, // Forced fit (distort if necessary)
|
||||||
|
NSScaleNone // Don't scale (clip)
|
||||||
|
} NSImageScaling;
|
||||||
|
|
||||||
|
typedef enum {
|
||||||
|
NSImageAlignCenter = 0,
|
||||||
|
NSImageAlignTop,
|
||||||
|
NSImageAlignTopLeft,
|
||||||
|
NSImageAlignTopRight,
|
||||||
|
NSImageAlignLeft,
|
||||||
|
NSImageAlignBottom,
|
||||||
|
NSImageAlignBottomLeft,
|
||||||
|
NSImageAlignBottomRight,
|
||||||
|
NSImageAlignRight
|
||||||
|
} NSImageAlignment;
|
||||||
|
|
||||||
|
typedef enum {
|
||||||
|
NSImageFrameNone = 0,
|
||||||
|
NSImageFramePhoto,
|
||||||
|
NSImageFrameGrayBezel,
|
||||||
|
NSImageFrameGroove,
|
||||||
|
NSImageFrameButton
|
||||||
|
} NSImageFrameStyle;
|
||||||
|
|
||||||
|
@interface NSImageView : NSControl
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
- (NSImage *)image;
|
||||||
|
- (void)setImage:(NSImage *)image;
|
||||||
|
|
||||||
|
- (NSImageAlignment)imageAlignment;
|
||||||
|
- (void)setImageAlignment:(NSImageAlignment)align;
|
||||||
|
- (NSImageScaling)imageScaling;
|
||||||
|
- (void)setImageScaling:(NSImageScaling)scaling;
|
||||||
|
- (NSImageFrameStyle)imageFrameStyle;
|
||||||
|
- (void)setImageFrameStyle:(NSImageFrameStyle)style;
|
||||||
|
- (void)setEditable:(BOOL)flag;
|
||||||
|
- (BOOL)isEditable;
|
||||||
|
|
||||||
|
@end
|
||||||
|
|
||||||
|
#endif /* _GNUstep_H_NSImageView */
|
|
@ -32,7 +32,7 @@
|
||||||
#ifndef _GNUstep_H_NSView
|
#ifndef _GNUstep_H_NSView
|
||||||
#define _GNUstep_H_NSView
|
#define _GNUstep_H_NSView
|
||||||
|
|
||||||
#include <DPSClient/TypesandConstants.h>
|
#include <AppKit/NSDPSContext.h>
|
||||||
#include <AppKit/NSResponder.h>
|
#include <AppKit/NSResponder.h>
|
||||||
|
|
||||||
@class NSString;
|
@class NSString;
|
||||||
|
|
|
@ -29,7 +29,7 @@
|
||||||
#ifndef _GNUstep_H_NSWindow
|
#ifndef _GNUstep_H_NSWindow
|
||||||
#define _GNUstep_H_NSWindow
|
#define _GNUstep_H_NSWindow
|
||||||
|
|
||||||
#include <DPSClient/TypesandConstants.h>
|
#include <AppKit/NSDPSContext.h>
|
||||||
#include <AppKit/NSGraphics.h>
|
#include <AppKit/NSGraphics.h>
|
||||||
#include <AppKit/NSResponder.h>
|
#include <AppKit/NSResponder.h>
|
||||||
#include <AppKit/NSEvent.h>
|
#include <AppKit/NSEvent.h>
|
||||||
|
|
|
@ -44,6 +44,9 @@
|
||||||
@interface NSControl (GMArchiverMethods) <ModelCoding>
|
@interface NSControl (GMArchiverMethods) <ModelCoding>
|
||||||
@end
|
@end
|
||||||
|
|
||||||
|
@interface NSCStringText (GMArchiverMethods) <ModelCoding>
|
||||||
|
@end
|
||||||
|
|
||||||
@interface NSFont (GMArchiverMethods) <ModelCoding>
|
@interface NSFont (GMArchiverMethods) <ModelCoding>
|
||||||
@end
|
@end
|
||||||
|
|
||||||
|
@ -56,6 +59,9 @@
|
||||||
@interface NSMenu (GMArchiverMethods) <ModelCoding>
|
@interface NSMenu (GMArchiverMethods) <ModelCoding>
|
||||||
@end
|
@end
|
||||||
|
|
||||||
|
@interface NSPopUpButton (GMArchiverMethods) <ModelCoding>
|
||||||
|
@end
|
||||||
|
|
||||||
@interface NSResponder (GMArchiverMethods) <ModelCoding>
|
@interface NSResponder (GMArchiverMethods) <ModelCoding>
|
||||||
@end
|
@end
|
||||||
|
|
||||||
|
|
|
@ -345,6 +345,26 @@ void __dummy_GMAppKit_functionForLinking() {}
|
||||||
@end /* NSControl (GMArchiverMethods) */
|
@end /* NSControl (GMArchiverMethods) */
|
||||||
|
|
||||||
|
|
||||||
|
@implementation NSCStringText (GMArchiverMethods)
|
||||||
|
|
||||||
|
- (void)encodeWithModelArchiver:(GMArchiver*)archiver
|
||||||
|
{
|
||||||
|
[super encodeWithModelArchiver:archiver];
|
||||||
|
}
|
||||||
|
|
||||||
|
- (id)initWithModelUnarchiver:(GMUnarchiver*)unarchiver
|
||||||
|
{
|
||||||
|
return [super initWithModelUnarchiver:unarchiver];
|
||||||
|
}
|
||||||
|
|
||||||
|
- (Class)classForModelArchiver
|
||||||
|
{
|
||||||
|
return [NSCStringText class];
|
||||||
|
}
|
||||||
|
|
||||||
|
@end /* NSCStringText (GMArchiverMethods) */
|
||||||
|
|
||||||
|
|
||||||
@implementation NSFont (GMArchiverMethods)
|
@implementation NSFont (GMArchiverMethods)
|
||||||
|
|
||||||
- (void)encodeWithModelArchiver:(GMArchiver*)archiver
|
- (void)encodeWithModelArchiver:(GMArchiver*)archiver
|
||||||
|
@ -382,7 +402,11 @@ void __dummy_GMAppKit_functionForLinking() {}
|
||||||
|
|
||||||
+ (id)createObjectForModelUnarchiver:(GMUnarchiver*)unarchiver
|
+ (id)createObjectForModelUnarchiver:(GMUnarchiver*)unarchiver
|
||||||
{
|
{
|
||||||
return [NSImage imageNamed:[unarchiver decodeStringWithName:@"name"]];
|
id image = [NSImage imageNamed:[unarchiver decodeStringWithName:@"name"]];
|
||||||
|
|
||||||
|
if (!image)
|
||||||
|
image = [NSImage imageNamed:@"NSRadioButton"];
|
||||||
|
return image;
|
||||||
}
|
}
|
||||||
|
|
||||||
- (id)initWithModelUnarchiver:(GMUnarchiver*)unarchiver
|
- (id)initWithModelUnarchiver:(GMUnarchiver*)unarchiver
|
||||||
|
@ -499,6 +523,27 @@ void __dummy_GMAppKit_functionForLinking() {}
|
||||||
@end /* NSMenu (GMArchiverMethods) */
|
@end /* NSMenu (GMArchiverMethods) */
|
||||||
|
|
||||||
|
|
||||||
|
@implementation NSPopUpButton (GMArchiverMethods)
|
||||||
|
|
||||||
|
- (void)encodeWithModelArchiver:(GMArchiver*)archiver
|
||||||
|
{
|
||||||
|
// [super encodeWithModelArchiver:archiver];
|
||||||
|
}
|
||||||
|
|
||||||
|
- (id)initWithModelUnarchiver:(GMUnarchiver*)unarchiver
|
||||||
|
{
|
||||||
|
// return [super initWithModelUnarchiver:unarchiver];
|
||||||
|
return self;
|
||||||
|
}
|
||||||
|
|
||||||
|
- (Class)classForModelArchiver
|
||||||
|
{
|
||||||
|
return [NSPopUpButton class];
|
||||||
|
}
|
||||||
|
|
||||||
|
@end /* NSPopUpButton (GMArchiverMethods) */
|
||||||
|
|
||||||
|
|
||||||
@implementation NSResponder (GMArchiverMethods)
|
@implementation NSResponder (GMArchiverMethods)
|
||||||
|
|
||||||
- (void)encodeWithModelArchiver:(GMArchiver*)archiver
|
- (void)encodeWithModelArchiver:(GMArchiver*)archiver
|
||||||
|
|
|
@ -22,6 +22,8 @@
|
||||||
# Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
# Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
||||||
#
|
#
|
||||||
|
|
||||||
|
GNUSTEP_INSTALLATION_DIR = $(GNUSTEP_SYSTEM_ROOT)
|
||||||
|
|
||||||
include $(GNUSTEP_SYSTEM_ROOT)/Makefiles/common.make
|
include $(GNUSTEP_SYSTEM_ROOT)/Makefiles/common.make
|
||||||
|
|
||||||
LIBRARY_NAME = libgmodel
|
LIBRARY_NAME = libgmodel
|
||||||
|
@ -33,6 +35,9 @@ endif
|
||||||
APP_NAME = test
|
APP_NAME = test
|
||||||
|
|
||||||
libgmodel_OBJC_FILES = IMCustomObject.m IMConnectors.m IMLoading.m GMAppKit.m
|
libgmodel_OBJC_FILES = IMCustomObject.m IMConnectors.m IMLoading.m GMAppKit.m
|
||||||
|
libgmodel_HEADER_FILES_DIR = .
|
||||||
|
libgmodel_HEADER_FILES_INSTALL_DIR = /gnustep/gui/AppKit
|
||||||
|
libgmodel_HEADER_FILES = IMConnectors.h IMCustomObject.h IMLoading.h GMAppKit.h
|
||||||
|
|
||||||
test_OBJC_FILES = test.m Controller.m
|
test_OBJC_FILES = test.m Controller.m
|
||||||
|
|
||||||
|
|
|
@ -56,4 +56,23 @@
|
||||||
@interface NSIBControlConnector : NSIBConnector
|
@interface NSIBControlConnector : NSIBConnector
|
||||||
@end
|
@end
|
||||||
|
|
||||||
|
/* Classes used internally by NeXT's AppKit we don't want to appear in the
|
||||||
|
model file */
|
||||||
|
@interface NSWindowTemplate : NSObject
|
||||||
|
{
|
||||||
|
NSRect windowRect;
|
||||||
|
int windowStyleMask;
|
||||||
|
int windowBacking;
|
||||||
|
id windowTitle;
|
||||||
|
id viewClass;
|
||||||
|
id windowClass;
|
||||||
|
id windowView;
|
||||||
|
id realObject;
|
||||||
|
id extension;
|
||||||
|
NSSize minSize;
|
||||||
|
BOOL _wtFlags; /* Don't know the type of this ivar */
|
||||||
|
NSRect screenRect;
|
||||||
|
}
|
||||||
|
@end
|
||||||
|
|
||||||
#endif /* _GNUstep_H_IBClasses */
|
#endif /* _GNUstep_H_IBClasses */
|
||||||
|
|
|
@ -127,3 +127,25 @@
|
||||||
return [IMControlConnector class];
|
return [IMControlConnector class];
|
||||||
}
|
}
|
||||||
@end /* NSIBControlConnector */
|
@end /* NSIBControlConnector */
|
||||||
|
|
||||||
|
|
||||||
|
@implementation NSWindowTemplate (GMArchiverMethods)
|
||||||
|
|
||||||
|
#ifdef DEBUG
|
||||||
|
- (void)encodeWithModelArchiver:(GMArchiver*)archiver
|
||||||
|
{
|
||||||
|
NSLog (@"%@: %@", NSStringFromClass (isa), NSStringFromSelector (_cmd));
|
||||||
|
[super encodeWithModelArchiver:archiver];
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
|
- (id)replacementObjectForModelArchiver:(GMArchiver*)archiver
|
||||||
|
{
|
||||||
|
#ifdef DEBUG
|
||||||
|
NSLog (@"realObject = %@", realObject);
|
||||||
|
#endif
|
||||||
|
return realObject;
|
||||||
|
}
|
||||||
|
|
||||||
|
@end
|
||||||
|
|
||||||
|
|
|
@ -54,7 +54,7 @@ object_set_instance_variable (id anObject,
|
||||||
|
|
||||||
if (ivar.ivar_name && !strcmp (ivar.ivar_name, variableName)) {
|
if (ivar.ivar_name && !strcmp (ivar.ivar_name, variableName)) {
|
||||||
/* We found it! */
|
/* We found it! */
|
||||||
*((id*)(((char*)anObject) + ivar.ivar_offset)) = value;
|
*((void**)(((char*)anObject) + ivar.ivar_offset)) = value;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -97,7 +97,7 @@ object_set_instance_variable (id anObject,
|
||||||
[_source setTarget:_destination];
|
[_source setTarget:_destination];
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
object_set_instance_variable (_source, "target", _destination);
|
object_set_instance_variable (_source, "target", [_destination retain]);
|
||||||
|
|
||||||
if ([_source respondsToSelector:@selector(setAction:)]) {
|
if ([_source respondsToSelector:@selector(setAction:)]) {
|
||||||
// NSLog (@"%@: setting action to %@",
|
// NSLog (@"%@: setting action to %@",
|
||||||
|
@ -124,7 +124,7 @@ object_set_instance_variable (id anObject,
|
||||||
if (setSelector && [_source respondsToSelector:setSelector])
|
if (setSelector && [_source respondsToSelector:setSelector])
|
||||||
[_source performSelector:setSelector withObject:_destination];
|
[_source performSelector:setSelector withObject:_destination];
|
||||||
else
|
else
|
||||||
object_set_instance_variable(_source, [label cString], _destination);
|
object_set_instance_variable(_source, [label cString], [_destination retain]);
|
||||||
}
|
}
|
||||||
|
|
||||||
@end /* IMOutletConnector */
|
@end /* IMOutletConnector */
|
||||||
|
|
|
@ -25,6 +25,7 @@
|
||||||
|
|
||||||
#import <Foundation/NSDictionary.h>
|
#import <Foundation/NSDictionary.h>
|
||||||
#import <Foundation/NSArray.h>
|
#import <Foundation/NSArray.h>
|
||||||
|
#import <Foundation/NSFileManager.h>
|
||||||
#include <extensions/GMArchiver.h>
|
#include <extensions/GMArchiver.h>
|
||||||
#include "IMLoading.h"
|
#include "IMLoading.h"
|
||||||
#include "IMCustomObject.h"
|
#include "IMCustomObject.h"
|
||||||
|
@ -58,10 +59,21 @@ BOOL _fileOwnerDecoded = NO;
|
||||||
|
|
||||||
+ (BOOL)loadIMFile:(NSString*)path owner:(id)owner
|
+ (BOOL)loadIMFile:(NSString*)path owner:(id)owner
|
||||||
{
|
{
|
||||||
GMUnarchiver* unarchiver = [GMUnarchiver unarchiverWithContentsOfFile:path];
|
NSBundle* mainBundle = [NSBundle mainBundle];
|
||||||
|
NSString* resourcePath = [mainBundle resourcePath];
|
||||||
|
GMUnarchiver* unarchiver;
|
||||||
id previousNibOwner = _nibOwner;
|
id previousNibOwner = _nibOwner;
|
||||||
GMModel* decoded;
|
GMModel* decoded;
|
||||||
|
|
||||||
|
if (![path hasSuffix:@".gmodel"])
|
||||||
|
path = [path stringByAppendingPathExtension:@"gmodel"];
|
||||||
|
path = [resourcePath stringByAppendingPathComponent:path];
|
||||||
|
if (![[NSFileManager defaultManager] fileExistsAtPath:path])
|
||||||
|
return NO;
|
||||||
|
|
||||||
|
NSLog (@"loading model file %@...", path);
|
||||||
|
unarchiver = [GMUnarchiver unarchiverWithContentsOfFile:path];
|
||||||
|
|
||||||
if (!unarchiver)
|
if (!unarchiver)
|
||||||
return NO;
|
return NO;
|
||||||
|
|
||||||
|
|
|
@ -70,6 +70,7 @@ NSFormCell.m \
|
||||||
NSHelpPanel.m \
|
NSHelpPanel.m \
|
||||||
NSImage.m \
|
NSImage.m \
|
||||||
NSImageRep.m \
|
NSImageRep.m \
|
||||||
|
NSImageView.m \
|
||||||
NSMatrix.m \
|
NSMatrix.m \
|
||||||
NSMenu.m \
|
NSMenu.m \
|
||||||
NSMenuItem.m \
|
NSMenuItem.m \
|
||||||
|
@ -149,6 +150,7 @@ AppKit/NSGraphics.h \
|
||||||
AppKit/NSHelpPanel.h \
|
AppKit/NSHelpPanel.h \
|
||||||
AppKit/NSImage.h \
|
AppKit/NSImage.h \
|
||||||
AppKit/NSImageRep.h \
|
AppKit/NSImageRep.h \
|
||||||
|
AppKit/NSImageView.h \
|
||||||
AppKit/NSMatrix.h \
|
AppKit/NSMatrix.h \
|
||||||
AppKit/NSMenu.h \
|
AppKit/NSMenu.h \
|
||||||
AppKit/NSMenuItem.h \
|
AppKit/NSMenuItem.h \
|
||||||
|
@ -184,9 +186,8 @@ AppKit/NSWorkspace.h \
|
||||||
AppKit/TrackingRectangle.h \
|
AppKit/TrackingRectangle.h \
|
||||||
AppKit/nsimage-tiff.h \
|
AppKit/nsimage-tiff.h \
|
||||||
AppKit/PSMatrix.h \
|
AppKit/PSMatrix.h \
|
||||||
DPSClient/NSDPSContext.h \
|
AppKit/NSDPSContext.h \
|
||||||
DPSClient/DPSOperators.h \
|
AppKit/DPSOperators.h
|
||||||
DPSClient/TypesandConstants.h
|
|
||||||
|
|
||||||
|
|
||||||
-include GNUmakefile.preamble
|
-include GNUmakefile.preamble
|
||||||
|
|
|
@ -77,5 +77,3 @@ before-all:: header-links
|
||||||
header-links:
|
header-links:
|
||||||
-rm -rf ../Headers/AppKit
|
-rm -rf ../Headers/AppKit
|
||||||
$(LN_S) ../Headers/gnustep/gui ../Headers/AppKit
|
$(LN_S) ../Headers/gnustep/gui ../Headers/AppKit
|
||||||
-rm -rf ../Headers/DPSClient
|
|
||||||
$(LN_S) ../Headers/gnustep/dps ../Headers/DPSClient
|
|
||||||
|
|
|
@ -63,8 +63,7 @@ ADDITIONAL_LIB_DIRS =
|
||||||
# Additional directories to be created during installation
|
# Additional directories to be created during installation
|
||||||
ADDITIONAL_INSTALL_DIRS = $(GNUSTEP_HEADERS)/gnustep \
|
ADDITIONAL_INSTALL_DIRS = $(GNUSTEP_HEADERS)/gnustep \
|
||||||
$(GNUSTEP_HEADERS)/gnustep/gui \
|
$(GNUSTEP_HEADERS)/gnustep/gui \
|
||||||
$(GNUSTEP_HEADERS)/gnustep/gui/AppKit \
|
$(GNUSTEP_HEADERS)/gnustep/gui/AppKit
|
||||||
$(GNUSTEP_HEADERS)/gnustep/gui/DPSClient
|
|
||||||
|
|
||||||
# What are the libraries this library depends upon. This is needed for some
|
# What are the libraries this library depends upon. This is needed for some
|
||||||
# systems where building a shared library requires to pass to the linker
|
# systems where building a shared library requires to pass to the linker
|
||||||
|
|
|
@ -30,16 +30,19 @@
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
|
|
||||||
#include <Foundation/NSArray.h>
|
#include <Foundation/NSArray.h>
|
||||||
|
#include <Foundation/NSDictionary.h>
|
||||||
#include <Foundation/NSNotification.h>
|
#include <Foundation/NSNotification.h>
|
||||||
#include <Foundation/NSRunLoop.h>
|
#include <Foundation/NSRunLoop.h>
|
||||||
#include <Foundation/NSAutoreleasePool.h>
|
#include <Foundation/NSAutoreleasePool.h>
|
||||||
#include <Foundation/NSTimer.h>
|
#include <Foundation/NSTimer.h>
|
||||||
|
#include <Foundation/NSProcessInfo.h>
|
||||||
|
#include <Foundation/NSFileManager.h>
|
||||||
|
|
||||||
#ifndef LIB_FOUNDATION_LIBRARY
|
#ifndef LIB_FOUNDATION_LIBRARY
|
||||||
# include <Foundation/NSConnection.h>
|
# include <Foundation/NSConnection.h>
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#include <DPSClient/NSDPSContext.h>
|
#include <AppKit/NSDPSContext.h>
|
||||||
#include <AppKit/NSApplication.h>
|
#include <AppKit/NSApplication.h>
|
||||||
#include <AppKit/NSPopUpButton.h>
|
#include <AppKit/NSPopUpButton.h>
|
||||||
#include <AppKit/NSPanel.h>
|
#include <AppKit/NSPanel.h>
|
||||||
|
@ -49,6 +52,8 @@
|
||||||
#include <AppKit/NSMenuItem.h>
|
#include <AppKit/NSMenuItem.h>
|
||||||
#include <AppKit/NSCursor.h>
|
#include <AppKit/NSCursor.h>
|
||||||
|
|
||||||
|
#include <AppKit/IMLoading.h>
|
||||||
|
|
||||||
//
|
//
|
||||||
// Class variables
|
// Class variables
|
||||||
//
|
//
|
||||||
|
@ -138,6 +143,21 @@ static id NSApp;
|
||||||
- (void)finishLaunching
|
- (void)finishLaunching
|
||||||
{
|
{
|
||||||
NSNotificationCenter *nc = [NSNotificationCenter defaultCenter];
|
NSNotificationCenter *nc = [NSNotificationCenter defaultCenter];
|
||||||
|
NSBundle* mainBundle = [NSBundle mainBundle];
|
||||||
|
NSString* resourcePath = [mainBundle resourcePath];
|
||||||
|
NSString* infoFilePath
|
||||||
|
= [resourcePath stringByAppendingPathComponent:@"Info-gnustep.plist"];
|
||||||
|
NSDictionary* infoDict = [[NSString stringWithContentsOfFile:infoFilePath]
|
||||||
|
propertyList];
|
||||||
|
NSString* mainModelFile = [infoDict objectForKey:@"NSMainNibFile"];
|
||||||
|
|
||||||
|
if (mainModelFile) {
|
||||||
|
if (![GMModel loadIMFile:mainModelFile
|
||||||
|
owner:[NSApplication sharedApplication]])
|
||||||
|
NSLog (@"Cannot load the main model file '%@", mainModelFile);
|
||||||
|
else
|
||||||
|
NSLog (@"Model loading ready!");
|
||||||
|
}
|
||||||
|
|
||||||
// notify that we will finish the launching
|
// notify that we will finish the launching
|
||||||
[nc postNotificationName: NSApplicationWillFinishLaunchingNotification
|
[nc postNotificationName: NSApplicationWillFinishLaunchingNotification
|
||||||
|
@ -1120,3 +1140,16 @@ static id NSApp;
|
||||||
{}
|
{}
|
||||||
|
|
||||||
@end
|
@end
|
||||||
|
|
||||||
|
|
||||||
|
/* Some utilities */
|
||||||
|
NSString *NSOpenStepRootDirectory(void)
|
||||||
|
{
|
||||||
|
NSString* root = [[[NSProcessInfo processInfo] environment]
|
||||||
|
objectForKey:@"GNUSTEP_SYSTEM_ROOT"];
|
||||||
|
|
||||||
|
if (!root)
|
||||||
|
root = @"/";
|
||||||
|
|
||||||
|
return root;
|
||||||
|
}
|
||||||
|
|
|
@ -32,7 +32,7 @@
|
||||||
#include <Foundation/NSLock.h>
|
#include <Foundation/NSLock.h>
|
||||||
#include <Foundation/NSData.h>
|
#include <Foundation/NSData.h>
|
||||||
#include <Foundation/NSDictionary.h>
|
#include <Foundation/NSDictionary.h>
|
||||||
#include <gnustep/dps/NSDPSContext.h>
|
#include <AppKit/NSDPSContext.h>
|
||||||
|
|
||||||
#define ASSIGN(a, b) \
|
#define ASSIGN(a, b) \
|
||||||
[b retain]; \
|
[b retain]; \
|
||||||
|
|
|
@ -39,7 +39,7 @@
|
||||||
#include <AppKit/NSEvent.h>
|
#include <AppKit/NSEvent.h>
|
||||||
#include <AppKit/NSApplication.h>
|
#include <AppKit/NSApplication.h>
|
||||||
#include <AppKit/NSWindow.h>
|
#include <AppKit/NSWindow.h>
|
||||||
#include <DPSClient/NSDPSContext.h>
|
#include <AppKit/NSDPSContext.h>
|
||||||
|
|
||||||
@implementation NSEvent
|
@implementation NSEvent
|
||||||
|
|
||||||
|
|
56
Source/NSImageView.m
Normal file
56
Source/NSImageView.m
Normal file
|
@ -0,0 +1,56 @@
|
||||||
|
/*
|
||||||
|
NSImageView.m
|
||||||
|
|
||||||
|
Copyright (C) 1996 Free Software Foundation, Inc.
|
||||||
|
|
||||||
|
Author: Ovidiu Predescu <ovidiu@net-community.com>
|
||||||
|
Date: January 1998
|
||||||
|
|
||||||
|
This file is part of the GNUstep GUI Library.
|
||||||
|
|
||||||
|
This library is free software; you can redistribute it and/or
|
||||||
|
modify it under the terms of the GNU Library General Public
|
||||||
|
License as published by the Free Software Foundation; either
|
||||||
|
version 2 of the License, or (at your option) any later version.
|
||||||
|
|
||||||
|
This library 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 Library General Public
|
||||||
|
License along with this library; if not, write to the Free
|
||||||
|
Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
||||||
|
*/
|
||||||
|
|
||||||
|
#include <AppKit/NSImageView.h>
|
||||||
|
|
||||||
|
@implementation NSImageView
|
||||||
|
|
||||||
|
- (void)setImage:(NSImage *)image
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
- (void)setImageAlignment:(NSImageAlignment)align
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
- (void)setImageScaling:(NSImageScaling)scaling
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
- (void)setImageFrameStyle:(NSImageFrameStyle)style
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
- (void)setEditable:(BOOL)flag
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
- (NSImage *)image { return nil; }
|
||||||
|
- (NSImageAlignment)imageAlignment { return 0; }
|
||||||
|
- (NSImageScaling)imageScaling { return 0; }
|
||||||
|
- (NSImageFrameStyle)imageFrameStyle { return 0; }
|
||||||
|
- (BOOL)isEditable { return 0; }
|
||||||
|
|
||||||
|
@end
|
|
@ -87,6 +87,7 @@ NSString *NSApplicationWillBecomeActiveNotification
|
||||||
= @"ApplicationWillBecomeActive";
|
= @"ApplicationWillBecomeActive";
|
||||||
NSString *NSApplicationWillFinishLaunchingNotification
|
NSString *NSApplicationWillFinishLaunchingNotification
|
||||||
= @"ApplicationWillFinishLaunching";
|
= @"ApplicationWillFinishLaunching";
|
||||||
|
NSString *NSApplicationWillTerminateNotification = @"ApplicationWillTerminate";
|
||||||
NSString *NSApplicationWillHideNotification = @"ApplicationWillHide";
|
NSString *NSApplicationWillHideNotification = @"ApplicationWillHide";
|
||||||
NSString *NSApplicationWillResignActiveNotification
|
NSString *NSApplicationWillResignActiveNotification
|
||||||
= @"ApplicationWillResignActive";
|
= @"ApplicationWillResignActive";
|
||||||
|
|
|
@ -30,7 +30,7 @@
|
||||||
;
|
;
|
||||||
LIBRARY libgnustep-gui
|
LIBRARY libgnustep-gui
|
||||||
EXPORTS
|
EXPORTS
|
||||||
GNUstepMain
|
NSApplicationMain
|
||||||
__objc_class_name_NSActionCell
|
__objc_class_name_NSActionCell
|
||||||
__objc_category_name_NSApplication_GNUstepBackend
|
__objc_category_name_NSApplication_GNUstepBackend
|
||||||
__objc_class_name_NSApplication
|
__objc_class_name_NSApplication
|
||||||
|
|
|
@ -26,19 +26,31 @@
|
||||||
59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include <Foundation/NSString.h>
|
#include <Foundation/NSAutoreleasePool.h>
|
||||||
|
|
||||||
#include <AppKit/NSApplication.h>
|
#include <AppKit/NSApplication.h>
|
||||||
#include <AppKit/NSFontManager.h>
|
|
||||||
#include <AppKit/NSFont.h>
|
|
||||||
|
|
||||||
char **NSArgv = NULL;
|
char **NSArgv = NULL;
|
||||||
|
|
||||||
//
|
//
|
||||||
// The main entry point for X Windows
|
// The main entry point for X Windows
|
||||||
//
|
//
|
||||||
int
|
int NSApplicationMain(int argc, const char **argv)
|
||||||
GNUstepMain(int argc, char **argv)
|
|
||||||
{
|
{
|
||||||
|
extern char** environ;
|
||||||
|
|
||||||
|
#if LIB_FOUNDATION_LIBRARY
|
||||||
|
[NSProcessInfo initializeWithArguments:(char**)argv
|
||||||
|
count:argc
|
||||||
|
environment:environ];
|
||||||
|
#endif
|
||||||
|
|
||||||
|
[NSAutoreleasePool new];
|
||||||
|
|
||||||
|
#ifndef NX_CURRENT_COMPILER_RELEASE
|
||||||
|
initialize_gnustep_backend();
|
||||||
|
#endif
|
||||||
|
|
||||||
|
[[NSApplication sharedApplication] run];
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue