#import "PBNames.h"

@implementation PBNames
+ new
{	static id pbNames;	// HashTable: NXAtom -> NXAtom

	if (! pbNames)
	{	pbNames = [[self alloc] initKeyDesc:"%" valueDesc:"%"];

#define add(a,b) [pbNames insertKey:NXUniqueString(#a) value:(void *)b], \
		 [pbNames insertKey:NXUniqueString(#b) value:(void *)b]

		add(drag, NXDragPboard);
		add(find, NXFindPboard);
		add(font, NXFontPboard);
		add(ruler, NXRulerPboard);

#undef add
	}
	return pbNames;
}
- (NXAtom)key:(const char *)name
{	NXAtom result = [self valueForKey:NXUniqueString(name)];

	return result ? result : NXGeneralPboard;
}
@end
