Move and install resources to more appropriate place.

Minor fixes.
Incorporate Adam Fedor's NSImage patches.


git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gui/trunk@2070 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
Scott Christley 1997-01-31 13:40:15 +00:00
parent e3dde2fd9a
commit 9211409e28
24 changed files with 145 additions and 158 deletions

View file

@ -1,3 +1,21 @@
Fri Jan 31 05:30:40 1997 Scott Christley <scottc@net-community.com>
* Makefile.in: Clean up code.
* configure.in: Update ftp messages; add Images directory.
* configure: Regenerate based upon configure.in changes.
* Headers/gnustep/gui/NSCell.h (support): Remove instance variable.
(cell_image, cell_font): New instance variables.
* gnustep/gui/resource: Remove directory and files; these resources
have been moved elsewhere like the new Images directory.
* Source/Makefile.in (GNUSTEP_RESOURCE, install-resource): Remove.
(GNUSTEP_INSTALL_LIBDIR): Add definition.
Correct some minor errors.
* Source/NSButtonCell.m: Modify for NSCell instance variables changes.
* Source/NSCell.m: Likewise.
* Source/NSTextFieldCell.m: Likewise.
* Source/NSImage.m (NSImage_PATH): Default path for where NSImage
tries to find system image resources.
Thu Jan 30 12:34:30 1997 Scott Christley <scottc@net-community.com>
* Headers/gnustep/gui/NSDragging.h (NSDraggingInfo): Define
@ -7,6 +25,18 @@ Thu Jan 30 12:34:30 1997 Scott Christley <scottc@net-community.com>
* Source/NSFontManager.m (-fontWithFamily:traits:weight:size:):
Add log error message when requesting invalid font.
Thu Jan 29 13:07:11 1997 Adam Fedor <fedor@boulder.Colorado.edu>
* Headers/gnustep/gui/AppKit.h: Add NSBundle definitions.
* Source/NSBitmapImageRep.m ([NSBitmapImageRep -bitmapData]):
planes instance variable always contains image data.
([NSBitmapImageRep -getBitmapDataPlanes]): Check for data in
imagePlanes before allocating data.
* Source/NSEPSImageRep.m ([NSEPSImageRep +imageRepWithData:]): Just
return nil instead of not implementing.
([NSEPSImageRep +imageRepsWithData:]): New method.
Wed Jan 29 07:44:32 1997 Simon Frankau <sgf@frankau.demon.co.uk>
* Headers/gnustep/gui/NSCStringText.h: New file.

View file

@ -148,4 +148,7 @@ float MB_SCREEN_MAXHEIGHT();
#include <AppKit/NSWindow.h>
#include <AppKit/NSWorkspace.h>
#include <Foundation/NSBundle.h>
#include <AppKit/NSBundle.h>
#endif _GNUstep_H_AppKit

View file

