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:
netcrep 1997-07-07 16:56:52 +00:00
parent f38b177296
commit 01b4994fb8
44 changed files with 2645 additions and 1101 deletions

4
.cvsignore Normal file
View file

@ -0,0 +1,4 @@
config.log
Makefile
config.status
config.cache

View file

@ -1,7 +1,7 @@
ANNOUNCE 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? What is the GNUstep GUI Library?
================================ ================================
@ -31,41 +31,38 @@ component like the GNUstep X/DPS GUI Backend.
What's new in this release? 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 * Completely reworked the menu class. The NSMenu class is now
images for use with controls that were designed by Andrew Lindesay. 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, * The initial implementation of NSForm has been made although it has
categories, and protocols; thanks to Simon Frankau for much of this not been tested yet.
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.
* Completely reworked the NSFont and NSFontManager classes so that * NSPrinter has been implemented though it was not throughly tested;
NSUserDefaults is used for getting defaults and list of known thanks to Simon Frankau.
fonts are maintained.
* 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. * Several cleanups have been made in a lot of classes: the
Buttons can not display images and/or text, handles all of the retain/release policy has been fixed, the cell classes correctly
OpenStep button types and styles. implement the NSCopying protocol and many others.
* 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.
How can I get support for this software? 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? 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'. `ftp.gnustep.org' in `pub/gnustep'.
The program requires gcc 2.7.0 or higher. 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. TIFF Graphics library version 3.4.
It also requires a FoundationKit library as specified by the OpenStep It also requires a FoundationKit library as specified by the OpenStep
specification. The FoundationKit library known to work is the GNUstep specification. The FoundationKit libraries known to work are the
Base Library version `0.2.12'. 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 The `.tar' file is compressed with GNU gzip. Gzip can be obtained by
anonymous ftp at any of the GNU archive sites. anonymous ftp at any of the GNU archive sites.

View file

@ -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. Finished the second attempt in implementing menus.
* Headers/gnustep/gui/NSCell.h: Declare class to conform to * Headers/gnustep/gui/NSMenuCell.h: Removed.
NSCopying. * Headers/gnustep/gui/NSMenuPrivate.h: Removed.
* Headers/gnustep/gui/NSActionCell.h: Likewise. * Headers/gnustep/gui/NSMenuItem.h: New file.
* Headers/gnustep/gui/NSButtonCell.h: Likewise. * Headers/gnustep/gui/NSMenu.h: Completely reworked.
* Source/NSCell.m: Implement copyWithZone:. * Headers/gnustep/gui/AppKit.h: Include NSMenuItem.h.
* Source/NSActionCell.m: Likewise. * Source/NSMenu.m: Completely reworked.
* Source/NSButtonCell.m: Likewise. * Source/NSMenuCell.m: Removed.
* Source/NSMenuItem.m: New file.
* Use NSRunLoop to get the events. Fixed objects retain/release policy.
* Headers/gnustep/gui/NSApplication.h: Define USE_RUN_LOOP macro if you * Source/NSView.m: Likewise.
want NSRunLoop class to be used instead of the default busy wait. Note * Source/NSWindow.m: Likewise.
that some classes will not work with the "default" loop. This macro * Source/NSImage.m: Likewise.
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.
* NSMatrix class completely reworked to be compliant to the OpenStep * Source/NSWindow.m: Changed the way in which the windows are
specification. identified by number. The NSWindow class should keep track of them
* Source/NSMatrix.m: The second implementation. instead of NSApplication.
* Headers/gnustep/gui/NSMatrix.h: Likewise. * 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/NSWindow.m (flushWindowIfNeeded): Flush the window if it needs
* Source/NSForm.m: Initial implementation. flush.
* Headers/gnustep/gui/NSForm.h: Likewise. (+windowWithNumber:): New method; its implementation should be in the
* Source/NSFormCell.m: Initial implementation. backend library.
* 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.
Mon Apr 21 18:57:30 1997 Ovidiu Predescu <ovidiu@net-community.com> 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/NSScroller.m (-trackKnob:): Likewise.
* Source/NSWindow.m (-nextEventMatchingMask:): 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. specification.
* Source/NSMatrix.m: The second implementation. * Source/NSMatrix.m: The second implementation.
* Headers/gnustep/gui/NSMatrix.h: Likewise. * Headers/gnustep/gui/NSMatrix.h: Likewise.

View file

@ -91,6 +91,8 @@ version.tmpl.texi: $(srcdir)/../Version
>> version.tmpl.texi >> version.tmpl.texi
echo '@set GNUSTEP-GUI-BASE $(GNUSTEP_GUI_BASE)' \ echo '@set GNUSTEP-GUI-BASE $(GNUSTEP_GUI_BASE)' \
>> version.tmpl.texi >> version.tmpl.texi
echo '@set LIB-FOUNDATION $(LIB_FOUNDATION)' \
>> version.tmpl.texi
echo '@set GNUSTEP-GUI-LIBTIFF $(GNUSTEP_GUI_LIBTIFF)' \ echo '@set GNUSTEP-GUI-LIBTIFF $(GNUSTEP_GUI_LIBTIFF)' \
>> version.tmpl.texi >> version.tmpl.texi
echo '@set GNUSTEP-GUI-DGS $(GNUSTEP_GUI_DGS)' \ echo '@set GNUSTEP-GUI-DGS $(GNUSTEP_GUI_DGS)' \
@ -111,6 +113,7 @@ version.tmpl.texi: $(srcdir)/../Version
echo '@set GNUSTEP-GUI-SNAP-FTP-DIRECTORY \ echo '@set GNUSTEP-GUI-SNAP-FTP-DIRECTORY \
$(GNUSTEP_GUI_SNAP_FTP_DIRECTORY)' \ $(GNUSTEP_GUI_SNAP_FTP_DIRECTORY)' \
>> version.tmpl.texi; fi >> version.tmpl.texi; fi
cp version.tmpl.texi version.texi
gnustep-gui.dvi: $(ORIG_FILES) gnustep-gui.dvi: $(ORIG_FILES)
rm -f $(TEXI_FILES) rm -f $(TEXI_FILES)

View file

@ -65,8 +65,9 @@ It requires the Display Ghostscript System version
@value{GNUSTEP-GUI-LIBTIFF}. @value{GNUSTEP-GUI-LIBTIFF}.
It also requires a FoundationKit library as specified by the OpenStep It also requires a FoundationKit library as specified by the OpenStep
specification. The FoundationKit library known to work is the GNUstep specification. The FoundationKit libraries known to work are the GNUstep
Base Library version @samp{@value{GNUSTEP-GUI-BASE}}. 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 The @samp{.tar} file is compressed with GNU gzip. Gzip can be obtained by
anonymous ftp at any of the GNU archive sites. anonymous ftp at any of the GNU archive sites.

View file

@ -105,8 +105,9 @@ It requires the Display Ghostscript System version
@value{GNUSTEP-GUI-LIBTIFF}. @value{GNUSTEP-GUI-LIBTIFF}.
It also requires a FoundationKit library as specified by the OpenStep It also requires a FoundationKit library as specified by the OpenStep
specification. The FoundationKit library known to work is the GNUstep specification. The FoundationKit libraries known to work are the GNUstep
Base Library version @samp{@value{GNUSTEP-GUI-BASE}}. 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 The @samp{.tar} file is compressed with GNU gzip. Gzip can be obtained by
anonymous ftp at any of the GNU archive sites. anonymous ftp at any of the GNU archive sites.

View file

@ -30,10 +30,10 @@ Install @samp{gcc}. The library requires gcc version
@value{GNUSTEP-GUI-GCC} or later. @value{GNUSTEP-GUI-GCC} or later.
@item @item
Install @samp{gnustep-base}. This library requires the classes in Install @samp{gnustep-base} or @samp{libFoundation}. This library requires the
the GNUstep Base Library. You must also apply the Objective-C classes either in the GNUstep Base Library or libFoundation. You must also
Runtime patches to GCC which makes the runtime thread-safe, if apply the Objective-C Runtime patches to GCC which makes the runtime
your version of GCC lacks them. thread-safe, if your version of GCC lacks them.
@item @item
Install the @samp{TIFF} library. This library requires the header files Install the @samp{TIFF} library. This library requires the header files

View file

@ -9,6 +9,48 @@
The currently released version of the library is @samp{@value{GNUSTEP-GUI-VERSION}}. 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} @section Noteworthy changes in version @samp{0.2.0}
@itemize @bullet @itemize @bullet
@ -56,10 +98,6 @@ Many bug fixes and minor enhancements.
@end itemize @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} @section Noteworthy changes in version @samp{0.1.1}
@itemize @bullet @itemize @bullet

View file

@ -5,7 +5,7 @@
@include version.texi @include version.texi
@end ifset @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: report is available at:
@example @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. methods are implemented; the only thing lacking is a test, if needed.
@item NSApplication:: [6] @item NSApplication:: [6]
The event handling is pretty good though it The event handling has been integrated with the NSRunLoop class.
does not take advantage of the NSRunLoop class. Many of the minor Many of the minor methods are implemented.
methods are implemented. No window ordering is being maintained, and No window ordering is being maintained, and
a number of the methods that perform operations on windows are a number of the methods that perform operations on windows are
empty. Modal loops are not implemented. empty. Modal loops are not implemented.
@ -138,7 +138,9 @@ Ghostscript System, but still requires additional work.
@item NSFontPanel:: [2] @item NSFontPanel:: [2]
May be usable with backend implementation. 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] @item NSFormCell:: [2]
@ -153,16 +155,19 @@ classes.
Additional implementation to the point where TIFF images can be Additional implementation to the point where TIFF images can be
displayed; requires sufficient backend implementation. displayed; requires sufficient backend implementation.
@item NSMatrix:: [6] @item NSMatrix:: [9]
Many methods are implemented but more thorough testing needs to be done. 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] @item NSMenu:: [10]
Implementation was removed until a more efficient mechanism can be The class is complete now, all the logic is here, the backend needs to
devised. The OpenStep specification has changed regarding this class. 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] @item NSMenuItem:: [10]
Almost complete implementation; actual ability to use depends upon The logic is here, but needs support for drawing the cell in the backend. Also
backend implementation. take a look to the XDPS backend to see how this works.
@item NSOpenPanel:: [6] @item NSOpenPanel:: [6]
Usability greatly depends upon backend implementation. Usability greatly depends upon backend implementation.
@ -176,7 +181,10 @@ Usability greatly depends upon backend implementation.
@item NSPopUpButton:: [4] @item NSPopUpButton:: [4]
Usability greatly depends upon backend implementation. 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] @item NSPrintinfo:: [2]

7
FAQ
View file

@ -76,7 +76,7 @@ is available at:
5. Where can I get a copy? 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'. `ftp.gnustep.org' in `pub/gnustep'.
The program requires gcc 2.7.0 or higher. The program requires gcc 2.7.0 or higher.
@ -85,8 +85,9 @@ is available at:
TIFF Graphics library version 3.4. TIFF Graphics library version 3.4.
It also requires a FoundationKit library as specified by the It also requires a FoundationKit library as specified by the
OpenStep specification. The FoundationKit library known to work OpenStep specification. The FoundationKit libraries known to work
is the GNUstep Base Library version `0.2.12'. 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 The `.tar' file is compressed with GNU gzip. Gzip can be obtained
by anonymous ftp at any of the GNU archive sites. by anonymous ftp at any of the GNU archive sites.

View file

