NSSlider implemented. Optimizations in displaying and flushing mechanism. A bunch of memory allocation problems fixed.

git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gui/trunk@2494 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
Ovidiu Predescu 1997-10-09 22:55:31 +00:00
parent aee90a695e
commit 9837b14866
59 changed files with 1577 additions and 5103 deletions

339
COPYING
View file

@ -1,339 +0,0 @@
GNU GENERAL PUBLIC LICENSE
Version 2, June 1991
Copyright (C) 1989, 1991 Free Software Foundation, Inc.
59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
Everyone is permitted to copy and distribute verbatim copies
of this license document, but changing it is not allowed.
Preamble
The licenses for most software are designed to take away your
freedom to share and change it. By contrast, the GNU General Public
License is intended to guarantee your freedom to share and change free
software--to make sure the software is free for all its users. This
General Public License applies to most of the Free Software
Foundation's software and to any other program whose authors commit to
using it. (Some other Free Software Foundation software is covered by
the GNU Library General Public License instead.) You can apply it to
your programs, too.
When we speak of free software, we are referring to freedom, not
price. Our General Public Licenses are designed to make sure that you
have the freedom to distribute copies of free software (and charge for
this service if you wish), that you receive source code or can get it
if you want it, that you can change the software or use pieces of it
in new free programs; and that you know you can do these things.
To protect your rights, we need to make restrictions that forbid
anyone to deny you these rights or to ask you to surrender the rights.
These restrictions translate to certain responsibilities for you if you
distribute copies of the software, or if you modify it.
For example, if you distribute copies of such a program, whether
gratis or for a fee, you must give the recipients all the rights that
you have. You must make sure that they, too, receive or can get the
source code. And you must show them these terms so they know their
rights.
We protect your rights with two steps: (1) copyright the software, and
(2) offer you this license which gives you legal permission to copy,
distribute and/or modify the software.
Also, for each author's protection and ours, we want to make certain
that everyone understands that there is no warranty for this free
software. If the software is modified by someone else and passed on, we
want its recipients to know that what they have is not the original, so
that any problems introduced by others will not reflect on the original
authors' reputations.
Finally, any free program is threatened constantly by software
patents. We wish to avoid the danger that redistributors of a free
program will individually obtain patent licenses, in effect making the
program proprietary. To prevent this, we have made it clear that any
patent must be licensed for everyone's free use or not licensed at all.
The precise terms and conditions for copying, distribution and
modification follow.
GNU GENERAL PUBLIC LICENSE
TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
0. This License applies to any program or other work which contains
a notice placed by the copyright holder saying it may be distributed
under the terms of this General Public License. The "Program", below,
refers to any such program or work, and a "work based on the Program"
means either the Program or any derivative work under copyright law:
that is to say, a work containing the Program or a portion of it,
either verbatim or with modifications and/or translated into another
language. (Hereinafter, translation is included without limitation in
the term "modification".) Each licensee is addressed as "you".
Activities other than copying, distribution and modification are not
covered by this License; they are outside its scope. The act of
running the Program is not restricted, and the output from the Program
is covered only if its contents constitute a work based on the
Program (independent of having been made by running the Program).
Whether that is true depends on what the Program does.
1. You may copy and distribute verbatim copies of the Program's
source code as you receive it, in any medium, provided that you
conspicuously and appropriately publish on each copy an appropriate
copyright notice and disclaimer of warranty; keep intact all the
notices that refer to this License and to the absence of any warranty;
and give any other recipients of the Program a copy of this License
along with the Program.
You may charge a fee for the physical act of transferring a copy, and
you may at your option offer warranty protection in exchange for a fee.
2. You may modify your copy or copies of the Program or any portion
of it, thus forming a work based on the Program, and copy and
distribute such modifications or work under the terms of Section 1
above, provided that you also meet all of these conditions:
a) You must cause the modified files to carry prominent notices
stating that you changed the files and the date of any change.
b) You must cause any work that you distribute or publish, that in
whole or in part contains or is derived from the Program or any
part thereof, to be licensed as a whole at no charge to all third
parties under the terms of this License.
c) If the modified program normally reads commands interactively
when run, you must cause it, when started running for such
interactive use in the most ordinary way, to print or display an
announcement including an appropriate copyright notice and a
notice that there is no warranty (or else, saying that you provide
a warranty) and that users may redistribute the program under
these conditions, and telling the user how to view a copy of this
License. (Exception: if the Program itself is interactive but
does not normally print such an announcement, your work based on
the Program is not required to print an announcement.)
These requirements apply to the modified work as a whole. If
identifiable sections of that work are not derived from the Program,
and can be reasonably considered independent and separate works in
themselves, then this License, and its terms, do not apply to those
sections when you distribute them as separate works. But when you
distribute the same sections as part of a whole which is a work based
on the Program, the distribution of the whole must be on the terms of
this License, whose permissions for other licensees extend to the
entire whole, and thus to each and every part regardless of who wrote it.
Thus, it is not the intent of this section to claim rights or contest
your rights to work written entirely by you; rather, the intent is to
exercise the right to control the distribution of derivative or
collective works based on the Program.
In addition, mere aggregation of another work not based on the Program
with the Program (or with a work based on the Program) on a volume of
a storage or distribution medium does not bring the other work under
the scope of this License.
3. You may copy and distribute the Program (or a work based on it,
under Section 2) in object code or executable form under the terms of
Sections 1 and 2 above provided that you also do one of the following:
a) Accompany it with the complete corresponding machine-readable
source code, which must be distributed under the terms of Sections
1 and 2 above on a medium customarily used for software interchange; or,
b) Accompany it with a written offer, valid for at least three
years, to give any third party, for a charge no more than your
cost of physically performing source distribution, a complete
machine-readable copy of the corresponding source code, to be
distributed under the terms of Sections 1 and 2 above on a medium
customarily used for software interchange; or,
c) Accompany it with the information you received as to the offer
to distribute corresponding source code. (This alternative is
allowed only for noncommercial distribution and only if you
received the program in object code or executable form with such
an offer, in accord with Subsection b above.)
The source code for a work means the preferred form of the work for
making modifications to it. For an executable work, complete source
code means all the source code for all modules it contains, plus any
associated interface definition files, plus the scripts used to
control compilation and installation of the executable. However, as a
special exception, the source code distributed need not include
anything that is normally distributed (in either source or binary
form) with the major components (compiler, kernel, and so on) of the
operating system on which the executable runs, unless that component
itself accompanies the executable.
If distribution of executable or object code is made by offering
access to copy from a designated place, then offering equivalent
access to copy the source code from the same place counts as
distribution of the source code, even though third parties are not
compelled to copy the source along with the object code.
4. You may not copy, modify, sublicense, or distribute the Program
except as expressly provided under this License. Any attempt
otherwise to copy, modify, sublicense or distribute the Program is
void, and will automatically terminate your rights under this License.
However, parties who have received copies, or rights, from you under
this License will not have their licenses terminated so long as such
parties remain in full compliance.
5. You are not required to accept this License, since you have not
signed it. However, nothing else grants you permission to modify or
distribute the Program or its derivative works. These actions are
prohibited by law if you do not accept this License. Therefore, by
modifying or distributing the Program (or any work based on the
Program), you indicate your acceptance of this License to do so, and
all its terms and conditions for copying, distributing or modifying
the Program or works based on it.
6. Each time you redistribute the Program (or any work based on the
Program), the recipient automatically receives a license from the
original licensor to copy, distribute or modify the Program subject to
these terms and conditions. You may not impose any further
restrictions on the recipients' exercise of the rights granted herein.
You are not responsible for enforcing compliance by third parties to
this License.
7. If, as a consequence of a court judgment or allegation of patent
infringement or for any other reason (not limited to patent issues),
conditions are imposed on you (whether by court order, agreement or
otherwise) that contradict the conditions of this License, they do not
excuse you from the conditions of this License. If you cannot
distribute so as to satisfy simultaneously your obligations under this
License and any other pertinent obligations, then as a consequence you
may not distribute the Program at all. For example, if a patent
license would not permit royalty-free redistribution of the Program by
all those who receive copies directly or indirectly through you, then
the only way you could satisfy both it and this License would be to
refrain entirely from distribution of the Program.
If any portion of this section is held invalid or unenforceable under
any particular circumstance, the balance of the section is intended to
apply and the section as a whole is intended to apply in other
circumstances.
It is not the purpose of this section to induce you to infringe any
patents or other property right claims or to contest validity of any
such claims; this section has the sole purpose of protecting the
integrity of the free software distribution system, which is
implemented by public license practices. Many people have made
generous contributions to the wide range of software distributed
through that system in reliance on consistent application of that
system; it is up to the author/donor to decide if he or she is willing
to distribute software through any other system and a licensee cannot
impose that choice.
This section is intended to make thoroughly clear what is believed to
be a consequence of the rest of this License.
8. If the distribution and/or use of the Program is restricted in
certain countries either by patents or by copyrighted interfaces, the
original copyright holder who places the Program under this License
may add an explicit geographical distribution limitation excluding
those countries, so that distribution is permitted only in or among
countries not thus excluded. In such case, this License incorporates
the limitation as if written in the body of this License.
9. The Free Software Foundation may publish revised and/or new versions
of the General Public License from time to time. Such new versions will
be similar in spirit to the present version, but may differ in detail to
address new problems or concerns.
Each version is given a distinguishing version number. If the Program
specifies a version number of this License which applies to it and "any
later version", you have the option of following the terms and conditions
either of that version or of any later version published by the Free
Software Foundation. If the Program does not specify a version number of
this License, you may choose any version ever published by the Free Software
Foundation.
10. If you wish to incorporate parts of the Program into other free
programs whose distribution conditions are different, write to the author
to ask for permission. For software which is copyrighted by the Free
Software Foundation, write to the Free Software Foundation; we sometimes
make exceptions for this. Our decision will be guided by the two goals
of preserving the free status of all derivatives of our free software and
of promoting the sharing and reuse of software generally.
NO WARRANTY
11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY
FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN
OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES
PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED
OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS
TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE
PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING,
REPAIR OR CORRECTION.
12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR
REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES,
INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING
OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED
TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY
YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER
PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE
POSSIBILITY OF SUCH DAMAGES.
END OF TERMS AND CONDITIONS
Appendix: How to Apply These Terms to Your New Programs
If you develop a new program, and you want it to be of the greatest
possible use to the public, the best way to achieve this is to make it
free software which everyone can redistribute and change under these terms.
To do so, attach the following notices to the program. It is safest
to attach them to the start of each source file to most effectively
convey the exclusion of warranty; and each file should have at least
the "copyright" line and a pointer to where the full notice is found.
<one line to give the program's name and a brief idea of what it does.>
Copyright (C) 19yy <name of author>
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
Also add information on how to contact you by electronic and paper mail.
If the program is interactive, make it output a short notice like this
when it starts in an interactive mode:
Gnomovision version 69, Copyright (C) 19yy name of author
Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
This is free software, and you are welcome to redistribute it
under certain conditions; type `show c' for details.
The hypothetical commands `show w' and `show c' should show the appropriate
parts of the General Public License. Of course, the commands you use may
be called something other than `show w' and `show c'; they could even be
mouse-clicks or menu items--whatever suits your program.
You should also get your employer (if you work as a programmer) or your
school, if any, to sign a "copyright disclaimer" for the program, if
necessary. Here is a sample; alter the names:
Yoyodyne, Inc., hereby disclaims all copyright interest in the program
`Gnomovision' (which makes passes at compilers) written by James Hacker.
<signature of Ty Coon>, 1 April 1989
Ty Coon, President of Vice
This General Public License does not permit incorporating your program into
proprietary programs. If your program is a subroutine library, you may
consider it more useful to permit linking proprietary applications with the
library. If this is what you want to do, use the GNU Library General
Public License instead of this License.

153
ChangeLog
View file

@ -1,3 +1,138 @@
Wed Oct 8 15:38:22 1997 Ovidiu Predescu <ovidiu@net-community.com>
* Heavy display and window flushing optimizations have been
implemented.
* Source/NSView.m (-setDisplayInRect:): Now is implemented to work
optimized.
(-displayRect:): Likewise.
(-setNeedsDisplay:): Likewise.
(-setNeedsDisplayInRect:): Likewise.
(-_addSubviewForNeedingDisplay:): New method.
(-_recursivelyResetNeedsDisplayInAllViews): Likewise.
(-_displayNeededViews): Likewise.
(-_collectFlushRectangles): Likewise.
(-_setNeedsDisplay): Likewise.
(-_setNeedsFlush): Likewise.
(-_needsFlush): Likewise.
(+_flushWindows): Likewise.
* Headers/gnustep/gui/NSWindow.h: Important optimization for window
flushing has been implemented.
* Source/NSWindow.m: Likewise.
* Headers/gnustep/gui/PSMatrix.h (boundingRectFor:): New method.
(isRotated): New method.
(rectInMatrixSpace:): New method.
* Source/NSApplication.m (-nextEventMatchingMask:untilDate:inMode:
dequeue:): Call the NSWindow class to flush the windows, then flush the
communication channels.
(-_flushCommunicationChannels): New method.
* Source/NSWindow.m (-disableFlushWindow): New method.
* Source/PSMatrix.m (-boundingRectFor:result:): New method.
(-rectInMatrixSpace:): Likewise.
* NSSlider has been implemented.
* Headers/gnustep/gui/NSSlider.h: New implementation.
* Source/NSSlider.m: Likewise.
* Headers/gnustep/gui/NSSliderCell.h: Likewise.
* Source/NSSliderCell.m: Likewise.
* Source/NSButton.m: Use -setNeedsDisplay: instead of display.
* Source/NSCell.m: Likewise.
* Source/NSControl.m: Likewise.
* Source/NSScroller.m: Likewise.
* Source/NSMatrix.m: Likewise. Removed all lock focuses because display
occurs at a later time. It is still possible to improve the
performance, but at least selection in the list mode works quite quick
under Solaris, not counting in radio mode which is (very) fast.
* Source/NSMenu.m (-drawRect:): Fixed code that determines what cells
need display.
Several cleanups.
* Source/NSActionCell.m: Remove commented out sequences of code.
* Source/NSApplication.m: Likewise.
* Source/NSPopUpButton.m: Likewise.
* Source/NSView.m: Likewise.
* Source/NSApplication.m: Fixed memory allocation problems by
retaining instance variables.
* Source/NSButtonCell.m: Likewise.
* Source/NSCachedImageRep.m: Likewise.
* Source/NSCell.m: Likewise.
* Source/NSColorList.m: Likewise.
* Source/NSColorWell.m: Likewise.
* Source/NSCursor.m: Likewise.
* Source/NSEvent.m: Likewise.
* Source/NSDPSContext.m: Likewise.
* Source/NSPopUpButton.m: Likewise.
* Source/NSWindow.m: Likewise.
(-dealloc): New method: release all instance variables.
* Source/NSColor.m (-dealloc): Likewise.
* Source/NSView.m (-dealloc): Release other two additional ivars.
* Source/NSApplication.m (-dealloc): Cleanup the windows array
deallocation. Other memory allocation problems have been fixed.
(-hide): Don't use an enumerator, iterate instead over the array.
(-unhide): Likewise.
(-miniaturizeAll): Likewise.
(-updateWindows): Likewise.
(-postEvent:atStart:): Fixed condition.
* Source/NSColorList.m (-colorListNamed:): Don't use an enumerator.
* Source/NSCell.m: Changed the size of the default font back to 12.
* Source/NSText.m: Likewise.
* Source/NSTextFieldCell.m: Likewise.
* Source/NSClipView.m (-scrollToPoint:): Fixed the code that moves the
bounds to a new point.
* Source/NSScrollView.m (-_doScroll:): Fixed the code that computes the
moving direction and step. Fixed the way the scroller position is
updated when a scroll button is pressed.
* Headers/gnustep/gui/NSApplication.h: Removed the backend category
because of the problems it presents with calling super in its methods.
* Source/NSApplication.m: Likewise.
(-handleNullEvent): New method.
* Headers/gnustep/gui/NSCell.h (-setControlView:): New method.
* Source/NSCell.m (-setControlView:): New method.
* Source/NSCell.m: Likewise.
* Headers/gnustep/gui/NSPrintInfo.h: Replaced with Simon Frankau's
implementation.
* Source/NSPrintInfo.m: Likewise.
* Headers/gnustep/gui/NSScrollView.h (_knobMoved): New instance
variable.
* Source/Makefile: Temporary exclude NSPasteboard from compiling.
* Source/Makefile.preamble: Add -Wall to the compile flags. Define the
libraries the GUI library depends upon.
* Source/NSApplication.m: Conditionally include NSConnection.h. Include
NSTimer.h. Define ASSIGN.
(+sharedApplication): Use two consecutive calls to initialize the NSApp
global variable.
(-nextEventMatchingMask:untilDate:inMode:dequeue:): Change the order in
which the expiration date is computed to avoid unnecessary operations.
* Source/NSView.m: Mark the view as being rotated and/or scaled when
setting bounds or frame.
(-sortSubviewsUsingFunction:context:): Implemented.
* Source/externs.m: Define NSPrintHorizontalPagination.
Wed Oct 8 10:33:52 1997 Ovidiu Predescu <ovidiu@net-community.com>
* Headers/gnustep/gui/config.h.in: Changed to config.h.
* Headers/gnustep/gui/config.sed.nt: Removed.
* Images/common_SliderHoriz.tiff: New file.
* Images/common_SliderVert.tiff: New file.
* Images/Makefile: Added the above two files.
* aclocal.m4: Removed.
* configure: Removed.
* configure.in: Removed.
* configure.bat: Removed.
* config.guess: Removed.
* config.mak.in: Removed.
* config.sub: Removed.
* COPYING: Removed.
* install-sh: Removed.
* mkinstalldirs: Removed.
* Documentation/Makefile.in: Removed.
Tue Sep 23 14:28:14 1997 Scott Christley <scottc@net-community.com>
* Convert to the GNUstep makefile package.
@ -158,7 +293,7 @@ Fri Aug 22 11:40:45 1997 Ovidiu Predescu <ovidiu@net-community.com>
Mon Aug 18 09:38:27 1997 Ovidiu Predescu <ovidiu@net-community.com>
Start the port to NeXT PDO under Solaris.
Start the port to NeXT's PDO under Solaris.
* Headers/gnustep/gui/NSCStringText.h: Include Foundation/NSString.h.
* Headers/gnustep/gui/NSScreen.h: Declare NSArray.
* Headers/gnustep/gui/NSText.h: Include Foundation/NSRange.h.
@ -179,7 +314,7 @@ Mon Aug 18 09:38:27 1997 Ovidiu Predescu <ovidiu@net-community.com>
* Source/NSDPSContext.m: Likewise. Also declare -copyWithZone: for
NSThread to make possible adding it to Foundation containers.
Add scaling and rotation support.
Added scaling and rotation support.
* Headers/gnustep/gui/NSView.h: Remove frame_rotation. Add frameMatrix
and boundsMatrix instance variables.
* Source/PSMatrix.m: New file.
@ -258,10 +393,18 @@ Wed Aug 6 13:27:53 1997 Ovidiu Predescu <ovidiu@net-community.com>
Tue Aug 5 14:39:29 1997 Ovidiu Predescu <ovidiu@net-community.com>
Implementation of scroll views.
* Source/NSClipView.m: The initial implementation.
* Source/NSScrollView.m: Likewise.
* NSScroller completely reworked.
* Source/NSScroller.m: Optimized to work with time events to gain speed
in user interaction.
* Images/common_ArrowLeftH.tiff: New file.
* Images/common_ArrowRightH.tiff: Likewise.
* Images/common_ArrowUpH.tiff: Likewise.
* Images/common_ArrowDownH.tiff: Likewise.
* Source/NSApplication.m (-nextEventMatchingMask:untilDate:inMode:
dequeue:): Do not pop-up the time events from the queue immediately
after -limitDateForMode: to avoid loosing the normal events.
@ -270,12 +413,6 @@ Tue Aug 5 14:39:29 1997 Ovidiu Predescu <ovidiu@net-community.com>
* Source/NSButtonCell.m: Likewise.
* Source/NSButton.m: Likewise.
Implementation of scroll views.
* Source/NSClipView.m: The initial implementation.
* Source/NSScrollView.m: Likewise.
* Source/NSScroller.m: Optimized to work with time events to gain speed
in user interaction.
* Source/NSView.m: Post notifications if needed when a frame or bound
change.
* Source/externs.m: Changed the name of NSView notification to conform

View file

@ -1,266 +0,0 @@
#
# Documentation makefile for GNUstep GUI Library
# Copyright (C) 1996 Free Software Foundation, Inc.
#
# Author: Scott Christley <scottc@net-community.com>
# Date: August 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, Inc.,
# 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
SHELL = /bin/sh
#### Start of system configuration section. ####
srcdir = @srcdir@
VPATH = @srcdir@
# Installation location
prefix = @prefix@
infodir = @infodir@
MAKEINFO = makeinfo
TEXI2DVI = texi2dvi
TEXI2HTML = texi2html
#### End of system configuration section. ####
include $(srcdir)/../Version
ORIG_FILES = \
version.tmpl.texi \
gnustep-gui.tmpl.texi \
announce.tmpl.texi \
install.tmpl.texi \
news.tmpl.texi \
readme.tmpl.texi \
status.tmpl.texi \
todo.tmpl.texi \
faq.tmpl.texi
TEXI_FILES = \
version.texi \
gnustep-gui.texi \
announce.texi \
install.texi \
news.texi \
readme.texi \
status.texi \
todo.texi \
faq.texi \
TEXT_FILES = \
TODO INSTALL NEWS README ANNOUNCE FAQ STATUS
DVI_FILES = gnustep-gui.dvi
PS_FILES = gnustep-gui.ps
HTML_FILES = gnustep-gui_toc.html
INFO_FILES = gnustep-gui.info
INFO_FLAGS = -I $(srcdir) -D NO-TEXI2HTML --no-header
HTML_FLAGS = -split_chapter -expandinfo -I $(srcdir)
TEXT_FLAGS = -I $(srcdir) -D NO-TEXI2HTML -D TEXT-ONLY --no-header --no-split
all: info dvi html text ps
info: $(INFO_FILES)
dvi: $(DVI_FILES)
html: $(HTML_FILES)
text: $(TEXT_FILES)
ps: $(PS_FILES)
version.tmpl.texi: $(srcdir)/../Version
rm -f version.tmpl.texi
echo '@set GNUSTEP-GUI-VERSION' $(GNUSTEP_GUI_VERSION) \
> version.tmpl.texi
echo '@set GNUSTEP-GUI-GCC $(GNUSTEP_GUI_GCC)' \
>> version.tmpl.texi
echo '@set GNUSTEP-GUI-BASE $(GNUSTEP_GUI_BASE)' \
>> version.tmpl.texi
echo '@set LIB-FOUNDATION $(LIB_FOUNDATION)' \
>> version.tmpl.texi
echo '@set GNUSTEP-GUI-LIBTIFF $(GNUSTEP_GUI_LIBTIFF)' \
>> version.tmpl.texi
echo '@set GNUSTEP-GUI-DGS $(GNUSTEP_GUI_DGS)' \
>> version.tmpl.texi
echo '@set GNUSTEP-GUI-DPSCLIENT $(GNUSTEP_GUI_DPSCLIENT)' \
>> version.tmpl.texi
if [ $(GNUSTEP_GUI_FTP_MACHINE) ]; then \
echo '@set GNUSTEP-GUI-FTP-MACHINE $(GNUSTEP_GUI_FTP_MACHINE)' \
>> version.tmpl.texi; fi
if [ $(GNUSTEP_GUI_FTP_DIRECTORY) ]; then \
echo '@set GNUSTEP-GUI-FTP-DIRECTORY $(GNUSTEP_GUI_FTP_DIRECTORY)' \
>> version.tmpl.texi; fi
if [ $(GNUSTEP_GUI_SNAP_FTP_MACHINE) ]; then \
echo '@set GNUSTEP-GUI-SNAP-FTP-MACHINE \
$(GNUSTEP_GUI_SNAP_FTP_MACHINE)' \
>> version.tmpl.texi; fi
if [ $(GNUSTEP_GUI_SNAP_FTP_DIRECTORY) ]; then \
echo '@set GNUSTEP-GUI-SNAP-FTP-DIRECTORY \
$(GNUSTEP_GUI_SNAP_FTP_DIRECTORY)' \
>> version.tmpl.texi; fi
cp version.tmpl.texi version.texi
gnustep-gui.dvi: $(ORIG_FILES)
rm -f $(TEXI_FILES)
for i in $(ORIG_FILES); do \
cp $$i `basename $$i .tmpl.texi`.texi ; \
done
$(TEXI2DVI) $(srcdir)/gnustep-gui.texi
gnustep-gui.info: $(ORIG_FILES)
rm -f $(TEXI_FILES)
for i in $(ORIG_FILES); do \
sed -e 's,@email{\([^}]*\)},<\1>,g' \
$(srcdir)/$$i \
| sed -e 's,@url{\([^}]*\)},@samp{\1},g' \
> `basename $$i .tmpl.texi`.texi ; \
done
$(MAKEINFO) $(INFO_FLAGS) -o gnustep-gui.info $(srcdir)/gnustep-gui.texi
gnustep-gui.ps: gnustep-gui.dvi
dvips gnustep-gui.dvi -o gnustep-gui.ps
gnustep-gui_toc.html: $(ORIG_FILES)
rm -f $(TEXI_FILES)
for i in $(ORIG_FILES); do \
sed -e 's,@email{\([^}]*\)},<A HREF="mailto:\1">\1</A>,g' \
$(srcdir)/$$i \
| sed -e 's,@url{\([^}]*\)},<A HREF="\1">\1</A>,g' \
| sed -e 's,^ *$$,@br{},g' \
> `basename $$i .tmpl.texi`.texi ; \
done
$(TEXI2HTML) $(HTML_FLAGS) gnustep-gui.texi
# Rules for producing the text files
README: version.tmpl.texi readme.tmpl.texi
sed -e 's,@email{\([^}]*\)},<\1>,g' \
$(srcdir)/readme.tmpl.texi \
| sed -e 's,@url{\([^}]*\)},@samp{\1},g' \
> readme.texi ; \
$(MAKEINFO) $(TEXT_FLAGS) -o README $(srcdir)/readme.texi
ANNOUNCE: version.tmpl.texi announce.tmpl.texi
sed -e 's,@email{\([^}]*\)},<\1>,g' \
$(srcdir)/announce.tmpl.texi \
| sed -e 's,@url{\([^}]*\)},@samp{\1},g' \
> announce.texi ; \
$(MAKEINFO) $(TEXT_FLAGS) -o ANNOUNCE $(srcdir)/announce.texi
INSTALL: version.tmpl.texi install.tmpl.texi
sed -e 's,@email{\([^}]*\)},<\1>,g' \
$(srcdir)/install.tmpl.texi \
| sed -e 's,@url{\([^}]*\)},@samp{\1},g' \
> install.texi ; \
$(MAKEINFO) $(TEXT_FLAGS) -o INSTALL $(srcdir)/install.texi
NEWS: version.tmpl.texi news.tmpl.texi
sed -e 's,@email{\([^}]*\)},<\1>,g' \
$(srcdir)/news.tmpl.texi \
| sed -e 's,@url{\([^}]*\)},@samp{\1},g' \
> news.texi ; \
$(MAKEINFO) $(TEXT_FLAGS) -o NEWS $(srcdir)/news.texi
FAQ: version.tmpl.texi faq.tmpl.texi
sed -e 's,@email{\([^}]*\)},<\1>,g' \
$(srcdir)/faq.tmpl.texi \
| sed -e 's,@url{\([^}]*\)},@samp{\1},g' \
> faq.texi ; \
$(MAKEINFO) $(TEXT_FLAGS) -o FAQ $(srcdir)/faq.texi
STATUS: version.tmpl.texi status.tmpl.texi
sed -e 's,@email{\([^}]*\)},<\1>,g' \
$(srcdir)/status.tmpl.texi \
| sed -e 's,@url{\([^}]*\)},@samp{\1},g' \
> status.texi ; \
$(MAKEINFO) $(TEXT_FLAGS) -o STATUS $(srcdir)/status.texi
TODO: version.tmpl.texi todo.tmpl.texi
sed -e 's,@email{\([^}]*\)},<\1>,g' \
$(srcdir)/todo.tmpl.texi \
| sed -e 's,@url{\([^}]*\)},@samp{\1},g' \
> todo.texi ; \
$(MAKEINFO) $(TEXT_FLAGS) -o TODO $(srcdir)/todo.texi
#
# GNU Objective-C Runtime Library Manual
#
objc-runtime.dvi: version.tmpl.texi objc-runtime.tmpl.texi
rm -f $(TEXI_FILES)
for i in version.tmpl.texi objc-runtime.tmpl.texi; do \
cp $$i `basename $$i .tmpl.texi`.texi ; \
done
$(TEXI2DVI) $(srcdir)/objc-runtime.texi
objc-runtime.info: version.tmpl.texi objc-runtime.tmpl.texi
rm -f $(TEXI_FILES)
for i in version.tmpl.texi objc-runtime.tmpl.texi; do \
sed -e 's,@email{\([^}]*\)},<\1>,g' \
$(srcdir)/$$i \
| sed -e 's,@url{\([^}]*\)},@samp{\1},g' \
> `basename $$i .tmpl.texi`.texi ; \
done
$(MAKEINFO) $(INFO_FLAGS) -o objc-runtime.info $(srcdir)/objc-runtime.texi
objc-runtime.ps: objc-runtime.dvi
dvips objc-runtime.dvi -o objc-runtime.ps
objc-runtime_toc.html: version.tmpl.texi objc-runtime.tmpl.texi
rm -f $(TEXI_FILES)
for i in version.tmpl.texi objc-runtime.tmpl.texi; do \
sed -e 's,@email{\([^}]*\)},<A HREF="mailto:\1">\1</A>,g' \
$(srcdir)/$$i \
| sed -e 's,@url{\([^}]*\)},<A HREF="\1">\1</A>,g' \
| sed -e 's,^ *$$,@br{},g' \
> `basename $$i .tmpl.texi`.texi ; \
done
$(TEXI2HTML) $(HTML_FLAGS) objc-runtime.texi
install:
uninstall:
update-top: ANNOUNCE FAQ INSTALL NEWS README TODO STATUS
cp ANNOUNCE ..
cp FAQ ..
cp INSTALL ..
cp NEWS ..
cp README ..
cp TODO ..
cp STATUS ..
mostlyclean:
rm -f *~
rm -f *.aux *.cp *.cps *.fn *.fns
rm -f *.ky *.log *.pg *.toc *.tp *.vr
rm -f $(TEXI_FILES)
rm -f objc-runtime.texi
clean: mostlyclean
rm -f version.tmpl.texi
rm -f $(TEXT_FILES)
rm -f *.html
rm -f *.info
rm -f *.dvi
rm -f *.ps
distclean: clean
rm -f Makefile
maintainer-clean: distclean
Makefile: Makefile.in
cd ..; $(SHELL) config.status

View file

@ -83,7 +83,8 @@ No determination of component sizes. Editing
text, validating input, represented object, and some other odd and end
methods not implemented.
@item NSClipView:: [2]
@item NSClipView:: [9]
The class has been implemented but does not work yet with copy on scroll.
@item NSColor:: [8]
Now implements all colorspaces; however, does not know the difference
@ -125,7 +126,7 @@ Ghostscript are empty.
@item NSEPSImageRep:: [2]
@item NSEvent:: [9]
All methods implemented except periodic events.
All methods implemented including periodic events.
@item NSFont:: [9]
Now maintains AFM and glyph information but requires the backend
@ -138,11 +139,12 @@ Ghostscript System, but still requires additional work.
@item NSFontPanel:: [2]
May be usable with backend implementation.
@item NSForm:: [9]
@item NSForm:: [8]
The code has been written, it greatly depends on NSMatrix, but no tests have
been made.
@item NSFormCell:: [2]
@item NSFormCell:: [8]
The code has been written but no tests have been made.
@item NSHelpPanel:: [2]
@ -205,15 +207,16 @@ Knows nothing about window depth, greatly depends upon backend implementation.
Filled out implementation so that it should be almost complete; requires
backend implementation of a few methods.
@item NSScrollView:: [2]
@item NSScrollView:: [8]
The code has been implemented though it does not deal yet with copy on scroll.
@item NSSelection:: [2]
@item NSSlider:: [4]
Usability greatly depends upon backend implementation.
@item NSSlider:: [10]
Implemented. Does not require backend support.
@item NSSliderCell:: [6]
No title or image capability implemented, greatly depends upon backend.
@item NSSliderCell:: [10]
Implemented. Requires only a method to be implemented in the backend.
@item NSSpellChecker:: [2]
@ -225,17 +228,18 @@ No title or image capability implemented, greatly depends upon backend.
Usability greatly depends upon backend implementation.
@item NSTextField:: [8]
Does not properly send text delegate messages.
Does not properly send text delegate messages. Does not handle selection yet
and does not hide the cursor when it resigns as the first responder.
@item NSTextFieldCell:: [4]
Usability greatly depends upon backend implementation.
@item NSView:: [6]
Maintains subview lists, notification of new window, send resizing
messages to subviews. Rotation, scaling, or translation of user
coordinate space depends upon backend implementation. Event handling
messages to subviews. Rotation, scaling and translation of user
coordinate space have been implemented. Event handling
and tracking rectangles implemented. Cursor management implemented. No
scrolling capability. No printing, paging, or postscript.
autoscrolling capability. No printing, paging, or postscript.
@item NSWindow:: [4]
Most methods not implemented, but maybe usable with backend implementation.

View file

@ -37,6 +37,7 @@
@class NSException;
@class NSNotification;
@class NSDate;
@class NSTimer;
@class NSEvent;
@class NSPasteboard;
@ -261,12 +262,9 @@ extern NSString *NSEventTrackingRunLoopMode;
- (void)encodeWithCoder:aCoder;
- initWithCoder:aDecoder;
@end
//
// Backend methods
//
@interface NSApplication (GNUstepBackend)
// the null event
+ (void)setNullEvent:(NSEvent *)e;
@ -279,11 +277,18 @@ extern NSString *NSEventTrackingRunLoopMode;
// handle a non-translated event
- (void)handleNullEvent;
/* Set up the run loop input sources for a given mode */
- (void)setupRunLoopInputSourcesForMode:(NSString*)mode;
/* Private methods */
- (void)_flushCommunicationChannels;
@end
@interface NSApplication (BackendMethods)
/* Set up the run loop input sources for a given mode */
- (void)setupRunLoopInputSourcesForMode:(NSString*)mode;
@end
@interface NSObject (NSServicesRequests)
// Pasteboard Read/Write

View file

@ -6,6 +6,7 @@
Copyright (C) 1996 Free Software Foundation, Inc.
Author: Scott Christley <scottc@net-community.com>
Ovidiu Predescu <ovidiu@net-community.com>
Date: 1996
This file is part of the GNUstep GUI Library.

View file

@ -6,6 +6,7 @@
Copyright (C) 1996 Free Software Foundation, Inc.
Author: Scott Christley <scottc@net-community.com>
Ovidiu Predescu <ovidiu@net-community.com>
Date: 1996
This file is part of the GNUstep GUI Library.

View file

@ -248,6 +248,8 @@ enum {
// Displaying
//
- (NSView *)controlView;
- (void)setControlView:(NSView*)aView;
- (void)drawInteriorWithFrame:(NSRect)cellFrame
inView:(NSView *)controlView;
- (void)drawWithFrame:(NSRect)cellFrame

View file

@ -3,10 +3,10 @@
Stores information used in printing
Copyright (C) 1996 Free Software Foundation, Inc.
Copyright (C) 1996,1997 Free Software Foundation, Inc.
Author: Scott Christley <scottc@net-community.com>
Date: 1996
Author: Simon Frankau <sgf@frankau.demon.co.uk>
Date: July 1997
This file is part of the GNUstep GUI Library.
@ -51,7 +51,7 @@ typedef enum _NSPrintingPaginationMode {
@interface NSPrintInfo : NSObject <NSCoding>
{
// Attributes
NSMutableDictionary *info;
}
//
@ -144,7 +144,7 @@ extern NSString *NSPrintFaxSendTime;
extern NSString *NSPrintFaxTrimPageEnds;
extern NSString *NSPrintFaxUseCoverSheet;
extern NSString *NSPrintFirstPage;
extern NSString *NSPrintHorizonalPagination;
extern NSString *NSPrintHorizontalPagination;
extern NSString *NSPrintHorizontallyCentered;
extern NSString *NSPrintJobDisposition;
extern NSString *NSPrintJobFeatures;

View file

@ -53,6 +53,7 @@
BOOL _hasVertRuler;
BOOL _scrollsDynamically;
BOOL _rulersVisible;
BOOL _knobMoved;
}
/* Calculating layout */

View file

@ -1,12 +1,10 @@
/*
/*
NSSlider.h
The slider control class
Copyright (C) 1996 Free Software Foundation, Inc.
Author: Scott Christley <scottc@net-community.com>
Date: 1996
Author: Ovidiu Predescu <ovidiu@net-community.com>
Date: September 1997
This file is part of the GNUstep GUI Library.
@ -21,10 +19,9 @@
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.
*/
License along with this library; if not, write to the Free
Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/
#ifndef _GNUstep_H_NSSlider
#define _GNUstep_H_NSSlider
@ -38,20 +35,8 @@
@class NSColor;
@class NSEvent;
@interface NSSlider : NSControl <NSCoding>
{
// Attributes
}
@interface NSSlider : NSControl
//
// Setting the Cell Class
//
+ (Class)cellClass;
+ (void)setCellClass:(Class)classId;
//
// Modifying an NSSlider's Appearance
//
- (NSImage *)image;
- (int)isVertical;
- (float)knobThickness;
@ -65,26 +50,12 @@
- (id)titleCell;
- (NSColor *)titleColor;
- (NSFont *)titleFont;
//
// Setting and Getting Value Limits
//
- (double)maxValue;
- (double)minValue;
- (void)setMaxValue:(double)aDouble;
- (void)setMinValue:(double)aDouble;
//
// Handling Events
//
- (BOOL)acceptsFirstMouse:(NSEvent *)theEvent;
//
// NSCoding protocol
//
- (void)encodeWithCoder:aCoder;
- initWithCoder:aDecoder;
@end
#endif // _GNUstep_H_NSSlider

View file

@ -1,12 +1,10 @@
/*
/*
NSSliderCell.h
Cell class for slider control
Copyright (C) 1996 Free Software Foundation, Inc.
Author: Scott Christley <scottc@net-community.com>
Date: 1996
Author: Ovidiu Predescu <ovidiu@net-community.com>
Date: September 1997
This file is part of the GNUstep GUI Library.
@ -21,10 +19,9 @@
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.
*/
License along with this library; if not, write to the Free
Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/
#ifndef _GNUstep_H_NSSliderCell
#define _GNUstep_H_NSSliderCell
@ -34,78 +31,60 @@
@class NSString;
@class NSColor;
@class NSFont;
@class NSImage;
@interface NSSliderCell : NSActionCell <NSCoding>
{
// Attributes
double max_value;
double min_value;
double scale_factor;
int scroll_size;
int knob_thickness;
double page_value;
BOOL is_vertical;
float _minValue;
float _maxValue;
float _floatValue;
float _altIncrementValue;
id _titleCell;
id _knobCell;
NSRect _trackRect;
BOOL _isVertical;
// Reserved for back-end use
void *be_sc_reserved;
}
//
// Determining Component Sizes
//
- (NSSize)cellSizeForBounds:(NSRect)aRect;
- (NSRect)knobRectFlipped:(BOOL)flipped;
//
// Setting Value Limits
//
- (double)maxValue;
- (double)minValue;
- (void)setMaxValue:(double)aDouble;
- (void)setMinValue:(double)aDouble;
//
// Modifying Graphic Attributes
//
- (void)setVertical:(BOOL)value;
- (int)isVertical;
- (float)knobThickness;
- (void)setKnobThickness:(float)aFloat;
- (void)setTitle:(NSString *)aString;
- (void)setTitleCell:(NSCell *)aCell;
- (void)setTitleColor:(NSColor *)aColor;
- (void)setTitleFont:(NSFont *)fontObject;
- (NSString *)title;
- (id)titleCell;
- (NSFont *)titleFont;
- (NSColor *)titleColor;
//
// Displaying the NSSliderCell
//
- (void)drawBarInside:(NSRect)aRect
flipped:(BOOL)flipped;
- (void)drawKnob;
- (void)drawKnob:(NSRect)knobRect;
//
// Modifying Behavior
//
/* Asking about the cell's behavior */
- (double)altIncrementValue;
- (void)setAltIncrementValue:(double)incValue;
//
// Tracking the Mouse
//
+ (BOOL)prefersTrackingUntilMouseUp;
- (NSRect)trackRect;
//
// NSCoding protocol
//
- (void)encodeWithCoder:aCoder;
- initWithCoder:aDecoder;
/* Changing the cell's behavior */
- (void)setAltIncrementValue:(double)increment;
/* Displaying the cell */
- (NSRect)knobRectFlipped:(BOOL)flipped;
- (void)drawBarInside:(NSRect)aRect flipped:(BOOL)flipped;
- (void)drawKnob;
- (void)drawKnob:(NSRect)knobRect;
/* Asking about the cell's appearance */
- (float)knobThickness;
- (int)isVertical;
- (NSString*)title;
- (id)titleCell;
- (NSColor*)titleColor;
- (NSFont*)titleFont;
/* Changing the cell's appearance */
- (void)setKnobThickness:(float)thickness;
- (void)setTitle:(NSString*)title;
- (void)setTitleCell:(NSCell*)aCell;
- (void)setTitleColor:(NSColor*)color;
- (void)setTitleFont:(NSFont*)font;
/* Asking about the value limits */
- (double)minValue;
- (double)maxValue;
/* Changing the value limits */
- (void)setMinValue:(double)aDouble;
- (void)setMaxValue:(double)aDouble;
@end
#endif // _GNUstep_H_NSSliderCell
#endif /* _GNUstep_H_NSSliderCell */

View file

@ -6,8 +6,10 @@
Copyright (C) 1996 Free Software Foundation, Inc.
Author: Scott Christley <scottc@net-community.com>
Ovidiu Predescu <ovidiu@net-community.com>
Date: 1996, 1997
Date: 1996
Heavily changed and extended by Ovidiu Predescu <ovidiu@net-community.com>.
Date: 1997
This file is part of the GNUstep GUI Library.
@ -72,21 +74,26 @@ enum {
id frameMatrix;
id boundsMatrix;
id super_view;
NSView* super_view;
NSMutableArray *sub_views;
id window;
NSMutableArray *tracking_rects;
NSMutableArray *cursor_rects;
NSRect invalidatedRectangle;
unsigned int autoresizingMask;
BOOL is_rotated_from_base;
BOOL is_rotated_or_scaled_from_base;
BOOL opaque;
BOOL needs_display;
BOOL disable_autodisplay;
BOOL post_frame_changes;
BOOL post_bounds_changes;
BOOL autoresize_subviews;
NSView* _nextSiblingSubviewThatNeedsDisplay;
/* NULL if no sibling view needs display */
NSView* _subviewsThatNeedDisplay;
// Reserved for back-end use
void *be_view_reserved;
}
@ -338,6 +345,29 @@ enum {
@end
@class PSMatrix;
@interface NSView (PrivateMethods)
/* If the view is rotated returns the bounding box of the rect in the "normal"
coordinates */
- (NSRect)_boundingRectFor:(NSRect)rect;
- (void)_recursivelyResetNeedsDisplayInAllViews;
- (void)_displayNeededViews;
/* Collects into `array' the invalid rectangles that need to be displayed. All
the rectangles are expressed in the window coordinates and not of the views
they come from. */
- (void)_collectInvalidatedRectanglesInArray:(NSMutableArray*)array
originMatrix:(PSMatrix*)matrix1
sizeMatrix:(PSMatrix*)matrix2;
- (PSMatrix*)_frameMatrix;
- (PSMatrix*)_boundsMatrix;
@end
/* Notifications */
extern NSString *NSViewFrameDidChangeNotification;
extern NSString *NSViewBoundsDidChangeNotification;