@ -42,7 +42,8 @@
{
// Attributes
NSString *contents;
id support;
NSImage *cell_image;
NSFont *cell_font;
BOOL cell_state;
BOOL cell_highlighted;
BOOL cell_enabled;

View file

@ -1,43 +0,0 @@
----------------------------------------------------------------------------
GNUstep Icons for the GNUstep generic user environment/UserSuite Apps
and the GNUstep X/DPS window manager.
----------------------------------------------------------------------------
Icons may be used by developers for the creation of Freely
distributable software to run under any OpenSTEP environment
*INCLUDING* GNUstep. Note that apps using these icons may not need to
be distributed under the GPL, but be freely distributed in at least
binary form.
If you have a special requirement or need icons or design help with
any GNUstep project please feel free to contact me and I will russle
something up for you as quickly as I can to integrate into your
project.
----------------------------------------------------------------------------
Conditions of use:
No icon may be visually modified any any way without express
permission of the designer
(http://www.gnustep.org/UserSuite/UserSuite.html) My efforts here are
to keep GNUstep elegant and I don't want to waste my time with people
mucking things up -- sorry if this offends you.
Icons must only be used for the development of application software
for free deployment under OpenSTEP *AND* it must compile and run for
GNUstep.
----------------------------------------------------------------------------
I am open to feedback and would like to include any work that you
think is up to inclusion in the GNUstep project. If you are
interested in developing software for GNUstep please view the GNUstep
home page on (http://www.gnustep.org).
----------------------------------------------------------------------------
Andrew Lindesay
(apl@kcbbs.gen.nz)

View file

@ -23,7 +23,7 @@ exeext =
include $(srcdir)/Version
SUBDIRS = Source Testing
SUBDIRS = Source Testing Images
DIST_FILES = \
Makefile.in configure config.guess \
@ -59,55 +59,16 @@ config.status: configure
mostlyclean-top:
rm -f *~
cd Headers ; cd gnustep ; cd gui ; rm -f *~
cd Headers ; cd gnustep ; cd dps ; rm -f *~
clean-top: mostlyclean-top
maintainer-clean-top: clean-top
distclean-top: clean-top
rm -f Makefile config.status config.log config.cache TAGS
cd Headers ; cd gnustep ; cd gui ; rm -f config.h
cd Headers ; rm -rf AppKit ; rm -rf DPSClient
mostlyclean: mostlyclean-top mostlyclean-subdirs
clean: mostlyclean-top clean-subdirs
distclean: clean-top distclean-subdirs
rm -f Makefile config.status config.log config.cache TAGS
cd Headers ; cd gnustep ; cd gui ; rm -f *~ config.h
cd Headers ; cd gnustep ; cd dps ; rm -f *~
cd Headers ; rm -f AppKit ; rm -f DPSClient
maintainer-clean: maintainer-clean-subdirs
snap: $(DIST_FILES)
rm -rf snap
mkdir snap
for i in $(SUBDIRS); do \
(cd $$i; $(MAKE) $(MAKEDEFINES) copy-dist); \
done
mkdir snap/config
for file in $(DIST_FILES); do \
ln $$file snap/$$file ; \
done
snapshot: snap
ln README.first snap
rm -f .name
echo libobjects-`date +%y%m%d` >.name
rm -rf `cat .name`
mv snap `cat .name`
tar -chvf `cat .name`.tar `cat .name`
rm -f `cat .name`.tar.gz
gzip -9 `cat .name`.tar
rm -rf `cat .name`
dist: snap
mv snap libobjects-$(OBJECTS_VERSION)
tar -chvf libobjects-$(OBJECTS_VERSION).tar \
libobjects-$(OBJECTS_VERSION)
rm -f libobjects-$(OBJECTS_VERSION).tar.gz
gzip -9 libobjects-$(OBJECTS_VERSION).tar
rm -rf libobjects-$(OBJECTS_VERSION)
rcs-list-locked:
@echo "===."
@rlog -L -R $(RCS_FILES)
@for i in $(SUBDIRS); do \
echo "===$$i"; \
(cd $$i; \
$(MAKE) -s $(MAKEDEFINES) rcs-list-locked); \
done
clean: clean-top clean-subdirs
distclean: distclean-subdirs distclean-top
FORCE:

View file

@ -39,6 +39,7 @@ VPATH = @srcdir@
prefix = @prefix@
exec_prefix = @exec_prefix@
libdir = @libdir@
gnustep_libdir = $(libdir)/gnustep
includedir = @includedir@
bindir = @bindir@
@ -47,6 +48,7 @@ MAKEDEFINES =
CC = @CC@ -g
CPPFLAGS = @CPPFLAGS@
CFLAGS = -c $(GCCFLAGS) -I../Headers $(CPPFLAGS)
DEFS = -DGNUSTEP_INSTALL_LIBDIR=$(gnustep_libdir) @DEFS@
GCC_LIB =
OBJC_LIB = -lobjc
@ -164,17 +166,6 @@ GNUSTEP_DPS_HEADERS = dps/NSDPSContext.h \
dps/DPSOperators.h \
dps/TypesandConstants.h
GNUSTEP_RESOURCE = gui/common_ArrowDown.tiff \
gui/common_ArrowLeft.tiff \
gui/common_ArrowRight.tiff \
gui/common_ArrowUp.tiff \
gui/common_Dimple.tiff \
gui/common_RadioOff.tiff \
gui/common_RadioOn.tiff \
gui/common_SwitchOff.tiff \
gui/common_SwitchOn.tiff \
gui/common_ret.tiff
OBJS_WITHOUT_INIT = $(MAIN_FILE)$(oext) \
NSActionCell$(oext) \
NSApplication$(oext) \
@ -249,9 +240,9 @@ OBJS = $(OBJS_WITHOUT_INIT)
.SUFFIXES: .m
.m$(oext):
$(CC) $(CFLAGS) $<
$(CC) $(CFLAGS) $(DEFS) $<
.c$(oext):
$(CC) $(CFLAGS) $<
$(CC) $(CFLAGS) $(DEFS) $<
#
# libraries
@ -266,9 +257,9 @@ all: header_links src
header_links:
-rm -rf ../Headers/AppKit
cp -r ../Headers/gnustep/gui ../Headers/AppKit
$(LN_S) ../Headers/gnustep/gui ../Headers/AppKit
-rm -rf ../Headers/DPSClient
cp -r ../Headers/gnustep/dps ../Headers/DPSClient
$(LN_S) ../Headers/gnustep/dps ../Headers/DPSClient
src: $(MAIN_FILE)$(libext)
@ -286,14 +277,12 @@ $(INIT_FILE_OBJ): $(OBJS_WITHOUT_INIT)
$(CC) $(CFLAGS) $(INIT_FILE).c
rm tmpinit.c
install: installdirs install-lib install-headers install-resource
install: installdirs install-lib install-headers
installdirs:
$(srcdir)/../mkinstalldirs \
$(libdir) \
$(libdir)/gnustep \
$(libdir)/gnustep/resource \
$(libdir)/gnustep/resource/gui \
$(includedir)/gnustep \
$(includedir)/gnustep/dps \
$(includedir)/gnustep/gui
@ -319,14 +308,8 @@ install-headers:
$(INSTALL_DATA) ../Headers/gnustep/$$file \
$(includedir)/gnustep/$$file ; \
done
cd $(includedir); rm -rf AppKit; cp -r ./gnustep/gui ./AppKit
cd $(includedir); rm -rf DPSClient; cp -r ./gnustep/dps ./DPSClient
install-resource:
for file in $(GNUSTEP_RESOURCE); do \
$(INSTALL_DATA) ../Headers/gnustep/resource/$$file \
$(libdir)/gnustep/resource/$$file ; \
done
cd $(includedir); rm -rf AppKit; $(LN_S) ./gnustep/gui ./AppKit
cd $(includedir); rm -rf DPSClient; $(LN_S) ./gnustep/dps ./DPSClient
# end of install targets
uninstall:
@ -335,7 +318,6 @@ uninstall:
rm -rf $(includedir)/AppKit
rm -rf $(includedir)/DPSClient
rm -rf $(libdir)/$(MAIN_FILE)$(libext)
rm -rf $(libdir)/gnustep/resource/gui
#
# Cleaning

View file

@ -284,15 +284,14 @@
{
unsigned char *planes[MAX_PLANES];
[self getBitmapDataPlanes: planes];
return (unsigned char *)[imageData mutableBytes];
// return planes[0];
return planes[0];
}
- (void) getBitmapDataPlanes: (unsigned char **)data
{
int i;
if (!imagePlanes)
if (!imagePlanes || !imagePlanes[0])
{
long length;
unsigned char* bits;

View file

@ -63,6 +63,7 @@
- initImageCell:(NSImage *)anImage
{
[super initImageCell:anImage];
contents = @"Button";
cell_type = NSMomentaryPushButton;
[self setEnabled:YES];
transparent = NO;
@ -73,7 +74,6 @@
- initTextCell:(NSString *)aString
{
[super initTextCell:aString];
support = [NSFont userFontOfSize:12];
alt_contents = @"Button";
cell_type = NSMomentaryPushButton;
[self setEnabled:YES];

View file

@ -63,6 +63,8 @@
{
[super init];
cell_type = NSNullCellType;
cell_image = nil;
cell_font = nil;
image_position = NSNoImage;
cell_state = NO;
cell_highlighted = NO;
@ -87,9 +89,10 @@
if (![anImage isKindOfClass:[NSImage class]])
return nil;
support = anImage;
cell_type = NSImageCellType;
cell_image = anImage;
image_position = NSImageOnly;
cell_font = [NSFont userFontOfSize:12];
cell_state = NO;
cell_highlighted = NO;
cell_enabled = YES;
@ -113,10 +116,11 @@
//if (![aString isKindOfClass:[NSString class]])
// return nil;
support = [NSFont userFontOfSize:12];
cell_font = [NSFont userFontOfSize:12];
contents = aString;
cell_type = NSTextCellType;
text_align = NSLeftTextAlignment;
cell_image = nil;
image_position = NSNoImage;
cell_state = NO;
cell_highlighted = NO;
@ -208,10 +212,7 @@
//
- (NSImage *)image
{
if (cell_type == NSImageCellType)
return support;
else
return nil;
return cell_image;
}
- (void)setImage:(NSImage *)anImage
@ -220,9 +221,8 @@
if (![anImage isKindOfClass:[NSImage class]])
return;
// Only set the image if we are an image cell
if (cell_type == NSImageCellType)
support = anImage;
// Only set the image if we are an image cell
cell_image = anImage;
}
//
@ -330,10 +330,7 @@
- (NSFont *)font
{
if ([support isKindOfClass:[NSFont class]])
return support;
else
return nil;
return cell_font;
}
- (BOOL)isEditable
@ -370,9 +367,7 @@
if (![fontObject isKindOfClass:[NSFont class]])
return;
// Only set the font if we are a text cell
if ([support isKindOfClass:[NSFont class]])
support = fontObject;
cell_font = fontObject;
}
- (void)setSelectable:(BOOL)flag
@ -741,7 +736,8 @@
[super encodeWithCoder:aCoder];
[aCoder encodeObject: contents];
[aCoder encodeObject: support];
[aCoder encodeObject: cell_image];
[aCoder encodeObject: cell_font];
[aCoder encodeValueOfObjCType: @encode(BOOL) at: &cell_state];
[aCoder encodeValueOfObjCType: @encode(BOOL) at: &cell_highlighted];
[aCoder encodeValueOfObjCType: @encode(BOOL) at: &cell_enabled];
@ -766,7 +762,8 @@
[super initWithCoder:aDecoder];
contents = [aDecoder decodeObject];
support = [aDecoder decodeObject];
cell_image = [aDecoder decodeObject];
cell_font = [aDecoder decodeObject];
[aDecoder decodeValueOfObjCType: @encode(BOOL) at: &cell_state];
[aDecoder decodeValueOfObjCType: @encode(BOOL) at: &cell_highlighted];
[aDecoder decodeValueOfObjCType: @encode(BOOL) at: &cell_enabled];

View file

@ -33,9 +33,16 @@
// Initializing a New Instance
+ (id) imageRepWithData: (NSData *)epsData
{
// [self notImplemented: _cmd];
return [[self alloc] init];
//[self notImplemented: _cmd];
return nil;
}
+ (NSArray *) imageRepsWithData: (NSData *)epsData
{
//[self notImplemented: _cmd];
return nil;
}
- (id) initWithData: (NSData *)epsData
{
[self notImplemented: _cmd];

View file

@ -43,6 +43,10 @@
#include <Foundation/NSBundle.h>
#include <string.h>
#ifndef NSImage_PATH
#define NSImage_PATH OBJC_STRINGIFY(GNUSTEP_INSTALL_LIBDIR) @"/Images"
#endif
/* Backend protocol - methods that must be implemented by the backend to
complete the class */
@protocol NSImageBackend
@ -155,27 +159,65 @@ set_repd_for_rep(NSMutableArray *_reps, NSImageRep *rep, rep_data_t *new_repd)
if (!nameDict || ![nameDict objectForKey:aName])
{
NSString* ext;
NSString* path;
NSString* path = nil;
NSBundle* main;
main = [NSBundle mainBundle];
ext = extension(aName);
NSLog(@"search locally\n");
NSLog(@"extension is %s\n", [ext cString]);
/* First search locally */
if (ext)
path = [main pathForResource: aName ofType: ext];
else
{
int i, count;
id o, e;
NSArray* array;
array = [self imageFileTypes];
count = [array count];
for (i = 0; i < count; i++)
if (!array)
NSLog(@"array is nil\n");
e = [array objectEnumerator];
while ((o = [e nextObject]))
{
NSLog(@"extension %s\n", [o cString]);
path = [main pathForResource:aName
ofType: [array objectAtIndex: i]];
ofType: o];
if ([path length] != 0)
break;
}
}
/* If not found then search in system */
if (!path)
{
if (ext)
path = [NSBundle pathForResource: aName
ofType: ext
inDirectory: NSImage_PATH
withVersion: 0];
else
{
id o, e;
NSArray* array;
array = [self imageFileTypes];
if (!array)
NSLog(@"array is nil\n");
e = [array objectEnumerator];
while ((o = [e nextObject]))
{
NSLog(@"extension %s\n", [o cString]);
path = [NSBundle pathForResource: aName
ofType: o
inDirectory: NSImage_PATH
withVersion: 0];
if ([path length] != 0)
break;
}
}
}
if ([path length] != 0)
{
NSImage* image = [[NSImage alloc] initByReferencingFile:path];
@ -593,7 +635,7 @@ set_repd_for_rep(NSMutableArray *_reps, NSImageRep *rep, rep_data_t *new_repd)
if (!ext)
return NO;
array = [[self class] imageFileTypes];
if (![array indexOfObject: ext])
if ([array indexOfObject: ext] == NSNotFound)
return NO;
repd.fileName = [fileName retain];
[_reps addObject: [NSValue value: &repd withObjCType: @encode(rep_data_t)]];
@ -906,7 +948,7 @@ iterate_reps_for_types(NSArray* imageReps, SEL method)
obj = [e1 nextObject];
while (obj)
{
if (![types indexOfObject: obj])
if ([types indexOfObject: obj] == NSNotFound)
[types addObject: obj];
obj = [e1 nextObject];
}

View file

@ -77,7 +77,7 @@
background_color = [NSColor whiteColor];
text_color = [NSColor blackColor];
support = [NSFont systemFontOfSize:12];
cell_font = [NSFont systemFontOfSize:12];
return self;
}

12
configure vendored
View file

@ -1077,10 +1077,14 @@ done
if test "x$HAVE_DPSCLIENT" = "x0"
then
echo You must have the DPSClient library installed.
echo The most recent version "(R6)", patched for GNUstep,
echo The most recent public release, patched for GNUstep,
echo should be available at:
echo
echo ftp://ftp.ocbi.com/pub/GNUstep
echo ftp://ftp.gnustep.org
echo
echo The most recent snapshot should be available at:
echo
echo ftp://ftp.net-community.com/pub/GNUstep
echo
echo Configuration of the GNUstep GUI Library cannot continue.
exit 1
@ -1195,7 +1199,7 @@ done
ac_given_srcdir=$srcdir
ac_given_INSTALL="$INSTALL"
trap 'rm -fr `echo "Makefile Source/Makefile Testing/Makefile Headers/gnustep/gui/config.h Documentation/Makefile" | sed "s/:[^ ]*//g"` conftest*; exit 1' 1 2 15
trap 'rm -fr `echo "Makefile Source/Makefile Testing/Makefile Headers/gnustep/gui/config.h Documentation/Makefile Images/Makefile" | sed "s/:[^ ]*//g"` conftest*; exit 1' 1 2 15
EOF
cat >> $CONFIG_STATUS <<EOF
@ -1239,7 +1243,7 @@ CEOF
EOF
cat >> $CONFIG_STATUS <<EOF
CONFIG_FILES=\${CONFIG_FILES-"Makefile Source/Makefile Testing/Makefile Headers/gnustep/gui/config.h Documentation/Makefile"}
CONFIG_FILES=\${CONFIG_FILES-"Makefile Source/Makefile Testing/Makefile Headers/gnustep/gui/config.h Documentation/Makefile Images/Makefile"}
EOF
cat >> $CONFIG_STATUS <<\EOF
for ac_file in .. $CONFIG_FILES; do if test "x$ac_file" != x..; then

View file

@ -68,10 +68,14 @@ AC_CHECK_HEADERS(DPS/dpsclient.h, HAVE_DPSCLIENT=1, HAVE_DPSCLIENT=0)
if test "x$HAVE_DPSCLIENT" = "x0"
then
echo You must have the DPSClient library installed.
echo The most recent version "(R6)", patched for GNUstep,
echo The most recent public release, patched for GNUstep,
echo should be available at:
echo
echo ftp://ftp.ocbi.com/pub/GNUstep
echo ftp://ftp.gnustep.org
echo
echo The most recent snapshot should be available at:
echo
echo ftp://ftp.net-community.com/pub/GNUstep
echo
echo Configuration of the GNUstep GUI Library cannot continue.
exit 1
@ -87,5 +91,5 @@ AC_SUBST(config_include)
#--------------------------------------------------------------------
# Write the Makefiles and configuration files
#--------------------------------------------------------------------
AC_OUTPUT(Makefile Source/Makefile Testing/Makefile Headers/gnustep/gui/config.h Documentation/Makefile)
AC_OUTPUT(Makefile Source/Makefile Testing/Makefile Headers/gnustep/gui/config.h Documentation/Makefile Images/Makefile)