@ -105,7 +105,7 @@
#include <AppKit/NSImageRep.h> #include <AppKit/NSImageRep.h>
#include <AppKit/NSMatrix.h> #include <AppKit/NSMatrix.h>
#include <AppKit/NSMenu.h> #include <AppKit/NSMenu.h>
#include <AppKit/NSMenuCell.h> #include <AppKit/NSMenuItem.h>
#include <AppKit/NSNibLoading.h> #include <AppKit/NSNibLoading.h>
#include <AppKit/NSOpenPanel.h> #include <AppKit/NSOpenPanel.h>
#include <AppKit/NSPageLayout.h> #include <AppKit/NSPageLayout.h>

View file

@ -43,7 +43,7 @@
@class NSEvent; @class NSEvent;
@class NSPasteboard; @class NSPasteboard;
@class NSMenu; @class NSMenu;
@class NSMenuCell; @class NSMenuItem;
@class NSImage; @class NSImage;
@class NSWindow; @class NSWindow;
@class NSDPSContext; @class NSDPSContext;
@ -72,7 +72,7 @@ extern NSString *NSEventTrackingRunLoopMode;
id delegate; id delegate;
int window_count; int window_count;
NSMenu *main_menu; NSMenu *main_menu;
NSMenuCell *windows_menu; NSMenuItem *windows_menu;
unsigned int current_mod; unsigned int current_mod;
BOOL app_is_running; BOOL app_is_running;
BOOL app_should_quit; BOOL app_should_quit;

View file