View file

@ -88,6 +88,7 @@ extern NSSize NSTokenSize;
NSBackingStoreType backing_type;
unsigned int style_mask;
int window_level;
NSMutableArray* _flushRectangles;
BOOL is_one_shot;
BOOL needs_display;
@ -395,9 +396,15 @@ extern NSSize NSTokenSize;
- (void)encodeWithCoder:aCoder;
- initWithCoder:aDecoder;
// Private methods
- (void)_setNeedsFlush:(BOOL)flag;
/* Private methods */
- (void)_view:(NSView*)view needsFlushInRect:(NSRect)rect;
- (void)_setNeedsDisplay;
- (void)_setNeedsFlush;
- (BOOL)_needsFlush;
- (void)_collectFlushRectangles;
+ (BOOL)_flushWindows;
+ (void)_setNeedsFlushWindows:(BOOL)flag;
+ (BOOL)_needsFlushWindows;
@end

View file

@ -46,11 +46,16 @@
- (void)setFrameRotation:(float)angle;
- (void)inverse;
- (BOOL)isRotated;
- (void)boundingRectFor:(NSRect)rect result:(NSRect*)result;
/* Returns anotherMatrix * self */
- (void)concatenateWith:(PSMatrix*)anotherMatrix;
- (NSPoint)pointInMatrixSpace:(NSPoint)point;
- (NSSize)sizeInMatrixSpace:(NSSize)size;
- (NSRect)rectInMatrixSpace:(NSRect)rect;
@end

View file

@ -1,58 +0,0 @@
/*
config.h
System dependent includes.
@configure_input@
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_AppKitConfig
#define _GNUstep_H_AppKitConfig
#include <Foundation/NSGeometry.h>
/* Define NSDebugLog if not defined */
#ifndef NSDebugLog
# ifdef DEBUGLOG
# define NSDebugLog(format, args...) NSLog(format, ## args)
# else
# define NSDebugLog(format, args...)
# endif
#endif /* !NSDebugLog */
extern BOOL initialize_gnustep_backend (void);
#ifndef OBJC_MALLOC
# define OBJC_MALLOC(pointer, type, elements) \
(pointer = calloc (sizeof(type), elements))
#endif
#ifndef OBJC_FREE
# define OBJC_FREE(pointer) \
if (pointer) free(pointer)
#endif
#endif /* _GNUstep_H_AppKitConfig */

View file

@ -1,4 +0,0 @@
s/@configure_input@/ Generated from config.in by configure.bat/
s/@config_include@//
s/@HAVE_TIFF@/1/
s/@HAVE_DPSCLIENT@/1/

View file

@ -24,7 +24,6 @@
include $(GNUSTEP_SYSTEM_ROOT)/Makefiles/common.make
include ../Version
include ../config.mak
imagedir = $(GNUSTEP_RESOURCES)/Images
@ -47,6 +46,8 @@ common_Right.tiff \
common_RightH.tiff \
common_SwitchOn.tiff \
common_SwitchOff.tiff \
common_SliderHoriz.tiff \
common_SliderVert.tiff \
common_Dimple.tiff \
common_ret.tiff

Binary file not shown.

Binary file not shown.

View file

@ -74,7 +74,6 @@ NSMenuItem.m \
NSOpenPanel.m \
NSPageLayout.m \
NSPanel.m \
NSPasteboard.m \
NSPrinter.m \
NSPrintInfo.m \
NSPrintOperation.m \
@ -101,6 +100,7 @@ TrackingRectangle.m \
PSMatrix.m \
tiff.m \
externs.m
# NSPasteboard.m
HEADER_FILES_DIR = ../Headers
HEADER_FILES_INSTALL_DIR = /gnustep/gui

View file

@ -42,7 +42,7 @@
ADDITIONAL_CPPFLAGS = -DGNUSTEP_INSTALL_LIBDIR=\"$(GNUSTEP_LIBRARIES_ROOT)\"
# Additional flags to pass to the Objective-C compiler
ADDITIONAL_OBJCFLAGS =
ADDITIONAL_OBJCFLAGS = -Wall
# Additional flags to pass to the C compiler
ADDITIONAL_CFLAGS =
@ -65,3 +65,9 @@ ADDITIONAL_INSTALL_DIRS = $(GNUSTEP_HEADERS)/gnustep \
$(GNUSTEP_HEADERS)/gnustep/gui \
$(GNUSTEP_HEADERS)/gnustep/gui/AppKit \
$(GNUSTEP_HEADERS)/gnustep/gui/DPSClient
# What are the libraries this library depends upon. This is needed for some
# systems where building a shared library requires to pass to the linker
# all the libraries the target library depends upon.
LIBRARIES_DEPEND_UPON = -l$(FOUNDATION_LIBRARY_NAME) -ltiff

View file

@ -197,6 +197,7 @@
action = aSelector;
}
/* NSActionCell does not retain its target! */
- (void)setTarget:(id)anObject
{
target = anObject;
@ -237,29 +238,17 @@
- (void)encodeWithCoder:aCoder
{
[super encodeWithCoder:aCoder];
[aCoder encodeValueOfObjCType: "i" at: &tag];
#if 0
[aCoder encodeObjectReference: target withName: @"Target"];
#else
[aCoder encodeConditionalObject:target];
#endif
[aCoder encodeValueOfObjCType:@encode(SEL) at: &action];
}
- initWithCoder:aDecoder
{
[super initWithCoder:aDecoder];
[aDecoder decodeValueOfObjCType: "i" at: &tag];
#if 0
[aDecoder decodeObjectAt: &target withName: NULL];
#else
target = [aDecoder decodeObject];
#endif
[aDecoder decodeValueOfObjCType: @encode(SEL) at: &action];
return self;
}

View file

@ -31,11 +31,11 @@
#include <Foundation/NSArray.h>
#include <Foundation/NSNotification.h>
#include <Foundation/NSConnection.h>
#include <Foundation/NSRunLoop.h>
#include <Foundation/NSAutoreleasePool.h>
#include <Foundation/NSTimer.h>
#ifdef NEXT_PDO
#ifndef LIB_FOUNDATION_LIBRARY
# include <Foundation/NSConnection.h>
#endif
@ -56,6 +56,11 @@ static BOOL gnustep_gui_app_is_in_dealloc;
static NSEvent *gnustep_gui_null_event;
static id NSApp;
#define ASSIGN(a, b) \
[b retain]; \
[a release]; \
a = b;
@implementation NSApplication
//
@ -79,8 +84,13 @@ static id NSApp;
+ (NSApplication *)sharedApplication
{
// If the global application does not exist yet then create it
if (!NSApp)
NSApp = [[self alloc] init];
if (!NSApp) {
/* Don't combine the following two statements into one to avoid problems
with some classes initialization code that tries to get the shared
application. */
NSApp = [self alloc];
[NSApp init];
}
return NSApp;
}
@ -98,18 +108,18 @@ static id NSApp;
NSDebugLog(@"Begin of NSApplication -init\n");
// allocate the window list
window_list = [NSMutableArray array];
window_list = [NSMutableArray new];
window_count = 1;
//
// Event handling setup
//
// allocate the event queue
event_queue = [[NSMutableArray alloc] init];
event_queue = [NSMutableArray new];
// No current event
current_event = nil;
// The NULL event
gnustep_gui_null_event = [[NSEvent alloc] init];
gnustep_gui_null_event = [NSEvent new];
//
// We are the end of the responder chain
@ -147,19 +157,7 @@ static id NSApp;
// Let ourselves know we are within dealloc
gnustep_gui_app_is_in_dealloc = YES;
// Release the window list
// We retain all of the objects in our list
// so we need to release them
//NSArray doesn't know -removeAllObjects yet
[window_list removeAllObjects];
//j = [window_list count];
//for (i = 0;i < j; ++i)
// [[window_list objectAtIndex:i] release];
// no need -array is autoreleased
//[window_list release];
[window_list release];
[event_queue release];
[current_event release];
[super dealloc];
@ -283,14 +281,15 @@ static id NSApp;
//
default:
{
NSWindow* window = [theEvent window];
if (!theEvent) NSDebugLog(@"NSEvent is nil!\n");
NSDebugLog(@"NSEvent type: %d\n", [theEvent type]);
NSDebugLog(@"send event to window\n");
NSDebugLog([[theEvent window] description]);
NSDebugLog(@"\n");
if (![theEvent window])
NSDebugLog(@"no window\n");
[[theEvent window] sendEvent:theEvent];
NSDebugLog(@"NSEvent type: %d", [theEvent type]);
NSDebugLog(@"send event to window");
NSDebugLog([window description]);
if (!window)
NSDebugLog(@"no window");
[window sendEvent:theEvent];
}
}
}
@ -371,7 +370,7 @@ static id NSApp;
return NO;
}
- (void)setCurrentEvent:(NSEvent *)theEvent;
- (void)setCurrentEvent:(NSEvent *)theEvent
{
[theEvent retain];
[current_event release];
@ -419,12 +418,11 @@ static id NSApp;
NSEvent *event;
BOOL done = NO;
if (!expiration)
expiration = [NSDate distantFuture];
event = [self _eventMatchingMask:mask];
if (event)
done = YES;
else if (!expiration)
expiration = [NSDate distantFuture];
// Not in queue so wait for next event
while (!done) {
@ -439,6 +437,8 @@ static id NSApp;
else
limitDate = expiration;
[NSWindow _flushWindows];
[self _flushCommunicationChannels];
[currentLoop runMode:mode beforeDate:limitDate];
event = [self _eventMatchingMask:mask];
@ -505,7 +505,7 @@ static id NSApp;
- (void)postEvent:(NSEvent *)event atStart:(BOOL)flag
{
if (flag)
if (!flag)
[event_queue addObject: event];
else
[event_queue insertObject: event atIndex: 0];
@ -567,15 +567,13 @@ static id NSApp;
//
- (void)hide:sender
{
id e;
NSWindow *w;
int i, count;
// TODO: hide the menu
// Tell the windows to hide
e = [window_list objectEnumerator];
while ((w = [e nextObject]))
[w performHide: sender];
for (i = 0, count = [window_list count]; i < count; i++)
[[window_list objectAtIndex:i] performHide:sender];
app_is_hidden = YES;
}
@ -587,13 +585,11 @@ static id NSApp;
- (void)unhide:sender
{
id e;
NSWindow *w;
int i, count;
// Tell the windows to unhide
e = [window_list objectEnumerator];
while ((w = [e nextObject]))
[w performUnhide: sender];
for (i = 0, count = [window_list count]; i < count; i++)
[[window_list objectAtIndex:i] performUnhide:sender];
// TODO: unhide the menu
@ -647,15 +643,10 @@ static id NSApp;
- (void)miniaturizeAll:sender
{
id e, obj;
int i, count;
e = [window_list objectEnumerator];
obj = [e nextObject];
while (obj)
{
[obj miniaturize: sender];
obj = [e nextObject];
}
for (i = 0, count = [window_list count]; i < count; i++)
[[window_list objectAtIndex:i] miniaturize:sender];
}
- (void)preventWindowOrdering
@ -668,15 +659,10 @@ static id NSApp;
- (void)updateWindows
{
id e, obj;
int i, count;
e = [window_list objectEnumerator];
obj = [e nextObject];
while (obj)
{
[obj update];
obj = [e nextObject];
}
for (i = 0, count = [window_list count]; i < count; i++)
[[window_list objectAtIndex:i] update];
}
- (NSArray *)windows
@ -1015,22 +1001,11 @@ static id NSApp;
[super encodeWithCoder:aCoder];
[aCoder encodeObject: window_list];
// We don't want to code the event queue do we?
//[aCoder encodeObject: event_queue];
//[aCoder encodeObject: current_event];
#if 0
[aCoder encodeObjectReference: key_window withName: @"Key window"];
[aCoder encodeObjectReference: main_window withName: @"Main window"];
[aCoder encodeObjectReference: delegate withName: @"Delegate"];
[aCoder encodeObject: main_menu];
[aCoder encodeObjectReference: windows_menu withName: @"Windows menu"];
#else
[aCoder encodeConditionalObject:key_window];
[aCoder encodeConditionalObject:main_window];
[aCoder encodeConditionalObject:delegate];
[aCoder encodeObject:main_menu];
[aCoder encodeConditionalObject:windows_menu];
#endif
}
- initWithCoder:aDecoder
@ -1038,34 +1013,17 @@ static id NSApp;
[super initWithCoder:aDecoder];
window_list = [aDecoder decodeObject];
#if 0
[aDecoder decodeObjectAt: &key_window withName: NULL];
[aDecoder decodeObjectAt: &main_window withName: NULL];
[aDecoder decodeObjectAt: &delegate withName: NULL];
main_menu = [aDecoder decodeObject];
[aDecoder decodeObjectAt: &windows_menu withName: NULL];
#else
key_window = [aDecoder decodeObject];
main_window = [aDecoder decodeObject];
delegate = [aDecoder decodeObject];
main_menu = [aDecoder decodeObject];
windows_menu = [aDecoder decodeObject];
#endif
return self;
}
@end
//
// Backend methods
// empty implementations
//
@implementation NSApplication (GNUstepBackend)
+ (void)setNullEvent:(NSEvent *)e
{
gnustep_gui_null_event = e;
ASSIGN(gnustep_gui_null_event, e);
}
+ (NSEvent *)getNullEvent;
@ -1076,7 +1034,7 @@ static id NSApp;
// Get next event
- (NSEvent *)getNextEvent
{
[event_queue addObject: gnustep_gui_null_event];
[event_queue addObject:gnustep_gui_null_event];
return gnustep_gui_null_event;
}
@ -1089,6 +1047,9 @@ static id NSApp;
- (void)handleNullEvent
{}
- (void)_flushCommunicationChannels
{}
- (void)setupRunLoopInputSourcesForMode:(NSString*)mode
{}

View file

@ -6,6 +6,7 @@
Copyright (C) 1996 Free Software Foundation, Inc.
Author: Scott Christley <scottc@net-community.com>
Ovidiu Predescu <ovidiu@net-community.com>
Date: 1996
This file is part of the GNUstep GUI Library.
@ -339,8 +340,12 @@ id gnustep_gui_nsbutton_class = nil;
inView: self];
[cell setState:![self state]];
#if 1
[self setNeedsDisplayInRect:bounds];
#else
[cell drawWithFrame:bounds inView:self];
[[self window] flushWindow];
#endif
}
[self unlockFocus];

