ftp.nice.ch/pub/next/tools/dock/Locus.1.0.NI.bs.tar.gz#/Locus/Source/ItemCell.h

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

/*
	Copyright 1993  Jeremy Slade.  All rights reserved.
*/

/*
	Project: Locus
	
	Class: ItemCell
	
	Description: 

	Original Author: Jeremy Slade
	
	Revision History:
		Created
			V.101	JGS Mon Feb  8 22:33:12 GMT-0700 1993


*/


#ifndef ItemCell_h
#define ItemCell_h

#define ItemCell_VERSION 		(101)


#import <appkit/Cell.h>
#import <appkit/NXImage.h>
#import <objc/HashTable.h>
#import <sys/param.h>
#import <sys/types.h>
#import <time.h>


// File types ( fileType instance variable ) ----------------------------
#define FT_UNKNOWN			0
#define FT_APPLICATION		1
#define FT_FILE				2
#define FT_SUBDIR			3


// -----------------------------------------------------------------
//   Drawing Flags
// -----------------------------------------------------------------

typedef struct {

	// General flags;
	ushort mode;			// Current drawing mode
	BOOL actualImage;		// Show Actual Image
	
	// Large Browse mode
	BOOL lb_tridots;		// Show tridots for non-running apps
	ushort lb_nameMode;		// Name mode -- eight possibilities
	BOOL lb_info1;			// Show info line 1
	BOOL lb_info2;			// Show info line 2
	
	// Small Browse mode
	BOOL sb_icon;			// Show icon in Small Browser mode
	ushort sb_nameMode;		// Name mode
	
	// Large Icon mode
	BOOL li_showName;		// Show name
	
	// Small Icon mode
	BOOL si_showName;		// Show name
	
} DrawInfo;
#define DrawInfoTypeString	"{SccScccScc}"


// Draw Modes ----------------------------------------------------------
#define IC_DRAW_UNKNOWN		0
#define IC_LARGE_BROWSE		1
#define IC_SMALL_BROWSE		2
#define IC_LARGE_ICON		3
#define IC_SMALL_ICON		4
extern const char *ICModeTitles[];

// Name Formats (for Browse modes) --------------------------------
#define IC_NAME_UNKNOWN		0
#define IC_FULLPATH			1
#define IC_FILEANDPATH		2
#define IC_FILEONLY			3
#define IC_RELATIVE			4
#define IC_NOPATH			5
extern const char *ICFormatTitles[];


@interface ItemCell : Cell
{
	char *path;			// Path specifier
	char *fileStr;			// Formatted string for path
	unsigned short fileType;
	
	// ItemCell flags
	BOOL	isAutoLaunch;
	BOOL	isGroupLaunch;
	BOOL	specificApp;
	BOOL	createBrowser;
	BOOL	hideIcon;
	BOOL	dynamic;
	BOOL	needsUpdate;

	NXPoint		largeIconLoc;	// Location for Icon in Large Icon mode
	NXPoint		smallIconLoc;	// Location for Icon in Small Icon mode

	char 		*appName;	// Application used to open it
	char		*rootAt;	// Path to root new browser at
	
	NXImage	*image;			// Image supplied by Workspace
	NXImage	*actualImage;	// Actual contents of image Items
	NXImage	*smallImage;	// 1/4 size icon
	
	id	group; // The group it belongs to

}

// Creating, intializing instances
+ initialize;
- init;
- initPath:(const char*)aPath;
- free;

// Drawing
+ setDrawInfo:(const DrawInfo *)info;
+ getDrawInfo:(DrawInfo *)info;
+ (int)drawMode;
- calcCellSize:(NXSize *)theSize;
- drawSelf:(const NXRect *)cellFrame inView:controlView;
- drawInside:(const NXRect *)cellFrame inView:controlView;
- highlight:(const NXRect *)cellFrame inView:controlView lit:(BOOL)flag;
- (BOOL)needsUpdate;
- (int)state;

// Tracking
- (BOOL)mouseDownAt:(const NXPoint *)startPt
	frame:(const NXRect *)cellFrame
	inView:controlView;

// Setting Attributes
- setPath:(const char *)aPath;
- resetFileStr;
- setAutoLaunch:(BOOL)flag;
- setGroupLaunch:(BOOL)flag;
- getInfo;
- getIcon;
- (const char *)path;
- (int)fileType;
- (const char *)fileStr;
- (const char *)filename;
- (BOOL)isAutoLaunch;
- (BOOL)isGroupLaunch;
- (NXImage *)image;
- (NXImage *)smallImage;

// Group
- group;
- setGroup:aGroup;

// File-type Items
- setAppName:(const char *)aString;
- (const char *)appName;
- (BOOL)hasSpecificApp;

// Subdir-type Items
- setCreateBrowser:(BOOL)flag;
- rootBrowserAt:(const char*)fullpath;
- (BOOL)createBrowser;
- (const char *)browserRootedAt;

// App-type Items
- setHideIcon:(BOOL)flag;
- (BOOL)hideIcon;

// Dynamic Items
- setDynamic:(BOOL)flag;
- (BOOL)isDynamic;

// Launching
- (BOOL)launch;

// Archiving
- awake;
- read:(NXTypedStream *)stream;
- write:(NXTypedStream *)stream;

@end

#endif // ItemCell_h

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