@ -267,6 +267,7 @@ enum {
- (void)setContinuous:(BOOL)flag; - (void)setContinuous:(BOOL)flag;
- (void)setTarget:(id)anObject; - (void)setTarget:(id)anObject;
- (id)target; - (id)target;
- (void)performClick:(id)sender;
// //
// Assigning a Tag // Assigning a Tag

View file

@ -1,13 +1,11 @@
/* /*
NSMenu.h NSMenu.h
The menu class
Here is your menu sir, our specials today are...
Copyright (C) 1996 Free Software Foundation, Inc. Copyright (C) 1996 Free Software Foundation, Inc.
Author: Scott Christley <scottc@net-community.com> Author: Ovidiu Predescu <ovidiu@net-community.com>
Date: 1996 Date: May 1997
A completely rewritten version of the original source by Scott Christley.
This file is part of the GNUstep GUI Library. This file is part of the GNUstep GUI Library.
@ -30,97 +28,128 @@
#ifndef _GNUstep_H_NSMenu #ifndef _GNUstep_H_NSMenu
#define _GNUstep_H_NSMenu #define _GNUstep_H_NSMenu
#include <Foundation/NSCoder.h> #include <AppKit/NSMenuItem.h>
#include <Foundation/NSGeometry.h> #include <AppKit/NSControl.h>
@class NSString; @class NSString;
@class NSArray; @class NSEvent;
@class NSMutableArray;
@class NSMatrix; @class NSMatrix;
@class NSMenuCell;
@interface NSMenu : NSObject <NSCoding> @class NSMenuMatrix;
@interface NSMenu : NSObject <NSCoding, NSCopying>
{ {
// Attributes NSString* title;
NSString *window_title; NSMenuMatrix* menuCells;
NSMutableArray *menu_items; NSMenu* supermenu;
NSMenu *super_menu; NSMenu* attachedMenu;
BOOL autoenables_items; BOOL autoenablesItems;
NSMatrix *menu_matrix; BOOL menuChangedMessagesEnabled;
BOOL is_torn_off; BOOL menuHasChanged;
// Reserved for back-end use // Reserved for back-end use
void *be_menu_reserved; void *be_menu_reserved;
} }
// /* Controlling allocation zones */
// Controlling Allocation Zones + (void)setMenuZone:(NSZone*)zone;
// + (NSZone*)menuZone;
+ (NSZone *)menuZone;
+ (void)setMenuZone:(NSZone *)zone;
// /* Setting the menu cell class */
// Initializing a New NSMenu + (void)setCellClass:(Class)aClass;
// + (Class)cellClass;
- (id)initWithTitle:(NSString *)aTitle;
// /* Initializing a new NSMenu */
// Setting Up the Menu Commands - (id)initWithTitle:(NSString*)aTitle;
//
- (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;
// /* Setting up the menu commands */
// Finding Menu Items - (id <NSMenuItem>)addItemWithTitle:(NSString*)aString
// action:(SEL)aSelector
- (id)cellWithTag:(int)aTag; 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;
// /* Finding menu items */
// Building Submenus - (id <NSMenuItem>)itemWithTag:(int)aTag;
// - (id <NSMenuItem>)itemWithTitle:(NSString*)aString;
- (NSMenuCell *)setSubmenu:(NSMenu *)aMenu
forItem:(NSMenuCell *)aCell; /* Managing submenus */
- (void)setSubmenu:(NSMenu*)aMenu forItem:(id <NSMenuItem>)anItem;
- (void)submenuAction:(id)sender; - (void)submenuAction:(id)sender;
- (NSMenu*)attachedMenu;
//
// Managing NSMenu Windows
//
- (NSMenu *)attachedMenu;
- (BOOL)isAttached; - (BOOL)isAttached;
- (BOOL)isTornOff; - (BOOL)isTornOff;
- (NSPoint)locationForSubmenu:(NSMenu *)aSubmenu; - (NSPoint)locationForSubmenu:(NSMenu*)aSubmenu;
- (void)sizeToFit; - (NSMenu*)supermenu;
- (NSMenu *)supermenu;
// /* Enabling and disabling menu items */
// Displaying the Menu
//
- (BOOL)autoenablesItems;
- (void)setAutoenablesItems:(BOOL)flag; - (void)setAutoenablesItems:(BOOL)flag;
- (BOOL)autoenablesItems;
- (void)update;
// /* Perform a menu item action (not an OpenStep method) */
// NSCoding protocol - (void)performActionForItem:(id <NSMenuItem>)anItem;
//
- (void)encodeWithCoder:aCoder; /* Handling keyboard equivalents */
- initWithCoder:aDecoder; - (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 @end
@interface NSObject (NSMenuActionResponder)
// @interface NSObject (NSMenuActionResponder)
// Updating NSMenuCells - (BOOL)validateMenuItem:(NSMenuItem*)aMenuItem;
// @end
- (BOOL)validateCell:(id)aCell;
@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 @end

View file

@ -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

View 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

View file

@ -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

View file

@ -3,10 +3,10 @@
Class representing a printer's or printer model's capabilities. 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> Authors: Simon Frankau <sgf@frankau.demon.co.uk>
Date: 1996 Date: June 1997
This file is part of the GNUstep GUI Library. This file is part of the GNUstep GUI Library.
@ -29,12 +29,13 @@
#ifndef _GNUstep_H_NSPrinter #ifndef _GNUstep_H_NSPrinter
#define _GNUstep_H_NSPrinter #define _GNUstep_H_NSPrinter
#include <gnustep/gui/config.h>
#include <Foundation/NSCoder.h> #include <Foundation/NSCoder.h>
#include <Foundation/NSGeometry.h>
@class NSString; @class NSString;
@class NSArray; @class NSArray;
@class NSDictionary; @class NSDictionary;
@class NSMutableDictionary;
typedef enum _NSPrinterTableStatus { typedef enum _NSPrinterTableStatus {
NSPrinterTableOK, NSPrinterTableOK,
@ -44,7 +45,14 @@ typedef enum _NSPrinterTableStatus {
@interface NSPrinter : NSObject <NSCoding> @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;
} }
// //

View file

@ -91,6 +91,7 @@ extern NSSize NSTokenSize;
BOOL is_one_shot; BOOL is_one_shot;
BOOL needs_display; BOOL needs_display;
BOOL needs_flush;
BOOL is_autodisplay; BOOL is_autodisplay;
BOOL optimize_drawing; BOOL optimize_drawing;
BOOL views_need_display; BOOL views_need_display;
@ -394,6 +395,10 @@ extern NSSize NSTokenSize;
- (void)encodeWithCoder:aCoder; - (void)encodeWithCoder:aCoder;
- initWithCoder:aDecoder; - initWithCoder:aDecoder;
// Private methods
- (void)_setNeedsFlush:(BOOL)flag;
- (BOOL)_needsFlush;
@end @end
// //
@ -401,6 +406,8 @@ extern NSSize NSTokenSize;
// //
@interface NSWindow (GNUstepBackend) @interface NSWindow (GNUstepBackend)
+ (NSWindow*)windowWithNumber:(int)windowNumber;
// //
// Mouse capture/release // Mouse capture/release
// //

10
INSTALL
View file

@ -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 may copy, distribute, and modify it freely as long as you preserve this
copyright notice and permission notice. 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' Installing `gnustep-gui'
======================== ========================
@ -21,10 +21,10 @@ Installing `gnustep-gui'
1. Install `gcc'. The library requires gcc version 2.7.0 or later. 1. Install `gcc'. The library requires gcc version 2.7.0 or later.
2. Install `gnustep-base'. This library requires the classes in the 2. Install `gnustep-base' or `libFoundation'. This library requires
GNUstep Base Library. You must also apply the Objective-C Runtime the classes either in the GNUstep Base Library or libFoundation.
patches to GCC which makes the runtime thread-safe, if your You must also apply the Objective-C Runtime patches to GCC which
version of GCC lacks them. makes the runtime thread-safe, if your version of GCC lacks them.
3. Install the `TIFF' library. This library requires the header files 3. Install the `TIFF' library. This library requires the header files
in the TIFF library to compile; the TIFF library is used for the in the TIFF library to compile; the TIFF library is used for the

View file

@ -51,8 +51,13 @@ common_ArrowDown.tiff \
common_ArrowUp.tiff \ common_ArrowUp.tiff \
common_ArrowRight.tiff \ common_ArrowRight.tiff \
common_ArrowLeft.tiff \ common_ArrowLeft.tiff \
common_Close.tiff \
common_CloseH.tiff \
common_CloseBroken.tiff \
common_RadioOn.tiff \ common_RadioOn.tiff \
common_RadioOff.tiff \ common_RadioOff.tiff \
common_Right.tiff \
common_RightH.tiff \
common_SwitchOn.tiff \ common_SwitchOn.tiff \
common_SwitchOff.tiff \ common_SwitchOff.tiff \
common_Dimple.tiff \ common_Dimple.tiff \

BIN
Images/common_Close.tiff Normal file

Binary file not shown.

Binary file not shown.

BIN
Images/common_CloseH.tiff Normal file

Binary file not shown.

BIN
Images/common_Right.tiff Normal file

Binary file not shown.

BIN
Images/common_RightH.tiff Normal file

Binary file not shown.

33
NEWS
View file

@ -1,7 +1,38 @@
NEWS 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' Noteworthy changes in version `0.2.0'
===================================== =====================================

2
README
View file

@ -1,7 +1,7 @@
README 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: Here is some introductory info to get you started:

45
STATUS
View file

@ -1,7 +1,7 @@
Status Report 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: report is available at:
`http://www.gnustep.org/Documentation/gnustep-gui/gnustep-gui_toc.html' `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. implemented; the only thing lacking is a test, if needed.
*NSApplication:: [6]* *NSApplication:: [6]*
The event handling is pretty good though it does not take The event handling has been integrated with the NSRunLoop class.
advantage of the NSRunLoop class. Many of the minor methods are Many of the minor methods are implemented. No window ordering is
implemented. No window ordering is being maintained, and a number being maintained, and a number of the methods that perform
of the methods that perform operations on windows are empty. operations on windows are empty. Modal loops are not implemented.
Modal loops are not implemented.
*NSBitmapImageRep:: [4]* *NSBitmapImageRep:: [4]*
Implementation has been filled out enough so that TIFF images can Implementation has been filled out enough so that TIFF images can
@ -124,7 +123,10 @@ Classes
*NSFontPanel:: [2]* *NSFontPanel:: [2]*
May be usable with backend implementation. 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]* *NSFormCell:: [2]*
*NSHelpPanel:: [2]* *NSHelpPanel:: [2]*
*NSImage:: [8]* *NSImage:: [8]*
@ -136,18 +138,21 @@ Classes
Additional implementation to the point where TIFF images can be Additional implementation to the point where TIFF images can be
displayed; requires sufficient backend implementation. displayed; requires sufficient backend implementation.
*NSMatrix:: [6]* *NSMatrix:: [9]*
Many methods are implemented but more thorough testing needs to be The class is almost completely implemented, only the methods that
done. deal with text selection and moving from a text field to another
using TAB and SHIFT-TAB are empty.
*NSMenu:: [2]* *NSMenu:: [10]*
Implementation was removed until a more efficient mechanism can be The class is complete now, all the logic is here, the backend
devised. The OpenStep specification has changed regarding this needs to write only the code that deals with displaying the menu
class. windows on screen. For an example of how this is achieved take a
look to the XDPS backend.
*NSMenuCell:: [8]* *NSMenuItem:: [10]*
Almost complete implementation; actual ability to use depends upon The logic is here, but needs support for drawing the cell in the
backend implementation. backend. Also take a look to the XDPS backend to see how this
works.
*NSOpenPanel:: [6]* *NSOpenPanel:: [6]*
Usability greatly depends upon backend implementation. Usability greatly depends upon backend implementation.
@ -158,7 +163,11 @@ Classes
*NSPopUpButton:: [4]* *NSPopUpButton:: [4]*
Usability greatly depends upon backend implementation. 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]* *NSPrintinfo:: [2]*
*NSPrintOperation:: [2]* *NSPrintOperation:: [2]*
*NSPrintPanel:: [2]* *NSPrintPanel:: [2]*

View file

@ -125,7 +125,7 @@ gui/NSImage.h \
gui/NSImageRep.h \ gui/NSImageRep.h \
gui/NSMatrix.h \ gui/NSMatrix.h \
gui/NSMenu.h \ gui/NSMenu.h \
gui/NSMenuCell.h \ gui/NSMenuItem.h \
gui/NSNibLoading.h \ gui/NSNibLoading.h \
gui/NSOpenPanel.h \ gui/NSOpenPanel.h \
gui/NSPageLayout.h \ gui/NSPageLayout.h \
@ -201,7 +201,7 @@ NSImage$(oext) \
NSImageRep$(oext) \ NSImageRep$(oext) \
NSMatrix$(oext) \ NSMatrix$(oext) \
NSMenu$(oext) \ NSMenu$(oext) \
NSMenuCell$(oext) \ NSMenuItem$(oext) \
NSOpenPanel$(oext) \ NSOpenPanel$(oext) \
NSPageLayout$(oext) \ NSPageLayout$(oext) \
NSPanel$(oext) \ NSPanel$(oext) \

View file

@ -31,6 +31,8 @@
#include <Foundation/NSArray.h> #include <Foundation/NSArray.h>
#include <Foundation/NSNotification.h> #include <Foundation/NSNotification.h>
#include <Foundation/NSRunLoop.h> #include <Foundation/NSRunLoop.h>
#include <Foundation/NSAutoreleasePool.h>
#include <DPSClient/NSDPSContext.h> #include <DPSClient/NSDPSContext.h>
#include <AppKit/NSApplication.h> #include <AppKit/NSApplication.h>
#include <AppKit/NSPopUpButton.h> #include <AppKit/NSPopUpButton.h>
@ -38,7 +40,7 @@
#include <AppKit/NSEvent.h> #include <AppKit/NSEvent.h>
#include <AppKit/NSImage.h> #include <AppKit/NSImage.h>
#include <AppKit/NSMenu.h> #include <AppKit/NSMenu.h>
#include <AppKit/NSMenuCell.h> #include <AppKit/NSMenuItem.h>
#include <AppKit/NSCursor.h> #include <AppKit/NSCursor.h>
// //
@ -264,6 +266,7 @@ NSString *NSApplicationWillUpdateNotification = @"ApplicationWillUpdate";
- (void)run - (void)run
{ {
NSEvent *e; NSEvent *e;
NSAutoreleasePool* pool;
NSDebugLog(@"NSApplication -run\n"); NSDebugLog(@"NSApplication -run\n");
@ -274,6 +277,7 @@ NSString *NSApplicationWillUpdateNotification = @"ApplicationWillUpdate";
do do
{ {
pool = [NSAutoreleasePool new];
e = [self nextEventMatchingMask:NSAnyEventMask e = [self nextEventMatchingMask:NSAnyEventMask
untilDate:[NSDate distantFuture] untilDate:[NSDate distantFuture]
inMode:NSDefaultRunLoopMode dequeue:YES]; inMode:NSDefaultRunLoopMode dequeue:YES];
@ -285,6 +289,7 @@ NSString *NSApplicationWillUpdateNotification = @"ApplicationWillUpdate";
// Call the back-end method to handle it // Call the back-end method to handle it
[self handleNullEvent]; [self handleNullEvent];
} }
[pool release];
} while (!app_should_quit); } while (!app_should_quit);
app_is_running = YES; 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 - (NSEvent *)nextEventMatchingMask:(unsigned int)mask
untilDate:(NSDate *)expiration untilDate:(NSDate *)expiration
inMode:(NSString *)mode inMode:(NSString *)mode
dequeue:(BOOL)flag dequeue:(BOOL)flag
{ {
NSEvent *e; NSRunLoop* currentLoop = [NSRunLoop currentRunLoop];
BOOL done; NSEventType type;
int i, j; NSEvent *event;
BOOL done = NO;
// If the queue isn't empty then check those messages event = [self _eventMatchingMask:mask];
if ([event_queue count]) if (event)
{ done = YES;
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];
}
}
}
// Not in queue so wait for next event // Not in queue so wait for next event
done = NO; while (!done) {
while (!done) NSDate* limitDate = [currentLoop limitDateForMode:mode];
{
#if USE_RUN_LOOP
NSRunLoop* currentLoop = [NSRunLoop currentRunLoop];
NSDate* limitDate = [currentLoop limitDateForMode:mode];
if (!expiration) /* -limitDateForMode: can fire timers and timer events can be quueued in
expiration = [NSDate distantFuture]; events queue so check for them. */
event = [self _eventMatchingMask:mask];
if (event)
break;
if (limitDate) if (!expiration)
limitDate = [expiration earlierDate:limitDate]; expiration = [NSDate distantFuture];
else
limitDate = expiration;
// NSLog (@"calling runMode:beforeDate:"); if (limitDate)
[currentLoop runMode:mode beforeDate:limitDate]; limitDate = [expiration earlierDate:limitDate];
// NSLog (@"return from runMode:beforeDate:"); else
#else limitDate = expiration;
e = [self getNextEvent];
#endif
if ([event_queue count]) { [currentLoop runMode:mode beforeDate:limitDate];
e = [[event_queue lastObject] retain];
// Check mask event = [self _eventMatchingMask:mask];
if ([self event: e matchMask: mask]) if (event)
{ done = YES;
if (e) }
{
[event_queue removeObject: e]; type = [event type];
}
done = YES;
}
}
}
// Unhide the cursor if necessary // Unhide the cursor if necessary
// but only if its not a null event // 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 // Only if we should unhide when mouse moves
if ([NSCursor isHiddenUntilMouseMoves]) if ([NSCursor isHiddenUntilMouseMoves])
{ {
// Make sure the event is a mouse event before unhiding // Make sure the event is a mouse event before unhiding
type = [e type];
if ((type == NSLeftMouseDown) || (type == NSLeftMouseUp) if ((type == NSLeftMouseDown) || (type == NSLeftMouseUp)
|| (type == NSRightMouseDown) || (type == NSRightMouseUp) || (type == NSRightMouseDown) || (type == NSRightMouseUp)
|| (type == NSMouseMoved)) || (type == NSMouseMoved))
@ -525,8 +524,7 @@ NSString *NSApplicationWillUpdateNotification = @"ApplicationWillUpdate";
} }
} }
[self setCurrentEvent: e]; return event;
return [e autorelease];
} }
- (NSEvent *)peekEventMatchingMask:(unsigned int)mask - (NSEvent *)peekEventMatchingMask:(unsigned int)mask
@ -810,13 +808,13 @@ NSString *NSApplicationWillUpdateNotification = @"ApplicationWillUpdate";
- (void)setMainMenu:(NSMenu *)aMenu - (void)setMainMenu:(NSMenu *)aMenu
{ {
int i, j; int i, j;
NSMenuCell *mc; NSMenuItem *mc;
NSArray *mi; NSArray *mi;
// Release old and retain new // Release old and retain new
[aMenu retain];
[main_menu release]; [main_menu release];
main_menu = aMenu; main_menu = aMenu;
[main_menu retain];
// Search for a menucell with the name Windows // Search for a menucell with the name Windows
// This is the default windows menu // This is the default windows menu
@ -897,8 +895,8 @@ NSString *NSApplicationWillUpdateNotification = @"ApplicationWillUpdate";
- (void)setWindowsMenu:aMenu - (void)setWindowsMenu:aMenu
{ {
if (windows_menu) // if (windows_menu)
[windows_menu setSubmenu:aMenu]; // [windows_menu setSubmenu:aMenu];
} }
- (void)updateWindowsItem:aWindow - (void)updateWindowsItem:aWindow
@ -907,7 +905,8 @@ NSString *NSApplicationWillUpdateNotification = @"ApplicationWillUpdate";
- (NSMenu *)windowsMenu - (NSMenu *)windowsMenu
{ {
return [windows_menu submenu]; // return [windows_menu submenu];
return nil;
} }
// //

View file

@ -132,6 +132,7 @@
[contents release]; [contents release];
[cell_image release]; [cell_image release];
[cell_font release]; [cell_font release];
[represented_object release];
[super dealloc]; [super dealloc];
} }
@ -223,6 +224,7 @@
[anImage retain]; [anImage retain];
[cell_image release]; [cell_image release];
cell_image = anImage; cell_image = anImage;
[self setType:NSImageCellType];
} }
// //
@ -254,6 +256,7 @@
[contents release]; [contents release];
contents = [[number stringValue] retain]; contents = [[number stringValue] retain];
[self setType:NSTextCellType];
} }
- (void)setFloatValue:(float)aFloat - (void)setFloatValue:(float)aFloat
@ -262,6 +265,7 @@
[contents release]; [contents release];
contents = [[number stringValue] retain]; contents = [[number stringValue] retain];
[self setType:NSTextCellType];
} }
- (void)setIntValue:(int)anInt - (void)setIntValue:(int)anInt
@ -270,6 +274,7 @@
[contents release]; [contents release];
contents = [[number stringValue] retain]; contents = [[number stringValue] retain];
[self setType:NSTextCellType];
} }
- (void)setStringValue:(NSString *)aString - (void)setStringValue:(NSString *)aString
@ -537,6 +542,10 @@
return nil; return nil;
} }
- (void)performClick:(id)sender
{
}
// //
// Assigning a Tag // Assigning a Tag
// //
@ -730,11 +739,15 @@
// //
- (id)representedObject - (id)representedObject
{ {
return nil; return represented_object;
} }
- (void)setRepresentedObject:(id)anObject - (void)setRepresentedObject:(id)anObject
{} {
[anObject retain];
[represented_object release];
represented_object = anObject;
}
- (id)copyWithZone:(NSZone*)zone - (id)copyWithZone:(NSZone*)zone
{ {
@ -761,7 +774,7 @@
[c setEntryType:entry_type]; [c setEntryType:entry_type];
c->control_view = control_view; c->control_view = control_view;
c->cell_size = cell_size; c->cell_size = cell_size;
c->represented_object = [represented_object retain]; [c setRepresentedObject:represented_object];
return c; return c;
} }

