mirror of
https://github.com/gnustep/libs-gui.git
synced 2025-04-25 06:01:05 +00:00
Release 0.3.0.
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gui/trunk@2347 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
parent
f38b177296
commit
01b4994fb8
44 changed files with 2645 additions and 1101 deletions
4
.cvsignore
Normal file
4
.cvsignore
Normal file
|
@ -0,0 +1,4 @@
|
|||
config.log
|
||||
Makefile
|
||||
config.status
|
||||
config.cache
|
58
ANNOUNCE
58
ANNOUNCE
|
@ -1,7 +1,7 @@
|
|||
ANNOUNCE
|
||||
********
|
||||
|
||||
This is version 0.2.0 of the GNUstep GUI library (`gnustep-gui').
|
||||
This is version 0.3.0 of the GNUstep GUI library (`gnustep-gui').
|
||||
|
||||
What is the GNUstep GUI Library?
|
||||
================================
|
||||
|
@ -31,41 +31,38 @@ component like the GNUstep X/DPS GUI Backend.
|
|||
What's new in this release?
|
||||
===========================
|
||||
|
||||
The currently released version of the library is `0.2.0'.
|
||||
The currently released version of the library is `0.3.0'.
|
||||
|
||||
Noteworthy changes in version `0.2.0'
|
||||
Noteworthy changes in version `0.3.0'
|
||||
=====================================
|
||||
|
||||
* Additional NSImage and NSImageRep class work. Incorporated common
|
||||
images for use with controls that were designed by Andrew Lindesay.
|
||||
* Completely reworked the menu class. The NSMenu class is now
|
||||
inherited from NSObject and using the new implementation menus
|
||||
have been implemented for the XDPS backend (they have the look and
|
||||
feel of the NeXTStep menus!).
|
||||
|
||||
* Fill out implementation of NSColorWell class.
|
||||
* NSRunLoop has been integrated with NSApplication. Using this
|
||||
capability time events have been implemented to NSEvent class.
|
||||
These events allow several improvements in the interaction between
|
||||
user and the graphic interface.
|
||||
|
||||
* Fill out implementation of NSColorList class.
|
||||
* NSMatrix has been reworked, it is now conforming to the OpenStep
|
||||
specification and it knows all the selection modes. It uses time
|
||||
events to enhance the drawing speed during mouse drags.
|
||||
|
||||
* Cleaned up the header files and added missing headers, methods,
|
||||
categories, and protocols; thanks to Simon Frankau for much of this
|
||||
work. Major reorganization of header files. Types and constants
|
||||
were moved in the files they belong. Each header file includes
|
||||
only the headers it really needs. Use `@class' to forward class
|
||||
definitions instead of including the corresponding class file.
|
||||
* The initial implementation of NSForm has been made although it has
|
||||
not been tested yet.
|
||||
|
||||
* Completely reworked the NSFont and NSFontManager classes so that
|
||||
NSUserDefaults is used for getting defaults and list of known
|
||||
fonts are maintained.
|
||||
* NSPrinter has been implemented though it was not throughly tested;
|
||||
thanks to Simon Frankau.
|
||||
|
||||
* Initial implementation of NSCursor class.
|
||||
* Configure script has been changed to detect the underlaying
|
||||
Foundation library. The currently supported libraries are
|
||||
gnustep-base and libFoundation.
|
||||
|
||||
* Almost complete implementation of NSButton and NSButtonCell class.
|
||||
Buttons can not display images and/or text, handles all of the
|
||||
OpenStep button types and styles.
|
||||
|
||||
* Fill out implementation of NSScroller class.
|
||||
|
||||
* Put in underlying support for optimizing drawing; flushing of
|
||||
windows, backing store, and only display when needed.
|
||||
|
||||
* Many bug fixes and minor enhancements.
|
||||
* Several cleanups have been made in a lot of classes: the
|
||||
retain/release policy has been fixed, the cell classes correctly
|
||||
implement the NSCopying protocol and many others.
|
||||
|
||||
How can I get support for this software?
|
||||
========================================
|
||||
|
@ -82,7 +79,7 @@ GNUstep GUI Library, see the file `SUPPORT' for more information.
|
|||
Where can you get it? How can you compile it?
|
||||
==============================================
|
||||
|
||||
The gstep-gui-0.2.0.tar.gz distribution file has been placed on
|
||||
The gstep-gui-0.3.0.tar.gz distribution file has been placed on
|
||||
`ftp.gnustep.org' in `pub/gnustep'.
|
||||
|
||||
The program requires gcc 2.7.0 or higher.
|
||||
|
@ -91,8 +88,9 @@ Where can you get it? How can you compile it?
|
|||
TIFF Graphics library version 3.4.
|
||||
|
||||
It also requires a FoundationKit library as specified by the OpenStep
|
||||
specification. The FoundationKit library known to work is the GNUstep
|
||||
Base Library version `0.2.12'.
|
||||
specification. The FoundationKit libraries known to work are the
|
||||
GNUstep Base Library version `0.2.12' and libFoundation version
|
||||
`0.7.1'.
|
||||
|
||||
The `.tar' file is compressed with GNU gzip. Gzip can be obtained by
|
||||
anonymous ftp at any of the GNU archive sites.
|
||||
|
|
97
ChangeLog
97
ChangeLog
|
@ -1,71 +1,38 @@
|
|||
Mon Apr 21 18:57:30 1997 Ovidiu Predescu <ovidiu@net-community.com>
|
||||
Thu Jun 12 19:05:24 1997 Ovidiu Predescu <ovidiu@net-community.com>
|
||||
|
||||
* Implement NSCopying protocol to cell classes.
|
||||
* Headers/gnustep/gui/NSCell.h: Declare class to conform to
|
||||
NSCopying.
|
||||
* Headers/gnustep/gui/NSActionCell.h: Likewise.
|
||||
* Headers/gnustep/gui/NSButtonCell.h: Likewise.
|
||||
* Source/NSCell.m: Implement copyWithZone:.
|
||||
* Source/NSActionCell.m: Likewise.
|
||||
* Source/NSButtonCell.m: Likewise.
|
||||
Finished the second attempt in implementing menus.
|
||||
* Headers/gnustep/gui/NSMenuCell.h: Removed.
|
||||
* Headers/gnustep/gui/NSMenuPrivate.h: Removed.
|
||||
* Headers/gnustep/gui/NSMenuItem.h: New file.
|
||||
* Headers/gnustep/gui/NSMenu.h: Completely reworked.
|
||||
* Headers/gnustep/gui/AppKit.h: Include NSMenuItem.h.
|
||||
* Source/NSMenu.m: Completely reworked.
|
||||
* Source/NSMenuCell.m: Removed.
|
||||
* Source/NSMenuItem.m: New file.
|
||||
|
||||
* Use NSRunLoop to get the events.
|
||||
* Headers/gnustep/gui/NSApplication.h: Define USE_RUN_LOOP macro if you
|
||||
want NSRunLoop class to be used instead of the default busy wait. Note
|
||||
that some classes will not work with the "default" loop. This macro
|
||||
should be removed eventually.
|
||||
(-setupRunLoopInputSourcesForMode:): New method to be implemented in
|
||||
backend. In this method the backend should register to run loop the
|
||||
input sources it uses.
|
||||
* Source/NSApplication.m (-init): Call backend method
|
||||
-setupRunLoopInputSourcesForMode: to setup the input source is several
|
||||
modes used by NSApp.
|
||||
(-run): Get the events from NSDefaultRunLoopMode mode instead of nil.
|
||||
(-nextEventMatchingMask:untilDate:inMode:dequeue:): Check for a
|
||||
matching event into the events queue in the order in which the events
|
||||
occured. Temporary retain the event found before removing it from the
|
||||
events queue to avoid an unneeded deallocation.
|
||||
Inside the loop fire the timers then wait for inputs on the input
|
||||
sources of run loop.
|
||||
* Source/NSButton.m: Call the nextEventMatchingMask:... using the
|
||||
NSEventTrackingRunLoopMode mode instead of nil.
|
||||
* Source/NSCell.m: (-trackMouse:inRect:ofView:untilMouseUp:): Likewise.
|
||||
(-trackScrollButtons:): Likewise.
|
||||
* Source/NSScroller.m (-trackKnob:): Likewise.
|
||||
* Source/NSWindow.m (-nextEventMatchingMask:): Likewise.
|
||||
Fixed objects retain/release policy.
|
||||
* Source/NSView.m: Likewise.
|
||||
* Source/NSWindow.m: Likewise.
|
||||
* Source/NSImage.m: Likewise.
|
||||
|
||||
* NSMatrix class completely reworked to be compliant to the OpenStep
|
||||
specification.
|
||||
* Source/NSMatrix.m: The second implementation.
|
||||
* Headers/gnustep/gui/NSMatrix.h: Likewise.
|
||||
* Source/NSWindow.m: Changed the way in which the windows are
|
||||
identified by number. The NSWindow class should keep track of them
|
||||
instead of NSApplication.
|
||||
* Source/NSApplication.m (-run): Create a local autorelease pool.
|
||||
(-_eventMatchingMask:): New method.
|
||||
(-nextEventMatchingMask:untilDate:inMode:dequeue:): Changed the way
|
||||
in which the events are get off the queue to better handle time events.
|
||||
(-setMainMenu:): Properly handle the assignment of aMenu to main_menu.
|
||||
* Source/NSEvent.m (-windowNumber): Send -windowWithNumber: to NSWindow
|
||||
class instead of using the shared application instance.
|
||||
* Source/NSView.m (-dealloc): Simply release the arrays instead of
|
||||
doing other strange things.
|
||||
(-removeCursorRect:cursor:, -viewWithTag:) Several cleanups.
|
||||
|
||||
* Implementation of NSForm, not tested.
|
||||
* Source/NSForm.m: Initial implementation.
|
||||
* Headers/gnustep/gui/NSForm.h: Likewise.
|
||||
* Source/NSFormCell.m: Initial implementation.
|
||||
* Headers/gnustep/gui/NSFormCell.h: Likewise.
|
||||
|
||||
* Added support in configure and makefiles for libFoundation.
|
||||
* configure.in: Configure checks now for the underlaying Foundation
|
||||
library and the Objective-C runtime for whom the library was compiled
|
||||
for. The code is copied with copy/paste from libFoundation sources.
|
||||
* aclocal.m4: Likewise.
|
||||
* Source/Makefile.in: New OBJC_RUNTIME_FLAG that gets replaced by
|
||||
configure. Remove OBJC_LIB since the runtime library is added to LIBS
|
||||
by configure.
|
||||
|
||||
* Source/NSButton.m: Comment out captureMouse: method call to make
|
||||
possible debugging. Anyway it seems we don't need to capture the mouse.
|
||||
* Source/NSButtonCell.m: Remove the -prefersTrackingUntilMouseUp
|
||||
method.
|
||||
|
||||
* Source/NSCell.m: Changed the way in which a cell gets initialized.
|
||||
Moved all the common things into the -_init method.
|
||||
|
||||
* Added support for periodic events.
|
||||
* Source/NSEvent.m: (+startPeriodicEventsAfterDelay:withPeriod:,
|
||||
+stopPeriodicEvents): New public methods.
|
||||
(+_timerFired:, +_registerRealTimer:): New private methods.
|
||||
* Source/NSWindow.m (flushWindowIfNeeded): Flush the window if it needs
|
||||
flush.
|
||||
(+windowWithNumber:): New method; its implementation should be in the
|
||||
backend library.
|
||||
|
||||
Mon Apr 21 18:57:30 1997 Ovidiu Predescu <ovidiu@net-community.com>
|
||||
|
||||
|
@ -103,7 +70,7 @@ Mon Apr 21 18:57:30 1997 Ovidiu Predescu <ovidiu@net-community.com>
|
|||
* Source/NSScroller.m (-trackKnob:): Likewise.
|
||||
* Source/NSWindow.m (-nextEventMatchingMask:): Likewise.
|
||||
|
||||
* NSMatrix class completely reworked to be compliant to the OpenStep
|
||||
* NSMatrix class completely reworked to be compliant with the OpenStep
|
||||
specification.
|
||||
* Source/NSMatrix.m: The second implementation.
|
||||
* Headers/gnustep/gui/NSMatrix.h: Likewise.
|
||||
|
|
|
@ -91,6 +91,8 @@ version.tmpl.texi: $(srcdir)/../Version
|
|||
>> version.tmpl.texi
|
||||
echo '@set GNUSTEP-GUI-BASE $(GNUSTEP_GUI_BASE)' \
|
||||
>> version.tmpl.texi
|
||||
echo '@set LIB-FOUNDATION $(LIB_FOUNDATION)' \
|
||||
>> version.tmpl.texi
|
||||
echo '@set GNUSTEP-GUI-LIBTIFF $(GNUSTEP_GUI_LIBTIFF)' \
|
||||
>> version.tmpl.texi
|
||||
echo '@set GNUSTEP-GUI-DGS $(GNUSTEP_GUI_DGS)' \
|
||||
|
@ -111,6 +113,7 @@ version.tmpl.texi: $(srcdir)/../Version
|
|||
echo '@set GNUSTEP-GUI-SNAP-FTP-DIRECTORY \
|
||||
$(GNUSTEP_GUI_SNAP_FTP_DIRECTORY)' \
|
||||
>> version.tmpl.texi; fi
|
||||
cp version.tmpl.texi version.texi
|
||||
|
||||
gnustep-gui.dvi: $(ORIG_FILES)
|
||||
rm -f $(TEXI_FILES)
|
||||
|
|
|
@ -65,8 +65,9 @@ It requires the Display Ghostscript System version
|
|||
@value{GNUSTEP-GUI-LIBTIFF}.
|
||||
|
||||
It also requires a FoundationKit library as specified by the OpenStep
|
||||
specification. The FoundationKit library known to work is the GNUstep
|
||||
Base Library version @samp{@value{GNUSTEP-GUI-BASE}}.
|
||||
specification. The FoundationKit libraries known to work are the GNUstep
|
||||
Base Library version @samp{@value{GNUSTEP-GUI-BASE}} and libFoundation
|
||||
version @samp{@value{LIB-FOUNDATION}}.
|
||||
|
||||
The @samp{.tar} file is compressed with GNU gzip. Gzip can be obtained by
|
||||
anonymous ftp at any of the GNU archive sites.
|
||||
|
|
|
@ -105,8 +105,9 @@ It requires the Display Ghostscript System version
|
|||
@value{GNUSTEP-GUI-LIBTIFF}.
|
||||
|
||||
It also requires a FoundationKit library as specified by the OpenStep
|
||||
specification. The FoundationKit library known to work is the GNUstep
|
||||
Base Library version @samp{@value{GNUSTEP-GUI-BASE}}.
|
||||
specification. The FoundationKit libraries known to work are the GNUstep
|
||||
Base Library version @samp{@value{GNUSTEP-GUI-BASE}} and libFoundation version
|
||||
@samp{@value{LIB-FOUNDATION}}.
|
||||
|
||||
The @samp{.tar} file is compressed with GNU gzip. Gzip can be obtained by
|
||||
anonymous ftp at any of the GNU archive sites.
|
||||
|
|
|
@ -30,10 +30,10 @@ Install @samp{gcc}. The library requires gcc version
|
|||
@value{GNUSTEP-GUI-GCC} or later.
|
||||
|
||||
@item
|
||||
Install @samp{gnustep-base}. This library requires the classes in
|
||||
the GNUstep Base Library. You must also apply the Objective-C
|
||||
Runtime patches to GCC which makes the runtime thread-safe, if
|
||||
your version of GCC lacks them.
|
||||
Install @samp{gnustep-base} or @samp{libFoundation}. This library requires the
|
||||
classes either in the GNUstep Base Library or libFoundation. You must also
|
||||
apply the Objective-C Runtime patches to GCC which makes the runtime
|
||||
thread-safe, if your version of GCC lacks them.
|
||||
|
||||
@item
|
||||
Install the @samp{TIFF} library. This library requires the header files
|
||||
|
|
|
@ -9,6 +9,48 @@
|
|||
|
||||
The currently released version of the library is @samp{@value{GNUSTEP-GUI-VERSION}}.
|
||||
|
||||
@section Noteworthy changes in version @samp{0.3.0}
|
||||
|
||||
@itemize @bullet
|
||||
|
||||
@item
|
||||
Completely reworked the menu class. The NSMenu class is now inherited from
|
||||
NSObject and using the new implementation menus have been implemented for the
|
||||
XDPS backend (they have the look and feel of the NeXTStep menus!).
|
||||
|
||||
@item
|
||||
NSRunLoop has been integrated with NSApplication. Using this capability time
|
||||
events have been implemented to NSEvent class. These events allow several
|
||||
improvements in the interaction between user and the graphic interface.
|
||||
|
||||
@item
|
||||
NSMatrix has been reworked, it is now conforming to the OpenStep specification
|
||||
and it knows all the selection modes. It uses time events to enhance the
|
||||
drawing speed during mouse drags.
|
||||
|
||||
@item
|
||||
The initial implementation of NSForm has been made although it has not been
|
||||
tested yet.
|
||||
|
||||
@item
|
||||
NSPrinter has been implemented though it was not throughly tested; thanks to
|
||||
Simon Frankau.
|
||||
|
||||
@item
|
||||
Configure script has been changed to detect the underlaying Foundation library.
|
||||
The currently supported libraries are gnustep-base and libFoundation.
|
||||
|
||||
@item
|
||||
Several cleanups have been made in a lot of classes: the retain/release policy
|
||||
has been fixed, the cell classes correctly implement the NSCopying protocol
|
||||
and many others.
|
||||
|
||||
@end itemize
|
||||
|
||||
@c ====================================================================
|
||||
@c Keep the next line just below the list of changes in most recent version.
|
||||
@ifclear ANNOUNCE-ONLY
|
||||
|
||||
@section Noteworthy changes in version @samp{0.2.0}
|
||||
|
||||
@itemize @bullet
|
||||
|
@ -56,10 +98,6 @@ Many bug fixes and minor enhancements.
|
|||
|
||||
@end itemize
|
||||
|
||||
@c ====================================================================
|
||||
@c Keep the next line just below the list of changes in most recent version.
|
||||
@ifclear ANNOUNCE-ONLY
|
||||
|
||||
@section Noteworthy changes in version @samp{0.1.1}
|
||||
|
||||
@itemize @bullet
|
||||
|
|
|
@ -5,7 +5,7 @@
|
|||
@include version.texi
|
||||
@end ifset
|
||||
|
||||
Last updated March 1997. The most up-to-date version of this status
|
||||
Last updated July 1997. The most up-to-date version of this status
|
||||
report is available at:
|
||||
|
||||
@example
|
||||
|
@ -45,9 +45,9 @@ backend as it is an abstract class which only defines behaviour. All
|
|||
methods are implemented; the only thing lacking is a test, if needed.
|
||||
|
||||
@item NSApplication:: [6]
|
||||
The event handling is pretty good though it
|
||||
does not take advantage of the NSRunLoop class. Many of the minor
|
||||
methods are implemented. No window ordering is being maintained, and
|
||||
The event handling has been integrated with the NSRunLoop class.
|
||||
Many of the minor methods are implemented.
|
||||
No window ordering is being maintained, and
|
||||
a number of the methods that perform operations on windows are
|
||||
empty. Modal loops are not implemented.
|
||||
|
||||
|
@ -138,7 +138,9 @@ Ghostscript System, but still requires additional work.
|
|||
@item NSFontPanel:: [2]
|
||||
May be usable with backend implementation.
|
||||
|
||||
@item NSForm:: [2]
|
||||
@item NSForm:: [9]
|
||||
The code has been written, it greatly depends on NSMatrix, but no tests have
|
||||
been made.
|
||||
|
||||
@item NSFormCell:: [2]
|
||||
|
||||
|
@ -153,16 +155,19 @@ classes.
|
|||
Additional implementation to the point where TIFF images can be
|
||||
displayed; requires sufficient backend implementation.
|
||||
|
||||
@item NSMatrix:: [6]
|
||||
Many methods are implemented but more thorough testing needs to be done.
|
||||
@item NSMatrix:: [9]
|
||||
The class is almost completely implemented, only the methods that deal with
|
||||
text selection and moving from a text field to another using TAB and SHIFT-TAB
|
||||
are empty.
|
||||
|
||||
@item NSMenu:: [2]
|
||||
Implementation was removed until a more efficient mechanism can be
|
||||
devised. The OpenStep specification has changed regarding this class.
|
||||
@item NSMenu:: [10]
|
||||
The class is complete now, all the logic is here, the backend needs to
|
||||
write only the code that deals with displaying the menu windows on screen. For
|
||||
an example of how this is achieved take a look to the XDPS backend.
|
||||
|
||||
@item NSMenuCell:: [8]
|
||||
Almost complete implementation; actual ability to use depends upon
|
||||
backend implementation.
|
||||
@item NSMenuItem:: [10]
|
||||
The logic is here, but needs support for drawing the cell in the backend. Also
|
||||
take a look to the XDPS backend to see how this works.
|
||||
|
||||
@item NSOpenPanel:: [6]
|
||||
Usability greatly depends upon backend implementation.
|
||||
|
@ -176,7 +181,10 @@ Usability greatly depends upon backend implementation.
|
|||
@item NSPopUpButton:: [4]
|
||||
Usability greatly depends upon backend implementation.
|
||||
|
||||
@item NSPrinter:: [2]
|
||||
@item NSPrinter:: [9]
|
||||
The code was written but not tested very much. We also need to add printer
|
||||
description files to the PrinterTypes directory inside the gnustep instalation
|
||||
directory.
|
||||
|
||||
@item NSPrintinfo:: [2]
|
||||
|
||||
|
|
7
FAQ
7
FAQ
|
@ -76,7 +76,7 @@ is available at:
|
|||
|
||||
5. Where can I get a copy?
|
||||
|
||||
The gstep-gui-0.2.0.tar.gz distribution file has been placed on
|
||||
The gstep-gui-0.3.0.tar.gz distribution file has been placed on
|
||||
`ftp.gnustep.org' in `pub/gnustep'.
|
||||
|
||||
The program requires gcc 2.7.0 or higher.
|
||||
|
@ -85,8 +85,9 @@ is available at:
|
|||
TIFF Graphics library version 3.4.
|
||||
|
||||
It also requires a FoundationKit library as specified by the
|
||||
OpenStep specification. The FoundationKit library known to work
|
||||
is the GNUstep Base Library version `0.2.12'.
|
||||
OpenStep specification. The FoundationKit libraries known to work
|
||||
are the GNUstep Base Library version `0.2.12' and libFoundation
|
||||
version `0.7.1'.
|
||||
|
||||
The `.tar' file is compressed with GNU gzip. Gzip can be obtained
|
||||
by anonymous ftp at any of the GNU archive sites.
|
||||
|
|
|
@ -105,7 +105,7 @@
|
|||
#include <AppKit/NSImageRep.h>
|
||||
#include <AppKit/NSMatrix.h>
|
||||
#include <AppKit/NSMenu.h>
|
||||
#include <AppKit/NSMenuCell.h>
|
||||
#include <AppKit/NSMenuItem.h>
|
||||
#include <AppKit/NSNibLoading.h>
|
||||
#include <AppKit/NSOpenPanel.h>
|
||||
#include <AppKit/NSPageLayout.h>
|
||||
|
|
|
@ -43,7 +43,7 @@
|
|||
@class NSEvent;
|
||||
@class NSPasteboard;
|
||||
@class NSMenu;
|
||||
@class NSMenuCell;
|
||||
@class NSMenuItem;
|
||||
@class NSImage;
|
||||
@class NSWindow;
|
||||
@class NSDPSContext;
|
||||
|
@ -72,7 +72,7 @@ extern NSString *NSEventTrackingRunLoopMode;
|
|||
id delegate;
|
||||
int window_count;
|
||||
NSMenu *main_menu;
|
||||
NSMenuCell *windows_menu;
|
||||
NSMenuItem *windows_menu;
|
||||
unsigned int current_mod;
|
||||
BOOL app_is_running;
|
||||
BOOL app_should_quit;
|
||||
|
|
|
@ -267,6 +267,7 @@ enum {
|
|||
- (void)setContinuous:(BOOL)flag;
|
||||
- (void)setTarget:(id)anObject;
|
||||
- (id)target;
|
||||
- (void)performClick:(id)sender;
|
||||
|
||||
//
|
||||
// Assigning a Tag
|
||||
|
|
|
@ -1,13 +1,11 @@
|
|||
/*
|
||||
NSMenu.h
|
||||
|
||||
The menu class
|
||||
Here is your menu sir, our specials today are...
|
||||
|
||||
Copyright (C) 1996 Free Software Foundation, Inc.
|
||||
|
||||
Author: Scott Christley <scottc@net-community.com>
|
||||
Date: 1996
|
||||
Author: Ovidiu Predescu <ovidiu@net-community.com>
|
||||
Date: May 1997
|
||||
A completely rewritten version of the original source by Scott Christley.
|
||||
|
||||
This file is part of the GNUstep GUI Library.
|
||||
|
||||
|
@ -30,97 +28,128 @@
|
|||
#ifndef _GNUstep_H_NSMenu
|
||||
#define _GNUstep_H_NSMenu
|
||||
|
||||
#include <Foundation/NSCoder.h>
|
||||
#include <Foundation/NSGeometry.h>
|
||||
#include <AppKit/NSMenuItem.h>
|
||||
#include <AppKit/NSControl.h>
|
||||
|
||||
@class NSString;
|
||||
@class NSArray;
|
||||
@class NSMutableArray;
|
||||
|
||||
@class NSEvent;
|
||||
@class NSMatrix;
|
||||
@class NSMenuCell;
|
||||
|
||||
@interface NSMenu : NSObject <NSCoding>
|
||||
@class NSMenuMatrix;
|
||||
|
||||
@interface NSMenu : NSObject <NSCoding, NSCopying>
|
||||
{
|
||||
// Attributes
|
||||
NSString *window_title;
|
||||
NSMutableArray *menu_items;
|
||||
NSMenu *super_menu;
|
||||
BOOL autoenables_items;
|
||||
NSMatrix *menu_matrix;
|
||||
BOOL is_torn_off;
|
||||
NSString* title;
|
||||
NSMenuMatrix* menuCells;
|
||||
NSMenu* supermenu;
|
||||
NSMenu* attachedMenu;
|
||||
BOOL autoenablesItems;
|
||||
BOOL menuChangedMessagesEnabled;
|
||||
BOOL menuHasChanged;
|
||||
|
||||
// Reserved for back-end use
|
||||
void *be_menu_reserved;
|
||||
}
|
||||
|
||||
//
|
||||
// Controlling Allocation Zones
|
||||
//
|
||||
+ (NSZone *)menuZone;
|
||||
+ (void)setMenuZone:(NSZone *)zone;
|
||||
/* Controlling allocation zones */
|
||||
+ (void)setMenuZone:(NSZone*)zone;
|
||||
+ (NSZone*)menuZone;
|
||||
|
||||
//
|
||||
// Initializing a New NSMenu
|
||||
//
|
||||
- (id)initWithTitle:(NSString *)aTitle;
|
||||
/* Setting the menu cell class */
|
||||
+ (void)setCellClass:(Class)aClass;
|
||||
+ (Class)cellClass;
|
||||
|
||||
//
|
||||
// Setting Up the Menu Commands
|
||||
//
|
||||
- (id)addItemWithTitle:(NSString *)aString
|
||||
action:(SEL)aSelector
|
||||
keyEquivalent:(NSString *)charCode;
|
||||
- (id)insertItemWithTitle:(NSString *)aString
|
||||
action:(SEL)aSelector
|
||||
keyEquivalent:(NSString *)charCode
|
||||
atIndex:(unsigned int)index;
|
||||
- (NSArray *)itemArray;
|
||||
- (NSMatrix *)itemMatrix;
|
||||
- (void)setItemMatrix:(NSMatrix *)aMatrix;
|
||||
/* Initializing a new NSMenu */
|
||||
- (id)initWithTitle:(NSString*)aTitle;
|
||||
|
||||
//
|
||||
// Finding Menu Items
|
||||
//
|
||||
- (id)cellWithTag:(int)aTag;
|
||||
/* Setting up the menu commands */
|
||||
- (id <NSMenuItem>)addItemWithTitle:(NSString*)aString
|
||||
action:(SEL)aSelector
|
||||
keyEquivalent:(NSString*)charCode;
|
||||
- (id <NSMenuItem>)insertItemWithTitle:(NSString*)aString
|
||||
action:(SEL)aSelector
|
||||
keyEquivalent:(NSString*)charCode
|
||||
atIndex:(unsigned int)index;
|
||||
- (void)removeItem:(id <NSMenuItem>)anItem;
|
||||
- (NSArray*)itemArray;
|
||||
|
||||
//
|
||||
// Building Submenus
|
||||
//
|
||||
- (NSMenuCell *)setSubmenu:(NSMenu *)aMenu
|
||||
forItem:(NSMenuCell *)aCell;
|
||||
/* Finding menu items */
|
||||
- (id <NSMenuItem>)itemWithTag:(int)aTag;
|
||||
- (id <NSMenuItem>)itemWithTitle:(NSString*)aString;
|
||||
|
||||
/* Managing submenus */
|
||||
- (void)setSubmenu:(NSMenu*)aMenu forItem:(id <NSMenuItem>)anItem;
|
||||
- (void)submenuAction:(id)sender;
|
||||
|
||||
//
|
||||
// Managing NSMenu Windows
|
||||
//
|
||||
- (NSMenu *)attachedMenu;
|
||||
- (NSMenu*)attachedMenu;
|
||||
- (BOOL)isAttached;
|
||||
- (BOOL)isTornOff;
|
||||
- (NSPoint)locationForSubmenu:(NSMenu *)aSubmenu;
|
||||
- (void)sizeToFit;
|
||||
- (NSMenu *)supermenu;
|
||||
- (NSPoint)locationForSubmenu:(NSMenu*)aSubmenu;
|
||||
- (NSMenu*)supermenu;
|
||||
|
||||
//
|
||||
// Displaying the Menu
|
||||
//
|
||||
- (BOOL)autoenablesItems;
|
||||
/* Enabling and disabling menu items */
|
||||
- (void)setAutoenablesItems:(BOOL)flag;
|
||||
- (BOOL)autoenablesItems;
|
||||
- (void)update;
|
||||
|
||||
//
|
||||
// NSCoding protocol
|
||||
//
|
||||
- (void)encodeWithCoder:aCoder;
|
||||
- initWithCoder:aDecoder;
|
||||
/* Perform a menu item action (not an OpenStep method) */
|
||||
- (void)performActionForItem:(id <NSMenuItem>)anItem;
|
||||
|
||||
/* Handling keyboard equivalents */
|
||||
- (BOOL)performKeyEquivalent:(NSEvent*)theEvent;
|
||||
|
||||
/* Updating menu layout */
|
||||
- (void)setMenuChangedMessagesEnabled:(BOOL)flag;
|
||||
- (BOOL)menuChangedMessagesEnabled;
|
||||
- (void)sizeToFit;
|
||||
|
||||
/* Getting the menu title */
|
||||
- (NSString*)title;
|
||||
|
||||
/* Getting the menu cells matrix */
|
||||
- (NSMenuMatrix*)menuCells;
|
||||
|
||||
@end
|
||||
|
||||
@interface NSObject (NSMenuActionResponder)
|
||||
|
||||
//
|
||||
// Updating NSMenuCells
|
||||
//
|
||||
- (BOOL)validateCell:(id)aCell;
|
||||
@interface NSObject (NSMenuActionResponder)
|
||||
- (BOOL)validateMenuItem:(NSMenuItem*)aMenuItem;
|
||||
@end
|
||||
|
||||
|
||||
@interface NSMenu (PrivateMethods)
|
||||
/* Shows the menu window on screen */
|
||||
- (void)display;
|
||||
|
||||
/* Close the associated window menu */
|
||||
- (void)close;
|
||||
@end
|
||||
|
||||
|
||||
/* Private class used to display the menu cells and respond to user actions */
|
||||
@interface NSMenuMatrix : NSControl <NSCopying>
|
||||
{
|
||||
NSMutableArray* cells;
|
||||
NSSize cellSize;
|
||||
NSMenu* menu;
|
||||
id selectedCell;
|
||||
NSRect selectedCellRect;
|
||||
}
|
||||
|
||||
- initWithFrame:(NSRect)rect;
|
||||
- (id <NSMenuItem>)insertItemWithTitle:(NSString*)aString
|
||||
action:(SEL)aSelector
|
||||
keyEquivalent:(NSString*)charCode
|
||||
atIndex:(unsigned int)index;
|
||||
- (void)removeItem:(id <NSMenuItem>)anItem;
|
||||
- (NSArray*)itemArray;
|
||||
- (id <NSMenuItem>)itemWithTitle:(NSString*)aString;
|
||||
- (id <NSMenuItem>)itemWithTag:(int)aTag;
|
||||
- (NSRect)cellFrameAtRow:(int)index;
|
||||
- (NSSize)cellSize;
|
||||
- (void)setMenu:(NSMenu*)menu;
|
||||
- (void)setSelectedCell:(id)aCell;
|
||||
- (id)selectedCell;
|
||||
- (NSRect)selectedCellRect;
|
||||
|
||||
@end
|
||||
|
||||
|
|
|
@ -1,76 +0,0 @@
|
|||
/*
|
||||
NSMenuCell.h
|
||||
|
||||
Cell class for menu items
|
||||
|
||||
Copyright (C) 1996 Free Software Foundation, Inc.
|
||||
|
||||
Author: Scott Christley <scottc@net-community.com>
|
||||
Date: 1996
|
||||
|
||||
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; see the file COPYING.LIB.
|
||||
If not, write to the Free Software Foundation,
|
||||
59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||
*/
|
||||
|
||||
#ifndef _GNUstep_H_NSMenuCell
|
||||
#define _GNUstep_H_NSMenuCell
|
||||
|
||||
#include <AppKit/NSButtonCell.h>
|
||||
|
||||
@class NSString;
|
||||
@class NSMenu;
|
||||
|
||||
@interface NSMenuCell : NSButtonCell <NSCoding>
|
||||
{
|
||||
// Attributes
|
||||
NSString *key_equivalent;
|
||||
NSMenu *sub_menu;
|
||||
unsigned int menu_identifier;
|
||||
|
||||
// Reserved for back-end use
|
||||
void *be_mc_reserved;
|
||||
}
|
||||
|
||||
//
|
||||
// WIN32 methods
|
||||
//
|
||||
- (unsigned int)menuIdentifier;
|
||||
- (void)setMenuIdentifier:(unsigned int)theID;
|
||||
|
||||
//
|
||||
// Checking for a Submenu
|
||||
//
|
||||
- (BOOL)hasSubmenu;
|
||||
- (NSMenu *)submenu;
|
||||
- (void)setSubmenu:(NSMenu *)aMenu;
|
||||
|
||||
//
|
||||
// Managing User Key Equivalents
|
||||
//
|
||||
+ (void)setUsesUserKeyEquivalents:(BOOL)flag;
|
||||
+ (BOOL)usesUserKeyEquivalents;
|
||||
- (NSString *)userKeyEquivalent;
|
||||
|
||||
//
|
||||
// NSCoding protocol
|
||||
//
|
||||
- (void)encodeWithCoder:aCoder;
|
||||
- initWithCoder:aDecoder;
|
||||
|
||||
@end
|
||||
|
||||
#endif // _GNUstep_H_NSMenuCell
|
96
Headers/gnustep/gui/NSMenuItem.h
Normal file
96
Headers/gnustep/gui/NSMenuItem.h
Normal file
|
@ -0,0 +1,96 @@
|
|||
/*
|
||||
NSMenuItem.h
|
||||
|
||||
The menu cell protocol and the GNUstep menu cell class.
|
||||
|
||||
Copyright (C) 1996 Free Software Foundation, Inc.
|
||||
|
||||
Author: Ovidiu Predescu <ovidiu@net-community.com>
|
||||
Date: May 1997
|
||||
|
||||
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; see the file COPYING.LIB.
|
||||
If not, write to the Free Software Foundation,
|
||||
59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||
*/
|
||||
|
||||
#ifndef _GNUstep_H_NSMenuItem
|
||||
#define _GNUstep_H_NSMenuItem
|
||||
|
||||
#include <AppKit/NSButtonCell.h>
|
||||
|
||||
@protocol NSMenuItem <NSCopying, NSCoding>
|
||||
|
||||
- (void)setTarget:(id)anObject;
|
||||
- (id)target;
|
||||
- (void)setAction:(SEL)aSelector;
|
||||
- (SEL)action;
|
||||
|
||||
- (void)setTitle:(NSString*)aString;
|
||||
- (NSString*)title;
|
||||
|
||||
- (void)setTag:(int)anInt;
|
||||
- (int)tag;
|
||||
|
||||
- (void)setEnabled:(BOOL)flag;
|
||||
- (BOOL)isEnabled;
|
||||
|
||||
- (BOOL)hasSubmenu;
|
||||
|
||||
- (void)setKeyEquivalent:(NSString*)aKeyEquivalent;
|
||||
- (NSString*)keyEquivalent;
|
||||
- (void)setKeyEquivalentModifierMask:(unsigned int)mask;
|
||||
- (unsigned int)keyEquivalentModifierMask;
|
||||
|
||||
+ (void)setUsesUserKeyEquivalents:(BOOL)flag;
|
||||
+ (BOOL)usesUserKeyEquivalents;
|
||||
- (NSString*)userKeyEquivalent;
|
||||
|
||||
- (void)setRepresentedObject:(id)anObject;
|
||||
- (id)representedObject;
|
||||
|
||||
@end
|
||||
|
||||
|
||||
@interface NSMenuItem : NSButtonCell //<NSMenuItem>
|
||||
{
|
||||
id representedObject;
|
||||
BOOL hasSubmenu;
|
||||
}
|
||||
|
||||
- (void)setTitle:(NSString*)aString;
|
||||
- (NSString*)title;
|
||||
|
||||
- (BOOL)hasSubmenu;
|
||||
|
||||
+ (void)setUsesUserKeyEquivalents:(BOOL)flag;
|
||||
+ (BOOL)usesUserKeyEquivalents;
|
||||
- (NSString*)userKeyEquivalent;
|
||||
|
||||
- (void)setRepresentedObject:(id)anObject;
|
||||
- (id)representedObject;
|
||||
|
||||
@end
|
||||
|
||||
|
||||
/* Private stuff; it should be in a private header file but it really doesn't
|
||||
worth the effort. */
|
||||
enum {
|
||||
INTERCELL_SPACE = 1,
|
||||
RIGHT_IMAGE_WIDTH = 12,
|
||||
ADDITIONAL_WIDTH = RIGHT_IMAGE_WIDTH + 6
|
||||
};
|
||||
|
||||
#endif // _GNUstep_H_NSMenuItem
|
|
@ -1,40 +0,0 @@
|
|||
/*
|
||||
NSMenuPrivate.h
|
||||
|
||||
Private methods for the menu class
|
||||
|
||||
Copyright (C) 1996 Free Software Foundation, Inc.
|
||||
|
||||
Author: Scott Christley <scottc@net-community.com>
|
||||
Date: September 1996
|
||||
|
||||
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; see the file COPYING.LIB.
|
||||
If not, write to the Free Software Foundation,
|
||||
59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||
*/
|
||||
|
||||
#ifndef _GNUstep_H_NSMenuPrivate
|
||||
#define _GNUstep_H_NSMenuPrivate
|
||||
|
||||
#include <AppKit/NSMenu.h>
|
||||
|
||||
@interface NSMenu (GNUstepPrivate)
|
||||
|
||||
- (void)setSupermenu:(NSMenu *)obj;
|
||||
|
||||
@end
|
||||
|
||||
#endif // _GNUstep_H_NSMenuPrivate
|
|
@ -3,10 +3,10 @@
|
|||
|
||||
Class representing a printer's or printer model's capabilities.
|
||||
|
||||
Copyright (C) 1996 Free Software Foundation, Inc.
|
||||
Copyright (C) 1996, 1997 Free Software Foundation, Inc.
|
||||
|
||||
Author: Scott Christley <scottc@net-community.com>
|
||||
Date: 1996
|
||||
Authors: Simon Frankau <sgf@frankau.demon.co.uk>
|
||||
Date: June 1997
|
||||
|
||||
This file is part of the GNUstep GUI Library.
|
||||
|
||||
|
@ -29,12 +29,13 @@
|
|||
#ifndef _GNUstep_H_NSPrinter
|
||||
#define _GNUstep_H_NSPrinter
|
||||
|
||||
#include <gnustep/gui/config.h>
|
||||
#include <Foundation/NSCoder.h>
|
||||
#include <Foundation/NSGeometry.h>
|
||||
|
||||
@class NSString;
|
||||
@class NSArray;
|
||||
@class NSDictionary;
|
||||
@class NSMutableDictionary;
|
||||
|
||||
typedef enum _NSPrinterTableStatus {
|
||||
NSPrinterTableOK,
|
||||
|
@ -44,7 +45,14 @@ typedef enum _NSPrinterTableStatus {
|
|||
|
||||
@interface NSPrinter : NSObject <NSCoding>
|
||||
{
|
||||
// Attributes
|
||||
NSString *printerHost, *printerName, *printerNote, *printerType;
|
||||
int cacheAcceptsBinary, cacheOutputOrder;
|
||||
BOOL isRealPrinter;
|
||||
NSMutableDictionary *PPD;
|
||||
NSMutableDictionary *PPDOptionTranslation;
|
||||
NSMutableDictionary *PPDArgumentTranslation;
|
||||
NSMutableDictionary *PPDOrderDependency;
|
||||
NSMutableDictionary *PPDUIConstraints;
|
||||
}
|
||||
|
||||
//
|
||||
|
|
|
@ -91,6 +91,7 @@ extern NSSize NSTokenSize;
|
|||
|
||||
BOOL is_one_shot;
|
||||
BOOL needs_display;
|
||||
BOOL needs_flush;
|
||||
BOOL is_autodisplay;
|
||||
BOOL optimize_drawing;
|
||||
BOOL views_need_display;
|
||||
|
@ -394,6 +395,10 @@ extern NSSize NSTokenSize;
|
|||
- (void)encodeWithCoder:aCoder;
|
||||
- initWithCoder:aDecoder;
|
||||
|
||||
// Private methods
|
||||
- (void)_setNeedsFlush:(BOOL)flag;
|
||||
- (BOOL)_needsFlush;
|
||||
|
||||
@end
|
||||
|
||||
//
|
||||
|
@ -401,6 +406,8 @@ extern NSSize NSTokenSize;
|
|||
//
|
||||
@interface NSWindow (GNUstepBackend)
|
||||
|
||||
+ (NSWindow*)windowWithNumber:(int)windowNumber;
|
||||
|
||||
//
|
||||
// Mouse capture/release
|
||||
//
|
||||
|
|
10
INSTALL
10
INSTALL
|
@ -6,7 +6,7 @@ This file documents the installation of the GNUstep GUI Library,
|
|||
may copy, distribute, and modify it freely as long as you preserve this
|
||||
copyright notice and permission notice.
|
||||
|
||||
This is version 0.2.0 of the GNUstep GUI library.
|
||||
This is version 0.3.0 of the GNUstep GUI library.
|
||||
|
||||
Installing `gnustep-gui'
|
||||
========================
|
||||
|
@ -21,10 +21,10 @@ Installing `gnustep-gui'
|
|||
|
||||
1. Install `gcc'. The library requires gcc version 2.7.0 or later.
|
||||
|
||||
2. Install `gnustep-base'. This library requires the classes in the
|
||||
GNUstep Base Library. You must also apply the Objective-C Runtime
|
||||
patches to GCC which makes the runtime thread-safe, if your
|
||||
version of GCC lacks them.
|
||||
2. Install `gnustep-base' or `libFoundation'. This library requires
|
||||
the classes either in the GNUstep Base Library or libFoundation.
|
||||
You must also apply the Objective-C Runtime patches to GCC which
|
||||
makes the runtime thread-safe, if your version of GCC lacks them.
|
||||
|
||||
3. Install the `TIFF' library. This library requires the header files
|
||||
in the TIFF library to compile; the TIFF library is used for the
|
||||
|
|
|
@ -51,8 +51,13 @@ common_ArrowDown.tiff \
|
|||
common_ArrowUp.tiff \
|
||||
common_ArrowRight.tiff \
|
||||
common_ArrowLeft.tiff \
|
||||
common_Close.tiff \
|
||||
common_CloseH.tiff \
|
||||
common_CloseBroken.tiff \
|
||||
common_RadioOn.tiff \
|
||||
common_RadioOff.tiff \
|
||||
common_Right.tiff \
|
||||
common_RightH.tiff \
|
||||
common_SwitchOn.tiff \
|
||||
common_SwitchOff.tiff \
|
||||
common_Dimple.tiff \
|
||||
|
|
BIN
Images/common_Close.tiff
Normal file
BIN
Images/common_Close.tiff
Normal file
Binary file not shown.
BIN
Images/common_CloseBroken.tiff
Normal file
BIN
Images/common_CloseBroken.tiff
Normal file
Binary file not shown.
BIN
Images/common_CloseH.tiff
Normal file
BIN
Images/common_CloseH.tiff
Normal file
Binary file not shown.
BIN
Images/common_Right.tiff
Normal file
BIN
Images/common_Right.tiff
Normal file
Binary file not shown.
BIN
Images/common_RightH.tiff
Normal file
BIN
Images/common_RightH.tiff
Normal file
Binary file not shown.
33
NEWS
33
NEWS
|
@ -1,7 +1,38 @@
|
|||
NEWS
|
||||
****
|
||||
|
||||
The currently released version of the library is `0.2.0'.
|
||||
The currently released version of the library is `0.3.0'.
|
||||
|
||||
Noteworthy changes in version `0.3.0'
|
||||
=====================================
|
||||
|
||||
* Completely reworked the menu class. The NSMenu class is now
|
||||
inherited from NSObject and using the new implementation menus
|
||||
have been implemented for the XDPS backend (they have the look and
|
||||
feel of the NeXTStep menus!).
|
||||
|
||||
* NSRunLoop has been integrated with NSApplication. Using this
|
||||
capability time events have been implemented to NSEvent class.
|
||||
These events allow several improvements in the interaction between
|
||||
user and the graphic interface.
|
||||
|
||||
* NSMatrix has been reworked, it is now conforming to the OpenStep
|
||||
specification and it knows all the selection modes. It uses time
|
||||
events to enhance the drawing speed during mouse drags.
|
||||
|
||||
* The initial implementation of NSForm has been made although it has
|
||||
not been tested yet.
|
||||
|
||||
* NSPrinter has been implemented though it was not throughly tested;
|
||||
thanks to Simon Frankau.
|
||||
|
||||
* Configure script has been changed to detect the underlaying
|
||||
Foundation library. The currently supported libraries are
|
||||
gnustep-base and libFoundation.
|
||||
|
||||
* Several cleanups have been made in a lot of classes: the
|
||||
retain/release policy has been fixed, the cell classes correctly
|
||||
implement the NSCopying protocol and many others.
|
||||
|
||||
Noteworthy changes in version `0.2.0'
|
||||
=====================================
|
||||
|
|
2
README
2
README
|
@ -1,7 +1,7 @@
|
|||
README
|
||||
******
|
||||
|
||||
This is version 0.2.0 of the GNUstep GUI library (`gnustep-gui').
|
||||
This is version 0.3.0 of the GNUstep GUI library (`gnustep-gui').
|
||||
|
||||
Here is some introductory info to get you started:
|
||||
|
||||
|
|
45
STATUS
45
STATUS
|
@ -1,7 +1,7 @@
|
|||
Status Report
|
||||
*************
|
||||
|
||||
Last updated March 1997. The most up-to-date version of this status
|
||||
Last updated July 1997. The most up-to-date version of this status
|
||||
report is available at:
|
||||
|
||||
`http://www.gnustep.org/Documentation/gnustep-gui/gnustep-gui_toc.html'
|
||||
|
@ -42,11 +42,10 @@ Classes
|
|||
implemented; the only thing lacking is a test, if needed.
|
||||
|
||||
*NSApplication:: [6]*
|
||||
The event handling is pretty good though it does not take
|
||||
advantage of the NSRunLoop class. Many of the minor methods are
|
||||
implemented. No window ordering is being maintained, and a number
|
||||
of the methods that perform operations on windows are empty.
|
||||
Modal loops are not implemented.
|
||||
The event handling has been integrated with the NSRunLoop class.
|
||||
Many of the minor methods are implemented. No window ordering is
|
||||
being maintained, and a number of the methods that perform
|
||||
operations on windows are empty. Modal loops are not implemented.
|
||||
|
||||
*NSBitmapImageRep:: [4]*
|
||||
Implementation has been filled out enough so that TIFF images can
|
||||
|
@ -124,7 +123,10 @@ Classes
|
|||
*NSFontPanel:: [2]*
|
||||
May be usable with backend implementation.
|
||||
|
||||
*NSForm:: [2]*
|
||||
*NSForm:: [9]*
|
||||
The code has been written, it greatly depends on NSMatrix, but no
|
||||
tests have been made.
|
||||
|
||||
*NSFormCell:: [2]*
|
||||
*NSHelpPanel:: [2]*
|
||||
*NSImage:: [8]*
|
||||
|
@ -136,18 +138,21 @@ Classes
|
|||
Additional implementation to the point where TIFF images can be
|
||||
displayed; requires sufficient backend implementation.
|
||||
|
||||
*NSMatrix:: [6]*
|
||||
Many methods are implemented but more thorough testing needs to be
|
||||
done.
|
||||
*NSMatrix:: [9]*
|
||||
The class is almost completely implemented, only the methods that
|
||||
deal with text selection and moving from a text field to another
|
||||
using TAB and SHIFT-TAB are empty.
|
||||
|
||||
*NSMenu:: [2]*
|
||||
Implementation was removed until a more efficient mechanism can be
|
||||
devised. The OpenStep specification has changed regarding this
|
||||
class.
|
||||
*NSMenu:: [10]*
|
||||
The class is complete now, all the logic is here, the backend
|
||||
needs to write only the code that deals with displaying the menu
|
||||
windows on screen. For an example of how this is achieved take a
|
||||
look to the XDPS backend.
|
||||
|
||||
*NSMenuCell:: [8]*
|
||||
Almost complete implementation; actual ability to use depends upon
|
||||
backend implementation.
|
||||
*NSMenuItem:: [10]*
|
||||
The logic is here, but needs support for drawing the cell in the
|
||||
backend. Also take a look to the XDPS backend to see how this
|
||||
works.
|
||||
|
||||
*NSOpenPanel:: [6]*
|
||||
Usability greatly depends upon backend implementation.
|
||||
|
@ -158,7 +163,11 @@ Classes
|
|||
*NSPopUpButton:: [4]*
|
||||
Usability greatly depends upon backend implementation.
|
||||
|
||||
*NSPrinter:: [2]*
|
||||
*NSPrinter:: [9]*
|
||||
The code was written but not tested very much. We also need to add
|
||||
printer description files to the PrinterTypes directory inside the
|
||||
gnustep instalation directory.
|
||||
|
||||
*NSPrintinfo:: [2]*
|
||||
*NSPrintOperation:: [2]*
|
||||
*NSPrintPanel:: [2]*
|
||||
|
|
|
@ -125,7 +125,7 @@ gui/NSImage.h \
|
|||
gui/NSImageRep.h \
|
||||
gui/NSMatrix.h \
|
||||
gui/NSMenu.h \
|
||||
gui/NSMenuCell.h \
|
||||
gui/NSMenuItem.h \
|
||||
gui/NSNibLoading.h \
|
||||
gui/NSOpenPanel.h \
|
||||
gui/NSPageLayout.h \
|
||||
|
@ -201,7 +201,7 @@ NSImage$(oext) \
|
|||
NSImageRep$(oext) \
|
||||
NSMatrix$(oext) \
|
||||
NSMenu$(oext) \
|
||||
NSMenuCell$(oext) \
|
||||
NSMenuItem$(oext) \
|
||||
NSOpenPanel$(oext) \
|
||||
NSPageLayout$(oext) \
|
||||
NSPanel$(oext) \
|
||||
|
|
|
@ -31,6 +31,8 @@
|
|||
#include <Foundation/NSArray.h>
|
||||
#include <Foundation/NSNotification.h>
|
||||
#include <Foundation/NSRunLoop.h>
|
||||
#include <Foundation/NSAutoreleasePool.h>
|
||||
|
||||
#include <DPSClient/NSDPSContext.h>
|
||||
#include <AppKit/NSApplication.h>
|
||||
#include <AppKit/NSPopUpButton.h>
|
||||
|
@ -38,7 +40,7 @@
|
|||
#include <AppKit/NSEvent.h>
|
||||
#include <AppKit/NSImage.h>
|
||||
#include <AppKit/NSMenu.h>
|
||||
#include <AppKit/NSMenuCell.h>
|
||||
#include <AppKit/NSMenuItem.h>
|
||||
#include <AppKit/NSCursor.h>
|
||||
|
||||
//
|
||||
|
@ -264,6 +266,7 @@ NSString *NSApplicationWillUpdateNotification = @"ApplicationWillUpdate";
|
|||
- (void)run
|
||||
{
|
||||
NSEvent *e;
|
||||
NSAutoreleasePool* pool;
|
||||
|
||||
NSDebugLog(@"NSApplication -run\n");
|
||||
|
||||
|
@ -274,6 +277,7 @@ NSString *NSApplicationWillUpdateNotification = @"ApplicationWillUpdate";
|
|||
|
||||
do
|
||||
{
|
||||
pool = [NSAutoreleasePool new];
|
||||
e = [self nextEventMatchingMask:NSAnyEventMask
|
||||
untilDate:[NSDate distantFuture]
|
||||
inMode:NSDefaultRunLoopMode dequeue:YES];
|
||||
|
@ -285,6 +289,7 @@ NSString *NSApplicationWillUpdateNotification = @"ApplicationWillUpdate";
|
|||
// Call the back-end method to handle it
|
||||
[self handleNullEvent];
|
||||
}
|
||||
[pool release];
|
||||
} while (!app_should_quit);
|
||||
app_is_running = YES;
|
||||
|
||||
|
@ -442,82 +447,76 @@ NSString *NSApplicationWillUpdateNotification = @"ApplicationWillUpdate";
|
|||
{
|
||||
}
|
||||
|
||||
- (NSEvent*)_eventMatchingMask:(unsigned int)mask
|
||||
{
|
||||
NSEvent* event;
|
||||
int i, count;
|
||||
|
||||
/* Get an event from the events queue */
|
||||
if ((count = [event_queue count])) {
|
||||
for (i = 0; i < count; i++) {
|
||||
event = [event_queue objectAtIndex:i];
|
||||
if ([self event:event matchMask:mask]) {
|
||||
[event retain];
|
||||
[event_queue removeObjectAtIndex:i];
|
||||
[self setCurrentEvent:event];
|
||||
return [event autorelease];
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return nil;
|
||||
}
|
||||
|
||||
- (NSEvent *)nextEventMatchingMask:(unsigned int)mask
|
||||
untilDate:(NSDate *)expiration
|
||||
inMode:(NSString *)mode
|
||||
dequeue:(BOOL)flag
|
||||
{
|
||||
NSEvent *e;
|
||||
BOOL done;
|
||||
int i, j;
|
||||
NSRunLoop* currentLoop = [NSRunLoop currentRunLoop];
|
||||
NSEventType type;
|
||||
NSEvent *event;
|
||||
BOOL done = NO;
|
||||
|
||||
// If the queue isn't empty then check those messages
|
||||
if ([event_queue count])
|
||||
{
|
||||
j = [event_queue count];
|
||||
// for (i = j-1;i >= 0; --i)
|
||||
for (i = 0; i < j; i++)
|
||||
{
|
||||
e = [event_queue objectAtIndex: i];
|
||||
if ([self event: e matchMask: mask])
|
||||
{
|
||||
[e retain];
|
||||
[event_queue removeObjectAtIndex: i];
|
||||
[self setCurrentEvent: e];
|
||||
return [e autorelease];
|
||||
}
|
||||
}
|
||||
}
|
||||
event = [self _eventMatchingMask:mask];
|
||||
if (event)
|
||||
done = YES;
|
||||
|
||||
// Not in queue so wait for next event
|
||||
done = NO;
|
||||
while (!done)
|
||||
{
|
||||
#if USE_RUN_LOOP
|
||||
NSRunLoop* currentLoop = [NSRunLoop currentRunLoop];
|
||||
NSDate* limitDate = [currentLoop limitDateForMode:mode];
|
||||
while (!done) {
|
||||
NSDate* limitDate = [currentLoop limitDateForMode:mode];
|
||||
|
||||
if (!expiration)
|
||||
expiration = [NSDate distantFuture];
|
||||
/* -limitDateForMode: can fire timers and timer events can be quueued in
|
||||
events queue so check for them. */
|
||||
event = [self _eventMatchingMask:mask];
|
||||
if (event)
|
||||
break;
|
||||
|
||||
if (limitDate)
|
||||
limitDate = [expiration earlierDate:limitDate];
|
||||
else
|
||||
limitDate = expiration;
|
||||
if (!expiration)
|
||||
expiration = [NSDate distantFuture];
|
||||
|
||||
// NSLog (@"calling runMode:beforeDate:");
|
||||
[currentLoop runMode:mode beforeDate:limitDate];
|
||||
// NSLog (@"return from runMode:beforeDate:");
|
||||
#else
|
||||
e = [self getNextEvent];
|
||||
#endif
|
||||
if (limitDate)
|
||||
limitDate = [expiration earlierDate:limitDate];
|
||||
else
|
||||
limitDate = expiration;
|
||||
|
||||
if ([event_queue count]) {
|
||||
e = [[event_queue lastObject] retain];
|
||||
[currentLoop runMode:mode beforeDate:limitDate];
|
||||
|
||||
// Check mask
|
||||
if ([self event: e matchMask: mask])
|
||||
{
|
||||
if (e)
|
||||
{
|
||||
[event_queue removeObject: e];
|
||||
}
|
||||
done = YES;
|
||||
}
|
||||
}
|
||||
}
|
||||
event = [self _eventMatchingMask:mask];
|
||||
if (event)
|
||||
done = YES;
|
||||
}
|
||||
|
||||
type = [event type];
|
||||
|
||||
// Unhide the cursor if necessary
|
||||
// but only if its not a null event
|
||||
if (e != gnustep_gui_null_event)
|
||||
if (event != gnustep_gui_null_event)
|
||||
{
|
||||
NSEventType type;
|
||||
|
||||
// Only if we should unhide when mouse moves
|
||||
if ([NSCursor isHiddenUntilMouseMoves])
|
||||
{
|
||||
// Make sure the event is a mouse event before unhiding
|
||||
type = [e type];
|
||||
if ((type == NSLeftMouseDown) || (type == NSLeftMouseUp)
|
||||
|| (type == NSRightMouseDown) || (type == NSRightMouseUp)
|
||||
|| (type == NSMouseMoved))
|
||||
|
@ -525,8 +524,7 @@ NSString *NSApplicationWillUpdateNotification = @"ApplicationWillUpdate";
|
|||
}
|
||||
}
|
||||
|
||||
[self setCurrentEvent: e];
|
||||
return [e autorelease];
|
||||
return event;
|
||||
}
|
||||
|
||||
- (NSEvent *)peekEventMatchingMask:(unsigned int)mask
|
||||
|
@ -810,13 +808,13 @@ NSString *NSApplicationWillUpdateNotification = @"ApplicationWillUpdate";
|
|||
- (void)setMainMenu:(NSMenu *)aMenu
|
||||
{
|
||||
int i, j;
|
||||
NSMenuCell *mc;
|
||||
NSMenuItem *mc;
|
||||
NSArray *mi;
|
||||
|
||||
// Release old and retain new
|
||||
[aMenu retain];
|
||||
[main_menu release];
|
||||
main_menu = aMenu;
|
||||
[main_menu retain];
|
||||
|
||||
// Search for a menucell with the name Windows
|
||||
// This is the default windows menu
|
||||
|
@ -897,8 +895,8 @@ NSString *NSApplicationWillUpdateNotification = @"ApplicationWillUpdate";
|
|||
|
||||
- (void)setWindowsMenu:aMenu
|
||||
{
|
||||
if (windows_menu)
|
||||
[windows_menu setSubmenu:aMenu];
|
||||
// if (windows_menu)
|
||||
// [windows_menu setSubmenu:aMenu];
|
||||
}
|
||||
|
||||
- (void)updateWindowsItem:aWindow
|
||||
|
@ -907,7 +905,8 @@ NSString *NSApplicationWillUpdateNotification = @"ApplicationWillUpdate";
|
|||
|
||||
- (NSMenu *)windowsMenu
|
||||
{
|
||||
return [windows_menu submenu];
|
||||
// return [windows_menu submenu];
|
||||
return nil;
|
||||
}
|
||||
|
||||
//
|
||||
|
|
|
@ -132,6 +132,7 @@
|
|||
[contents release];
|
||||
[cell_image release];
|
||||
[cell_font release];
|
||||
[represented_object release];
|
||||
[super dealloc];
|
||||
}
|
||||
|
||||
|
@ -223,6 +224,7 @@
|
|||
[anImage retain];
|
||||
[cell_image release];
|
||||
cell_image = anImage;
|
||||
[self setType:NSImageCellType];
|
||||
}
|
||||
|
||||
//
|
||||
|
@ -254,6 +256,7 @@
|
|||
|
||||
[contents release];
|
||||
contents = [[number stringValue] retain];
|
||||
[self setType:NSTextCellType];
|
||||
}
|
||||
|
||||
- (void)setFloatValue:(float)aFloat
|
||||
|
@ -262,6 +265,7 @@
|
|||
|
||||
[contents release];
|
||||
contents = [[number stringValue] retain];
|
||||
[self setType:NSTextCellType];
|
||||
}
|
||||
|
||||
- (void)setIntValue:(int)anInt
|
||||
|
@ -270,6 +274,7 @@
|
|||
|
||||
[contents release];
|
||||
contents = [[number stringValue] retain];
|
||||
[self setType:NSTextCellType];
|
||||
}
|
||||
|
||||
- (void)setStringValue:(NSString *)aString
|
||||
|
@ -537,6 +542,10 @@
|
|||
return nil;
|
||||
}
|
||||
|
||||
- (void)performClick:(id)sender
|
||||
{
|
||||
}
|
||||
|
||||
//
|
||||
// Assigning a Tag
|
||||
//
|
||||
|
@ -730,11 +739,15 @@
|
|||
//
|
||||
- (id)representedObject
|
||||
{
|
||||
return nil;
|
||||
return represented_object;
|
||||
}
|
||||
|
||||
- (void)setRepresentedObject:(id)anObject
|
||||
{}
|
||||
{
|
||||
[anObject retain];
|
||||
[represented_object release];
|
||||
represented_object = anObject;
|
||||
}
|
||||
|
||||
- (id)copyWithZone:(NSZone*)zone
|
||||
{
|
||||
|
@ -761,7 +774,7 @@
|
|||
[c setEntryType:entry_type];
|
||||
c->control_view = control_view;
|
||||
c->cell_size = cell_size;
|
||||
c->represented_object = [represented_object retain];
|
||||
[c setRepresentedObject:represented_object];
|
||||
|
||||
return c;
|
||||
}
|
||||
|
|
|
@ -37,6 +37,7 @@
|
|||
|
||||
#include <AppKit/NSEvent.h>
|
||||
#include <AppKit/NSApplication.h>
|
||||
#include <AppKit/NSWindow.h>
|
||||
|
||||
@implementation NSEvent
|
||||
|
||||
|
@ -435,9 +436,7 @@ static NSRecursiveLock* timersLock = nil;
|
|||
|
||||
- (NSWindow *)window
|
||||
{
|
||||
NSApplication *theApp = [NSApplication sharedApplication];
|
||||
|
||||
return [theApp windowWithWindowNumber:window_num];
|
||||
return [NSWindow windowWithNumber:window_num];
|
||||
}
|
||||
|
||||
- (int)windowNumber
|
||||
|
|
|
@ -69,6 +69,13 @@ static NSFont* getFont(NSString* key, NSString* defaultFontName, float fontSize)
|
|||
if (!fontName)
|
||||
fontName = defaultFontName;
|
||||
|
||||
if (!fontSize) {
|
||||
fontSize = [[NSUserDefaults standardUserDefaults]
|
||||
floatForKey:[NSString stringWithFormat:@"%@Size", key]];
|
||||
if (!fontSize)
|
||||
fontSize = 12;
|
||||
}
|
||||
|
||||
return [NSFont fontWithName:fontName size:fontSize];
|
||||
}
|
||||
|
||||
|
|
|
@ -108,6 +108,7 @@ set_repd_for_rep(NSMutableArray *_reps, NSImageRep *rep, rep_data_t *new_repd)
|
|||
[_reps replaceObjectAtIndex: i withObject:
|
||||
[NSValue value: new_repd withObjCType: @encode(rep_data_t)]];
|
||||
found = YES;
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (!found)
|
||||
|
@ -217,7 +218,8 @@ set_repd_for_rep(NSMutableArray *_reps, NSImageRep *rep, rep_data_t *new_repd)
|
|||
|
||||
if ([path length] != 0)
|
||||
{
|
||||
NSImage* image = [[NSImage alloc] initByReferencingFile:path];
|
||||
NSImage* image = [[[NSImage alloc] initByReferencingFile:path]
|
||||
autorelease];
|
||||
if (image)
|
||||
[image setName: [[path lastPathComponent]
|
||||
stringByDeletingPathExtension]];
|
||||
|
@ -325,12 +327,15 @@ set_repd_for_rep(NSMutableArray *_reps, NSImageRep *rep, rep_data_t *new_repd)
|
|||
NSImage* copy;
|
||||
|
||||
// FIXME: maybe we should retain if _flags.dataRetained = NO
|
||||
copy = (NSImage*)NSAllocateObject (isa, 0, zone);
|
||||
copy = (NSImage*)NSCopyObject (self, 0, zone);
|
||||
|
||||
[name retain];
|
||||
copy->_reps = [NSMutableArray new];
|
||||
copy->_repList = [NSMutableArray new];
|
||||
[_color retain];
|
||||
_lockedView = nil;
|
||||
[copy addRepresentations: [[self representations] copyWithZone: zone]];
|
||||
[copy addRepresentations: [[[self representations] copyWithZone: zone]
|
||||
autorelease]];
|
||||
|
||||
return copy;
|
||||
}
|
||||
|
@ -686,7 +691,7 @@ set_repd_for_rep(NSMutableArray *_reps, NSImageRep *rep, rep_data_t *new_repd)
|
|||
for (i = 0; i < count; i++)
|
||||
{
|
||||
repd.fileName = NULL;
|
||||
repd.rep = [imageRepArray objectAtIndex: i];
|
||||
repd.rep = [[imageRepArray objectAtIndex: i] retain];
|
||||
repd.cache = NULL;
|
||||
repd.original = NULL;
|
||||
repd.validCache = NO;
|
||||
|
|
|
@ -32,6 +32,8 @@
|
|||
|
||||
#include <Foundation/NSValue.h>
|
||||
#include <Foundation/NSArray.h>
|
||||
#include <Foundation/NSAutoreleasePool.h>
|
||||
|
||||
#include <AppKit/NSColor.h>
|
||||
#include <AppKit/NSActionCell.h>
|
||||
#include <AppKit/NSWindow.h>
|
||||
|
@ -960,11 +962,15 @@ static int mouseDownFlags = 0;
|
|||
- (void)sizeToCells
|
||||
{
|
||||
NSSize newSize;
|
||||
int nc = numCols;
|
||||
int nr = numRows;
|
||||
|
||||
newSize.width = numCols * (cellSize.width + intercell.width)
|
||||
- intercell.width;
|
||||
newSize.height = numRows * (cellSize.height + intercell.height)
|
||||
- intercell.height;
|
||||
if (!nc)
|
||||
nc = 1;
|
||||
if (!nr)
|
||||
nr = 1;
|
||||
newSize.width = nc * (cellSize.width + intercell.width) - intercell.width;
|
||||
newSize.height = nr * (cellSize.height + intercell.height) - intercell.height;
|
||||
[self setFrameSize:newSize];
|
||||
}
|
||||
|
||||
|
@ -1155,7 +1161,8 @@ static int mouseDownFlags = 0;
|
|||
|
||||
mouseDownFlags = [theEvent modifierFlags];
|
||||
lastLocation = [self convertPoint:lastLocation fromView:nil];
|
||||
[NSEvent startPeriodicEventsAfterDelay:0.05 withPeriod:0.05];
|
||||
if (mode != NSTrackModeMatrix)
|
||||
[NSEvent startPeriodicEventsAfterDelay:0.05 withPeriod:0.05];
|
||||
ASSIGN(lastEvent, theEvent);
|
||||
[self lockFocus];
|
||||
|
||||
|
@ -1325,7 +1332,8 @@ static int mouseDownFlags = 0;
|
|||
|
||||
[[self window] flushWindow];
|
||||
[self unlockFocus];
|
||||
[NSEvent stopPeriodicEvents];
|
||||
if (mode != NSTrackModeMatrix)
|
||||
[NSEvent stopPeriodicEvents];
|
||||
[lastEvent release];
|
||||
}
|
||||
|
||||
|
@ -1548,10 +1556,10 @@ static int mouseDownFlags = 0;
|
|||
last:(MPoint)last
|
||||
current:(MPoint)current
|
||||
{
|
||||
/* We use an imaginar coordinate system whose center is the `anchor' point. We
|
||||
should determine in which quadrants are located the `last' and the `current'
|
||||
points. Based on this we extend the selection to the rectangle determined
|
||||
by `anchor' and `current' points.
|
||||
/* We use an imaginar coordinate system whose center is the `anchor' point.
|
||||
We should determine in which quadrants are located the `last' and the
|
||||
`current' points. Based on this we extend the selection to the rectangle
|
||||
determined by `anchor' and `current' points.
|
||||
|
||||
The algorithm uses two rectangles: one determined by `anchor' and
|
||||
`current' that defines how the final selection rectangle will look, and
|
||||
|
@ -1982,4 +1990,80 @@ static int mouseDownFlags = 0;
|
|||
}
|
||||
}
|
||||
|
||||
#ifdef DEBUG
|
||||
#include <stdio.h>
|
||||
|
||||
/* A test to exhaustively check if the list selection mode works correctly. */
|
||||
- (void)_selectRect2UsingAnchor:(MPoint)anchor
|
||||
last:(MPoint)last
|
||||
current:(MPoint)current
|
||||
{
|
||||
MRect selectRect;
|
||||
MRect unselectRect;
|
||||
|
||||
selectRect.x = MIN(anchor.x, current.x);
|
||||
selectRect.y = MIN(anchor.y, current.y);
|
||||
selectRect.width = ABS(current.x - anchor.x);
|
||||
selectRect.height = ABS(current.y - anchor.y);
|
||||
|
||||
unselectRect.x = MIN(anchor.x, last.x);
|
||||
unselectRect.y = MIN(anchor.y, last.y);
|
||||
unselectRect.width = ABS(current.x - last.x);
|
||||
unselectRect.height = ABS(current.y - last.y);
|
||||
|
||||
[self _setState:0 inRect:unselectRect];
|
||||
[self _setState:1 inRect:selectRect];
|
||||
}
|
||||
|
||||
/* This method assumes the receiver matrix has at least 5 rows and 5 columns.
|
||||
*/
|
||||
- (void)_test
|
||||
{
|
||||
NSArray* selectedCellsByMethod1;
|
||||
NSArray* selectedCellsByMethod2;
|
||||
NSAutoreleasePool* pool;
|
||||
MPoint anchor, last, current;
|
||||
int i = 1;
|
||||
int noOfErrors = 0;
|
||||
|
||||
if (numRows < 5 || numCols < 5) {
|
||||
NSLog (@"matrix should have at least 5 rows and 5 columns!");
|
||||
return;
|
||||
}
|
||||
|
||||
for (anchor.x = 0; anchor.x < 5; anchor.x++)
|
||||
for (anchor.y = 0; anchor.y < 5; anchor.y++)
|
||||
for (last.x = 0; last.x < 5; last.x++)
|
||||
for (last.y = 0; last.y < 5; last.y++)
|
||||
for (current.x = 0; current.x < 5; current.x++)
|
||||
for (current.y = 0; current.y < 5; current.y++) {
|
||||
pool = [NSAutoreleasePool new];
|
||||
|
||||
printf ("%d\r", i++);
|
||||
fflush (stdout);
|
||||
|
||||
/* First determine the selected cells using the sure method */
|
||||
[self _selectRect2UsingAnchor:anchor last:last current:current];
|
||||
selectedCellsByMethod2 = [self selectedCells];
|
||||
|
||||
/* Then determine the same using the optimized method */
|
||||
[self _selectRectUsingAnchor:anchor last:last current:current];
|
||||
selectedCellsByMethod1 = [self selectedCells];
|
||||
|
||||
/* Compare the selected cells determined by the two methods */
|
||||
if (![selectedCellsByMethod1 isEqual:selectedCellsByMethod2]) {
|
||||
NSLog (@"\nSelected cells are different for:\n"
|
||||
@"anchor = (%d, %d)\nlast = (%d, %d)\ncurrent = (%d, %d)",
|
||||
anchor.x, anchor.y, last.x, last.y, current.x, current.y);
|
||||
noOfErrors++;
|
||||
}
|
||||
|
||||
[pool release];
|
||||
}
|
||||
|
||||
printf ("\nready!\nnumber of errors = %d\n", noOfErrors);
|
||||
fflush (stdout);
|
||||
}
|
||||
#endif
|
||||
|
||||
@end
|
||||
|
|
836
Source/NSMenu.m
836
Source/NSMenu.m
|
@ -1,12 +1,11 @@
|
|||
/*
|
||||
NSMenu.m
|
||||
|
||||
The menu class
|
||||
|
||||
Copyright (C) 1996 Free Software Foundation, Inc.
|
||||
|
||||
Author: Scott Christley <scottc@net-community.com>
|
||||
Date: 1996
|
||||
Author: Ovidiu Predescu <ovidiu@net-community.com>
|
||||
Date: May 1997
|
||||
A completely rewritten version of the original source by Scott Christley.
|
||||
|
||||
This file is part of the GNUstep GUI Library.
|
||||
|
||||
|
@ -26,267 +25,710 @@
|
|||
59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||
*/
|
||||
|
||||
#include <Foundation/NSLock.h>
|
||||
#include <Foundation/NSCoder.h>
|
||||
#include <Foundation/NSArray.h>
|
||||
#include <AppKit/NSMenu.h>
|
||||
#include <AppKit/NSMenuCell.h>
|
||||
#include <AppKit/NSMenuPrivate.h>
|
||||
#include <AppKit/NSApplication.h>
|
||||
#include <Foundation/NSProcessInfo.h>
|
||||
|
||||
#include <AppKit/NSMatrix.h>
|
||||
#include <AppKit/NSApplication.h>
|
||||
#include <AppKit/NSWindow.h>
|
||||
#include <AppKit/NSEvent.h>
|
||||
#include <AppKit/NSFont.h>
|
||||
#include <AppKit/NSMenu.h>
|
||||
|
||||
NSZone *gnustep_gui_nsmenu_zone = NULL;
|
||||
#define ASSIGN(variable, value) \
|
||||
[value retain]; \
|
||||
[variable release]; \
|
||||
variable = value;
|
||||
|
||||
@implementation NSMenu
|
||||
#ifdef MAX
|
||||
# undef MAX
|
||||
#endif
|
||||
# define MAX(a, b) \
|
||||
({typedef _ta = (a), _tb = (b); \
|
||||
_ta _a = (a); _tb _b = (b); \
|
||||
_a > _b ? _a : _b; })
|
||||
|
||||
//
|
||||
// Class methods
|
||||
//
|
||||
+ (void)initialize
|
||||
|
||||
@interface NSMenu (PrivateMethods2)
|
||||
- (void)_menuChanged;
|
||||
@end
|
||||
|
||||
|
||||
@implementation NSMenuMatrix
|
||||
|
||||
// Class variables
|
||||
static NSFont* menuFont = nil;
|
||||
|
||||
- initWithFrame:(NSRect)rect
|
||||
{
|
||||
if (self == [NSMenu class])
|
||||
{
|
||||
// Initial version
|
||||
[self setVersion:2];
|
||||
}
|
||||
}
|
||||
[super initWithFrame:rect];
|
||||
cells = [NSMutableArray new];
|
||||
|
||||
//
|
||||
// Controlling Allocation Zones
|
||||
//
|
||||
+ (NSZone *)menuZone
|
||||
{
|
||||
return gnustep_gui_nsmenu_zone;
|
||||
}
|
||||
|
||||
+ (void)setMenuZone:(NSZone *)zone
|
||||
{
|
||||
gnustep_gui_nsmenu_zone = zone;
|
||||
}
|
||||
|
||||
//
|
||||
// Instance methods
|
||||
//
|
||||
//
|
||||
// Initializing a New NSMenu
|
||||
//
|
||||
- init
|
||||
{
|
||||
return [self initWithTitle:@""];
|
||||
}
|
||||
|
||||
// Default initializer
|
||||
- (id)initWithTitle:(NSString *)aTitle
|
||||
{
|
||||
// NSApplication *theApp = [NSApplication sharedApplication];
|
||||
|
||||
// Init our superclass but skip any of its backend implementation
|
||||
[super init];
|
||||
|
||||
window_title = aTitle;
|
||||
menu_items = [NSMutableArray array];
|
||||
super_menu = nil;
|
||||
autoenables_items = NO;
|
||||
|
||||
menu_matrix = [[NSMatrix alloc] initWithFrame: NSZeroRect];
|
||||
[menu_matrix setCellClass: [NSMenuCell class]];
|
||||
[menu_matrix setIntercellSpacing: NSZeroSize];
|
||||
// [self setContentView: menu_matrix];
|
||||
|
||||
is_torn_off = NO;
|
||||
|
||||
// Register ourselves with the Application object
|
||||
// [theApp addWindowsItem:self title:window_title filename:NO];
|
||||
/* Don't initialize menuFont in +initialize since we don't know if the
|
||||
DGS process knows anything about the fonts yet. */
|
||||
if (!menuFont)
|
||||
menuFont = [[NSFont systemFontOfSize:0] retain];
|
||||
|
||||
cellSize = NSMakeSize (1, [menuFont pointSize] - [menuFont descender] + 4);
|
||||
return self;
|
||||
}
|
||||
|
||||
//
|
||||
// Setting Up the Menu Commands
|
||||
//
|
||||
- (id)addItemWithTitle:(NSString *)aString
|
||||
action:(SEL)aSelector
|
||||
keyEquivalent:(NSString *)charCode
|
||||
- (void)dealloc
|
||||
{
|
||||
NSMenuCell *m;
|
||||
NSDebugLog (@"NSMenuMatrix of menu '%@' dealloc", [menu title]);
|
||||
|
||||
m = [[NSMenuCell alloc] initTextCell:aString];
|
||||
[m setAction:aSelector];
|
||||
[menu_items addObject:m];
|
||||
|
||||
return m;
|
||||
[cells release];
|
||||
[super dealloc];
|
||||
}
|
||||
|
||||
- (id)insertItemWithTitle:(NSString *)aString
|
||||
action:(SEL)aSelector
|
||||
keyEquivalent:(NSString *)charCode
|
||||
atIndex:(unsigned int)index
|
||||
- (id)copyWithZone:(NSZone*)zone
|
||||
{
|
||||
NSMenuCell *m;
|
||||
NSMenuMatrix* copy = NSAllocateObject (isa, 0, zone);
|
||||
int i, count;
|
||||
|
||||
m = [[NSMenuCell alloc] initTextCell:aString];
|
||||
[m setAction:aSelector];
|
||||
[menu_items insertObject:m atIndex:index];
|
||||
NSDebugLog (@"copy menu matrix of menu with title '%@'", [menu title]);
|
||||
copy->cells = [[NSMutableArray alloc] initWithCapacity:[cells count]];
|
||||
for (i = 0, count = [cells count]; i < count; i++) {
|
||||
id aCell = [cells objectAtIndex:i];
|
||||
id cellCopy = [[aCell copyWithZone:zone] autorelease];
|
||||
|
||||
return m;
|
||||
[copy->cells addObject:cellCopy];
|
||||
}
|
||||
|
||||
copy->cellSize = cellSize;
|
||||
copy->menu = menu;
|
||||
if (selectedCell) {
|
||||
int index = [cells indexOfObject:selectedCell];
|
||||
|
||||
copy->selectedCell = [[cells objectAtIndex:index] retain];
|
||||
}
|
||||
copy->selectedCellRect = selectedCellRect;
|
||||
|
||||
return copy;
|
||||
}
|
||||
|
||||
- (NSArray *)itemArray
|
||||
- (void)_resizeMenuForCellSize
|
||||
{
|
||||
return menu_items;
|
||||
/* Resize the frame to hold all the menu cells */
|
||||
[super setFrameSize:NSMakeSize (cellSize.width,
|
||||
(cellSize.height + INTERCELL_SPACE) * [cells count] - INTERCELL_SPACE)];
|
||||
}
|
||||
|
||||
- (NSMatrix *)itemMatrix
|
||||
- (id <NSMenuItem>)insertItemWithTitle:(NSString*)aString
|
||||
action:(SEL)aSelector
|
||||
keyEquivalent:(NSString*)charCode
|
||||
atIndex:(unsigned int)index
|
||||
{
|
||||
return menu_matrix;
|
||||
id menuCell = [[[NSMenu cellClass] new] autorelease];
|
||||
float titleWidth;
|
||||
|
||||
[menuCell setTitle:aString];
|
||||
[menuCell setAction:aSelector];
|
||||
[menuCell setKeyEquivalent:charCode];
|
||||
[menuCell setFont:menuFont];
|
||||
|
||||
titleWidth = [menuFont widthOfString:aString];
|
||||
cellSize = NSMakeSize (MAX(titleWidth + ADDITIONAL_WIDTH, cellSize.width),
|
||||
cellSize.height);
|
||||
[cells insertObject:menuCell atIndex:index];
|
||||
|
||||
[self _resizeMenuForCellSize];
|
||||
|
||||
return menuCell;
|
||||
}
|
||||
|
||||
- (void)setItemMatrix:(NSMatrix *)aMatrix
|
||||
- (void)removeItem:(id <NSMenuItem>)anItem
|
||||
{
|
||||
menu_matrix = aMatrix;
|
||||
int row = [cells indexOfObject:anItem];
|
||||
float titleWidth;
|
||||
int i, count;
|
||||
|
||||
if (row == -1)
|
||||
return;
|
||||
|
||||
[cells removeObjectAtIndex:row];
|
||||
|
||||
/* Compute the new width of the menu cells matrix */
|
||||
cellSize.width = 0;
|
||||
count = [cells count];
|
||||
for (i = 0; i < count; i++) {
|
||||
titleWidth = [menuFont widthOfString:[cells objectAtIndex:i]];
|
||||
cellSize.width = MAX(titleWidth + ADDITIONAL_WIDTH, cellSize.width);
|
||||
}
|
||||
|
||||
[self _resizeMenuForCellSize];
|
||||
}
|
||||
|
||||
//
|
||||
// Finding Menu Items
|
||||
//
|
||||
- (id)cellWithTag:(int)aTag
|
||||
- (NSArray*)itemArray { return cells; }
|
||||
|
||||
- (id <NSMenuItem>)itemWithTitle:(NSString*)aString
|
||||
{
|
||||
int i, j;
|
||||
NSMenuCell *m, *found;
|
||||
int i, count = [cells count];
|
||||
id menuCell;
|
||||
|
||||
// Recursively find the menu cell with the tag
|
||||
found = nil;
|
||||
j = [menu_items count];
|
||||
for (i = 0;i < j; ++i)
|
||||
{
|
||||
m = [menu_items objectAtIndex:i];
|
||||
if ([m tag] == aTag) return m;
|
||||
if ([m hasSubmenu])
|
||||
found = [[m submenu] cellWithTag:aTag];
|
||||
if (found) return found;
|
||||
}
|
||||
return found;
|
||||
}
|
||||
|
||||
//
|
||||
// Building Submenus
|
||||
//
|
||||
- (NSMenuCell *)setSubmenu:(NSMenu *)aMenu
|
||||
forItem:(NSMenuCell *)aCell
|
||||
{
|
||||
int i, j;
|
||||
NSMenuCell *m;
|
||||
|
||||
j = [menu_items count];
|
||||
for (i = 0;i < j; ++i)
|
||||
{
|
||||
m = [menu_items objectAtIndex:i];
|
||||
if (m == aCell)
|
||||
{
|
||||
// Set the menucell's submenu
|
||||
[m setSubmenu:aMenu];
|
||||
|
||||
// Tell the submenu we are its supermenu
|
||||
[aMenu setSupermenu: self];
|
||||
|
||||
// Return the menucell
|
||||
return m;
|
||||
}
|
||||
}
|
||||
for (i = 0; i < count; i++) {
|
||||
menuCell = [cells objectAtIndex:i];
|
||||
if ([[menuCell title] isEqual:aString])
|
||||
return menuCell;
|
||||
}
|
||||
return nil;
|
||||
}
|
||||
|
||||
- (void)submenuAction:(id)sender
|
||||
{}
|
||||
|
||||
//
|
||||
// Managing NSMenu Windows
|
||||
//
|
||||
- (NSMenu *)attachedMenu
|
||||
- (id <NSMenuItem>)itemWithTag:(int)aTag
|
||||
{
|
||||
int i, count = [cells count];
|
||||
id menuCell;
|
||||
|
||||
for (i = 0; i < count; i++) {
|
||||
menuCell = [cells objectAtIndex:i];
|
||||
if ([menuCell tag] == aTag)
|
||||
return menuCell;
|
||||
}
|
||||
return nil;
|
||||
}
|
||||
|
||||
- (NSRect)cellFrameAtRow:(int)index
|
||||
{
|
||||
NSRect rect;
|
||||
|
||||
rect.origin.x = 0;
|
||||
rect.origin.y = ([cells count] - index - 1)
|
||||
* (cellSize.height + INTERCELL_SPACE);
|
||||
rect.size = cellSize;
|
||||
|
||||
return rect;
|
||||
}
|
||||
|
||||
- (void)drawRect:(NSRect)rect
|
||||
{
|
||||
int i, count = [cells count];
|
||||
NSRect intRect = {{0, 0}, {0, 0}};
|
||||
|
||||
intRect.size = cellSize;
|
||||
for (i = count - 1; i >= 0; i--) {
|
||||
id aCell = [cells objectAtIndex:i];
|
||||
|
||||
[aCell drawWithFrame:intRect inView:self];
|
||||
intRect.origin.y += cellSize.height + INTERCELL_SPACE;
|
||||
}
|
||||
[[self window] flushWindow];
|
||||
}
|
||||
|
||||
- (NSSize)cellSize { return cellSize; }
|
||||
- (void)setMenu:(NSMenu*)anObject { menu = anObject; }
|
||||
- (void)setSelectedCell:(id)aCell { ASSIGN(selectedCell, aCell); }
|
||||
- (id)selectedCell { return selectedCell; }
|
||||
- (NSRect)selectedCellRect { return selectedCellRect; }
|
||||
|
||||
@end /* NSMenuMatrix */
|
||||
|
||||
|
||||
@implementation NSMenu
|
||||
|
||||
// Class variables
|
||||
static NSZone *menuZone = NULL;
|
||||
static Class menuCellClass = nil;
|
||||
|
||||
+ (void)initialize
|
||||
{
|
||||
menuCellClass = [NSMenuItem class];
|
||||
}
|
||||
|
||||
+ (void)setMenuZone:(NSZone*)zone
|
||||
{
|
||||
menuZone = zone;
|
||||
}
|
||||
|
||||
+ (NSZone*)menuZone
|
||||
{
|
||||
return menuZone;
|
||||
}
|
||||
|
||||
+ (void)setCellClass:(Class)aClass
|
||||
{
|
||||
menuCellClass = aClass;
|
||||
}
|
||||
|
||||
+ (Class)cellClass
|
||||
{
|
||||
return menuCellClass;
|
||||
}
|
||||
|
||||
- init
|
||||
{
|
||||
return [self initWithTitle:
|
||||
[[[NSProcessInfo processInfo] processName] lastPathComponent]];
|
||||
}
|
||||
|
||||
- (id)initWithTitle:(NSString*)aTitle
|
||||
{
|
||||
// SUBCLASS to initialize other "instance variables"
|
||||
NSRect rect = {{0, 0}, {80, 20}};
|
||||
|
||||
ASSIGN(title, aTitle);
|
||||
menuCells = [[NSMenuMatrix alloc] initWithFrame:rect];
|
||||
[menuCells setMenu:self];
|
||||
menuChangedMessagesEnabled = YES;
|
||||
autoenablesItems = YES;
|
||||
return self;
|
||||
}
|
||||
|
||||
- (void)dealloc
|
||||
{
|
||||
NSDebugLog (@"NSMenu '%@' dealloc", title);
|
||||
|
||||
[title release];
|
||||
[menuCells release];
|
||||
[super dealloc];
|
||||
}
|
||||
|
||||
- (id)copyWithZone:(NSZone*)zone
|
||||
{
|
||||
NSMenu* copy = NSAllocateObject (isa, 0, zone);
|
||||
int i, count;
|
||||
NSArray* cells;
|
||||
|
||||
NSDebugLog (@"copy menu with title '%@'", [self title]);
|
||||
|
||||
copy->title = [title copyWithZone:zone];
|
||||
|
||||
copy->menuCells = [menuCells copyWithZone:zone];
|
||||
[copy->menuCells setMenu:copy];
|
||||
|
||||
/* Change the supermenu object of the new cells to the new menu */
|
||||
cells = [copy->menuCells itemArray];
|
||||
for (i = 0, count = [cells count]; i < count; i++) {
|
||||
id cell = [cells objectAtIndex:i];
|
||||
|
||||
if ([cell hasSubmenu]) {
|
||||
NSMenu* submenu = [cell target];
|
||||
|
||||
submenu->supermenu = copy;
|
||||
}
|
||||
}
|
||||
|
||||
[copy->menuCells setFrame:[menuCells frame]];
|
||||
|
||||
copy->supermenu = supermenu;
|
||||
copy->attachedMenu = nil;
|
||||
copy->autoenablesItems = autoenablesItems;
|
||||
copy->menuChangedMessagesEnabled = menuChangedMessagesEnabled;
|
||||
copy->menuHasChanged = menuHasChanged;
|
||||
|
||||
return copy;
|
||||
}
|
||||
|
||||
- (id <NSMenuItem>)addItemWithTitle:(NSString*)aString
|
||||
action:(SEL)aSelector
|
||||
keyEquivalent:(NSString*)charCode
|
||||
{
|
||||
return [self insertItemWithTitle:aString
|
||||
action:aSelector
|
||||
keyEquivalent:charCode
|
||||
atIndex:[[menuCells itemArray] count]];
|
||||
}
|
||||
|
||||
- (id <NSMenuItem>)insertItemWithTitle:(NSString*)aString
|
||||
action:(SEL)aSelector
|
||||
keyEquivalent:(NSString*)charCode
|
||||
atIndex:(unsigned int)index
|
||||
{
|
||||
id menuCell = [menuCells insertItemWithTitle:aString
|
||||
action:aSelector
|
||||
keyEquivalent:charCode
|
||||
atIndex:index];
|
||||
[self _menuChanged];
|
||||
|
||||
return menuCell;
|
||||
}
|
||||
|
||||
- (void)removeItem:(id <NSMenuItem>)anItem
|
||||
{
|
||||
[menuCells removeItem:anItem];
|
||||
[self _menuChanged];
|
||||
}
|
||||
|
||||
- (NSArray*)itemArray
|
||||
{
|
||||
return [menuCells itemArray];
|
||||
}
|
||||
|
||||
- (id <NSMenuItem>)itemWithTag:(int)aTag
|
||||
{
|
||||
return [menuCells itemWithTag:aTag];
|
||||
}
|
||||
|
||||
- (id <NSMenuItem>)itemWithTitle:(NSString*)aString
|
||||
{
|
||||
return [menuCells itemWithTitle:aString];
|
||||
}
|
||||
|
||||
- (void)setSubmenu:(NSMenu*)aMenu forItem:(id <NSMenuItem>)anItem
|
||||
{
|
||||
NSString* itemTitle = [anItem title];
|
||||
|
||||
[anItem setTarget:aMenu];
|
||||
[anItem setAction:@selector(submenuAction:)];
|
||||
if (aMenu)
|
||||
aMenu->supermenu = self;
|
||||
|
||||
[itemTitle retain];
|
||||
// [aMenu->title release];
|
||||
aMenu->title = itemTitle;
|
||||
|
||||
[self _menuChanged];
|
||||
}
|
||||
|
||||
- (void)submenuAction:(id)sender
|
||||
{
|
||||
// SUBCLASS
|
||||
}
|
||||
|
||||
- (NSMenu*)attachedMenu
|
||||
{
|
||||
return attachedMenu;
|
||||
}
|
||||
|
||||
- (BOOL)isAttached
|
||||
{
|
||||
return !is_torn_off;
|
||||
return supermenu && [supermenu attachedMenu] == self;
|
||||
}
|
||||
|
||||
- (BOOL)isTornOff
|
||||
{
|
||||
return is_torn_off;
|
||||
// SUBCLASS
|
||||
return NO;
|
||||
}
|
||||
|
||||
- (NSPoint)locationForSubmenu:(NSMenu *)aSubmenu
|
||||
- (NSPoint)locationForSubmenu:(NSMenu*)aSubmenu
|
||||
{
|
||||
// SUBCLASS
|
||||
return NSZeroPoint;
|
||||
}
|
||||
|
||||
- (void)sizeToFit
|
||||
{}
|
||||
|
||||
- (NSMenu *)supermenu
|
||||
- (NSMenu*)supermenu
|
||||
{
|
||||
return super_menu;
|
||||
}
|
||||
|
||||
//
|
||||
// Displaying the Menu
|
||||
//
|
||||
- (BOOL)autoenablesItems
|
||||
{
|
||||
return autoenables_items;
|
||||
return supermenu;
|
||||
}
|
||||
|
||||
- (void)setAutoenablesItems:(BOOL)flag
|
||||
{
|
||||
autoenables_items = flag;
|
||||
autoenablesItems = flag;
|
||||
}
|
||||
|
||||
//
|
||||
// NSCoding protocol
|
||||
//
|
||||
- (void)encodeWithCoder:aCoder
|
||||
- (BOOL)autoenablesItems
|
||||
{
|
||||
[aCoder encodeObject: menu_items];
|
||||
|
||||
// Version 2
|
||||
[aCoder encodeObject: window_title];
|
||||
#if 0
|
||||
[aCoder encodeObjectReference: super_menu withName: @"SuperMenu"];
|
||||
#else
|
||||
[aCoder encodeConditionalObject:super_menu];
|
||||
#endif
|
||||
[aCoder encodeValueOfObjCType:@encode(BOOL) at: &autoenables_items];
|
||||
[aCoder encodeObject: menu_matrix];
|
||||
[aCoder encodeValueOfObjCType:@encode(BOOL) at: &is_torn_off];
|
||||
return autoenablesItems;
|
||||
}
|
||||
|
||||
- initWithCoder:aDecoder
|
||||
- (void)update
|
||||
{
|
||||
menu_items = [aDecoder decodeObject];
|
||||
// SUBCLASS to redisplay the menu
|
||||
|
||||
// Version 2
|
||||
window_title = [aDecoder decodeObject];
|
||||
#if 0
|
||||
[aDecoder decodeObjectAt: &super_menu withName: NULL];
|
||||
#else
|
||||
super_menu = [aDecoder decodeObject];
|
||||
#endif
|
||||
[aDecoder decodeValueOfObjCType:@encode(BOOL) at: &autoenables_items];
|
||||
menu_matrix = [aDecoder decodeObject];
|
||||
[aDecoder decodeValueOfObjCType:@encode(BOOL) at: &is_torn_off];
|
||||
id cells;
|
||||
int i, count;
|
||||
|
||||
if (![[NSApp mainMenu] autoenablesItems])
|
||||
return;
|
||||
|
||||
cells = [menuCells itemArray];
|
||||
count = [cells count];
|
||||
|
||||
/* Temporary disable automatic displaying of menu */
|
||||
[self setMenuChangedMessagesEnabled:NO];
|
||||
|
||||
for (i = 0; i < count; i++) {
|
||||
id<NSMenuItem> cell = [cells objectAtIndex:i];
|
||||
SEL action = [cell action];
|
||||
id target;
|
||||
NSWindow* keyWindow;
|
||||
NSWindow* mainWindow;
|
||||
id responder;
|
||||
id delegate;
|
||||
BOOL found = NO;
|
||||
|
||||
/* Update the submenu items if any */
|
||||
if ([cell hasSubmenu]) {
|
||||
[[cell target] update];
|
||||
continue;
|
||||
}
|
||||
|
||||
if (!action) {
|
||||
[cell setEnabled:NO];
|
||||
continue;
|
||||
}
|
||||
|
||||
/* Search the target */
|
||||
if ((target = [cell target])) {
|
||||
if ([target respondsToSelector:action]) {
|
||||
if ([target respondsToSelector:@selector(validateMenuItem:)])
|
||||
[cell setEnabled:[target validateMenuItem:cell]];
|
||||
else
|
||||
[cell setEnabled:YES];
|
||||
continue;
|
||||
}
|
||||
}
|
||||
|
||||
/* Search the key window's responder chain */
|
||||
keyWindow = [NSApp keyWindow];
|
||||
responder = [keyWindow firstResponder];
|
||||
while (responder && !found) {
|
||||
if ([responder respondsToSelector:action]) {
|
||||
if ([responder respondsToSelector:@selector(validateMenuItem:)])
|
||||
[cell setEnabled:[responder validateMenuItem:cell]];
|
||||
else
|
||||
[cell setEnabled:YES];
|
||||
found = YES;
|
||||
}
|
||||
responder = [responder nextResponder];
|
||||
}
|
||||
if (found)
|
||||
continue;
|
||||
|
||||
/* Search the key window */
|
||||
if ([keyWindow respondsToSelector:action]) {
|
||||
if ([keyWindow respondsToSelector:@selector(validateMenuItem:)])
|
||||
[cell setEnabled:[keyWindow validateMenuItem:cell]];
|
||||
else
|
||||
[cell setEnabled:YES];
|
||||
continue;
|
||||
}
|
||||
|
||||
/* Search the key window's delegate */
|
||||
delegate = [keyWindow delegate];
|
||||
if ([delegate respondsToSelector:action]) {
|
||||
if ([delegate respondsToSelector:@selector(validateMenuItem:)])
|
||||
[cell setEnabled:[delegate validateMenuItem:cell]];
|
||||
else
|
||||
[cell setEnabled:YES];
|
||||
continue;
|
||||
}
|
||||
|
||||
mainWindow = [NSApp mainWindow];
|
||||
if (mainWindow != keyWindow) {
|
||||
/* Search the main window's responder chain */
|
||||
responder = [mainWindow firstResponder];
|
||||
while (responder && !found) {
|
||||
if ([responder respondsToSelector:action]) {
|
||||
if ([responder respondsToSelector:@selector(validateMenuItem:)])
|
||||
[cell setEnabled:[responder validateMenuItem:cell]];
|
||||
else
|
||||
[cell setEnabled:YES];
|
||||
found = YES;
|
||||
}
|
||||
|
||||
responder = [responder nextResponder];
|
||||
}
|
||||
if (found)
|
||||
continue;
|
||||
|
||||
/* Search the main window */
|
||||
if ([mainWindow respondsToSelector:action]) {
|
||||
if ([mainWindow respondsToSelector:@selector(validateMenuItem:)])
|
||||
[cell setEnabled:[mainWindow validateMenuItem:cell]];
|
||||
else
|
||||
[cell setEnabled:YES];
|
||||
continue;
|
||||
}
|
||||
|
||||
/* Search the main window's delegate */
|
||||
delegate = [mainWindow delegate];
|
||||
if ([delegate respondsToSelector:action]) {
|
||||
if ([delegate respondsToSelector:@selector(validateMenuItem:)])
|
||||
[cell setEnabled:[delegate validateMenuItem:cell]];
|
||||
else
|
||||
[cell setEnabled:YES];
|
||||
continue;
|
||||
}
|
||||
}
|
||||
|
||||
/* Search the NSApplication object */
|
||||
if ([NSApp respondsToSelector:action]) {
|
||||
if ([NSApp respondsToSelector:@selector(validateMenuItem:)])
|
||||
[cell setEnabled:[NSApp validateMenuItem:cell]];
|
||||
else
|
||||
[cell setEnabled:YES];
|
||||
continue;
|
||||
}
|
||||
|
||||
/* Search the NSApplication object's delegate */
|
||||
delegate = [NSApp delegate];
|
||||
if ([delegate respondsToSelector:action]) {
|
||||
if ([delegate respondsToSelector:@selector(validateMenuItem:)])
|
||||
[cell setEnabled:[delegate validateMenuItem:cell]];
|
||||
else
|
||||
[cell setEnabled:YES];
|
||||
continue;
|
||||
}
|
||||
|
||||
[cell setEnabled:NO];
|
||||
}
|
||||
|
||||
/* Reenable displaying of menus */
|
||||
[self setMenuChangedMessagesEnabled:YES];
|
||||
|
||||
[self sizeToFit];
|
||||
}
|
||||
|
||||
- (void)performActionForItem:(id <NSMenuItem>)cell
|
||||
{
|
||||
SEL action;
|
||||
id target;
|
||||
NSWindow* keyWindow;
|
||||
NSWindow* mainWindow;
|
||||
id responder;
|
||||
id delegate;
|
||||
|
||||
if (![cell isEnabled])
|
||||
return;
|
||||
|
||||
action = [cell action];
|
||||
|
||||
/* Search the target */
|
||||
if ((target = [cell target]) && [target respondsToSelector:action]) {
|
||||
[target perform:action withObject:cell];
|
||||
return;
|
||||
}
|
||||
|
||||
/* Search the key window's responder chain */
|
||||
keyWindow = [NSApp keyWindow];
|
||||
responder = [keyWindow firstResponder];
|
||||
while (responder) {
|
||||
if ([responder respondsToSelector:action]) {
|
||||
[responder perform:action withObject:cell];
|
||||
return;
|
||||
}
|
||||
responder = [responder nextResponder];
|
||||
}
|
||||
|
||||
/* Search the key window */
|
||||
if ([keyWindow respondsToSelector:action]) {
|
||||
[keyWindow perform:action withObject:cell];
|
||||
return;
|
||||
}
|
||||
|
||||
/* Search the key window's delegate */
|
||||
delegate = [keyWindow delegate];
|
||||
if ([delegate respondsToSelector:action]) {
|
||||
[delegate perform:action withObject:cell];
|
||||
return;
|
||||
}
|
||||
|
||||
mainWindow = [NSApp mainWindow];
|
||||
if (mainWindow != keyWindow) {
|
||||
/* Search the main window's responder chain */
|
||||
responder = [mainWindow firstResponder];
|
||||
while (responder) {
|
||||
if ([responder respondsToSelector:action]) {
|
||||
[responder perform:action withObject:cell];
|
||||
return;
|
||||
}
|
||||
responder = [responder nextResponder];
|
||||
}
|
||||
|
||||
/* Search the main window */
|
||||
if ([mainWindow respondsToSelector:action]) {
|
||||
[mainWindow perform:action withObject:cell];
|
||||
return;
|
||||
}
|
||||
|
||||
/* Search the main window's delegate */
|
||||
delegate = [mainWindow delegate];
|
||||
if ([delegate respondsToSelector:action]) {
|
||||
[delegate perform:action withObject:cell];
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
/* Search the NSApplication object */
|
||||
if ([NSApp respondsToSelector:action]) {
|
||||
[NSApp perform:action withObject:cell];
|
||||
return;
|
||||
}
|
||||
|
||||
/* Search the NSApplication object's delegate */
|
||||
delegate = [NSApp delegate];
|
||||
if ([delegate respondsToSelector:action]) {
|
||||
[delegate perform:action withObject:cell];
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
- (BOOL)performKeyEquivalent:(NSEvent*)theEvent
|
||||
{
|
||||
id cells = [menuCells itemArray];
|
||||
int i, count = [cells count];
|
||||
NSEventType type = [theEvent type];
|
||||
|
||||
if (type != NSKeyDown || type != NSKeyUp)
|
||||
return NO;
|
||||
|
||||
for (i = 0; i < count; i++) {
|
||||
id<NSMenuItem> cell = [cells objectAtIndex:i];
|
||||
|
||||
if ([cell hasSubmenu]) {
|
||||
if ([[cell target] performKeyEquivalent:theEvent])
|
||||
/* The event has been handled by a cell in submenu */
|
||||
return YES;
|
||||
}
|
||||
else {
|
||||
if ([[cell keyEquivalent] isEqual:[theEvent charactersIgnoringModifiers]]
|
||||
&& [cell keyEquivalentModifierMask] == [theEvent modifierFlags]) {
|
||||
[menuCells lockFocus];
|
||||
[(id)cell performClick:self];
|
||||
[menuCells unlockFocus];
|
||||
return YES;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return NO;
|
||||
}
|
||||
|
||||
- (void)setMenuChangedMessagesEnabled:(BOOL)flag
|
||||
{
|
||||
menuChangedMessagesEnabled = flag;
|
||||
}
|
||||
|
||||
- (BOOL)menuChangedMessagesEnabled
|
||||
{
|
||||
return menuChangedMessagesEnabled;
|
||||
}
|
||||
|
||||
- (void)sizeToFit
|
||||
{
|
||||
// SUBCLASS
|
||||
menuHasChanged = NO;
|
||||
}
|
||||
|
||||
- (NSString*)title
|
||||
{
|
||||
return title;
|
||||
}
|
||||
|
||||
- (NSMenuMatrix*)menuCells
|
||||
{
|
||||
return menuCells;
|
||||
}
|
||||
|
||||
- initWithCoder:(NSCoder*)aDecoder
|
||||
{
|
||||
return self;
|
||||
}
|
||||
|
||||
@end
|
||||
|
||||
@implementation NSMenu (GNUstepPrivate)
|
||||
|
||||
- (void)setSupermenu:(NSMenu *)obj
|
||||
- (void)encodeWithCoder:(NSCoder*)aCoder
|
||||
{
|
||||
super_menu = obj;
|
||||
}
|
||||
|
||||
@end /* NSMenu */
|
||||
|
||||
|
||||
@implementation NSMenu (PrivateMethods2)
|
||||
- (void)_menuChanged
|
||||
{
|
||||
menuHasChanged = YES;
|
||||
if (menuChangedMessagesEnabled)
|
||||
[self sizeToFit];
|
||||
}
|
||||
@end
|
||||
|
|
|
@ -1,152 +0,0 @@
|
|||
/*
|
||||
NSMenuCell.m
|
||||
|
||||
Cell class for menu items
|
||||
|
||||
Copyright (C) 1996 Free Software Foundation, Inc.
|
||||
|
||||
Author: Scott Christley <scottc@net-community.com>
|
||||
Date: 1996
|
||||
|
||||
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; see the file COPYING.LIB.
|
||||
If not, write to the Free Software Foundation,
|
||||
59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||
*/
|
||||
|
||||
#include <Foundation/NSCoder.h>
|
||||
#include <AppKit/NSMenuCell.h>
|
||||
#include <AppKit/NSMenu.h>
|
||||
|
||||
//
|
||||
// Class variables
|
||||
//
|
||||
static BOOL MB_NSMENUCELL_USES_KEY = NO;
|
||||
|
||||
@implementation NSMenuCell
|
||||
|
||||
//
|
||||
// Class methods
|
||||
//
|
||||
+ (void)initialize
|
||||
{
|
||||
if (self == [NSMenuCell class])
|
||||
{
|
||||
// Initial version
|
||||
[self setVersion:1];
|
||||
}
|
||||
}
|
||||
|
||||
//
|
||||
// Managing User Key Equivalents
|
||||
//
|
||||
+ (void)setUsesUserKeyEquivalents:(BOOL)flag
|
||||
{
|
||||
MB_NSMENUCELL_USES_KEY = flag;
|
||||
}
|
||||
|
||||
+ (BOOL)usesUserKeyEquivalents
|
||||
{
|
||||
return MB_NSMENUCELL_USES_KEY;
|
||||
}
|
||||
|
||||
//
|
||||
// Instance methods
|
||||
//
|
||||
- (unsigned int)menuIdentifier
|
||||
{
|
||||
return menu_identifier;
|
||||
}
|
||||
|
||||
- (void)setMenuIdentifier:(unsigned int)theID
|
||||
{
|
||||
menu_identifier = theID;
|
||||
}
|
||||
|
||||
//
|
||||
// Initialization
|
||||
//
|
||||
- init
|
||||
{
|
||||
return [self initTextCell:@"Text"];
|
||||
}
|
||||
|
||||
- initTextCell:(NSString *)aString
|
||||
{
|
||||
[super initTextCell:aString];
|
||||
[self setEnabled:YES];
|
||||
sub_menu = nil;
|
||||
return self;
|
||||
}
|
||||
|
||||
- (void)dealloc
|
||||
{
|
||||
[sub_menu release];
|
||||
[super dealloc];
|
||||
}
|
||||
|
||||
//
|
||||
// Checking for a Submenu
|
||||
//
|
||||
- (BOOL)hasSubmenu
|
||||
{
|
||||
if (sub_menu)
|
||||
return YES;
|
||||
else
|
||||
return NO;
|
||||
}
|
||||
|
||||
- (NSMenu *)submenu
|
||||
{
|
||||
return sub_menu;
|
||||
}
|
||||
|
||||
- (void)setSubmenu:(NSMenu *)aMenu
|
||||
{
|
||||
[sub_menu release];
|
||||
sub_menu = aMenu;
|
||||
[sub_menu retain];
|
||||
}
|
||||
|
||||
- (NSString *)userKeyEquivalent
|
||||
{
|
||||
return key_equivalent;
|
||||
}
|
||||
|
||||
//
|
||||
// NSCoding protocol
|
||||
//
|
||||
- (void)encodeWithCoder:aCoder
|
||||
{
|
||||
[super encodeWithCoder:aCoder];
|
||||
|
||||
[aCoder encodeObject: key_equivalent];
|
||||
[aCoder encodeObject: sub_menu];
|
||||
[aCoder encodeValueOfObjCType: "I" at: &menu_identifier];
|
||||
}
|
||||
|
||||
- initWithCoder:aDecoder
|
||||
{
|
||||
[super initWithCoder:aDecoder];
|
||||
|
||||
key_equivalent = [aDecoder decodeObject];
|
||||
sub_menu = [aDecoder decodeObject];
|
||||
[aDecoder decodeValueOfObjCType: "I" at: &menu_identifier];
|
||||
|
||||
return self;
|
||||
}
|
||||
|
||||
@end
|
||||
|
157
Source/NSMenuItem.m
Normal file
157
Source/NSMenuItem.m
Normal file
|
@ -0,0 +1,157 @@
|
|||
/*
|
||||
NSMenuItem.m
|
||||
|
||||
The menu cell class.
|
||||
|
||||
Copyright (C) 1996 Free Software Foundation, Inc.
|
||||
|
||||
Author: Ovidiu Predescu <ovidiu@net-community.com>
|
||||
Date: May 1997
|
||||
|
||||
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; see the file COPYING.LIB.
|
||||
If not, write to the Free Software Foundation,
|
||||
59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||
*/
|
||||
|
||||
#include <Foundation/NSUserDefaults.h>
|
||||
#include <Foundation/NSDictionary.h>
|
||||
#include <AppKit/NSMenuItem.h>
|
||||
#include <AppKit/NSMenu.h>
|
||||
|
||||
#define ASSIGN(variable, value) \
|
||||
[value retain]; \
|
||||
[variable release]; \
|
||||
variable = value;
|
||||
|
||||
static BOOL usesUserKeyEquivalents = YES;
|
||||
|
||||
@implementation NSMenuItem
|
||||
|
||||
+ (void)initialize
|
||||
{
|
||||
if (self == [NSMenuItem class])
|
||||
{
|
||||
// Initial version
|
||||
[self setVersion:2];
|
||||
}
|
||||
}
|
||||
|
||||
+ (void)setUsesUserKeyEquivalents:(BOOL)flag
|
||||
{
|
||||
usesUserKeyEquivalents = flag;
|
||||
}
|
||||
|
||||
+ (BOOL)usesUserKeyEquivalents
|
||||
{
|
||||
return usesUserKeyEquivalents;
|
||||
}
|
||||
|
||||
- init
|
||||
{
|
||||
[self setAlignment:NSLeftTextAlignment];
|
||||
return self;
|
||||
}
|
||||
|
||||
- (void)dealloc
|
||||
{
|
||||
NSDebugLog (@"NSMenuItem '%@' dealloc", [self title]);
|
||||
|
||||
[representedObject release];
|
||||
if (hasSubmenu)
|
||||
[[self target] release];
|
||||
[super dealloc];
|
||||
}
|
||||
|
||||
- (id)copyWithZone:(NSZone*)zone
|
||||
{
|
||||
NSMenuItem* copy = [super copyWithZone:zone];
|
||||
|
||||
NSDebugLog (@"menu item '%@' copy", [self title]);
|
||||
copy->representedObject = [representedObject retain];
|
||||
copy->hasSubmenu = hasSubmenu;
|
||||
if (hasSubmenu) {
|
||||
id submenu = [[target copyWithZone:zone] autorelease];
|
||||
[copy setTarget:submenu];
|
||||
}
|
||||
|
||||
return copy;
|
||||
}
|
||||
|
||||
- (void)setTarget:(id)anObject
|
||||
{
|
||||
hasSubmenu = anObject && [anObject isKindOfClass:[NSMenu class]];
|
||||
if (hasSubmenu) {
|
||||
[anObject retain];
|
||||
[[self target] release];
|
||||
}
|
||||
[super setTarget:anObject];
|
||||
}
|
||||
|
||||
- (void)setTitle:(NSString*)aString
|
||||
{
|
||||
[super setStringValue:aString];
|
||||
}
|
||||
|
||||
- (NSString*)title
|
||||
{
|
||||
return [self stringValue];
|
||||
}
|
||||
|
||||
- (BOOL)hasSubmenu
|
||||
{
|
||||
return hasSubmenu;
|
||||
}
|
||||
|
||||
- (BOOL)isEnabled
|
||||
{
|
||||
if (hasSubmenu)
|
||||
return YES;
|
||||
else
|
||||
return [super isEnabled];
|
||||
}
|
||||
|
||||
- (NSString*)keyEquivalent
|
||||
{
|
||||
if (usesUserKeyEquivalents)
|
||||
return [self userKeyEquivalent];
|
||||
else
|
||||
return [super keyEquivalent];
|
||||
}
|
||||
|
||||
- (NSString*)userKeyEquivalent
|
||||
{
|
||||
NSString* userKeyEquivalent = [[[[NSUserDefaults standardUserDefaults]
|
||||
persistentDomainForName:NSGlobalDomain]
|
||||
objectForKey:@"NSCommandKeys"]
|
||||
objectForKey:[self stringValue]];
|
||||
|
||||
if (!userKeyEquivalent)
|
||||
userKeyEquivalent = [super keyEquivalent];
|
||||
|
||||
return userKeyEquivalent;
|
||||
}
|
||||
|
||||
- (void)setRepresentedObject:(id)anObject
|
||||
{
|
||||
ASSIGN(representedObject, anObject);
|
||||
}
|
||||
|
||||
- (id)representedObject
|
||||
{
|
||||
return representedObject;
|
||||
}
|
||||
|
||||
@end
|
File diff suppressed because it is too large
Load diff
135
Source/NSView.m
135
Source/NSView.m
|
@ -153,13 +153,13 @@ NSString *NSViewFocusChangedNotification = @"NSViewFocusChangedNotification";
|
|||
bounds.size = frame.size;
|
||||
|
||||
// Initialize subview list
|
||||
sub_views = [NSMutableArray array];
|
||||
sub_views = [NSMutableArray new];
|
||||
|
||||
// Initialize tracking rectangle list
|
||||
tracking_rects = [NSMutableArray array];
|
||||
tracking_rects = [NSMutableArray new];
|
||||
|
||||
// Initialize cursor rect list
|
||||
cursor_rects = [NSMutableArray array];
|
||||
cursor_rects = [NSMutableArray new];
|
||||
|
||||
super_view = nil;
|
||||
window = nil;
|
||||
|
@ -177,26 +177,9 @@ NSString *NSViewFocusChangedNotification = @"NSViewFocusChangedNotification";
|
|||
|
||||
- (void)dealloc
|
||||
{
|
||||
int i, j;
|
||||
|
||||
//NSArray doesn't know -removeAllObjects yet
|
||||
//[sub_views removeAllObjects];
|
||||
j = [sub_views count];
|
||||
for (i = 0;i < j; ++i)
|
||||
[[sub_views objectAtIndex:i] release];
|
||||
|
||||
// no need -array is autoreleased
|
||||
//[sub_views release];
|
||||
|
||||
// Free the tracking rectangles
|
||||
j = [tracking_rects count];
|
||||
for (i = 0;i < j; ++i)
|
||||
[[tracking_rects objectAtIndex:i] release];
|
||||
|
||||
// Free the cursor rectangles
|
||||
j = [cursor_rects count];
|
||||
for (i = 0;i < j; ++i)
|
||||
[[cursor_rects objectAtIndex:i] release];
|
||||
[sub_views release];
|
||||
[tracking_rects release];
|
||||
[cursor_rects release];
|
||||
|
||||
[super dealloc];
|
||||
}
|
||||
|
@ -224,9 +207,6 @@ NSString *NSViewFocusChangedNotification = @"NSViewFocusChangedNotification";
|
|||
return;
|
||||
}
|
||||
|
||||
// retain the object
|
||||
[aView retain];
|
||||
|
||||
// Add to our subview list
|
||||
[sub_views addObject:(id)aView];
|
||||
[aView setSuperview:self];
|
||||
|
@ -246,9 +226,6 @@ NSString *NSViewFocusChangedNotification = @"NSViewFocusChangedNotification";
|
|||
if (![aView isKindOfClass:[NSView class]]) return;
|
||||
#endif
|
||||
|
||||
// retain the object
|
||||
[aView retain];
|
||||
|
||||
// Add to our subview list
|
||||
[sub_views addObject:(id)aView];
|
||||
[aView setSuperview:self];
|
||||
|
@ -314,52 +291,22 @@ NSString *NSViewFocusChangedNotification = @"NSViewFocusChangedNotification";
|
|||
|
||||
- (void)removeFromSuperview
|
||||
{
|
||||
int i, j;
|
||||
NSMutableArray *v;
|
||||
NSMutableArray *views;
|
||||
|
||||
// No superview then just return
|
||||
if (!super_view) return;
|
||||
|
||||
v = [super_view subviews];
|
||||
j = [v count];
|
||||
for (i = 0;i < j; ++i)
|
||||
{
|
||||
if ([v objectAtIndex:i] == self)
|
||||
[v removeObjectAtIndex:i];
|
||||
}
|
||||
views = [super_view subviews];
|
||||
[views removeObjectIdenticalTo:self];
|
||||
}
|
||||
|
||||
- (void)replaceSubview:(NSView *)oldView
|
||||
with:(NSView *)newView
|
||||
{
|
||||
int i, j;
|
||||
NSView *v;
|
||||
int index = [sub_views indexOfObjectIdenticalTo:oldView];
|
||||
|
||||
// Not a NSView --then forget it
|
||||
// xxx but NSView will really be the backend class
|
||||
// so how do we check that its really a subclass of NSView
|
||||
// and not of the backend class?
|
||||
#if 0
|
||||
if (![newView isKindOfClass:[NSView class]]) return;
|
||||
#endif
|
||||
|
||||
j = [sub_views count];
|
||||
for (i = 0;i < j; ++i)
|
||||
{
|
||||
v = [sub_views objectAtIndex:i];
|
||||
if (v == oldView)
|
||||
{
|
||||
// Found it then replace
|
||||
[sub_views replaceObjectAtIndex:i withObject:newView];
|
||||
// release it as well
|
||||
[v release];
|
||||
// and retain the new view
|
||||
[newView retain];
|
||||
}
|
||||
else
|
||||
// Didn't find then pass down view hierarchy
|
||||
[v replaceSubview:oldView with:newView];
|
||||
}
|
||||
if (index != NSNotFound)
|
||||
[sub_views replaceObjectAtIndex:index withObject:newView];
|
||||
}
|
||||
|
||||
- (void)sortSubviewsUsingFunction:(int (*)(id ,id ,void *))compare
|
||||
|
@ -378,14 +325,6 @@ NSString *NSViewFocusChangedNotification = @"NSViewFocusChangedNotification";
|
|||
|
||||
- (void)setSuperview:(NSView *)superview
|
||||
{
|
||||
// Not a NSView --then forget it
|
||||
// xxx but NSView will really be the backend class
|
||||
// so how do we check that its really a subclass of NSView
|
||||
// and not of the backend class?
|
||||
#if 0
|
||||
if (![superview isKindOfClass:[NSView class]]) return;
|
||||
#endif
|
||||
|
||||
super_view = superview;
|
||||
}
|
||||
|
||||
|
@ -400,16 +339,13 @@ NSString *NSViewFocusChangedNotification = @"NSViewFocusChangedNotification";
|
|||
|
||||
- (void)viewWillMoveToWindow:(NSWindow *)newWindow
|
||||
{
|
||||
int i, j;
|
||||
|
||||
// not a window --then forget it
|
||||
// if (![newWindow isKindOfClass:[NSWindow class]]) return;
|
||||
int i, count;
|
||||
|
||||
window = newWindow;
|
||||
|
||||
// Pass new window down to subviews
|
||||
j = [sub_views count];
|
||||
for (i = 0;i < j; ++i)
|
||||
count = [sub_views count];
|
||||
for (i = 0; i < count; ++i)
|
||||
[[sub_views objectAtIndex:i] viewWillMoveToWindow:newWindow];
|
||||
|
||||
}
|
||||
|
@ -900,8 +836,9 @@ NSString *NSViewFocusChangedNotification = @"NSViewFocusChangedNotification";
|
|||
{
|
||||
TrackingRectangle *m;
|
||||
|
||||
m = [[TrackingRectangle alloc] initWithRect: aRect tag: 0 owner: anObject
|
||||
userData: NULL inside: YES];
|
||||
m = [[[TrackingRectangle alloc] initWithRect: aRect tag: 0 owner: anObject
|
||||
userData: NULL inside: YES]
|
||||
autorelease];
|
||||
[cursor_rects addObject:m];
|
||||
}
|
||||
|
||||
|
@ -916,21 +853,18 @@ NSString *NSViewFocusChangedNotification = @"NSViewFocusChangedNotification";
|
|||
id e = [cursor_rects objectEnumerator];
|
||||
TrackingRectangle *o;
|
||||
NSCursor *c;
|
||||
BOOL found = NO;
|
||||
|
||||
// Base remove test upon cursor object
|
||||
o = [e nextObject];
|
||||
while (o && (!found))
|
||||
{
|
||||
c = [o owner];
|
||||
if (c == anObject)
|
||||
found = YES;
|
||||
else
|
||||
o = [e nextObject];
|
||||
while (o) {
|
||||
c = [o owner];
|
||||
if (c == anObject) {
|
||||
[cursor_rects removeObject: o];
|
||||
break;
|
||||
}
|
||||
|
||||
if (found)
|
||||
[cursor_rects removeObject: o];
|
||||
else
|
||||
o = [e nextObject];
|
||||
}
|
||||
}
|
||||
|
||||
- (void)resetCursorRects
|
||||
|
@ -951,13 +885,15 @@ NSString *NSViewFocusChangedNotification = @"NSViewFocusChangedNotification";
|
|||
|
||||
- (id)viewWithTag:(int)aTag
|
||||
{
|
||||
int i, j;
|
||||
int i, count;
|
||||
|
||||
j = [sub_views count];
|
||||
for (i = 0;i < j; ++i)
|
||||
count = [sub_views count];
|
||||
for (i = 0; i < count; ++i)
|
||||
{
|
||||
if ([[sub_views objectAtIndex:i] tag] == aTag)
|
||||
return [sub_views objectAtIndex:i];
|
||||
id view = [sub_views objectAtIndex:i];
|
||||
|
||||
if ([view tag] == aTag)
|
||||
return view;
|
||||
}
|
||||
return nil;
|
||||
}
|
||||
|
@ -1062,8 +998,9 @@ NSString *NSViewFocusChangedNotification = @"NSViewFocusChangedNotification";
|
|||
}
|
||||
++t;
|
||||
|
||||
m = [[TrackingRectangle alloc] initWithRect:aRect tag:t owner:anObject
|
||||
userData:data inside:flag];
|
||||
m = [[[TrackingRectangle alloc] initWithRect:aRect tag:t owner:anObject
|
||||
userData:data inside:flag]
|
||||
autorelease];
|
||||
[tracking_rects addObject:m];
|
||||
|
||||
return t;
|
||||
|
|
|
@ -30,8 +30,10 @@
|
|||
#include <Foundation/NSCoder.h>
|
||||
#include <Foundation/NSArray.h>
|
||||
#include <Foundation/NSNotification.h>
|
||||
|
||||
#include <AppKit/NSWindow.h>
|
||||
#include <AppKit/NSApplication.h>
|
||||
#include <AppKit/NSImage.h>
|
||||
#include <AppKit/NSTextFieldCell.h>
|
||||
#include <AppKit/NSTextField.h>
|
||||
#include <AppKit/NSColor.h>
|
||||
|
@ -56,6 +58,11 @@ NSString *NSWindowWillCloseNotification = @"WindowWillClose";
|
|||
NSString *NSWindowWillMiniaturizeNotification = @"WindowWillMiniaturize";
|
||||
NSString *NSWindowWillMoveNotification = @"WindowWillMove";
|
||||
|
||||
#define ASSIGN(variable, value) \
|
||||
[value retain]; \
|
||||
[variable release]; \
|
||||
variable = value;
|
||||
|
||||
//
|
||||
// NSWindow implementation
|
||||
//
|
||||
|
@ -125,17 +132,15 @@ NSString *NSWindowWillMoveNotification = @"WindowWillMove";
|
|||
|
||||
- (void)dealloc
|
||||
{
|
||||
NSApplication *theApp = [NSApplication sharedApplication];
|
||||
|
||||
NSDebugLog(@"Remove NSWindow from application\n");
|
||||
// Remove ourselves from the application window list
|
||||
[theApp removeWindowsItem:self];
|
||||
|
||||
// Release the content view
|
||||
NSDebugLog(@"Release content view\n");
|
||||
if (content_view) [content_view release];
|
||||
|
||||
NSDebugLog(@"NSWindow dealloc super\n");
|
||||
[background_color release];
|
||||
[represented_filename release];
|
||||
[miniaturized_title release];
|
||||
[miniaturized_image release];
|
||||
[window_title release];
|
||||
|
||||
[super dealloc];
|
||||
}
|
||||
|
||||
|
@ -160,6 +165,7 @@ NSString *NSWindowWillMoveNotification = @"WindowWillMove";
|
|||
{
|
||||
NSApplication *theApp = [NSApplication sharedApplication];
|
||||
NSRect r = [[NSScreen mainScreen] frame];
|
||||
NSRect cframe;
|
||||
|
||||
NSDebugLog(@"NSWindow default initializer\n");
|
||||
if (!theApp)
|
||||
|
@ -186,7 +192,9 @@ NSString *NSWindowWillMoveNotification = @"WindowWillMove";
|
|||
cursor_rects_valid = NO;
|
||||
|
||||
// Create our content view
|
||||
[self setContentView:[[NSView alloc] initWithFrame:frame]];
|
||||
cframe.origin = NSZeroPoint;
|
||||
cframe.size = frame.size;
|
||||
[self setContentView:[[[NSView alloc] initWithFrame:cframe] autorelease]];
|
||||
|
||||
// Register ourselves with the Application object
|
||||
[theApp addWindowsItem:self title:window_title filename:NO];
|
||||
|
@ -205,22 +213,14 @@ NSString *NSWindowWillMoveNotification = @"WindowWillMove";
|
|||
|
||||
- (void)setContentView:(NSView *)aView
|
||||
{
|
||||
// Not an NSView -then forget it
|
||||
if (![aView isKindOfClass:[NSView class]])
|
||||
return;
|
||||
|
||||
// Release current content view
|
||||
if (content_view)
|
||||
{
|
||||
// Tell view it is no longer in a window
|
||||
[content_view viewWillMoveToWindow:nil];
|
||||
[content_view release];
|
||||
}
|
||||
[content_view viewWillMoveToWindow:nil];
|
||||
|
||||
ASSIGN(content_view, aView);
|
||||
|
||||
content_view = aView;
|
||||
[content_view retain];
|
||||
// Tell the view its changing windows
|
||||
[content_view viewWillMoveToWindow:self];
|
||||
|
||||
// Make us the view's next responder
|
||||
[content_view setNextResponder:self];
|
||||
}
|
||||
|
@ -240,17 +240,17 @@ NSString *NSWindowWillMoveNotification = @"WindowWillMove";
|
|||
|
||||
- (void)setBackgroundColor:(NSColor *)color
|
||||
{
|
||||
background_color = color;
|
||||
ASSIGN(background_color, color);
|
||||
}
|
||||
|
||||
- (void)setRepresentedFilename:(NSString *)aString
|
||||
{
|
||||
represented_filename = aString;
|
||||
ASSIGN(represented_filename, aString);
|
||||
}
|
||||
|
||||
- (void)setTitle:(NSString *)aString
|
||||
{
|
||||
window_title = aString;
|
||||
ASSIGN(window_title, aString);
|
||||
}
|
||||
|
||||
- (void)setTitleWithRepresentedFilename:(NSString *)aString
|
||||
|
@ -327,12 +327,12 @@ NSString *NSWindowWillMoveNotification = @"WindowWillMove";
|
|||
|
||||
- (void)setMiniwindowImage:(NSImage *)image
|
||||
{
|
||||
miniaturized_image = image;
|
||||
ASSIGN(miniaturized_image, image);
|
||||
}
|
||||
|
||||
- (void)setMiniwindowTitle:(NSString *)title;
|
||||
{
|
||||
miniaturized_title = title;
|
||||
ASSIGN(miniaturized_title, title);
|
||||
}
|
||||
|
||||
//
|
||||
|
@ -469,7 +469,7 @@ NSString *NSWindowWillMoveNotification = @"WindowWillMove";
|
|||
|
||||
- (void)orderOut:sender
|
||||
{
|
||||
visible = YES;
|
||||
visible = NO;
|
||||
}
|
||||
|
||||
- (void)orderWindow:(NSWindowOrderingMode)place
|
||||
|
@ -636,7 +636,7 @@ NSString *NSWindowWillMoveNotification = @"WindowWillMove";
|
|||
|
||||
- (void)flushWindowIfNeeded
|
||||
{
|
||||
if (!disable_flush_window)
|
||||
if (!disable_flush_window && needs_flush)
|
||||
[self flushWindow];
|
||||
}
|
||||
|
||||
|
@ -1344,6 +1344,9 @@ NSString *NSWindowWillMoveNotification = @"WindowWillMove";
|
|||
- (void)print:sender
|
||||
{}
|
||||
|
||||
- (void)_setNeedsFlush:(BOOL)flag { needs_flush = flag; }
|
||||
- (BOOL)_needsFlush { return needs_flush; }
|
||||
|
||||
//
|
||||
// Assigning a delegate
|
||||
//
|
||||
|
@ -1577,6 +1580,11 @@ NSString *NSWindowWillMoveNotification = @"WindowWillMove";
|
|||
//
|
||||
@implementation NSWindow (GNUstepBackend)
|
||||
|
||||
+ (NSWindow*)windowWithNumber:(int)windowNumber
|
||||
{
|
||||
return nil;
|
||||
}
|
||||
|
||||
//
|
||||
// Mouse capture/release
|
||||
//
|
||||
|
@ -1598,7 +1606,7 @@ NSString *NSWindowWillMoveNotification = @"WindowWillMove";
|
|||
original_responder = nil;
|
||||
delegate = nil;
|
||||
window_num = 0;
|
||||
background_color = [NSColor lightGrayColor];
|
||||
background_color = [[NSColor lightGrayColor] retain];
|
||||
represented_filename = @"Window";
|
||||
miniaturized_title = @"Window";
|
||||
miniaturized_image = nil;
|
||||
|
|
3
Version
3
Version
|
@ -5,13 +5,14 @@ GNUSTEP_GUI_GCC = 2.7.0
|
|||
|
||||
# Versions for libraries that gnustep-gui is dependent upon
|
||||
GNUSTEP_GUI_BASE = 0.2.12
|
||||
LIB_FOUNDATION = 0.7.1
|
||||
GNUSTEP_GUI_LIBTIFF = 3.4
|
||||
GNUSTEP_GUI_DGS = 0.2.0
|
||||
GNUSTEP_GUI_DPSCLIENT = 6.1
|
||||
|
||||
# The version number of this release.
|
||||
GNUSTEP_GUI_MAJOR_VERSION = 0
|
||||
GNUSTEP_GUI_MINOR_VERSION = 2
|
||||
GNUSTEP_GUI_MINOR_VERSION = 3
|
||||
GNUSTEP_GUI_SUBMINOR_VERSION = 0
|
||||
GNUSTEP_GUI_VERSION = \
|
||||
$(GNUSTEP_GUI_MAJOR_VERSION).$(GNUSTEP_GUI_MINOR_VERSION).$(GNUSTEP_GUI_SUBMINOR_VERSION)
|
||||
|
|
387
configure
vendored
387
configure
vendored
|
@ -1,7 +1,7 @@
|
|||
#! /bin/sh
|
||||
|
||||
# Guess values for system-dependent variables and create Makefiles.
|
||||
# Generated automatically using autoconf version 2.10
|
||||
# Generated automatically using autoconf version 2.12
|
||||
# Copyright (C) 1992, 93, 94, 95, 96 Free Software Foundation, Inc.
|
||||
#
|
||||
# This configure script is free software; the Free Software Foundation
|
||||
|
@ -49,6 +49,8 @@ mandir='${prefix}/man'
|
|||
# Initialize some other variables.
|
||||
subdirs=
|
||||
MFLAGS= MAKEFLAGS=
|
||||
# Maximum number of lines to put in a shell here document.
|
||||
ac_max_here_lines=12
|
||||
|
||||
ac_prev=
|
||||
for ac_option
|
||||
|
@ -330,7 +332,7 @@ EOF
|
|||
verbose=yes ;;
|
||||
|
||||
-version | --version | --versio | --versi | --vers)
|
||||
echo "configure generated by autoconf version 2.10"
|
||||
echo "configure generated by autoconf version 2.12"
|
||||
exit 0 ;;
|
||||
|
||||
-with-* | --with-*)
|
||||
|
@ -432,11 +434,14 @@ do
|
|||
done
|
||||
|
||||
# NLS nuisances.
|
||||
# Only set LANG and LC_ALL to C if already set.
|
||||
# These must not be set unconditionally because not all systems understand
|
||||
# e.g. LANG=C (notably SCO).
|
||||
if test "${LC_ALL+set}" = set; then LC_ALL=C; export LC_ALL; fi
|
||||
# Only set these to C if already set. These must not be set unconditionally
|
||||
# because not all systems understand e.g. LANG=C (notably SCO).
|
||||
# Fixing LC_MESSAGES prevents Solaris sh from translating var values in `set'!
|
||||
# Non-C LC_CTYPE values break the ctype check.
|
||||
if test "${LANG+set}" = set; then LANG=C; export LANG; fi
|
||||
if test "${LC_ALL+set}" = set; then LC_ALL=C; export LC_ALL; fi
|
||||
if test "${LC_MESSAGES+set}" = set; then LC_MESSAGES=C; export LC_MESSAGES; fi
|
||||
if test "${LC_CTYPE+set}" = set; then LC_CTYPE=C; export LC_CTYPE; fi
|
||||
|
||||
# confdefs.h avoids OS command line length limits that DEFS can exceed.
|
||||
rm -rf conftest* confdefs.h
|
||||
|
@ -498,6 +503,7 @@ ac_ext=c
|
|||
ac_cpp='$CPP $CPPFLAGS'
|
||||
ac_compile='${CC-cc} -c $CFLAGS $CPPFLAGS conftest.$ac_ext 1>&5'
|
||||
ac_link='${CC-cc} -o conftest $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5'
|
||||
cross_compiling=$ac_cv_prog_cc_cross
|
||||
|
||||
if (echo "testing\c"; echo 1,2,3) | grep c >/dev/null; then
|
||||
# Stardent Vistra SVR4 grep lacks -e, says ghazi@caip.rutgers.edu.
|
||||
|
@ -544,6 +550,7 @@ fi
|
|||
# Extract the first word of "gcc", so it can be a program name with args.
|
||||
set dummy gcc; ac_word=$2
|
||||
echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
|
||||
echo "configure:554: checking for $ac_word" >&5
|
||||
if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then
|
||||
echo $ac_n "(cached) $ac_c" 1>&6
|
||||
else
|
||||
|
@ -572,6 +579,7 @@ if test -z "$CC"; then
|
|||
# Extract the first word of "cc", so it can be a program name with args.
|
||||
set dummy cc; ac_word=$2
|
||||
echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
|
||||
echo "configure:583: checking for $ac_word" >&5
|
||||
if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then
|
||||
echo $ac_n "(cached) $ac_c" 1>&6
|
||||
else
|
||||
|
@ -618,7 +626,47 @@ fi
|
|||
test -z "$CC" && { echo "configure: error: no acceptable cc found in \$PATH" 1>&2; exit 1; }
|
||||
fi
|
||||
|
||||
echo $ac_n "checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works""... $ac_c" 1>&6
|
||||
echo "configure:631: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works" >&5
|
||||
|
||||
ac_ext=c
|
||||
# CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options.
|
||||
ac_cpp='$CPP $CPPFLAGS'
|
||||
ac_compile='${CC-cc} -c $CFLAGS $CPPFLAGS conftest.$ac_ext 1>&5'
|
||||
ac_link='${CC-cc} -o conftest $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5'
|
||||
cross_compiling=$ac_cv_prog_cc_cross
|
||||
|
||||
cat > conftest.$ac_ext <<EOF
|
||||
#line 641 "configure"
|
||||
#include "confdefs.h"
|
||||
main(){return(0);}
|
||||
EOF
|
||||
if { (eval echo configure:645: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
|
||||
ac_cv_prog_cc_works=yes
|
||||
# If we can't run a trivial program, we are probably using a cross compiler.
|
||||
if (./conftest; exit) 2>/dev/null; then
|
||||
ac_cv_prog_cc_cross=no
|
||||
else
|
||||
ac_cv_prog_cc_cross=yes
|
||||
fi
|
||||
else
|
||||
echo "configure: failed program was:" >&5
|
||||
cat conftest.$ac_ext >&5
|
||||
ac_cv_prog_cc_works=no
|
||||
fi
|
||||
rm -fr conftest*
|
||||
|
||||
echo "$ac_t""$ac_cv_prog_cc_works" 1>&6
|
||||
if test $ac_cv_prog_cc_works = no; then
|
||||
{ echo "configure: error: installation or configuration problem: C compiler cannot create executables." 1>&2; exit 1; }
|
||||
fi
|
||||
echo $ac_n "checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler""... $ac_c" 1>&6
|
||||
echo "configure:665: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler" >&5
|
||||
echo "$ac_t""$ac_cv_prog_cc_cross" 1>&6
|
||||
cross_compiling=$ac_cv_prog_cc_cross
|
||||
|
||||
echo $ac_n "checking whether we are using GNU C""... $ac_c" 1>&6
|
||||
echo "configure:670: checking whether we are using GNU C" >&5
|
||||
if eval "test \"`echo '$''{'ac_cv_prog_gcc'+set}'`\" = set"; then
|
||||
echo $ac_n "(cached) $ac_c" 1>&6
|
||||
else
|
||||
|
@ -627,7 +675,7 @@ else
|
|||
yes;
|
||||
#endif
|
||||
EOF
|
||||
if { ac_try='${CC-cc} -E conftest.c'; { (eval echo configure:631: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; } | egrep yes >/dev/null 2>&1; then
|
||||
if { ac_try='${CC-cc} -E conftest.c'; { (eval echo configure:679: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; } | egrep yes >/dev/null 2>&1; then
|
||||
ac_cv_prog_gcc=yes
|
||||
else
|
||||
ac_cv_prog_gcc=no
|
||||
|
@ -635,29 +683,34 @@ fi
|
|||
fi
|
||||
|
||||
echo "$ac_t""$ac_cv_prog_gcc" 1>&6
|
||||
|
||||
if test $ac_cv_prog_gcc = yes; then
|
||||
GCC=yes
|
||||
if test "${CFLAGS+set}" != set; then
|
||||
echo $ac_n "checking whether ${CC-cc} accepts -g""... $ac_c" 1>&6
|
||||
if eval "test \"`echo '$''{'ac_cv_prog_gcc_g'+set}'`\" = set"; then
|
||||
ac_test_CFLAGS="${CFLAGS+set}"
|
||||
ac_save_CFLAGS="$CFLAGS"
|
||||
CFLAGS=
|
||||
echo $ac_n "checking whether ${CC-cc} accepts -g""... $ac_c" 1>&6
|
||||
echo "configure:694: checking whether ${CC-cc} accepts -g" >&5
|
||||
if eval "test \"`echo '$''{'ac_cv_prog_cc_g'+set}'`\" = set"; then
|
||||
echo $ac_n "(cached) $ac_c" 1>&6
|
||||
else
|
||||
echo 'void f(){}' > conftest.c
|
||||
if test -z "`${CC-cc} -g -c conftest.c 2>&1`"; then
|
||||
ac_cv_prog_gcc_g=yes
|
||||
ac_cv_prog_cc_g=yes
|
||||
else
|
||||
ac_cv_prog_gcc_g=no
|
||||
ac_cv_prog_cc_g=no
|
||||
fi
|
||||
rm -f conftest*
|
||||
|
||||
fi
|
||||
|
||||
echo "$ac_t""$ac_cv_prog_gcc_g" 1>&6
|
||||
if test $ac_cv_prog_gcc_g = yes; then
|
||||
CFLAGS="-g -O"
|
||||
else
|
||||
CFLAGS="-O"
|
||||
fi
|
||||
echo "$ac_t""$ac_cv_prog_cc_g" 1>&6
|
||||
if test "$ac_test_CFLAGS" = set; then
|
||||
CFLAGS="$ac_save_CFLAGS"
|
||||
elif test $ac_cv_prog_cc_g = yes; then
|
||||
CFLAGS="-g -O2"
|
||||
else
|
||||
CFLAGS="-O2"
|
||||
fi
|
||||
else
|
||||
GCC=
|
||||
|
@ -665,6 +718,7 @@ else
|
|||
fi
|
||||
|
||||
echo $ac_n "checking how to run the C preprocessor""... $ac_c" 1>&6
|
||||
echo "configure:722: checking how to run the C preprocessor" >&5
|
||||
# On Suns, sometimes $CPP names a directory.
|
||||
if test -n "$CPP" && test -d "$CPP"; then
|
||||
CPP=
|
||||
|
@ -679,33 +733,37 @@ else
|
|||
# On the NeXT, cc -E runs the code through the compiler's parser,
|
||||
# not just through cpp.
|
||||
cat > conftest.$ac_ext <<EOF
|
||||
#line 683 "configure"
|
||||
#line 737 "configure"
|
||||
#include "confdefs.h"
|
||||
#include <assert.h>
|
||||
Syntax Error
|
||||
EOF
|
||||
ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
|
||||
{ (eval echo configure:689: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
|
||||
{ (eval echo configure:743: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
|
||||
ac_err=`grep -v '^ *+' conftest.out`
|
||||
if test -z "$ac_err"; then
|
||||
:
|
||||
else
|
||||
echo "$ac_err" >&5
|
||||
echo "configure: failed program was:" >&5
|
||||
cat conftest.$ac_ext >&5
|
||||
rm -rf conftest*
|
||||
CPP="${CC-cc} -E -traditional-cpp"
|
||||
cat > conftest.$ac_ext <<EOF
|
||||
#line 698 "configure"
|
||||
#line 754 "configure"
|
||||
#include "confdefs.h"
|
||||
#include <assert.h>
|
||||
Syntax Error
|
||||
EOF
|
||||
ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
|
||||
{ (eval echo configure:704: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
|
||||
{ (eval echo configure:760: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
|
||||
ac_err=`grep -v '^ *+' conftest.out`
|
||||
if test -z "$ac_err"; then
|
||||
:
|
||||
else
|
||||
echo "$ac_err" >&5
|
||||
echo "configure: failed program was:" >&5
|
||||
cat conftest.$ac_ext >&5
|
||||
rm -rf conftest*
|
||||
CPP=/lib/cpp
|
||||
fi
|
||||
|
@ -754,11 +812,12 @@ ac_configure=$ac_aux_dir/configure # This should be Cygnus configure.
|
|||
# SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff"
|
||||
# ./install, which can be erroneously created by make from ./install.sh.
|
||||
echo $ac_n "checking for a BSD compatible install""... $ac_c" 1>&6
|
||||
echo "configure:816: checking for a BSD compatible install" >&5
|
||||
if test -z "$INSTALL"; then
|
||||
if eval "test \"`echo '$''{'ac_cv_path_install'+set}'`\" = set"; then
|
||||
echo $ac_n "(cached) $ac_c" 1>&6
|
||||
else
|
||||
IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}:"
|
||||
IFS="${IFS= }"; ac_save_IFS="$IFS"; IFS="${IFS}:"
|
||||
for ac_dir in $PATH; do
|
||||
# Account for people who put trailing slashes in PATH elements.
|
||||
case "$ac_dir/" in
|
||||
|
@ -781,7 +840,7 @@ else
|
|||
;;
|
||||
esac
|
||||
done
|
||||
IFS="$ac_save_ifs"
|
||||
IFS="$ac_save_IFS"
|
||||
|
||||
fi
|
||||
if test "${ac_cv_path_install+set}" = set; then
|
||||
|
@ -805,6 +864,7 @@ test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644'
|
|||
# Extract the first word of "ranlib", so it can be a program name with args.
|
||||
set dummy ranlib; ac_word=$2
|
||||
echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
|
||||
echo "configure:868: checking for $ac_word" >&5
|
||||
if eval "test \"`echo '$''{'ac_cv_prog_RANLIB'+set}'`\" = set"; then
|
||||
echo $ac_n "(cached) $ac_c" 1>&6
|
||||
else
|
||||
|
@ -831,6 +891,7 @@ else
|
|||
fi
|
||||
|
||||
echo $ac_n "checking whether ln -s works""... $ac_c" 1>&6
|
||||
echo "configure:895: checking whether ln -s works" >&5
|
||||
if eval "test \"`echo '$''{'ac_cv_prog_LN_S'+set}'`\" = set"; then
|
||||
echo $ac_n "(cached) $ac_c" 1>&6
|
||||
else
|
||||
|
@ -859,38 +920,13 @@ fi
|
|||
#--------------------------------------------------------------------
|
||||
# Standard ANSI headers
|
||||
#--------------------------------------------------------------------
|
||||
# If we cannot run a trivial program, we must be cross compiling.
|
||||
echo $ac_n "checking whether cross-compiling""... $ac_c" 1>&6
|
||||
if eval "test \"`echo '$''{'ac_cv_c_cross'+set}'`\" = set"; then
|
||||
echo $ac_n "(cached) $ac_c" 1>&6
|
||||
else
|
||||
if test "$cross_compiling" = yes; then
|
||||
ac_cv_c_cross=yes
|
||||
else
|
||||
cat > conftest.$ac_ext <<EOF
|
||||
#line 872 "configure"
|
||||
#include "confdefs.h"
|
||||
main(){return(0);}
|
||||
EOF
|
||||
{ (eval echo configure:876: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; }
|
||||
if test -s conftest && (./conftest; exit) 2>/dev/null; then
|
||||
ac_cv_c_cross=no
|
||||
else
|
||||
ac_cv_c_cross=yes
|
||||
fi
|
||||
fi
|
||||
rm -fr conftest*
|
||||
fi
|
||||
|
||||
echo "$ac_t""$ac_cv_c_cross" 1>&6
|
||||
cross_compiling=$ac_cv_c_cross
|
||||
|
||||
echo $ac_n "checking for ANSI C header files""... $ac_c" 1>&6
|
||||
echo "configure:925: checking for ANSI C header files" >&5
|
||||
if eval "test \"`echo '$''{'ac_cv_header_stdc'+set}'`\" = set"; then
|
||||
echo $ac_n "(cached) $ac_c" 1>&6
|
||||
else
|
||||
cat > conftest.$ac_ext <<EOF
|
||||
#line 894 "configure"
|
||||
#line 930 "configure"
|
||||
#include "confdefs.h"
|
||||
#include <stdlib.h>
|
||||
#include <stdarg.h>
|
||||
|
@ -898,13 +934,15 @@ else
|
|||
#include <float.h>
|
||||
EOF
|
||||
ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
|
||||
{ (eval echo configure:902: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
|
||||
{ (eval echo configure:938: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
|
||||
ac_err=`grep -v '^ *+' conftest.out`
|
||||
if test -z "$ac_err"; then
|
||||
rm -rf conftest*
|
||||
ac_cv_header_stdc=yes
|
||||
else
|
||||
echo "$ac_err" >&5
|
||||
echo "configure: failed program was:" >&5
|
||||
cat conftest.$ac_ext >&5
|
||||
rm -rf conftest*
|
||||
ac_cv_header_stdc=no
|
||||
fi
|
||||
|
@ -913,7 +951,7 @@ rm -f conftest*
|
|||
if test $ac_cv_header_stdc = yes; then
|
||||
# SunOS 4.x string.h does not declare mem*, contrary to ANSI.
|
||||
cat > conftest.$ac_ext <<EOF
|
||||
#line 917 "configure"
|
||||
#line 955 "configure"
|
||||
#include "confdefs.h"
|
||||
#include <string.h>
|
||||
EOF
|
||||
|
@ -931,7 +969,7 @@ fi
|
|||
if test $ac_cv_header_stdc = yes; then
|
||||
# ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI.
|
||||
cat > conftest.$ac_ext <<EOF
|
||||
#line 935 "configure"
|
||||
#line 973 "configure"
|
||||
#include "confdefs.h"
|
||||
#include <stdlib.h>
|
||||
EOF
|
||||
|
@ -951,8 +989,8 @@ if test $ac_cv_header_stdc = yes; then
|
|||
if test "$cross_compiling" = yes; then
|
||||
:
|
||||
else
|
||||
cat > conftest.$ac_ext <<EOF
|
||||
#line 956 "configure"
|
||||
cat > conftest.$ac_ext <<EOF
|
||||
#line 994 "configure"
|
||||
#include "confdefs.h"
|
||||
#include <ctype.h>
|
||||
#define ISLOWER(c) ('a' <= (c) && (c) <= 'z')
|
||||
|
@ -963,14 +1001,18 @@ if (XOR (islower (i), ISLOWER (i)) || toupper (i) != TOUPPER (i)) exit(2);
|
|||
exit (0); }
|
||||
|
||||
EOF
|
||||
{ (eval echo configure:967: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; }
|
||||
if test -s conftest && (./conftest; exit) 2>/dev/null; then
|
||||
if { (eval echo configure:1005: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null
|
||||
then
|
||||
:
|
||||
else
|
||||
echo "configure: failed program was:" >&5
|
||||
cat conftest.$ac_ext >&5
|
||||
rm -fr conftest*
|
||||
ac_cv_header_stdc=no
|
||||
fi
|
||||
fi
|
||||
rm -fr conftest*
|
||||
fi
|
||||
|
||||
fi
|
||||
fi
|
||||
|
||||
|
@ -988,24 +1030,27 @@ fi
|
|||
#--------------------------------------------------------------------
|
||||
for ac_hdr in tiff.h
|
||||
do
|
||||
ac_safe=`echo "$ac_hdr" | tr './\055' '___'`
|
||||
ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
|
||||
echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
|
||||
echo "configure:1036: checking for $ac_hdr" >&5
|
||||
if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
|
||||
echo $ac_n "(cached) $ac_c" 1>&6
|
||||
else
|
||||
cat > conftest.$ac_ext <<EOF
|
||||
#line 998 "configure"
|
||||
#line 1041 "configure"
|
||||
#include "confdefs.h"
|
||||
#include <$ac_hdr>
|
||||
EOF
|
||||
ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
|
||||
{ (eval echo configure:1003: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
|
||||
{ (eval echo configure:1046: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
|
||||
ac_err=`grep -v '^ *+' conftest.out`
|
||||
if test -z "$ac_err"; then
|
||||
rm -rf conftest*
|
||||
eval "ac_cv_header_$ac_safe=yes"
|
||||
else
|
||||
echo "$ac_err" >&5
|
||||
echo "configure: failed program was:" >&5
|
||||
cat conftest.$ac_ext >&5
|
||||
rm -rf conftest*
|
||||
eval "ac_cv_header_$ac_safe=no"
|
||||
fi
|
||||
|
@ -1013,7 +1058,7 @@ rm -f conftest*
|
|||
fi
|
||||
if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
|
||||
echo "$ac_t""yes" 1>&6
|
||||
ac_tr_hdr=HAVE_`echo $ac_hdr | tr 'abcdefghijklmnopqrstuvwxyz./\055' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ___'`
|
||||
ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
|
||||
cat >> confdefs.h <<EOF
|
||||
#define $ac_tr_hdr 1
|
||||
EOF
|
||||
|
@ -1040,24 +1085,27 @@ fi
|
|||
#--------------------------------------------------------------------
|
||||
for ac_hdr in DPS/dpsclient.h
|
||||
do
|
||||
ac_safe=`echo "$ac_hdr" | tr './\055' '___'`
|
||||
ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
|
||||
echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
|
||||
echo "configure:1091: checking for $ac_hdr" >&5
|
||||
if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
|
||||
echo $ac_n "(cached) $ac_c" 1>&6
|
||||
else
|
||||
cat > conftest.$ac_ext <<EOF
|
||||
#line 1050 "configure"
|
||||
#line 1096 "configure"
|
||||
#include "confdefs.h"
|
||||
#include <$ac_hdr>
|
||||
EOF
|
||||
ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
|
||||
{ (eval echo configure:1055: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
|
||||
{ (eval echo configure:1101: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
|
||||
ac_err=`grep -v '^ *+' conftest.out`
|
||||
if test -z "$ac_err"; then
|
||||
rm -rf conftest*
|
||||
eval "ac_cv_header_$ac_safe=yes"
|
||||
else
|
||||
echo "$ac_err" >&5
|
||||
echo "configure: failed program was:" >&5
|
||||
cat conftest.$ac_ext >&5
|
||||
rm -rf conftest*
|
||||
eval "ac_cv_header_$ac_safe=no"
|
||||
fi
|
||||
|
@ -1065,7 +1113,7 @@ rm -f conftest*
|
|||
fi
|
||||
if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
|
||||
echo "$ac_t""yes" 1>&6
|
||||
ac_tr_hdr=HAVE_`echo $ac_hdr | tr 'abcdefghijklmnopqrstuvwxyz./\055' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ___'`
|
||||
ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
|
||||
cat >> confdefs.h <<EOF
|
||||
#define $ac_tr_hdr 1
|
||||
EOF
|
||||
|
@ -1099,30 +1147,32 @@ config_include=''
|
|||
|
||||
|
||||
# Checking for some additional libraries we might need
|
||||
echo $ac_n "checking for -ldl""... $ac_c" 1>&6
|
||||
ac_lib_var=`echo dl'_'dlopen | tr './+\055' '__p_'`
|
||||
echo $ac_n "checking for dlopen in -ldl""... $ac_c" 1>&6
|
||||
echo "configure:1152: checking for dlopen in -ldl" >&5
|
||||
ac_lib_var=`echo dl'_'dlopen | sed 'y%./+-%__p_%'`
|
||||
if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
|
||||
echo $ac_n "(cached) $ac_c" 1>&6
|
||||
else
|
||||
ac_save_LIBS="$LIBS"
|
||||
LIBS="-ldl $LIBS"
|
||||
cat > conftest.$ac_ext <<EOF
|
||||
#line 1111 "configure"
|
||||
#line 1160 "configure"
|
||||
#include "confdefs.h"
|
||||
/* Override any gcc2 internal prototype to avoid an error. */
|
||||
/* We use char because int might match the return type of a gcc2
|
||||
builtin and then its argument prototype would still apply. */
|
||||
char dlopen();
|
||||
|
||||
int main() { return 0; }
|
||||
int t() {
|
||||
int main() {
|
||||
dlopen()
|
||||
; return 0; }
|
||||
EOF
|
||||
if { (eval echo configure:1123: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; }; then
|
||||
if { (eval echo configure:1171: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
|
||||
rm -rf conftest*
|
||||
eval "ac_cv_lib_$ac_lib_var=yes"
|
||||
else
|
||||
echo "configure: failed program was:" >&5
|
||||
cat conftest.$ac_ext >&5
|
||||
rm -rf conftest*
|
||||
eval "ac_cv_lib_$ac_lib_var=no"
|
||||
fi
|
||||
|
@ -1132,7 +1182,8 @@ LIBS="$ac_save_LIBS"
|
|||
fi
|
||||
if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
|
||||
echo "$ac_t""yes" 1>&6
|
||||
ac_tr_lib=HAVE_LIB`echo dl | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
|
||||
ac_tr_lib=HAVE_LIB`echo dl | sed -e 's/[^a-zA-Z0-9_]/_/g' \
|
||||
-e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'`
|
||||
cat >> confdefs.h <<EOF
|
||||
#define $ac_tr_lib 1
|
||||
EOF
|
||||
|
@ -1143,30 +1194,32 @@ else
|
|||
echo "$ac_t""no" 1>&6
|
||||
fi
|
||||
|
||||
echo $ac_n "checking for -lpthread""... $ac_c" 1>&6
|
||||
ac_lib_var=`echo pthread'_'pthread_create | tr './+\055' '__p_'`
|
||||
echo $ac_n "checking for pthread_create in -lpthread""... $ac_c" 1>&6
|
||||
echo "configure:1199: checking for pthread_create in -lpthread" >&5
|
||||
ac_lib_var=`echo pthread'_'pthread_create | sed 'y%./+-%__p_%'`
|
||||
if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
|
||||
echo $ac_n "(cached) $ac_c" 1>&6
|
||||
else
|
||||
ac_save_LIBS="$LIBS"
|
||||
LIBS="-lpthread $LIBS"
|
||||
cat > conftest.$ac_ext <<EOF
|
||||
#line 1155 "configure"
|
||||
#line 1207 "configure"
|
||||
#include "confdefs.h"
|
||||
/* Override any gcc2 internal prototype to avoid an error. */
|
||||
/* We use char because int might match the return type of a gcc2
|
||||
builtin and then its argument prototype would still apply. */
|
||||
char pthread_create();
|
||||
|
||||
int main() { return 0; }
|
||||
int t() {
|
||||
int main() {
|
||||
pthread_create()
|
||||
; return 0; }
|
||||
EOF
|
||||
if { (eval echo configure:1167: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; }; then
|
||||
if { (eval echo configure:1218: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
|
||||
rm -rf conftest*
|
||||
eval "ac_cv_lib_$ac_lib_var=yes"
|
||||
else
|
||||
echo "configure: failed program was:" >&5
|
||||
cat conftest.$ac_ext >&5
|
||||
rm -rf conftest*
|
||||
eval "ac_cv_lib_$ac_lib_var=no"
|
||||
fi
|
||||
|
@ -1176,7 +1229,8 @@ LIBS="$ac_save_LIBS"
|
|||
fi
|
||||
if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
|
||||
echo "$ac_t""yes" 1>&6
|
||||
ac_tr_lib=HAVE_LIB`echo pthread | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
|
||||
ac_tr_lib=HAVE_LIB`echo pthread | sed -e 's/[^a-zA-Z0-9_]/_/g' \
|
||||
-e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'`
|
||||
cat >> confdefs.h <<EOF
|
||||
#define $ac_tr_lib 1
|
||||
EOF
|
||||
|
@ -1187,30 +1241,32 @@ else
|
|||
echo "$ac_t""no" 1>&6
|
||||
fi
|
||||
|
||||
echo $ac_n "checking for -lm""... $ac_c" 1>&6
|
||||
ac_lib_var=`echo m'_'sqrt | tr './+\055' '__p_'`
|
||||
echo $ac_n "checking for sqrt in -lm""... $ac_c" 1>&6
|
||||
echo "configure:1246: checking for sqrt in -lm" >&5
|
||||
ac_lib_var=`echo m'_'sqrt | sed 'y%./+-%__p_%'`
|
||||
if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
|
||||
echo $ac_n "(cached) $ac_c" 1>&6
|
||||
else
|
||||
ac_save_LIBS="$LIBS"
|
||||
LIBS="-lm $LIBS"
|
||||
cat > conftest.$ac_ext <<EOF
|
||||
#line 1199 "configure"
|
||||
#line 1254 "configure"
|
||||
#include "confdefs.h"
|
||||
/* Override any gcc2 internal prototype to avoid an error. */
|
||||
/* We use char because int might match the return type of a gcc2
|
||||
builtin and then its argument prototype would still apply. */
|
||||
char sqrt();
|
||||
|
||||
int main() { return 0; }
|
||||
int t() {
|
||||
int main() {
|
||||
sqrt()
|
||||
; return 0; }
|
||||
EOF
|
||||
if { (eval echo configure:1211: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; }; then
|
||||
if { (eval echo configure:1265: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
|
||||
rm -rf conftest*
|
||||
eval "ac_cv_lib_$ac_lib_var=yes"
|
||||
else
|
||||
echo "configure: failed program was:" >&5
|
||||
cat conftest.$ac_ext >&5
|
||||
rm -rf conftest*
|
||||
eval "ac_cv_lib_$ac_lib_var=no"
|
||||
fi
|
||||
|
@ -1220,7 +1276,8 @@ LIBS="$ac_save_LIBS"
|
|||
fi
|
||||
if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
|
||||
echo "$ac_t""yes" 1>&6
|
||||
ac_tr_lib=HAVE_LIB`echo m | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
|
||||
ac_tr_lib=HAVE_LIB`echo m | sed -e 's/[^a-zA-Z0-9_]/_/g' \
|
||||
-e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'`
|
||||
cat >> confdefs.h <<EOF
|
||||
#define $ac_tr_lib 1
|
||||
EOF
|
||||
|
@ -1233,7 +1290,9 @@ fi
|
|||
|
||||
|
||||
# Determine the Foundation library
|
||||
|
||||
echo $ac_n "checking for the Foundation library""... $ac_c" 1>&6
|
||||
echo "configure:1296: checking for the Foundation library" >&5
|
||||
if eval "test \"`echo '$''{'ac_cv_foundation_library'+set}'`\" = set"; then
|
||||
echo $ac_n "(cached) $ac_c" 1>&6
|
||||
else
|
||||
|
@ -1244,73 +1303,79 @@ ac_compile='${CC-cc} -c $OBJC_RUNTIME_FLAG $CFLAGS conftest.$ac_ext 1>&5 2>&5'
|
|||
ac_link='${CC-cc} -o conftest $OBJC_RUNTIME_FLAG $CFLAGS $LDFLAGS conftest.$ac_ext $LIBS $OBJC_LIBS 1>&5 2>&5'
|
||||
|
||||
cat > conftest.$ac_ext <<EOF
|
||||
#line 1248 "configure"
|
||||
#line 1307 "configure"
|
||||
#include "confdefs.h"
|
||||
#include <Foundation/preface.h>
|
||||
|
||||
int main() { return 0; }
|
||||
int t() {
|
||||
int main() {
|
||||
|
||||
; return 0; }
|
||||
EOF
|
||||
if { (eval echo configure:1257: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
|
||||
if { (eval echo configure:1315: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
|
||||
rm -rf conftest*
|
||||
ac_cv_foundation_library="$ac_cv_foundation_library gnustep-base"
|
||||
else
|
||||
echo "configure: failed program was:" >&5
|
||||
cat conftest.$ac_ext >&5
|
||||
fi
|
||||
rm -f conftest*
|
||||
|
||||
cat > conftest.$ac_ext <<EOF
|
||||
#line 1264 "configure"
|
||||
#line 1324 "configure"
|
||||
#include "confdefs.h"
|
||||
#include <Foundation/exceptions/FoundationException.h>
|
||||
|
||||
int main() { return 0; }
|
||||
int t() {
|
||||
int main() {
|
||||
|
||||
; return 0; }
|
||||
EOF
|
||||
if { (eval echo configure:1273: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
|
||||
if { (eval echo configure:1332: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
|
||||
rm -rf conftest*
|
||||
ac_cv_foundation_library="$ac_cv_foundation_library libFoundation"
|
||||
else
|
||||
echo "configure: failed program was:" >&5
|
||||
cat conftest.$ac_ext >&5
|
||||
fi
|
||||
rm -f conftest*
|
||||
|
||||
cat > conftest.$ac_ext <<EOF
|
||||
#line 1280 "configure"
|
||||
#line 1341 "configure"
|
||||
#include "confdefs.h"
|
||||
#include <objects/stdobjects.h>
|
||||
|
||||
int main() { return 0; }
|
||||
int t() {
|
||||
int main() {
|
||||
|
||||
; return 0; }
|
||||
EOF
|
||||
if { (eval echo configure:1289: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
|
||||
if { (eval echo configure:1349: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
|
||||
rm -rf conftest*
|
||||
ac_cv_foundation_library="$ac_cv_foundation_library libobjects"
|
||||
else
|
||||
echo "configure: failed program was:" >&5
|
||||
cat conftest.$ac_ext >&5
|
||||
fi
|
||||
rm -f conftest*
|
||||
|
||||
ac_ext=c
|
||||
# CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options.
|
||||
ac_cpp='$CPP $CPPFLAGS'
|
||||
ac_compile='${CC-cc} -c $CFLAGS $CPPFLAGS conftest.$ac_ext 1>&5'
|
||||
ac_link='${CC-cc} -o conftest $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5'
|
||||
cross_compiling=$ac_cv_prog_cc_cross
|
||||
if test "$FOUNDATION" = ""; then
|
||||
cat > conftest.$ac_ext <<EOF
|
||||
#line 1302 "configure"
|
||||
#line 1365 "configure"
|
||||
#include "confdefs.h"
|
||||
#include <foundation/NSObject.h>
|
||||
|
||||
EOF
|
||||
ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
|
||||
{ (eval echo configure:1308: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
|
||||
{ (eval echo configure:1371: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
|
||||
ac_err=`grep -v '^ *+' conftest.out`
|
||||
if test -z "$ac_err"; then
|
||||
rm -rf conftest*
|
||||
ac_cv_foundation_library=foundation
|
||||
else
|
||||
echo "$ac_err" >&5
|
||||
echo "configure: failed program was:" >&5
|
||||
cat conftest.$ac_ext >&5
|
||||
fi
|
||||
rm -f conftest*
|
||||
else
|
||||
|
@ -1366,6 +1431,7 @@ EOF
|
|||
esac
|
||||
echo "$ac_t""${ac_cv_foundation_library}" 1>&6
|
||||
echo $ac_n "checking for the Objective-C runtime""... $ac_c" 1>&6
|
||||
echo "configure:1435: checking for the Objective-C runtime" >&5
|
||||
if eval "test \"`echo '$''{'ac_cv_objc_runtime'+set}'`\" = set"; then
|
||||
echo $ac_n "(cached) $ac_c" 1>&6
|
||||
else
|
||||
|
@ -1377,11 +1443,10 @@ ac_compile='${CC-cc} -c $OBJC_RUNTIME_FLAG $CFLAGS conftest.$ac_ext 1>&5 2>&5'
|
|||
ac_link='${CC-cc} -o conftest $OBJC_RUNTIME_FLAG $CFLAGS $LDFLAGS conftest.$ac_ext $LIBS $OBJC_LIBS 1>&5 2>&5'
|
||||
|
||||
cat > conftest.$ac_ext <<EOF
|
||||
#line 1381 "configure"
|
||||
#line 1447 "configure"
|
||||
#include "confdefs.h"
|
||||
#include <Foundation/NSString.h>
|
||||
int main() { return 0; }
|
||||
int t() {
|
||||
int main() {
|
||||
extern id objc_lookUpClass(char*);
|
||||
id class = objc_lookUpClass("NSObject");
|
||||
id obj = [class alloc];
|
||||
|
@ -1389,46 +1454,48 @@ extern id objc_lookUpClass(char*);
|
|||
|
||||
; return 0; }
|
||||
EOF
|
||||
if { (eval echo configure:1393: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; }; then
|
||||
if { (eval echo configure:1458: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
|
||||
rm -rf conftest*
|
||||
ac_cv_objc_runtime=NeXT
|
||||
else
|
||||
echo "configure: failed program was:" >&5
|
||||
cat conftest.$ac_ext >&5
|
||||
rm -rf conftest*
|
||||
ac_cv_objc_runtime=unknown
|
||||
fi
|
||||
rm -f conftest*
|
||||
|
||||
if test $ac_cv_objc_runtime = unknown; then
|
||||
OBJC_RUNTIME_FLAG=-fgnu-runtime
|
||||
LIBS="$LIBS -lobjc"
|
||||
cat > conftest.$ac_ext <<EOF
|
||||
#line 1406 "configure"
|
||||
#line 1472 "configure"
|
||||
#include "confdefs.h"
|
||||
#include <Foundation/NSString.h>
|
||||
#include <objc/objc-api.h>
|
||||
int main() { return 0; }
|
||||
int t() {
|
||||
int main() {
|
||||
id class = objc_lookup_class("NSObject");
|
||||
id obj = [class alloc];
|
||||
puts([[obj description] cString]);
|
||||
|
||||
; return 0; }
|
||||
EOF
|
||||
if { (eval echo configure:1418: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; }; then
|
||||
if { (eval echo configure:1483: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
|
||||
rm -rf conftest*
|
||||
ac_cv_objc_runtime=GNU
|
||||
else
|
||||
echo "configure: failed program was:" >&5
|
||||
cat conftest.$ac_ext >&5
|
||||
rm -rf conftest*
|
||||
ac_cv_objc_runtime=unknown
|
||||
fi
|
||||
rm -f conftest*
|
||||
|
||||
fi
|
||||
ac_ext=c
|
||||
# CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options.
|
||||
ac_cpp='$CPP $CPPFLAGS'
|
||||
ac_compile='${CC-cc} -c $CFLAGS $CPPFLAGS conftest.$ac_ext 1>&5'
|
||||
ac_link='${CC-cc} -o conftest $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5'
|
||||
cross_compiling=$ac_cv_prog_cc_cross
|
||||
|
||||
fi
|
||||
|
||||
|
@ -1485,11 +1552,25 @@ cat > confcache <<\EOF
|
|||
# --recheck option to rerun configure.
|
||||
#
|
||||
EOF
|
||||
# The following way of writing the cache mishandles newlines in values,
|
||||
# but we know of no workaround that is simple, portable, and efficient.
|
||||
# So, don't put newlines in cache variables' values.
|
||||
# Ultrix sh set writes to stderr and can't be redirected directly,
|
||||
# and sets the high bit in the cache file unless we assign to the vars.
|
||||
(set) 2>&1 |
|
||||
sed -n "s/^\([a-zA-Z0-9_]*_cv_[a-zA-Z0-9_]*\)=\(.*\)/\1=\${\1='\2'}/p" \
|
||||
>> confcache
|
||||
case `(ac_space=' '; set) 2>&1` in
|
||||
*ac_space=\ *)
|
||||
# `set' does not quote correctly, so add quotes (double-quote substitution
|
||||
# turns \\\\ into \\, and sed turns \\ into \).
|
||||
sed -n \
|
||||
-e "s/'/'\\\\''/g" \
|
||||
-e "s/^\\([a-zA-Z0-9_]*_cv_[a-zA-Z0-9_]*\\)=\\(.*\\)/\\1=\${\\1='\\2'}/p"
|
||||
;;
|
||||
*)
|
||||
# `set' quotes correctly as required by POSIX, so do not add quotes.
|
||||
sed -n -e 's/^\([a-zA-Z0-9_]*_cv_[a-zA-Z0-9_]*\)=\(.*\)/\1=${\1=\2}/p'
|
||||
;;
|
||||
esac >> confcache
|
||||
if cmp -s $cache_file confcache; then
|
||||
:
|
||||
else
|
||||
|
@ -1544,7 +1625,7 @@ do
|
|||
echo "running \${CONFIG_SHELL-/bin/sh} $0 $ac_configure_args --no-create --no-recursion"
|
||||
exec \${CONFIG_SHELL-/bin/sh} $0 $ac_configure_args --no-create --no-recursion ;;
|
||||
-version | --version | --versio | --versi | --vers | --ver | --ve | --v)
|
||||
echo "$CONFIG_STATUS generated by autoconf version 2.10"
|
||||
echo "$CONFIG_STATUS generated by autoconf version 2.12"
|
||||
exit 0 ;;
|
||||
-help | --help | --hel | --he | --h)
|
||||
echo "\$ac_cs_usage"; exit 0 ;;
|
||||
|
@ -1598,20 +1679,56 @@ s%@OBJC_RUNTIME_FLAG@%$OBJC_RUNTIME_FLAG%g
|
|||
|
||||
CEOF
|
||||
EOF
|
||||
|
||||
cat >> $CONFIG_STATUS <<\EOF
|
||||
|
||||
# Split the substitutions into bite-sized pieces for seds with
|
||||
# small command number limits, like on Digital OSF/1 and HP-UX.
|
||||
ac_max_sed_cmds=90 # Maximum number of lines to put in a sed script.
|
||||
ac_file=1 # Number of current file.
|
||||
ac_beg=1 # First line for current file.
|
||||
ac_end=$ac_max_sed_cmds # Line after last line for current file.
|
||||
ac_more_lines=:
|
||||
ac_sed_cmds=""
|
||||
while $ac_more_lines; do
|
||||
if test $ac_beg -gt 1; then
|
||||
sed "1,${ac_beg}d; ${ac_end}q" conftest.subs > conftest.s$ac_file
|
||||
else
|
||||
sed "${ac_end}q" conftest.subs > conftest.s$ac_file
|
||||
fi
|
||||
if test ! -s conftest.s$ac_file; then
|
||||
ac_more_lines=false
|
||||
rm -f conftest.s$ac_file
|
||||
else
|
||||
if test -z "$ac_sed_cmds"; then
|
||||
ac_sed_cmds="sed -f conftest.s$ac_file"
|
||||
else
|
||||
ac_sed_cmds="$ac_sed_cmds | sed -f conftest.s$ac_file"
|
||||
fi
|
||||
ac_file=`expr $ac_file + 1`
|
||||
ac_beg=$ac_end
|
||||
ac_end=`expr $ac_end + $ac_max_sed_cmds`
|
||||
fi
|
||||
done
|
||||
if test -z "$ac_sed_cmds"; then
|
||||
ac_sed_cmds=cat
|
||||
fi
|
||||
EOF
|
||||
|
||||
cat >> $CONFIG_STATUS <<EOF
|
||||
|
||||
CONFIG_FILES=\${CONFIG_FILES-"Makefile Source/Makefile Testing/Makefile Documentation/Makefile Images/Makefile"}
|
||||
EOF
|
||||
cat >> $CONFIG_STATUS <<\EOF
|
||||
for ac_file in .. $CONFIG_FILES; do if test "x$ac_file" != x..; then
|
||||
# Support "outfile[:infile]", defaulting infile="outfile.in".
|
||||
# Support "outfile[:infile[:infile...]]", defaulting infile="outfile.in".
|
||||
case "$ac_file" in
|
||||
*:*) ac_file_in=`echo "$ac_file"|sed 's%.*:%%'`
|
||||
*:*) ac_file_in=`echo "$ac_file"|sed 's%[^:]*:%%'`
|
||||
ac_file=`echo "$ac_file"|sed 's%:.*%%'` ;;
|
||||
*) ac_file_in="${ac_file}.in" ;;
|
||||
esac
|
||||
|
||||
# Adjust relative srcdir, etc. for subdirectories.
|
||||
# Adjust a relative srcdir, top_srcdir, and INSTALL for subdirectories.
|
||||
|
||||
# Remove last slash and all that follows it. Not all systems have dirname.
|
||||
ac_dir=`echo $ac_file|sed 's%/[^/][^/]*$%%'`
|
||||
|
@ -1639,6 +1756,7 @@ for ac_file in .. $CONFIG_FILES; do if test "x$ac_file" != x..; then
|
|||
[/$]*) INSTALL="$ac_given_INSTALL" ;;
|
||||
*) INSTALL="$ac_dots$ac_given_INSTALL" ;;
|
||||
esac
|
||||
|
||||
echo creating "$ac_file"
|
||||
rm -f "$ac_file"
|
||||
configure_input="Generated automatically from `echo $ac_file_in|sed 's%.*/%%'` by configure."
|
||||
|
@ -1647,14 +1765,16 @@ for ac_file in .. $CONFIG_FILES; do if test "x$ac_file" != x..; then
|
|||
# $configure_input" ;;
|
||||
*) ac_comsub= ;;
|
||||
esac
|
||||
|
||||
ac_file_inputs=`echo $ac_file_in|sed -e "s%^%$ac_given_srcdir/%" -e "s%:% $ac_given_srcdir/%g"`
|
||||
sed -e "$ac_comsub
|
||||
s%@configure_input@%$configure_input%g
|
||||
s%@srcdir@%$srcdir%g
|
||||
s%@top_srcdir@%$top_srcdir%g
|
||||
s%@INSTALL@%$INSTALL%g
|
||||
" -f conftest.subs $ac_given_srcdir/$ac_file_in > $ac_file
|
||||
" $ac_file_inputs | (eval "$ac_sed_cmds") > $ac_file
|
||||
fi; done
|
||||
rm -f conftest.subs
|
||||
rm -f conftest.s*
|
||||
|
||||
# These sed commands are passed to sed as "A NAME B NAME C VALUE D", where
|
||||
# NAME is the cpp macro being defined and VALUE is the value it is being given.
|
||||
|
@ -1675,11 +1795,17 @@ ac_eB='$%\1#\2define\3'
|
|||
ac_eC=' '
|
||||
ac_eD='%g'
|
||||
|
||||
CONFIG_HEADERS=${CONFIG_HEADERS-"Headers/gnustep/gui/config.h"}
|
||||
if test "${CONFIG_HEADERS+set}" != set; then
|
||||
EOF
|
||||
cat >> $CONFIG_STATUS <<EOF
|
||||
CONFIG_HEADERS="Headers/gnustep/gui/config.h"
|
||||
EOF
|
||||
cat >> $CONFIG_STATUS <<\EOF
|
||||
fi
|
||||
for ac_file in .. $CONFIG_HEADERS; do if test "x$ac_file" != x..; then
|
||||
# Support "outfile[:infile]", defaulting infile="outfile.in".
|
||||
# Support "outfile[:infile[:infile...]]", defaulting infile="outfile.in".
|
||||
case "$ac_file" in
|
||||
*:*) ac_file_in=`echo "$ac_file"|sed 's%.*:%%'`
|
||||
*:*) ac_file_in=`echo "$ac_file"|sed 's%[^:]*:%%'`
|
||||
ac_file=`echo "$ac_file"|sed 's%:.*%%'` ;;
|
||||
*) ac_file_in="${ac_file}.in" ;;
|
||||
esac
|
||||
|
@ -1687,7 +1813,8 @@ for ac_file in .. $CONFIG_HEADERS; do if test "x$ac_file" != x..; then
|
|||
echo creating $ac_file
|
||||
|
||||
rm -f conftest.frag conftest.in conftest.out
|
||||
cp $ac_given_srcdir/$ac_file_in conftest.in
|
||||
ac_file_inputs=`echo $ac_file_in|sed -e "s%^%$ac_given_srcdir/%" -e "s%:% $ac_given_srcdir/%g"`
|
||||
cat $ac_file_inputs > conftest.in
|
||||
|
||||
EOF
|
||||
|
||||
|
@ -1715,8 +1842,6 @@ EOF
|
|||
|
||||
# Break up conftest.vals because some shells have a limit on
|
||||
# the size of here documents, and old seds have small limits too.
|
||||
# Maximum number of lines to put in a single here document.
|
||||
ac_max_here_lines=12
|
||||
|
||||
rm -f conftest.tail
|
||||
while :
|
||||
|
@ -1758,7 +1883,11 @@ cat >> $CONFIG_STATUS <<\EOF
|
|||
fi
|
||||
fi; done
|
||||
|
||||
EOF
|
||||
cat >> $CONFIG_STATUS <<EOF
|
||||
|
||||
EOF
|
||||
cat >> $CONFIG_STATUS <<\EOF
|
||||
|
||||
exit 0
|
||||
EOF
|
||||
|
|
Loading…
Reference in a new issue