1995-05-05 21:16:49 +00:00
|
|
|
/* Interface for NSBitmapCharSet for GNUStep
|
|
|
|
Copyright (C) 1995 Free Software Foundation, Inc.
|
1995-07-01 19:01:11 +00:00
|
|
|
|
|
|
|
Written by: Adam Fedor <fedor@boulder.colorado.edu>
|
|
|
|
Date: 1995
|
|
|
|
|
1996-05-12 00:56:10 +00:00
|
|
|
This file is part of the GNUstep Base Library.
|
1995-05-05 21:16:49 +00:00
|
|
|
|
|
|
|
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; if not, write to the Free
|
1999-09-09 02:56:20 +00:00
|
|
|
Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111 USA.
|
1995-05-05 21:16:49 +00:00
|
|
|
*/
|
|
|
|
|
1996-04-17 19:36:35 +00:00
|
|
|
#ifndef __NSBitmapCharSet_h_GNUSTEP_BASE_INCLUDE
|
|
|
|
#define __NSBitmapCharSet_h_GNUSTEP_BASE_INCLUDE
|
1995-05-05 21:16:49 +00:00
|
|
|
|
|
|
|
#include <Foundation/NSCharacterSet.h>
|
|
|
|
#include <Foundation/NSData.h>
|
|
|
|
|
2004-06-22 22:27:39 +00:00
|
|
|
//PENDING: may want to make these less likely to conflict
|
1995-05-05 21:16:49 +00:00
|
|
|
#define UNICODE_SIZE 65536
|
|
|
|
#define BITMAP_SIZE UNICODE_SIZE/8
|
|
|
|
|
|
|
|
#ifndef SETBIT
|
|
|
|
#define SETBIT(a,i) ((a) |= 1<<(i))
|
|
|
|
#define CLRBIT(a,i) ((a) &= ~(1<<(i)))
|
|
|
|
#define ISSET(a,i) ((((a) & (1<<(i)))) > 0) ? YES : NO;
|
|
|
|
#endif
|
|
|
|
|
2004-06-22 22:27:39 +00:00
|
|
|
/**
|
|
|
|
* An [NSCharacterSet] that stores the set of unicode characters in it as a
|
|
|
|
* simple bitmap. Implementation is very efficient.
|
|
|
|
*/
|
1995-05-05 21:16:49 +00:00
|
|
|
@interface NSBitmapCharSet : NSCharacterSet
|
|
|
|
{
|
1999-09-16 07:21:34 +00:00
|
|
|
char _data[BITMAP_SIZE];
|
1995-05-05 21:16:49 +00:00
|
|
|
}
|
|
|
|
|
2004-06-22 22:27:39 +00:00
|
|
|
/**
|
|
|
|
* Init directly with bitmap data. bitmap should be <code>BITMAP_SIZE</code>
|
|
|
|
* long, which is currently 2^16 / 8.
|
|
|
|
*/
|
1999-09-16 07:21:34 +00:00
|
|
|
- (id) initWithBitmap: (NSData*)bitmap;
|
1995-05-05 21:16:49 +00:00
|
|
|
|
|
|
|
@end
|
|
|
|
|
2004-06-22 22:27:39 +00:00
|
|
|
/**
|
|
|
|
* Mutable version of [NSBitmapCharSet].
|
|
|
|
*/
|
1995-05-05 21:16:49 +00:00
|
|
|
@interface NSMutableBitmapCharSet : NSMutableCharacterSet
|
|
|
|
{
|
1999-09-16 07:21:34 +00:00
|
|
|
char _data[BITMAP_SIZE];
|
1995-05-05 21:16:49 +00:00
|
|
|
}
|
|
|
|
|
2004-06-22 22:27:39 +00:00
|
|
|
/**
|
|
|
|
* Init directly with bitmap data. bitmap should be <code>BITMAP_SIZE</code>
|
|
|
|
* long, which is currently 2^16 / 8.
|
|
|
|
*/
|
1999-09-16 07:21:34 +00:00
|
|
|
- (id) initWithBitmap: (NSData*)bitmap;
|
1995-05-05 21:16:49 +00:00
|
|
|
|
|
|
|
@end
|
|
|
|
|
1996-04-17 19:36:35 +00:00
|
|
|
#endif /* __NSBitmapCharSet_h_GNUSTEP_BASE_INCLUDE */
|