View file

@ -37,6 +37,7 @@
#include <AppKit/NSEvent.h> #include <AppKit/NSEvent.h>
#include <AppKit/NSApplication.h> #include <AppKit/NSApplication.h>
#include <AppKit/NSWindow.h>
@implementation NSEvent @implementation NSEvent
@ -435,9 +436,7 @@ static NSRecursiveLock* timersLock = nil;
- (NSWindow *)window - (NSWindow *)window
{ {
NSApplication *theApp = [NSApplication sharedApplication]; return [NSWindow windowWithNumber:window_num];
return [theApp windowWithWindowNumber:window_num];
} }
- (int)windowNumber - (int)windowNumber

View file

@ -69,6 +69,13 @@ static NSFont* getFont(NSString* key, NSString* defaultFontName, float fontSize)
if (!fontName) if (!fontName)
fontName = defaultFontName; fontName = defaultFontName;
if (!fontSize) {
fontSize = [[NSUserDefaults standardUserDefaults]
floatForKey:[NSString stringWithFormat:@"%@Size", key]];
if (!fontSize)
fontSize = 12;
}
return [NSFont fontWithName:fontName size:fontSize]; return [NSFont fontWithName:fontName size:fontSize];
} }

View file

@ -108,6 +108,7 @@ set_repd_for_rep(NSMutableArray *_reps, NSImageRep *rep, rep_data_t *new_repd)
[_reps replaceObjectAtIndex: i withObject: [_reps replaceObjectAtIndex: i withObject:
[NSValue value: new_repd withObjCType: @encode(rep_data_t)]]; [NSValue value: new_repd withObjCType: @encode(rep_data_t)]];
found = YES; found = YES;
break;
} }
} }
if (!found) if (!found)
@ -217,7 +218,8 @@ set_repd_for_rep(NSMutableArray *_reps, NSImageRep *rep, rep_data_t *new_repd)
if ([path length] != 0) if ([path length] != 0)
{ {
NSImage* image = [[NSImage alloc] initByReferencingFile:path]; NSImage* image = [[[NSImage alloc] initByReferencingFile:path]
autorelease];
if (image) if (image)
[image setName: [[path lastPathComponent] [image setName: [[path lastPathComponent]
stringByDeletingPathExtension]]; stringByDeletingPathExtension]];
@ -325,12 +327,15 @@ set_repd_for_rep(NSMutableArray *_reps, NSImageRep *rep, rep_data_t *new_repd)
NSImage* copy; NSImage* copy;
// FIXME: maybe we should retain if _flags.dataRetained = NO // FIXME: maybe we should retain if _flags.dataRetained = NO
copy = (NSImage*)NSAllocateObject (isa, 0, zone); copy = (NSImage*)NSCopyObject (self, 0, zone);
[name retain]; [name retain];
copy->_reps = [NSMutableArray new];
copy->_repList = [NSMutableArray new];
[_color retain]; [_color retain];
_lockedView = nil; _lockedView = nil;
[copy addRepresentations: [[self representations] copyWithZone: zone]]; [copy addRepresentations: [[[self representations] copyWithZone: zone]
autorelease]];
return copy; 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++) for (i = 0; i < count; i++)
{ {
repd.fileName = NULL; repd.fileName = NULL;
repd.rep = [imageRepArray objectAtIndex: i]; repd.rep = [[imageRepArray objectAtIndex: i] retain];
repd.cache = NULL; repd.cache = NULL;
repd.original = NULL; repd.original = NULL;
repd.validCache = NO; repd.validCache = NO;

View file

@ -32,6 +32,8 @@
#include <Foundation/NSValue.h> #include <Foundation/NSValue.h>
#include <Foundation/NSArray.h> #include <Foundation/NSArray.h>
#include <Foundation/NSAutoreleasePool.h>
#include <AppKit/NSColor.h> #include <AppKit/NSColor.h>
#include <AppKit/NSActionCell.h> #include <AppKit/NSActionCell.h>
#include <AppKit/NSWindow.h> #include <AppKit/NSWindow.h>
@ -960,11 +962,15 @@ static int mouseDownFlags = 0;
- (void)sizeToCells - (void)sizeToCells
{ {
NSSize newSize; NSSize newSize;
int nc = numCols;
int nr = numRows;
newSize.width = numCols * (cellSize.width + intercell.width) if (!nc)
- intercell.width; nc = 1;
newSize.height = numRows * (cellSize.height + intercell.height) if (!nr)
- intercell.height; nr = 1;
newSize.width = nc * (cellSize.width + intercell.width) - intercell.width;
newSize.height = nr * (cellSize.height + intercell.height) - intercell.height;
[self setFrameSize:newSize]; [self setFrameSize:newSize];
} }
@ -1155,7 +1161,8 @@ static int mouseDownFlags = 0;
mouseDownFlags = [theEvent modifierFlags]; mouseDownFlags = [theEvent modifierFlags];
lastLocation = [self convertPoint:lastLocation fromView:nil]; 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); ASSIGN(lastEvent, theEvent);
[self lockFocus]; [self lockFocus];
@ -1325,7 +1332,8 @@ static int mouseDownFlags = 0;
[[self window] flushWindow]; [[self window] flushWindow];
[self unlockFocus]; [self unlockFocus];
[NSEvent stopPeriodicEvents]; if (mode != NSTrackModeMatrix)
[NSEvent stopPeriodicEvents];
[lastEvent release]; [lastEvent release];
} }
@ -1548,10 +1556,10 @@ static int mouseDownFlags = 0;
last:(MPoint)last last:(MPoint)last
current:(MPoint)current current:(MPoint)current
{ {
/* We use an imaginar coordinate system whose center is the `anchor' point. We /* We use an imaginar coordinate system whose center is the `anchor' point.
should determine in which quadrants are located the `last' and the `current' We should determine in which quadrants are located the `last' and the
points. Based on this we extend the selection to the rectangle determined `current' points. Based on this we extend the selection to the rectangle
by `anchor' and `current' points. determined by `anchor' and `current' points.
The algorithm uses two rectangles: one determined by `anchor' and The algorithm uses two rectangles: one determined by `anchor' and
`current' that defines how the final selection rectangle will look, 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 @end

View file

@ -1,12 +1,11 @@
/* /*
NSMenu.m NSMenu.m
The menu class
Copyright (C) 1996 Free Software Foundation, Inc. Copyright (C) 1996 Free Software Foundation, Inc.
Author: Scott Christley <scottc@net-community.com> Author: Ovidiu Predescu <ovidiu@net-community.com>
Date: 1996 Date: May 1997
A completely rewritten version of the original source by Scott Christley.
This file is part of the GNUstep GUI Library. This file is part of the GNUstep GUI Library.
@ -26,267 +25,710 @@
59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/ */
#include <Foundation/NSLock.h>
#include <Foundation/NSCoder.h> #include <Foundation/NSCoder.h>
#include <Foundation/NSArray.h> #include <Foundation/NSArray.h>
#include <AppKit/NSMenu.h> #include <Foundation/NSProcessInfo.h>
#include <AppKit/NSMenuCell.h>
#include <AppKit/NSMenuPrivate.h>
#include <AppKit/NSApplication.h>
#include <AppKit/NSMatrix.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 @interface NSMenu (PrivateMethods2)
// - (void)_menuChanged;
+ (void)initialize @end
@implementation NSMenuMatrix
// Class variables
static NSFont* menuFont = nil;
- initWithFrame:(NSRect)rect
{ {
if (self == [NSMenu class]) [super initWithFrame:rect];
{ cells = [NSMutableArray new];
// Initial version
[self setVersion:2];
}
}
// /* Don't initialize menuFont in +initialize since we don't know if the
// Controlling Allocation Zones DGS process knows anything about the fonts yet. */
// if (!menuFont)
+ (NSZone *)menuZone menuFont = [[NSFont systemFontOfSize:0] retain];
{
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];
cellSize = NSMakeSize (1, [menuFont pointSize] - [menuFont descender] + 4);
return self; return self;
} }
// - (void)dealloc
// Setting Up the Menu Commands
//
- (id)addItemWithTitle:(NSString *)aString
action:(SEL)aSelector
keyEquivalent:(NSString *)charCode
{ {
NSMenuCell *m; NSDebugLog (@"NSMenuMatrix of menu '%@' dealloc", [menu title]);
m = [[NSMenuCell alloc] initTextCell:aString]; [cells release];
[m setAction:aSelector]; [super dealloc];
[menu_items addObject:m];
return m;
} }
- (id)insertItemWithTitle:(NSString *)aString - (id)copyWithZone:(NSZone*)zone
action:(SEL)aSelector
keyEquivalent:(NSString *)charCode
atIndex:(unsigned int)index
{ {
NSMenuCell *m; NSMenuMatrix* copy = NSAllocateObject (isa, 0, zone);
int i, count;
m = [[NSMenuCell alloc] initTextCell:aString]; NSDebugLog (@"copy menu matrix of menu with title '%@'", [menu title]);
[m setAction:aSelector]; copy->cells = [[NSMutableArray alloc] initWithCapacity:[cells count]];
[menu_items insertObject:m atIndex:index]; 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];
} }
// - (NSArray*)itemArray { return cells; }
// Finding Menu Items
// - (id <NSMenuItem>)itemWithTitle:(NSString*)aString
- (id)cellWithTag:(int)aTag
{ {
int i, j; int i, count = [cells count];
NSMenuCell *m, *found; id menuCell;
// Recursively find the menu cell with the tag for (i = 0; i < count; i++) {
found = nil; menuCell = [cells objectAtIndex:i];
j = [menu_items count]; if ([[menuCell title] isEqual:aString])
for (i = 0;i < j; ++i) return menuCell;
{ }
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;
}
}
return nil; return nil;
} }
- (void)submenuAction:(id)sender - (id <NSMenuItem>)itemWithTag:(int)aTag
{}
//
// Managing NSMenu Windows
//
- (NSMenu *)attachedMenu
{ {
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; 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 - (BOOL)isAttached
{ {
return !is_torn_off; return supermenu && [supermenu attachedMenu] == self;
} }
- (BOOL)isTornOff - (BOOL)isTornOff
{ {
return is_torn_off; // SUBCLASS
return NO;
} }
- (NSPoint)locationForSubmenu:(NSMenu *)aSubmenu - (NSPoint)locationForSubmenu:(NSMenu*)aSubmenu
{ {
// SUBCLASS
return NSZeroPoint; return NSZeroPoint;
} }
- (void)sizeToFit - (NSMenu*)supermenu
{}
- (NSMenu *)supermenu
{ {
return super_menu; return supermenu;
}
//
// Displaying the Menu
//
- (BOOL)autoenablesItems
{
return autoenables_items;
} }
- (void)setAutoenablesItems:(BOOL)flag - (void)setAutoenablesItems:(BOOL)flag
{ {
autoenables_items = flag; autoenablesItems = flag;
} }
// - (BOOL)autoenablesItems
// NSCoding protocol
//
- (void)encodeWithCoder:aCoder
{ {
[aCoder encodeObject: menu_items]; return autoenablesItems;
// 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];
} }
- initWithCoder:aDecoder - (void)update
{ {
menu_items = [aDecoder decodeObject]; // SUBCLASS to redisplay the menu
// Version 2 id cells;
window_title = [aDecoder decodeObject]; int i, count;
#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];
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; return self;
} }
@end - (void)encodeWithCoder:(NSCoder*)aCoder
@implementation NSMenu (GNUstepPrivate)
- (void)setSupermenu:(NSMenu *)obj
{ {
super_menu = obj;
} }
@end /* NSMenu */
@implementation NSMenu (PrivateMethods2)
- (void)_menuChanged
{
menuHasChanged = YES;
if (menuChangedMessagesEnabled)
[self sizeToFit];
}
@end @end

View file

@ -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
View 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

View file

@ -153,13 +153,13 @@ NSString *NSViewFocusChangedNotification = @"NSViewFocusChangedNotification";
bounds.size = frame.size; bounds.size = frame.size;
// Initialize subview list // Initialize subview list
sub_views = [NSMutableArray array]; sub_views = [NSMutableArray new];
// Initialize tracking rectangle list // Initialize tracking rectangle list
tracking_rects = [NSMutableArray array]; tracking_rects = [NSMutableArray new];
// Initialize cursor rect list // Initialize cursor rect list
cursor_rects = [NSMutableArray array]; cursor_rects = [NSMutableArray new];
super_view = nil; super_view = nil;
window = nil; window = nil;
@ -177,26 +177,9 @@ NSString *NSViewFocusChangedNotification = @"NSViewFocusChangedNotification";
- (void)dealloc - (void)dealloc
{ {
int i, j; [sub_views release];
[tracking_rects release];
//NSArray doesn't know -removeAllObjects yet [cursor_rects release];
//[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];
[super dealloc]; [super dealloc];
} }
@ -224,9 +207,6 @@ NSString *NSViewFocusChangedNotification = @"NSViewFocusChangedNotification";
return; return;
} }
// retain the object
[aView retain];
// Add to our subview list // Add to our subview list
[sub_views addObject:(id)aView]; [sub_views addObject:(id)aView];
[aView setSuperview:self]; [aView setSuperview:self];
@ -246,9 +226,6 @@ NSString *NSViewFocusChangedNotification = @"NSViewFocusChangedNotification";
if (![aView isKindOfClass:[NSView class]]) return; if (![aView isKindOfClass:[NSView class]]) return;
#endif #endif
// retain the object
[aView retain];
// Add to our subview list // Add to our subview list
[sub_views addObject:(id)aView]; [sub_views addObject:(id)aView];
[aView setSuperview:self]; [aView setSuperview:self];
@ -314,52 +291,22 @@ NSString *NSViewFocusChangedNotification = @"NSViewFocusChangedNotification";
- (void)removeFromSuperview - (void)removeFromSuperview
{ {
int i, j; NSMutableArray *views;
NSMutableArray *v;
// No superview then just return // No superview then just return
if (!super_view) return; if (!super_view) return;
v = [super_view subviews]; views = [super_view subviews];
j = [v count]; [views removeObjectIdenticalTo:self];
for (i = 0;i < j; ++i)
{
if ([v objectAtIndex:i] == self)
[v removeObjectAtIndex:i];
}
} }
- (void)replaceSubview:(NSView *)oldView - (void)replaceSubview:(NSView *)oldView
with:(NSView *)newView with:(NSView *)newView
{ {
int i, j; int index = [sub_views indexOfObjectIdenticalTo:oldView];
NSView *v;
// Not a NSView --then forget it if (index != NSNotFound)
// xxx but NSView will really be the backend class [sub_views replaceObjectAtIndex:index withObject:newView];
// 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];
}
} }
- (void)sortSubviewsUsingFunction:(int (*)(id ,id ,void *))compare - (void)sortSubviewsUsingFunction:(int (*)(id ,id ,void *))compare
@ -378,14 +325,6 @@ NSString *NSViewFocusChangedNotification = @"NSViewFocusChangedNotification";
- (void)setSuperview:(NSView *)superview - (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; super_view = superview;
} }
@ -400,16 +339,13 @@ NSString *NSViewFocusChangedNotification = @"NSViewFocusChangedNotification";
- (void)viewWillMoveToWindow:(NSWindow *)newWindow - (void)viewWillMoveToWindow:(NSWindow *)newWindow
{ {
int i, j; int i, count;
// not a window --then forget it
// if (![newWindow isKindOfClass:[NSWindow class]]) return;
window = newWindow; window = newWindow;
// Pass new window down to subviews // Pass new window down to subviews
j = [sub_views count]; count = [sub_views count];
for (i = 0;i < j; ++i) for (i = 0; i < count; ++i)
[[sub_views objectAtIndex:i] viewWillMoveToWindow:newWindow]; [[sub_views objectAtIndex:i] viewWillMoveToWindow:newWindow];
} }
@ -900,8 +836,9 @@ NSString *NSViewFocusChangedNotification = @"NSViewFocusChangedNotification";
{ {
TrackingRectangle *m; TrackingRectangle *m;
m = [[TrackingRectangle alloc] initWithRect: aRect tag: 0 owner: anObject m = [[[TrackingRectangle alloc] initWithRect: aRect tag: 0 owner: anObject
userData: NULL inside: YES]; userData: NULL inside: YES]
autorelease];
[cursor_rects addObject:m]; [cursor_rects addObject:m];
} }
@ -916,21 +853,18 @@ NSString *NSViewFocusChangedNotification = @"NSViewFocusChangedNotification";
id e = [cursor_rects objectEnumerator]; id e = [cursor_rects objectEnumerator];
TrackingRectangle *o; TrackingRectangle *o;
NSCursor *c; NSCursor *c;
BOOL found = NO;
// Base remove test upon cursor object // Base remove test upon cursor object
o = [e nextObject]; o = [e nextObject];
while (o && (!found)) while (o) {
{ c = [o owner];
c = [o owner]; if (c == anObject) {
if (c == anObject) [cursor_rects removeObject: o];
found = YES; break;
else
o = [e nextObject];
} }
else
if (found) o = [e nextObject];
[cursor_rects removeObject: o]; }
} }
- (void)resetCursorRects - (void)resetCursorRects
@ -951,13 +885,15 @@ NSString *NSViewFocusChangedNotification = @"NSViewFocusChangedNotification";
- (id)viewWithTag:(int)aTag - (id)viewWithTag:(int)aTag
{ {
int i, j; int i, count;
j = [sub_views count]; count = [sub_views count];
for (i = 0;i < j; ++i) for (i = 0; i < count; ++i)
{ {
if ([[sub_views objectAtIndex:i] tag] == aTag) id view = [sub_views objectAtIndex:i];
return [sub_views objectAtIndex:i];
if ([view tag] == aTag)
return view;
} }
return nil; return nil;
} }
@ -1062,8 +998,9 @@ NSString *NSViewFocusChangedNotification = @"NSViewFocusChangedNotification";
} }
++t; ++t;
m = [[TrackingRectangle alloc] initWithRect:aRect tag:t owner:anObject m = [[[TrackingRectangle alloc] initWithRect:aRect tag:t owner:anObject
userData:data inside:flag]; userData:data inside:flag]
autorelease];
[tracking_rects addObject:m]; [tracking_rects addObject:m];
return t; return t;