View file

@ -6,6 +6,7 @@
Copyright (C) 1996 Free Software Foundation, Inc.
Author: Scott Christley <scottc@net-community.com>
Ovidiu Predescu <ovidiu@net-community.com>
Date: 1996
This file is part of the GNUstep GUI Library.
@ -39,6 +40,11 @@
#include <AppKit/NSFont.h>
#include <AppKit/NSImage.h>
#define ASSIGN(a, b) \
[b retain]; \
[a release]; \
a = b;
//
// NSButtonCell implementation
//
@ -147,7 +153,7 @@
- (void)setAlternateImage:(NSImage *)anImage
{
altImage = [anImage retain];
ASSIGN(altImage, anImage);
}
- (void)setImagePosition:(NSCellImagePosition)aPosition
@ -193,7 +199,9 @@
- (void)setKeyEquivalent:(NSString *)key
{
keyEquivalent = [key copy];
id copy = [key copy];
ASSIGN(keyEquivalent, copy);
[copy release];
}
- (void)setKeyEquivalentModifierMask:(unsigned int)mask
@ -203,13 +211,13 @@
- (void)setKeyEquivalentFont:(NSFont *)fontObj
{
keyEquivalentFont = [fontObj retain];
ASSIGN(keyEquivalentFont, fontObj);
}
- (void)setKeyEquivalentFont:(NSString *)fontName
size:(float)fontSize
{
keyEquivalentFont = [[NSFont fontWithName:fontName size:fontSize] retain];
ASSIGN(keyEquivalentFont, [NSFont fontWithName:fontName size:fontSize]);
}
//

View file

@ -61,7 +61,7 @@
[super init];
_window = win;
_window = [win retain];
_rect = rect;
/* Either win or rect must be non-NULL. If rect is empty, we get the

View file

@ -108,7 +108,7 @@
cell_type = NSImageCellType;
cell_image = [anImage retain];
image_position = NSImageOnly;
cell_font = [[NSFont userFontOfSize:16] retain];
cell_font = [[NSFont userFontOfSize:12] retain];
return self;
}
@ -116,11 +116,7 @@
{
[self _init];
// Not a string class --then forget it
//if (![aString isKindOfClass:[NSString class]])
// return nil;
cell_font = [[NSFont userFontOfSize:16] retain];
cell_font = [[NSFont userFontOfSize:12] retain];
contents = [aString retain];
cell_type = NSTextCellType;
text_align = NSCenterTextAlignment;
@ -489,6 +485,11 @@
return control_view;
}
- (void)setControlView:(NSView*)view
{
control_view = view;
}
- (void)drawInteriorWithFrame:(NSRect)cellFrame
inView:(NSView *)controlView
{}
@ -639,7 +640,11 @@
// If point is in cellFrame then highlight the cell
if ([controlView mouse: point inRect: cellFrame]) {
[self highlight:YES withFrame:cellFrame inView:controlView];
#if 1
[controlView setNeedsDisplayInRect:cellFrame];
#else
[[controlView window] flushWindow];
#endif
}
else
return NO;
@ -686,8 +691,12 @@
if (cell_highlighted) {
[self highlight: NO withFrame: cellFrame
inView: controlView];
#if 1
[controlView setNeedsDisplayInRect:cellFrame];
#else
[self drawWithFrame: cellFrame inView: controlView];
[[controlView window] flushWindow];
#endif
}
// Do we now return or keep tracking
@ -704,8 +713,12 @@
if (!cell_highlighted) {
[self highlight: YES withFrame: cellFrame
inView: controlView];
#if 1
[controlView setNeedsDisplayInRect:cellFrame];
#else
//[self drawWithFrame: cellFrame inView: controlView];
[[controlView window] flushWindow];
#endif
}
}
@ -748,6 +761,10 @@
return YES;
}
#if 1
[controlView setNeedsDisplayInRect:cellFrame];
#endif
// Otherwise return NO
NSDebugLog(@"NSCell mouse did not go up in cell\n");
return NO;
@ -837,11 +854,7 @@
[aCoder encodeValueOfObjCType: "i" at: &cell_type];
[aCoder encodeValueOfObjCType: @encode(NSTextAlignment) at: &text_align];
[aCoder encodeValueOfObjCType: "i" at: &entry_type];
#if 0
[aCoder encodeObjectReference: control_view withName: @"Control view"];
#else
[aCoder encodeConditionalObject:control_view];
#endif
}
- initWithCoder:aDecoder
@ -865,11 +878,7 @@
[aDecoder decodeValueOfObjCType: "i" at: &cell_type];
[aDecoder decodeValueOfObjCType: @encode(NSTextAlignment) at: &text_align];
[aDecoder decodeValueOfObjCType: "i" at: &entry_type];
#if 0
[aDecoder decodeObjectAt: &control_view withName: NULL];
#else
control_view = [aDecoder decodeObject];
#endif
return self;
}

View file

@ -102,12 +102,17 @@
#endif
point = [self constrainScrollPoint:point];
[super setBoundsOrigin:NSMakePoint(-point.x, -point.y)];
[self setBoundsOrigin:NSMakePoint(point.x, point.y)];
if (_copiesOnScroll)
/* TODO: move the visible portion of the document */;
else {
#if 1
[self setNeedsDisplay:YES];
#else
[self display];
[[self window] flushWindow];
#endif
}
}

View file

@ -34,11 +34,16 @@
#include <AppKit/NSView.h>
#include <AppKit/NSGraphics.h>
// Class variables
static BOOL gnustep_gui_ignores_alpha = YES;
#define ASSIGN(a, b) \
[b retain]; \
[a release]; \
a = b;
@implementation NSColor
// Class variables
static BOOL gnustep_gui_ignores_alpha = YES;
//
// Class methods
//
@ -560,6 +565,9 @@ static BOOL gnustep_gui_ignores_alpha = YES;
//
- (void)dealloc
{
[colorspace_name release];
[catalog_name release];
[color_name release];
[super dealloc];
}
@ -634,17 +642,17 @@ static BOOL gnustep_gui_ignores_alpha = YES;
- (void)setColorSpaceName:(NSString *)str
{
colorspace_name = str;
ASSIGN(colorspace_name, str);
}
- (void)setCatalogName:(NSString *)str
{
catalog_name = str;
ASSIGN(catalog_name, str);
}
- (void)setColorName:(NSString *)str
{
color_name = str;
ASSIGN(color_name, str);
}
// RGB component values

View file

@ -32,7 +32,9 @@
#include <Foundation/NSDictionary.h>
#include <Foundation/NSArchiver.h>
#include <Foundation/NSException.h>
#include <AppKit/NSColorList.h>
#include <AppKit/NSColor.h>
#include <AppKit/AppKitExceptions.h>
// global variable
@ -59,7 +61,7 @@ static NSLock *gnustep_color_list_lock;
[self setVersion:1];
// Initialize the global array of color lists
gnustep_available_color_lists = [NSMutableArray array];
gnustep_available_color_lists = [NSMutableArray new];
// And its access lock
gnustep_color_list_lock = [[NSLock alloc] init];
}
@ -86,27 +88,22 @@ static NSLock *gnustep_color_list_lock;
//
+ (NSColorList *)colorListNamed:(NSString *)name
{
id e;
NSColorList* o;
BOOL found = NO;
int i, count;
NSColorList* color = nil;
// Serialize access to color list
[gnustep_color_list_lock lock];
e = [gnustep_available_color_lists objectEnumerator];
o = [e nextObject];
while ((o) && (!found))
{
if ([name compare: [o name]] == NSOrderedSame)
found = YES;
else
o = [e nextObject];
}
for (i = 0, count = [gnustep_available_color_lists count]; i < count; i++) {
color = [gnustep_available_color_lists objectAtIndex:i];
if ([name compare:[color name]] == NSOrderedSame)
break;
}
[gnustep_color_list_lock unlock];
if (found)
return o;
else
if (i == count)
return nil;
else
return color;
}
//
@ -120,12 +117,9 @@ static NSLock *gnustep_color_list_lock;
[super init];
// Initialize instance variables
list_name = name;
[list_name retain];
color_list = [NSMutableDictionary dictionary];
[color_list retain];
color_list_keys = [NSMutableArray array];
[color_list_keys retain];
list_name = [name retain];
color_list = [NSMutableDictionary new];
color_list_keys = [NSMutableArray new];
is_editable = YES;
file_name = @"";
@ -145,12 +139,11 @@ static NSLock *gnustep_color_list_lock;
[super init];
// Initialize instance variables
list_name = name;
[list_name retain];
list_name = [name retain];
[self setFileNameFromPath: path];
// Unarchive the color list
cl = [NSUnarchiver unarchiveObjectWithFile: file_name];
cl = [NSUnarchiver unarchiveObjectWithFile:file_name];
// Copy the color list elements to self
is_editable = [cl isEditable];

View file

@ -30,6 +30,11 @@
#include <AppKit/NSColorWell.h>
#include <AppKit/NSColor.h>
#define ASSIGN(a, b) \
[b retain]; \
[a release]; \
a = b;
@implementation NSColorWell
//
@ -53,11 +58,17 @@
is_bordered = YES;
is_active = NO;
the_color = [NSColor blackColor];
ASSIGN(the_color, [NSColor blackColor]);
return self;
}
- (void)dealloc
{
[the_color release];
[super dealloc];
}
//
// Drawing
//
@ -107,13 +118,13 @@
- (void)setColor:(NSColor *)color
{
the_color = color;
ASSIGN(the_color, color);
}
- (void)takeColorFrom:(id)sender
{
if ([sender respondsToSelector:@selector(color)])
the_color = [sender color];
ASSIGN(the_color, [sender color]);
}
//

View file

@ -122,6 +122,9 @@ static id MB_NSCONTROL_CELL_CLASS = nil;
if (![aCell isKindOfClass:[NSCell class]])
return;
[cell setControlView:nil];
[aCell setControlView:self];
[aCell retain];
[cell release];
cell = aCell;
@ -177,19 +180,19 @@ static id MB_NSCONTROL_CELL_CLASS = nil;
- (void)setDoubleValue:(double)aDouble
{
[[self selectedCell] setDoubleValue:aDouble];
[self displayIfNeeded];
[self setNeedsDisplay:YES];
}
- (void)setFloatValue:(float)aFloat
{
[[self selectedCell] setFloatValue:aFloat];
[self displayIfNeeded];
[self setNeedsDisplay:YES];
}
- (void)setIntValue:(int)anInt
{
[[self selectedCell] setIntValue:anInt];
[self displayIfNeeded];
[self setNeedsDisplay:YES];
}
- (void)setNeedsDisplay
@ -200,7 +203,7 @@ static id MB_NSCONTROL_CELL_CLASS = nil;
- (void)setStringValue:(NSString *)aString
{
[[self selectedCell] setStringValue:aString];
[self displayIfNeeded];
[self setNeedsDisplay:YES];
}
- (NSString *)stringValue
@ -214,25 +217,25 @@ static id MB_NSCONTROL_CELL_CLASS = nil;
- (void)takeDoubleValueFrom:(id)sender
{
[[self selectedCell] takeDoubleValueFrom:sender];
[self displayIfNeeded];
[self setNeedsDisplay:YES];
}
- (void)takeFloatValueFrom:(id)sender
{
[[self selectedCell] takeFloatValueFrom:sender];
[self displayIfNeeded];
[self setNeedsDisplay:YES];
}
- (void)takeIntValueFrom:(id)sender
{
[[self selectedCell] takeIntValueFrom:sender];
[self displayIfNeeded];
[self setNeedsDisplay:YES];
}
- (void)takeStringValueFrom:(id)sender
{
[[self selectedCell] takeStringValueFrom:sender];
[self displayIfNeeded];
[self setNeedsDisplay:YES];
}
//
@ -259,7 +262,7 @@ static id MB_NSCONTROL_CELL_CLASS = nil;
if (cell)
{
[cell setAlignment:mode];
[self displayIfNeeded];
[self setNeedsDisplay:YES];
}
}

View file

@ -50,7 +50,7 @@ static BOOL gnustep_gui_hidden_until_move;
// Initialize class variables
gnustep_gui_cursor_stack = [[NSMutableArray alloc] initWithCapacity: 2];
gnustep_gui_hidden_until_move = YES;
gnustep_gui_current_cursor = [NSCursor arrowCursor];
gnustep_gui_current_cursor = [[NSCursor arrowCursor] retain];
}
}

View file

@ -34,6 +34,11 @@
#include <Foundation/NSDictionary.h>
#include <gnustep/dps/NSDPSContext.h>
#define ASSIGN(a, b) \
[b retain]; \
[a release]; \
a = b;
//
// DPS exceptions
//
@ -113,7 +118,7 @@ static BOOL GNU_CONTEXT_SYNCHRONIZED = NO;
errorProc:(DPSErrorProc)errorProc
{
[super init];
context_data = data;
ASSIGN(context_data, data);
is_screen_context = YES;
error_proc = errorProc;
text_proc = tProc;
@ -123,6 +128,13 @@ static BOOL GNU_CONTEXT_SYNCHRONIZED = NO;
return self;
}
- (void)dealloc
{
[context_data release];
[chained_child release];
[super dealloc];
}
//
// Testing the Drawing Destination
//
@ -291,7 +303,7 @@ static BOOL GNU_CONTEXT_SYNCHRONIZED = NO;
{
if (child)
{
chained_child = child;
chained_child = [child retain];
[child setParentContext: self];
}
}
@ -311,6 +323,7 @@ static BOOL GNU_CONTEXT_SYNCHRONIZED = NO;
if (chained_child)
{
[chained_child setParentContext: nil];
[chained_child release];
chained_child = nil;
}
}

View file

@ -39,6 +39,7 @@
#include <AppKit/NSEvent.h>
#include <AppKit/NSApplication.h>
#include <AppKit/NSWindow.h>
#include <DPSClient/NSDPSContext.h>
@implementation NSEvent
@ -76,6 +77,8 @@ static NSRecursiveLock* timersLock = nil;
- (void)setContext:(NSDPSContext *)context
{
[context retain];
[event_context release];
event_context = context;
}
@ -404,6 +407,7 @@ static NSRecursiveLock* timersLock = nil;
[event_data.key.char_keys release];
[event_data.key.unmodified_keys release];
}
[event_context release];
[super dealloc];
}

View file

@ -544,10 +544,14 @@ static int mouseDownFlags = 0;
column:(int)column
{
[[cells objectAtIndex:row] replaceObjectAtIndex:column withObject:newCell];
#if 1
[self setNeedsDisplayInRect:[self cellFrameAtRow:row column:column]];
#else
[self lockFocus];
[newCell drawWithFrame:[self cellFrameAtRow:row column:column] inView:self];
[[self window] flushWindow];
[self unlockFocus];
#endif
}
- (void)removeColumn:(int)column
@ -723,10 +727,14 @@ static int mouseDownFlags = 0;
else
[aCell setState:value];
#if 1
[self setNeedsDisplayInRect:[self cellFrameAtRow:row column:column]];
#else
[self lockFocus];
[aCell drawWithFrame:[self cellFrameAtRow:row column:column] inView:self];
[[self window] flushWindow];
[self unlockFocus];
#endif
}
- (void)deselectAllCells
@ -735,9 +743,6 @@ static int mouseDownFlags = 0;
NSArray* row;
NSCell* aCell;
/* There is a bug right now in NSView that doesn't allow a view to be
locked focus more than one time. Uncomment this when the bug is fixed! */
// [self lockFocus];
for (i = 0; i < numRows; i++) {
row = [cells objectAtIndex:i];
for (j = 0; j < numCols; j++)
@ -747,12 +752,17 @@ static int mouseDownFlags = 0;
aCell = [row objectAtIndex:j];
[aCell setState:0];
[aCell highlight:NO withFrame:theFrame inView:self];
#if 1
[self setNeedsDisplayInRect:theFrame];
#else
[aCell drawWithFrame:theFrame inView:self];
#endif
((tMatrix)selectedCells)->matrix[i][j] = NO;
}
}
#if 0
[[self window] flushWindow];
// [self unlockFocus];
#endif
}
- (void)deselectSelectedCell
@ -799,9 +809,11 @@ static int mouseDownFlags = 0;
NSRect f = [self cellFrameAtRow:selectedRow column:selectedColumn];
[selectedCell setState:0];
#if 0
[self lockFocus];
[selectedCell drawWithFrame:f inView:self];
[self unlockFocus];
#endif
}
}
else if (!aCell)
@ -812,10 +824,14 @@ static int mouseDownFlags = 0;
selectedColumn = column;
[selectedCell setState:1];
#if 1
[self setNeedsDisplayInRect:[self cellFrameAtRow:row column:column]];
#else
[self lockFocus];
[aCell drawWithFrame:[self cellFrameAtRow:row column:column] inView:self];
[self unlockFocus];
[[self window] flushWindow];
#endif
}
- (BOOL)selectCellWithTag:(int)anInt
@ -1053,7 +1069,9 @@ static int mouseDownFlags = 0;
intRect.origin.y -= cellSize.height + intercell.height;
#endif
}
#if 0
[[self window] flushWindow];
#endif
}
- (void)drawCellAtRow:(int)row
@ -1204,11 +1222,16 @@ static int mouseDownFlags = 0;
break;
[previousCell highlight:NO withFrame:previousCellRect inView:self];
[self setNeedsDisplayInRect:previousCellRect];
ASSIGN(selectedCell, aCell);
selectedRow = row;
selectedColumn = column;
[selectedCell highlight:YES withFrame:rect inView:self];
#if 1
[self setNeedsDisplayInRect:rect];
#else
[[self window] flushWindow];
#endif
break;
case NSRadioModeMatrix:
@ -1221,16 +1244,26 @@ static int mouseDownFlags = 0;
id aCell = selectedCell;
[self deselectSelectedCell];
#if 1
[self setNeedsDisplayInRect:f];
#else
[aCell drawWithFrame:f inView:self];
#endif
}
else
else {
[previousCell highlight:NO withFrame:previousCellRect inView:self];
[self setNeedsDisplayInRect:previousCellRect];
}
ASSIGN(selectedCell, aCell);
selectedRow = row;
selectedColumn = column;
[selectedCell highlight:YES withFrame:rect inView:self];
#if 1
[self setNeedsDisplayInRect:rect];
#else
[[self window] flushWindow];
#endif
break;
case NSListModeMatrix: {
@ -1260,9 +1293,15 @@ static int mouseDownFlags = 0;
[selectedCell setState:1];
[selectedCell highlight:YES withFrame:rect inView:self];
#if 0
[selectedCell drawWithFrame:rect inView:self];
#endif
((tMatrix)selectedCells)->matrix[row][column] = YES;
#if 1
[self setNeedsDisplayInRect:rect];
#else
[[self window] flushWindow];
#endif
break;
}
}
@ -1279,7 +1318,9 @@ static int mouseDownFlags = 0;
ASSIGN(selectedCell, aCell);
selectedRow = row;
selectedColumn = column;
#if 0
[[self window] flushWindow];
#endif
break;
}
}
@ -1328,12 +1369,18 @@ static int mouseDownFlags = 0;
case NSHighlightModeMatrix:
[selectedCell setState:![selectedCell state]];
[selectedCell highlight:NO withFrame:rect inView:self];
[self setNeedsDisplayInRect:rect];
#if 0
[selectedCell drawWithFrame:rect inView:self];
#endif
break;
case NSRadioModeMatrix:
[selectedCell setState:1];
[selectedCell highlight:NO withFrame:rect inView:self];
[self setNeedsDisplayInRect:rect];
#if 0
[selectedCell drawWithFrame:rect inView:self];
#endif
break;
case NSListModeMatrix:
break;
@ -1344,7 +1391,10 @@ static int mouseDownFlags = 0;
else if (target)
[target performSelector:action withObject:self];
#if 0
[[self window] flushWindow];
#endif
[self unlockFocus];
if (mode != NSTrackModeMatrix)
[NSEvent stopPeriodicEvents];
@ -1879,7 +1929,11 @@ static int mouseDownFlags = 0;
aCell = [row objectAtIndex:colNo];
[aCell setState:state];
[aCell highlight:highlight withFrame:rect inView:self];
#if 1
[self setNeedsDisplayInRect:rect];
#else
[aCell drawWithFrame:rect inView:self];
#endif
((tMatrix)selectedCells)->matrix[rowNo][colNo] = YES;
rect.origin.x += cellSize.width + intercell.width;
}
@ -1996,7 +2050,11 @@ static int mouseDownFlags = 0;
aCell = [row objectAtIndex:j];
[aCell setState:state];
[aCell highlight:highlight withFrame:rect inView:self];
#if 1
[self setNeedsDisplayInRect:rect];
#else
[aCell drawWithFrame:rect inView:self];
#endif
((tMatrix)selectedCells)->matrix[i][j] = YES;
rect.origin.x += cellSize.width + intercell.width;
}

View file

