mirror of
https://github.com/gnustep/libs-gui.git
synced 2025-05-31 21:00:47 +00:00
* NSFileWrapper.m and NSFileWrapper.h added preliminary implementations
in support of Daniel B�hringer's work on the text classes * NSText.m added changes by Daniel B�hringer * Tools/gpbs.m added dummy defines of some backend function git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gui/trunk@2952 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
parent
601cac5d1b
commit
c5d8b82392
8 changed files with 1876 additions and 305 deletions
|
@ -1,3 +1,10 @@
|
||||||
|
Weds Sept 2 1998 Felipe A. Rodriguez <far@ix.netcom.com>
|
||||||
|
|
||||||
|
* NSFileWrapper.m and NSFileWrapper.h added preliminary implementations
|
||||||
|
in support of Daniel Bðhringer's work on the text classes
|
||||||
|
* NSText.m added changes by Daniel Bðhringer
|
||||||
|
* Tools/gpbs.m added dummy defines of some backend functions
|
||||||
|
|
||||||
Tues Sept 1 1998 Felipe A. Rodriguez <far@ix.netcom.com>
|
Tues Sept 1 1998 Felipe A. Rodriguez <far@ix.netcom.com>
|
||||||
|
|
||||||
* GNUmakefile added NSAttributedString.m, NSAttributedString.h,
|
* GNUmakefile added NSAttributedString.m, NSAttributedString.h,
|
||||||
|
|
121
Headers/gnustep/gui/NSFileWrapper.h
Normal file
121
Headers/gnustep/gui/NSFileWrapper.h
Normal file
|
@ -0,0 +1,121 @@
|
||||||
|
/*
|
||||||
|
NSFileWrapper.h
|
||||||
|
|
||||||
|
NSFileWrapper objects hold a file's contents in dynamic memory.
|
||||||
|
|
||||||
|
Copyright (C) 1996 Free Software Foundation, Inc.
|
||||||
|
|
||||||
|
Author: Felipe A. Rodriguez <far@ix.netcom.com>
|
||||||
|
Date: Sept 1998
|
||||||
|
|
||||||
|
This file is part of the GNUstep GUI Library.
|
||||||
|
|
||||||
|
This library is free software; you can redistribute it and/or
|
||||||
|
modify it under the terms of the GNU Library General Public
|
||||||
|
License as published by the Free Software Foundation; either
|
||||||
|
version 2 of the License, or (at your option) any later version.
|
||||||
|
|
||||||
|
This library is distributed in the hope that it will be useful,
|
||||||
|
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||||
|
Library General Public License for more details.
|
||||||
|
|
||||||
|
You should have received a copy of the GNU Library General Public
|
||||||
|
License along with this library; 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_NSFileWrapper
|
||||||
|
#define _GNUstep_H_NSFileWrapper
|
||||||
|
|
||||||
|
|
||||||
|
@class NSImage;
|
||||||
|
@class NSFont;
|
||||||
|
@class NSString;
|
||||||
|
|
||||||
|
@interface NSFileWrapper : NSObject
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
//
|
||||||
|
// Initialization
|
||||||
|
//
|
||||||
|
// Init instance of directory type
|
||||||
|
- (id)initDirectoryWithFileWrappers:(NSDictionary *)docs;
|
||||||
|
|
||||||
|
// Init instance of regular file type
|
||||||
|
- (id)initRegularFileWithContents:(NSData *)data;
|
||||||
|
|
||||||
|
// Init instance of symbolic link type
|
||||||
|
- (id)initSymbolicLinkWithDestination:(NSString *)path;
|
||||||
|
|
||||||
|
// Init an instance from the file,
|
||||||
|
// directory, or symbolic link at path.
|
||||||
|
// This can create a tree of instances
|
||||||
|
- (id)initWithPath:(NSString *)path; // with a directory instance at the top
|
||||||
|
|
||||||
|
// Init an instance from data in std
|
||||||
|
// serial format. Serial format is the
|
||||||
|
// same as that used by NSText's
|
||||||
|
// RTFDFromRange: method. This can
|
||||||
|
// create a tree of instances with a
|
||||||
|
// directory instance at the top
|
||||||
|
- (id)initWithSerializedRepresentation:(NSData *)data;
|
||||||
|
|
||||||
|
//
|
||||||
|
// General methods
|
||||||
|
// // write instace to disk
|
||||||
|
- (BOOL)writeToFile:(NSString *)path // at path. if directory
|
||||||
|
atomically:(BOOL)atomicFlag // type this method is
|
||||||
|
updateFilenames:(BOOL)updateFilenamesFlag; // recursive, if flag is
|
||||||
|
// YES the wrapper will be
|
||||||
|
// updated with the name
|
||||||
|
// used in writing the file
|
||||||
|
- (NSData *)serializedRepresentation;
|
||||||
|
|
||||||
|
- (void)setFilename:(NSString *)filename;
|
||||||
|
- (NSString *)filename;
|
||||||
|
|
||||||
|
- (void)setPreferredFilename:(NSString *)filename;
|
||||||
|
- (NSString *)preferredFilename;
|
||||||
|
|
||||||
|
- (void)setFileAttributes:(NSDictionary *)attributes;
|
||||||
|
- (NSDictionary *)fileAttributes;
|
||||||
|
|
||||||
|
- (BOOL)isRegularFile;
|
||||||
|
- (BOOL)isDirectory;
|
||||||
|
- (BOOL)isSymbolicLink;
|
||||||
|
|
||||||
|
- (void)setIcon:(NSImage *)icon;
|
||||||
|
- (NSImage *)icon;
|
||||||
|
|
||||||
|
- (BOOL)needsToBeUpdatedFromPath:(NSString *)path;
|
||||||
|
- (BOOL)updateFromPath:(NSString *)path;
|
||||||
|
|
||||||
|
//
|
||||||
|
// Directory type methods
|
||||||
|
//
|
||||||
|
- (NSString *)addFileWrapper:(NSFileWrapper *)doc; // methods for use
|
||||||
|
- (void)removeFileWrapper:(NSFileWrapper *)doc; // with directory
|
||||||
|
- (NSDictionary *)fileWrappers; // type instances
|
||||||
|
- (NSString *)keyForFileWrapper:(NSFileWrapper *)doc; // types they raise
|
||||||
|
- (NSString *)addFileWithPath:(NSString *)path; // an exception.
|
||||||
|
- (NSString *)addRegularFileWithContents:(NSData *)data
|
||||||
|
preferredFilename:(NSString *)filename;
|
||||||
|
- (NSString *)addSymbolicLinkWithDestination:(NSString *)path
|
||||||
|
preferredFilename:(NSString *)filename;
|
||||||
|
|
||||||
|
//
|
||||||
|
// Regular file type methods
|
||||||
|
//
|
||||||
|
- (NSData *)regularFileContents;
|
||||||
|
|
||||||
|
//
|
||||||
|
// Symbolic link type methods
|
||||||
|
//
|
||||||
|
- (NSString *)symbolicLinkDestination;
|
||||||
|
|
||||||
|
@end
|
||||||
|
|
||||||
|
#endif // _GNUstep_H_NSFileWrapper
|
|
@ -80,7 +80,6 @@ typedef enum _NSSelectionAffinity
|
||||||
@interface NSText : NSView <NSChangeSpelling,NSIgnoreMisspelledWords,NSCoding>
|
@interface NSText : NSView <NSChangeSpelling,NSIgnoreMisspelledWords,NSCoding>
|
||||||
{
|
{
|
||||||
id delegate;
|
id delegate;
|
||||||
NSString *text_contents;
|
|
||||||
unsigned int alignment;
|
unsigned int alignment;
|
||||||
BOOL is_editable;
|
BOOL is_editable;
|
||||||
BOOL is_rich_text;
|
BOOL is_rich_text;
|
||||||
|
@ -105,6 +104,12 @@ typedef enum _NSSelectionAffinity
|
||||||
NSMutableAttributedString *rtfContent;
|
NSMutableAttributedString *rtfContent;
|
||||||
NSCharacterSet *selectionWordGranularitySet;
|
NSCharacterSet *selectionWordGranularitySet;
|
||||||
NSCharacterSet *selectionParagraphGranularitySet;
|
NSCharacterSet *selectionParagraphGranularitySet;
|
||||||
|
|
||||||
|
id lineLayoutInformation;
|
||||||
|
NSMutableDictionary *typingAttributes;
|
||||||
|
float currentCursorX;
|
||||||
|
BOOL displayDisabled;
|
||||||
|
int spellCheckerDocumentTag;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -65,6 +65,7 @@ NSDataLinkPanel.m \
|
||||||
NSDPSContext.m \
|
NSDPSContext.m \
|
||||||
NSEPSImageRep.m \
|
NSEPSImageRep.m \
|
||||||
NSEvent.m \
|
NSEvent.m \
|
||||||
|
NSFileWrapper.m \
|
||||||
NSFont.m \
|
NSFont.m \
|
||||||
NSFontManager.m \
|
NSFontManager.m \
|
||||||
NSFontPanel.m \
|
NSFontPanel.m \
|
||||||
|
@ -148,6 +149,7 @@ AppKit/NSDataLinkPanel.h \
|
||||||
AppKit/NSDragging.h \
|
AppKit/NSDragging.h \
|
||||||
AppKit/NSEPSImageRep.h \
|
AppKit/NSEPSImageRep.h \
|
||||||
AppKit/NSEvent.h \
|
AppKit/NSEvent.h \
|
||||||
|
AppKit/NSFileWrapper.h \
|
||||||
AppKit/NSFont.h \
|
AppKit/NSFont.h \
|
||||||
AppKit/NSFontManager.h \
|
AppKit/NSFontManager.h \
|
||||||
AppKit/NSFontPanel.h \
|
AppKit/NSFontPanel.h \
|
||||||
|
|
219
Source/NSFileWrapper.m
Normal file
219
Source/NSFileWrapper.m
Normal file
|
@ -0,0 +1,219 @@
|
||||||
|
/*
|
||||||
|
NSFileWrapper.m
|
||||||
|
|
||||||
|
NSFileWrapper objects hold a file's contents in dynamic memory.
|
||||||
|
|
||||||
|
Copyright (C) 1996 Free Software Foundation, Inc.
|
||||||
|
|
||||||
|
Author: Felipe A. Rodriguez <far@ix.netcom.com>
|
||||||
|
Date: Sept 1998
|
||||||
|
|
||||||
|
This file is part of the GNUstep GUI Library.
|
||||||
|
|
||||||
|
This library is free software; you can redistribute it and/or
|
||||||
|
modify it under the terms of the GNU Library General Public
|
||||||
|
License as published by the Free Software Foundation; either
|
||||||
|
version 2 of the License, or (at your option) any later version.
|
||||||
|
|
||||||
|
This library is distributed in the hope that it will be useful,
|
||||||
|
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||||
|
Library General Public License for more details.
|
||||||
|
|
||||||
|
You should have received a copy of the GNU Library General Public
|
||||||
|
License along with this library; see the file COPYING.LIB.
|
||||||
|
If not, write to the Free Software Foundation,
|
||||||
|
59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||||
|
*/
|
||||||
|
|
||||||
|
#include <gnustep/gui/config.h>
|
||||||
|
|
||||||
|
#include <AppKit/NSFileWrapper.h>
|
||||||
|
#include <AppKit/NSFont.h>
|
||||||
|
|
||||||
|
|
||||||
|
@implementation NSFileWrapper
|
||||||
|
|
||||||
|
//
|
||||||
|
// Initialization
|
||||||
|
//
|
||||||
|
// Init instance of directory type
|
||||||
|
- (id)initDirectoryWithFileWrappers:(NSDictionary *)docs
|
||||||
|
{
|
||||||
|
return nil;
|
||||||
|
}
|
||||||
|
// Init instance of regular file type
|
||||||
|
- (id)initRegularFileWithContents:(NSData *)data
|
||||||
|
{
|
||||||
|
return nil;
|
||||||
|
}
|
||||||
|
// Init instance of symbolic link type
|
||||||
|
- (id)initSymbolicLinkWithDestination:(NSString *)path
|
||||||
|
{
|
||||||
|
return nil;
|
||||||
|
}
|
||||||
|
// Init an instance from the file,
|
||||||
|
// directory, or symbolic link at path.
|
||||||
|
// This can create a tree of instances
|
||||||
|
- (id)initWithPath:(NSString *)path // with a directory instance at the top
|
||||||
|
{
|
||||||
|
return nil;
|
||||||
|
}
|
||||||
|
// Init an instance from data in std
|
||||||
|
// serial format. Serial format is the
|
||||||
|
// same as that used by NSText's
|
||||||
|
// RTFDFromRange: method. This can
|
||||||
|
// create a tree of instances with a
|
||||||
|
// directory instance at the top
|
||||||
|
- (id)initWithSerializedRepresentation:(NSData *)data
|
||||||
|
{
|
||||||
|
return nil;
|
||||||
|
}
|
||||||
|
|
||||||
|
//
|
||||||
|
// General methods
|
||||||
|
// // write instace to disk
|
||||||
|
- (BOOL)writeToFile:(NSString *)path // at path. if directory
|
||||||
|
atomically:(BOOL)atomicFlag // type, this method is
|
||||||
|
updateFilenames:(BOOL)updateFilenamesFlag // recursive, if flag is
|
||||||
|
{ // YES the wrapper will be
|
||||||
|
return NO; // updated with the name
|
||||||
|
} // used in writing the file
|
||||||
|
|
||||||
|
- (NSData *)serializedRepresentation
|
||||||
|
{
|
||||||
|
return nil;
|
||||||
|
}
|
||||||
|
|
||||||
|
- (void)setFilename:(NSString *)filename
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
- (NSString *)filename
|
||||||
|
{
|
||||||
|
return nil;
|
||||||
|
}
|
||||||
|
|
||||||
|
- (void)setPreferredFilename:(NSString *)filename
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
- (NSString *)preferredFilename;
|
||||||
|
{
|
||||||
|
return nil;
|
||||||
|
}
|
||||||
|
|
||||||
|
- (void)setFileAttributes:(NSDictionary *)attributes
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
- (NSDictionary *)fileAttributes
|
||||||
|
{
|
||||||
|
return nil;
|
||||||
|
}
|
||||||
|
|
||||||
|
- (BOOL)isRegularFile
|
||||||
|
{
|
||||||
|
return NO;
|
||||||
|
}
|
||||||
|
|
||||||
|
- (BOOL)isDirectory
|
||||||
|
{
|
||||||
|
return NO;
|
||||||
|
}
|
||||||
|
|
||||||
|
- (BOOL)isSymbolicLink
|
||||||
|
{
|
||||||
|
return NO;
|
||||||
|
}
|
||||||
|
|
||||||
|
- (void)setIcon:(NSImage *)icon
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
- (NSImage *)icon;
|
||||||
|
{
|
||||||
|
return nil;
|
||||||
|
}
|
||||||
|
|
||||||
|
- (BOOL)needsToBeUpdatedFromPath:(NSString *)path
|
||||||
|
{
|
||||||
|
return NO;
|
||||||
|
}
|
||||||
|
|
||||||
|
- (BOOL)updateFromPath:(NSString *)path
|
||||||
|
{
|
||||||
|
return NO;
|
||||||
|
}
|
||||||
|
|
||||||
|
//
|
||||||
|
// Directory type methods
|
||||||
|
//
|
||||||
|
- (NSString *)addFileWrapper:(NSFileWrapper *)doc
|
||||||
|
{
|
||||||
|
return nil;
|
||||||
|
}
|
||||||
|
|
||||||
|
- (void)removeFileWrapper:(NSFileWrapper *)doc
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
- (NSDictionary *)fileWrappers;
|
||||||
|
{
|
||||||
|
return nil;
|
||||||
|
}
|
||||||
|
|
||||||
|
- (NSString *)keyForFileWrapper:(NSFileWrapper *)doc
|
||||||
|
{
|
||||||
|
return nil;
|
||||||
|
}
|
||||||
|
|
||||||
|
- (NSString *)addFileWithPath:(NSString *)path
|
||||||
|
{
|
||||||
|
return nil;
|
||||||
|
}
|
||||||
|
|
||||||
|
- (NSString *)addRegularFileWithContents:(NSData *)data
|
||||||
|
preferredFilename:(NSString *)filename
|
||||||
|
{
|
||||||
|
return nil;
|
||||||
|
}
|
||||||
|
|
||||||
|
- (NSString *)addSymbolicLinkWithDestination:(NSString *)path
|
||||||
|
preferredFilename:(NSString *)filename
|
||||||
|
{
|
||||||
|
return nil;
|
||||||
|
}
|
||||||
|
|
||||||
|
//
|
||||||
|
// Regular file type methods
|
||||||
|
//
|
||||||
|
- (NSData *)regularFileContents
|
||||||
|
{
|
||||||
|
return nil;
|
||||||
|
}
|
||||||
|
|
||||||
|
//
|
||||||
|
// Symbolic link type methods
|
||||||
|
//
|
||||||
|
- (NSString *)symbolicLinkDestination
|
||||||
|
{
|
||||||
|
return nil;
|
||||||
|
}
|
||||||
|
|
||||||
|
//
|
||||||
|
// Archiving
|
||||||
|
//
|
||||||
|
- (void)encodeWithCoder:aCoder
|
||||||
|
{
|
||||||
|
[super encodeWithCoder:aCoder];
|
||||||
|
}
|
||||||
|
|
||||||
|
- initWithCoder:aDecoder
|
||||||
|
{
|
||||||
|
[super initWithCoder:aDecoder];
|
||||||
|
|
||||||
|
return self;
|
||||||
|
}
|
||||||
|
|
||||||
|
@end
|
1803
Source/NSText.m
1803
Source/NSText.m
File diff suppressed because it is too large
Load diff
|
@ -59,11 +59,14 @@
|
||||||
|
|
||||||
// container may be nil
|
// container may be nil
|
||||||
- initWithFrame:(NSRect)frameRect textContainer:(NSTextContainer *)container
|
- initWithFrame:(NSRect)frameRect textContainer:(NSTextContainer *)container
|
||||||
{ if(container) [self setTextContainer: container];
|
{
|
||||||
|
// self=[super initWithFrame:frameRect];
|
||||||
|
[super initWithFrame:frameRect];
|
||||||
|
|
||||||
|
if(container) [self setTextContainer: container];
|
||||||
else // set up a new container
|
else // set up a new container
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
self=[super initWithFrame:frameRect];
|
|
||||||
return self;
|
return self;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
15
Tools/gpbs.m
15
Tools/gpbs.m
|
@ -49,13 +49,18 @@
|
||||||
#include "PasteboardServer.h"
|
#include "PasteboardServer.h"
|
||||||
|
|
||||||
#include <signal.h>
|
#include <signal.h>
|
||||||
|
// dummy definitions provided here to
|
||||||
BOOL
|
BOOL // avoid errors when not linking with
|
||||||
initialize_gnustep_backend(void)
|
initialize_gnustep_backend(void) // a back end
|
||||||
{
|
{
|
||||||
/* Dummy replacement for the xdps function */
|
return YES; // dummy define
|
||||||
return YES;
|
|
||||||
}
|
}
|
||||||
|
void NSHighlightRect(NSRect aRect) // dummy define
|
||||||
|
{}
|
||||||
|
void NSRectFill(NSRect aRect) // dummy define
|
||||||
|
{}
|
||||||
|
void NSBeep(void) // dummy define
|
||||||
|
{}
|
||||||
|
|
||||||
@interface GMModel: NSObject
|
@interface GMModel: NSObject
|
||||||
{
|
{
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue