ftp.nice.ch/pub/next/graphics/vector/Wood.0.72.s.tar.gz#/Wood/Sources/Tree.h

This is Tree.h in view mode; [Download] [Up]

#import <appkit/appkit.h>
#import <soundkit/Sound.h>
#import <misckit/SearchableText.h>

#import "UPath.h"
#import "HitPath.h"

#define RECT_NODETYPE			0
#define ROUNDRECT_NODETYPE		1
#define ELLIPSE_NODETYPE		2
#define RHOMB_NODETYPE			3
#define HEXAGON_NODETYPE		4

#define ENDING_NONE		0
#define ENDING_ARROW	1
#define ENDING_HOLLOW	2
#define ENDING_DOUBLE	3
#define ENDING_SOLID	4
#define ENDING_CIRCLE	5

#define UPDATE_NONE				0x0
#define UPDATE_TREEVIEW			0x1
#define UPDATE_TEXTVIEW			0x2
#define CHECK_RESIZE			0x4
#define SCROLL_TREEVIEW			0x8
#define UPDATE_ALL		(UPDATE_TREEVIEW | UPDATE_TEXTVIEW | CHECK_RESIZE)

@protocol TreeDelegate

- updateViewsDirty:(BOOL)aBool rect:(NXRect *)aRect flag:(int)aFlag;
- tree;
- declareSelection:aNode;
- (float)docScale;
- setDocScale:(float)aScale;
- currentNode;
- (BOOL)showMarker;
- undoManager;

@end

typedef struct _LINE {
     NXCoord dx,dy;
     struct _LINE *link;
} Polyline;

typedef struct _POLYGON {
     struct {
	Polyline *head,*tail;
     } lower,upper;
} Polygon;

typedef struct _PROPERTIES {
	NXCoord border,parentDistance;
	int zipped,shadow,fill,outline;
	id font;
	int pathKind,linkKind;
	NXColor fillColor,outlineColor,textColor,shadowColor;
	float linewidth;
	float biegFactor;
	char *defaultNodeName;
	int ending, parentEnding;
} Properties;

typedef struct _DRAWSTATE {
	float linewidth;
	NXColor color;
	id font;
} DrawState;	

typedef struct _TEXTPLACER {
	float rect[2];
	float roundRect[3];
	float ellipse[2];
	float rhomb[2];
	float hexagon[3];
} TextPlacer;


@interface Tree:Object
{
    Tree *parent,*child,*sibling;
    NXCoord width,height,border,parentDistance,linewidth;
    NXPoint pos,offset,deltaText,deltaLink,deltaShadow;
    Polygon contour;
    //BOOL zipped,updateLayout,shadow,outline,fill,selected;
	int zipped,updateLayout,shadow,outline,fill,selected;
	id nodeDescription;
	UPath *gpath;
	id delegate;
	int pathKind,linkKind;
	float biegFactor;
	int ending, parentEnding;
	NXColor fillColor,outlineColor,shadowColor;
	TextPlacer placer;
	NXDataLink *verknuepfung;
	//BOOL hasVerknuepfung;
	int hasVerknuepfung;
	Sound *geraeusch;
	//BOOL hasSound;
	int hasSound;
	TextFieldCell *textCell;
	NXRect textCellFrame;
	unsigned dgVertexNr[4], dgSymbolNr;
}

// creating and destroying
- initLabel:(const char *)aLabel props:(Properties *)aProps;
- free;
- copyFromZone:(NXZone *)zone;

// layout and drawing
- involved:(const NXRect *)aRect addTo:aList link:aPath;
- getBounds:(NXRect *)rect;
- getTreeBounds:(NXRect *)rect 
  lowerWidth:(NXCoord *)lowW lowerHeight:(NXCoord *)lowH;
- hit:(HitPath *)hitUPath;
- hitAttachment:(const NXPoint *)aPoint :(BOOL *)theAttach;
- activateAttachment:(NXEvent *)event inView:aView;
- activateSound:(NXEvent *)event inView:aView;
- drawNodeShadow:(DrawState *)aState;
- drawNodeFill:(DrawState *)aState;
- drawNodeOutline:(DrawState *)aState knobs:(BOOL)aBool;
- drawNodeEnding:(DrawState *)aState;
- drawNodeCellsInView:aView attachments:(BOOL)aBool;
- setOffset:(NXCoord)aX :(NXCoord)aY;
- (NXCoord)width;
- (NXCoord)height;
- (Polygon *)contour;
- layout;
- getTextFrame:(NXRect *)aRect;