@ -204,16 +204,20 @@ static NSFont* menuFont = nil;
- (void)drawRect:(NSRect)rect
{
int i, count = [cells count];
int max, howMany;
NSRect intRect = {{0, 0}, {0, 0}};
max = count - rect.origin.y / (cellSize.height + INTERCELL_SPACE);
howMany = rect.size.height / (cellSize.height + INTERCELL_SPACE);
intRect.origin.y = (count - max) * (cellSize.height + INTERCELL_SPACE);
intRect.size = cellSize;
for (i = count - 1; i >= 0; i--) {
for (i = max - 1; howMany >= 0; i--, howMany--) {
id aCell = [cells objectAtIndex:i];
[aCell drawWithFrame:intRect inView:self];
intRect.origin.y += cellSize.height + INTERCELL_SPACE;
}
[[self window] flushWindow];
}
- (NSSize)cellSize { return cellSize; }

View file

@ -66,7 +66,7 @@
pullsDown:(BOOL)flag
{
[super initWithFrame:frameRect];
list_items = [NSMutableArray array];
list_items = [NSMutableArray new];
is_up = NO;
pulls_down = flag;
selected_item = 0;
@ -76,11 +76,7 @@
- (void)dealloc
{
int i, j;
j = [list_items count];
for (i = 0;i < j; ++i)
[[list_items objectAtIndex:i] release];
[list_items release];
[super dealloc];
}
@ -180,7 +176,7 @@
- (NSMenuCell *)lastItem
{
if ([list_items count] != 0)
if ([list_items count])
return [list_items lastObject];
else
return nil;
@ -193,7 +189,7 @@
- (NSString *)titleOfSelectedItem
{
if ([list_items count] != 0)
if ([list_items count])
return [list_items objectAtIndex:selected_item];
else
return nil;
@ -214,7 +210,7 @@
- (void)selectItemAtIndex:(int)index
{
if ((index >= 0) && (index <= [list_items count]))
if ((index >= 0) && (index < [list_items count]))
{
selected_item = index;
[self synchronizeTitleAndSelectedItem];
@ -295,11 +291,7 @@
[aCoder encodeObject: list_items];
[aCoder encodeRect: list_rect];
[aCoder encodeValueOfObjCType: "i" at: &selected_item];
#if 0
[aCoder encodeObjectReference: pub_target withName: @"Target"];
#else
[aCoder encodeConditionalObject:pub_target];
#endif
[aCoder encodeValueOfObjCType: @encode(SEL) at: &pub_action];
[aCoder encodeValueOfObjCType: @encode(BOOL) at: &is_up];
[aCoder encodeValueOfObjCType: @encode(BOOL) at: &pulls_down];
@ -312,11 +304,7 @@
list_items = [aDecoder decodeObject];
list_rect = [aDecoder decodeRect];
[aDecoder decodeValueOfObjCType: "i" at: &selected_item];
#if 0
[aDecoder decodeObjectAt: &pub_target withName: NULL];
#else
pub_target = [aDecoder decodeObject];
#endif
[aDecoder decodeValueOfObjCType: @encode(SEL) at: &pub_action];
[aDecoder decodeValueOfObjCType: @encode(BOOL) at: &is_up];
[aDecoder decodeValueOfObjCType: @encode(BOOL) at: &pulls_down];

View file

@ -1,12 +1,12 @@
/*
NSPrintInfo.m
Description...
Stores information used in printing
Copyright (C) 1996 Free Software Foundation, Inc.
Copyright (C) 1996,1997 Free Software Foundation, Inc.
Author: Scott Christley <scottc@net-community.com>
Date: 1996
Author: Simon Frankau <sgf@frankau.demon.co.uk>
Date: July 1997
This file is part of the GNUstep GUI Library.
@ -26,9 +26,37 @@
59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/
#include <gnustep/gui/config.h>
#include <Foundation/NSBundle.h>
#include <Foundation/NSDictionary.h>
#include <Foundation/NSException.h>
#include <Foundation/NSValue.h>
#include <AppKit/NSPrinter.h>
#include <AppKit/NSPrintInfo.h>
#ifndef NSPrinterAdmin_PATH
#define NSPrinterAdmin_PATH @GNUSTEP_INSTALL_LIBDIR @"/PrinterAdmin"
#endif
#ifndef NSPrintInfo_PAPERFILE
#define NSPrintInfo_PAPERFILE @"PaperSizes"
#endif
#ifndef NSPrintInfo_DEFAULTSTABLE
#define NSPrintInfo_DEFAULTSTABLE @"PrintDefaults"
#endif
// FIXME: retain/release of dictionary with retain/release of printInfo?
// Class variables:
NSPrintInfo *sharedPrintInfoObject = nil;
NSMutableDictionary *printInfoDefaults = nil;
NSDictionary *paperSizes = nil;
@interface NSPrintInfo (private)
+ initPrintInfoDefaults;
@end
@implementation NSPrintInfo
//
@ -47,11 +75,20 @@
// Managing the Shared NSPrintInfo Object
//
+ (void)setSharedPrintInfo:(NSPrintInfo *)printInfo
{}
{
sharedPrintInfoObject = printInfo;
}
+ (NSPrintInfo *)sharedPrintInfo
{
return nil;
if (!sharedPrintInfoObject)
{
if (!printInfoDefaults)
[NSPrintInfo initPrintInfoDefaults];
sharedPrintInfoObject = [[self alloc]
initWithDictionary:printInfoDefaults];
}
return sharedPrintInfoObject;
}
//
@ -59,7 +96,29 @@
//
+ (NSSize)sizeForPaperName:(NSString *)name
{
return NSZeroSize;
return [[self defaultPrinter] pageSizeForPaper:name];
// Alternatively:
// NSBundle *adminBundle;
// NSString *path;
// NSValue *size;
// if (!paperSizes)
// {
// adminBundle = [NSBundle bundleWithPath:NSPrinterAdmin_PATH];
// path = [adminBundle pathForResource:NSPrintInfo_PAPERFILE ofType:nil];
// // If not found
// if (path == nil || [path length] == 0)
// {
// [NSException raise:NSGenericException
// format:@"Could not find paper size index, file %s",
// [NSPrintInfo_PAPERFILE cString]];
// // NOT REACHED
// }
// paperSizes = [[NSDictionary dictionaryWithContentsOfFile:path] retain];
// }
// size = [paperSizes objectForKey:name];
// if (!size)
// return NSZeroSize;
// return [size sizeValue];
}
//
@ -67,11 +126,17 @@
//
+ (NSPrinter *)defaultPrinter
{
return nil;
if (!printInfoDefaults)
[NSPrintInfo initPrintInfoDefaults];
return [printInfoDefaults objectForKey:NSPrintPrinter];
}
+ (void)setDefaultPrinter:(NSPrinter *)printer
{}
{
if (!printInfoDefaults)
[NSPrintInfo initPrintInfoDefaults];
[printInfoDefaults setObject:printer forKey:NSPrintPrinter];
}
//
// Instance methods
@ -81,7 +146,9 @@
//
- (id)initWithDictionary:(NSDictionary *)aDict
{
return nil;
[super init];
info = [[NSMutableDictionary alloc] initWithDictionary:aDict];
return self;
}
//
@ -89,58 +156,78 @@
//
- (float)bottomMargin
{
return 0.0;
return [(NSNumber *)[info objectForKey:NSPrintBottomMargin] floatValue];
}
- (float)leftMargin
{
return 0.0;
return [(NSNumber *)[info objectForKey:NSPrintLeftMargin] floatValue];
}
- (NSPrintingOrientation)orientation
{
return 0;
return [(NSNumber *)[info objectForKey:NSPrintOrientation] intValue];
}
- (NSString *)paperName
{
return nil;
return [info objectForKey:NSPrintPaperName];
}
- (NSSize)paperSize
{
return NSZeroSize;
return [(NSValue *)[info objectForKey:NSPrintPaperSize] sizeValue];
}
- (float)rightMargin
{
return 0.0;
return [(NSNumber *)[info objectForKey:NSPrintRightMargin] floatValue];
}
- (void)setBottomMargin:(float)value
{}
{
[info setObject:[NSNumber numberWithFloat:value]
forKey:NSPrintBottomMargin];
}
- (void)setLeftMargin:(float)value
{}
{
[info setObject:[NSNumber numberWithFloat:value]
forKey:NSPrintLeftMargin];
}
- (void)setOrientation:(NSPrintingOrientation)mode
{}
{
[info setObject:[NSNumber numberWithInt:mode]
forKey:NSPrintOrientation];
}
- (void)setPaperName:(NSString *)name
{}
{
[info setObject:name forKey:NSPrintPaperName];
}
- (void)setPaperSize:(NSSize)size
{}
{
[info setObject:[NSValue valueWithSize:size]
forKey:NSPrintPaperSize];
}
- (void)setRightMargin:(float)value
{}
{
[info setObject:[NSNumber numberWithFloat:value]
forKey:NSPrintRightMargin];
}
- (void)setTopMargin:(float)value
{}
{
[info setObject:[NSNumber numberWithFloat:value]
forKey:NSPrintTopMargin];
}
- (float)topMargin
{
return 0.0;
return [(NSNumber *)[info objectForKey:NSPrintTopMargin] floatValue];
}
//
@ -148,18 +235,25 @@
//
- (NSPrintingPaginationMode)horizontalPagination
{
return 0;
return [(NSNumber *)[info objectForKey:NSPrintHorizontalPagination]
intValue];
}
- (void)setHorizontalPagination:(NSPrintingPaginationMode)mode
{}
{
[info setObject:[NSNumber numberWithInt:mode]
forKey:NSPrintHorizontalPagination];
}
- (void)setVerticalPagination:(NSPrintingPaginationMode)mode
{}
{
[info setObject:[NSNumber numberWithInt:mode]
forKey:NSPrintVerticalPagination];
}
- (NSPrintingPaginationMode)verticalPagination
{
return 0;
return [(NSNumber *)[info objectForKey:NSPrintVerticalPagination] intValue];
}
//
@ -167,51 +261,76 @@
//
- (BOOL)isHorizontallyCentered
{
return NO;
return [(NSNumber *)[info objectForKey:NSPrintHorizontallyCentered]
boolValue];
}
- (BOOL)isVerticallyCentered
{
return NO;
return [(NSNumber *)[info objectForKey:NSPrintVerticallyCentered] boolValue];
}
- (void)setHorizontallyCentered:(BOOL)flag
{}
{
[info setObject:[NSNumber numberWithBool:flag]
forKey:NSPrintHorizontallyCentered];
}
- (void)setVerticallyCentered:(BOOL)flag
{}
{
[info setObject:[NSNumber numberWithBool:flag]
forKey:NSPrintVerticallyCentered];
}
//
// Specifying the Printer
//
- (NSPrinter *)printer
{
return nil;
return [info objectForKey:NSPrintPrinter];
}
- (void)setPrinter:(NSPrinter *)aPrinter
{}
{
[info setObject:aPrinter forKey:NSPrintPrinter];
}
//
// Controlling Printing
//
- (NSString *)jobDisposition
{
return nil;
return [info objectForKey:NSPrintJobDisposition];
}
- (void)setJobDisposition:(NSString *)disposition
{}
{
[info setObject:disposition forKey:NSPrintJobDisposition];
}
- (void)setUpPrintOperationDefaultValues
{}
{
NSEnumerator *keys, *objects;
NSString *key;
id object;
if (!printInfoDefaults)
[NSPrintInfo initPrintInfoDefaults];
keys = [printInfoDefaults keyEnumerator];
objects = [printInfoDefaults objectEnumerator];
while ((key = [keys nextObject]))
{
object = [objects nextObject];
if (![info objectForKey:key])
[info setObject:object forKey:key];
}
}
//
// Accessing the NSPrintInfo Object's Dictionary
//
- (NSMutableDictionary *)dictionary
{
return nil;
return info;
}
//
@ -219,10 +338,45 @@
//
- (void)encodeWithCoder:aCoder
{
[aCoder encodePropertyList:info];
}
- initWithCoder:aDecoder
{
info = [aDecoder decodePropertyList];
return self;
}
//
// Private method to initialise printing defaults dictionary
//
+ initPrintInfoDefaults
{
NSBundle *adminBundle;
NSString *path;
adminBundle = [NSBundle bundleWithPath:NSPrinterAdmin_PATH];
path = [adminBundle pathForResource:NSPrintInfo_DEFAULTSTABLE ofType:nil];
// If not found
if (path == nil || [path length] == 0)
{
[NSException raise:NSGenericException
format:@"Could not find printing defaults table, file %s",
[NSPrintInfo_DEFAULTSTABLE cString]];
// NOT REACHED
}
printInfoDefaults = [[NSMutableDictionary dictionaryWithContentsOfFile:path]
retain];
// The loaded dictionary contains the name of the printer for NSPrintPrinter
// Load the real NSPrinter object...
[printInfoDefaults
setObject:[NSPrinter printerWithName:[printInfoDefaults
objectForKey:NSPrintPrinter]]
forKey:NSPrintPrinter];
[printInfoDefaults
setObject:[NSValue valueWithSize:
[NSPrintInfo sizeForPaperName:
[printInfoDefaults objectForKey:NSPrintPaperName]]]
forKey:NSPrintPaperSize];
return self;
}

View file

@ -29,6 +29,7 @@
#include <AppKit/NSScroller.h>
#include <AppKit/NSClipView.h>
#include <AppKit/NSScrollView.h>
#include <AppKit/NSWindow.h>
#define ASSIGN(a, b) \
[b retain]; \
@ -198,10 +199,10 @@ static Class rulerViewClass = nil;
NSRect documentRect = [_contentView documentRect];
float amount = 0;
NSPoint point;
BOOL wasAScrollerButton = YES;
NSDebugLog (@"_doScroll: float value = %f", floatValue);
_knobMoved = NO;
if (hitPart == NSScrollerIncrementLine)
amount = _lineScroll;
else if (hitPart == NSScrollerIncrementPage)
@ -211,26 +212,26 @@ static Class rulerViewClass = nil;
else if (hitPart == NSScrollerDecrementPage)
amount = -_pageScroll;
else
wasAScrollerButton = NO;
_knobMoved = YES;
if (wasAScrollerButton) {
if (!_knobMoved) {
if (scroller == _horizScroller) {
point.x = -clipViewBounds.origin.x + amount;
point.y = -clipViewBounds.origin.y;
point.x = clipViewBounds.origin.x + amount;
point.y = clipViewBounds.origin.y;
}
else if (scroller == _vertScroller) {
point.x = -clipViewBounds.origin.x;
point.x = clipViewBounds.origin.x;
/* For the vertical scroller the amount should actually be reversed */
amount = -amount;
// amount = -amount;
/* If the view is flipped we also have to reverse the meanings of
increasing or decreasing of the y coordinate */
if (![_contentView isFlipped])
amount = -amount;
// if (![_contentView isFlipped])
// amount = -amount;
NSDebugLog (@"increment/decrement: amount = %f, flipped = %d",
amount, [_contentView isFlipped]);
point.y = -clipViewBounds.origin.y + amount;
point.y = clipViewBounds.origin.y + amount;
}
else {
/* do nothing */
@ -241,10 +242,10 @@ static Class rulerViewClass = nil;
if (scroller == _horizScroller) {
point.x = floatValue * (documentRect.size.width
- clipViewBounds.size.width);
point.y = -clipViewBounds.origin.y;
point.y = clipViewBounds.origin.y;
}
else if (scroller == _vertScroller) {
point.x = -clipViewBounds.origin.x;
point.x = clipViewBounds.origin.x;
if (![_contentView isFlipped])
floatValue = 1 - floatValue;
point.y = floatValue * (documentRect.size.height
@ -257,52 +258,35 @@ static Class rulerViewClass = nil;
}
[_contentView scrollToPoint:point];
/* Update the scroller knob if the scroll occurred due to a
scroller button. */
if (wasAScrollerButton) {
NSRect newClipViewBounds = [_contentView bounds];
if (newClipViewBounds.origin.x != clipViewBounds.origin.x) {
/* Update the horizontal scroller */
floatValue = -newClipViewBounds.origin.x
/ (documentRect.size.width - newClipViewBounds.size.width);
[_horizScroller setFloatValue:floatValue];
[_horizScroller display];
NSDebugLog (@"new horiz float value %f", floatValue);
}
if (newClipViewBounds.origin.x != clipViewBounds.origin.y) {
/* Update the vertical scroller */
floatValue = -newClipViewBounds.origin.y
/ (documentRect.size.height - newClipViewBounds.size.height);
/* Take care if the document view is not flipped by reversing the meaning
of the float value. */
if (![_contentView isFlipped])
floatValue = 1 - floatValue;
[_vertScroller setFloatValue:floatValue];
[_vertScroller display];
NSDebugLog (@"new vert float value %f", floatValue);
}
}
_knobMoved = NO;
}
- (void)reflectScrolledClipView:(NSClipView*)aClipView
{
NSRect documentRect = [_contentView documentRect];
NSRect clipViewBounds = [_contentView bounds];
NSRect documentRect = NSZeroRect;
NSRect clipViewBounds = NSZeroRect;
float floatValue;
float knobProportion;
if (_knobMoved)
return;
NSDebugLog (@"reflectScrolledClipView:");
if (_contentView) {
clipViewBounds = [_contentView bounds];
if ([_contentView documentView])
documentRect = [_contentView documentRect];
}
if (_hasVertScroller) {
if (documentRect.size.height < clipViewBounds.size.height)
if (documentRect.size.height <= clipViewBounds.size.height)
[_vertScroller setEnabled:NO];
else {
[_vertScroller setEnabled:YES];
knobProportion = clipViewBounds.size.height / documentRect.size.height;
floatValue = clipViewBounds.origin.y / clipViewBounds.size.height;
floatValue = clipViewBounds.origin.y
/ (documentRect.size.height - clipViewBounds.size.height);
if (![_contentView isFlipped])
floatValue = 1 - floatValue;
[_vertScroller setFloatValue:floatValue knobProportion:knobProportion];
@ -310,12 +294,13 @@ static Class rulerViewClass = nil;
}
if (_hasHorizScroller) {
if (documentRect.size.width < clipViewBounds.size.width)
if (documentRect.size.width <= clipViewBounds.size.width)
[_horizScroller setEnabled:NO];
else {
[_horizScroller setEnabled:YES];
knobProportion = clipViewBounds.size.width / documentRect.size.width;
floatValue = clipViewBounds.origin.x / clipViewBounds.size.width;
floatValue = clipViewBounds.origin.x
/ (documentRect.size.width - clipViewBounds.size.width);
[_horizScroller setFloatValue:floatValue knobProportion:knobProportion];
}
}

View file

@ -185,7 +185,11 @@ static NSButtonCell* knobCell = nil;
return;
_isEnabled = flag;
#if 1
[self setNeedsDisplay:YES];
#else
[self display];
#endif
}
- (void)setArrowsPosition:(NSScrollArrowPosition)where
@ -194,7 +198,11 @@ static NSButtonCell* knobCell = nil;
return;
_arrowsPosition = where;
#if 1
[self setNeedsDisplay:YES];
#else
[self display];
#endif
}
- (void)setFloatValue:(float)aFloat
@ -205,6 +213,10 @@ static NSButtonCell* knobCell = nil;
_floatValue = 1;
else
_floatValue = aFloat;
#if 1
[self setNeedsDisplayInRect:[self rectForPart:NSScrollerKnobSlot]];
#endif
}
- (void)setFloatValue:(float)aFloat
@ -218,8 +230,13 @@ static NSButtonCell* knobCell = nil;
_knobProportion = ratio;
[self setFloatValue:aFloat];
#if 1
[self setNeedsDisplayInRect:[self rectForPart:NSScrollerKnobSlot]];
#else
[self display];
[[self window] flushWindow];
#endif
}
- (void)setFrame:(NSRect)frameRect
@ -250,8 +267,12 @@ static NSButtonCell* knobCell = nil;
{
[super setFrameSize:size];
[self checkSpaceForParts];
#if 1
[self setNeedsDisplay:YES];
#else
[self display];
[[self window] flushWindow];
#endif
}
- (NSScrollerPart)testPart:(NSPoint)thePoint
@ -297,7 +318,7 @@ static NSButtonCell* knobCell = nil;
float position;
if (_isHorizontal) {
/* Adjust the last point to lie inside the knob slot */
/* Adjust the point to lie inside the knob slot */
if (point.x < slotRect.origin.x + knobRect.size.width / 2)
position = slotRect.origin.x + knobRect.size.width / 2;
else if (point.x > slotRect.origin.x + slotRect.size.width
@ -312,7 +333,7 @@ static NSButtonCell* knobCell = nil;
/ (slotRect.size.width - knobRect.size.width);
}
else {
/* Adjust the last point to lie inside the knob slot */
/* Adjust the point to lie inside the knob slot */
if (point.y < slotRect.origin.y + knobRect.size.height / 2)
position = slotRect.origin.y + knobRect.size.height / 2;
else if (point.y > slotRect.origin.y + slotRect.size.height
@ -342,17 +363,8 @@ static NSButtonCell* knobCell = nil;
switch (_hitPart) {
case NSScrollerIncrementLine:
[self trackScrollButtons:theEvent];
break;
case NSScrollerDecrementLine:
[self trackScrollButtons:theEvent];
break;
case NSScrollerIncrementPage:
[self trackScrollButtons:theEvent];
break;
case NSScrollerDecrementPage:
[self trackScrollButtons:theEvent];
break;
@ -366,9 +378,11 @@ static NSButtonCell* knobCell = nil;
[self setFloatValue:floatValue];
[self sendAction:_action to:_target];
#if 0
[self drawKnobSlot];
[self drawKnob];
[[self window] flushWindow];
#endif
[self trackKnob:theEvent];
break;
}
@ -410,11 +424,16 @@ static NSButtonCell* knobCell = nil;
if (floatValue != oldFloatValue) {
[self setFloatValue:floatValue];
#if 1
[self setNeedsDisplayInRect:[self rectForPart:NSScrollerKnobSlot]];
#else
[self drawKnobSlot];
[self drawKnob];
[self setNeedsDisplayInRect:[self rectForPart:NSScrollerKnobSlot]];
[[self window] flushWindow];
#endif
[self sendAction:_action to:_target];
oldFloatValue = _floatValue;
oldFloatValue = floatValue;
}
knobRect.origin = point;
}
@ -462,8 +481,13 @@ static NSButtonCell* knobCell = nil;
/* Now unhighlight the cell */
[theCell highlight:NO withFrame:rect inView:self];
#if 1
[self setNeedsDisplayInRect:rect];
#else
[theCell drawWithFrame:rect inView:self];
[self setNeedsDisplayInRect:rect];
[[self window] flushWindow];
#endif
}
if (shouldReturn)
@ -509,7 +533,6 @@ static NSButtonCell* knobCell = nil;
/* Draw the knob */
[self drawKnob];
[[self window] flushWindow];
}
- (void)drawArrow:(NSScrollerArrow)whichButton

View file

@ -1,12 +1,10 @@
/*
/*
NSSlider.m
The slider control class
Copyright (C) 1996 Free Software Foundation, Inc.
Author: Scott Christley <scottc@net-community.com>
Date: 1996
Author: Ovidiu Predescu <ovidiu@net-community.com>
Date: September 1997
This file is part of the GNUstep GUI Library.
@ -21,28 +19,22 @@
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.
*/
License along with this library; if not, write to the Free
Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/
#include <gnustep/gui/config.h>
#include <Foundation/NSRunLoop.h>
#include <AppKit/NSEvent.h>
#include <AppKit/NSSlider.h>
#include <AppKit/NSSliderCell.h>
#include <AppKit/NSWindow.h>
#include <AppKit/NSApplication.h>
//
// class variables
//
id gnustep_gui_nsslider_cell_class = nil;
//
// NSSlider implementation
//
@implementation NSSlider
//
// Class methods
//
static Class cellClass;
+ (void)initialize
{
if (self == [NSSlider class])
@ -55,157 +47,241 @@ id gnustep_gui_nsslider_cell_class = nil;
}
}
//
// Setting the Cell Class
//
+ (Class)cellClass
{
return gnustep_gui_nsslider_cell_class;
}
+ (void)setCellClass:(Class)class { cellClass = class; }
+ (Class)cellClass { return cellClass; }
+ (void)setCellClass:(Class)classId
{
gnustep_gui_nsslider_cell_class = classId;
}
//
// Instance methods
//
//
// Initialization
//
- initWithFrame:(NSRect)frameRect
{
NSSliderCell* theCell = [[[isa cellClass] new] autorelease];
[super initWithFrame:frameRect];
// set our cell
[self setCell:[[gnustep_gui_nsslider_cell_class new] autorelease]];
if (frame.size.width > frame.size.height)
[cell setVertical:NO];
else
[cell setVertical:YES];
[cell setState:1];
[self setCell:theCell];
[theCell setState:1];
return self;
}
//
// Modifying an NSSlider's Appearance
//
- (NSImage *)image
{
return nil;
return [[self cell] image];
}
- (int)isVertical
{
return [cell isVertical];
return [[self cell] isVertical];
}
- (float)knobThickness
{
return [cell knobThickness];
return [[self cell] knobThickness];
}
- (void)setImage:(NSImage *)backgroundImage
{}
{
[[self cell] setImage:backgroundImage];
}
- (void)setKnobThickness:(float)aFloat
{
[cell setKnobThickness:aFloat];
[[self cell] setKnobThickness:aFloat];
}
- (void)setTitle:(NSString *)aString
{}
{
[[self cell] setTitle:aString];
}
- (void)setTitleCell:(NSCell *)aCell
{}
{
[[self cell] setTitleCell:aCell];
}
- (void)setTitleColor:(NSColor *)aColor
{}
{
[[self cell] setTitleColor:aColor];
}
- (void)setTitleFont:(NSFont *)fontObject
{}
{
[[self cell] setTitleFont:fontObject];
}
- (NSString *)title
{
return nil;
return [[self cell] title];
}
- (id)titleCell
{
return nil;
return [[self cell] titleCell];
}
- (NSColor *)titleColor
{
return nil;
return [[self cell] titleColor];
}
- (NSFont *)titleFont
{
return nil;
return [[self cell] titleFont];
}
//
// Setting and Getting Value Limits
//
- (double)maxValue
{
return [cell maxValue];
return [[self cell] maxValue];
}
- (double)minValue
{
return [cell minValue];
return [[self cell] minValue];
}
- (void)setMaxValue:(double)aDouble
{
[cell setMaxValue:aDouble];
[[self cell] setMaxValue:aDouble];
}
- (void)setMinValue:(double)aDouble
{
[cell setMinValue:aDouble];
[[self cell] setMinValue:aDouble];
}
//
// Handling Events
//
- (BOOL)acceptsFirstMouse:(NSEvent *)theEvent
{
return NO;
return YES;
}
//
// Handling Events and Action Messages
//
- (void)mouseDown:(NSEvent *)theEvent
{
}
//
// Displaying
//
- (void)drawRect:(NSRect)rect
{
[cell drawWithFrame:rect inView:self];
[[self cell] drawWithFrame:rect inView:self];
}
//
// NSCoding protocol
//
- (void)encodeWithCoder:aCoder
- (float)_floatValueForMousePoint:(NSPoint)point knobRect:(NSRect)knobRect
{
[super encodeWithCoder:aCoder];
NSSliderCell* theCell = [self cell];
NSRect slotRect = [theCell trackRect];
BOOL isVertical = [theCell isVertical];
float minValue = [theCell minValue];
float maxValue = [theCell maxValue];
float floatValue = 0;
float position;
if (isVertical) {
/* Adjust the point to lie inside the knob slot. We don't have to worry
if the view is flipped or not. */
if (point.y < slotRect.origin.y + knobRect.size.height / 2)
position = slotRect.origin.y + knobRect.size.height / 2;
else if (point.y > slotRect.origin.y + slotRect.size.height
- knobRect.size.height / 2)
position = slotRect.origin.y + slotRect.size.height
- knobRect.size.height / 2;
else
position = point.y;
/* Compute the float value */
floatValue = (position - (slotRect.origin.y + knobRect.size.height/2))
/ (slotRect.size.height - knobRect.size.height);
if ([self isFlipped])
floatValue = 1 - floatValue;
}
else {
/* Adjust the point to lie inside the knob slot */
if (point.x < slotRect.origin.x + knobRect.size.width / 2)
position = slotRect.origin.x + knobRect.size.width / 2;
else if (point.x > slotRect.origin.x + slotRect.size.width
- knobRect.size.width / 2)
position = slotRect.origin.x + slotRect.size.width
- knobRect.size.width / 2;
else
position = point.x;
/* Compute the float value considering the knob size */
floatValue = (position - (slotRect.origin.x + knobRect.size.width / 2))
/ (slotRect.size.width - knobRect.size.width);
}
return floatValue * (maxValue - minValue) + minValue;
}
- initWithCoder:aDecoder
- (void)trackKnob:(NSEvent*)theEvent knobRect:(NSRect)knobRect
{
[super initWithCoder:aDecoder];
unsigned int eventMask = NSLeftMouseDownMask | NSLeftMouseUpMask
| NSLeftMouseDraggedMask | NSMouseMovedMask
| NSPeriodicMask;
NSPoint point = [self convertPoint:[theEvent locationInWindow] fromView:nil];
NSEventType eventType = [theEvent type];
BOOL isContinuous = [self isContinuous];
NSSliderCell* theCell = [self cell];
float oldFloatValue = [theCell floatValue];
id target = [theCell target];
SEL action = [theCell action];
return self;
[NSEvent startPeriodicEventsAfterDelay:0.05 withPeriod:0.05];
[[NSRunLoop currentRunLoop] limitDateForMode:NSEventTrackingRunLoopMode];
while (eventType != NSLeftMouseUp) {
theEvent = [[NSApplication sharedApplication]
nextEventMatchingMask:eventMask
untilDate:[NSDate distantFuture]
inMode:NSEventTrackingRunLoopMode
dequeue:YES];
eventType = [theEvent type];
if (eventType != NSPeriodic)
point = [self convertPoint:[theEvent locationInWindow] fromView:nil];
else if (point.x != knobRect.origin.x || point.y != knobRect.origin.y) {
float floatValue = [self _floatValueForMousePoint:point
knobRect:knobRect];
if (floatValue != oldFloatValue) {
[theCell setFloatValue:floatValue];
#if 0
[theCell drawWithFrame:[self bounds] inView:self];
[[self window] flushWindow];
#else
[self setNeedsDisplay:YES];
#endif
if (isContinuous)
[target performSelector:action withObject:self];
oldFloatValue = floatValue;
}
knobRect.origin = point;
}
}
/* If the control is not continuous send the action at the end of the drag */
if (!isContinuous)
[target performSelector:action withObject:self];
[NSEvent stopPeriodicEvents];
}
- (void)mouseDown:(NSEvent *)theEvent
{
NSPoint location = [self convertPoint:[theEvent locationInWindow]
fromView:nil];
NSSliderCell* theCell = [self cell];
NSRect rect;
[self lockFocus];
rect = [theCell knobRectFlipped:[self isFlipped]];
if (![self mouse:location inRect:rect]) {
/* Mouse is not on the knob, move the knob to the mouse position */
float floatValue = [self _floatValueForMousePoint:location knobRect:rect];
[theCell setFloatValue:floatValue];
if ([self isContinuous])
[[theCell target] performSelector:[theCell action] withObject:self];
#if 0
[theCell drawWithFrame:[self bounds] inView:self];
[[self window] flushWindow];
#else
[self setNeedsDisplay:YES];
#endif
}
[self trackKnob:theEvent knobRect:rect];
}
@end

View file

@ -1,12 +1,10 @@
/*
/*
NSSliderCell.m
Cell class for slider control
Copyright (C) 1996 Free Software Foundation, Inc.
Author: Scott Christley <scottc@net-community.com>
Date: 1996
Author: Ovidiu Predescu <ovidiu@net-community.com>
Date: September 1997
This file is part of the GNUstep GUI Library.
@ -21,309 +19,201 @@
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.
*/
License along with this library; if not, write to the Free
Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/
#include <Foundation/NSString.h>
#include <AppKit/NSSliderCell.h>
#include <AppKit/NSControl.h>
#include <AppKit/NSApplication.h>
#include <AppKit/NSEvent.h>
#include <AppKit/NSWindow.h>
#include <AppKit/NSImage.h>
#include <AppKit/NSTextFieldCell.h>
#define ASSIGN(a, b) \
[b retain]; \
[a release]; \
a = b;
//
// NSSliderCell implementation
//
@implementation NSSliderCell
//
// Class methods
//
+ (void)initialize
{
if (self == [NSSliderCell class])
{
// Initial version
[self setVersion:1];
}
}
//
// Instance methods
//
//
// Initialization
//
- init
{
[self initTextCell:@""];
return self;
}
[self initImageCell:nil];
_altIncrementValue = -1;
_isVertical = -1;
_minValue = 0;
_maxValue = 1;
_floatValue = 0;
[self setBordered:YES];
[self setBezeled:YES];
- initImageCell:(NSImage *)anImage
{
return nil;
}
_knobCell = [NSCell new];
- initTextCell:(NSString *)aString
{
[super initTextCell:aString];
[self setEnabled:YES];
knob_thickness = 6;
page_value = 6;
[self setDoubleValue:0];
return self;
}
- (void)dealloc
{
[_titleCell release];
[_knobCell release];
[super dealloc];
}
//
// Determining Component Sizes
//
- (NSSize)cellSizeForBounds:(NSRect)aRect
{
return NSZeroSize;
}
- (NSRect)knobRectFlipped:(BOOL)flipped
{
return NSZeroRect;
}
//
// Setting the NSCell's Value
//
- (void)setDoubleValue:(double)aDouble
{
double value = aDouble;
if (aDouble < min_value) value = min_value;
if (aDouble > max_value) value = max_value;
[super setDoubleValue:value];
}
- (void)setFloatValue:(float)aFloat
{
[self setDoubleValue:(double)aFloat];
}
- (void)setIntValue:(int)anInt
{
[self setDoubleValue:(double)anInt];
}
- (void)setStringValue:(NSString *)aString
{
}
//
// Setting Value Limits
//
- (double)maxValue
{
return max_value;
}
- (double)minValue
{
return min_value;
}
- (void)setMaxValue:(double)aDouble
{
double val_range;
// Swap values if new max is less than min
if (aDouble < min_value)
{
max_value = min_value;
min_value = aDouble;
}
if (aFloat < _minValue)
_floatValue = _minValue;
else if (aFloat > _maxValue)
_floatValue = _maxValue;
else
max_value = aDouble;
val_range = max_value - min_value;
if (val_range != 0)
{
scale_factor = scroll_size/val_range;
if (scale_factor != 0)
page_value = knob_thickness * (1/scale_factor);
}
_floatValue = aFloat;
}
- (void)setMinValue:(double)aDouble
- (void)drawBarInside:(NSRect)aRect flipped:(BOOL)flipped
{
double val_range;
if ([self image])
return;
// Swap values if new min is greater than max
if (aDouble > max_value)
{
min_value = max_value;
max_value = aDouble;
}
else
min_value = aDouble;
val_range = max_value - min_value;
if (val_range != 0)
{
scale_factor = scroll_size/val_range;
if (scale_factor != 0)
page_value = knob_thickness * (1/scale_factor);
}
/* We should now draw the bar. Since this code depends on backend this method
should be overwritten in backend. */
}
//
// Modifying Graphic Attributes
//
- (void)setVertical:(BOOL)value
- (NSRect)knobRectFlipped:(BOOL)flipped
{
is_vertical = value;
NSImage* image = [_knobCell image];
NSSize size;
NSPoint origin;
float floatValue;
if (_isVertical && flipped)
_floatValue = _maxValue + _minValue - _floatValue;
floatValue = (_floatValue - _minValue) / (_maxValue - _minValue);
size = [image size];
if (_isVertical) {
origin.x = 0;
origin.y = (_trackRect.size.height - size.height) * floatValue;
}
else {
origin.x = (_trackRect.size.width - size.width) * floatValue;
origin.y = 0;
}
return NSMakeRect (origin.x, origin.y, size.width, size.height);
}
- (int)isVertical
- (void)drawKnob
{
return is_vertical;
[self drawKnob:[self knobRectFlipped:[[self controlView] isFlipped]]];
}
- (void)drawKnob:(NSRect)knobRect
{
[_knobCell drawInteriorWithFrame:knobRect inView:[self controlView]];
}
- (void)drawInteriorWithFrame:(NSRect)cellFrame inView:(NSView*)controlView
{
BOOL vertical = (cellFrame.size.height > cellFrame.size.width);
NSImage* image;
NSSize size;
if (vertical != _isVertical) {
if (vertical) {
image = [NSImage imageNamed:@"common_SliderVert"];
size = [image size];
[_knobCell setImage:image];
[image setSize:NSMakeSize (cellFrame.size.width, size.height)];
}
else {
image = [NSImage imageNamed:@"common_SliderHoriz"];
size = [image size];
[_knobCell setImage:image];
[image setSize:NSMakeSize (size.width, cellFrame.size.height)];
}
}
_isVertical = vertical;
_trackRect = cellFrame;
if (_titleCell)
[_titleCell drawInteriorWithFrame:cellFrame inView:controlView];
[self drawBarInside:cellFrame flipped:[controlView isFlipped]];
[self drawKnob];
}
- (float)knobThickness
{
return knob_thickness;
NSImage* image = [_knobCell image];
NSSize size = [image size];
return _isVertical ? size.height : size.width;
}
- (void)setKnobThickness:(float)aFloat
- (void)setKnobThickness:(float)thickness
{
int old_scroll = scroll_size;
double val_range;
NSImage* image = [_knobCell image];
NSSize size = [image size];
// Recalculate the scroll size
scroll_size = old_scroll + knob_thickness;
knob_thickness = aFloat;
scroll_size -= knob_thickness;
if (_isVertical)
size.height = thickness;
else
size.width = thickness;
val_range = max_value - min_value;
if (val_range != 0)
{
scale_factor = scroll_size/val_range;
if (scale_factor != 0)
page_value = knob_thickness * (1/scale_factor);
}
[image setSize:size];
}
- (void)setTitle:(NSString *)aString
{}
- (void)setTitleCell:(NSCell *)aCell
{}
- (void)setTitleColor:(NSColor *)aColor
{}
- (void)setTitleFont:(NSFont *)fontObject
{}
- (NSString *)title
- (void)setAltIncrementValue:(double)increment
{
return nil;
_altIncrementValue = increment;
}
- (id)titleCell
- (void)setMinValue:(double)aDouble
{
return nil;
_minValue = aDouble;
if (_floatValue < _minValue)
_floatValue = _minValue;
}
- (NSFont *)titleFont
- (void)setMaxValue:(double)aDouble
{
return nil;
_maxValue = aDouble;
if (_floatValue > _maxValue)
_floatValue = _maxValue;
}
- (NSColor *)titleColor
- (id)titleCell { return _titleCell; }
- (NSColor*)titleColor { return [_titleCell textColor]; }
- (NSFont*)titleFont { return [_titleCell font]; }
- (void)setTitle:(NSString*)title { [_titleCell setStringValue:title]; }
- (NSString*)title { return [_titleCell stringValue]; }
- (void)setTitleCell:(NSCell*)aCell { ASSIGN(_titleCell, aCell); }
- (void)setTitleColor:(NSColor*)color { [_titleCell setTextColor:color]; }
- (void)setTitleFont:(NSFont*)font { [_titleCell setFont:font]; }
- (int)isVertical { return _isVertical; }
- (double)altIncrementValue { return _altIncrementValue; }
+ (BOOL)prefersTrackingUntilMouseUp { return YES; }
- (NSRect)trackRect { return _trackRect; }
- (double)minValue { return _minValue; }
- (double)maxValue { return _maxValue; }
- (float)floatValue { return _floatValue; }
- (id)initWithCoder:(NSCoder*)decoder
{
return nil;
}
//
// Displaying the NSSliderCell
//
- (void)drawBarInside:(NSRect)aRect
flipped:(BOOL)flipped
{}
- (void)drawKnob
{}
- (void)drawKnob:(NSRect)knobRect
{}
//
// Modifying Behavior
//
- (double)altIncrementValue
{
return page_value;
}
- (void)setAltIncrementValue:(double)incValue
{
page_value = incValue;
}
//
// Tracking the Mouse
//
+ (BOOL)prefersTrackingUntilMouseUp
{
return NO;
}
- (NSRect)trackRect
{
return NSZeroRect;
}
//
// Displaying
//
- (void)drawWithFrame:(NSRect)cellFrame
inView:(NSView *)controlView
{
}
//
// NSCoding protocol
//
- (void)encodeWithCoder:aCoder
{
[super encodeWithCoder:aCoder];
[aCoder encodeValueOfObjCType: "d" at: &max_value];
[aCoder encodeValueOfObjCType: "d" at: &min_value];
[aCoder encodeValueOfObjCType: "d" at: &scale_factor];
[aCoder encodeValueOfObjCType: "i" at: &scroll_size];
[aCoder encodeValueOfObjCType: "i" at: &knob_thickness];
[aCoder encodeValueOfObjCType: "d" at: &page_value];
[aCoder encodeValueOfObjCType: @encode(BOOL) at: &is_vertical];
}
- initWithCoder:aDecoder
{
[super initWithCoder:aDecoder];
[aDecoder decodeValueOfObjCType: "d" at: &max_value];
[aDecoder decodeValueOfObjCType: "d" at: &min_value];
[aDecoder decodeValueOfObjCType: "d" at: &scale_factor];
[aDecoder decodeValueOfObjCType: "i" at: &scroll_size];
[aDecoder decodeValueOfObjCType: "i" at: &knob_thickness];
[aDecoder decodeValueOfObjCType: "d" at: &page_value];
[aDecoder decodeValueOfObjCType: @encode(BOOL) at: &is_vertical];
self = [super initWithCoder:decoder];
[decoder decodeValuesOfObjCTypes:"ffff",
&_minValue, &_maxValue, &_floatValue, &_altIncrementValue];
return self;
}
@end
- (void)encodeWithCoder:(NSCoder*)coder
{
[coder encodeValuesOfObjCTypes:"ffff",
_minValue, _maxValue, _floatValue, _altIncrementValue];
}
@end

View file

@ -75,7 +75,7 @@
is_field_editor = NO;
background_color = [NSColor whiteColor];
text_color = [NSColor blackColor];
default_font = [NSFont userFontOfSize:16];
default_font = [NSFont userFontOfSize:12];
return self;
}
//

View file

@ -81,7 +81,7 @@
[self setBackgroundColor: [NSColor whiteColor]];
[self setTextColor: [NSColor blackColor]];
[self setFont: [NSFont systemFontOfSize: 16]];
[self setFont: [NSFont systemFontOfSize:12]];
draw_background = YES;
return self;
}

View file

@ -6,8 +6,10 @@
Copyright (C) 1996 Free Software Foundation, Inc.
Author: Scott Christley <scottc@net-community.com>
Ovidiu Predescu <ovidiu@net-community.com>
Date: 1996, 1997
Date: 1996
Heavily changed and extended by Ovidiu Predescu <ovidiu@net-community.com>.
Date: 1997
This file is part of the GNUstep GUI Library.
@ -35,26 +37,19 @@
#include <Foundation/NSLock.h>
#include <Foundation/NSArray.h>
#include <Foundation/NSNotification.h>
#include <Foundation/NSValue.h>
#include <AppKit/NSView.h>
#include <AppKit/NSWindow.h>
#include <AppKit/TrackingRectangle.h>
#include <AppKit/PSMatrix.h>
//
// Class variables
//
@implementation NSView
/* Class variables */
static NSMutableDictionary *gnustep_gui_nsview_thread_dict = nil;
static NSRecursiveLock *gnustep_gui_nsview_lock = nil;
@implementation NSView
//
// Class methods
//
//
// Initialization
//
+ (void)initialize
{
if (self == [NSView class])
@ -66,14 +61,12 @@ static NSRecursiveLock *gnustep_gui_nsview_lock = nil;
// Allocate dictionary for maintaining
// mapping of threads to focused views
gnustep_gui_nsview_thread_dict = [NSMutableDictionary dictionary];
gnustep_gui_nsview_thread_dict = [NSMutableDictionary new];
// Create lock for serializing access to dictionary
gnustep_gui_nsview_lock = [[NSRecursiveLock alloc] init];
}
}
//
// Focusing
//
// +++ Really each thread should have a stack!
//
@ -130,18 +123,11 @@ static NSRecursiveLock *gnustep_gui_nsview_lock = nil;
return current_view;
}
//
// Instance methods
//
//
// Initializing NSView Objects
//
- init
{
return [self initWithFrame:NSZeroRect];
}
// The default initializer
- (id)initWithFrame:(NSRect)frameRect
{
// Our super is NSResponder
@ -171,7 +157,6 @@ static NSRecursiveLock *gnustep_gui_nsview_lock = nil;
window = nil;
is_rotated_from_base = NO;
is_rotated_or_scaled_from_base = NO;
opaque = YES;
disable_autodisplay = NO;
needs_display = YES;
post_frame_changes = NO;
@ -182,6 +167,8 @@ static NSRecursiveLock *gnustep_gui_nsview_lock = nil;
- (void)dealloc
{
[frameMatrix release];
[boundsMatrix release];
[sub_views release];
[tracking_rects release];
[cursor_rects release];
@ -189,9 +176,6 @@ static NSRecursiveLock *gnustep_gui_nsview_lock = nil;
[super dealloc];
}
//
// Managing the NSView Hierarchy
//
- (void)addSubview:(NSView *)aView
{
// make sure we aren't making ourself a subview of ourself or we're not
@ -299,21 +283,8 @@ static NSRecursiveLock *gnustep_gui_nsview_lock = nil;
- (void)sortSubviewsUsingFunction:(int (*)(id ,id ,void *))compare
context:(void *)context
{}
- (NSMutableArray *)subviews
{
return sub_views;
}
- (NSView *)superview
{
return super_view;
}
- (void)setSuperview:(NSView *)superview
{
super_view = superview;
[sub_views sortUsingFunction:compare context:context];
}
- (NSWindow *)window
@ -338,23 +309,10 @@ static NSRecursiveLock *gnustep_gui_nsview_lock = nil;
}
//
// Modifying the Frame Rectangle
//
- (float)frameRotation
{
return [frameMatrix rotationAngle];
}
- (NSRect)frame
{
return frame;
}
- (void)rotateByAngle:(float)angle
{
[boundsMatrix rotateByAngle:angle];
is_rotated_from_base = is_rotated_or_scaled_from_base = YES;
if (post_bounds_changes)
[[NSNotificationCenter defaultCenter]
@ -403,41 +361,31 @@ static NSRecursiveLock *gnustep_gui_nsview_lock = nil;
- (void)setFrameRotation:(float)angle
{
[frameMatrix setFrameRotation:angle];
is_rotated_from_base = is_rotated_or_scaled_from_base = YES;
if (post_frame_changes)
[[NSNotificationCenter defaultCenter]
postNotificationName:NSViewFrameDidChangeNotification object:self];
}
//
// Modifying the Coordinate System
//
- (float)boundsRotation
{
return [boundsMatrix rotationAngle];
}
- (NSRect)bounds
{
return bounds;
}
- (BOOL)isFlipped
{
return NO;
}
- (BOOL)isRotatedFromBase
{
// TODO
return is_rotated_from_base;
if (is_rotated_from_base)
return is_rotated_from_base;
else if (super_view)
return [super_view isRotatedFromBase];
else
return NO;
}
- (BOOL)isRotatedOrScaledFromBase
{
// TODO
return is_rotated_or_scaled_from_base;
if (is_rotated_or_scaled_from_base)
return is_rotated_or_scaled_from_base;
else if (super_view)
return [super_view isRotatedOrScaledFromBase];
else
return NO;
}
- (void)scaleUnitSquareToSize:(NSSize)newSize
@ -450,6 +398,8 @@ static NSRecursiveLock *gnustep_gui_nsview_lock = nil;
bounds.size.width = frame.size.width / newSize.width;
bounds.size.height = frame.size.height / newSize.height;
is_rotated_or_scaled_from_base = YES;
[boundsMatrix scaleBy:frame.size.width / bounds.size.width
:frame.size.height / bounds.size.height];
@ -460,10 +410,17 @@ static NSRecursiveLock *gnustep_gui_nsview_lock = nil;
- (void)setBounds:(NSRect)aRect
{
float sx, sy;
bounds = aRect;
[boundsMatrix setFrameOrigin:bounds.origin];
[boundsMatrix scaleTo:frame.size.width / bounds.size.width
:frame.size.height / bounds.size.height];
[boundsMatrix setFrameOrigin:
NSMakePoint(-bounds.origin.x, -bounds.origin.y)];
sx = frame.size.width / bounds.size.width;
sy = frame.size.height / bounds.size.height;
[boundsMatrix scaleTo:sx :sy];
if (sx != 1 || sy != 1)
is_rotated_or_scaled_from_base = YES;
if (post_bounds_changes)
[[NSNotificationCenter defaultCenter]
@ -473,7 +430,9 @@ static NSRecursiveLock *gnustep_gui_nsview_lock = nil;
- (void)setBoundsOrigin:(NSPoint)newOrigin
{
bounds.origin = newOrigin;
[boundsMatrix setFrameOrigin:newOrigin];
/* We have to translate the origin of the bounds in the oposite direction
so that the newOrigin becomes the origin when viewed. */
[boundsMatrix setFrameOrigin:NSMakePoint(-newOrigin.x, -newOrigin.y)];
if (post_bounds_changes)
[[NSNotificationCenter defaultCenter]
@ -482,9 +441,15 @@ static NSRecursiveLock *gnustep_gui_nsview_lock = nil;
- (void)setBoundsSize:(NSSize)newSize
{
float sx, sy;
bounds.size = newSize;
[boundsMatrix scaleTo:frame.size.width / bounds.size.width
:frame.size.height / bounds.size.height];
sx = frame.size.width / bounds.size.width;
sy = frame.size.height / bounds.size.height;
[boundsMatrix scaleTo:sx :sy];
if (sx != 1 || sy != 1)
is_rotated_or_scaled_from_base = YES;
if (post_bounds_changes)
[[NSNotificationCenter defaultCenter]
@ -494,6 +459,7 @@ static NSRecursiveLock *gnustep_gui_nsview_lock = nil;
- (void)setBoundsRotation:(float)angle
{
[boundsMatrix setFrameRotation:angle];
is_rotated_from_base = is_rotated_or_scaled_from_base = YES;
if (post_bounds_changes)
[[NSNotificationCenter defaultCenter]
@ -509,9 +475,6 @@ static NSRecursiveLock *gnustep_gui_nsview_lock = nil;
postNotificationName:NSViewBoundsDidChangeNotification object:self];
}
//
// Converting Coordinates
//
- (NSRect)centerScanRect:(NSRect)aRect
{
return NSZeroRect;
@ -672,14 +635,6 @@ static NSRecursiveLock *gnustep_gui_nsview_lock = nil;
return [aView convertSize:aSize fromView:self];
}
//
// Notifying Ancestor Views
//
- (BOOL)postsFrameChangedNotifications
{
return post_frame_changes;
}
- (void)setPostsFrameChangedNotifications:(BOOL)flag
{
post_frame_changes = flag;
@ -690,14 +645,6 @@ static NSRecursiveLock *gnustep_gui_nsview_lock = nil;
post_bounds_changes = flag;
}
- (BOOL)postsBoundsChangedNotifications
{
return post_bounds_changes;
}
//
// Resizing Subviews
//
- (void)resizeSubviewsWithOldSize:(NSSize)oldSize
{
id e, o;
@ -726,25 +673,14 @@ static NSRecursiveLock *gnustep_gui_nsview_lock = nil;
autoresize_subviews = flag;
}
- (BOOL)autoresizesSubviews
{
return autoresize_subviews;
}
- (void)setAutoresizingMask:(unsigned int)mask
{}
- (unsigned int)autoresizingMask
{
return 0;
autoresizingMask = mask;
}
- (void)resizeWithOldSuperviewSize:(NSSize)oldSize
{}
//
// Graphics State Objects
//
- (void)allocateGState
{}
@ -762,9 +698,6 @@ static NSRecursiveLock *gnustep_gui_nsview_lock = nil;
- (void)setUpGState
{}
//
// Focusing
//
- (void)lockFocus
{
NSView *s = [self superview];
@ -789,51 +722,83 @@ static NSRecursiveLock *gnustep_gui_nsview_lock = nil;
[[self class] popFocusView];
}
//
// Displaying
//
- (BOOL)canDraw
{
// TODO
return YES;
}
- (void)_setNeedsFlush
{
[window _setNeedsFlush];
}
- (void)display
{
int i, j;
if (!boundsMatrix || !frameMatrix)
NSLog (@"warning: %@ %p has not setup the PS matrices",
NSStringFromClass(isa), self);
[self lockFocus];
[self drawRect:bounds];
[self unlockFocus];
// Tell subviews to display
j = [sub_views count];
for (i = 0;i < j; ++i)
[(NSView *)[sub_views objectAtIndex:i] display];
[[self window] flushWindow];
invalidatedRectangle = NSZeroRect;
[self displayRect:bounds];
}
- (void)displayIfNeeded
{
if ((needs_display) && (opaque)) {
[self display];
[self setNeedsDisplay:NO];
if (needs_display) {
NSRect rect = invalidatedRectangle;
invalidatedRectangle = NSZeroRect;
[self displayRect:rect];
}
}
- (void)displayIfNeededIgnoringOpacity
{
if (needs_display) {
[self display];
[self setNeedsDisplay:NO];
NSRect rect = invalidatedRectangle;
invalidatedRectangle = NSZeroRect;
[self displayRect:rect];
}
}
- (void)displayRect:(NSRect)aRect
{}
- (void)displayRect:(NSRect)rect
{
int i, count;
if (!boundsMatrix || !frameMatrix)
NSLog (@"warning: %@ %p has not have the PS matrices setup!",
NSStringFromClass(isa), self);
// NSLog (@"NSView displayRect:");
needs_display = NO;
[self lockFocus];
[self drawRect:rect];
[window _setNeedsFlush];
// [window _view:self needsFlushInRect:rect];
[self unlockFocus];
// Tell subviews to display
for (i = 0, count = [sub_views count]; i < count; ++i) {
NSView* subview = [sub_views objectAtIndex:i];
NSRect subviewFrame = subview->frame;
NSRect intersection;
/* If the subview is rotated compute its bounding rectangle and use this
one instead of the subview's frame. */
if ([subview->frameMatrix isRotated])
[subview->frameMatrix boundingRectFor:subviewFrame result:&subviewFrame];
/* Determine if the subview's frame intersects "rect"
so that we can display the subview. */
intersection = NSIntersectionRect (rect, subviewFrame);
if (intersection.origin.x || intersection.origin.y
|| intersection.size.width || intersection.size.height) {
/* Convert the intersection rectangle to the subview's coordinates */
intersection = [subview convertRect:intersection fromView:self];
[subview displayRect:intersection];
}
}
}
- (void)displayRectIgnoringOpacity:(NSRect)aRect
{}
@ -846,29 +811,153 @@ static NSRecursiveLock *gnustep_gui_nsview_lock = nil;
return bounds;
}
- (BOOL)isOpaque
- (void)_addSubviewForNeedingDisplay:(NSView*)view
{
return opaque;
}
NSView* currentView;
- (BOOL)needsDisplay
{
return needs_display;
/* Add view in the list of sibling subviews that need display. First
check if view is not already there. */
currentView = _subviewsThatNeedDisplay;
while (currentView) {
if (currentView == view)
return;
currentView = currentView->_nextSiblingSubviewThatNeedsDisplay;
}
/* view is not in the list of subviews that need display; add it.
To do this concatenate the "view"'s list of siblings to the list of
subviews. Find the last element in the "view"'s list of siblings and
assign to its _nextSiblingSubviewThatNeedsDisplay ivar the first element
of the subviews that need display list in self.
*/
currentView = view;
while (currentView->_nextSiblingSubviewThatNeedsDisplay)
currentView = currentView->_nextSiblingSubviewThatNeedsDisplay;
currentView->_nextSiblingSubviewThatNeedsDisplay = _subviewsThatNeedDisplay;
_subviewsThatNeedDisplay = view;
/* Now add recursively do the same algorithm with self. This way we'll create
a subtree of views that need display inside the views hierarchy. */
if (super_view)
[super_view _addSubviewForNeedingDisplay:self];
}
- (void)setNeedsDisplay:(BOOL)flag
{
needs_display = flag;
if (needs_display) {
// NSLog (@"NSView setNeedsDisplay:");
invalidatedRectangle = bounds;
[window _setNeedsDisplay];
if (super_view)
[super_view _addSubviewForNeedingDisplay:self];
}
}
- (void)setNeedsDisplayInRect:(NSRect)invalidRect
- (void)setNeedsDisplayInRect:(NSRect)rect
{
// NSLog (@"NSView setNeedsDisplayInRect:");
needs_display = YES;
invalidatedRectangle = NSUnionRect (invalidatedRectangle, rect);
[window _setNeedsDisplay];
if (super_view)
[super_view _addSubviewForNeedingDisplay:self];
}
- (BOOL)shouldDrawColor
- (void)_recursivelyResetNeedsDisplayInAllViews
{
return YES;
NSView* currentView = _subviewsThatNeedDisplay;
NSView* nextView;
while (currentView) {
nextView = currentView->_nextSiblingSubviewThatNeedsDisplay;
[currentView _recursivelyResetNeedsDisplayInAllViews];
currentView->_nextSiblingSubviewThatNeedsDisplay = NULL;
currentView = nextView;
}
_subviewsThatNeedDisplay = NULL;
}
- (void)_displayNeededViews
{
NSView* subview;
if (needs_display)
[self displayIfNeeded];
subview = _subviewsThatNeedDisplay;
while (subview) {
[subview _displayNeededViews];
subview = subview->_nextSiblingSubviewThatNeedsDisplay;
}
}
- (void)_collectInvalidatedRectanglesInArray:(NSMutableArray*)array
originMatrix:(PSMatrix*)originMatrix
sizeMatrix:(PSMatrix*)sizeMatrix
{
PSMatrix* copyOfOriginMatrix;
PSMatrix* copyOfSizeMatrix;
NSView* subview = _subviewsThatNeedDisplay;
// NSLog (@"_collectInvalidatedRectanglesInArray");
while (subview) {
NSRect subviewFrame;
NSRect intersection;
/* Create copies of the original matrices passed by superview */
copyOfOriginMatrix = [originMatrix copy];
copyOfSizeMatrix = [sizeMatrix copy];
/* Concatenate the matrices copies with the subview matrices */
[copyOfOriginMatrix concatenateWith:subview->frameMatrix];
[copyOfOriginMatrix concatenateWith:subview->boundsMatrix];
[copyOfSizeMatrix concatenateWith:subview->boundsMatrix];
if (subview->needs_display) {
subviewFrame = subview->invalidatedRectangle;
/* If the subview is rotated compute its bounding rectangle and use this
one instead of the invalidated rectangle. */
if ([subview->frameMatrix isRotated])
[subview->frameMatrix boundingRectFor:subviewFrame
result:&subviewFrame];
/* Determine if the subview's invalidated frame rectangle intersects
our bounds to find out if the subview gets displayed. */
intersection = NSIntersectionRect (bounds, subviewFrame);
if (intersection.origin.x || intersection.origin.y
|| intersection.size.width || intersection.size.height) {
/* Convert the intersection rectangle to the window coordinates */
intersection.origin
= [copyOfOriginMatrix pointInMatrixSpace:intersection.origin];
intersection.size
= [copyOfSizeMatrix sizeInMatrixSpace:intersection.size];
[array addObject:[NSValue valueWithRect:intersection]];
}
}
else
[subview _collectInvalidatedRectanglesInArray:array
originMatrix:copyOfOriginMatrix
sizeMatrix:copyOfSizeMatrix];
[copyOfOriginMatrix release];
[copyOfSizeMatrix release];
subview = subview->_nextSiblingSubviewThatNeedsDisplay;
}
}
- (NSRect)_boundingRectFor:(NSRect)rect
{
NSRect new;
[frameMatrix boundingRectFor:rect result:&new];
return new;
}
//
@ -950,19 +1039,6 @@ static NSRecursiveLock *gnustep_gui_nsview_lock = nil;
- (void)resetCursorRects
{}
- (NSArray *)cursorRectangles
{
return cursor_rects;
}
//
// Assigning a Tag
//
- (int)tag
{
return -1;
}
- (id)viewWithTag:(int)aTag
{
int i, count;
@ -1000,7 +1076,7 @@ static NSRecursiveLock *gnustep_gui_nsview_lock = nil;
// Check our sub_views
count = [sub_views count];
for (i = 0; i < count; ++i)
for (i = count - 1; i >= 0; i--)
{
w = [sub_views objectAtIndex:i];
v = [w hitTest:p];
@ -1243,24 +1319,13 @@ static NSRecursiveLock *gnustep_gui_nsview_lock = nil;
NSDebugLog(@"NSView: start encoding\n");
[aCoder encodeRect: frame];
[aCoder encodeRect: bounds];
#if 0
[aCoder encodeObjectReference: super_view withName: @"Superview"];
#else
[aCoder encodeConditionalObject:super_view];
#endif
[aCoder encodeObject: sub_views];
#if 0
[aCoder encodeObjectReference: window withName: @"Window"];
#else
[aCoder encodeConditionalObject:window];
#endif
[aCoder encodeObject: tracking_rects];
[aCoder encodeValueOfObjCType:@encode(BOOL) at: &is_rotated_from_base];
[aCoder encodeValueOfObjCType:@encode(BOOL)
at: &is_rotated_or_scaled_from_base];
[aCoder encodeValueOfObjCType:@encode(BOOL) at: &opaque];
[aCoder encodeValueOfObjCType:@encode(BOOL) at: &needs_display];
[aCoder encodeValueOfObjCType:@encode(BOOL) at: &disable_autodisplay];
[aCoder encodeValueOfObjCType:@encode(BOOL) at: &post_frame_changes];
@ -1275,25 +1340,13 @@ static NSRecursiveLock *gnustep_gui_nsview_lock = nil;
NSDebugLog(@"NSView: start decoding\n");
frame = [aDecoder decodeRect];
bounds = [aDecoder decodeRect];
#if 0
[aDecoder decodeObjectAt: &super_view withName: NULL];
#else
super_view = [aDecoder decodeObject];
#endif
sub_views = [aDecoder decodeObject];
#if 0
[aDecoder decodeObjectAt: &window withName: NULL];
#else
window = [aDecoder decodeObject];
#endif
tracking_rects = [aDecoder decodeObject];
[aDecoder decodeValueOfObjCType:@encode(BOOL) at: &is_rotated_from_base];
[aDecoder decodeValueOfObjCType:@encode(BOOL)
at: &is_rotated_or_scaled_from_base];
[aDecoder decodeValueOfObjCType:@encode(BOOL) at: &opaque];
[aDecoder decodeValueOfObjCType:@encode(BOOL) at: &needs_display];
[aDecoder decodeValueOfObjCType:@encode(BOOL) at: &disable_autodisplay];
[aDecoder decodeValueOfObjCType:@encode(BOOL) at: &post_frame_changes];
@ -1303,4 +1356,25 @@ static NSRecursiveLock *gnustep_gui_nsview_lock = nil;
return self;
}
/* Accessor methods */
- (NSMutableArray *)subviews { return sub_views; }
- (NSView *)superview { return super_view; }
- (void)setSuperview:(NSView *)superview { super_view = superview; }
- (NSRect)frame { return frame; }
- (float)frameRotation { return [frameMatrix rotationAngle]; }
- (BOOL)shouldDrawColor { return YES; }
- (BOOL)isOpaque { return NO; }
- (BOOL)needsDisplay { return needs_display; }
- (BOOL)autoresizesSubviews { return autoresize_subviews; }
- (unsigned int)autoresizingMask { return autoresizingMask; }
- (int)tag { return -1; }
- (NSArray *)cursorRectangles { return cursor_rects; }
- (float)boundsRotation { return [boundsMatrix rotationAngle]; }
- (NSRect)bounds { return bounds; }
- (BOOL)isFlipped { return NO; }
- (BOOL)postsFrameChangedNotifications { return post_frame_changes; }
- (BOOL)postsBoundsChangedNotifications { return post_bounds_changes; }
- (PSMatrix*)_frameMatrix { return frameMatrix; }
- (PSMatrix*)_boundsMatrix { return boundsMatrix; }
@end

View file

@ -32,6 +32,7 @@
#include <Foundation/NSCoder.h>
#include <Foundation/NSArray.h>
#include <Foundation/NSNotification.h>
#include <Foundation/NSValue.h>
#include <AppKit/NSWindow.h>
#include <AppKit/NSApplication.h>
@ -43,6 +44,7 @@
#include <AppKit/NSSliderCell.h>
#include <AppKit/NSScreen.h>
#include <AppKit/NSCursor.h>
#include <AppKit/PSMatrix.h>
#define ASSIGN(variable, value) \
[value retain]; \
@ -54,6 +56,8 @@
//
@implementation NSWindow
static BOOL _needsFlushWindows = YES;
//
// Class methods
//
@ -89,8 +93,7 @@
+ (NSRect)minFrameWidthWithTitle:(NSString *)aTitle
styleMask:(unsigned int)aStyle
{
NSRect t;
return t;
return NSZeroRect;
}
// Screens and window depths
@ -99,6 +102,13 @@
return 8;
}
+ (void)_setNeedsFlushWindows:(BOOL)flag
{
_needsFlushWindows = flag;
}
+ (BOOL)_needsFlushWindows { return _needsFlushWindows; }
//
// Instance methods
//
@ -126,6 +136,7 @@
[miniaturized_title release];
[miniaturized_image release];
[window_title release];
[_flushRectangles release];
[super dealloc];
}
@ -185,6 +196,8 @@
// Register ourselves with the Application object
[theApp addWindowsItem:self title:window_title filename:NO];
_flushRectangles = [[NSMutableArray alloc] initWithCapacity:10];
NSDebugLog(@"NSWindow end of init\n");
return self;
}
@ -592,24 +605,36 @@
//
// Managing the display
//
- (void)display
{
visible = YES;
// Tell the first responder that it is the first responder
// So it can set the focus to itself
[first_responder becomeFirstResponder];
}
- (void)disableFlushWindow
{
disable_flush_window = YES;
}
- (void)display
{
visible = YES;
needs_display = NO;
// Tell the first responder that it is the first responder
// So it can set the focus to itself
[first_responder becomeFirstResponder];
/* Temporary disable displaying */
[self disableFlushWindow];
// Draw the content view
[content_view display];
/* Reenable displaying and flush the window */
[self enableFlushWindow];
}
- (void)displayIfNeeded
{
if (needs_display)
[self display];
if (needs_display) {
[content_view _displayNeededViews];
needs_display = NO;
}
}
- (void)enableFlushWindow
@ -618,12 +643,41 @@
}
- (void)flushWindow
{}
{
needs_flush = NO;
[_flushRectangles removeAllObjects];
[content_view _recursivelyResetNeedsDisplayInAllViews];
}
- (void)flushWindowIfNeeded
{
if (!disable_flush_window && needs_flush)
if (!disable_flush_window && needs_flush) {
needs_flush = NO;
[self flushWindow];
}
}
- (void)_collectFlushRectangles
{
PSMatrix* originMatrix;
PSMatrix* sizeMatrix;
if (disable_flush_window || backing_type == NSBackingStoreNonretained)
return;
// NSLog (@"_collectFlushRectangles");
[_flushRectangles removeAllObjects];
originMatrix = [[content_view _frameMatrix] copy];
[originMatrix concatenateWith:[content_view _boundsMatrix]];
sizeMatrix = [[content_view _boundsMatrix] copy];
[content_view _collectInvalidatedRectanglesInArray:_flushRectangles
originMatrix:originMatrix
sizeMatrix:sizeMatrix];
[originMatrix release];
[sizeMatrix release];
}
- (BOOL)isAutodisplay
@ -1244,6 +1298,8 @@
break;
}
}
[NSWindow _flushWindows];
}
- (BOOL)tryToPerform:(SEL)anAction with:anObject
@ -1336,9 +1392,6 @@
- (void)print:sender
{}
- (void)_setNeedsFlush:(BOOL)flag { needs_flush = flag; }
- (BOOL)_needsFlush { return needs_flush; }
//
// Assigning a delegate
//
@ -1462,6 +1515,65 @@
return [delegate windowWillMove:aNotification];
}
- (void)_setNeedsFlush
{
// NSLog (@"NSWindow _setNeedsFlush");
needs_flush = YES;
_needsFlushWindows = YES;
}
- (void)_view:(NSView*)view needsFlushInRect:(NSRect)rect
{
[self _setNeedsFlush];
/* Convert the rectangle to the window coordinates */
rect = [view convertRect:rect toView:nil];
/* If the view is rotated then compute the bounding box of the rectangle in
the window's coordinates */
if ([view isRotatedFromBase])
rect = [view _boundingRectFor:rect];
/* TODO: Optimize adding rect to the already existing arrays */
[_flushRectangles addObject:[NSValue valueWithRect:rect]];
}
- (void)_setNeedsDisplay
{
// NSLog (@"NSWindow setNeedsDisplay");
needs_display = YES;
[self _setNeedsFlush];
}
- (BOOL)_needsFlush { return needs_flush; }
+ (BOOL)_flushWindows
{
int i, count;
NSArray* windowList;
if (!_needsFlushWindows)
return NO;
// NSLog (@"_flushWindows");
windowList = [[NSApplication sharedApplication] windows];
for (i = 0, count = [windowList count]; i < count; i++) {
NSWindow* window = [windowList objectAtIndex:i];
if (window->needs_display || window->needs_flush) {
[window _collectFlushRectangles];
[window displayIfNeeded];
[window flushWindowIfNeeded];
}
}
_needsFlushWindows = NO;
return YES;
}
//
// NSCoding protocol
//

View file

@ -183,6 +183,60 @@ static const float pi = 3.1415926535897932384626433;
TX = newTX; TY = newTY;
}
- (BOOL)isRotated
{
return rotationAngle != 0;
}
- (void)boundingRectFor:(NSRect)rect result:(NSRect*)new
{
float angle = rotationAngle
- ((int)(rotationAngle / 360)) * rotationAngle;
float angleRad = pi * angle / 180;
float angle90Rad = pi * (angle + 90) / 180;
float cosWidth, cosHeight, sinWidth, sinHeight;
/* Shortcuts of the usual rect values */
float x = rect.origin.x;
float y = rect.origin.y;
float width = rect.size.width;
float height = rect.size.height;
if (rotationAngle == 0) {
*new = NSZeroRect;
return;
}
cosWidth = cos(angleRad);
cosHeight = cos(angle90Rad);
sinWidth = sin(angleRad);
sinHeight = sin(angle90Rad);
if (angle <= 90) {
new->origin.x = x + height * cosHeight;
new->origin.y = y;
new->size.width = width * cosWidth - height * cosHeight;
new->size.height = width * sinWidth + height * sinHeight;
}
else if (angle <= 180) {
new->origin.x = x + width * cosWidth + height * cosHeight;
new->origin.y = y + height * sinHeight;
new->size.width = -width * cosWidth - height * cosHeight;
new->size.height = width * sinWidth - height * sinHeight;
}
else if (angle <= 270) {
new->origin.x = x + width * cosWidth;
new->origin.y = y + width * sinWidth + height * sinHeight;
new->size.width = -width * cosWidth + height * cosHeight;
new->size.height = -width * sinWidth - height * sinHeight;
}
else {
new->origin.x = x;
new->origin.y = y;
new->size.width = width * cosWidth + height * cosHeight;
new->size.height = width * sinWidth + height * sinHeight;
}
}
- (NSPoint)pointInMatrixSpace:(NSPoint)point
{
NSPoint new;
@ -203,6 +257,18 @@ static const float pi = 3.1415926535897932384626433;
return new;
}
- (NSRect)rectInMatrixSpace:(NSRect)rect
{
NSRect new;
new.origin.x = A * rect.origin.x + C * rect.origin.y + TX;
new.origin.y = B * rect.origin.x + D * rect.origin.y + TY;
new.size.width = A * rect.size.width + C * rect.size.height + TX;
new.size.height = B * rect.size.width + D * rect.size.height + TY;
return new;
}
- (NSString*)description
{
return [NSString stringWithFormat:@"PSMatrix ((%f, %f) (%f, %f) (%f, %f))",

View file

@ -219,6 +219,7 @@ NSString *NSPrintRightMargin = @"PrintRightMargin";
NSString *NSPrintSavePath = @"PrintSavePath";
NSString *NSPrintScalingFactor = @"PrintScalingFactor";
NSString *NSPrintTopMargin = @"PrintTopMargin";
NSString *NSPrintHorizontalPagination = @"PrintHorizontalPagination";
NSString *NSPrintVerticalPagination = @"PrintVerticalPagination";
NSString *NSPrintVerticallyCentered = @"PrintVerticallyCentered";

287
aclocal.m4 vendored
View file

@ -1,287 +0,0 @@
# aclocal.m4 - configure macros for libobjects and projects that depend on it.
#
# Copyright (C) 1995, 1996 Free Software Foundation, Inc.
#
# Author: Adam Fedor <fedor@boulder.colorado.edu>
# Author: Ovidiu Predescu <ovidiu@bx.logicnet.ro>
#
# This file is part of the GNU Objective-C 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.
AC_DEFUN(OBJC_SYS_AUTOLOAD,
[dnl
#--------------------------------------------------------------------
# Guess if we are using a object file format that supports automatic
# loading of constructor functions, et. al. (e.g. ELF format).
#
# Currently only looks for ELF format. NOTE: Checking for __ELF__ being
# defined doesnt work, since gcc on Solaris does not define this. I'm
# assuming that machines that have elf.h use the ELF library format, what
# is really needed is to check if this is true directly.
#
# Makes the following substitutions:
# Defines SYS_AUTOLOAD (whether initializer functions are autoloaded)
# Defines CON_AUTOLOAD (whether constructor functions are autoloaded)
#--------------------------------------------------------------------
AC_CACHE_VAL(objc_cv_sys_autoload,
[AC_CHECK_HEADER(elf.h, [objc_cv_sys_autoload=yes], [objc_cv_sys_autoload=no])
])
if test $objc_cv_sys_autoload = yes; then
AC_DEFINE(CON_AUTOLOAD)
fi
AC_CACHE_VAL(objc_subinit_worked,
[AC_MSG_CHECKING(loading of initializer functions)
AC_TRY_RUN([
static char *argv0 = 0;
static char *env0 = 0;
static void args_test (int argc, char *argv[], char *env[])
{
argv0 = argv[0];
env0 = env[0];
}
static void * __libobjects_subinit_args__
__attribute__ ((section ("__libc_subinit"))) = &(args_test);
int main(int argc, char *argv[])
{
if (argv[0] == argv0 && env[0] == env0)
exit (0);
exit (1);
}
], objc_subinit_worked=yes, objc_subinit_worked=no, objc_subinit_worked=no)])
if test $objc_subinit_worked = yes; then
AC_DEFINE(SYS_AUTOLOAD)
AC_MSG_RESULT(yes)
else
AC_MSG_RESULT(no)
fi
])
AC_DEFUN(OBJC_SYS_DYNAMIC_LINKER,
[dnl
#--------------------------------------------------------------------
# Guess the type of dynamic linker for the system
#
# Makes the following substitutions:
# DYNAMIC_LINKER - cooresponds to the interface that is included
# in objc-load.c (i.e. #include "${DYNAMIC_LINKER}-load.h")
# LIBS - Updated to include the system library that
# performs dynamic linking.
#--------------------------------------------------------------------
DYNAMIC_LINKER=null
AC_CHECK_LIB(dl, dlopen, [DYNAMIC_LINKER=simple LIBS="${LIBS} -ldl"])
if test $DYNAMIC_LINKER = null; then
AC_CHECK_LIB(dld, main, [DYNAMIC_LINKER=dld LIBS="${LIBS} -ldld"])
AC_CHECK_HEADER(dld/defs.h, objc_found_dld_defs=yes, objc_found_dld_defs=no)
# Try to distinguish between GNU dld and HPUX dld
AC_CHECK_HEADER(dl.h, [DYNAMIC_LINKER=hpux])
if test $ac_cv_lib_dld = yes && test $objc_found_dld_defs = no && test $ac_cv_header_dl_h = no; then
AC_MSG_WARN(Could not find dld/defs.h header)
echo
echo "Currently, the dld/defs.h header is needed to get information"
echo "about how to use GNU dld. Some files may not compile without"
echo "this header."
echo
fi
fi
AC_SUBST(DYNAMIC_LINKER)dnl
AC_SUBST(DLD_INCLUDE)dnl
])
AC_DEFUN(OBJC_SYS_DYNAMIC_FLAGS,
[AC_REQUIRE([OBJC_SYS_DYNAMIC_LINKER])dnl
AC_REQUIRE([OBJC_SYS_AUTOLOAD])dnl
#--------------------------------------------------------------------
# Set the flags for compiling dynamically loadable objects
#
# Makes the following substitutions:
# DYNAMIC_BUNDLER_LINKER - The command to link the object files into
# a dynamically loadable module.
# DYNAMIC_LDFLAGS - Flags required when compiling the main program
# that will do the dynamic linking
# DYNAMIC_CFLAGS - Flags required when compiling the object files that
# will be included in the loaded module.
#--------------------------------------------------------------------
if test $DYNAMIC_LINKER = dld; then
DYNAMIC_BUNDLER_LINKER="ld -r"
DYNAMIC_LDFLAGS="-static"
DYNAMIC_CFLAGS=""
elif test $DYNAMIC_LINKER = simple; then
if test $objc_cv_sys_autoload = yes; then
DYNAMIC_BUNDLER_LINKER='$(CC) -Xlinker -r'
else
DYNAMIC_BUNDLER_LINKER='$(CC) -nostdlib'
fi
DYNAMIC_LDFLAGS=""
DYNAMIC_CFLAGS="-fPIC"
elif test $DYNAMIC_LINKER = hpux; then
DYNAMIC_BUNDLER_LINKER='$(CC) -nostdlib -Xlinker -b'
DYNAMIC_LDFLAGS="-Xlinker -E"
DYNAMIC_CFLAGS="-fPIC"
elif test $DYNAMIC_LINKER = null; then
DYNAMIC_BUNDLER_LINKER='$(CC) -nostdlib -Xlinker -r'
DYNAMIC_LDFLAGS=""
DYNAMIC_CFLAGS=""
else
DYNAMIC_BUNDLER_LINKER='$(CC) -nostdlib -Xlinker -r'
DYNAMIC_LDFLAGS=""
DYNAMIC_CFLAGS=""
fi
AC_SUBST(DYNAMIC_BUNDLER_LINKER)dnl
AC_SUBST(DYNAMIC_LDFLAGS)dnl
AC_SUBST(DYNAMIC_CFLAGS)dnl
])
AC_DEFUN(AC_LANG_OBJECTIVE_C,
[AC_REQUIRE([AC_PROG_CC])dnl
define([AC_LANG], [AC_LANG_OBJECTIVE_C])dnl
ac_ext=m
# CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options.
ac_cpp='$CPP $OBJC_RUNTIME_FLAG'
ac_compile='${CC-cc} -c $OBJC_RUNTIME_FLAG $CFLAGS conftest.$ac_ext 1>&AC_FD_CC 2>&AC_FD_CC'
ac_link='${CC-cc} -o conftest $OBJC_RUNTIME_FLAG $CFLAGS $LDFLAGS conftest.$ac_ext $LIBS $OBJC_LIBS 1>&AC_FD_CC 2>&AC_FD_CC'
])dnl
AC_DEFUN(AC_FIND_FOUNDATION,
[dnl
AC_SUBST(FOUNDATION_LIBRARY)dnl
dnl
AC_REQUIRE([AC_PROG_CC])dnl
AC_REQUIRE([AC_C_CROSS])dnl
AC_MSG_CHECKING(for the Foundation library)
OBJC_LIBS=
AC_CACHE_VAL(ac_cv_foundation_library,
[AC_LANG_SAVE[]dnl
AC_LANG_OBJECTIVE_C[]
AC_TRY_COMPILE(
#include <Foundation/preface.h>
,
, ac_cv_foundation_library="$ac_cv_foundation_library gnustep-base")
AC_TRY_COMPILE(
#include <Foundation/exceptions/FoundationException.h>
,
, ac_cv_foundation_library="$ac_cv_foundation_library libFoundation")
AC_TRY_COMPILE(
#include <objects/stdobjects.h>
,
, ac_cv_foundation_library="$ac_cv_foundation_library libobjects")
AC_LANG_RESTORE[]dnl
if test "$FOUNDATION" = ""; then
AC_TRY_CPP(
#include <foundation/NSObject.h>
, ac_cv_foundation_library=foundation)
else
ac_cv_foundation_library=$FOUNDATION
fi
])dnl
libs_found=`echo ${ac_cv_foundation_library} | awk '{print NF}' -`
if test $libs_found -gt 1; then
echo "" 1>&2
AC_MSG_ERROR([More than one Foundation library installed on your system. In the FOUNDATION variable you must specify exactly one of the following libraries: ${ac_cv_foundation_library}])
fi
FOUNDATION_LIBRARY=`echo ${ac_cv_foundation_library} | awk '{print $1}'`
case "$FOUNDATION_LIBRARY" in
foundation)
OBJC_RUNTIME=next
# save the prefix
old_prefix=$prefix
prefix=$ac_default_prefix
CFLAGS="-I`eval \"echo $includedir\"`/next $CFLAGS"
# restore the value of prefix
prefix=$old_prefix
OBJC_LIBS="-lFoundation_s";
AC_DEFINE(NeXT_foundation_LIBRARY);;
libobjects)
OBJC_LIBS="-lobjects"
AC_DEFINE(GNUSTEP_BASE_LIBRARY);;
gnustep-base)
OBJC_LIBS="-lgnustep-base"
AC_DEFINE(GNUSTEP_BASE_LIBRARY);;
libFoundation)
if test "$FOUNDATION_LIB" = ""; then
FOUNDATION_LIB=Foundation
fi
OBJC_LIBS="-l${FOUNDATION_LIB}"
AC_DEFINE(LIB_FOUNDATION_LIBRARY);;
*)
AC_MSG_ERROR(Unknown $FOUNDATION_LIBRARY library!);;
esac
AC_MSG_RESULT(${ac_cv_foundation_library})
AC_DETERMINE_FOUNDATION_RUNTIME
])dnl
AC_DEFUN(AC_DETERMINE_FOUNDATION_RUNTIME,
[dnl
AC_SUBST(OBJC_RUNTIME)dnl
AC_SUBST(OBJC_RUNTIME_FLAG)dnl
dnl
AC_REQUIRE([AC_PROG_CC])dnl
AC_REQUIRE([AC_C_CROSS])dnl
AC_MSG_CHECKING(for the Objective-C runtime)
AC_CACHE_VAL(ac_cv_objc_runtime,
[if test "$OBJC_RUNTIME" = ""; then
AC_LANG_SAVE[]dnl
AC_LANG_OBJECTIVE_C[]
AC_TRY_LINK([#include <Foundation/NSString.h>],
[extern id objc_lookUpClass(char*);
id class = objc_lookUpClass("NSObject");
id obj = [class alloc];
puts([[obj description] cString]);
], ac_cv_objc_runtime=NeXT, ac_cv_objc_runtime=unknown)
if test $ac_cv_objc_runtime = unknown; then
OBJC_RUNTIME_FLAG=-fgnu-runtime
saved_LIBS=$LIBS
LIBS="$OBJC_LIBS -lobjc $LIBS"
AC_TRY_LINK([#include <Foundation/NSString.h>
#include <objc/objc-api.h>],
[id class = objc_lookup_class("NSObject");
id obj = [class alloc];
puts([[obj description] cString]);
], ac_cv_objc_runtime=GNU, ac_cv_objc_runtime=unknown)
LIBS=$saved_LIBS
fi
AC_LANG_RESTORE[]
fi
])dnl
OBJC_RUNTIME=$ac_cv_objc_runtime
if test "`echo ${OBJC_RUNTIME} | tr a-z A-Z`" = "GNU"; then
OBJC_RUNTIME=GNU
OBJC_RUNTIME_FLAG=-fgnu-runtime
ac_cv_objc_runtime=GNU
OBJC_LIBS="$OBJC_LIBS -lobjc"
AC_DEFINE(GNU_RUNTIME)
elif test "`echo ${OBJC_RUNTIME} | tr a-z A-Z`" = "NEXT"; then
OBJC_RUNTIME=NeXT
OBJC_RUNTIME_FLAG=-fnext-runtime
ac_cv_objc_runtime=NeXT
AC_DEFINE(NeXT_RUNTIME)
else
OBJC_RUNTIME=unknown
fi
if test ${OBJC_RUNTIME} = unknown; then
echo
rm -f conftest* confdefs* core core.* *.core
AC_MSG_ERROR([Cannot determine the Objective-C runtime! Probably you have
to specify some additional libraries needed to link an ObjC program, so please
take a look in the config.log file to see the reason and try again.])
fi
AC_MSG_RESULT(${ac_cv_objc_runtime})
LIBS="$OBJC_LIBS $LIBS"
])dnl

743
config.guess vendored
View file

@ -1,743 +0,0 @@
#! /bin/sh
# Attempt to guess a canonical system name.
# Copyright (C) 1992, 93, 94, 95, 96, 1997 Free Software Foundation, Inc.
#
# This file is free software; you can redistribute it and/or modify it
# under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful, but
# WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
# General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
#
# As a special exception to the GNU General Public License, if you
# distribute this file as part of a program that contains a
# configuration script generated by Autoconf, you may include it under
# the same distribution terms that you use for the rest of that program.
# Written by Per Bothner <bothner@cygnus.com>.
# The master version of this file is at the FSF in /home/gd/gnu/lib.
#
# This script attempts to guess a canonical system name similar to
# config.sub. If it succeeds, it prints the system name on stdout, and
# exits with 0. Otherwise, it exits with 1.
#
# The plan is that this can be called by configure scripts if you
# don't specify an explicit system type (host/target name).
#
# Only a few systems have been added to this list; please add others
# (but try to keep the structure clean).
#
# This is needed to find uname on a Pyramid OSx when run in the BSD universe.
# (ghazi@noc.rutgers.edu 8/24/94.)
if (test -f /.attbin/uname) >/dev/null 2>&1 ; then
PATH=$PATH:/.attbin ; export PATH
fi
UNAME_MACHINE=`(uname -m) 2>/dev/null` || UNAME_MACHINE=unknown
UNAME_RELEASE=`(uname -r) 2>/dev/null` || UNAME_RELEASE=unknown
UNAME_SYSTEM=`(uname -s) 2>/dev/null` || UNAME_SYSTEM=unknown
UNAME_VERSION=`(uname -v) 2>/dev/null` || UNAME_VERSION=unknown
trap 'rm -f dummy.c dummy.o dummy; exit 1' 1 2 15
# Note: order is significant - the case branches are not exclusive.
case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in
alpha:OSF1:*:*)
# A Vn.n version is a released version.
# A Tn.n version is a released field test version.
# A Xn.n version is an unreleased experimental baselevel.
# 1.2 uses "1.2" for uname -r.
echo alpha-dec-osf`echo ${UNAME_RELEASE} | sed -e 's/^[VTX]//'`
exit 0 ;;
21064:Windows_NT:50:3)
echo alpha-dec-winnt3.5
exit 0 ;;
Amiga*:UNIX_System_V:4.0:*)
echo m68k-cbm-sysv4
exit 0;;
amiga:NetBSD:*:*)
echo m68k-cbm-netbsd${UNAME_RELEASE}
exit 0 ;;
amiga:OpenBSD:*:*)
echo m68k-unknown-openbsd${UNAME_RELEASE}
exit 0 ;;
arc64:OpenBSD:*:*)
echo mips64el-unknown-openbsd${UNAME_RELEASE}
exit 0 ;;
arc:OpenBSD:*:*)
echo mipsel-unknown-openbsd${UNAME_RELEASE}
exit 0 ;;
hkmips:OpenBSD:*:*)
echo mips-unknown-openbsd${UNAME_RELEASE}
exit 0 ;;
pmax:OpenBSD:*:*)
echo mipsel-unknown-openbsd${UNAME_RELEASE}
exit 0 ;;
sgi:OpenBSD:*:*)
echo mips-unknown-openbsd${UNAME_RELEASE}
exit 0 ;;
wgrisc:OpenBSD:*:*)
echo mipsel-unknown-openbsd${UNAME_RELEASE}
exit 0 ;;
arm:RISC*:1.[012]*:*|arm:riscix:1.[012]*:*)
echo arm-acorn-riscix${UNAME_RELEASE}
exit 0;;
SR2?01:HI-UX/MPP:*:*)
echo hppa1.1-hitachi-hiuxmpp
exit 0;;
Pyramid*:OSx*:*:*|MIS*:OSx*:*:*)
# akee@wpdis03.wpafb.af.mil (Earle F. Ake) contributed MIS and NILE.
if test "`(/bin/universe) 2>/dev/null`" = att ; then
echo pyramid-pyramid-sysv3
else
echo pyramid-pyramid-bsd
fi
exit 0 ;;
NILE:*:*:dcosx)
echo pyramid-pyramid-svr4
exit 0 ;;
sun4*:SunOS:5.*:* | tadpole*:SunOS:5.*:*)
echo sparc-sun-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
exit 0 ;;
i86pc:SunOS:5.*:*)
echo i386-pc-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
exit 0 ;;
sun4*:SunOS:6*:*)
# According to config.sub, this is the proper way to canonicalize
# SunOS6. Hard to guess exactly what SunOS6 will be like, but
# it's likely to be more like Solaris than SunOS4.
echo sparc-sun-solaris3`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
exit 0 ;;
sun4*:SunOS:*:*)
case "`/usr/bin/arch -k`" in
Series*|S4*)
UNAME_RELEASE=`uname -v`
;;
esac
# Japanese Language versions have a version number like `4.1.3-JL'.
echo sparc-sun-sunos`echo ${UNAME_RELEASE}|sed -e 's/-/_/'`
exit 0 ;;
sun3*:SunOS:*:*)
echo m68k-sun-sunos${UNAME_RELEASE}
exit 0 ;;
aushp:SunOS:*:*)
echo sparc-auspex-sunos${UNAME_RELEASE}
exit 0 ;;
atari*:NetBSD:*:*)
echo m68k-atari-netbsd${UNAME_RELEASE}
exit 0 ;;
atari*:OpenBSD:*:*)
echo m68k-unknown-openbsd${UNAME_RELEASE}
exit 0 ;;
sun3*:NetBSD:*:*)
echo m68k-sun-netbsd${UNAME_RELEASE}
exit 0 ;;
sun3*:OpenBSD:*:*)
echo m68k-unknown-openbsd${UNAME_RELEASE}
exit 0 ;;
mac68k:NetBSD:*:*)
echo m68k-apple-netbsd${UNAME_RELEASE}
exit 0 ;;
mac68k:OpenBSD:*:*)
echo m68k-unknown-openbsd${UNAME_RELEASE}
exit 0 ;;
mvme68k:OpenBSD:*:*)
echo m68k-unknown-openbsd${UNAME_RELEASE}
exit 0 ;;
mvme88k:OpenBSD:*:*)
echo m88k-unknown-openbsd${UNAME_RELEASE}
exit 0 ;;
powerpc:machten:*:*)
echo powerpc-apple-machten${UNAME_RELEASE}
exit 0 ;;
RISC*:Mach:*:*)
echo mips-dec-mach_bsd4.3
exit 0 ;;
RISC*:ULTRIX:*:*)
echo mips-dec-ultrix${UNAME_RELEASE}
exit 0 ;;
VAX*:ULTRIX*:*:*)
echo vax-dec-ultrix${UNAME_RELEASE}
exit 0 ;;
2020:CLIX:*:*)
echo clipper-intergraph-clix${UNAME_RELEASE}
exit 0 ;;
mips:*:*:UMIPS | mips:*:*:RISCos)
sed 's/^ //' << EOF >dummy.c
int main (argc, argv) int argc; char **argv; {
#if defined (host_mips) && defined (MIPSEB)
#if defined (SYSTYPE_SYSV)
printf ("mips-mips-riscos%ssysv\n", argv[1]); exit (0);
#endif
#if defined (SYSTYPE_SVR4)
printf ("mips-mips-riscos%ssvr4\n", argv[1]); exit (0);
#endif
#if defined (SYSTYPE_BSD43) || defined(SYSTYPE_BSD)
printf ("mips-mips-riscos%sbsd\n", argv[1]); exit (0);
#endif
#endif
exit (-1);
}
EOF
${CC-cc} dummy.c -o dummy \
&& ./dummy `echo "${UNAME_RELEASE}" | sed -n 's/\([0-9]*\).*/\1/p'` \
&& rm dummy.c dummy && exit 0
rm -f dummy.c dummy
echo mips-mips-riscos${UNAME_RELEASE}
exit 0 ;;
Night_Hawk:Power_UNIX:*:*)
echo powerpc-harris-powerunix
exit 0 ;;
m88k:CX/UX:7*:*)
echo m88k-harris-cxux7
exit 0 ;;
m88k:*:4*:R4*)
echo m88k-motorola-sysv4
exit 0 ;;
m88k:*:3*:R3*)
echo m88k-motorola-sysv3
exit 0 ;;
AViiON:dgux:*:*)
# DG/UX returns AViiON for all architectures
UNAME_PROCESSOR=`/usr/bin/uname -p`
if [ $UNAME_PROCESSOR = mc88100 -o $UNAME_PROCESSOR = mc88110 ] ; then
if [ ${TARGET_BINARY_INTERFACE}x = m88kdguxelfx \
-o ${TARGET_BINARY_INTERFACE}x = x ] ; then
echo m88k-dg-dgux${UNAME_RELEASE}
else
echo m88k-dg-dguxbcs${UNAME_RELEASE}
fi
else echo i586-dg-dgux${UNAME_RELEASE}
fi
exit 0 ;;
M88*:DolphinOS:*:*) # DolphinOS (SVR3)
echo m88k-dolphin-sysv3
exit 0 ;;
M88*:*:R3*:*)
# Delta 88k system running SVR3
echo m88k-motorola-sysv3
exit 0 ;;
XD88*:*:*:*) # Tektronix XD88 system running UTekV (SVR3)
echo m88k-tektronix-sysv3
exit 0 ;;
Tek43[0-9][0-9]:UTek:*:*) # Tektronix 4300 system running UTek (BSD)
echo m68k-tektronix-bsd
exit 0 ;;
*:IRIX*:*:*)
echo mips-sgi-irix`echo ${UNAME_RELEASE}|sed -e 's/-/_/g'`
exit 0 ;;
????????:AIX?:[12].1:2) # AIX 2.2.1 or AIX 2.1.1 is RT/PC AIX.
echo romp-ibm-aix # uname -m gives an 8 hex-code CPU id
exit 0 ;; # Note that: echo "'`uname -s`'" gives 'AIX '
i?86:AIX:*:*)
echo i386-ibm-aix
exit 0 ;;
*:AIX:2:3)
if grep bos325 /usr/include/stdio.h >/dev/null 2>&1; then
sed 's/^ //' << EOF >dummy.c
#include <sys/systemcfg.h>
main()
{
if (!__power_pc())
exit(1);
puts("powerpc-ibm-aix3.2.5");
exit(0);
}
EOF
${CC-cc} dummy.c -o dummy && ./dummy && rm dummy.c dummy && exit 0
rm -f dummy.c dummy
echo rs6000-ibm-aix3.2.5
elif grep bos324 /usr/include/stdio.h >/dev/null 2>&1; then
echo rs6000-ibm-aix3.2.4
else
echo rs6000-ibm-aix3.2
fi
exit 0 ;;
*:AIX:*:4)
if /usr/sbin/lsattr -EHl proc0 | grep POWER >/dev/null 2>&1; then
IBM_ARCH=rs6000
else
IBM_ARCH=powerpc
fi
if [ -x /usr/bin/oslevel ] ; then
IBM_REV=`/usr/bin/oslevel`
else
IBM_REV=4.${UNAME_RELEASE}
fi
echo ${IBM_ARCH}-ibm-aix${IBM_REV}
exit 0 ;;
*:AIX:*:*)
echo rs6000-ibm-aix
exit 0 ;;
ibmrt:4.4BSD:*|romp-ibm:BSD:*)
echo romp-ibm-bsd4.4
exit 0 ;;
ibmrt:*BSD:*|romp-ibm:BSD:*) # covers RT/PC NetBSD and
echo romp-ibm-bsd${UNAME_RELEASE} # 4.3 with uname added to
exit 0 ;; # report: romp-ibm BSD 4.3
*:BOSX:*:*)
echo rs6000-bull-bosx
exit 0 ;;
DPX/2?00:B.O.S.:*:*)
echo m68k-bull-sysv3
exit 0 ;;
9000/[34]??:4.3bsd:1.*:*)
echo m68k-hp-bsd
exit 0 ;;
hp300:4.4BSD:*:* | 9000/[34]??:4.3bsd:2.*:*)
echo m68k-hp-bsd4.4
exit 0 ;;
9000/[3478]??:HP-UX:*:*)
case "${UNAME_MACHINE}" in
9000/31? ) HP_ARCH=m68000 ;;
9000/[34]?? ) HP_ARCH=m68k ;;
9000/7?? | 9000/8?[1679] ) HP_ARCH=hppa1.1 ;;
9000/8?? ) HP_ARCH=hppa1.0 ;;
esac
HPUX_REV=`echo ${UNAME_RELEASE}|sed -e 's/[^.]*.[0B]*//'`
echo ${HP_ARCH}-hp-hpux${HPUX_REV}
exit 0 ;;
3050*:HI-UX:*:*)
sed 's/^ //' << EOF >dummy.c
#include <unistd.h>
int
main ()
{
long cpu = sysconf (_SC_CPU_VERSION);
/* The order matters, because CPU_IS_HP_MC68K erroneously returns
true for CPU_PA_RISC1_0. CPU_IS_PA_RISC returns correct
results, however. */
if (CPU_IS_PA_RISC (cpu))
{
switch (cpu)
{
case CPU_PA_RISC1_0: puts ("hppa1.0-hitachi-hiuxwe2"); break;
case CPU_PA_RISC1_1: puts ("hppa1.1-hitachi-hiuxwe2"); break;
case CPU_PA_RISC2_0: puts ("hppa2.0-hitachi-hiuxwe2"); break;
default: puts ("hppa-hitachi-hiuxwe2"); break;
}
}
else if (CPU_IS_HP_MC68K (cpu))
puts ("m68k-hitachi-hiuxwe2");
else puts ("unknown-hitachi-hiuxwe2");
exit (0);
}
EOF
${CC-cc} dummy.c -o dummy && ./dummy && rm dummy.c dummy && exit 0
rm -f dummy.c dummy
echo unknown-hitachi-hiuxwe2
exit 0 ;;
9000/7??:4.3bsd:*:* | 9000/8?[79]:4.3bsd:*:* )
echo hppa1.1-hp-bsd
exit 0 ;;
9000/8??:4.3bsd:*:*)
echo hppa1.0-hp-bsd
exit 0 ;;
hp7??:OSF1:*:* | hp8?[79]:OSF1:*:* )
echo hppa1.1-hp-osf
exit 0 ;;
hp8??:OSF1:*:*)
echo hppa1.0-hp-osf
exit 0 ;;
i?86:OSF1:*:*)
if [ -x /usr/sbin/sysversion ] ; then
echo ${UNAME_MACHINE}-unknown-osf1mk
else
echo ${UNAME_MACHINE}-unknown-osf1
fi
exit 0 ;;
parisc*:Lites*:*:*)
echo hppa1.1-hp-lites
exit 0 ;;
C1*:ConvexOS:*:* | convex:ConvexOS:C1*:*)
echo c1-convex-bsd
exit 0 ;;
C2*:ConvexOS:*:* | convex:ConvexOS:C2*:*)
if getsysinfo -f scalar_acc
then echo c32-convex-bsd
else echo c2-convex-bsd
fi
exit 0 ;;
C34*:ConvexOS:*:* | convex:ConvexOS:C34*:*)
echo c34-convex-bsd
exit 0 ;;
C38*:ConvexOS:*:* | convex:ConvexOS:C38*:*)
echo c38-convex-bsd
exit 0 ;;
C4*:ConvexOS:*:* | convex:ConvexOS:C4*:*)
echo c4-convex-bsd
exit 0 ;;
CRAY*X-MP:*:*:*)
echo xmp-cray-unicos
exit 0 ;;
CRAY*Y-MP:*:*:*)
echo ymp-cray-unicos${UNAME_RELEASE}
exit 0 ;;
CRAY*[A-Z]90:*:*:*)
echo ${UNAME_MACHINE}-cray-unicos${UNAME_RELEASE} \
| sed -e 's/CRAY.*\([A-Z]90\)/\1/' \
-e y/ABCDEFGHIJKLMNOPQRSTUVWXYZ/abcdefghijklmnopqrstuvwxyz/
exit 0 ;;
CRAY*TS:*:*:*)
echo t90-cray-unicos${UNAME_RELEASE}
exit 0 ;;
CRAY-2:*:*:*)
echo cray2-cray-unicos
exit 0 ;;
F300:UNIX_System_V:*:*)
FUJITSU_SYS=`uname -p | tr [A-Z] [a-z] | sed -e 's/\///'`
FUJITSU_REL=`echo ${UNAME_RELEASE} | sed -e 's/ /_/'`
echo "f300-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}"
exit 0 ;;
F301:UNIX_System_V:*:*)
echo f301-fujitsu-uxpv`echo $UNAME_RELEASE | sed 's/ .*//'`
exit 0 ;;
hp3[0-9][05]:NetBSD:*:*)
echo m68k-hp-netbsd${UNAME_RELEASE}
exit 0 ;;
hp300:OpenBSD:*:*)
echo m68k-unknown-openbsd${UNAME_RELEASE}
exit 0 ;;
i?86:BSD/386:*:* | *:BSD/OS:*:*)
echo ${UNAME_MACHINE}-pc-bsdi${UNAME_RELEASE}
exit 0 ;;
*:FreeBSD:*:*)
echo ${UNAME_MACHINE}-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'`
exit 0 ;;
*:NetBSD:*:*)
echo ${UNAME_MACHINE}-unknown-netbsd`echo ${UNAME_RELEASE}|sed -e 's/[-_].*/\./'`
exit 0 ;;
*:OpenBSD:*:*)
echo ${UNAME_MACHINE}-unknown-openbsd`echo ${UNAME_RELEASE}|sed -e 's/[-_].*/\./'`
exit 0 ;;
i*:CYGWIN*:*)
echo i386-pc-cygwin32
exit 0 ;;
i*:MINGW*:*)
echo i386-pc-mingw32
exit 0 ;;
p*:CYGWIN*:*)
echo powerpcle-unknown-cygwin32
exit 0 ;;
prep*:SunOS:5.*:*)
echo powerpcle-unknown-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
exit 0 ;;
*:GNU:*:*)
echo `echo ${UNAME_MACHINE}|sed -e 's,[-/].*$,,'`-unknown-gnu`echo ${UNAME_RELEASE}|sed -e 's,/.*$,,'`
exit 0 ;;
*:Linux:*:*)
# The BFD linker knows what the default object file format is, so
# first see if it will tell us.
ld_help_string=`ld --help 2>&1`
if echo "$ld_help_string" | grep >/dev/null 2>&1 "supported emulations: elf_i.86"; then
echo "${UNAME_MACHINE}-pc-linux-gnu" ; exit 0
elif echo "$ld_help_string" | grep >/dev/null 2>&1 "supported emulations: i.86linux"; then
echo "${UNAME_MACHINE}-pc-linux-gnuaout" ; exit 0
elif echo "$ld_help_string" | grep >/dev/null 2>&1 "supported emulations: i.86coff"; then
echo "${UNAME_MACHINE}-pc-linux-gnucoff" ; exit 0
elif echo "$ld_help_string" | grep >/dev/null 2>&1 "supported emulations: m68kelf"; then
echo "${UNAME_MACHINE}-unknown-linux-gnu" ; exit 0
elif echo "$ld_help_string" | grep >/dev/null 2>&1 "supported emulations: m68klinux"; then
echo "${UNAME_MACHINE}-unknown-linux-gnuaout" ; exit 0
elif echo "$ld_help_string" | grep >/dev/null 2>&1 "supported emulations: elf32ppc"; then
echo "powerpc-unknown-linux-gnu" ; exit 0
elif test "${UNAME_MACHINE}" = "alpha" ; then
echo alpha-unknown-linux-gnu ; exit 0
elif test "${UNAME_MACHINE}" = "sparc" ; then
echo sparc-unknown-linux-gnu ; exit 0
elif test "${UNAME_MACHINE}" = "mips" ; then
cat >dummy.c <<EOF
main(argc, argv)
int argc;
char *argv[];
{
#ifdef __MIPSEB__
printf ("%s-unknown-linux-gnu\n", argv[1]);
#endif
#ifdef __MIPSEL__
printf ("%sel-unknown-linux-gnu\n", argv[1]);
#endif
return 0;
}
EOF
${CC-cc} dummy.c -o dummy 2>/dev/null && ./dummy "${UNAME_MACHINE}" && rm dummy.c dummy && exit 0
rm -f dummy.c dummy
else
# Either a pre-BFD a.out linker (linux-gnuoldld) or one that does not give us
# useful --help. Gcc wants to distinguish between linux-gnuoldld and linux-gnuaout.
test ! -d /usr/lib/ldscripts/. \
&& echo "${UNAME_MACHINE}-pc-linux-gnuoldld" && exit 0
# Determine whether the default compiler is a.out or elf
cat >dummy.c <<EOF
main(argc, argv)
int argc;
char *argv[];
{
#ifdef __ELF__
printf ("%s-pc-linux-gnu\n", argv[1]);
#else
printf ("%s-pc-linux-gnuaout\n", argv[1]);
#endif
return 0;
}
EOF
${CC-cc} dummy.c -o dummy 2>/dev/null && ./dummy "${UNAME_MACHINE}" && rm dummy.c dummy && exit 0
rm -f dummy.c dummy
fi ;;
# ptx 4.0 does uname -s correctly, with DYNIX/ptx in there. earlier versions
# are messed up and put the nodename in both sysname and nodename.
i?86:DYNIX/ptx:4*:*)
echo i386-sequent-sysv4
exit 0 ;;
i?86:*:4.*:* | i?86:SYSTEM_V:4.*:*)
if grep Novell /usr/include/link.h >/dev/null 2>/dev/null; then
echo ${UNAME_MACHINE}-univel-sysv${UNAME_RELEASE}
else
echo ${UNAME_MACHINE}-pc-sysv${UNAME_RELEASE}
fi
exit 0 ;;
i?86:*:3.2:*)
if test -f /usr/options/cb.name; then
UNAME_REL=`sed -n 's/.*Version //p' </usr/options/cb.name`
echo ${UNAME_MACHINE}-pc-isc$UNAME_REL
elif /bin/uname -X 2>/dev/null >/dev/null ; then
UNAME_REL=`(/bin/uname -X|egrep Release|sed -e 's/.*= //')`
(/bin/uname -X|egrep i80486 >/dev/null) && UNAME_MACHINE=i486
(/bin/uname -X|egrep '^Machine.*Pentium' >/dev/null) \
&& UNAME_MACHINE=i586
echo ${UNAME_MACHINE}-pc-sco$UNAME_REL
else
echo ${UNAME_MACHINE}-pc-sysv32
fi
exit 0 ;;
Intel:Mach:3*:*)
echo i386-pc-mach3
exit 0 ;;
paragon:*:*:*)
echo i860-intel-osf1
exit 0 ;;
i860:*:4.*:*) # i860-SVR4
if grep Stardent /usr/include/sys/uadmin.h >/dev/null 2>&1 ; then
echo i860-stardent-sysv${UNAME_RELEASE} # Stardent Vistra i860-SVR4
else # Add other i860-SVR4 vendors below as they are discovered.
echo i860-unknown-sysv${UNAME_RELEASE} # Unknown i860-SVR4
fi
exit 0 ;;
mini*:CTIX:SYS*5:*)
# "miniframe"
echo m68010-convergent-sysv
exit 0 ;;
M68*:*:R3V[567]*:*)
test -r /sysV68 && echo 'm68k-motorola-sysv' && exit 0 ;;
3[34]??:*:4.0:3.0 | 3[34]??,*:*:4.0:3.0 | 4850:*:4.0:3.0)
OS_REL=''
test -r /etc/.relid \
&& OS_REL=.`sed -n 's/[^ ]* [^ ]* \([0-9][0-9]\).*/\1/p' < /etc/.relid`
/bin/uname -p 2>/dev/null | grep 86 >/dev/null \
&& echo i486-ncr-sysv4.3${OS_REL} && exit 0
/bin/uname -p 2>/dev/null | /bin/grep entium >/dev/null \
&& echo i586-ncr-sysv4.3${OS_REL} && exit 0 ;;
3[34]??:*:4.0:* | 3[34]??,*:*:4.0:*)
/bin/uname -p 2>/dev/null | grep 86 >/dev/null \
&& echo i486-ncr-sysv4 && exit 0 ;;
m68*:LynxOS:2.*:*)
echo m68k-unknown-lynxos${UNAME_RELEASE}
exit 0 ;;
mc68030:UNIX_System_V:4.*:*)
echo m68k-atari-sysv4
exit 0 ;;
i?86:LynxOS:2.*:*)
echo i386-unknown-lynxos${UNAME_RELEASE}
exit 0 ;;
TSUNAMI:LynxOS:2.*:*)
echo sparc-unknown-lynxos${UNAME_RELEASE}
exit 0 ;;
rs6000:LynxOS:2.*:* | PowerPC:LynxOS:2.*:*)
echo rs6000-unknown-lynxos${UNAME_RELEASE}
exit 0 ;;
SM[BE]S:UNIX_SV:*:*)
echo mips-dde-sysv${UNAME_RELEASE}
exit 0 ;;
RM*:SINIX-*:*:*)
echo mips-sni-sysv4
exit 0 ;;
*:SINIX-*:*:*)
if uname -p 2>/dev/null >/dev/null ; then
UNAME_MACHINE=`(uname -p) 2>/dev/null`
echo ${UNAME_MACHINE}-sni-sysv4
else
echo ns32k-sni-sysv
fi
exit 0 ;;
PENTIUM:CPunix:4.0*:*) # Unisys `ClearPath HMP IX 4000' SVR4/MP effort
# says <Richard.M.Bartel@ccMail.Census.GOV>
echo i586-unisys-sysv4
exit 0 ;;
*:UNIX_System_V:4*:FTX*)
# From Gerald Hewes <hewes@openmarket.com>.
# How about differentiating between stratus architectures? -djm
echo hppa1.1-stratus-sysv4
exit 0 ;;
*:*:*:FTX*)
# From seanf@swdc.stratus.com.
echo i860-stratus-sysv4
exit 0 ;;
mc68*:A/UX:*:*)
echo m68k-apple-aux${UNAME_RELEASE}
exit 0 ;;
R3000:*System_V*:*:* | R4000:UNIX_SYSV:*:*)
if [ -d /usr/nec ]; then
echo mips-nec-sysv${UNAME_RELEASE}
else
echo mips-unknown-sysv${UNAME_RELEASE}
fi
exit 0 ;;
esac
#echo '(No uname command or uname output not recognized.)' 1>&2
#echo "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" 1>&2
cat >dummy.c <<EOF
#ifdef _SEQUENT_
# include <sys/types.h>
# include <sys/utsname.h>
#endif
main ()
{
#if defined (sony)
#if defined (MIPSEB)
/* BFD wants "bsd" instead of "newsos". Perhaps BFD should be changed,
I don't know.... */
printf ("mips-sony-bsd\n"); exit (0);
#else
#include <sys/param.h>
printf ("m68k-sony-newsos%s\n",
#ifdef NEWSOS4
"4"
#else
""
#endif
); exit (0);
#endif
#endif
#if defined (__arm) && defined (__acorn) && defined (__unix)
printf ("arm-acorn-riscix"); exit (0);
#endif
#if defined (hp300) && !defined (hpux)
printf ("m68k-hp-bsd\n"); exit (0);
#endif
#if defined (NeXT)
#if !defined (__ARCHITECTURE__)
#define __ARCHITECTURE__ "m68k"
#endif
int version;
version=`(hostinfo | sed -n 's/.*NeXT Mach \([0-9]*\).*/\1/p') 2>/dev/null`;
printf ("%s-next-nextstep%d\n", __ARCHITECTURE__, version);
exit (0);
#endif
#if defined (MULTIMAX) || defined (n16)
#if defined (UMAXV)
printf ("ns32k-encore-sysv\n"); exit (0);
#else
#if defined (CMU)
printf ("ns32k-encore-mach\n"); exit (0);
#else
printf ("ns32k-encore-bsd\n"); exit (0);
#endif
#endif
#endif
#if defined (__386BSD__)
printf ("i386-pc-bsd\n"); exit (0);
#endif
#if defined (sequent)
#if defined (i386)
printf ("i386-sequent-dynix\n"); exit (0);
#endif
#if defined (ns32000)
printf ("ns32k-sequent-dynix\n"); exit (0);
#endif
#endif
#if defined (_SEQUENT_)
struct utsname un;
uname(&un);
if (strncmp(un.version, "V2", 2) == 0) {
printf ("i386-sequent-ptx2\n"); exit (0);
}
if (strncmp(un.version, "V1", 2) == 0) { /* XXX is V1 correct? */
printf ("i386-sequent-ptx1\n"); exit (0);
}
printf ("i386-sequent-ptx\n"); exit (0);
#endif
#if defined (vax)
#if !defined (ultrix)
printf ("vax-dec-bsd\n"); exit (0);
#else
printf ("vax-dec-ultrix\n"); exit (0);
#endif
#endif
#if defined (alliant) && defined (i860)
printf ("i860-alliant-bsd\n"); exit (0);
#endif
exit (1);
}
EOF
${CC-cc} dummy.c -o dummy 2>/dev/null && ./dummy && rm dummy.c dummy && exit 0
rm -f dummy.c dummy
# Apollos put the system type in the environment.
test -d /usr/apollo && { echo ${ISP}-apollo-${SYSTYPE}; exit 0; }
# Convex versions that predate uname can use getsysinfo(1)
if [ -x /usr/convex/getsysinfo ]
then
case `getsysinfo -f cpu_type` in
c1*)
echo c1-convex-bsd
exit 0 ;;
c2*)
if getsysinfo -f scalar_acc
then echo c32-convex-bsd
else echo c2-convex-bsd
fi
exit 0 ;;
c34*)
echo c34-convex-bsd
exit 0 ;;
c38*)
echo c38-convex-bsd
exit 0 ;;
c4*)
echo c4-convex-bsd
exit 0 ;;
esac
fi
#echo '(Unable to guess system type)' 1>&2
exit 1