View file

@ -30,8 +30,10 @@
#include <Foundation/NSCoder.h> #include <Foundation/NSCoder.h>
#include <Foundation/NSArray.h> #include <Foundation/NSArray.h>
#include <Foundation/NSNotification.h> #include <Foundation/NSNotification.h>
#include <AppKit/NSWindow.h> #include <AppKit/NSWindow.h>
#include <AppKit/NSApplication.h> #include <AppKit/NSApplication.h>
#include <AppKit/NSImage.h>
#include <AppKit/NSTextFieldCell.h> #include <AppKit/NSTextFieldCell.h>
#include <AppKit/NSTextField.h> #include <AppKit/NSTextField.h>
#include <AppKit/NSColor.h> #include <AppKit/NSColor.h>
@ -56,6 +58,11 @@ NSString *NSWindowWillCloseNotification = @"WindowWillClose";
NSString *NSWindowWillMiniaturizeNotification = @"WindowWillMiniaturize"; NSString *NSWindowWillMiniaturizeNotification = @"WindowWillMiniaturize";
NSString *NSWindowWillMoveNotification = @"WindowWillMove"; NSString *NSWindowWillMoveNotification = @"WindowWillMove";
#define ASSIGN(variable, value) \
[value retain]; \
[variable release]; \
variable = value;
// //
// NSWindow implementation // NSWindow implementation
// //
@ -125,17 +132,15 @@ NSString *NSWindowWillMoveNotification = @"WindowWillMove";
- (void)dealloc - (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 // Release the content view
NSDebugLog(@"Release content view\n");
if (content_view) [content_view release]; 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]; [super dealloc];
} }
@ -160,6 +165,7 @@ NSString *NSWindowWillMoveNotification = @"WindowWillMove";
{ {
NSApplication *theApp = [NSApplication sharedApplication]; NSApplication *theApp = [NSApplication sharedApplication];
NSRect r = [[NSScreen mainScreen] frame]; NSRect r = [[NSScreen mainScreen] frame];
NSRect cframe;
NSDebugLog(@"NSWindow default initializer\n"); NSDebugLog(@"NSWindow default initializer\n");
if (!theApp) if (!theApp)
@ -186,7 +192,9 @@ NSString *NSWindowWillMoveNotification = @"WindowWillMove";
cursor_rects_valid = NO; cursor_rects_valid = NO;
// Create our content view // 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 // Register ourselves with the Application object
[theApp addWindowsItem:self title:window_title filename:NO]; [theApp addWindowsItem:self title:window_title filename:NO];
@ -205,22 +213,14 @@ NSString *NSWindowWillMoveNotification = @"WindowWillMove";
- (void)setContentView:(NSView *)aView - (void)setContentView:(NSView *)aView
{ {
// Not an NSView -then forget it
if (![aView isKindOfClass:[NSView class]])
return;
// Release current content view
if (content_view) if (content_view)
{ [content_view viewWillMoveToWindow:nil];
// Tell view it is no longer in a window
[content_view viewWillMoveToWindow:nil]; ASSIGN(content_view, aView);
[content_view release];
}
content_view = aView;
[content_view retain];
// Tell the view its changing windows // Tell the view its changing windows
[content_view viewWillMoveToWindow:self]; [content_view viewWillMoveToWindow:self];
// Make us the view's next responder // Make us the view's next responder
[content_view setNextResponder:self]; [content_view setNextResponder:self];
} }
@ -240,17 +240,17 @@ NSString *NSWindowWillMoveNotification = @"WindowWillMove";
- (void)setBackgroundColor:(NSColor *)color - (void)setBackgroundColor:(NSColor *)color
{ {
background_color = color; ASSIGN(background_color, color);
} }
- (void)setRepresentedFilename:(NSString *)aString - (void)setRepresentedFilename:(NSString *)aString
{ {
represented_filename = aString; ASSIGN(represented_filename, aString);
} }
- (void)setTitle:(NSString *)aString - (void)setTitle:(NSString *)aString
{ {
window_title = aString; ASSIGN(window_title, aString);
} }
- (void)setTitleWithRepresentedFilename:(NSString *)aString - (void)setTitleWithRepresentedFilename:(NSString *)aString
@ -327,12 +327,12 @@ NSString *NSWindowWillMoveNotification = @"WindowWillMove";
- (void)setMiniwindowImage:(NSImage *)image - (void)setMiniwindowImage:(NSImage *)image
{ {
miniaturized_image = image; ASSIGN(miniaturized_image, image);
} }
- (void)setMiniwindowTitle:(NSString *)title; - (void)setMiniwindowTitle:(NSString *)title;
{ {
miniaturized_title = title; ASSIGN(miniaturized_title, title);
} }
// //
@ -469,7 +469,7 @@ NSString *NSWindowWillMoveNotification = @"WindowWillMove";
- (void)orderOut:sender - (void)orderOut:sender
{ {
visible = YES; visible = NO;
} }
- (void)orderWindow:(NSWindowOrderingMode)place - (void)orderWindow:(NSWindowOrderingMode)place
@ -636,7 +636,7 @@ NSString *NSWindowWillMoveNotification = @"WindowWillMove";
- (void)flushWindowIfNeeded - (void)flushWindowIfNeeded
{ {
if (!disable_flush_window) if (!disable_flush_window && needs_flush)
[self flushWindow]; [self flushWindow];
} }
@ -1344,6 +1344,9 @@ NSString *NSWindowWillMoveNotification = @"WindowWillMove";
- (void)print:sender - (void)print:sender
{} {}
- (void)_setNeedsFlush:(BOOL)flag { needs_flush = flag; }
- (BOOL)_needsFlush { return needs_flush; }
// //
// Assigning a delegate // Assigning a delegate
// //
@ -1577,6 +1580,11 @@ NSString *NSWindowWillMoveNotification = @"WindowWillMove";
// //
@implementation NSWindow (GNUstepBackend) @implementation NSWindow (GNUstepBackend)
+ (NSWindow*)windowWithNumber:(int)windowNumber
{
return nil;
}
// //
// Mouse capture/release // Mouse capture/release
// //
@ -1598,7 +1606,7 @@ NSString *NSWindowWillMoveNotification = @"WindowWillMove";
original_responder = nil; original_responder = nil;
delegate = nil; delegate = nil;
window_num = 0; window_num = 0;
background_color = [NSColor lightGrayColor]; background_color = [[NSColor lightGrayColor] retain];
represented_filename = @"Window"; represented_filename = @"Window";
miniaturized_title = @"Window"; miniaturized_title = @"Window";
miniaturized_image = nil; miniaturized_image = nil;

View file

@ -5,13 +5,14 @@ GNUSTEP_GUI_GCC = 2.7.0
# Versions for libraries that gnustep-gui is dependent upon # Versions for libraries that gnustep-gui is dependent upon
GNUSTEP_GUI_BASE = 0.2.12 GNUSTEP_GUI_BASE = 0.2.12
LIB_FOUNDATION = 0.7.1
GNUSTEP_GUI_LIBTIFF = 3.4 GNUSTEP_GUI_LIBTIFF = 3.4
GNUSTEP_GUI_DGS = 0.2.0 GNUSTEP_GUI_DGS = 0.2.0
GNUSTEP_GUI_DPSCLIENT = 6.1 GNUSTEP_GUI_DPSCLIENT = 6.1
# The version number of this release. # The version number of this release.
GNUSTEP_GUI_MAJOR_VERSION = 0 GNUSTEP_GUI_MAJOR_VERSION = 0
GNUSTEP_GUI_MINOR_VERSION = 2 GNUSTEP_GUI_MINOR_VERSION = 3
GNUSTEP_GUI_SUBMINOR_VERSION = 0 GNUSTEP_GUI_SUBMINOR_VERSION = 0
GNUSTEP_GUI_VERSION = \ GNUSTEP_GUI_VERSION = \
$(GNUSTEP_GUI_MAJOR_VERSION).$(GNUSTEP_GUI_MINOR_VERSION).$(GNUSTEP_GUI_SUBMINOR_VERSION) $(GNUSTEP_GUI_MAJOR_VERSION).$(GNUSTEP_GUI_MINOR_VERSION).$(GNUSTEP_GUI_SUBMINOR_VERSION)

387
configure vendored
View file

@ -1,7 +1,7 @@
#! /bin/sh #! /bin/sh
# Guess values for system-dependent variables and create Makefiles. # 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. # Copyright (C) 1992, 93, 94, 95, 96 Free Software Foundation, Inc.
# #
# This configure script is free software; the Free Software Foundation # This configure script is free software; the Free Software Foundation
@ -49,6 +49,8 @@ mandir='${prefix}/man'
# Initialize some other variables. # Initialize some other variables.
subdirs= subdirs=
MFLAGS= MAKEFLAGS= MFLAGS= MAKEFLAGS=
# Maximum number of lines to put in a shell here document.
ac_max_here_lines=12
ac_prev= ac_prev=
for ac_option for ac_option
@ -330,7 +332,7 @@ EOF
verbose=yes ;; verbose=yes ;;
-version | --version | --versio | --versi | --vers) -version | --version | --versio | --versi | --vers)
echo "configure generated by autoconf version 2.10" echo "configure generated by autoconf version 2.12"
exit 0 ;; exit 0 ;;
-with-* | --with-*) -with-* | --with-*)
@ -432,11 +434,14 @@ do
done done
# NLS nuisances. # NLS nuisances.
# Only set LANG and LC_ALL to C if already set. # Only set these to C if already set. These must not be set unconditionally
# These must not be set unconditionally because not all systems understand # because not all systems understand e.g. LANG=C (notably SCO).
# e.g. LANG=C (notably SCO). # Fixing LC_MESSAGES prevents Solaris sh from translating var values in `set'!
if test "${LC_ALL+set}" = set; then LC_ALL=C; export LC_ALL; fi # Non-C LC_CTYPE values break the ctype check.
if test "${LANG+set}" = set; then LANG=C; export LANG; fi 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. # confdefs.h avoids OS command line length limits that DEFS can exceed.
rm -rf conftest* confdefs.h rm -rf conftest* confdefs.h
@ -498,6 +503,7 @@ ac_ext=c
ac_cpp='$CPP $CPPFLAGS' ac_cpp='$CPP $CPPFLAGS'
ac_compile='${CC-cc} -c $CFLAGS $CPPFLAGS conftest.$ac_ext 1>&5' 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' 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 if (echo "testing\c"; echo 1,2,3) | grep c >/dev/null; then
# Stardent Vistra SVR4 grep lacks -e, says ghazi@caip.rutgers.edu. # 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. # Extract the first word of "gcc", so it can be a program name with args.
set dummy gcc; ac_word=$2 set dummy gcc; ac_word=$2
echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 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 if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6 echo $ac_n "(cached) $ac_c" 1>&6
else 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. # Extract the first word of "cc", so it can be a program name with args.
set dummy cc; ac_word=$2 set dummy cc; ac_word=$2
echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 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 if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6 echo $ac_n "(cached) $ac_c" 1>&6
else else
@ -618,7 +626,47 @@ fi
test -z "$CC" && { echo "configure: error: no acceptable cc found in \$PATH" 1>&2; exit 1; } test -z "$CC" && { echo "configure: error: no acceptable cc found in \$PATH" 1>&2; exit 1; }
fi 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 $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 if eval "test \"`echo '$''{'ac_cv_prog_gcc'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6 echo $ac_n "(cached) $ac_c" 1>&6
else else
@ -627,7 +675,7 @@ else
yes; yes;
#endif #endif
EOF 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 ac_cv_prog_gcc=yes
else else
ac_cv_prog_gcc=no ac_cv_prog_gcc=no
@ -635,29 +683,34 @@ fi
fi fi
echo "$ac_t""$ac_cv_prog_gcc" 1>&6 echo "$ac_t""$ac_cv_prog_gcc" 1>&6
if test $ac_cv_prog_gcc = yes; then if test $ac_cv_prog_gcc = yes; then
GCC=yes GCC=yes
if test "${CFLAGS+set}" != set; then ac_test_CFLAGS="${CFLAGS+set}"
echo $ac_n "checking whether ${CC-cc} accepts -g""... $ac_c" 1>&6 ac_save_CFLAGS="$CFLAGS"
if eval "test \"`echo '$''{'ac_cv_prog_gcc_g'+set}'`\" = set"; then 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 echo $ac_n "(cached) $ac_c" 1>&6
else else
echo 'void f(){}' > conftest.c echo 'void f(){}' > conftest.c
if test -z "`${CC-cc} -g -c conftest.c 2>&1`"; then 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 else
ac_cv_prog_gcc_g=no ac_cv_prog_cc_g=no
fi fi
rm -f conftest* rm -f conftest*
fi fi
echo "$ac_t""$ac_cv_prog_gcc_g" 1>&6 echo "$ac_t""$ac_cv_prog_cc_g" 1>&6
if test $ac_cv_prog_gcc_g = yes; then if test "$ac_test_CFLAGS" = set; then
CFLAGS="-g -O" CFLAGS="$ac_save_CFLAGS"
else elif test $ac_cv_prog_cc_g = yes; then
CFLAGS="-O" CFLAGS="-g -O2"
fi else
CFLAGS="-O2"
fi fi
else else
GCC= GCC=
@ -665,6 +718,7 @@ else
fi fi
echo $ac_n "checking how to run the C preprocessor""... $ac_c" 1>&6 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. # On Suns, sometimes $CPP names a directory.
if test -n "$CPP" && test -d "$CPP"; then if test -n "$CPP" && test -d "$CPP"; then
CPP= CPP=
@ -679,33 +733,37 @@ else
# On the NeXT, cc -E runs the code through the compiler's parser, # On the NeXT, cc -E runs the code through the compiler's parser,
# not just through cpp. # not just through cpp.
cat > conftest.$ac_ext <<EOF cat > conftest.$ac_ext <<EOF
#line 683 "configure" #line 737 "configure"
#include "confdefs.h" #include "confdefs.h"
#include <assert.h> #include <assert.h>
Syntax Error Syntax Error
EOF EOF
ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" 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` ac_err=`grep -v '^ *+' conftest.out`
if test -z "$ac_err"; then if test -z "$ac_err"; then
: :
else else
echo "$ac_err" >&5 echo "$ac_err" >&5
echo "configure: failed program was:" >&5
cat conftest.$ac_ext >&5
rm -rf conftest* rm -rf conftest*
CPP="${CC-cc} -E -traditional-cpp" CPP="${CC-cc} -E -traditional-cpp"
cat > conftest.$ac_ext <<EOF cat > conftest.$ac_ext <<EOF
#line 698 "configure" #line 754 "configure"
#include "confdefs.h" #include "confdefs.h"
#include <assert.h> #include <assert.h>
Syntax Error Syntax Error
EOF EOF
ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" 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` ac_err=`grep -v '^ *+' conftest.out`
if test -z "$ac_err"; then if test -z "$ac_err"; then
: :
else else
echo "$ac_err" >&5 echo "$ac_err" >&5
echo "configure: failed program was:" >&5
cat conftest.$ac_ext >&5
rm -rf conftest* rm -rf conftest*
CPP=/lib/cpp CPP=/lib/cpp
fi 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" # SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff"
# ./install, which can be erroneously created by make from ./install.sh. # ./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 $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 test -z "$INSTALL"; then
if eval "test \"`echo '$''{'ac_cv_path_install'+set}'`\" = set"; then if eval "test \"`echo '$''{'ac_cv_path_install'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6 echo $ac_n "(cached) $ac_c" 1>&6
else else
IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}:" IFS="${IFS= }"; ac_save_IFS="$IFS"; IFS="${IFS}:"
for ac_dir in $PATH; do for ac_dir in $PATH; do
# Account for people who put trailing slashes in PATH elements. # Account for people who put trailing slashes in PATH elements.
case "$ac_dir/" in case "$ac_dir/" in
@ -781,7 +840,7 @@ else
;; ;;
esac esac
done done
IFS="$ac_save_ifs" IFS="$ac_save_IFS"
fi fi
if test "${ac_cv_path_install+set}" = set; then 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. # Extract the first word of "ranlib", so it can be a program name with args.
set dummy ranlib; ac_word=$2 set dummy ranlib; ac_word=$2
echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 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 if eval "test \"`echo '$''{'ac_cv_prog_RANLIB'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6 echo $ac_n "(cached) $ac_c" 1>&6
else else
@ -831,6 +891,7 @@ else
fi fi
echo $ac_n "checking whether ln -s works""... $ac_c" 1>&6 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 if eval "test \"`echo '$''{'ac_cv_prog_LN_S'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6 echo $ac_n "(cached) $ac_c" 1>&6
else else
@ -859,38 +920,13 @@ fi
#-------------------------------------------------------------------- #--------------------------------------------------------------------
# Standard ANSI headers # 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 $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 if eval "test \"`echo '$''{'ac_cv_header_stdc'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6 echo $ac_n "(cached) $ac_c" 1>&6
else else
cat > conftest.$ac_ext <<EOF cat > conftest.$ac_ext <<EOF
#line 894 "configure" #line 930 "configure"
#include "confdefs.h" #include "confdefs.h"
#include <stdlib.h> #include <stdlib.h>
#include <stdarg.h> #include <stdarg.h>
@ -898,13 +934,15 @@ else
#include <float.h> #include <float.h>
EOF EOF
ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" 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` ac_err=`grep -v '^ *+' conftest.out`
if test -z "$ac_err"; then if test -z "$ac_err"; then
rm -rf conftest* rm -rf conftest*
ac_cv_header_stdc=yes ac_cv_header_stdc=yes
else else
echo "$ac_err" >&5 echo "$ac_err" >&5
echo "configure: failed program was:" >&5
cat conftest.$ac_ext >&5
rm -rf conftest* rm -rf conftest*
ac_cv_header_stdc=no ac_cv_header_stdc=no
fi fi
@ -913,7 +951,7 @@ rm -f conftest*
if test $ac_cv_header_stdc = yes; then if test $ac_cv_header_stdc = yes; then
# SunOS 4.x string.h does not declare mem*, contrary to ANSI. # SunOS 4.x string.h does not declare mem*, contrary to ANSI.
cat > conftest.$ac_ext <<EOF cat > conftest.$ac_ext <<EOF
#line 917 "configure" #line 955 "configure"
#include "confdefs.h" #include "confdefs.h"
#include <string.h> #include <string.h>
EOF EOF
@ -931,7 +969,7 @@ fi
if test $ac_cv_header_stdc = yes; then if test $ac_cv_header_stdc = yes; then
# ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI. # ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI.
cat > conftest.$ac_ext <<EOF cat > conftest.$ac_ext <<EOF
#line 935 "configure" #line 973 "configure"
#include "confdefs.h" #include "confdefs.h"
#include <stdlib.h> #include <stdlib.h>
EOF EOF
@ -951,8 +989,8 @@ if test $ac_cv_header_stdc = yes; then
if test "$cross_compiling" = yes; then if test "$cross_compiling" = yes; then
: :
else else
cat > conftest.$ac_ext <<EOF cat > conftest.$ac_ext <<EOF
#line 956 "configure" #line 994 "configure"
#include "confdefs.h" #include "confdefs.h"
#include <ctype.h> #include <ctype.h>
#define ISLOWER(c) ('a' <= (c) && (c) <= 'z') #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); } exit (0); }
EOF EOF
{ (eval echo configure:967: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } if { (eval echo configure:1005: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null
if test -s conftest && (./conftest; exit) 2>/dev/null; then then
: :
else else
echo "configure: failed program was:" >&5
cat conftest.$ac_ext >&5
rm -fr conftest*
ac_cv_header_stdc=no ac_cv_header_stdc=no
fi fi
fi
rm -fr conftest* rm -fr conftest*
fi
fi fi
fi fi
@ -988,24 +1030,27 @@ fi
#-------------------------------------------------------------------- #--------------------------------------------------------------------
for ac_hdr in tiff.h for ac_hdr in tiff.h
do 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 $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 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6 echo $ac_n "(cached) $ac_c" 1>&6
else else
cat > conftest.$ac_ext <<EOF cat > conftest.$ac_ext <<EOF
#line 998 "configure" #line 1041 "configure"
#include "confdefs.h" #include "confdefs.h"
#include <$ac_hdr> #include <$ac_hdr>
EOF EOF
ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" 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` ac_err=`grep -v '^ *+' conftest.out`
if test -z "$ac_err"; then if test -z "$ac_err"; then
rm -rf conftest* rm -rf conftest*
eval "ac_cv_header_$ac_safe=yes" eval "ac_cv_header_$ac_safe=yes"
else else
echo "$ac_err" >&5 echo "$ac_err" >&5
echo "configure: failed program was:" >&5
cat conftest.$ac_ext >&5
rm -rf conftest* rm -rf conftest*
eval "ac_cv_header_$ac_safe=no" eval "ac_cv_header_$ac_safe=no"
fi fi
@ -1013,7 +1058,7 @@ rm -f conftest*
fi fi
if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
echo "$ac_t""yes" 1>&6 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 cat >> confdefs.h <<EOF
#define $ac_tr_hdr 1 #define $ac_tr_hdr 1
EOF EOF
@ -1040,24 +1085,27 @@ fi
#-------------------------------------------------------------------- #--------------------------------------------------------------------
for ac_hdr in DPS/dpsclient.h for ac_hdr in DPS/dpsclient.h
do 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 $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 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6 echo $ac_n "(cached) $ac_c" 1>&6
else else
cat > conftest.$ac_ext <<EOF cat > conftest.$ac_ext <<EOF
#line 1050 "configure" #line 1096 "configure"
#include "confdefs.h" #include "confdefs.h"
#include <$ac_hdr> #include <$ac_hdr>
EOF EOF
ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" 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` ac_err=`grep -v '^ *+' conftest.out`
if test -z "$ac_err"; then if test -z "$ac_err"; then
rm -rf conftest* rm -rf conftest*
eval "ac_cv_header_$ac_safe=yes" eval "ac_cv_header_$ac_safe=yes"
else else
echo "$ac_err" >&5 echo "$ac_err" >&5
echo "configure: failed program was:" >&5
cat conftest.$ac_ext >&5
rm -rf conftest* rm -rf conftest*
eval "ac_cv_header_$ac_safe=no" eval "ac_cv_header_$ac_safe=no"
fi fi
@ -1065,7 +1113,7 @@ rm -f conftest*
fi fi
if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
echo "$ac_t""yes" 1>&6 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 cat >> confdefs.h <<EOF
#define $ac_tr_hdr 1 #define $ac_tr_hdr 1
EOF EOF
@ -1099,30 +1147,32 @@ config_include=''
# Checking for some additional libraries we might need # Checking for some additional libraries we might need
echo $ac_n "checking for -ldl""... $ac_c" 1>&6 echo $ac_n "checking for dlopen in -ldl""... $ac_c" 1>&6
ac_lib_var=`echo dl'_'dlopen | tr './+\055' '__p_'` 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 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6 echo $ac_n "(cached) $ac_c" 1>&6
else else
ac_save_LIBS="$LIBS" ac_save_LIBS="$LIBS"
LIBS="-ldl $LIBS" LIBS="-ldl $LIBS"
cat > conftest.$ac_ext <<EOF cat > conftest.$ac_ext <<EOF
#line 1111 "configure" #line 1160 "configure"
#include "confdefs.h" #include "confdefs.h"
/* Override any gcc2 internal prototype to avoid an error. */ /* Override any gcc2 internal prototype to avoid an error. */
/* We use char because int might match the return type of a gcc2 /* We use char because int might match the return type of a gcc2
builtin and then its argument prototype would still apply. */ builtin and then its argument prototype would still apply. */
char dlopen(); char dlopen();
int main() { return 0; } int main() {
int t() {
dlopen() dlopen()
; return 0; } ; return 0; }
EOF 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* rm -rf conftest*
eval "ac_cv_lib_$ac_lib_var=yes" eval "ac_cv_lib_$ac_lib_var=yes"
else else
echo "configure: failed program was:" >&5
cat conftest.$ac_ext >&5
rm -rf conftest* rm -rf conftest*
eval "ac_cv_lib_$ac_lib_var=no" eval "ac_cv_lib_$ac_lib_var=no"
fi fi
@ -1132,7 +1182,8 @@ LIBS="$ac_save_LIBS"
fi fi
if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
echo "$ac_t""yes" 1>&6 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 cat >> confdefs.h <<EOF
#define $ac_tr_lib 1 #define $ac_tr_lib 1
EOF EOF
@ -1143,30 +1194,32 @@ else
echo "$ac_t""no" 1>&6 echo "$ac_t""no" 1>&6
fi fi
echo $ac_n "checking for -lpthread""... $ac_c" 1>&6 echo $ac_n "checking for pthread_create in -lpthread""... $ac_c" 1>&6
ac_lib_var=`echo pthread'_'pthread_create | tr './+\055' '__p_'` 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 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6 echo $ac_n "(cached) $ac_c" 1>&6
else else
ac_save_LIBS="$LIBS" ac_save_LIBS="$LIBS"
LIBS="-lpthread $LIBS" LIBS="-lpthread $LIBS"
cat > conftest.$ac_ext <<EOF cat > conftest.$ac_ext <<EOF
#line 1155 "configure" #line 1207 "configure"
#include "confdefs.h" #include "confdefs.h"
/* Override any gcc2 internal prototype to avoid an error. */ /* Override any gcc2 internal prototype to avoid an error. */
/* We use char because int might match the return type of a gcc2 /* We use char because int might match the return type of a gcc2
builtin and then its argument prototype would still apply. */ builtin and then its argument prototype would still apply. */
char pthread_create(); char pthread_create();
int main() { return 0; } int main() {
int t() {
pthread_create() pthread_create()
; return 0; } ; return 0; }
EOF 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* rm -rf conftest*
eval "ac_cv_lib_$ac_lib_var=yes" eval "ac_cv_lib_$ac_lib_var=yes"
else else
echo "configure: failed program was:" >&5
cat conftest.$ac_ext >&5
rm -rf conftest* rm -rf conftest*
eval "ac_cv_lib_$ac_lib_var=no" eval "ac_cv_lib_$ac_lib_var=no"
fi fi
@ -1176,7 +1229,8 @@ LIBS="$ac_save_LIBS"
fi fi
if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
echo "$ac_t""yes" 1>&6 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 cat >> confdefs.h <<EOF
#define $ac_tr_lib 1 #define $ac_tr_lib 1
EOF EOF
@ -1187,30 +1241,32 @@ else
echo "$ac_t""no" 1>&6 echo "$ac_t""no" 1>&6
fi fi
echo $ac_n "checking for -lm""... $ac_c" 1>&6 echo $ac_n "checking for sqrt in -lm""... $ac_c" 1>&6
ac_lib_var=`echo m'_'sqrt | tr './+\055' '__p_'` 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 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6 echo $ac_n "(cached) $ac_c" 1>&6
else else
ac_save_LIBS="$LIBS" ac_save_LIBS="$LIBS"
LIBS="-lm $LIBS" LIBS="-lm $LIBS"
cat > conftest.$ac_ext <<EOF cat > conftest.$ac_ext <<EOF
#line 1199 "configure" #line 1254 "configure"
#include "confdefs.h" #include "confdefs.h"
/* Override any gcc2 internal prototype to avoid an error. */ /* Override any gcc2 internal prototype to avoid an error. */
/* We use char because int might match the return type of a gcc2 /* We use char because int might match the return type of a gcc2
builtin and then its argument prototype would still apply. */ builtin and then its argument prototype would still apply. */
char sqrt(); char sqrt();
int main() { return 0; } int main() {
int t() {
sqrt() sqrt()
; return 0; } ; return 0; }
EOF 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* rm -rf conftest*
eval "ac_cv_lib_$ac_lib_var=yes" eval "ac_cv_lib_$ac_lib_var=yes"
else else
echo "configure: failed program was:" >&5
cat conftest.$ac_ext >&5
rm -rf conftest* rm -rf conftest*
eval "ac_cv_lib_$ac_lib_var=no" eval "ac_cv_lib_$ac_lib_var=no"
fi fi
@ -1220,7 +1276,8 @@ LIBS="$ac_save_LIBS"
fi fi
if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
echo "$ac_t""yes" 1>&6 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 cat >> confdefs.h <<EOF
#define $ac_tr_lib 1 #define $ac_tr_lib 1
EOF EOF
@ -1233,7 +1290,9 @@ fi
# Determine the Foundation library # Determine the Foundation library
echo $ac_n "checking for the Foundation library""... $ac_c" 1>&6 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 if eval "test \"`echo '$''{'ac_cv_foundation_library'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6 echo $ac_n "(cached) $ac_c" 1>&6
else 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' 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 cat > conftest.$ac_ext <<EOF
#line 1248 "configure" #line 1307 "configure"
#include "confdefs.h" #include "confdefs.h"
#include <Foundation/preface.h> #include <Foundation/preface.h>
int main() { return 0; } int main() {
int t() {
; return 0; } ; return 0; }
EOF 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* rm -rf conftest*
ac_cv_foundation_library="$ac_cv_foundation_library gnustep-base" ac_cv_foundation_library="$ac_cv_foundation_library gnustep-base"
else
echo "configure: failed program was:" >&5
cat conftest.$ac_ext >&5
fi fi
rm -f conftest* rm -f conftest*
cat > conftest.$ac_ext <<EOF cat > conftest.$ac_ext <<EOF
#line 1264 "configure" #line 1324 "configure"
#include "confdefs.h" #include "confdefs.h"
#include <Foundation/exceptions/FoundationException.h> #include <Foundation/exceptions/FoundationException.h>
int main() { return 0; } int main() {
int t() {
; return 0; } ; return 0; }
EOF 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* rm -rf conftest*
ac_cv_foundation_library="$ac_cv_foundation_library libFoundation" ac_cv_foundation_library="$ac_cv_foundation_library libFoundation"
else
echo "configure: failed program was:" >&5
cat conftest.$ac_ext >&5
fi fi
rm -f conftest* rm -f conftest*
cat > conftest.$ac_ext <<EOF cat > conftest.$ac_ext <<EOF
#line 1280 "configure" #line 1341 "configure"
#include "confdefs.h" #include "confdefs.h"
#include <objects/stdobjects.h> #include <objects/stdobjects.h>
int main() { return 0; } int main() {
int t() {
; return 0; } ; return 0; }
EOF 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* rm -rf conftest*
ac_cv_foundation_library="$ac_cv_foundation_library libobjects" ac_cv_foundation_library="$ac_cv_foundation_library libobjects"
else
echo "configure: failed program was:" >&5
cat conftest.$ac_ext >&5
fi fi
rm -f conftest* rm -f conftest*
ac_ext=c ac_ext=c
# CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options. # CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options.
ac_cpp='$CPP $CPPFLAGS' ac_cpp='$CPP $CPPFLAGS'
ac_compile='${CC-cc} -c $CFLAGS $CPPFLAGS conftest.$ac_ext 1>&5' 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' 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 if test "$FOUNDATION" = ""; then
cat > conftest.$ac_ext <<EOF cat > conftest.$ac_ext <<EOF
#line 1302 "configure" #line 1365 "configure"
#include "confdefs.h" #include "confdefs.h"
#include <foundation/NSObject.h> #include <foundation/NSObject.h>
EOF EOF
ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" 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` ac_err=`grep -v '^ *+' conftest.out`
if test -z "$ac_err"; then if test -z "$ac_err"; then
rm -rf conftest* rm -rf conftest*
ac_cv_foundation_library=foundation ac_cv_foundation_library=foundation
else else
echo "$ac_err" >&5 echo "$ac_err" >&5
echo "configure: failed program was:" >&5
cat conftest.$ac_ext >&5
fi fi
rm -f conftest* rm -f conftest*
else else
@ -1366,6 +1431,7 @@ EOF
esac esac
echo "$ac_t""${ac_cv_foundation_library}" 1>&6 echo "$ac_t""${ac_cv_foundation_library}" 1>&6
echo $ac_n "checking for the Objective-C runtime""... $ac_c" 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 if eval "test \"`echo '$''{'ac_cv_objc_runtime'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6 echo $ac_n "(cached) $ac_c" 1>&6
else 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' 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 cat > conftest.$ac_ext <<EOF
#line 1381 "configure" #line 1447 "configure"
#include "confdefs.h" #include "confdefs.h"
#include <Foundation/NSString.h> #include <Foundation/NSString.h>
int main() { return 0; } int main() {
int t() {
extern id objc_lookUpClass(char*); extern id objc_lookUpClass(char*);
id class = objc_lookUpClass("NSObject"); id class = objc_lookUpClass("NSObject");
id obj = [class alloc]; id obj = [class alloc];
@ -1389,46 +1454,48 @@ extern id objc_lookUpClass(char*);
; return 0; } ; return 0; }
EOF 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* rm -rf conftest*
ac_cv_objc_runtime=NeXT ac_cv_objc_runtime=NeXT
else else
echo "configure: failed program was:" >&5
cat conftest.$ac_ext >&5
rm -rf conftest* rm -rf conftest*
ac_cv_objc_runtime=unknown ac_cv_objc_runtime=unknown
fi fi
rm -f conftest* rm -f conftest*
if test $ac_cv_objc_runtime = unknown; then if test $ac_cv_objc_runtime = unknown; then
OBJC_RUNTIME_FLAG=-fgnu-runtime OBJC_RUNTIME_FLAG=-fgnu-runtime
LIBS="$LIBS -lobjc" LIBS="$LIBS -lobjc"
cat > conftest.$ac_ext <<EOF cat > conftest.$ac_ext <<EOF
#line 1406 "configure" #line 1472 "configure"
#include "confdefs.h" #include "confdefs.h"
#include <Foundation/NSString.h> #include <Foundation/NSString.h>
#include <objc/objc-api.h> #include <objc/objc-api.h>
int main() { return 0; } int main() {
int t() {
id class = objc_lookup_class("NSObject"); id class = objc_lookup_class("NSObject");
id obj = [class alloc]; id obj = [class alloc];
puts([[obj description] cString]); puts([[obj description] cString]);
; return 0; } ; return 0; }
EOF 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* rm -rf conftest*
ac_cv_objc_runtime=GNU ac_cv_objc_runtime=GNU
else else
echo "configure: failed program was:" >&5
cat conftest.$ac_ext >&5
rm -rf conftest* rm -rf conftest*
ac_cv_objc_runtime=unknown ac_cv_objc_runtime=unknown
fi fi
rm -f conftest* rm -f conftest*
fi fi
ac_ext=c ac_ext=c
# CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options. # CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options.
ac_cpp='$CPP $CPPFLAGS' ac_cpp='$CPP $CPPFLAGS'
ac_compile='${CC-cc} -c $CFLAGS $CPPFLAGS conftest.$ac_ext 1>&5' 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' ac_link='${CC-cc} -o conftest $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5'
cross_compiling=$ac_cv_prog_cc_cross
fi fi
@ -1485,11 +1552,25 @@ cat > confcache <<\EOF
# --recheck option to rerun configure. # --recheck option to rerun configure.
# #
EOF 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, # 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. # and sets the high bit in the cache file unless we assign to the vars.
(set) 2>&1 | (set) 2>&1 |
sed -n "s/^\([a-zA-Z0-9_]*_cv_[a-zA-Z0-9_]*\)=\(.*\)/\1=\${\1='\2'}/p" \ case `(ac_space=' '; set) 2>&1` in
>> confcache *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 if cmp -s $cache_file confcache; then
: :
else else
@ -1544,7 +1625,7 @@ do
echo "running \${CONFIG_SHELL-/bin/sh} $0 $ac_configure_args --no-create --no-recursion" 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 ;; exec \${CONFIG_SHELL-/bin/sh} $0 $ac_configure_args --no-create --no-recursion ;;
-version | --version | --versio | --versi | --vers | --ver | --ve | --v) -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 ;; exit 0 ;;
-help | --help | --hel | --he | --h) -help | --help | --hel | --he | --h)
echo "\$ac_cs_usage"; exit 0 ;; echo "\$ac_cs_usage"; exit 0 ;;
@ -1598,20 +1679,56 @@ s%@OBJC_RUNTIME_FLAG@%$OBJC_RUNTIME_FLAG%g
CEOF CEOF
EOF 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 cat >> $CONFIG_STATUS <<EOF
CONFIG_FILES=\${CONFIG_FILES-"Makefile Source/Makefile Testing/Makefile Documentation/Makefile Images/Makefile"} CONFIG_FILES=\${CONFIG_FILES-"Makefile Source/Makefile Testing/Makefile Documentation/Makefile Images/Makefile"}
EOF EOF
cat >> $CONFIG_STATUS <<\EOF cat >> $CONFIG_STATUS <<\EOF
for ac_file in .. $CONFIG_FILES; do if test "x$ac_file" != x..; then 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 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=`echo "$ac_file"|sed 's%:.*%%'` ;;
*) ac_file_in="${ac_file}.in" ;; *) ac_file_in="${ac_file}.in" ;;
esac 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. # Remove last slash and all that follows it. Not all systems have dirname.
ac_dir=`echo $ac_file|sed 's%/[^/][^/]*$%%'` 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_given_INSTALL" ;;
*) INSTALL="$ac_dots$ac_given_INSTALL" ;; *) INSTALL="$ac_dots$ac_given_INSTALL" ;;
esac esac
echo creating "$ac_file" echo creating "$ac_file"
rm -f "$ac_file" rm -f "$ac_file"
configure_input="Generated automatically from `echo $ac_file_in|sed 's%.*/%%'` by configure." 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" ;; # $configure_input" ;;
*) ac_comsub= ;; *) ac_comsub= ;;
esac esac
ac_file_inputs=`echo $ac_file_in|sed -e "s%^%$ac_given_srcdir/%" -e "s%:% $ac_given_srcdir/%g"`
sed -e "$ac_comsub sed -e "$ac_comsub
s%@configure_input@%$configure_input%g s%@configure_input@%$configure_input%g
s%@srcdir@%$srcdir%g s%@srcdir@%$srcdir%g
s%@top_srcdir@%$top_srcdir%g s%@top_srcdir@%$top_srcdir%g
s%@INSTALL@%$INSTALL%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 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 # 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. # 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_eC=' '
ac_eD='%g' 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 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 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=`echo "$ac_file"|sed 's%:.*%%'` ;;
*) ac_file_in="${ac_file}.in" ;; *) ac_file_in="${ac_file}.in" ;;
esac esac
@ -1687,7 +1813,8 @@ for ac_file in .. $CONFIG_HEADERS; do if test "x$ac_file" != x..; then
echo creating $ac_file echo creating $ac_file
rm -f conftest.frag conftest.in conftest.out 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 EOF
@ -1715,8 +1842,6 @@ EOF
# Break up conftest.vals because some shells have a limit on # Break up conftest.vals because some shells have a limit on
# the size of here documents, and old seds have small limits too. # 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 rm -f conftest.tail
while : while :
@ -1758,7 +1883,11 @@ cat >> $CONFIG_STATUS <<\EOF
fi fi
fi; done fi; done
EOF
cat >> $CONFIG_STATUS <<EOF
EOF
cat >> $CONFIG_STATUS <<\EOF
exit 0 exit 0
EOF EOF