// tree data structure manipulation
- sibling;
- child;
- parent;
- addTree:(Tree *)aTree;
- removeChild:(Tree *)aChild;
- insertTree:(Tree *)aTree at:(int)aPos;

//properties
- attachFile:(const char *)aFileName;
- breakAttachment;
- (BOOL)attached;
- attachSound:(const char *)aSoundName;
- breakSound;
- (BOOL)hasSound;
- attachedSound;
- setSound:aSound;
- applyStyleToSubtree;
- promoteProps:(Properties *)aProps;
- getProps:(Properties *)aProps;
- changeTo:(Properties *)aProps;

// tree properties
- (NXCoord)border;
- setBorder:(NXCoord)aBorder;
- (NXCoord)parentDistance;
- setParentDistance:(NXCoord)aParentDistance;
- (BOOL)shadow;
- setShadow:(BOOL)aShadow;
- (int)linkKind;
- setLinkKind:(int)aLinkKind;
- changeLinkKind;
- (float)biegFactor;
- setBiegFactor:(float)aBiegFactor;
- (NXColor)shadowColor;
- setShadowColor:(NXColor)aColor;

// node properties
- (const char *)label;
- setLabel:(const char *)aLabel;
- setRTFDescription:(const char *)aDescription;
- setDescription:(const char *)aDescription;
- changeDescriptionFrom:aTextView;
- putDescriptionIn:aTextView;
- (int)pathKind;
- setPathKind:(int)aPathKind;
- (BOOL)outline;
- setOutline:(BOOL)aOutline;
- font;
- changeFont:sender;
- (NXColor)fillColor;
- setFillColor:(NXColor)aColor;
- (NXColor)outlineColor;
- setOutlineColor:(NXColor)aColor;
- (NXColor)textColor;
- setTextColor:(NXColor)aColor;
- (float)linewidth;
- setLinewidth:(float)aLinewidth;
- (BOOL)zipped;
- changeZipped;
- (int)ending;
- setEnding:(int)aEnding;
- (int)parentEnding;
- setParentEnding:(int)aEnding;

// misc
- (BOOL)selected;
- setSelected:(BOOL)aBOOL;
- setUpdateLayout:(BOOL)aBool;
- positionFrom:(const NXPoint *)aPoint;
- setPositionTo:(const NXPoint *)aPoint;
- linkPoint:(NXPoint *)aPoint;
- linkParentPoint:(NXPoint *)aPoint;
- linkChildPoint:(NXPoint *)aPoint;
- delegate;
- setDelegate:aDelegate;
- setDelegateRecursive:aDelegate;
- textDidEnd:textObject endChar:(unsigned short)endChar;

// streaming to diagram2 format
- (unsigned)dgSymbolNr;
- dgWriteSymbol:(NXStream *)stream buffer:(char *)buffer filename:(const char *)aName;
- dgWriteVertex:(NXStream *)stream buffer:(char *)buffer;
- dgWriteLine:(NXStream *)stream buffer:(char *)buffer;
+ saveToD2Tree:aTree fromView:aView toFile:(const char *)aFile printInfo:aPrintInfo;
+ (unsigned)dgNextNr;

// streaming 
- writeStyleToPBStream:(NXTypedStream *)stream;
- readStyleFromPBStream:(NXTypedStream *)stream;
- writeToPBStream:(NXTypedStream *)stream;
- writeToMMAPB:(NXStream *)stream; 
- write:(NXTypedStream *)stream;
- read:(NXTypedStream *)stream;
- awake;

// SearchableText support
- searchTreeFor:(const char *)pattern untilNode:endNode 
  reverse:(BOOL)rev regexpr:(BOOL)regexpr cases:(BOOL)cases position:(int *)positionS size:(int *)sizeS;
- replaceTreeFor:(const char *)pattern with:(const char *)replacement untilNode:endNode 
  regexpr:(BOOL)regexpr cases:(BOOL)cases result:(int *)result;    
- nextInDepth;
- previousInDepth;
- lastInDepth;
- (BOOL)replaceLabelSelectionWith:(const char *)replacement pos:(int)aPos size:(int)aSize;
  
@end



These are the contents of the former NiCE NeXT User Group NeXTSTEP/OpenStep software archive, currently hosted by Netfuture.ch.