View file

@ -1,3 +0,0 @@
#
# Makefile settings determined by configure
#

940
config.sub vendored
View file

@ -1,940 +0,0 @@
#! /bin/sh
# Configuration validation subroutine script, version 1.1.
# Copyright (C) 1991, 92, 93, 94, 95, 1996 Free Software Foundation, Inc.
# This file is (in principle) common to ALL GNU software.
# The presence of a machine in this file suggests that SOME GNU software
# can handle that machine. It does not imply ALL GNU software can.
#
# This file is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 59 Temple Place - Suite 330,
# Boston, MA 02111-1307, USA.
# As a special exception to the GNU General Public License, if you
# distribute this file as part of a program that contains a
# configuration script generated by Autoconf, you may include it under
# the same distribution terms that you use for the rest of that program.
# Configuration subroutine to validate and canonicalize a configuration type.
# Supply the specified configuration type as an argument.
# If it is invalid, we print an error message on stderr and exit with code 1.
# Otherwise, we print the canonical config type on stdout and succeed.
# This file is supposed to be the same for all GNU packages
# and recognize all the CPU types, system types and aliases
# that are meaningful with *any* GNU software.
# Each package is responsible for reporting which valid configurations
# it does not support. The user should be able to distinguish
# a failure to support a valid configuration from a meaningless
# configuration.
# The goal of this file is to map all the various variations of a given
# machine specification into a single specification in the form:
# CPU_TYPE-MANUFACTURER-OPERATING_SYSTEM
# or in some cases, the newer four-part form:
# CPU_TYPE-MANUFACTURER-KERNEL-OPERATING_SYSTEM
# It is wrong to echo any other type of specification.
if [ x$1 = x ]
then
echo Configuration name missing. 1>&2
echo "Usage: $0 CPU-MFR-OPSYS" 1>&2
echo "or $0 ALIAS" 1>&2
echo where ALIAS is a recognized configuration type. 1>&2
exit 1
fi
# First pass through any local machine types.
case $1 in
*local*)
echo $1
exit 0
;;
*)
;;
esac
# Separate what the user gave into CPU-COMPANY and OS or KERNEL-OS (if any).
# Here we must recognize all the valid KERNEL-OS combinations.
maybe_os=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\2/'`
case $maybe_os in
linux-gnu*)
os=-$maybe_os
basic_machine=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\1/'`
;;
*)
basic_machine=`echo $1 | sed 's/-[^-]*$//'`
if [ $basic_machine != $1 ]
then os=`echo $1 | sed 's/.*-/-/'`
else os=; fi
;;
esac
### Let's recognize common machines as not being operating systems so
### that things like config.sub decstation-3100 work. We also
### recognize some manufacturers as not being operating systems, so we
### can provide default operating systems below.
case $os in
-sun*os*)
# Prevent following clause from handling this invalid input.
;;
-dec* | -mips* | -sequent* | -encore* | -pc532* | -sgi* | -sony* | \
-att* | -7300* | -3300* | -delta* | -motorola* | -sun[234]* | \
-unicom* | -ibm* | -next | -hp | -isi* | -apollo | -altos* | \
-convergent* | -ncr* | -news | -32* | -3600* | -3100* | -hitachi* |\
-c[123]* | -convex* | -sun | -crds | -omron* | -dg | -ultra | -tti* | \
-harris | -dolphin | -highlevel | -gould | -cbm | -ns | -masscomp | \
-apple)
os=
basic_machine=$1
;;
-hiux*)
os=-hiuxwe2
;;
-sco5)
os=sco3.2v5
basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
;;
-sco4)
os=-sco3.2v4
basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
;;
-sco3.2.[4-9]*)
os=`echo $os | sed -e 's/sco3.2./sco3.2v/'`
basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
;;
-sco3.2v[4-9]*)
# Don't forget version if it is 3.2v4 or newer.
basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
;;
-sco*)
os=-sco3.2v2
basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
;;
-isc)
os=-isc2.2
basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
;;
-clix*)
basic_machine=clipper-intergraph
;;
-isc*)
basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
;;
-lynx*)
os=-lynxos
;;
-ptx*)
basic_machine=`echo $1 | sed -e 's/86-.*/86-sequent/'`
;;
-windowsnt*)
os=`echo $os | sed -e 's/windowsnt/winnt/'`
;;
-psos*)
os=-psos
;;
esac
# Decode aliases for certain CPU-COMPANY combinations.
case $basic_machine in
# Recognize the basic CPU types without company name.
# Some are omitted here because they have special meanings below.
tahoe | i860 | m32r | m68k | m68000 | m88k | ns32k | arm \
| arme[lb] | pyramid | mn10300 \
| tron | a29k | 580 | i960 | h8300 | hppa | hppa1.0 | hppa1.1 \
| alpha | we32k | ns16k | clipper | i370 | sh \
| powerpc | powerpcle | 1750a | dsp16xx | mips64 | mipsel \
| pdp11 | mips64el | mips64orion | mips64orionel \
| sparc | sparclet | sparclite | sparc64)
basic_machine=$basic_machine-unknown
;;
# We use `pc' rather than `unknown'
# because (1) that's what they normally are, and
# (2) the word "unknown" tends to confuse beginning users.
i[3456]86)
basic_machine=$basic_machine-pc
;;
# Object if more than one company name word.
*-*-*)
echo Invalid configuration \`$1\': machine \`$basic_machine\' not recognized 1>&2
exit 1
;;
# Recognize the basic CPU types with company name.
vax-* | tahoe-* | i[3456]86-* | i860-* | m32r-* | m68k-* | m68000-* \
| m88k-* | sparc-* | ns32k-* | fx80-* | arm-* | c[123]* \
| mips-* | pyramid-* | tron-* | a29k-* | romp-* | rs6000-* | power-* \
| none-* | 580-* | cray2-* | h8300-* | i960-* | xmp-* | ymp-* \
| hppa-* | hppa1.0-* | hppa1.1-* | alpha-* | we32k-* | cydra-* | ns16k-* \
| pn-* | np1-* | xps100-* | clipper-* | orion-* | sparclite-* \
| pdp11-* | sh-* | powerpc-* | powerpcle-* | sparc64-* | mips64-* | mipsel-* \
| mips64el-* | mips64orion-* | mips64orionel-* | f301-*)
;;
# Recognize the various machine names and aliases which stand
# for a CPU type and a company and sometimes even an OS.
3b1 | 7300 | 7300-att | att-7300 | pc7300 | safari | unixpc)
basic_machine=m68000-att
;;
3b*)
basic_machine=we32k-att
;;
alliant | fx80)
basic_machine=fx80-alliant
;;
altos | altos3068)
basic_machine=m68k-altos
;;
am29k)
basic_machine=a29k-none
os=-bsd
;;
amdahl)
basic_machine=580-amdahl
os=-sysv
;;
amiga | amiga-*)
basic_machine=m68k-cbm
;;
amigados)
basic_machine=m68k-cbm
os=-amigados
;;
amigaunix | amix)
basic_machine=m68k-cbm
os=-sysv4
;;
apollo68)
basic_machine=m68k-apollo
os=-sysv
;;
aux)
basic_machine=m68k-apple
os=-aux
;;
balance)
basic_machine=ns32k-sequent
os=-dynix
;;
convex-c1)
basic_machine=c1-convex
os=-bsd
;;
convex-c2)
basic_machine=c2-convex
os=-bsd
;;
convex-c32)
basic_machine=c32-convex
os=-bsd
;;
convex-c34)
basic_machine=c34-convex
os=-bsd
;;
convex-c38)
basic_machine=c38-convex
os=-bsd
;;
cray | ymp)
basic_machine=ymp-cray
os=-unicos
;;
cray2)
basic_machine=cray2-cray
os=-unicos
;;
[ctj]90-cray)
basic_machine=c90-cray
os=-unicos
;;
crds | unos)
basic_machine=m68k-crds
;;
da30 | da30-*)
basic_machine=m68k-da30
;;
decstation | decstation-3100 | pmax | pmax-* | pmin | dec3100 | decstatn)
basic_machine=mips-dec
;;
delta | 3300 | motorola-3300 | motorola-delta \
| 3300-motorola | delta-motorola)
basic_machine=m68k-motorola
;;
delta88)
basic_machine=m88k-motorola
os=-sysv3
;;
dpx20 | dpx20-*)
basic_machine=rs6000-bull
os=-bosx
;;
dpx2* | dpx2*-bull)
basic_machine=m68k-bull
os=-sysv3
;;
ebmon29k)
basic_machine=a29k-amd
os=-ebmon
;;
elxsi)
basic_machine=elxsi-elxsi
os=-bsd
;;
encore | umax | mmax)
basic_machine=ns32k-encore
;;
fx2800)
basic_machine=i860-alliant
;;
genix)
basic_machine=ns32k-ns
;;
gmicro)
basic_machine=tron-gmicro
os=-sysv
;;
h3050r* | hiux*)
basic_machine=hppa1.1-hitachi
os=-hiuxwe2
;;
h8300hms)
basic_machine=h8300-hitachi
os=-hms
;;
harris)
basic_machine=m88k-harris
os=-sysv3
;;
hp300-*)
basic_machine=m68k-hp
;;
hp300bsd)
basic_machine=m68k-hp
os=-bsd
;;
hp300hpux)
basic_machine=m68k-hp
os=-hpux
;;
hp9k2[0-9][0-9] | hp9k31[0-9])
basic_machine=m68000-hp
;;
hp9k3[2-9][0-9])
basic_machine=m68k-hp
;;
hp9k7[0-9][0-9] | hp7[0-9][0-9] | hp9k8[0-9]7 | hp8[0-9]7)
basic_machine=hppa1.1-hp
;;
hp9k8[0-9][0-9] | hp8[0-9][0-9])
basic_machine=hppa1.0-hp
;;
hppa-next)
os=-nextstep3
;;
i370-ibm* | ibm*)
basic_machine=i370-ibm
os=-mvs
;;
# I'm not sure what "Sysv32" means. Should this be sysv3.2?
i[3456]86v32)
basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'`
os=-sysv32
;;
i[3456]86v4*)
basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'`
os=-sysv4
;;
i[3456]86v)
basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'`
os=-sysv
;;
i[3456]86sol2)
basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'`
os=-solaris2
;;
iris | iris4d)
basic_machine=mips-sgi
case $os in
-irix*)
;;
*)
os=-irix4
;;
esac
;;
isi68 | isi)
basic_machine=m68k-isi
os=-sysv
;;
m88k-omron*)
basic_machine=m88k-omron
;;
magnum | m3230)
basic_machine=mips-mips
os=-sysv
;;
merlin)
basic_machine=ns32k-utek
os=-sysv
;;
miniframe)
basic_machine=m68000-convergent
;;
mipsel*-linux*)
basic_machine=mipsel-unknown
os=-linux
;;
mips*-linux*)
basic_machine=mips-unknown
os=-linux
;;
mips3*-*)
basic_machine=`echo $basic_machine | sed -e 's/mips3/mips64/'`
;;
mips3*)
basic_machine=`echo $basic_machine | sed -e 's/mips3/mips64/'`-unknown
;;
ncr3000)
basic_machine=i486-ncr
os=-sysv4
;;
news | news700 | news800 | news900)
basic_machine=m68k-sony
os=-newsos
;;
news1000)
basic_machine=m68030-sony
os=-newsos
;;
news-3600 | risc-news)
basic_machine=mips-sony
os=-newsos
;;
next | m*-next )
basic_machine=m68k-next
case $os in
-nextstep* )
;;
-ns2*)
os=-nextstep2
;;
*)
os=-nextstep3
;;
esac
;;
nh3000)
basic_machine=m68k-harris
os=-cxux
;;
nh[45]000)
basic_machine=m88k-harris
os=-cxux
;;
nindy960)
basic_machine=i960-intel
os=-nindy
;;
np1)
basic_machine=np1-gould
;;
pa-hitachi)
basic_machine=hppa1.1-hitachi
os=-hiuxwe2
;;
paragon)
basic_machine=i860-intel
os=-osf
;;
pbd)
basic_machine=sparc-tti
;;
pbb)
basic_machine=m68k-tti
;;
pc532 | pc532-*)
basic_machine=ns32k-pc532
;;
pentium | p5)
basic_machine=i586-intel
;;
pentiumpro | p6)
basic_machine=i686-intel
;;
pentium-* | p5-*)
basic_machine=i586-`echo $basic_machine | sed 's/^[^-]*-//'`
;;
pentiumpro-* | p6-*)
basic_machine=i686-`echo $basic_machine | sed 's/^[^-]*-//'`
;;
k5)
# We don't have specific support for AMD's K5 yet, so just call it a Pentium
basic_machine=i586-amd
;;
nexen)
# We don't have specific support for Nexgen yet, so just call it a Pentium
basic_machine=i586-nexgen
;;
pn)
basic_machine=pn-gould
;;
power) basic_machine=rs6000-ibm
;;
ppc) basic_machine=powerpc-unknown
;;
ppc-*) basic_machine=powerpc-`echo $basic_machine | sed 's/^[^-]*-//'`
;;
ppcle | powerpclittle | ppc-le | powerpc-little)
basic_machine=powerpcle-unknown
;;
ppcle-* | powerpclittle-*)
basic_machine=powerpcle-`echo $basic_machine | sed 's/^[^-]*-//'`
;;
ps2)
basic_machine=i386-ibm
;;
rm[46]00)
basic_machine=mips-siemens
;;
rtpc | rtpc-*)
basic_machine=romp-ibm
;;
sequent)
basic_machine=i386-sequent
;;
sh)
basic_machine=sh-hitachi
os=-hms
;;
sps7)
basic_machine=m68k-bull
os=-sysv2
;;
spur)
basic_machine=spur-unknown
;;
sun2)
basic_machine=m68000-sun
;;
sun2os3)
basic_machine=m68000-sun
os=-sunos3
;;
sun2os4)
basic_machine=m68000-sun
os=-sunos4
;;
sun3os3)
basic_machine=m68k-sun
os=-sunos3
;;
sun3os4)
basic_machine=m68k-sun
os=-sunos4
;;
sun4os3)
basic_machine=sparc-sun
os=-sunos3
;;
sun4os4)
basic_machine=sparc-sun
os=-sunos4
;;
sun4sol2)
basic_machine=sparc-sun
os=-solaris2
;;
sun3 | sun3-*)
basic_machine=m68k-sun
;;
sun4)
basic_machine=sparc-sun
;;
sun386 | sun386i | roadrunner)
basic_machine=i386-sun
;;
symmetry)
basic_machine=i386-sequent
os=-dynix
;;
tower | tower-32)
basic_machine=m68k-ncr
;;
udi29k)
basic_machine=a29k-amd
os=-udi
;;
ultra3)
basic_machine=a29k-nyu
os=-sym1
;;
vaxv)
basic_machine=vax-dec
os=-sysv
;;
vms)
basic_machine=vax-dec
os=-vms
;;
vpp*|vx|vx-*)
basic_machine=f301-fujitsu
;;
vxworks960)
basic_machine=i960-wrs
os=-vxworks
;;
vxworks68)
basic_machine=m68k-wrs
os=-vxworks
;;
vxworks29k)
basic_machine=a29k-wrs
os=-vxworks
;;
xmp)
basic_machine=xmp-cray
os=-unicos
;;
xps | xps100)
basic_machine=xps100-honeywell
;;
none)
basic_machine=none-none
os=-none
;;
# Here we handle the default manufacturer of certain CPU types. It is in
# some cases the only manufacturer, in others, it is the most popular.
mips)
if [ x$os = x-linux ]; then
basic_machine=mips-unknown
else
basic_machine=mips-mips
fi
;;
romp)
basic_machine=romp-ibm
;;
rs6000)
basic_machine=rs6000-ibm
;;
vax)
basic_machine=vax-dec
;;
pdp11)
basic_machine=pdp11-dec
;;
we32k)
basic_machine=we32k-att
;;
sparc)
basic_machine=sparc-sun
;;
cydra)
basic_machine=cydra-cydrome
;;
orion)
basic_machine=orion-highlevel
;;
orion105)
basic_machine=clipper-highlevel
;;
*)
echo Invalid configuration \`$1\': machine \`$basic_machine\' not recognized 1>&2
exit 1
;;
esac
# Here we canonicalize certain aliases for manufacturers.
case $basic_machine in
*-digital*)
basic_machine=`echo $basic_machine | sed 's/digital.*/dec/'`
;;
*-commodore*)
basic_machine=`echo $basic_machine | sed 's/commodore.*/cbm/'`
;;
*)
;;
esac
# Decode manufacturer-specific aliases for certain operating systems.
if [ x"$os" != x"" ]
then
case $os in
# First match some system type aliases
# that might get confused with valid system types.
# -solaris* is a basic system type, with this one exception.
-solaris1 | -solaris1.*)
os=`echo $os | sed -e 's|solaris1|sunos4|'`
;;
-solaris)
os=-solaris2
;;
-unixware* | svr4*)
os=-sysv4
;;
-gnu/linux*)
os=`echo $os | sed -e 's|gnu/linux|linux-gnu|'`
;;
# First accept the basic system types.
# The portable systems comes first.
# Each alternative MUST END IN A *, to match a version number.
# -sysv* is not here because it comes later, after sysvr4.
-gnu* | -bsd* | -mach* | -minix* | -genix* | -ultrix* | -irix* \
| -*vms* | -sco* | -esix* | -isc* | -aix* | -sunos | -sunos[34]*\
| -hpux* | -unos* | -osf* | -luna* | -dgux* | -solaris* | -sym* \
| -amigados* | -msdos* | -newsos* | -unicos* | -aof* | -aos* \
| -nindy* | -vxsim* | -vxworks* | -ebmon* | -hms* | -mvs* \
| -clix* | -riscos* | -uniplus* | -iris* | -rtu* | -xenix* \
| -hiux* | -386bsd* | -netbsd* | -openbsd* | -freebsd* | -riscix* \
| -lynxos* | -bosx* | -nextstep* | -cxux* | -aout* | -elf* \
| -ptx* | -coff* | -ecoff* | -winnt* | -domain* | -vsta* \
| -udi* | -eabi* | -lites* | -ieee* | -go32* | -aux* \
| -cygwin32* | -pe* | -psos* | -moss* | -proelf* | -rtems* \
| -mingw32* | -linux-gnu* | -uxpv*)
# Remember, each alternative MUST END IN *, to match a version number.
;;
-linux*)
os=`echo $os | sed -e 's|linux|linux-gnu|'`
;;
-sunos5*)
os=`echo $os | sed -e 's|sunos5|solaris2|'`
;;
-sunos6*)
os=`echo $os | sed -e 's|sunos6|solaris3|'`
;;
-osfrose*)
os=-osfrose
;;
-osf*)
os=-osf
;;
-utek*)
os=-bsd
;;
-dynix*)
os=-bsd
;;
-acis*)
os=-aos
;;
-ctix* | -uts*)
os=-sysv
;;
-ns2 )
os=-nextstep2
;;
# Preserve the version number of sinix5.
-sinix5.*)
os=`echo $os | sed -e 's|sinix|sysv|'`
;;
-sinix*)
os=-sysv4
;;
-triton*)
os=-sysv3
;;
-oss*)
os=-sysv3
;;
-svr4)
os=-sysv4
;;
-svr3)
os=-sysv3
;;
-sysvr4)
os=-sysv4
;;
# This must come after -sysvr4.
-sysv*)
;;
-xenix)
os=-xenix
;;
-none)
;;
*)
# Get rid of the `-' at the beginning of $os.
os=`echo $os | sed 's/[^-]*-//'`
echo Invalid configuration \`$1\': system \`$os\' not recognized 1>&2
exit 1
;;
esac
else
# Here we handle the default operating systems that come with various machines.
# The value should be what the vendor currently ships out the door with their
# machine or put another way, the most popular os provided with the machine.
# Note that if you're going to try to match "-MANUFACTURER" here (say,
# "-sun"), then you have to tell the case statement up towards the top
# that MANUFACTURER isn't an operating system. Otherwise, code above
# will signal an error saying that MANUFACTURER isn't an operating
# system, and we'll never get to this point.
case $basic_machine in
*-acorn)
os=-riscix1.2
;;
arm*-semi)
os=-aout
;;
pdp11-*)
os=-none
;;
*-dec | vax-*)
os=-ultrix4.2
;;
m68*-apollo)
os=-domain
;;
i386-sun)
os=-sunos4.0.2
;;
m68000-sun)
os=-sunos3
# This also exists in the configure program, but was not the
# default.
# os=-sunos4
;;
*-tti) # must be before sparc entry or we get the wrong os.
os=-sysv3
;;
sparc-* | *-sun)
os=-sunos4.1.1
;;
*-ibm)
os=-aix
;;
*-hp)
os=-hpux
;;
*-hitachi)
os=-hiux
;;
i860-* | *-att | *-ncr | *-altos | *-motorola | *-convergent)
os=-sysv
;;
*-cbm)
os=-amigados
;;
*-dg)
os=-dgux
;;
*-dolphin)
os=-sysv3
;;
m68k-ccur)
os=-rtu
;;
m88k-omron*)
os=-luna
;;
*-next )
os=-nextstep
;;
*-sequent)
os=-ptx
;;
*-crds)
os=-unos
;;
*-ns)
os=-genix
;;
i370-*)
os=-mvs
;;
*-next)
os=-nextstep3
;;
*-gould)
os=-sysv
;;
*-highlevel)
os=-bsd
;;
*-encore)
os=-bsd
;;
*-sgi)
os=-irix
;;
*-siemens)
os=-sysv4
;;
*-masscomp)
os=-rtu
;;
f301-fujitsu)
os=-uxpv
;;
*)
os=-none
;;
esac
fi
# Here we handle the case where we know the os, and the CPU type, but not the
# manufacturer. We pick the logical manufacturer.
vendor=unknown
case $basic_machine in
*-unknown)
case $os in
-riscix*)
vendor=acorn
;;
-sunos*)
vendor=sun
;;
-aix*)
vendor=ibm
;;
-hpux*)
vendor=hp
;;
-hiux*)
vendor=hitachi
;;
-unos*)
vendor=crds
;;
-dgux*)
vendor=dg
;;
-luna*)
vendor=omron
;;
-genix*)
vendor=ns
;;
-mvs*)
vendor=ibm
;;
-ptx*)
vendor=sequent
;;
-vxsim* | -vxworks*)
vendor=wrs
;;
-aux*)
vendor=apple
;;
esac
basic_machine=`echo $basic_machine | sed "s/unknown/$vendor/"`
;;
esac
echo $basic_machine$os

1217
configure vendored

File diff suppressed because it is too large Load diff

View file

@ -1,36 +0,0 @@
@echo off
rem
rem Configure.bat
rem
rem Configuration program for GNUstep GUI Library
rem
rem 2/27/95 Initially created
rem
rem
rem Top level makefile
rem
echo "Top level makefile"
sed -f Makefile.sed.nt Makefile.in >Makefile
rem
rem Source makefile
rem
cd Source
echo "Source makefile"
sed -f Makefile.sed.nt Makefile.in >Makefile
cd ..
rem
rem Configuration files
rem
echo "Creating header configuration files"
cd Headers
cd gnustep
cd gui
rm -f config.h
sed -f config.sed.nt config.h.in >>config.h
cd ..
cd ..
cd ..

View file

@ -1,69 +0,0 @@
AC_INIT(Source/NSApplication.m)
# configure.in for GNUstep GUI Library
# Process this file with autoconf to produce a configure script.
#
# Copyright (C) 1996 Free Software Foundation, Inc.
#
# Written by: Scott Christley <scottc@net-community.com>
# Ovidiu Predescu <ovidiu@net-community.com>
#
# 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.
#--------------------------------------------------------------------
# Use a .h file with #define's, instead of -D command-line switches
#--------------------------------------------------------------------
AC_CONFIG_HEADER(Headers/gnustep/gui/config.h)
#--------------------------------------------------------------------
# Determine the host, build, and target systems
#--------------------------------------------------------------------
AC_CANONICAL_SYSTEM
changequote(,)dnl
case "${host_cpu}" in
i[45]86) host_cpu=i386;;
hppa1.1) host_cpu=hppa;;
esac
case "${host_os}" in
solaris2*) host_os=solaris2;;
esac
changequote([,])dnl
HOST=$host
HOST_CPU=$host_cpu
HOST_VENDOR=$host_vendor
HOST_OS=$host_os
#--------------------------------------------------------------------
# Standard ANSI headers
#--------------------------------------------------------------------
AC_HEADER_STDC
#--------------------------------------------------------------------
# Operating system configuration
#--------------------------------------------------------------------
config_include=''
AC_SUBST(config_include)
#--------------------------------------------------------------------
# Write the Makefiles and configuration files
#--------------------------------------------------------------------
AC_OUTPUT(config.mak)

View file

@ -1,119 +0,0 @@
#!/bin/sh
#
# install - install a program, script, or datafile
# This comes from X11R5; it is not part of GNU.
#
# $XConsortium: install.sh,v 1.2 89/12/18 14:47:22 jim Exp $
#
# This script is compatible with the BSD install script, but was written
# from scratch.
#
# set DOITPROG to echo to test this script
# Don't use :- since 4.3BSD and earlier shells don't like it.
doit="${DOITPROG-}"
# put in absolute paths if you don't have them in your path; or use env. vars.
mvprog="${MVPROG-mv}"
cpprog="${CPPROG-cp}"
chmodprog="${CHMODPROG-chmod}"
chownprog="${CHOWNPROG-chown}"
chgrpprog="${CHGRPPROG-chgrp}"
stripprog="${STRIPPROG-strip}"
rmprog="${RMPROG-rm}"
instcmd="$cpprog"
chmodcmd=""
chowncmd=""
chgrpcmd=""
stripcmd=""
rmcmd="$rmprog -f"
mvcmd="$mvprog"
src=""
dst=""
while [ x"$1" != x ]; do
case $1 in
-c) instcmd="$cpprog"
shift
continue;;
-m) chmodcmd="$chmodprog $2"
shift
shift
continue;;
-o) chowncmd="$chownprog $2"
shift
shift
continue;;
-g) chgrpcmd="$chgrpprog $2"
shift
shift
continue;;
-s) stripcmd="$stripprog"
shift
continue;;
*) if [ x"$src" = x ]
then
src=$1
else
dst=$1
fi
shift
continue;;
esac
done
if [ x"$src" = x ]
then
echo "install: no input file specified"
exit 1
fi
if [ x"$dst" = x ]
then
echo "install: no destination specified"
exit 1
fi
# If destination is a directory, append the input filename; if your system
# does not like double slashes in filenames, you may need to add some logic
if [ -d $dst ]
then
dst="$dst"/`basename $src`
fi
# Make a temp file name in the proper directory.
dstdir=`dirname $dst`
dsttmp=$dstdir/#inst.$$#
# Move or copy the file name to the temp name
$doit $instcmd $src $dsttmp
# and set any options; do chmod last to preserve setuid bits
if [ x"$chowncmd" != x ]; then $doit $chowncmd $dsttmp; fi
if [ x"$chgrpcmd" != x ]; then $doit $chgrpcmd $dsttmp; fi
if [ x"$stripcmd" != x ]; then $doit $stripcmd $dsttmp; fi
if [ x"$chmodcmd" != x ]; then $doit $chmodcmd $dsttmp; fi
# Now rename the file to the real destination.
$doit $rmcmd $dst
$doit $mvcmd $dsttmp $dst
exit 0

View file

@ -1,35 +0,0 @@
#!/bin/sh
# Make directory hierarchy.
# Written by Noah Friedman <friedman@prep.ai.mit.edu>
# Public domain.
defaultIFS='
'
IFS="${IFS-${defaultIFS}}"
errstatus=0
for file in ${1+"$@"} ; do
oIFS="${IFS}"
# Some sh's can't handle IFS=/ for some reason.
IFS='%'
set - `echo ${file} | sed -e 's@/@%@g' -e 's@^%@/@'`
IFS="${oIFS}"
pathcomp=''
for d in ${1+"$@"} ; do
pathcomp="${pathcomp}${d}"
if test ! -d "${pathcomp}"; then
echo "mkdir $pathcomp" 1>&2
mkdir "${pathcomp}" || errstatus=$?
fi
pathcomp="${pathcomp}/"
done
done
exit $errstatus
# eof